<%--
  - Author(s)  : TC40335
  - Date       : 2024.10.14
  - Description: 구매_표준 미연동 계약서
  --%>
  
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
<%@ page import="com.udapsoft.waf.common.ui.*" %>
<%@ page import="com.udapsoft.waf.common.ui.InitCombo" %>
<%@ page import="kr.co.hsnc.common.util.*"%>
<%@ page import="kr.co.hsnc.common.sql.*" %>
<%@ page import="kr.co.udapsoft.common.code.CommCodeManager" %>
<%-- <%@ include file="/jsp/work/taglib.jsp" %>
<jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" /> --%>
<%
	

	//CommCodeManager commCodeManager = new CommCodeManager();
	
	RowSet pricesysGbRow = CommCodeManager.getCodeRowsetStatic("PRICE_SYS_GB");

	InitCombo initCombo3 = new InitCombo();
	initCombo3.makeComboData(CommCodeManager.getCodeRowsetStatic("PRICE_SYS_GB", "CHG_CODE01", "Y"), "DETAILNM", "DETAILCD");

	String PRICESYS_GB_CD = initCombo3.getCode();
	String PRICESYS_GB_NM = initCombo3.getCodeName();
	
%>
<SCRIPT language="JavaScript">
	/*예약함수*/
	var sheet4;
	var sheet4Row;
	var sheet4PageNo = 1;
	var pageLastRowIndex = 1;
	var validationResult = false;
	var filterShow = false;
	
	/* function _onReady(){
		
	} */
	
	/**
	 *	IBSheet object initialize
	 */
 	function gridInit4(sheetName){
		var init_sheet = {};
		init_sheet.Cfg = {SearchMode:2, Page:10};
		init_sheet.Cols = [
		       			{Header:'Del',						Type:"DelCheck",		SaveName:"DEL_CHECK", 			Width:20, 		Align:"Center", Edit:"false"},
		       			{Header:'Status',					Type:"Status", 			SaveName:"STATUS", 				Width:0, 		Align:"Center", Hidden:"true"},
		    			{Header:'계약서ID',					Type:"Text", 			SaveName:"PRICE_SYS_ID", 		Width:0, 		Align:"Center", Hidden:"true"},
		    			{Header:'하도급대금 연동 여부',				Type:"Combo", 			SaveName:"PRICE_SYS_YN",		Width:30, 		Align:"Center", Edit:"false", ComboText:"<%=PRICESYS_GB_NM%>", ComboCode:"<%=PRICESYS_GB_CD%>"},
		    			{Header:'미연동 대상 목적물 또는 물품 등의 명칭',		Type:"Text", 			SaveName:"OBJECT_NM",			Width:80, 		Align:"Center", Edit:"false"},
		    			{Header:'[수급사업자] 미연동 사유',			Type:"Text", 			SaveName:"SYS_REASON", 			Width:150, 		Align:"Center", Edit:"false", 	EditLen:"500"},
		    			{Header:'☞계약서',						Type:"Text", 			SaveName:"FILE_YN", 			Width:30, 		Align:"center", Edit:"false",	Cursor:'pointer'},
		    			{Header:'FILE_ID',					Type:"Text", 			SaveName:"FILE_ID", 			Width:0, 		Align:"center", Hidden:"true"},
		]; 
	
		init_sheet.HeaderMode = {Sort:1};
		IBS_InitSheet(sheetName, init_sheet);
		sheetName.SetDataAutoTrim(0);
		sheetName.SetImageList(1,"/img/buyer/button/bt_change.gif");
		if(jQuery("#STATUS_CD").val() == '50'){
			sheet4.SetEditable(0);
		}
		setGridSize4();
	} 
	
	function doSearchPricesys() {
		jQuery("#fevent").val("FORM_PRICESYS_SELECT");
		var url = Modular.model.PageContext.CONTEXT_ROOT + "/cont/purchase/PricesysList_sheet.screen";
		Modular.view.IBSheet7.doSearch(sheet4, url, jQuery("#form1"), 30, "");
	}
	function doSavePricesys() {
		jQuery("#fevent").val("SAVE_PRICESYS_LIST");
		var url = Modular.model.PageContext.CONTEXT_ROOT + "/cont/purchase/PricesysList_sheet.screen";
		Modular.view.IBSheet7.doSave(sheet4, url, jQuery("#form1"), false);
	}
	
	/**
	 *	IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
	 */
	function sheet4_OnSearchEnd(code, message) {
		var info = {Type: "Image"};

		if(code == 0) {
	    	setGridSize4();
			sheet4.SetColFontColor("FILE_YN", "#0000ff");
	    
	    	for(i=1; i <= sheet4.RowCount(); i++){
				if(sheet4.GetCellValue(i, "FILE_YN")!=""){
					sheet4.InitCellProperty(i, "FILE_YN", info);
				}
			}
		} else {
			//조회 에러 수행
			alert(message);
		}
	}
	 
	function pricesys_gb_chg() {
		if(jQuery("#p_pricesys_gb").val()=="00"||jQuery("#p_pricesys_gb").val()==""){
			jQuery("#btnPromiseAdd").hide();
		}else{
			jQuery("#btnPromiseAdd").show();	
		}
	}
	
	function sheet4_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
		 if(Row == 0)return;
		 if (sheet4.ColSaveName(Col) == "FILE_YN" && jQuery("#p_pricesys_gb").val() == '01') {
			 
		        var reportInfo = new ReportInfo();
	            reportInfo.title = "표준 미연동 계약서";
	            reportInfo.reportName = "/report/mrd/buyer/supplier/purchase/PurPricesysCont.mrd";
	            reportInfo.set($("#PUR_CONT_MOD_ID").val());    	// $1 contModId
		        reportInfo.width = 1500;                         	// Default: 1024
		        reportInfo.height = 800;                         	// Default: 768
				reportInfo.showPopup(); 
	     }
	 }
	
	
	/**
	 *	IBSheet size setting
	 */
	function setGridSize4() {sheet4.FitColWidth();}
	
	document.body.onresize = addEvent( document.body.onresize, "setGridSize4()"); 
</SCRIPT>


<div class="application-info  magT10">
	<div class="application-sub-title">
		<span class="title">표준 미연동 계약서</span>
	</div>
</div>
<!-- 검색조건 시작 -->
<table id="search-table" class="search-form-table">
  <tr height="25"> 
  	<td>연동제 구분:&nbsp;&nbsp;<%= HTMLMaker.getSelectTag(pricesysGbRow, "CODE", "NAME", "p_pricesys_gb", "style='width:100px;' ", "", ContInfo.get("PRICE_SYS_GB")) %></td>
  </tr>
</table>
<div id="sheet4_div" style="padding-top:5px; height: 157px; min-height: 157px; ">
	<script>createIBSheet('sheet4','100%', '157px'); gridInit4(sheet4);
	</script>
</div>
<iframe id="fileDown" name="fileDown" style="display:none"></iframe>

