SMRSO23010_적정재고량관리(팝업).xrw 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet ype="text/css" href="../../../com/commonweb/css/common.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. <prprtystoc>
  11. <prprtystoclist/>
  12. </prprtystoc>
  13. </main>
  14. <send>
  15. <search>
  16. <instcd/>
  17. <mngtdeptcd/>
  18. <mngtdeptnm/>
  19. <wareflag/>
  20. <reqdd/>
  21. <chkrow/>
  22. </search>
  23. <save>
  24. <prprtystoclist/>
  25. </save>
  26. <mthuseqty>
  27. <instcd/>
  28. <goodcd/>
  29. <deptcd/>
  30. <flag/>
  31. </mthuseqty>
  32. </send>
  33. <init>
  34. <wareflag/>
  35. </init>
  36. <hidden/>
  37. <temp>
  38. </temp>
  39. <mthuse>
  40. <mthuseqty/>
  41. </mthuse>
  42. <popgood>
  43. <instcd/>
  44. <wareflag/>
  45. <delivedd/>
  46. <basedd/>
  47. <selectyn/>
  48. <goodcd/>
  49. <goodlist>
  50. <goodcd/>
  51. </goodlist>
  52. </popgood>
  53. <popdata>
  54. <instcd/>
  55. <deptcd/>
  56. <deptnm/>
  57. <reqdd/>
  58. <wareflag/>
  59. </popdata>
  60. </root>
  61. </instance>
  62. <script type="javascript" ev:event="xforms-ready">
  63. <![CDATA[
  64. //화면 Control을 초기화한다
  65. misfGridInit(grd_prprtystoclist);
  66. misfComboComCdList("Z0007",cmb_instcd);
  67. submit("TRRSD20002");
  68. model.setValue("/root/send/search/mngtdeptcd", model.getValue("/root/popdata/deptcd"));
  69. model.setValue("/root/send/search/mngtdeptnm", model.getValue("/root/popdata/deptnm"));
  70. model.setValue("/root/send/search/instcd", model.getValue("/root/popdata/instcd"));
  71. model.setValue("/root/send/search/reqdd", model.getValue("/root/popdata/reqdd"));
  72. model.setValue("/root/send/search/wareflag", model.getValue("/root/popdata/wareflag"));
  73. btn_search.dispatch("DOMActivate");
  74. model.refresh();
  75. ]]>
  76. </script>
  77. <submission id="TXRSO23001" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/save" resultref="/root/temp"/>
  78. <submission id="TRRSO23002" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/mthuseqty" resultref="/root/mthuse"/>
  79. <submission id="TRRSO20104" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/popgood" resultref="/root/main/good"/>
  80. <submission id="TRRSO23011" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/search" resultref="/root/main/prprtystoc"/>
  81. <submission id="TRRSD20002" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/temp" resultref="/root/init/wareflag"/>
  82. </model>
  83. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  84. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  85. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  86. <script type="javascript" src="../../../com/commonweb/js/numericHelper.js"/>
  87. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  88. <script type="javascript" src="../../../mis/miscommonweb/js/RSZ001.js"/>
  89. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  90. <script type="javascript">
  91. <![CDATA[
  92. function fGetGoodDetail() {
  93. for(var k = 1; k <= instance1.selectNodes("/root/popgood/goodlist").length; k++) {
  94. var bDup = false; //물품코드가 중복되었는지를 확인하기 위한 변수
  95. //popup에서 선택한 물품코드가 이미 grid에 존재하고 있는지를 check하여 이미 존재하면 message를 보여주고 return한다.
  96. for(var i = 1; i < grd_prprtystoclist.rows; i++) {
  97. if( grd_prprtystoclist.valueMatrix(i, grd_prprtystoclist.colRef("goodcd")) == model.getValue("/root/popgood/goodlist[" + k + "]/goodcd") ) {
  98. messageBox("물품코드가 중복되었습니다. [" + grd_prprtystoclist.valueMatrix(i, grd_prprtystoclist.colRef("goodcd")) + "] ", "E999", ""); //E: 경고
  99. bDup = true;
  100. continue;
  101. }
  102. }
  103. if( bDup == false ) {
  104. // node 삭제
  105. //model.removenode("/root/main/gooddetail");
  106. //TRRSO20104를 위해 물품코드를 goodcd에 넣는다.
  107. model.setValue( "/root/popgood/goodcd", model.getValue("/root/popgood/goodlist[" + k + "]/goodcd") );
  108. if( submit("TRRSO20104") ) {
  109. /* model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/instcd", model.getValue("/root/send/search/instcd"));
  110. model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/delivedd", model.getValue("/root/send/search/delivedd"));
  111. //model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/deliveno", model.getValue("/root/send/search/deliveno"));
  112. //model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/deliveseq", model.getValue("/root/send/search/deliveseq"));
  113. model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/wareflag", model.getValue("/root/send/search/wareflag"));
  114. model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/delivedeptcd", model.getValue("/root/send/search/delivedeptcd"));
  115. */
  116. //마직막 행에 물품코드가 등록되어 있으면 그 행에 바로 적용하고, 물품코드가 없으면 한 행을 추가한 뒤 적용한다.
  117. if( grd_prprtystoclist.valueMatrix(grd_prprtystoclist.rows-1, grd_prprtystoclist.colRef("goodcd")) != "" ) {
  118. btn_insert.dispatch("DOMActivate");
  119. }
  120. model.setValue(grd_prprtystoclist.nodeset + "[" + (grd_prprtystoclist.rows-1) + "]/goodcd", model.getValue("/root/main/good/gooddetail/goodcd"));
  121. model.setValue(grd_prprtystoclist.nodeset + "[" + (grd_prprtystoclist.rows-1) + "]/goodnm", model.getValue("/root/main/good/gooddetail/goodnm"));
  122. model.setValue(grd_prprtystoclist.nodeset + "[" + (grd_prprtystoclist.rows-1) + "]/goodspec", model.getValue("/root/main/good/gooddetail/goodspec"));
  123. model.setValue(grd_prprtystoclist.nodeset + "[" + (grd_prprtystoclist.rows-1) + "]/deliveunit", model.getValue("/root/main/good/gooddetail/deliveunit"));
  124. // model.setValue(grd_prprtystoclist.nodeset + "[" + (grd_prprtystoclist.rows-1) + "]/exchqty", model.getValue("/root/main/good/gooddetail/exchqty"));
  125. // model.setValue(grd_prprtystoclist.nodeset + "[" + (grd_prprtystoclist.rows-1) + "]/siqty", model.getValue("/root/main/good/gooddetail/siqty"));
  126. // model.setValue(grd_prprtystoclist.nodeset + "[" + (grd_prprtystoclist.rows-1) + "]/hunqty", model.getValue("/root/main/good/gooddetail/hunqty"));
  127. // model.setValue(grd_prprtystoclist.nodeset + "[" + (grd_prprtystoclist.rows-1) + "]/origsiqty", model.getValue("/root/main/good/gooddetail/siqty")); //hunqty의 처음 값을 저장하기 위함.
  128. // model.setValue(grd_prprtystoclist.nodeset + "[" + (grd_prprtystoclist.rows-1) + "]/orighunqty", model.getValue("/root/main/good/gooddetail/hunqty")); //hunqty의 처음 값을 저장하기 위함.
  129. // model.setValue(grd_prprtystoclist.nodeset + "[" + (grd_prprtystoclist.rows-1) + "]/deliveqty", "");
  130. // model.setValue(grd_prprtystoclist.nodeset + "[" + (grd_prprtystoclist.rows-1) + "]/deliveamt", "");
  131. model.setValue(grd_prprtystoclist.nodeset + "[" + (grd_prprtystoclist.rows-1) + "]/stocqty", "0"); //적정재고
  132. model.setValue("/root/send/mthuseqty/instcd", grd_prprtystoclist.valueMatrix(grd_prprtystoclist.row, grd_prprtystoclist.colRef("instcd")));
  133. model.setValue("/root/send/mthuseqty/goodcd", grd_prprtystoclist.valueMatrix(grd_prprtystoclist.row, grd_prprtystoclist.colRef("goodcd")));
  134. model.setValue("/root/send/mthuseqty/deptcd", grd_prprtystoclist.valueMatrix(grd_prprtystoclist.row, grd_prprtystoclist.colRef("mngtdeptcd")));
  135. model.setValue("/root/send/mthuseqty/flag", "mthuseqty");
  136. submit("TRRSO23002");
  137. if(model.getValue("/root/mthuse/mthuseqty") != ""){
  138. grd_prprtystoclist.valueMatrix(grd_prprtystoclist.row, grd_prprtystoclist.colRef("mthuseqty")) = model.getValue("/root/mthuse/mthuseqty");
  139. }else{
  140. grd_prprtystoclist.valueMatrix(grd_prprtystoclist.row, grd_prprtystoclist.colRef("mthuseqty")) = "0";
  141. }
  142. }
  143. } // if( bDup ...) end
  144. } // for(var k ...) end
  145. grd_prprtystoclist.refresh();
  146. }
  147. ]]>
  148. </script>
  149. </xhtml:head>
  150. <xhtml:body style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  151. <group id="grp_tle" style="left:0px; top:0px; width:1195px; height:13px; ">
  152. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:243px; height:15px; ">적정재고량(팝업)</caption>
  153. </group>
  154. <group id="group1" style="left:0px; top:12; width:1195px; height:27px; ">
  155. <line id="line17" class="line_6" style="x1:0px; y1:25; x2:1195px; y2:25px; "/>
  156. <button id="btn_save" class="btn4_letter2" navindex="12" style="left:1136px; top:3px; width:56px; height:22px; ">
  157. <caption>적용</caption>
  158. <script type="javascript" ev:event="DOMActivate">
  159. <![CDATA[
  160. for(i = grd_prprtystoclist.rows ; i > 0 ; i--){
  161. var reqqty = grd_prprtystoclist.valueMatrix(i, grd_prprtystoclist.colRef("reqqty"));
  162. if(reqqty == 0){
  163. grd_prprtystoclist.deleteRow(i);
  164. }
  165. }
  166. for(j= grd_prprtystoclist.rows ; j > 0 ; j--){
  167. var chkrow = grd_prprtystoclist.valueMatrix(j, grd_prprtystoclist.colRef("chkrow"));
  168. if(chkrow == "N"){
  169. grd_prprtystoclist.deleteRow(j);
  170. }
  171. }
  172. var count = grd_prprtystoclist.rows-1;
  173. opener.model.setValue("/root/popdata2/send/count", count);
  174. model.copyNode(opener.root.popdata2.receive, "/root/main/prprtystoc");
  175. window.close();
  176. ]]>
  177. </script>
  178. </button>
  179. </group>
  180. <group id="group3" scroll="auto" style="left:0px; top:40; width:1195px; height:744px; ">
  181. <group id="grp_search" style="left:0px; top:9px; width:1195px; height:36px; vertical-align:top; ">
  182. <shape id="roundrect1" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:1195px; height:35px; background-color:#fffbf2; border-color:#ffd799; "/>
  183. <button id="btn_search" class="btn1_letter2" navindex="7" style="left:1129px; top:6px; width:56px; height:22px; ">
  184. <caption>조회</caption>
  185. <script type="javascript" ev:event="DOMActivate">
  186. <![CDATA[
  187. if(opt_mngtdeptnm.value == "") {
  188. messageBox("관리부서가 선택되지 않았습니다. \n\n먼저 관리부서를 선택하십시요.", "E999", "");
  189. model.setFocus("ipt_mngtdeptcd");
  190. return;
  191. };
  192. if(submit("TRRSO23011")){
  193. for( i = 1 ; i < grd_prprtystoclist.rows ; i++ ){
  194. var minqty = grd_prprtystoclist.valueMatrix(i, grd_prprtystoclist.colRef("minqty")); //최소재고량
  195. var stocqty = grd_prprtystoclist.valueMatrix(i, grd_prprtystoclist.colRef("stocqty")); //적정재고량
  196. var jaegoqty = grd_prprtystoclist.valueMatrix(i, grd_prprtystoclist.colRef("jaegoqty")); //현재고량
  197. if(parseInt(jaegoqty) < parseInt(minqty)){
  198. grd_prprtystoclist.valueMatrix(i, grd_prprtystoclist.colRef("reqqty")) = parseInt(stocqty) - parseInt(jaegoqty); //청구수량 = 적정재고량 - 현재고량
  199. }
  200. }
  201. grd_prprtystoclist.refresh();
  202. }
  203. ]]>
  204. </script>
  205. </button>
  206. <select1 id="cmb_instcd" ref="/root/send/search/instcd" class="combo_default" disabled="true" navindex="1" appearance="minimal" style="left:102px; top:8px; width:136px; height:19px; text-align:center; ">
  207. <choices>
  208. <itemset nodeset="/root/main/init">
  209. <label ref="cnstnm"/>
  210. <value ref="cnstcd"/>
  211. </itemset>
  212. </choices>
  213. </select1>
  214. <caption id="cap_instcd" class="search_name" style="left:18px; top:8px; width:86px; height:17px; ">기관코드:</caption>
  215. <caption id="caption20" class="search_name" style="left:245px; top:8px; width:81px; height:17px; vertical-align:middle; ">청구부서:</caption>
  216. <line id="line30" class="line_4" style="x1:1115px; y1:5px; x2:1115px; y2:30px; "/>
  217. <button id="btn_mngtdeptcd" class="icon_search" navindex="3" style="left:422px; top:8px; width:16px; height:16px; ">
  218. <caption/>
  219. <script type="javascript" ev:event="DOMActivate">
  220. <![CDATA[
  221. var vOrigDeptcd = ipt_mngtdeptcd.value; //popup을 열기전 부서 저장
  222. var recv_list = "mngtdeptcd,mngtdeptnm";
  223. misfOpenPopUpList("02", ipt_mngtdeptcd,"", recv_list);
  224. ipt_mngtdeptcd.refresh();
  225. opt_mngtdeptnm.refresh();
  226. ]]>
  227. </script>
  228. </button>
  229. <input id="ipt_mngtdeptcd" ref="/root/send/search/mngtdeptcd" class="input_default" navindex="2" style="left:325px; top:8px; width:95px; height:19px; ">
  230. <script type="javascript" ev:event="xforms-value-changed">
  231. <![CDATA[
  232. misfValidationCheck("02", "", "mngtdeptcd,mngtdeptnm" );
  233. ipt_mngtdeptcd.refresh();
  234. opt_mngtdeptnm.refresh();
  235. ]]>
  236. </script>
  237. <script type="javascript" ev:event="onkeypress">
  238. <![CDATA[
  239. inputEnterKey("ipt_mngtdeptcd", "xforms-value-changed");
  240. ]]>
  241. </script>
  242. </input>
  243. <output id="opt_mngtdeptnm" ref="/root/send/search/mngtdeptnm" class="output_fix" appearance="output" style="left:440px; top:8px; width:145px; height:19px; "/>
  244. <select1 id="cmb_searchwareflag" ref="/root/send/search/wareflag" class="combo_default" appearance="minimal" style="left:890px; top:8px; width:110px; height:19px; ">
  245. <choices>
  246. <itemset nodeset="/root/init/wareflag/wareflaglist">
  247. <label ref="cdnm"/>
  248. <value ref="cdid"/>
  249. </itemset>
  250. </choices>
  251. </select1>
  252. <caption id="caption19" class="search_name" style="left:805px; top:8px; width:106px; height:17px; ">창고구분 :</caption>
  253. <caption id="caption2" class="search_name" style="left:595px; top:8px; width:81px; height:17px; vertical-align:middle; ">적용일자:</caption>
  254. <input id="input1" ref="/root/send/search/reqdd" inputtype="date" format="yyyy-mm-dd" style="left:676px; top:8px; width:109px; height:19px; text-align:center; "/>
  255. </group>
  256. <line id="line1" class="line_1" style="x1:0px; y1:68px; x2:1195px; y2:68px; "/>
  257. <caption id="caption1" class="tit_2" style="left:0px; top:53px; width:180px; height:13px; ">출고내역</caption>
  258. <datagrid id="grd_prprtystoclist" nodeset="/root/main/prprtystoc/prprtystoclist" class="datagrid2" caption="^품목코드^품목명^규격^단위^적정재고^최소재고량^재고량^청구량^최종청구일자" colsep="^" colwidth="50, 103, 258, 191, 69, 70, 70, 70, 70, 100, 100, 100, 100" mergecellsfixedrows="bycolrec" rowheader="update" rowsep="|" style="left:0px; top:73px; width:1195px; height:667px; ">
  259. <col checkvalue="Y,N" ref="chkrow" type="checkbox"/>
  260. <col disabled="true" ref="goodcd" type="output" style="text-align:center; "/>
  261. <col ref="goodnm"/>
  262. <col ref="goodspec" style="text-align:center; "/>
  263. <col ref="deliveunit" style="text-align:center; "/>
  264. <col ref="stocqty" style="text-align:right; "/>
  265. <col ref="minqty" style="text-align:right; "/>
  266. <col ref="jaegoqty" type="output" style="text-align:right; "/>
  267. <col ref="reqqty" type="input" format="99999999999" style="text-align:right; "/>
  268. <col ref="lastreqday" format="yyyy-mm-dd" style="text-align:center; "/>
  269. <col ref="allsizespecid" visibility="hidden"/>
  270. <col ref="instcd" visibility="hidden"/>
  271. <col ref="reqdeptcd" visibility="hidden"/>
  272. </datagrid>
  273. <select id="chk_chkrow" ref="/root/send/search/chkrow" overflow="visible" appearance="full" style="left:23px; top:81px; width:45px; height:20px; border-style:none; ">
  274. <choices>
  275. <item>
  276. <label>선택</label>
  277. <value>Y</value>
  278. </item>
  279. </choices>
  280. <script type="javascript" ev:event="xforms-value-changed">
  281. <![CDATA[
  282. if(chk_chkrow.value == "Y"){
  283. for( i = 1 ; i < grd_prprtystoclist.rows ; i++ ){
  284. if(!(grd_prprtystoclist.rowStatus(i) == 1 || grd_prprtystoclist.rowStatus(i) == 3)){
  285. grd_prprtystoclist.valueMatrix(i, grd_prprtystoclist.colRef("chkrow")) = "Y";
  286. grd_prprtystoclist.rowStatus(i) = 2;
  287. }
  288. }
  289. }else{
  290. for( i = 1 ; i < grd_prprtystoclist.rows ; i++ ){
  291. if(!(grd_prprtystoclist.rowStatus(i) == 1 || grd_prprtystoclist.rowStatus(i) == 3)){
  292. grd_prprtystoclist.valueMatrix(i, grd_prprtystoclist.colRef("chkrow")) = "N";
  293. grd_prprtystoclist.rowStatus(i) = 2;
  294. }
  295. }
  296. }
  297. grd_prprtystoclist.refresh();
  298. ]]>
  299. </script>
  300. </select>
  301. </group>
  302. </xhtml:body>
  303. </xhtml:html>