<%--
  - Author(s)  : Hyung min Son
  - Date       : 2014.07.22
  - Description: 구매_기술문서검토 상세
  --%>
  
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %>
<%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
<%@ page import="com.udapsoft.waf.common.ui.*" %>
<%@ page import="kr.co.udapsoft.common.code.*" %>
<%@ page import="kr.co.hsnc.common.util.*"%>
<%@ page import="kr.co.hsnc.common.sql.*" %>
<%@ page import="com.udapsoft.waf.common.util.Formatter2"%>
<%@ page import="com.udapsoft.waf.common.util.StringUtils"%>
<%@ include file="/jsp/work/taglib.jsp" %>
<jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
<%
    ctx.init(request, response);
    HandlerStorage storage = ctx.getHandlerStorage();
    ValueObject params = storage.getParams();
    ValueObject user = storage.getUser();
    ValueObject Order = storage.getValueObject("Order");
    ValueObject filein = storage.getValueObject(Order.get("DOC_ETC_IN"));
    ValueObject fileout = storage.getValueObject(Order.get("DOC_ETC_OUT"));
    ValueObject filetot = storage.getValueObject(Order.get("TOT_FILE_GB"));
    RowSet Tbe_info = storage.getRowSet("TBE_INFO");
    boolean p_reason = false;
    boolean c_reason = false;
    boolean m_reason = false;
    boolean r_reason = false;
    if(Order.get("POSTPONE_REASON").length()> 0){
    	p_reason = true;
    }
    if(Order.get("CANCEL_REASON").length()> 0){
    	c_reason = true;
    }
    if(Order.get("MODIFY_REASON").length()> 0){
    	m_reason = true;
    }
    if(Order.get("RTN_REASON").length()> 0){
    	r_reason = true;
    }
    		
