SMRSI00400.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. /* ---------------------------------------------------------------------
  2. SMRSI00400_입고내역조회.xrw (SMRSI00400.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By Francis Choi
  6. : 2015.05.02
  7. ---------------------------------------------------------------------- */
  8. var xAuth = !(checkAuth("X"));
  9. var pAuth = !(checkAuth("P"));
  10. var vPurcAuth = "1";
  11. // --------------------------------------------------
  12. // 화면 Control을 초기화한다
  13. // --------------------------------------------------
  14. function fInit() {
  15. fInitialize();
  16. return;
  17. }
  18. // --------------------------------------------------------------
  19. // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
  20. // --------------------------------------------------------------
  21. function fInitialize() {
  22. model.resetInstanceNode("/root/send");
  23. //rszfUserGoodFlagList(cmb_goodflag,getUserInfo("userid"),"Y");
  24. rszfGoodFlagListByPgmGubn(cmb_goodflag,"1","Y");
  25. rszfUserInstList(cmb_instcd,getUserInfo("userid"),"N");
  26. misfComboComCdList("R0111",cmb_purcflag,"Y");
  27. //misfComboComCdListMulti("Z0007,R0025","cmb_instcd,cmb_goodflag" );
  28. //rszfComboAppendBlankChild("cmb_instcd,cmb_goodflag");
  29. model.setValue(cmb_instcd.attribute("ref") , getUserInfo("dutplceinstcd"));
  30. model.setValue(ipt_windeptcd.attribute("ref") , getUserInfo("dutplcecd"));
  31. model.setValue(ipt_windeptnm.attribute("ref") , getUserInfo("dutplcenm"));
  32. model.setValue(ipt_winfrdd.attribute("ref") , getCurrentDate());
  33. model.setValue(ipt_wintodd.attribute("ref") , getCurrentDate());
  34. misfGridInit(grd_goodwin);
  35. misfMsterDetailSet(grd_goodwin ,null , "TRRSI00401" ,"N", "byrow");
  36. misfMsterDetailSet(grd_gooddmndreq,grd_goodwin, "TRRSI00403" ,"N", "byrow");
  37. // misfMsterDetailSet(grd_gooddmndreq,grd_goodwin, "TRRSD00403" ,"N", "byrow");
  38. //화면에서 Grid의 마스터 Detail관계 설정
  39. /*
  40. pGrid_name : Grid id명
  41. pMaster_Grid : pGrid_name의 마스터 Grid id명
  42. pSubmit_Id : pGrid_name을 조회할 Submit id
  43. pSave_Yn : pGrid_name 저장여부("Y","N")
  44. pSelectionMode : pGrid_name 의 선택모드 "free", "byrow", "bycol"..
  45. function misfMsterDetailSet(pGrid_name, pMaster_Grid, pSubmit_Id, pSave_Yn, pSelectionMode)
  46. */
  47. // grd_goodwin.fixedcellcheckbox(0,grd_goodwin.colRef("chkyn")) = true;
  48. model.refresh();
  49. }
  50. // ---------------------------------------
  51. // 청구 출고 내역을 조회한다
  52. // ---------------------------------------
  53. function fAfterRetrieveDetail() {
  54. var SumDeliveQty = 0;
  55. for (var currow = grd_gooddmndreq.fixedRows ; currow < grd_gooddmndreq.rows ; currow++) {
  56. SumDeliveQty += parseFloat(grd_gooddmndreq.valueMatrix(currow , grd_gooddmndreq.colRef("deliveqty")));
  57. }
  58. model.setValue(opt_sumdeliveqty.attribute("ref"), SumDeliveQty);
  59. model.refresh();
  60. }
  61. // ---------------------------------------
  62. // 입고내역 Sum처리 한다
  63. // ---------------------------------------
  64. function fAfterGoodwin() {
  65. var SumWinQty = 0;
  66. var SumWinAmt = 0;
  67. for (var fRow = grd_goodwin.fixedRows; fRow < grd_goodwin.rows ; fRow++ ) {
  68. SumWinQty += parseFloat(grd_goodwin.valueMatrix(fRow , grd_goodwin.colRef("winqty")));
  69. SumWinAmt += parseFloat(grd_goodwin.valueMatrix(fRow , grd_goodwin.colRef("winamt")));
  70. if(grd_goodwin.valueMatrix(fRow, grd_goodwin.colRef("chkyn")) == "Y")
  71. {
  72. grd_goodwin.isReadOnly(fRow, grd_goodwin.fixedCols-1, fRow, grd_goodwin.cols-1) = true;
  73. } else {
  74. grd_goodwin.isReadOnly(fRow, grd_goodwin.fixedCols-1, fRow, grd_goodwin.cols-1) = false;
  75. }
  76. }
  77. model.setValue(opt_winqty.attribute("ref"),SumWinQty);
  78. model.setValue(opt_winamt.attribute("ref"),SumWinAmt);
  79. model.refresh();
  80. }
  81. //-----------------------------------
  82. // 입고 검수 확인 저장
  83. //-----------------------------------
  84. function fCheckPersonSave(){
  85. var vCnt = 0 ;
  86. var cPath = "/root/init/winchecklist";
  87. var sPath = "/root/main/list/goodwin/goodwinlist";
  88. var tPath = "/root/send/winchecklists";
  89. var tPath2 = "/root/send/winchecklists/winchecklist";
  90. var Winchecklist = "instcd" + "▦" // 01 기관코드
  91. + "goodflag" + "▦" // 02 물품구분
  92. + "windd" + "▦" // 03 입고일자
  93. + "winno" + "▦" // 04 입고번호
  94. + "winseqno" + "▦" // 05 입고일련번호
  95. + "windeptcd" + "▦" // 06 입고부서코드
  96. + "chkdd" + "▦" // 07 검수일자
  97. + "chkpsn" + "▦" // 08 검수자id
  98. + "chkyn" + "▩" ; // 09 검수유무
  99. for (var fRow = grd_goodwin.fixedRows; fRow < grd_goodwin.rows ; fRow++ ) {
  100. if ((model.getValue(sPath+"[" + fRow + "]/chkyn" ) =="Y") &&
  101. (model.getValue(sPath+"[" + fRow + "]/oldchkyn") =="N") ){
  102. Winchecklist += model.getValue(sPath + "[" + fRow + "]/instcd" ) + "▦"; // 01 기관코드
  103. Winchecklist += model.getValue(sPath + "[" + fRow + "]/goodflag" ) + "▦"; // 02 물품구분
  104. Winchecklist += model.getValue(sPath + "[" + fRow + "]/windd" ) + "▦"; // 03 입고일자
  105. Winchecklist += model.getValue(sPath + "[" + fRow + "]/winno" ) + "▦"; // 04 입고번호
  106. Winchecklist += model.getValue(sPath + "[" + fRow + "]/winseqno" ) + "▦"; // 05 입고일련번호
  107. Winchecklist += model.getValue(sPath + "[" + fRow + "]/windeptcd") + "▦"; // 06 입고부서코드
  108. Winchecklist += getCurrentDate() + "▦"; // 07 검수일자
  109. Winchecklist += getUserInfo("userid") + "▦"; // 08 검수자id
  110. Winchecklist += model.getValue(sPath + "[" + fRow + "]/chkyn" ) + "▩"; // 09 검수유무
  111. vCnt++;
  112. } else {
  113. if (model.getValue(sPath+"[" + fRow + "]/oldchkyn") =="Y") {
  114. model.setValue(sPath+"[" + fRow + "]/chkyn" , "Y");
  115. }
  116. }
  117. }
  118. if (vCnt > 0) {
  119. model.removenode(tPath);
  120. model.makeValue(tPath2, Winchecklist);
  121. submit("TXRSI00103");
  122. btn_search.dispatch("DOMActivate");
  123. }
  124. }
  125. //-----------------------------------
  126. // 입고 검수 확인 저장
  127. //-----------------------------------
  128. function fCheckPersonSave2(){
  129. var vCnt = 0 ;
  130. var cPath = "/root/init/winchecklist";
  131. var sPath = "/root/main/list/goodwin/goodwinlist";
  132. var tPath = "/root/send/winchecklists";
  133. var tPath2 = "/root/send/winchecklists/winchecklist";
  134. model.removenode(tPath);
  135. for (var fRow = grd_goodwin.fixedRows; fRow < grd_goodwin.rows ; fRow++ ) {
  136. if ((model.getValue(sPath+"[" + fRow + "]/chkyn" ) =="Y") &&
  137. (model.getValue(sPath+"[" + fRow + "]/oldchkyn") =="N") ){
  138. model.setValue(cPath + "/instcd" , model.getValue(sPath + "[" + fRow + "]/instcd" )) ; // 01 기관코드
  139. model.setValue(cPath + "/goodflag" , model.getValue(sPath + "[" + fRow + "]/goodflag" )) ; // 02 물품구분
  140. model.setValue(cPath + "/windd" , model.getValue(sPath + "[" + fRow + "]/windd" )) ; // 03 입고일자
  141. model.setValue(cPath + "/winno" , model.getValue(sPath + "[" + fRow + "]/winno" )) ; // 04 입고번호
  142. model.setValue(cPath + "/winseqno" , model.getValue(sPath + "[" + fRow + "]/winseqno" )) ; // 05 입고일련번호
  143. model.setValue(cPath + "/windeptcd", model.getValue(sPath + "[" + fRow + "]/windeptcd")) ; // 06 입고부서코드
  144. model.setValue(cPath + "/chkdd" , getCurrentDate() ) ; // 07 검수일자
  145. model.setValue(cPath + "/chkpsn" , getUserInfo("userid") ) ; // 08 검수자id
  146. model.setValue(cPath + "/chkyn" , model.getValue(sPath + "[" + fRow + "]/chkyn" )) ; // 09 검수유무
  147. xNode = instance1.selectSingleNode(tPath);
  148. if (vCnt == 0) {
  149. model.makeNode(tPath2 );
  150. model.copyNode(tPath2 , cPath);
  151. } else {
  152. model.duplicate(tPath , cPath);
  153. }
  154. vCnt++;
  155. } else {
  156. if (model.getValue(sPath+"[" + fRow + "]/oldchkyn") =="Y") {
  157. model.setValue(sPath+"[" + fRow + "]/chkyn" , "Y");
  158. }
  159. }
  160. }
  161. if (vCnt > 0) {
  162. submit("TXRSI00103");
  163. }
  164. //if (submit("TXRSI00103")) {
  165. // btn_search.dispatch("DOMActivate");
  166. //}
  167. // alert(vCnt);
  168. }
  169. function fWinAllSelect()
  170. {
  171. var sPath = "/root/main/list/goodwin/goodwinlist";
  172. for(var liRow = grd_goodwin.fixedRows; liRow < grd_goodwin.rows ; liRow++)
  173. {
  174. if (model.getValue(sPath+"[" + liRow + "]/oldchkyn") =="N") {
  175. if (model.getValue(sPath+"[" + liRow + "]/chkyn" ) =="Y")
  176. model.setValue(sPath+"[" + liRow + "]/chkyn", "N" );
  177. else
  178. model.setValue(sPath+"[" + liRow + "]/chkyn", "Y" );
  179. }
  180. }
  181. }
  182. //-----------------------------------
  183. // 입고 전체 선택 / 취소
  184. //-----------------------------------
  185. /* ------------------------------------------------- */
  186. /* ------End Of List ------------------------------- */
  187. /* -------------------------------------------------- */