PuSuppPlanApprPop.jsp 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <%--
  2. - FileName : PuSuppPlanApprPop.jsp
  3. - Author(s) : lsm
  4. -
  5. --%>
  6. <%@ page contentType="text/html; charset=utf-8" %>
  7. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  8. <%@ page import="kr.co.hsnc.common.util.ValueObject" %>
  9. <%@ page import="kr.co.hsnc.common.sql.RowSet" %>
  10. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  11. <%@ page import="com.udapsoft.waf.common.util.StringUtils" %>
  12. <%@ page import="kr.co.hsnc.common.config.WAFConfig" %>
  13. <%@ include file="/jsp/work/taglib.jsp" %>
  14. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  15. <%
  16. ctx.init(request, response);
  17. HandlerStorage storage = ctx.getHandlerStorage();
  18. ValueObject params = storage.getParams();
  19. ValueObject user = storage.getUser();
  20. String event = storage.getEvent();
  21. RowSet getApprSrdList = storage.getRowSet("getApprSrdList");
  22. ValueObject vo = storage.getValueObject("getAppr");
  23. String yyyymmdd = (new java.text.SimpleDateFormat ("yyyy년 MM월 dd일")).format (new java.util.Date());
  24. String appr_date = (new java.text.SimpleDateFormat ("yyyyMMdd")).format (new java.util.Date());
  25. %>
  26. <script type="text/javascript">
  27. $(function(){
  28. $(window).load(function () {
  29. $(".gubun").each(function () {
  30. var rows = $(".gubun:contains('" + $(this).text() + "')");
  31. if (rows.length > 1) {
  32. rows.eq(0).attr("rowspan", rows.length);
  33. rows.not(":eq(0)").remove();
  34. }
  35. });
  36. });
  37. $(':radio[name^=test_]').click(function(){
  38. var grade = ['A', 'B', 'C', 'D', 'E'];
  39. var i = this.name.split('test_')[1];
  40. var index = $(':radio[name="test_' + i + '"]').index($(this));
  41. $("#result_" + i).text($(this).val() + "점");
  42. $("#chkResultCd_" + i).val(grade[index]);
  43. });
  44. $("#btn_close").click(function(){
  45. parent.fLayerPopClose('PlanApprPop');
  46. //window.close();
  47. });
  48. $("#btn_save").click(function(){
  49. var f = document.form1;
  50. <%-- if("<%=params.get("P_CHARGE_CD")%>" == "C" && $("#APPR_NOTE").val().length < 1 ) {
  51. alert("담당자 의견은 필수입니다. ");
  52. return ;
  53. } --%>
  54. $("#fevent").val("GET_SAVE");
  55. if(confirm("저장하시겠습니까?"))
  56. {
  57. jQuery("#gubun").val("1");
  58. submitXmlRequest("/payment/purchase/PuSuppPlanApprPopSave.screen", "GET_SAVE", f);
  59. }
  60. });
  61. $(".icon_x").click(function(){
  62. parent.fLayerPopClose('PlanApprPop');
  63. //window.close();
  64. });
  65. $("#btnAppReq").click(function(){
  66. var f = document.form1;
  67. <%-- if("<%=params.get("P_CHARGE_CD")%>" == "C" && $("#APPR_NOTE").val().length < 1 ) {
  68. alert("담당자 의견은 필수입니다. ");
  69. return ;
  70. } --%>
  71. $("#fevent").val("GET_SAVE");
  72. if(confirm("확정하시겠습니까?"))
  73. {
  74. jQuery("#gubun").val("2");
  75. submitXmlRequest("/payment/purchase/PuSuppPlanApprPopSave.screen", "GET_SAVE", f);
  76. }
  77. });
  78. $(".icon_x").click(function(){
  79. window.close();
  80. });
  81. });
  82. $(document).ready(function(){
  83. if(<%=params.get("p_plan_appr_chk_empno")%> != <%=params.get("user_id") %>){
  84. jQuery("#btn_save").hide();
  85. jQuery("#btnAppReq").hide();
  86. }
  87. if(<%=params.get("p_plan_appr_status")%> == "02"){
  88. jQuery("#btn_save").hide();
  89. jQuery("#btnAppReq").hide();
  90. }
  91. if(<%=params.get("p_plan_appr_status")%> == "02" && "<%=params.get("P_CHARGE_CD")%>" == "S"){ //2016.5.11 완료상태에서 구매담당자 수정가능.
  92. jQuery("#save").hide();
  93. }else{
  94. jQuery("#save").show();
  95. }
  96. //2016.4.21
  97. if("<%=params.get("P_CHARGE_CD")%>" == "C"){
  98. jQuery("#WRITE_NO").val("<%=params.get("user_id")%>");
  99. jQuery("#WRITE_NM").val("<%=params.get("user_nm")%>");
  100. }
  101. //else{
  102. // $(':radio[name="test_5"]').attr("disabled", true);
  103. //}
  104. for(i=0; i < <%=getApprSrdList.size()%>; i++)
  105. {
  106. var index = $(':radio[name="test_'+i+'"]').index($(':radio[name="test_'+i+'"]:checked')) +1;
  107. if(index != 0)
  108. {
  109. if($(':radio[name="test_'+i+'"]:checked'))
  110. {
  111. $("#result_"+i+"").text($(':radio[name="test_'+i+'"]:checked').val() + "점");
  112. if(index == "1")
  113. {
  114. $("#chkResultCd_"+i).val("A");
  115. }
  116. else if(index == "2")
  117. {
  118. $("#chkResultCd_"+i).val("B");
  119. }
  120. else if(index == "3")
  121. {
  122. $("#chkResultCd_"+i).val("C");
  123. }
  124. else if(index == "4")
  125. {
  126. $("#chkResultCd_"+i).val("D");
  127. }
  128. else if(index == "5")
  129. {
  130. $("#chkResultCd_"+i).val("E");
  131. }
  132. }
  133. }
  134. }
  135. });
  136. function doResult(resultObj) {
  137. var f = document.form1;
  138. try
  139. {
  140. document.form1.isSubmit = false;
  141. if($("#fevent").val() == "GET_SAVE")
  142. {
  143. if (resultObj.getSuccess())
  144. {
  145. alert("평가표 저장이 완료되었습니다.");
  146. window.close(); //2016.4.25 중복저장 오류 제거
  147. //winClose();
  148. }
  149. else
  150. {
  151. dlgErrorMsg( resultObj );
  152. }
  153. }
  154. }
  155. catch(errorObject) {
  156. showErrorDlg("doResult()", errorObject);
  157. }
  158. }
  159. </script>
  160. <modular:search id="form1">
  161. <modular:key id="fevent" />
  162. </modular:search>
  163. <form id="form1" name="form1" method="post" modular:type="search">
  164. <input type="hidden" name="fevent" id="fevent" value="">
  165. <input type="hidden" name="gubun" id="gubun" value="">
  166. <input type=hidden name="payreq_id" id="payreq_id" value="<%=params.get("p_payreq_id") %>" />
  167. <input type=hidden name="corp_id" id="corp_id" value="<%=params.get("p_corp_id") %>" />
  168. <input type="hidden" name="corp_no" id="corp_no" value="<%=params.get("corp_no") %>" />
  169. <input type="hidden" name="dept_cd" id="dept_cd" value="<%=params.get("p_dept_cd") %>" />
  170. <input type="hidden" name="dept_nm" id="dept_nm" value="<%=params.get("dept_nm") %>" />
  171. <input type="hidden" name="doc_cd" id="doc_cd" value="<%=params.get("doc_cd") %>" />
  172. <input type="hidden" name="user_id" id="user_id" value="<%=params.get("user_id") %>" />
  173. <input type="hidden" name="user_nm" id="user_nm" value="<%=params.get("user_nm") %>" /> <!--2016.4.20 현재작성자정보 저장 -->
  174. <input type="hidden" name="user_id_before" id="user_id_before" value="<%=params.get("user_id_before") %>" />
  175. <input type="hidden" name="user_nm_before" id="user_nm_before" value="<%=params.get("user_nm_before") %>" /> <!--2016.4.20 현재작성자정보 저장 -->
  176. <input type="hidden" name="ord_doc_no" id="ord_doc_no" value="<%=params.get("p_ord_doc_no") %>" />
  177. <input type="hidden" name="cont_id" id="cont_id" value="<%=params.get("p_pur_cont_id") %>" />
  178. <input type="hidden" name="listSize" id="listSize" value="<%=getApprSrdList.size() %>" />
  179. <input type="hidden" name="appr_date" id="appr_date" value="<%=appr_date %>" />
  180. <input type="hidden" name="WRITE_NO" id="WRITE_NO" value="<%=vo.get("WRITE_NO") %>" />
  181. <input type="hidden" name="WRITE_NM" id="WRITE_NM" value="<%=vo.get("WRITE_NM") %>" /><!--2016.4.21 본사담당자 평가 내용 저장 -->
  182. <input type="hidden" name="CHARGE_CD" id="CHARGE_CD" value="<%=params.get("P_CHARGE_CD") %>" /><!--2016.4.21 본사담당자C,현장담당자S 구분 -->
  183. <input type="hidden" name="arr_id" id="arr_id" value="<%=vo.get("arr_id") %>" />
  184. <input type="hidden" name="p_status" id="p_status" value="<%=params.get("p_status")%>" />
  185. <div style="width: 100%; text-align: center; margin-top: 10px; margin-bottom: 15px;" >
  186. <span style="font-size: 15px; font-weight: bold;">기자재 공급업체 설계평가표</span>
  187. </div>
  188. <table cellspacing="0" cellpadding="0" border="1" bordercolordark="#FFFFF" bordercolorlight="#d2d2d2" class="input_table" style="width: 100%;">
  189. <col width="7%">
  190. <col width="7%">
  191. <col width="26%">
  192. <col width="7%">
  193. <col width="7%">
  194. <col width="7%">
  195. <col width="7%">
  196. <col width="7%">
  197. <col width="7%">
  198. <col width="7%">
  199. <!-- <col width="*"> -->
  200. <%-- <tr style="height: 23px;">
  201. <td class="insert_table_title" style="text-align: center;">공사번호</td>
  202. <td colspan="2" style="text-align: center;"></td>
  203. <td class="insert_table_title" style="text-align: center; text-indent : 0px;">공사기간</td>
  204. <td colspan="6" style="text-align: center;"></td>
  205. </tr>
  206. <tr style="height: 23px;">
  207. <td class="insert_table_title" style="text-align: center;">공 사 명</td>
  208. <td colspan="2" style="text-align: center;"></td>
  209. <td class="insert_table_title" style="text-align: center; text-indent : 0px;">작 성 일</td>
  210. <td colspan="6" style="text-align: center;"><%=params.get("dt_before")%></td>
  211. </tr>
  212. <tr style="height: 23px;">
  213. <td class="insert_table_title" style="text-align: center;">도급업체명</td>
  214. <td colspan="2" style="text-align: center;"><%=params.get("corp_kor") %> </td>
  215. <td class="insert_table_title" style="text-align: center; text-indent : 0px;">작 성 자</td>
  216. <td colspan="6" style="text-align: center;"><%=params.get("user_nm_before") %></td>
  217. </tr> --%>
  218. <div style="width: 100%; vertical-align: middle; float: left; text-align: left; padding-bottom: 8px;" >
  219. 평가자 : <%=params.get("user_nm_before") %>
  220. </div>
  221. <div style="width: 100%; vertical-align: middle; float: left; text-align: left; padding-bottom: 8px;" >
  222. 평가일 : <%=params.get("dt_before")%>
  223. </div>
  224. <div style="width: 100%; vertical-align: middle; float: left; text-align: left; padding-bottom: 8px;" >
  225. 업체명 : <%=params.get("corp_kor") %>
  226. </div>
  227. <tr style="height: 23px;">
  228. <td class="insert_table_title" style="text-align: center;">구 분</td>
  229. <td colspan="2" class="insert_table_title" style="text-align: center;">평 가 항 목</td>
  230. <td class="insert_table_title" style="text-align: center;">배당점수</td>
  231. <td class="insert_table_title" style="text-align: center;">평가점수</td>
  232. <td class="insert_table_title" style="text-align: center;">A</td>
  233. <td class="insert_table_title" style="text-align: center;">B</td>
  234. <td class="insert_table_title" style="text-align: center;">C</td>
  235. <td class="insert_table_title" style="text-align: center;">D</td>
  236. <td class="insert_table_title" style="text-align: center;">E</td>
  237. </tr>
  238. <%
  239. String chk = "";
  240. int idx = 0;
  241. int sum_stock_rate = 0;
  242. int all_sum_stock_rate = 0;
  243. String appr_cd = "";
  244. for(int i=0; i < getApprSrdList.size(); i++)
  245. {
  246. %>
  247. <tr>
  248. <td class="insert_table_title gubun" style="text-indent: 0px;"><%=getApprSrdList.getRow(i).get("GUBUN_1") %></td>
  249. <%-- <td class="insert_table_title gubun" style="text-indent: 0px;"><%=getApprSrdList.getRow(i).get("GUBUN_2") %></td> --%>
  250. <td colspan="2" class="insert_table_title gubun" style="text-indent: 0px; text-align: left;"><%=getApprSrdList.getRow(i).get("GUBUN_3") %></td>
  251. <td class="insert_table_title" style="text-align: center; text-indent: 0px;"><%=getApprSrdList.getRow(i).get("STOCK_RATE") %></td>
  252. <td style="text-align: center; text-indent: 0px;">
  253. <div id="result_<%=i%>">0</div>
  254. <div style="display: none;"><input type="text" name="appr_cd_<%=i %>" id="appr_cd_<%=i %>" value="<%=getApprSrdList.getRow(i).get("APPR_CD") %>" /></div>
  255. <div style="display: none;"><input type="text" name="chkResultCd_<%=i %>" id="chkResultCd_<%=i %>" value="" /></div>
  256. </td>
  257. <td style="text-align: center; text-indent: 0px;"><input type="radio" name="test_<%=i %>" id="test_<%=i %>" value="<%=getApprSrdList.getRow(i).get("A_RATE").replace("점", "") %>" <%=getApprSrdList.getRow(i).get("A_RATE").replace("점", "").equals(getApprSrdList.getRow(i).get("APPR_RATE")) ? "checked=\"checked\" " : ""%> /><div>(<%=getApprSrdList.getRow(i).get("A_RATE") %>)</div></td>
  258. <td style="text-align: center; text-indent: 0px;"><input type="radio" name="test_<%=i %>" id="test_<%=i %>" value="<%=getApprSrdList.getRow(i).get("B_RATE").replace("점", "") %>" <%=getApprSrdList.getRow(i).get("B_RATE").replace("점", "").equals(getApprSrdList.getRow(i).get("APPR_RATE")) ? "checked=\"checked\" " : ""%> /><div>(<%=getApprSrdList.getRow(i).get("B_RATE") %>)</div></td>
  259. <td style="text-align: center; text-indent: 0px;"><input type="radio" name="test_<%=i %>" id="test_<%=i %>" value="<%=getApprSrdList.getRow(i).get("C_RATE").replace("점", "") %>" <%=getApprSrdList.getRow(i).get("C_RATE").replace("점", "").equals(getApprSrdList.getRow(i).get("APPR_RATE")) ? "checked=\"checked\" " : ""%> /><div>(<%=getApprSrdList.getRow(i).get("C_RATE") %>)</div></td>
  260. <td style="text-align: center; text-indent: 0px;"><input type="radio" name="test_<%=i %>" id="test_<%=i %>" value="<%=getApprSrdList.getRow(i).get("D_RATE").replace("점", "") %>" <%=getApprSrdList.getRow(i).get("D_RATE").replace("점", "").equals(getApprSrdList.getRow(i).get("APPR_RATE")) ? "checked=\"checked\" " : ""%> /><div>(<%=getApprSrdList.getRow(i).get("D_RATE") %>)</div></td>
  261. <td style="text-align: center; text-indent: 0px;"><input type="radio" name="test_<%=i %>" id="test_<%=i %>" value="<%=getApprSrdList.getRow(i).get("E_RATE").replace("점", "") %>" <%=getApprSrdList.getRow(i).get("E_RATE").replace("점", "").equals(getApprSrdList.getRow(i).get("APPR_RATE")) ? "checked=\"checked\" " : ""%> /><div>(<%=getApprSrdList.getRow(i).get("E_RATE") %>)</div></td>
  262. </tr>
  263. <%
  264. all_sum_stock_rate += sum_stock_rate;
  265. sum_stock_rate = 0;
  266. idx++;
  267. }%>
  268. <%
  269. if (params.get("P_CHARGE_CD").equals("C")) {%>
  270. <TR style="height: 23px;" >
  271. <TD class="insert_table_title" style="text-align: center;" colspan="2">특 기 사 항</TD>
  272. <TD style="text-align: left;" colspan="8">&nbsp;<input type="text" class="input byteChk ctrlTarget" style="width: 98%;" name="APPR_NOTE" id="APPR_NOTE" value="<%=vo.get("APPR_NOTE") %>" /></TD>
  273. </TR>
  274. </table>
  275. <%} else
  276. {%>
  277. </table><input type="hidden" name="APPR_NOTE" id="APPR_NOTE" value="<%=vo.get("APPR_NOTE")%>" />
  278. <%} %>
  279. <div style="width: 100%; text-align: center; margin-top: 20px;">
  280. <span id="save" name="save" class="btnSearch center"><a href="javascript:void(0);" id="btn_save">저장</a></span>
  281. <span id="confirm" name="confirm" class="btnSearch center"><a href="javascript:void(0);" id="btnAppReq">확정</a></span>
  282. <span id="close" name="close" class="btnSearch center"><a href="javascript:void(0);" id="btn_close">닫기</a></span>
  283. </div>
  284. </form>