%>
<SCRIPT language="JavaScript">
	function _onReady(){
		 $("#btn_list").click(function() {
				$("#fevent").val("");
				$("#form1").attr("action", $("#p_list").val()); //"/bid/purchase/TBECheckList.screen");
				$("#form1").attr("target", "_self");
				$("#form1").attr("method", "post");
				$("#form1").submit();
		});
		 
		 
		 $("#btn_save").click(function() {//저장
			 	$("#TBE_FIN_STATUS_CD").val("02");//작성중 상태 업데이트
			 	var f = document.form1;
				if (confirm("저장 하시겠습니까?")){
					submitXmlRequest("/bid/purchase/TBECheck_form.screen", "SAVE", f, "SUCCESS");
				}
		 });
		 
		 $("#btn_tbe_fin").click(function() {//검토완료
			 var f = document.form1;
		 	 var success = true;
			  <%
			  	if(Tbe_info.size() > 0){
			  		for(int i=0;i < Tbe_info.size();i++){
			  %>
			  			var value = $(':radio[name="EVAL_RESULT_<%=Tbe_info.getRow(i).get("VENDOR_CD")%>"]:checked').val(); 
			  			if(value == null ||value == "" ||value == undefined){
			  				if("<%=Tbe_info.getRow(i).get("BID_RNNC_DT")%>" ==""){
				  				alert("평가결과는 필수입니다.");
				  				$(':radio[name="EVAL_RESULT_<%=Tbe_info.getRow(i).get("VENDOR_CD")%>"]').focus();
				  				return;
			  				}
			  			}
						if(value == "02"){
							if(<%=Tbe_info.size()%> != 1){
								if(f.EVAL_OPIN[<%=i%>].value == ""){
									alert("평가결과가 조건부 적합 또는 부적합일 경우 평가의견은 필수입니다.");
									f.EVAL_OPIN[<%=i%>].focus();
									return;
								}
							}else{
								if(f.EVAL_OPIN.value == ""){
									alert("평가결과가 조건부 적합 또는 부적합일 경우 평가의견은 필수입니다.");
									f.EVAL_OPIN.focus();
									return;
								}
							}
						}
						if(value == "03"){
							if(<%=Tbe_info.size()%> != 1){
								if(f.EVAL_OPIN[<%=i%>].value == ""){
									alert("평가결과가 조건부 적합 또는 부적합일 경우 평가의견은 필수입니다.");
									f.EVAL_OPIN[<%=i%>].focus();
									return;
								}
							}else{
								if(f.EVAL_OPIN.value == ""){
									alert("평가결과가 조건부 적합 또는 부적합일 경우 평가의견은 필수입니다.");
									f.EVAL_OPIN.focus();
									return;
								}
							}
						}
						if("<%=Tbe_info.getRow(i).get("STATUS_CD")%>" == "10"){
							success = false;
						}
		  		<%}%>
		 	<%}%>
		 	if(f.ONBID_YN_CD.value == "Y"){
			 	if(success){
			 		alert("검토 완료된 업체가 한 곳 이상이어야 합니다.");
			 		return;
			 	}
		 	}
		 	
		 	if(f.p_AttachFile3.value == ""){
		 		alert("종합의견 첨부파일은 필수입니다.");
				f.p_AttachFile3.focus();
				return;
		 	}
		 	if(f.TOT_OPIN.value == ""){
		 		alert("종합의견은 필수입니다.");
				f.TOT_OPIN.focus();
				return;
		 	}
		 	
				if (confirm("검토완료 하시겠습니까?")){
					$("#TBE_FIN_STATUS_CD").val("10");
					submitXmlRequest("/bid/purchase/TBECheck_form.screen", "TBE_FIN_SAVE", f, "SUCCESS");
				}
                
		 });
		 
		 // 검토 완료 인경우  버튼 숨김..
		 /* if(($("#STATUS_CD").val() == "06" || $("#TBE_STATUS_CD").val() == "10") && $("#ONBID_YN_CD").val() == "Y"){ */
		<%-- 	 
		if( $("#STATUS_CD").val() == "06" || $("#TBE_STATUS_CD").val() == "10" || '<%=user.get("ACCT_ID")%>' != '<%=Order.get("EVAL_EMPID")%>' ){
			 $("#btn_save").hide();
			 $("#btn_tbe_fin").hide();
			 $("#btnevalemp").hide();
			 $("#EVAL_TEL").attr("disabled",true);
			 $("#EVAL_EMAIL").attr("disabled",true);
		 }	 
		 --%>
		 
	    if($("#ONBID_YN_CD").val() == "Y" && ($("#STATUS_CD").val() == "06" || $("#TBE_STATUS_CD").val() == "10" || '<%=user.get("ACCT_ID")%>' != '<%=Order.get("EVAL_EMPID")%>')){
			 $("#btn_save").hide();
			 $("#btn_tbe_fin").hide();
			 $("#btnevalemp").hide();
			 $("#EVAL_TEL").attr("disabled",true);
			 $("#EVAL_EMAIL").attr("disabled",true);
		 }

		if($("#ONBID_YN_CD").val() == "N" &&( $("#TBE_STATUS_CD").val() == "10" || '<%=user.get("ACCT_ID")%>' != '<%=Order.get("EVAL_EMPID")%>' )){
			 $("#btn_save").hide();
			 $("#btn_tbe_fin").hide();
			 $("#btnevalemp").hide();
			 $("#EVAL_TEL").attr("disabled",true);
			 $("#EVAL_EMAIL").attr("disabled",true);
		 }
		 
		 
		 if("<%=Order.get("PBC_DEFECT_CONDI2")%>"!=""||"<%=Order.get("CBC_DEFECT_DAY2")%>"!=""||"<%=Order.get("CBC_DERECT_TERM_CD2")%>"!=""){
				$("#addGuar").attr("checked", true);
				$(".checkAdd").show();
			}
	}
	
	//첨부파일   
	function doAttachFile(obj,No) {
		var file_div = "bid/purchase/<%=Order.get("BID_NO")%>/TBE";
		var attch_yn = "N";
		
		if('<%=user.get("ACCT_ID")%>' == '<%=Order.get("EVAL_EMPID")%>'){
			attch_yn = "Y";
		}
		
		if(obj==''){
			 alert("After you have saved, you can attach a file.");
		}
		else if(obj != ''){ 
			if(No == 1){
				viewFileListNew('<%=Order.get("DOC_ETC_IN")%>', obj.value, document.form1.p_AttachFile1, "N", file_div);
			}else if(No == 2){
				viewFileListNew('<%=Order.get("DOC_ETC_OUT")%>', obj.value, document.form1.p_AttachFile2, "N", file_div);
			}else if(No == 3){
				if($("#TBE_STATUS_CD").val() == "10"){
					viewFileListNew('<%=Order.get("TOT_FILE_GB")%>', obj.value, document.form1.p_AttachFile3, "N", file_div);
				}else{
					viewFileListNew('<%=Order.get("TOT_FILE_GB")%>', obj.value, document.form1.p_AttachFile3, attch_yn, file_div);
				}
			}
		} 
	}
	//첨부파일   
	function doAttachFile_supp(obj,obj2,filegb) {
		var file_div = "bid/purchase/<%=Order.get("BID_NO")%>/TBE";
		if(obj==''){
			 alert("After you have saved, you can attach a file.");
		}else if(obj != ''){ 
			viewFileListNew(filegb, obj.value, obj2, "N", file_div);
		}
	}
	
	function doResult(resultObj) {
		try {
			if( resultObj.getRequestEvent() == "SAVE") {
				if( resultObj.getSuccess() ) {
					alert("저장 되었습니다.");
					page();
				}
				else {
					dlgErrorMsg(resultObj);
				}
			}
			
			if( resultObj.getRequestEvent() == "FILE_REQUEST") {
				if( resultObj.getSuccess() ) {
					alert("문서요청 하였습니다.");
					page();
				}
				else {
					dlgErrorMsg(resultObj);
				}
			}
			
			if( resultObj.getRequestEvent() == "TBE_FIN_SAVE") {
				if( resultObj.getSuccess() ) {
					alert("검토완료 처리 되었습니다.");
					$("#btn_list").click();
				}
				else {
					dlgErrorMsg(resultObj);
				}
			}
			
			
		} catch(errorObject) {
			showErrorDlg("doResult()", errorObject);
		}
	}
	
	function page(){
		$("#fevent").val("FORM_SELECT");
		$("#form1").attr("action", "/bid/purchase/TBECheck.screen");
		$("#form1").attr("target", "_self");
		$("#form1").attr("method", "post");
		$("#form1").submit();
	}
	

	function tbe_detail(vendor_cd,filecnt,rnnc){
		if(Number(filecnt) > 0){
			if (confirm("기술검토 페이지로 이동하시겠습니까?")){
				$("#fevent").val("FORM_SELECT");
				$("#CORP_ID").val(vendor_cd);
				$("#form1").attr("action", "/bid/purchase/TBECheckDetail.screen");
				$("#form1").attr("target", "_self");
				$("#form1").attr("method", "post");
				$("#form1").submit();
			}
		}else{
			if(rnnc.length == 0){
				alert("기술검토 할 문서가 없습니다.\n해당 업체에 문서요청을 해주세요.");
			}else{
				alert("입찰포기한 업체 입니다.\n문서검토를 하실 수 없습니다.");
			}
		}
	}
	
	//업체 문서 요청
	function suppFileRequest(corp_id,req_deg,status){
		$("#FILE_REQUEST_SUPP").val(corp_id);
		$("#REQ_DEG").val(req_deg);
		$("#SUPP_STATUS_CD").val(status);
		$("#REQ_YN").val("Y");
		//$("#TBE_FIN_STATUS_CD").val("02");//작성중 상태 업데이트
		var f = document.form1;
		if (confirm("해당업체에 문서요청을 하시겠습니까?")){
			submitXmlRequest("/bid/purchase/TBECheck_form.screen", "FILE_REQUEST", f, "SUCCESS");
		}
	}
	
	function SearchUser(NAME,CODE){
		var win_id = "_searchUserPopup";
		var link = "/lib/dlgSearchUserPop.screen";
		    link += "?pop_win_id="+win_id;
		fLayerPop(win_id, link, 700,400, '', '', 'NO');
	}
	
	function SearchUserClose(result){
		$("#EVAL_EMPID").val(result[9])//ACCT_ID
		$("#EVAL_EMPNM").val(result[1])//이름
		$("#EVAL_TEL").val(result[6])//연락처
		$("#EVAL_EMAIL").val(result[8])//이메일
		setTimeout(function(){fLayerPopClose('_searchUserPopup');},100);
	}
