SMMNP02100.js 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /* ---------------------------------------------------------------------
  2. 일단위 물품 미불출 조회(SMMNP02100.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By 김진명
  6. : 2009.12.18
  7. ---------------------------------------------------------------------- */
  8. /* --------------------------------------------------*/
  9. /* type : function */
  10. /* access : public */
  11. /* desc : 초기화 */
  12. /* param : */
  13. /* return : */
  14. /* --------------------------------------------------*/
  15. function fInit() {
  16. //model.removeNodeset("/root/main/stoclist");
  17. //submit("TRMNP04604");
  18. //var level = model.getValue("/root/temp/logginlevel/usrlevel");
  19. var curday = new Date();
  20. var dayflag = curday.getDay();
  21. var curdate = curday.getDateFormat();
  22. model.setValue("/root/main/cond/opfromdd", getDateAddc(curdate, -7));
  23. model.setValue("/root/main/cond/optodd", getDateAddc(curdate, -1));
  24. grd_undelivelist.explorerbar = "sort";
  25. grd_undelivelist.fixedcellcheckbox(0,1) = true;
  26. submit("TRMNP05001", false);
  27. addComboItem("cmb_oproomcd", "전체", "", "above" );
  28. submit("TRMNP03004") // 수술실(Rosette) 가져오기
  29. addComboItem("cmb_rosette","전체","","above");
  30. model.removenode("/root/send");
  31. model.makeValue("/root/send/cdgrupid", "038");
  32. submit("TRMNP00323", false);
  33. var deptflag = model.getValue("/root/viewctrl/viewctrllist/viewctrlinfo/cdnm");
  34. model.setValue("/root/main/cond/refdeptflag", deptflag);
  35. fSearch();
  36. }
  37. /* --------------------------------------------------*/
  38. /* type : function */
  39. /* access : public */
  40. /* desc : 방재고실사입력 조회 */
  41. /* param : */
  42. /* return : */
  43. /* --------------------------------------------------*/
  44. function fSearch() {
  45. model.removenode("/root/send");
  46. model.makeNode("/root/send/reqdata");
  47. model.copyNode("/root/send/reqdata", "/root/main/cond");
  48. submit("TRMNP02101");
  49. }
  50. /* --------------------------------------------------*/
  51. /* type : function */
  52. /* access : public */
  53. /* desc : 물품 조회 팝업 후 처리 */
  54. /* param : */
  55. /* return : */
  56. /* --------------------------------------------------*/
  57. function fSetGoodCd(paramData) {
  58. var variable = "'";
  59. var goodcd = "";
  60. var goodnm = "";
  61. var oldgoodcd, oldgoodnm, oldvariable;
  62. oldgoodcd = model.getValue("/root/main/cond/goodcd");
  63. oldgoodnm = model.getValue("/root/main/cond/goodnm");
  64. oldvariable = model.getValue("/root/main/cond/variable");
  65. var getData = paramData;
  66. if( getData != "") {
  67. if( model.getValue("/root/temp/chkcncl") != "C" ) {
  68. var getDataTemp1 = getData.split("▩");
  69. for( var i = 0; i < getDataTemp1.length-1; i++) {
  70. var getDataTemp2 = getDataTemp1[i].split("|");
  71. variable = variable + getDataTemp2[0] + getDataTemp2[2] + "'";
  72. goodcd = goodcd + getDataTemp2[0];
  73. goodnm = goodnm + getDataTemp2[1];
  74. if(( i+1) != (getDataTemp1.length-1) ) {
  75. variable = variable + ", '";
  76. goodcd = goodcd + ", ";
  77. goodnm = goodnm + ", ";
  78. }
  79. }
  80. if( oldgoodcd != "" ) {
  81. goodcd = oldgoodcd + ", " + goodcd
  82. }
  83. if( oldgoodnm != "" ) {
  84. goodnm = oldgoodnm + ", " + goodnm
  85. }
  86. if( oldvariable != "" ) {
  87. variable = oldvariable + ", " + variable
  88. }
  89. model.setValue("/root/main/cond/goodcd", goodcd);
  90. model.setValue("/root/main/cond/goodnm", goodnm);
  91. model.setValue("/root/main/cond/variable", variable);
  92. model.refresh();
  93. fSearch();
  94. }
  95. }
  96. }
  97. /* --------------------------------------------------*/
  98. /* type : function */
  99. /* access : public */
  100. /* desc : 일단위 물품 불출 확정 */
  101. /* param : */
  102. /* return : */
  103. /* --------------------------------------------------*/
  104. function fCnfmSave() {
  105. var iRows = -1;
  106. var chkflag, oproomcd, goodcd, allsizespecid, sumfromdd, sumtodd, deliveqty, cmt, refdeptflag, opcnfmdd, bfdeliveqty;
  107. var cnt = 0;
  108. iRows = grd_undelivelist.rows;
  109. var prcplist = "m▦goodcd▦allsizespecid▦deptflag▦oproomcd▦sumfromdd▦sumtodd▦deliveqty▦cmt▦delivedd▦seqno";
  110. for( var i = 1; i <= iRows; i++ ) {
  111. chkflag = model.getValue("/root/main/undelivelist[" + i + "]/chkflag");
  112. oproomcd = model.getValue("/root/main/undelivelist[" + i + "]/oproomcd");
  113. goodcd = model.getValue("/root/main/undelivelist[" + i + "]/goodcd");
  114. allsizespecid = model.getValue("/root/main/undelivelist[" + i + "]/allsizespecid");
  115. deliveqty = model.getValue("/root/main/undelivelist[" + i + "]/deliveqty");
  116. bfdeliveqty = model.getValue("/root/main/undelivelist[" + i + "]/bfdeliveqty");
  117. cmt = model.getValue("/root/main/undelivelist[" + i + "]/cmt");
  118. refdeptflag = model.getValue("/root/main/cond/refdeptflag");
  119. opcnfmdd = model.getValue("/root/main/undelivelist[" + i + "]/opcnfmdd");
  120. sumfromdd = model.getValue("/root/main/undelivelist[" + i + "]/sumfromdd");
  121. sumtodd = model.getValue("/root/main/undelivelist[" + i + "]/sumtodd");
  122. if( sumfromdd == "" ) { sumfromdd = opcnfmdd; }
  123. if( sumtodd == "" ) { sumtodd = opcnfmdd; }
  124. if( chkflag == "true" ) {
  125. cnt += 1;
  126. prcplist = prcplist + "▩" + "I" + "▦" + goodcd + "▦" + allsizespecid + "▦" + refdeptflag + "▦" + oproomcd + "▦" + sumfromdd + "▦" + sumtodd
  127. + "▦" + (parseInt(deliveqty) - parseInt(bfdeliveqty)) + "▦" + cmt + "▦" + "" + "▦" + "";
  128. }
  129. }
  130. if( cnt > 0 ) {
  131. model.removenode("/root/send");
  132. model.makeNode("/root/send/reqdata");
  133. model.makeNode("/root/send/savedata");
  134. model.copyNode("/root/send/reqdata", "/root/main/cond");
  135. model.setValue("/root/send/savedata", prcplist);
  136. submit("TXMNP02101", false);
  137. fSearch();
  138. }else {
  139. messageBox("선택한것이", "I004");
  140. }
  141. }