DivContPop.jsp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <%--
  2. - Author(s) : chj
  3. - Date : 2015-02-24
  4. - Description: 분할발주 업체선정
  5. --%>
  6. <%@ page contentType="text/html; charset=utf-8" %>
  7. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  8. <%@ page import="com.udapsoft.waf.system.*" %>
  9. <%@ page import="com.udapsoft.waf.common.*" %>
  10. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  11. <%@ page import="com.udapsoft.waf.common.util.StringUtils"%>
  12. <%@ page import="kr.co.hsnc.common.util.*"%>
  13. <%@ page import="kr.co.hsnc.common.sql.*" %>
  14. <%@ page import="kr.co.udapsoft.common.*" %>
  15. <%@ page import="kr.co.udapsoft.ebid.buyer.common.file.FileManager"%>
  16. <%@ include file="/jsp/work/taglib.jsp" %>
  17. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  18. <%
  19. ctx.init(request, response);
  20. HandlerStorage storage = ctx.getHandlerStorage();
  21. ValueObject user = ctx.getUser();
  22. ValueObject params = storage.getParams();
  23. String event = storage.getEvent();
  24. String BID_NO = (String) storage.get("BID_NO");
  25. String BID_DEG = (String) storage.get("BID_DEG");
  26. String pop_win_id = (String) storage.get("pop_win_id");
  27. ValueObject divCont = storage.getValueObject("divCont");
  28. System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
  29. System.out.println(divCont);
  30. System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
  31. %>
  32. <SCRIPT language="JavaScript">
  33. function _onReady(){
  34. gridInit(sheet1);
  35. jQuery("#btn_search").click(function(){
  36. doSearchSheet();
  37. });
  38. jQuery("#btn_save").click(function(){
  39. jQuery("#fevent").val("SAVE_VENDOR_LIST");
  40. var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/purchase/DivContPop_sheet.screen";
  41. Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), 30, "");
  42. });
  43. doSearchSheet();
  44. }
  45. /**
  46. * IBSheet object initialize
  47. */
  48. function gridInit(sheetName){
  49. var init_sheet = {};
  50. init_sheet.Cfg = {SearchMode:2, Page:30 , MergeSheet:msHeaderOnly};
  51. init_sheet.Cols = [
  52. {Header:'상태|상태', Type:"Status", SaveName:"STATUS", Width:100, Align:"Right", Edit:false, Hidden:true},
  53. {Header:'자재코드|자재코드', Type:"Text", SaveName:"MATERIAL_CD", Width:100, Align:"Right", Edit:false, Hidden:true},
  54. {Header:'자재명|자재명', Type:"Text", SaveName:"MATERIAL_NM", Width:150, Align:"Left", Edit:false},
  55. {Header:'규격|규격', Type:"Text", SaveName:"MATERIAL_SPEC", Width:120, Align:"Left", Edit:false},
  56. {Header:'단위|단위', Type:"Text", SaveName:"UNIT_KIND", Width:80, Align:"Center", Edit:false},
  57. {Header:'견적의뢰수량|견적의뢰수량', Type:"Float", SaveName:"ESTI_QTY", Width:100, Align:"Right", Edit:false},
  58. {Header:'잔량|잔량', Type:"Float", SaveName:"REMAIN_QTY", Width:100, Align:"Right", Edit:false, CalcLogic:"|ESTI_QTY|-|V1_SELECT_QTY|-|V2_SELECT_QTY|-|V3_SELECT_QTY|-|V4_SELECT_QTY|-|V5_SELECT_QTY|"},
  59. {Header: '<%=divCont.get("V1")%>'+'|선정수량', Type:"Float", SaveName:"V1_SELECT_QTY", Width:70, Align:"Right", Edit:true, PointCount:2},
  60. {Header:'<%=divCont.get("V1")%>'+'|단가', Type:"Float", SaveName:"V1_UNIT_COST", Width:100, Align:"Right", Edit:false, PointCount:'<%=divCont.get("V1_POINT")%>'},
  61. {Header:'<%=divCont.get("V1")%>'+'|금액', Type:"Float", SaveName:"V1_SELECT_AMT", Width:100, Align:"Right", Edit:false, CalcLogic:"|V1_SELECT_QTY|*|V1_UNIT_COST|", PointCount:'<%=divCont.get("V1_POINT")%>'},
  62. {Header:'<%=divCont.get("V2")%>'+'|선정수량', Type:"Float", SaveName:"V2_SELECT_QTY", Width:70, Align:"Right", Edit:true, PointCount:2},
  63. {Header:'<%=divCont.get("V2")%>'+'|단가', Type:"Float", SaveName:"V2_UNIT_COST", Width:100, Align:"Right", Edit:false, PointCount:'<%=divCont.get("V2_POINT")%>'},
  64. {Header:'<%=divCont.get("V2")%>'+'|금액', Type:"Float", SaveName:"V2_SELECT_AMT", Width:100, Align:"Right", Edit:false, CalcLogic:"|V2_SELECT_QTY|*|V2_UNIT_COST|", PointCount:'<%=divCont.get("V2_POINT")%>'},
  65. {Header:'<%=divCont.get("V3")%>'+'|선정수량', Type:"Float", SaveName:"V3_SELECT_QTY", Width:70, Align:"Right", Edit:true, PointCount:2},
  66. {Header:'<%=divCont.get("V3")%>'+'|단가', Type:"Float", SaveName:"V3_UNIT_COST", Width:100, Align:"Right", Edit:false, PointCount:'<%=divCont.get("V3_POINT")%>'},
  67. {Header:'<%=divCont.get("V3")%>'+'|금액', Type:"Float", SaveName:"V3_SELECT_AMT", Width:100, Align:"Right", Edit:false, CalcLogic:"|V3_SELECT_QTY|*|V3_UNIT_COST|", PointCount:'<%=divCont.get("V3_POINT")%>'},
  68. {Header:'<%=divCont.get("V4")%>'+'|선정수량', Type:"Float", SaveName:"V4_SELECT_QTY", Width:70, Align:"Right", Edit:true, PointCount:2},
  69. {Header:'<%=divCont.get("V4")%>'+'|단가', Type:"Float", SaveName:"V4_UNIT_COST", Width:100, Align:"Right", Edit:false, PointCount:'<%=divCont.get("V4_POINT")%>'},
  70. {Header:'<%=divCont.get("V4")%>'+'|금액', Type:"Float", SaveName:"V4_SELECT_AMT", Width:100, Align:"Right", Edit:false, CalcLogic:"|V4_SELECT_QTY|*|V4_UNIT_COST|", PointCount:'<%=divCont.get("V4_POINT")%>'},
  71. {Header:'<%=divCont.get("V5")%>'+'|선정수량', Type:"Float", SaveName:"V5_SELECT_QTY", Width:70, Align:"Right", Edit:true, PointCount:2},
  72. {Header:'<%=divCont.get("V5")%>'+'|단가', Type:"Float", SaveName:"V5_UNIT_COST", Width:100, Align:"Right", Edit:false, PointCount:'<%=divCont.get("V5_POINT")%>'},
  73. {Header:'<%=divCont.get("V5")%>'+'|금액', Type:"Float", SaveName:"V5_SELECT_AMT", Width:100, Align:"Right", Edit:false, CalcLogic:"|V5_SELECT_QTY|*|V5_UNIT_COST|", PointCount:'<%=divCont.get("V5_POINT")%>'},
  74. {Header:'업체1|업체1', Type:"Text", SaveName:"V1_VENDOR_CD", Width:100, Align:"Right", Edit:false, Hidden:true},
  75. {Header:'업체2|업체2', Type:"Text", SaveName:"V2_VENDOR_CD", Width:100, Align:"Right", Edit:false, Hidden:true},
  76. {Header:'업체3|업체3', Type:"Text", SaveName:"V3_VENDOR_CD", Width:100, Align:"Right", Edit:false, Hidden:true},
  77. {Header:'업체4|업체4', Type:"Text", SaveName:"V4_VENDOR_CD", Width:100, Align:"Right", Edit:false, Hidden:true},
  78. {Header:'업체5|업체5', Type:"Text", SaveName:"V5_VENDOR_CD", Width:100, Align:"Right", Edit:false, Hidden:true},
  79. ];
  80. init_sheet.HeaderMode = {Sort:1,HeaderCheck:false};
  81. IBS_InitSheet(sheetName, init_sheet);
  82. sheetName.SetDataAutoTrim(0);
  83. sheet1.SetEditable(true);
  84. }
  85. /*시트 조회*/
  86. function doSearchSheet(){
  87. $("#fevent").val("GET_VENDOR_LIST");
  88. var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/purchase/DivContPop_sheet.screen";
  89. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  90. }
  91. /*시트 조회후 로직*/
  92. function sheet1_OnSearchEnd(code, message) {
  93. if(code == 0) {
  94. if("<%=divCont.get("V1")%>" == ""){
  95. sheet1.SetColEditable("V1_SELECT_QTY",false);
  96. }
  97. if("<%=divCont.get("V2")%>" == ""){
  98. sheet1.SetColEditable("V2_SELECT_QTY",false);
  99. }
  100. if("<%=divCont.get("V3")%>" == ""){
  101. sheet1.SetColEditable("V3_SELECT_QTY",false);
  102. }
  103. if("<%=divCont.get("V4")%>" == ""){
  104. sheet1.SetColEditable("V4_SELECT_QTY",false);
  105. }
  106. if("<%=divCont.get("V5")%>" == ""){
  107. sheet1.SetColEditable("V5_SELECT_QTY",false);
  108. }
  109. //sheet1.FitColWidth();
  110. } else {
  111. alert(message);
  112. }
  113. }
  114. /*시트 저장후 로직*/
  115. function sheet1_OnSaveEnd(code, msg)
  116. {
  117. if(code>= "0"){
  118. alert("저장되었습니다.");
  119. }else{
  120. alert("에러가 발생 하였습니다.\n" + msg);
  121. }
  122. }
  123. /*시트 validation 이벤트*/
  124. function sheet1_OnChange(Row, Col, Value) {
  125. var sSaveName = sheet1.ColSaveName(Col);
  126. if (sSaveName == "V1_SELECT_QTY") {
  127. if(sheet1.GetCellValue(Row, "REMAIN_QTY") < 0){
  128. alert("잔여가 0보다 적으면 안됩니다.");
  129. }
  130. }else if(sSaveName == "V2_SELECT_QTY"){
  131. if(sheet1.GetCellValue(Row, "REMAIN_QTY") < 0){
  132. alert("잔여가 0보다 적으면 안됩니다.");
  133. }
  134. }else if(sSaveName == "V3_SELECT_QTY"){
  135. if(sheet1.GetCellValue(Row, "REMAIN_QTY") < 0){
  136. alert("잔여가 0보다 적으면 안됩니다.");
  137. }
  138. }else if(sSaveName == "V4_SELECT_QTY"){
  139. if(sheet1.GetCellValue(Row, "REMAIN_QTY") < 0){
  140. alert("잔여가 0보다 적으면 안됩니다.");
  141. }
  142. }else if(sSaveName == "V5_SELECT_QTY"){
  143. if(sheet1.GetCellValue(Row, "REMAIN_QTY") < 0){
  144. alert("잔여가 0보다 적으면 안됩니다.");
  145. }
  146. }
  147. }
  148. function sheet1_OnValidation(Row, Col, Value) {
  149. if(sheet1.GetCellValue(Row, "REMAIN_QTY") < 0){
  150. alert("잔여가 0보다 적으면 안됩니다.");
  151. sheet1.ValidateFail(1);
  152. }
  153. }
  154. </SCRIPT>
  155. <modular:search id="form1">
  156. <modular:key id="fevent" />
  157. </modular:search>
  158. <form id="form1" name="form1" method="post" modular:type="search">
  159. <INPUT type='hidden' name="fevent" id="fevent" value="">
  160. <INPUT type='hidden' name="BID_NO" value="<%=BID_NO%>">
  161. <INPUT type='hidden' name="BID_DEG" value="<%=BID_DEG%>">
  162. <INPUT type='hidden' name="V1_CD" value="<%=divCont.get("V1_CD")%>">
  163. <INPUT type='hidden' name="V2_CD" value="<%=divCont.get("V2_CD")%>">
  164. <INPUT type='hidden' name="V3_CD" value="<%=divCont.get("V3_CD")%>">
  165. <INPUT type='hidden' name="V4_CD" value="<%=divCont.get("V4_CD")%>">
  166. <INPUT type='hidden' name="V5_CD" value="<%=divCont.get("V5_CD")%>">
  167. <TABLE class="screen_title_table">
  168. <TR height="2"><TD colspan="2"></TD>
  169. </TR>
  170. <TR height="25"><TD>
  171. <!-- 제목 및 버튼 -->
  172. <table id="t1" width="100%" class="ftit_table">
  173. <colgroup>
  174. <col width="*" />
  175. <col width="150" />
  176. </colgroup>
  177. <tr>
  178. <th align="left">기술검토 상태 :</th>
  179. <td align="right">
  180. <span class="btnSearch center" id="btn_search"><a href="javascript:void(0);" id="btnSearch">조회</a></span>
  181. <span class="btnSearch center" id="btn_save"><a href="javascript:void(0);" id="btn_save">저장</a></span>
  182. </td>
  183. </tr>
  184. </table>
  185. </TD>
  186. </TR>
  187. </TABLE>
  188. <div id="sheet1_div" style="padding-top:5px;height: auto; min-height: 450px; overflow: auto;">
  189. <script>createIBSheet('sheet1','100%', '450px');</script>
  190. </div>
  191. </form>