SMMND05100.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /*
  2. 인공신장실 내환자세팅 (SMMND03300.xrw - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. /**
  7. * @group :
  8. * @ver : 2009.01.07
  9. * @by : dhkim
  10. * @---------------------------------------------------
  11. * @type : function
  12. * @access : public
  13. * @desc : 화면 초기화
  14. * @param :
  15. * @return :
  16. * @---------------------------------------------------
  17. */
  18. function fInit(){
  19. var instcd = getUserInfo("dutplceinstcd");
  20. ipt_fromdt.value = getCurrentDate();
  21. ipt_todt.value = getCurrentDate();
  22. grd_mypatlist.fixedcellcheckbox(0, 0) = true;
  23. grd_mypatlist.mergeCol(0) = false;
  24. grd_mypatlist.mergeCol(2) = false;
  25. grd_mypatlist.mergeCol(3) = false;
  26. grd_mypatlist.mergeCol(4) = false;
  27. grd_mypatlist.mergeCol(5) = false;
  28. grd_mypatlist.mergeCol(6) = false;
  29. grd_mypatlist.mergeCol(7) = false;
  30. grd_mypatlist.mergeCol(8) = false;
  31. grd_mypatlist.mergeCol(9) = false;
  32. grd_mypatlist.mergeCol(10) = false;
  33. model.removeNodeset("/root/main/mypatinfo/mypatlist");
  34. var pFlag = '-';
  35. model.setValue("root/main/cond/userid", getUserId());
  36. model.setValue("root/main/cond/usernm", getUserName());
  37. model.setValue("root/main/cond/wardcd", getUserInfo("dutplcecd"));
  38. model.setValue("root/main/cond/shiftflag", pFlag);
  39. model.refresh();
  40. fGetPatList(pFlag);
  41. setRowStyle("grd_mypatlist", "0", "true", "mysetting", "equal");
  42. }
  43. // 환자리스트 조회
  44. function fGetPatList(pFlag){
  45. var today = getCurrentDate();
  46. grd_mypatlist.attribute("height") = "609";
  47. tar_settinginfo.visible = false;
  48. grd_mypatlist.rebuildStyle();
  49. model.removenode("/root/send");
  50. model.makeValue("/root/send/wardcd" , model.getValue("/root/main/cond/wardcd"));
  51. model.makeValue("/root/send/srchflag" , pFlag);
  52. model.makeValue("/root/send/rsrvfromdd", today);
  53. model.makeValue("/root/send/rsrvtodd" , today);
  54. model.makeValue("/root/send/shiftflag" , model.getValue("/root/main/cond/shiftflag"));
  55. //20130520 혈액투석적정서평가를 위한 파라메터 추가
  56. model.makeValue("/root/send/hdsaqnflag" , model.getValue("/root/main/cond/hdsaqnflag"));
  57. submit("TRMND05101");
  58. grd_mypatlist.rebuildStyle(0, 0, grd_mypatlist.rows-1, grd_mypatlist.cols-1);
  59. setRowStyle("grd_mypatlist", "0", "true", "mysetting", "equal");
  60. }
  61. //그리드 온클릭이벤트
  62. function fOnclick(){
  63. if( grd_mypatlist.col != 0 && isDataCell()) {
  64. if (grd_mypatlist.mergeCol(grd_mypatlist.col) == true) {
  65. var arrRows = grd_mypatlist.mergeArea(grd_mypatlist.row, grd_mypatlist.col).split(",");
  66. var currentMysetting = model.getValue("/root/main/mypatinfo/mypatlist["+arrRows[0]+"]/mysetting")
  67. if(currentMysetting == "true" ) {
  68. currentMysetting = "false";
  69. } else {
  70. currentMysetting = "true";
  71. }
  72. for (var i=parseInt(arrRows[0]); i<=parseInt(arrRows[2]); i++) {
  73. model.setValue("/root/main/mypatinfo/mypatlist["+i+"]/mysetting", currentMysetting);
  74. }
  75. } else {
  76. var currentMysetting = model.getValue("/root/main/mypatinfo/mypatlist["+grd_mypatlist.selectedRow(0)+"]/mysetting")
  77. if (currentMysetting == "true") {
  78. model.setValue("/root/main/mypatinfo/mypatlist["+grd_mypatlist.selectedRow(0)+"]/mysetting","false");
  79. } else {
  80. model.setValue("/root/main/mypatinfo/mypatlist["+grd_mypatlist.selectedRow(0)+"]/mysetting","true");
  81. }
  82. }
  83. }
  84. grd_mypatlist.rebuildStyle(0, 0, grd_mypatlist.rows-1, grd_mypatlist.cols-1);
  85. setRowStyle("grd_mypatlist", "0", "true", "mysetting", "equal");
  86. }
  87. //내환자저장
  88. function fSave(){
  89. model.removenode("/root/send");
  90. //20130523 kya 유효일자 세팅
  91. var fromdt = ipt_fromdt.value + '000000';
  92. var todt = ipt_todt.value + '235959';
  93. for(var i = 0; i<grd_mypatlist.rows ; i++) {
  94. var currentMysetting = model.getValue("/root/main/mypatinfo/mypatlist["+i+"]/mysetting");
  95. //alert("todt =====" + currentMysetting);
  96. if( currentMysetting == "t" ) {
  97. model.SetValue("/root/main/mypatinfo/mypatlist[" + i +"]/fromdt", fromdt);
  98. model.SetValue("/root/main/mypatinfo/mypatlist[" + i +"]/todt", todt);
  99. }
  100. }
  101. //20130520 혈액투석적정서평가를 위한 파라메터 추가
  102. model.makeValue("/root/send/mypatlist", grd_mypatlist.getUpdateDataAll("u"));
  103. if(grd_mypatlist.rows > 1){
  104. if (submit("TXMND05101") ) {
  105. grd_mypatlist.clearStatus(); // submit() 성공하면 그리드의 i,u,d 상태 제거
  106. fGetPatList("setting"); // 환자리스트 조회
  107. model.setValue("/root/main/saveinfo/message", " " + model.getValue("/root/main/settinginfo/settingtime") + "\n ["+ getUserName() + "]간호사의 \n 내환자가 Setting 되었습니다.");
  108. grd_mypatlist.attribute("height") = "405";
  109. tar_settinginfo.visible = true;
  110. tar_settinginfo.refresh();
  111. }
  112. } else {
  113. messageBox("저장할 내역이 ", "I004")
  114. }
  115. }
  116. //병동선택변경시
  117. function fWardcdChanged(){
  118. model.removenode("/root/send");
  119. model.makeValue("/root/send/wardcd", model.getValue("root/main/cond/wardcd"));
  120. submit("TRMND03302");
  121. grd_mypatlist.rebuildStyle(0, 0, grd_mypatlist.rows-1, grd_mypatlist.cols-1);
  122. setRowStyle("grd_mypatlist", "0", "true", "mysetting", "equal");
  123. }