</SCRIPT>


<modular:search id="form1">
	<modular:key id="fevent" />
</modular:search>
<form id="form1" name="form1" method="post" modular:type="search">
<!-- List Search -->
<INPUT type="hidden" name="P_BID_MASTER_NM" id="P_BID_MASTER_NM" value="<%= params.get("P_BID_MASTER_NM") %>">
<INPUT type="hidden" name="p_demanded_status" id="p_demanded_status" value="<%= params.get("p_demanded_status") %>">
<INPUT type="hidden" name="p_dept_nm" id="p_dept_nm" value="<%= params.get("p_dept_nm") %>">
<INPUT type="hidden" name="p_dept_cd" id="p_dept_cd" value="<%= params.get("p_dept_cd") %>">
<INPUT type="hidden" name="p_list" id="p_list" value="<%= params.get("p_list") %>">
<!-- List Search -->  
<INPUT type='hidden' name="fevent" id="fevent"  value="">
<INPUT type='hidden' name="BID_NO" value="<%=Order.get("BID_NO")%>">
<INPUT type='hidden' name="BID_DEG" value="<%=Order.get("BID_DEG")%>">
<INPUT type='hidden' name="DEMANDED_ID" value="<%=Order.get("DEMANDED_ID")%>">
<INPUT type='hidden' name="TBE_FILE_GB" value="<%=Order.get("TBE_FILE_GB")%>">
<INPUT type='hidden' name="STATUS_CD" value="<%=Order.get("STATUS_CD")%>">
<INPUT type='hidden' name="TBE_STATUS_CD" value="<%=Order.get("TBE_STATUS_CD")%>">
<INPUT type='hidden' name="OPEN_DT" value="<%=Order.get("OPEN_DT")%>">
<INPUT type='hidden' name="CORP_ID" value="">
<INPUT type='hidden' name="TBE_FIN_STATUS_CD" value="">
<INPUT type='hidden' name="FILE_REQUEST_SUPP" value="">
<INPUT type='hidden' name="REQ_DEG" value="">
<INPUT type='hidden' name="REQ_YN" value="">
<INPUT type='hidden' name="SUPP_STATUS_CD" value="">
<INPUT type='hidden' name="TBESUPP_CNT" value="<%=Tbe_info.size() %>">
<INPUT type='hidden' name="TOT_FILE_GB" value="<%=Order.get("TOT_FILE_GB")%>">
<INPUT type='hidden' name="TOT_FILE_ID" value="<%=Order.get("TOT_FILE_ID")%>">
<INPUT type='hidden' name="ONBID_YN_CD" id="ONBID_YN_CD" value="<%=Order.get("ONBID_YN_CD")%>">
<table width="100%">
	<colgroup>
		<col width="*" />
		<col width="250" />
	</colgroup>
	<tr>
   		<th>
			<div align="left" id="title">
			    <ul><li>구매_기술문서검토 상세<font style="font-size:11px">(<%=Order.get("STATUS_NM")%>)</font></li></ul>
			</div>
   		</th>
   		<td align="right">
				<span class="btnSearch center" id="btn_save"><a href="javascript:void(0);">저장</a></span>
				<span class="btnSearch center" id="btn_tbe_fin"><a href="javascript:void(0);">검토완료</a></span>
				<span class="btnSearch center" id="btn_list"><a href="javascript:void(0);">목록</a></span>
   		</td>
  	</tr>
