SMRSO23000_적정재고량관리(부서).xrw 16 KB

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