SPMNR04900.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. /*
  2. 간호Item 시간Setting(SPMNR04900.xrw - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var xPrcpInfoPath = "/root/main/prcpinfo";
  7. var xClsListPath = "/root/main/clsinfo/clslist";
  8. var xTimeListPath = "/root/main/timeinfo/timelist";
  9. var sTimeColor = "#fcd2c1";
  10. /**
  11. * @group :
  12. * @ver : 2007.08.08
  13. * @by : 이은영
  14. * @---------------------------------------------------
  15. * @type : function
  16. * @access : public
  17. * @desc : 화면 초기화
  18. * @param :
  19. * @return :
  20. * @---------------------------------------------------
  21. */
  22. function fInitialize(){
  23. var sParamMsg = "";
  24. var sApntTMSpecList=""; // 기준시간setting
  25. var sRemainder = 0; // 나머지
  26. var sCareItemCD = "";
  27. var sFlag = "";
  28. var iRow = 0;
  29. if(checkOpener()){
  30. sParamMsg = opener.javascript.getParameter("SPMNR04900_Param");
  31. sFlag = getArrayData(sParamMsg,1,5);
  32. model.setValue( xPrcpInfoPath+"/prcpnm", getArrayData(sParamMsg,1,0));
  33. model.setValue( xPrcpInfoPath+"/prcpcd", getArrayData(sParamMsg,1,1));
  34. model.setValue( xPrcpInfoPath+"/careitemnm", getArrayData(sParamMsg,1,2));
  35. model.setValue( xPrcpInfoPath+"/careitemcd", getArrayData(sParamMsg,1,3));
  36. model.setValue( xPrcpInfoPath+"/apnttmspec", getArrayData(sParamMsg,1,4));
  37. model.setValue( xPrcpInfoPath+"/flag", sFlag);
  38. }
  39. // 분류명 리스트 조회
  40. if(submit("TRMNR04901")){
  41. if(sFlag == "all"){
  42. sCareItemCD = model.getValue(xPrcpInfoPath+"/careitemcd");
  43. if(sCareItemCD != ""){
  44. iRow = grd_clslist.findRow(sCareItemCD,1,3,false,true);
  45. if(iRow > 0) model.setValue(xClsListPath+"["+iRow+"]/check","true");
  46. }
  47. }else{
  48. for(var iRow=grd_clslist.fixedrows;iRow<=grd_clslist.rows-grd_clslist.fixedrows;iRow++){
  49. grd_clslist.isReadOnly(iRow,1) = true;
  50. }
  51. }
  52. }
  53. // 시간 세팅
  54. model.removenodeset(xTimeListPath);
  55. var i = 1;
  56. for(iRow=1; iRow<=4; iRow++){
  57. grd_timelist.addRow(false);
  58. for(var iCol=1; iCol<=6; iCol++){
  59. if(i == 24){
  60. i=0;
  61. }
  62. model.setValue(xTimeListPath+"["+iRow+"]/time"+iCol,i);
  63. i++;
  64. }
  65. }
  66. grd_timelist.rebuild();
  67. sApntTMSpecList = model.getValue(xPrcpInfoPath+"/apnttmspec");
  68. if( sApntTMSpecList != ""){
  69. var sApntTMSpec = sApntTMSpecList.split(",");
  70. for(i=0; i<sApntTMSpec.length; i++){
  71. sRemainder = eval(sApntTMSpec[i]) % 6;
  72. if(sRemainder == 0) sRemainder += 6;
  73. setCellStyle("grd_timelist","0",sApntTMSpec[i],"time"+sRemainder , "equal");
  74. }
  75. }
  76. model.refresh();
  77. }
  78. /**
  79. * @group :
  80. * @ver : 2007.08.08
  81. * @by : 이은영
  82. * @---------------------------------------------------
  83. * @type : function
  84. * @access : public
  85. * @desc : 그리드 클릭시
  86. * @param : pFlag ( time : 시간setting, item : 간호 Item)
  87. * @return :
  88. * @---------------------------------------------------
  89. */
  90. function fClinckGridRow(pFlag){
  91. var iRow = 0;
  92. var iCol = 0;
  93. switch(pFlag){
  94. case "time" :
  95. iRow = grd_timelist.row;
  96. iCol = grd_timelist.col;
  97. if(iRow < 1 || iCol < 0) return;
  98. if(grd_timelist.cellStyle("background-color", iRow, iCol) == sTimeColor){
  99. grd_timelist.cellStyle("background-color", iRow, iCol) = "#ffffff";
  100. }else{
  101. grd_timelist.cellStyle("background-color", iRow, iCol) = sTimeColor;
  102. }
  103. grd_timelist.row = 0;
  104. grd_timelist.col = -1;
  105. break;
  106. case "item":
  107. iRow = grd_clslist.row;
  108. iCol = grd_clslist.col;
  109. if(model.getValue(xPrcpInfoPath+"/flag") == "dept") return;
  110. if(iCol > 1){
  111. model.setValue(xClsListPath+"["+iRow+"]/check","true");
  112. }
  113. for(i=grd_clslist.fixedrows; i<= grd_clslist.rows-grd_clslist.fixedrows; i++){
  114. if(i != iRow && model.getValue(xClsListPath+"["+iRow+"]/check") == "true"){
  115. model.setValue(xClsListPath+"["+i+"]/check","false");
  116. }
  117. }
  118. break;
  119. }
  120. }
  121. /**
  122. * @group :
  123. * @ver : 2007.08.08
  124. * @by : 이은영
  125. * @---------------------------------------------------
  126. * @type : function
  127. * @access : public
  128. * @desc : 간호Item 또는 시간 setting 초기화
  129. * @param : pFlag ( time : 시간setting, item : 간호 Item)
  130. * @return :
  131. * @---------------------------------------------------
  132. */
  133. function fClearGrid(pFlag){
  134. switch(pFlag){
  135. case "time":
  136. grd_timelist.allstyle( "all", "background-color" ) = "#FFFFFF";
  137. grd_timelist.rebuild();
  138. break;
  139. case "item":
  140. var iRow = grd_clslist.findRow("true",1,1,false,true);
  141. if(iRow < 0 ){
  142. return;
  143. }
  144. model.setValue(xClsListPath+"["+iRow+"]/check","false");
  145. grd_clslist.row = 0;
  146. }
  147. }
  148. /**
  149. * @group :
  150. * @ver : 2007.08.08
  151. * @by : 이은영
  152. * @---------------------------------------------------
  153. * @type : function
  154. * @access : public
  155. * @desc : 간호Item 시간 Setting 전송
  156. * @param :
  157. * @return :
  158. * @---------------------------------------------------
  159. */
  160. function fSend(){
  161. var sApntTMSpec = "";
  162. sReturnMsg = "careitemnm▦careitemcd▦apnttmspec▩";
  163. var iRowCnt = grd_timelist.rows-grd_timelist.fixedrows;
  164. var iColCnt = grd_timelist.cols-grd_timelist.fixedcols-1;
  165. for(var iRow=grd_timelist.fixedrows;iRow<=iRowCnt; iRow++){
  166. for(var iCol=grd_timelist.fixedcols; iCol<=iColCnt; iCol++){
  167. if(grd_timelist.cellStyle("background-color", iRow, iCol) == sTimeColor){
  168. if(iRow == iRowCnt && iCol == iColCnt){
  169. if(sApntTMSpec != ""){
  170. sApntTMSpec = grd_timelist.labelmatrix(iRow,iCol)+","+sApntTMSpec;
  171. }else{
  172. sApntTMSpec += grd_timelist.labelmatrix(iRow,iCol);
  173. }
  174. }else{
  175. if(sApntTMSpec != ""){
  176. sApntTMSpec += ",";
  177. }
  178. sApntTMSpec += grd_timelist.labelmatrix(iRow,iCol);
  179. }
  180. }
  181. }
  182. }
  183. var iRow = grd_clslist.findRow("true",1,1,false,true);
  184. sReturnMsg += model.getValue(xClsListPath+"["+iRow+"]/itemnm")+"▦"
  185. + model.getValue(xClsListPath+"["+iRow+"]/itemcd")+"▦"
  186. + sApntTMSpec+"▩";
  187. opener.javascript.setParameter("SPMNR04900_Return",sReturnMsg);
  188. window.close();
  189. }