</table>
<%if(p_reason || m_reason || c_reason || r_reason){ %>
<TABLE class="form-table">
	<colgroup>
		<col width="160">
		<col/>
	</colgroup>
   <%if(c_reason){ %>
  <TR height="25">
    <TH>취소사유</TH>
	<TD><%=StringUtils.cvtHTML(Order.get("CANCEL_REASON"))%></TD>
  </TR>
  <%} %>
   <%if(p_reason){ %>
  <TR height="25">
    <TH>연기사유</TH>
	<TD><%=StringUtils.cvtHTML(Order.get("POSTPONE_REASON"))%></TD>
  </TR>
  <%} %>
  <%if(m_reason){ %>
  <TR height="25">
    <TH>정정사유</TH>
	<TD><%=StringUtils.cvtHTML(Order.get("MODIFY_REASON"))%></TD>
  </TR>
  <%} %>
  <%if(r_reason){ %>
  <TR height="25">
    <TH>반려사유</TH>
	<TD><%=StringUtils.cvtHTML(Order.get("RTN_REASON"))%></TD>
  </TR>
  <%} %>
</TABLE>
<%}%>

<div class="application-info magT15">
	<div class="application-sub-title">
		<span class="title">입찰기본정보</span>
	</div>
</div>

<TABLE class="form-table">
	<colgroup>
		<col width="160"/>
		<col width="38%"/>
		<col width="160"/>
		<col/>
	</colgroup>
  <TR height="25">
    <TH>입찰번호-차수</TH>
	<TD >
	  <%=Order.get("BID_NO")%>-<%=Order.get("BID_DEG")%>
    </TD>
	<TH>온라인입찰여부</TH>
	<TD >
	 <%=Order.get("ONBID_YN")%>           
	</TD>
  </TR>


  <TR height="25">
	<TH>입찰명</TH>
	<TD colspan="3">
		<%=Order.get("BID_MASTER_NM")%>
	</TD>
  </TR>
  
  <TR height="25">
	<TH>경쟁방법</TH>
	<TD >
		<%=Order.get("CMPT_NM")%>
	</TD>
       
	<TH>낙찰자선정방법</TH>
	<TD >
	  <%=Order.get("SUCC_NM") %>
 	</TD>	
  </TR>	
</table>

<div class="application-info magT15">
	<div class="application-sub-title">
		<span class="title">입찰조건</span>
	</div>
</div>

