SMMNP00730.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. /*
  2. 중환자실회복환자관리(SMMNP00730.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var xPatListPath = "/root/main/patinfo/patlist";
  7. /**
  8. * @group :
  9. * @ver : 2008.07.01
  10. * @by : dhkim
  11. * @---------------------------------------------------
  12. * @type : function
  13. * @access : public
  14. * @desc : 화면초기화
  15. * @param :
  16. * @param :
  17. * @return :
  18. * @---------------------------------------------------
  19. */
  20. function fInit(){
  21. //인스턴스초기화
  22. model.removenode('/root/send');
  23. model.removenode('/root/hidden');
  24. model.removenode('/root/main/patinfo');
  25. model.removenode('/root/cond');
  26. model.makenode('/root/send');
  27. model.makenode('/root/hidden');
  28. model.makenode('/root/main/patinfo');
  29. model.makenode('/root/cond/wardcd');
  30. model.makenode('/root/cond/fromdd');
  31. model.makenode('/root/cond/todd');
  32. model.makenode('/root/cond/rdocond');
  33. model.makeValue("/root/send/reqdata/cdgrupid", "094");
  34. model.makeValue("/root/send/reqdata/cdid", "");
  35. model.makeValue("/root/send/reqdata/supcdid", "");
  36. submit("TRMNP04903");
  37. addComboItem("cmb_spcl", "전 체", "", "above" );
  38. //조회조건 초기화
  39. model.setValue('/root/cond/fromdd', getCurrentDate());
  40. model.setValue('/root/cond/todd', getCurrentDate());
  41. model.setValue('/root/cond/rdocond', '1');
  42. model.refresh();
  43. }
  44. /**
  45. * @group :
  46. * @ver : 2008.07.01
  47. * @by : dhkim
  48. * @---------------------------------------------------
  49. * @type : function
  50. * @access : public
  51. * @desc : 회복환자조회
  52. * @param :
  53. * @param :
  54. * @return :
  55. * @---------------------------------------------------
  56. */
  57. function fSearch(){
  58. var wardcd = model.getValue('/root/cond/wardcd');
  59. var fromdd = model.getValue('/root/cond/fromdd');
  60. var todd = model.getValue('/root/cond/todd');
  61. var rdocond = model.getValue('/root/cond/rdocond');
  62. if(fromdd == null || fromdd == ''){
  63. fromdd = getCurrentDate();
  64. }
  65. if(todd == null || todd == ''){
  66. todd = getCurrentDate();
  67. }
  68. model.setValue('/root/cond/fromdd', fromdd);
  69. model.setValue('/root/cond/todd', todd);
  70. model.removenode('/root/send/reqdata');
  71. model.makeValue('/root/send/reqdata/wardcd', wardcd);
  72. model.makeValue('/root/send/reqdata/fromdd', fromdd);
  73. model.makeValue('/root/send/reqdata/todd', todd);
  74. model.makeValue('/root/send/reqdata/rdocond', rdocond);
  75. if(!submit('TRMNP00731')){
  76. messageBox('회복환자조회를', 'E009');
  77. return;
  78. }
  79. }
  80. /**
  81. * @group :
  82. * @ver : 2007.07.04
  83. * @by : 정경화
  84. * @---------------------------------------------------
  85. * @type : function
  86. * @access : public
  87. * @desc : Excel파일로 저장
  88. * @param :
  89. * @param :
  90. * @return :
  91. * @---------------------------------------------------
  92. */
  93. function fSaveExcel(){
  94. file = window.fileDialog("save","","true","","xls","All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  95. if(file != "") {
  96. grd_patlist.saveExcel(file);
  97. }
  98. }
  99. /**
  100. * @group :
  101. * @ver : 2008.07.01
  102. * @by : dhkim
  103. * @---------------------------------------------------
  104. * @type : function
  105. * @access : public
  106. * @desc : 회복환자 중환자실 퇴실시간 수정
  107. * @param :
  108. * @param :
  109. * @return :
  110. * @---------------------------------------------------
  111. */
  112. function fSave(){
  113. if(fIsValid()){
  114. model.removenode('/root/send');
  115. model.makeValue('/root/send/reqdata', grd_patlist.getUpdateDataAll('i'));
  116. if(!submit('TXMNP00731')){
  117. messageBox('회복환자 퇴실시간저장을', 'E009');
  118. return;
  119. }else{
  120. fSearch();
  121. }
  122. }
  123. }
  124. /**
  125. * @group :
  126. * @ver : 2008.07.01
  127. * @by : dhkim
  128. * @---------------------------------------------------
  129. * @type : function
  130. * @access : public
  131. * @desc : 회복환자 중환자실 퇴실시간 수정하기전 유효성체크
  132. * @param :
  133. * @param :
  134. * @return :
  135. * @---------------------------------------------------
  136. */
  137. function fIsValid(){
  138. var outdd, outtm;
  139. var isNull;//그리드에 전부다 입력 안됐을때 저장 막아준다.
  140. for(var i = 1; i <= grd_patlist.rows; i++){
  141. outdd = model.getValue('/root/main/patinfo/patlist[' + i + ']/icuoutroomdd');
  142. outtm = model.getValue('/root/main/patinfo/patlist[' + i + ']/icuoutroomtm');
  143. //퇴실일자만 입력되고 시간이 입력되지 않았을때
  144. if(outdd != null && outdd != ''){
  145. if(outdd.length != 8){
  146. messageBox(i + '번째의 환자의 퇴실일자를 날짜형식((예)2008-01-01)에 맞게', 'C001');
  147. return false;
  148. }
  149. if(outtm == null || outtm == ''){
  150. messageBox(i + '번째의 환자의 퇴실시간을', 'C001');
  151. return false;
  152. }else if(outtm.length != 4){
  153. messageBox(i + '번째의 환자의 퇴실시간을 시간형식((예)12:00)에 맞게', 'C001');
  154. return false;
  155. }
  156. isNull = false;
  157. }
  158. //퇴실시간만 입력되고 일자가 입력되지 않았을때
  159. if(outtm != null && outtm != ''){
  160. if(outtm.length != 4){
  161. messageBox(i + '번째의 환자의 퇴실시간을 시간형식((예)12:00)에 맞게', 'C001');
  162. return false;
  163. }
  164. if(outdd == null || outdd == ''){
  165. messageBox(i + '번째의 환자의 퇴실일자를', 'C001');
  166. return false;
  167. }else if(outdd.length != 8){
  168. messageBox(i + '번째의 환자의 퇴실일자를 날짜형식((예)2008-01-01)에 맞게', 'C001');
  169. return false;
  170. }
  171. isNull = false;
  172. }
  173. }
  174. //그리드에 입력된 퇴실시간, 퇴실일자가 없다.
  175. if(isNull){
  176. return false;
  177. }
  178. return true;
  179. }