SMRSK00200_구매요구선택.xrw 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
  3. <xhtml:html xmlns:ex="http://www.comsquare.co.kr/xforms/excel" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:my="http://www.comsquare.co.kr/example" xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:cs="http://www.comsquare.co.kr/xforms">
  4. <xhtml:head>
  5. <xhtml:title>구매요구 내역</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <list>
  11. <purcdmndmaininfo>
  12. <purcdmndmainlist>
  13. </purcdmndmainlist>
  14. </purcdmndmaininfo>
  15. <purcdmndsubinfo>
  16. <purcdmndsublist/>
  17. </purcdmndsubinfo>
  18. </list>
  19. </main>
  20. <target/>
  21. <init>
  22. </init>
  23. <send>
  24. <mainsearch>
  25. <instcd/>
  26. <acntcd/>
  27. <purcdmndddfr/>
  28. <purcdmndddto/>
  29. <reqdeptcd/>
  30. <reqdeptnm/>
  31. <goodcd/>
  32. <purcpgmgubn/>
  33. <purcdmndmmfr/>
  34. <purcdmndmmto/>
  35. </mainsearch>
  36. <subsearch>
  37. <instcd/>
  38. <purcpgmgubn/>
  39. <purcdmnddd/>
  40. <purcdmndno/>
  41. </subsearch>
  42. </send>
  43. <temp/>
  44. </root>
  45. </instance>
  46. <script type="javascript">
  47. <![CDATA[
  48. function fInitialize()
  49. {
  50. // 금일 날자 설정
  51. var curdate = getCurrentDate();
  52. var cvtdate = curdate.toDate("YYYYMMDD");
  53. var csv_acntcd = opener.window.javascript.getParameter("para_acntcd");
  54. var csv_purcpgmgubn = opener.window.javascript.getParameter("para_purcpgmgubn");
  55. var csv_bizflag = opener.window.javascript.getParameter("para_bizflag");
  56. var csv_purcdmnddd = opener.window.javascript.getParameter("para_purcdmnddd");
  57. var csv_unitcostconyn = opener.window.javascript.getParameter("para_unitcostconyn"); //단가계약 버튼FLAG
  58. model.removenode("/root/main/list/purcdmndmaininfo/purcdmndmainlist");
  59. model.removenode("/root/main/list/purcdmndsubinfo/purcdmndsublist");
  60. if (csv_purcpgmgubn == "3"){ //자산구분이 약품일 경우
  61. if(csv_unitcostconyn=="Y"){ //약품단가계약 일경우
  62. document.title="단가계약 내역";
  63. cap_tit.value = "단가계약 내역";
  64. cap_tit1.value = "단가계약 정보";
  65. cap_tit2.value = "단가계약 상세정보";
  66. model.makeValue("/root/send/mainsearch/unitcostconyn",csv_unitcostconyn);
  67. }
  68. cap_purcdmndmm.visible = true;
  69. cal_purcdmndmmfr.visible = true;
  70. cal_purcdmndmmto.visible = true;
  71. cap_purcdmnddd.visible = false;
  72. cal_purcdmndddfr.visible = false;
  73. cal_purcdmndddto.visible = false;
  74. }else{
  75. cap_purcdmndmm.visible = false;
  76. cal_purcdmndmmfr.visible = false;
  77. cal_purcdmndmmto.visible = false;
  78. cap_purcdmnddd.visible = true;
  79. cal_purcdmndddfr.visible = true;
  80. cal_purcdmndddto.visible = true;
  81. }
  82. model.setValue(ipt_acntcd.attribute("ref") , csv_acntcd);
  83. model.setValue(ipt_purcpgmgubn.attribute("ref") , csv_purcpgmgubn);
  84. if (csv_bizflag == "SMRSK01000"){ //단가납품지시에서 호출했을 경우
  85. model.setValue(cal_purcdmndddfr.attribute("ref") , csv_purcdmnddd);
  86. model.setValue(cal_purcdmndddto.attribute("ref") , csv_purcdmnddd);
  87. model.setValue(ipt_reqdeptcd.attribute("ref") , "");
  88. model.setValue(opt_reqdeptnm.attribute("ref") , "");
  89. }else{
  90. model.setValue(cal_purcdmndddfr.attribute("ref") , curdate);
  91. model.setValue(cal_purcdmndddto.attribute("ref") , curdate);
  92. //model.setValue(ipt_reqdeptcd.attribute("ref") , getUserInfo("dutplcecd"));
  93. //model.setValue(opt_reqdeptnm.attribute("ref") , getUserInfo("dutplcenm"));
  94. }
  95. model.setValue(cal_purcdmndmmfr.attribute("ref") , curdate);
  96. model.setValue(cal_purcdmndmmto.attribute("ref") , curdate);
  97. // misfComboComCdList("030M0001",cmb_wareflag);
  98. // misfComboComCdListMulti("Z0007","cmb_instcd");
  99. model.setValue("/root/send/mainsearch/instcd", getUserInfo("dutplceinstcd")); // 기관 설정
  100. //model.setValue(ipt_windtfrom.attribute("ref") ,cvtdate.getAddDate(-10,"D").getDateFormat("YYYYMMDD"));
  101. btn_search.dispatch("DOMActivate");
  102. model.refresh();
  103. }
  104. ]]>
  105. </script>
  106. <script type="javascript" ev:event="xforms-ready">
  107. <![CDATA[
  108. fInitialize();
  109. ]]>
  110. </script>
  111. <submission id="TRRSK00201" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/mainsearch" resultref="/root/main/list/purcdmndmaininfo"/>
  112. <submission id="TRRSK00202" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/subsearch" resultref="/root/main/list/purcdmndsubinfo"/>
  113. </model>
  114. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  115. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  116. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  117. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  118. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  119. <script type="javascript" src="../../../com/commonweb/js/numericHelper.js"/>
  120. <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
  121. <script type="javascript" src="../../../mis/humtrafactmngtweb/js/RPB001.js"/>
  122. </xhtml:head>
  123. <xhtml:body pagewidth="1100" pageheight="480" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  124. <caption id="cap_tit1" class="tit_2" style="left:5px; top:79px; width:105px; height:13px; ">구매요구 정보</caption>
  125. <line id="line1" class="line_1" style="x1:0px; y1:99px; x2:310px; y2:99px; "/>
  126. <caption id="cap_tit" class="tit_1" style="left:0px; top:0px; width:600px; height:14px; ">구매요구 내역</caption>
  127. <button id="btn_confirm" class="btn4_letter2" style="left:1015px; top:440px; width:56px; height:22px; ">
  128. <caption>닫기</caption>
  129. <script type="javascript" ev:event="DOMActivate">
  130. <![CDATA[
  131. window.close();
  132. ]]>
  133. </script>
  134. </button>
  135. <group id="grp_search" style="left:0px; top:22px; width:1080px; height:48px; vertical-align:top; ">
  136. <shape id="roundrect1" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:1075px; height:40px; background-color:#fffbf2; border-color:#ffd799; "/>
  137. <button id="btn_search" class="btn1_letter2" style="left:1005px; top:7px; width:56px; height:22px; ">
  138. <caption>조회</caption>
  139. <script type="javascript" ev:event="DOMActivate">
  140. <![CDATA[
  141. model.removeNodeset("/root/main/list/purcdmndmaininfo/purcdmndmainlist");
  142. submit("TRRSK00201");
  143. ]]>
  144. </script>
  145. </button>
  146. <line id="line30" class="line_4" style="x1:995px; y1:3px; x2:995px; y2:35px; "/>
  147. <input id="cal_purcdmndddfr" ref="/root/send/mainsearch/purcdmndddfr" inputtype="date" style="left:101px; top:10px; width:105px; height:19px; text-align:center; "/>
  148. <caption id="cap_purcdmnddd" class="search_name" style="left:10px; top:10px; width:96px; height:17px; vertical-align:middle; ">요구일자 :</caption>
  149. <input id="cal_purcdmndddto" ref="/root/send/mainsearch/purcdmndddto" inputtype="date" style="left:235px; top:10px; width:105px; height:19px; text-align:center; "/>
  150. <caption id="caption2" style="left:214px; top:13px; width:20px; height:17px; font-weight:bold; vertical-align:middle; ">~</caption>
  151. <caption id="caption3" class="search_name" style="left:365px; top:10px; width:96px; height:17px; vertical-align:middle; ">요구부서 :</caption>
  152. <button id="btn_reqdeptcd" class="icon_search" style="left:549px; top:12px; width:16px; height:16px; ">
  153. <caption/>
  154. <script type="javascript" ev:event="DOMActivate">
  155. <![CDATA[
  156. var recv_list = "reqdeptcd,reqdeptnm";
  157. misfOpenPopUpList("02", ipt_reqdeptcd,"", recv_list) ;
  158. model.refresh();
  159. ]]>
  160. </script>
  161. </button>
  162. <input id="ipt_reqdeptcd" ref="/root/send/mainsearch/reqdeptcd" class="input_essential" style="left:460px; top:10px; width:85px; height:19px; ">
  163. <script type="javascript" ev:event="xforms-value-changed">
  164. <![CDATA[
  165. misfValidationCheck("02", "", "reqdeptcd,reqdeptnm" );
  166. model.refresh();
  167. ]]>
  168. </script>
  169. <script type="javascript" ev:event="onkeydown">
  170. <![CDATA[
  171. if(event.keyCode == 9)
  172. {
  173. if(event.shiftKey)model.setFocus("ipt_fromdd");
  174. else model.setFocus("ipt_reqflag");
  175. }
  176. //event.preventDefault();
  177. ]]>
  178. </script>
  179. </input>
  180. <output id="opt_reqdeptnm" ref="/root/send/mainsearch/reqdeptnm" class="output_fix" appearance="output" style="left:572px; top:10px; width:124px; height:19px; "/>
  181. <caption id="cap_goodcd" class="search_name" style="left:715px; top:10px; width:86px; height:17px; ">물품코드 :</caption>
  182. <input id="ipt_goodcd" ref="/root/send/mainsearch/goodcd" class="input_search" maxlength="10" appearance="input" style="left:811px; top:10px; width:89px; height:19px; "/>
  183. <input id="ipt_instcd" ref="/root/send/mainsearch/instcd" class="input_search" visibility="hidden" appearance="input" style="left:905px; top:6px; width:45px; height:19px; "/>
  184. <input id="ipt_acntcd" ref="/root/send/mainsearch/acntcd" class="input_search" visibility="hidden" appearance="input" style="left:950px; top:6px; width:45px; height:19px; "/>
  185. <input id="ipt_purcpgmgubn" ref="/root/send/mainsearch/purcpgmgubn" class="input_search" visibility="hidden" appearance="input" style="left:905px; top:25px; width:45px; height:19px; "/>
  186. <input id="cal_purcdmndmmfr" ref="/root/send/mainsearch/purcdmndmmfr" inputtype="date" format="yyyy-mm" style="left:101px; top:10px; width:105px; height:19px; text-align:center; "/>
  187. <input id="cal_purcdmndmmto" ref="/root/send/mainsearch/purcdmndmmto" inputtype="date" format="yyyy-mm" style="left:235px; top:10px; width:105px; height:19px; text-align:center; "/>
  188. <caption id="cap_purcdmndmm" class="search_name" style="left:10px; top:10px; width:96px; height:17px; vertical-align:middle; ">요구년월 :</caption>
  189. </group>
  190. <caption id="cap_tit2" class="tit_2" style="left:330px; top:79px; width:131px; height:13px; ">구매요구 상세 정보</caption>
  191. <line id="line2" class="line_1" style="x1:325px; y1:99px; x2:1080px; y2:99px; "/>
  192. <button id="button1" class="btn4_letter2" style="left:950px; top:440px; width:56px; height:22px; ">
  193. <caption>적용</caption>
  194. <script type="javascript" ev:event="DOMActivate">
  195. <![CDATA[
  196. var iParam = model.getValue(grd_gooddmndsub.nodeset);
  197. var nodelist = instance1.selectNodes(grd_gooddmndsub.nodeset);
  198. var CVS = getNodeListCSV(nodelist);
  199. if ( checkOpener() ) {
  200. opener.javascript.setParameter("SMRSD00400_", CVS);
  201. } else {
  202. var rtn = messageBox("상위화면을 찾을 수", "E001");
  203. }
  204. model.close();
  205. ]]>
  206. </script>
  207. </button>
  208. <button id="btn_insert" class="btn2_letter2" style="left:1025px; top:75px; width:42px; height:19px; ">
  209. <caption>수정</caption>
  210. <script type="javascript" ev:event="DOMActivate">
  211. <![CDATA[
  212. for(i=grd_gooddmndsub.fixedRows;i<grd_gooddmndsub.rows;i++){
  213. grd_gooddmndsub.cellAttribute("disabled", i , grd_gooddmndsub.colRef("cnsttnqty" )) = "false";
  214. grd_gooddmndsub.cellAttribute("disabled", i , grd_gooddmndsub.colRef("goodunitcost" )) = "false";
  215. }
  216. ]]>
  217. </script>
  218. </button>
  219. <datagrid id="grd_gooddmndmain" nodeset="/root/main/list/purcdmndmaininfo/purcdmndmainlist" caption="기관코드^요구일자/NO^요구일자/NO^부서" colsep="^" colwidth="23, 81, 49, 136" dataheight="25" extendlastcol="scroll" mergecellsfixedrows="bycolrec" rowheader="update" rowheight="25" rowsep="|" style="left:0px; top:105px; width:310px; height:320px; ">
  220. <col ref="instcd" type="output" visibility="hidden" style="text-align:center; "/>
  221. <col ref="purcdmnddd" type="output" style="text-align:center; "/>
  222. <col ref="purcdmndno" style="text-align:center; "/>
  223. <col ref="reqdeptnm" style="text-align:left; padding-left:10; "/>
  224. <script type="javascript" ev:event="onclick">
  225. <![CDATA[
  226. var spath = "/root/send/subsearch";
  227. model.setValue(spath+"/instcd" , grd_gooddmndmain.valueMatrix(grd_gooddmndmain.row, grd_gooddmndmain.colRef("instcd")));
  228. model.setValue(spath+"/purcpgmgubn", model.getValue(ipt_purcpgmgubn.attribute("ref")));
  229. model.setValue(spath+"/purcdmnddd" , grd_gooddmndmain.valueMatrix(grd_gooddmndmain.row, grd_gooddmndmain.colRef("purcdmnddd")));
  230. model.setValue(spath+"/purcdmndno" , grd_gooddmndmain.valueMatrix(grd_gooddmndmain.row, grd_gooddmndmain.colRef("purcdmndno")));
  231. submit("TRRSK00202");
  232. model.resetInstanceNode(spath);
  233. for(i=grd_gooddmndsub.fixedRows;i<grd_gooddmndsub.rows;i++){
  234. grd_gooddmndsub.cellAttribute("disabled", i , grd_gooddmndsub.colRef("cnsttnqty" )) = "true";
  235. grd_gooddmndsub.cellAttribute("disabled", i , grd_gooddmndsub.colRef("goodunitcost" )) = "true";
  236. }
  237. ]]>
  238. </script>
  239. </datagrid>
  240. <datagrid id="grd_gooddmndsub" nodeset="/root/main/list/purcdmndsubinfo/purcdmndsublist" caption="SEQ^물품코드^물품코드^물품명^요구량^잔존량^품의량^단위^BOX 단위^조정단가^기관코드^구매요구일자^구매요구번호^구매요구일련번호^계정과목^규격^모델^요구포장단위당갯수^제조사코드^제조사명^요구부서 코드^요구부서명" colsep="^" colwidth="50, 105, 32, 173, 52, 57, 56, 53, 22, 66, 23, 17, 24, 17, 24, 23, 17, 19, 24, 17, 100, 100" dataheight="25" extendlastcol="scroll" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="25" rowsep="|" style="left:325px; top:105px; width:755px; height:320px; ">
  241. <col ref="purcdmndseq" type="output" _key="true" style="text-align:center; "/>
  242. <col ref="goodcd" type="output" _key="true" style="text-align:center; "/>
  243. <col ref="allsizespecid" type="output" _key="true" style="text-align:center; "/>
  244. <col ref="goodnm" style="text-align:left; padding-left:10; "/>
  245. <col ref="reqqty" format="#,###" style="text-align:right; "/>
  246. <col ref="spreqty" format="#,###" style="text-align:right; "/>
  247. <col ref="cnsttnqty" type="input" format="#,###" style="text-align:right; "/>
  248. <col ref="requnit" type="output" style="text-align:left; padding-left:10; "/>
  249. <col ref="fullpurcunit" type="output" visibility="hidden" style="text-align:left; padding-left:10; "/>
  250. <col ref="goodunitcost" type="input" format="#,###" style="text-align:right; "/>
  251. <col ref="instcd" visibility="hidden" style="text-align:center; "/>
  252. <col ref="purcdmnddd" visibility="hidden" style="text-align:center; "/>
  253. <col ref="purcdmndno" visibility="hidden" style="text-align:center; "/>
  254. <col ref="purcdmndseq" visibility="hidden" style="text-align:center; "/>
  255. <col ref="acntcd" visibility="hidden" style="text-align:center; "/>
  256. <col ref="goodspec" visibility="hidden" style="text-align:left; padding-left:10; "/>
  257. <col ref="goodmodel" visibility="hidden" style="text-align:left; padding-left:10; "/>
  258. <col ref="reqpackcntperunit" visibility="hidden" style="text-align:center; "/>
  259. <col ref="prodcmpycd" visibility="hidden" style="text-align:center; "/>
  260. <col ref="prodcmpynm" visibility="hidden" style="text-align:center; "/>
  261. <col ref="reqdeptcd"/>
  262. <col ref="reqdeptnm"/>
  263. <script type="javascript" ev:event="xforms-value-changed">
  264. <![CDATA[
  265. if(grd_gooddmndsub.col == grd_gooddmndsub.colRef("cnsttnqty")){
  266. grd_gooddmndsub.valueMatrix(grd_gooddmndsub.row, grd_gooddmndsub.colRef("spreqty")) = parseFloat(grd_gooddmndsub.valueMatrix(grd_gooddmndsub.row, grd_gooddmndsub.colRef("reqqty"))) - parseFloat(grd_gooddmndsub.valueMatrix(grd_gooddmndsub.row, grd_gooddmndsub.colRef("cnsttnqty")));
  267. grd_gooddmndsub.valueMatrix(grd_gooddmndsub.row, grd_gooddmndsub.colRef("reqpackcnt")) = (parseFloat(grd_gooddmndsub.valueMatrix(grd_gooddmndsub.row, grd_gooddmndsub.colRef("cnsttnqty"))) / parseFloat(grd_gooddmndsub.valueMatrix(grd_gooddmndsub.row, grd_gooddmndsub.colRef("reqpackcntperunit")))).toString().getRound(-1,"UP");
  268. }
  269. ]]>
  270. </script>
  271. </datagrid>
  272. </xhtml:body>
  273. </xhtml:html>