<TABLE class="form-table">
	<colgroup>
		<col width="160"/>
		<col width="20%">
		<col width="160"/>
		<col width="20%">
		<col width="160"/>
		<col/>
	</colgroup>
  <TR height="25"> 
	<TH>통화구분</TH>
	<TD><%=Order.get("CURRENCY_GB_NM") %> &nbsp&nbsp  
		<%=Order.get("CURRENCY_GB_YN").equals("Y") ? "[업체변경가능]" : "[업체변경불가능]" %>
		
	</TD>
	<TH>CBE문서 TYPE</TH>
	<TD colspan="3">
		<%if(!Order.get("PBC_CBE_TYPE_CD").isEmpty()){ %><%=Order.get("PBC_CBE_TYPE_CD").equals("A") ? "A type" : "B type" %><%} %>
	</TD>	
  </TR>
  <TR height="25"> 
	<TH>Installation</TH><!-- 설치비 포함여부 -->
	<TD><%=Order.get("PBC_INSTALL_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %></TD>
	<TH>Spare Parts for Commissionig</TH><!-- 시운전 포함여부 -->
	<TD><%=Order.get("PBC_COMMISS_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %></TD>
	<TH>Special Tool</TH><!-- 설치비 특별공구 포함여부 -->
	<TD><%=Order.get("PBC_SPETOOL_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %></TD>	
  </TR>
  <TR height="25"> 
	<TH>Test & Inspection at Fabrication shop</TH><!-- 샾(공장) 검사비용 포함여부 -->
	<TD><%=Order.get("PBC_TEST_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %></TD>
	<TH>Documentation</TH><!-- vendor print  (무조건 포함)  삭제? -->
	<TD><%=Order.get("PBC_DOC_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %></TD>
	<TH>Packing cost</TH><!-- 포장비용 포함여부 -->
	<TD><%=Order.get("PBC_PACK_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %></TD>	
  </TR>
  <TR height="25"> 
	<TH>Inland Transportaion</TH><!-- 내륙운송비 -->
	<TD><%=Order.get("PBC_LANDTRAN_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %></TD>
	<TH>Delivery Condition</TH><!-- 인도조건 (현장도착도, 현장상차도,현장설치도, 설치시운전도) -->
	<TD colspan="3">
	  <%=Order.get("DELIVERY_CONDITION_NM") %>&nbsp&nbsp  <%=Order.get("DELIVERY_CONDITION_YN").equals("Y") ? "[업체변경가능]" : "[업체 변경 불가능]" %></TD>
  </TR>
   <TR height="25"> 
	<TH>OPTIONAL PRICE</TH><!-- 현장감독관 일당   &     기타일당 내역 -->
	<TD colspan="5">A. Supervision fee &nbsp <%=Order.get("PBC_FEE_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %>
	    <% if(!Order.get("PBC_OPTION_COMMENT").isEmpty()){ %>&nbsp&nbsp  B. <%= Order.get("PBC_OPTION_COMMENT")%> &nbsp<%=Order.get("PBC_OPTION_YN").equals("Y") ? "업체 견적내용 반영" : "업체 견적내용 미반영" %><%} %></TD>
  </TR>
  <TR height="25"> 
	<TH>Liquidated Damages</TH><!-- 지체상금 fix -->
	<TD colspan="5"><% if(!Order.get("CBC_DAMAGE_RATE").isEmpty()){ %><%= Order.get("CBC_DAMAGE_RATE")%>% <%=Order.get("CBC_DAMAGE_NM")%>,<%} %>
	<% if(!Order.get("CBC_DAMAGE_MAXRATE").isEmpty()){ %> Max <%= Order.get("CBC_DAMAGE_MAXRATE")%>%<%} %></TD>
  </TR>
  <TR height="25"> 
	<TH>선급금</TH>
	<TD><% if(!Order.get("CBC_FIRST_RATE").isEmpty()){ %><%=Order.get("CBC_FIRST_RATE") %>% <%} %><%= Order.get("PBC_FIRST_CONDI")%></TD>
	<TH>중도금</TH>
	<TD><% if(!Order.get("CPC_MID_RATE").isEmpty()){ %><%= Order.get("CPC_MID_RATE")%>% <%} %><%=Order.get("PBC_MID_CONDI")%></TD>
	<TH>잔금</TH>
	<TD><% if(!Order.get("PBC_REST_RATE").isEmpty()){ %><%= Order.get("PBC_REST_RATE") %>% <%} %><%=Order.get("PBC_REST_CONDI")%></TD>	
  </TR>
  <TR height="25"> 
	<TH>First Payment Bond</TH><!-- 선급금이행증권(yes, no) -->
	<TD><% if(!Order.get("PBC_FRSTGUAR_RATE").isEmpty()){ %><%= Order.get("PBC_FRSTGUAR_RATE") %>% <%} %><%= Order.get("PBC_FRSTGUAR_CONDI")%></TD>
	<TH>Performance Bond</TH><!-- 계약이행증권(yes, no) -->
	<TD><% if(!Order.get("CONTFUL_RATE").isEmpty()){ %><%= Order.get("CONTFUL_RATE") %>% <%} %><%=Order.get("CONTFUL_CONDI") %></TD>
	<TH>Guarantee Bond</TH><!-- 하자이행증권(yes, no) -->
	<TD><% if(!Order.get("WARR_RATE").isEmpty()){ %><%= Order.get("WARR_RATE") %>%<%} %> <%= Order.get("WARR_CONDI")%></TD>	
  </TR>  
  <TR height="25"> 
	<TH>Guarantee Period</TH><!-- 하자보수기간 -->
	<TD colspan="3"><%=Order.get("PBC_DEFECT_CONDI") %> <%=Order.get("CBC_DEFECT_DAY") %>  
	<% if(!Order.get("CBC_DERECT_TERM_NM").isEmpty()){ %><%=Order.get("CBC_DERECT_TERM_NM") %>간<%} %>
	<input type="checkbox" id="addGuar" style="margin-top:2px; display:none;">
	<span class="checkAdd" style="display:none;">&nbsp;or&nbsp;
	<%=Order.get("PBC_DEFECT_CONDI2") %> <%=Order.get("CBC_DEFECT_DAY2")%>  
	<%if(Order.get("CBC_DERECT_TERM_CD2").equals("01")){%>
		<span>일 간 중 선도래일</span>
	<%}else if(Order.get("CBC_DERECT_TERM_CD2").equals("02")){%>
		<span>개월 간 중 선도래일</span>
	<%} %>
	</span>
	</TD>
	<TH>Delivery Period</TH><!-- 납기일 fix -->
	<TD>
		<% if(!Order.get("DELI_FROM_DY").isEmpty() && !Order.get("DELI_TO_DY").isEmpty()){ %><%=Order.get("DELI_FROM_DY") %> ~ 
		<%= Order.get("DELI_TO_DY") %><%} %>
	</TD>
  </TR>  
</TABLE>

<TABLE class="form-table" style="margin-top:5px">
	<colgroup>
		<col width="160"/>
		<col width="38%"/>
		<col width="160"/>
		<col/>
	</colgroup>
  <TR height="25">
    <TH>주요발주내용</TH>
	<TD style="vertical-align: top">
		<%=StringUtils.cvtHTML(Order.get("MAIN_PR_CONTENTS"))%>
    </TD>
	
	<TH>입찰업체선정사유</TH>
	<TD style="vertical-align: top">
	 <%=StringUtils.cvtHTML(Order.get("BID_SUPP_SELECT_REASON"))%>           
	</TD>
  </TR>	
  <TR height="25">
    <TH>특이사항 내부</TH>
	<TD style="vertical-align: top">
		<%=StringUtils.cvtHTML(Order.get("INNER_REMARKS"))%>
    </TD>
	
	<TH>특이사항 외부</TH>
	<TD style="vertical-align: top">
	 <%=StringUtils.cvtHTML(Order.get("OUTER_REMARKS"))%>           
	</TD>
  </TR>
  <TR height="100">
    <TH>내부자료</TH>
	<TD >
	 <TEXTAREA name="p_AttachFile1" id="p_AttachFile1" style="width:85%;height:80px" rows="1" class="input" readOnly><%=filein.get(Order.get("DOC_ETC_IN")) %></TEXTAREA>
	                    <IMG id='search_spot_button' onClick="doAttachFile(document.form1.DEMANDED_ID,1);" src='/img/buyer/button/bt_change.gif' border='0'  align="top" align='absmiddle' alt='[Attach File]' style='cursor:pointer;'>
    </TD>
	<TH>외부자료</TH>
	<TD>
	 <TEXTAREA name="p_AttachFile2" id="p_AttachFile2" style="width:85%;height:80px" rows="1" class="input" readOnly><%=fileout.get(Order.get("DOC_ETC_OUT")) %></TEXTAREA>
	                    <IMG id='search_spot_button' onClick="doAttachFile(document.form1.DEMANDED_ID,2);" src='/img/buyer/button/bt_change.gif' border='0'  align="top" align='absmiddle' alt='[Attach File]' style='cursor:pointer;'>
	</TD>
  </TR> 
</TABLE>


<div class="application-info magT15">
	<div class="application-sub-title">
		<span class="title">기술검토 정보</span>
	</div>
</div>

<TABLE class="form-table">
	<colgroup>
		<col width="160"/>
		<col width="20%"/>
		<col width="160"/>
		<col width="26%"/>
		<col width="160"/>
		<col />
	</colgroup>
  <TR height="25">
    <TH>심사자 명</TH>
	<TD><INPUT type='hidden' name="EVAL_EMPID" value="<%=Order.get("EVAL_EMPID")%>"><INPUT type='hidden' name="EVAL_EMPID_O" value="<%=Order.get("EVAL_EMPID")%>">
		<%= InputText.get("EVAL_EMPNM", Order.get("EVAL_EMPNM"), 21, 60, "desc=TBE심사자,readOnly") %>
		<IMG id=btnevalemp src="/img/buyer/button/bt_search_right.gif" alt="담당자" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:SearchUser('EVAL_EMPNM','EVAL_EMPID','N');">
    </TD>
	<TH>심사자 연락처</TH>
	<TD><%= InputText.get("EVAL_TEL", Order.get("EVAL_TEL"), 25, 20, "") %>
	</TD>
	<TH>심사자 이메일</TH>
	<TD><%= InputText.get("EVAL_EMAIL", Order.get("EVAL_EMAIL"), 55, 50, "") %>
	</TD>
  </TR>
</TABLE>
<% if(Order.get("ONBID_YN_CD").equals("Y")){ %>
<TABLE class="list-form-table" style="margin-top:5px">
	<colgroup>
		<col width="70"/>
		<col width="70"/>
		<col width="40%"/>
		<col width="50"/>
		<col width="50"/>
		<col width="70"/>
		<col width="70"/>
		<col width="60"/>
	</colgroup>
  <TR height="25">
    <TH>사업자번호</TH>
	<TH>업체명</TH>
	<TH>검토완료문서</TH>
	<TH>전체문서</TH>
	<TH>검토완료</TH>
	<TH>문서요청일</TH>
	<TH>제출일</TH>
	<TH>상태</TH>
  </TR>
  <%
 		if(Tbe_info.size() > 0){
  			for(int i=0;i < Tbe_info.size();i++){
  		
  %>
  <TR height="25">
    <TD style="text-align:center"><%=StringUtils.getBizNo(Tbe_info.getRow(i).get("VENDOR_NO"))%></TD>
	<TD style="text-align:center"><a href="javascript:tbe_detail('<%=Tbe_info.getRow(i).get("VENDOR_CD")%>','<%=Tbe_info.getRow(i).get("FILE_CNT")%>','<%=Tbe_info.getRow(i).get("BID_RNNC_DT")%>');"><%=Tbe_info.getRow(i).get("VENDOR_NAME")%></a></TD>
	<TD><TEXTAREA name="p_File_Supp<%=i %>" id="p_File_Supp<%=i %>" style="width:90%;height:40px" rows="1" class="input" readOnly><%=Tbe_info.getRow(i).get("FILE_LIST") %></TEXTAREA>
	                    <IMG id='search_spot_button' onClick="doAttachFile_supp(document.form1.DEMANDED_ID,document.form1.p_File_Supp<%=i %>,'<%=Tbe_info.getRow(i).get("FIN_FILE_GB")%>');" src='/img/buyer/button/bt_change.gif' border='0'  align="top" align='absmiddle' alt='[Attach File]' style='cursor:pointer;'></TD>
	<TD style="text-align:center"><%=Tbe_info.getRow(i).get("FILE_CNT")%></TD>
	<TD style="text-align:center"><%=Tbe_info.getRow(i).get("CL_CNT")%></TD>
	<TD style="text-align:center"><%=Tbe_info.getRow(i).get("REG_DT")%></TD>
	<TD style="text-align:center"><%=Tbe_info.getRow(i).get("DOC_DT")%></TD>
	<TD style="text-align:center">
	<%-- <%if("문서요청".equals(Tbe_info.getRow(i).get("STATUS_NM"))&& !"10".equals(Order.get("TBE_STATUS_CD"))){%><span class="btnSearch center" id="btn_tbe_supp"><a href="javascript:suppFileRequest('<%=Tbe_info.getRow(i).get("VENDOR_CD")%>',<%=Tbe_info.getRow(i).get("REQ_DEG")%>,'04');"><%=Tbe_info.getRow(i).get("STATUS_NM")%></a></span><%}else{%><%=Tbe_info.getRow(i).get("STATUS_NM")%><%} %> --%>
	<%-- <%if("91".equals(Order.get("TBE_STATUS_CD")) && !"Y".equals(Tbe_info.getRow(i).get("REQ_YN"))&& !"문서요청".equals(Tbe_info.getRow(i).get("STATUS_NM"))){%><br><span class="btnSearch center" id="btn_tbe_supp"><a href="javascript:suppFileRequest('<%=Tbe_info.getRow(i).get("VENDOR_CD")%>',<%=Tbe_info.getRow(i).get("REQ_DEG")%>,'04');">문서요청</a></span><%} %> --%>
	<%if("문서요청".equals(Tbe_info.getRow(i).get("STATUS_NM"))&& !"10".equals(Order.get("TBE_STATUS_CD")) && !"Y".equals(Tbe_info.getRow(i).get("REQ_YN")) && Order.get("EVAL_EMPID").equals(user.get("ACCT_ID"))){%><span class="btnSearch center" id="btn_tbe_supp"><a href="javascript:suppFileRequest('<%=Tbe_info.getRow(i).get("VENDOR_CD")%>',<%=Tbe_info.getRow(i).get("REQ_DEG")%>,'04');"><%=Tbe_info.getRow(i).get("STATUS_NM")%></a></span><%}else{%><%=Tbe_info.getRow(i).get("STATUS_NM")%><%} %>
	<%if("91".equals(Order.get("TBE_STATUS_CD")) && !"Y".equals(Tbe_info.getRow(i).get("REQ_YN"))&& !"문서요청".equals(Tbe_info.getRow(i).get("STATUS_NM")) && Order.get("EVAL_EMPID").equals(user.get("ACCT_ID")) ){%><br><span class="btnSearch center" id="btn_tbe_supp"><a href="javascript:suppFileRequest('<%=Tbe_info.getRow(i).get("VENDOR_CD")%>',<%=Tbe_info.getRow(i).get("REQ_DEG")%>,'04');">문서요청</a></span><%} %>
	</TD>
  </TR>
  <%		}
  		}else{%>
  		<TR height="25">
    <TD colspan="8" style="text-align:center">기술 검토 대상 업체가 없습니다.</TD>
  </TR>
  <%}%>
</TABLE>
<%} %>
<div class="application-info magT15">
	<div class="application-sub-title">
		<span class="title">기술검토 결과</span>
	</div>
</div>

<TABLE class="form-table" style="margin-top:5px">
	<colgroup>
		<col width="145"/>
		<col width="145"/>
		<col width="200"/>
		<col />
	</colgroup>
  <TR height="25">
    <TH style="text-align:center;padding-right:20px">사업자번호</TH>
	<TH style="text-align:center;padding-right:20px">업체명</TH>
	<TH style="text-align:center;padding-right:20px">평가결과</TH>
	<TH style="text-align:center;padding-right:20px">평가의견</TH>
  </TR>
  <%
  	 if(Tbe_info.size() > 0){
  		for(int i=0;i < Tbe_info.size();i++){
  %>
  <TR height="25">
    <TD style="text-align:center"><%=StringUtils.getBizNo(Tbe_info.getRow(i).get("VENDOR_NO"))%><INPUT type="hidden"  id="VENDOR_CD" name="VENDOR_CD" value="<%=Tbe_info.getRow(i).get("VENDOR_CD")%>"></TD>
	<TD style="text-align:center"><%=Tbe_info.getRow(i).get("VENDOR_NAME")%></TD>
	<TD style="text-align:center"><%if(Tbe_info.getRow(i).get("BID_RNNC_DT").isEmpty()){ %>
	<%-- <INPUT type="hidden"  id="EVAL_RESULT_<%=Tbe_info.getRow(i).get("VENDOR_CD")%>" name="EVAL_RESULT_<%=Tbe_info.getRow(i).get("VENDOR_CD")%>" value=""> --%>
	<LABEL for="eval_result_1<%=Tbe_info.getRow(i).get("VENDOR_CD")%>"><INPUT id="eval_result_1<%=Tbe_info.getRow(i).get("VENDOR_CD")%>" type="radio" name="EVAL_RESULT_<%=Tbe_info.getRow(i).get("VENDOR_CD")%>" value="01" desc="평가결과" <%=Tbe_info.getRow(i).get("EVAL_RESULT").equals("01") ? "checked=\"checked\"" : "" %> <%if(("06".equals(Order.get("STATUS_CD"))||"10".equals(Order.get("TBE_STATUS_CD"))) && "Y".equals(Order.get("ONBID_YN_CD"))){%>disabled<%} %>>적합</LABEL>
	<LABEL for="eval_result_2<%=Tbe_info.getRow(i).get("VENDOR_CD")%>"><INPUT id="eval_result_2<%=Tbe_info.getRow(i).get("VENDOR_CD")%>" type="radio" name="EVAL_RESULT_<%=Tbe_info.getRow(i).get("VENDOR_CD")%>" value="02" desc="평가결과" <%=Tbe_info.getRow(i).get("EVAL_RESULT").equals("02") ? "checked=\"checked\"" : "" %> <%if(("06".equals(Order.get("STATUS_CD"))||"10".equals(Order.get("TBE_STATUS_CD"))) && "Y".equals(Order.get("ONBID_YN_CD"))){%>disabled<%} %>>조건부 적합</LABEL>
	<LABEL for="eval_result_3<%=Tbe_info.getRow(i).get("VENDOR_CD")%>"><INPUT id="eval_result_3<%=Tbe_info.getRow(i).get("VENDOR_CD")%>" type="radio" name="EVAL_RESULT_<%=Tbe_info.getRow(i).get("VENDOR_CD")%>" value="03" desc="평가결과" <%=Tbe_info.getRow(i).get("EVAL_RESULT").equals("03") ? "checked=\"checked\"" : "" %> <%if(("06".equals(Order.get("STATUS_CD"))||"10".equals(Order.get("TBE_STATUS_CD"))) && "Y".equals(Order.get("ONBID_YN_CD"))){%>disabled<%} %>>부적합</LABEL>
	<%}else{ %>입찰포기<%} %>
	</TD>
	<TD ><textarea name="EVAL_OPIN" id="EVAL_OPIN" style="width:98%; height:40px; overflow-y:auto;" maxlength="1000" class="input byteChk ctrlTarget" <%if(("06".equals(Order.get("STATUS_CD"))||"10".equals(Order.get("TBE_STATUS_CD"))) && "Y".equals(Order.get("ONBID_YN_CD"))){%>readOnly<%} %>><%=Tbe_info.getRow(i).get("EVAL_OPIN")%></textarea></TD>
  </TR>
  <%		} %>
  <TR  height="25">
  <TH style="text-align:center;padding-right:20px" rowspan="2">종합의견<br>(TBE 결과등록)</TH>
  <TD colspan="2"><TEXTAREA name="p_AttachFile3" id="p_AttachFile3" style="width:85%;height:40px" rows="1" class="input" readOnly><%=filetot.get(Order.get("TOT_FILE_GB")) %></TEXTAREA>
	                    <IMG id='search_spot_button' onClick="doAttachFile(document.form1.DEMANDED_ID,3);" src='/img/buyer/button/bt_change.gif' border='0'  align="top" align='absmiddle' alt='[Attach File]' style='cursor:pointer;'></TD>
  <TD rowspan="2"><textarea name="TOT_OPIN" id="TOT_OPIN" style="width:98%; height:65px; overflow-y:auto" maxlength="1000" class="input byteChk ctrlTarget" <%if("10".equals(Order.get("TBE_STATUS_CD"))){%>readOnly<%} %>><%=Order.get("TOT_OPIN")%></textarea></TD>
  <TR  height="25">
  <TD colspan="2"><font color="red">결재된 기술검토서를 스캔하여 첨부바랍니다.</font></TD>
  <%	}else{%>
  		<TR height="25">
    <TD colspan="4" style="text-align:center">기술 검토 대상 업체가 없습니다.</TD>
  </TR>
  <%}%>
  
</TABLE>

</form>