SMMND03300.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. grd_mypatlist.fixedcellcheckbox(0, 0) = true;
  21. grd_mypatlist.mergeCol(0) = false;
  22. grd_mypatlist.mergeCol(2) = false;
  23. grd_mypatlist.mergeCol(3) = false;
  24. grd_mypatlist.mergeCol(4) = false;
  25. grd_mypatlist.mergeCol(5) = false;
  26. grd_mypatlist.mergeCol(6) = false;
  27. grd_mypatlist.mergeCol(7) = false;
  28. grd_mypatlist.mergeCol(8) = false;
  29. grd_mypatlist.mergeCol(9) = false;
  30. grd_mypatlist.mergeCol(10) = false;
  31. model.removeNodeset("/root/main/mypatinfo/mypatlist");
  32. var pFlag = '-';
  33. model.setValue("root/main/cond/userid", getUserId());
  34. model.setValue("root/main/cond/usernm", getUserName());
  35. model.setValue("root/main/cond/wardcd", getUserInfo("dutplcecd"));
  36. model.setValue("root/main/cond/shiftflag", pFlag);
  37. model.refresh();
  38. fGetPatList(pFlag);
  39. setRowStyle("grd_mypatlist", "0", "true", "mysetting", "equal");
  40. }
  41. // 환자리스트 조회
  42. function fGetPatList(pFlag){
  43. var today = getCurrentDate();
  44. grd_mypatlist.attribute("height") = "663";
  45. tar_settinginfo.visible = false;
  46. grd_mypatlist.rebuildStyle();
  47. model.removenode("/root/send");
  48. model.makeValue("/root/send/wardcd" , model.getValue("/root/main/cond/wardcd"));
  49. model.makeValue("/root/send/srchflag" , pFlag);
  50. model.makeValue("/root/send/rsrvfromdd", today);
  51. model.makeValue("/root/send/rsrvtodd" , today);
  52. model.makeValue("/root/send/shiftflag" , model.getValue("/root/main/cond/shiftflag"));
  53. submit("TRMND03301");
  54. grd_mypatlist.rebuildStyle(0, 0, grd_mypatlist.rows-1, grd_mypatlist.cols-1);
  55. setRowStyle("grd_mypatlist", "0", "true", "mysetting", "equal");
  56. }
  57. //그리드 온클릭이벤트
  58. function fOnclick(){
  59. if( grd_mypatlist.col != 0 && isDataCell()) {
  60. if (grd_mypatlist.mergeCol(grd_mypatlist.col) == true) {
  61. var arrRows = grd_mypatlist.mergeArea(grd_mypatlist.row, grd_mypatlist.col).split(",");
  62. var currentMysetting = model.getValue("/root/main/mypatinfo/mypatlist["+arrRows[0]+"]/mysetting")
  63. if(currentMysetting == "true" ) {
  64. currentMysetting = "false";
  65. } else {
  66. currentMysetting = "true";
  67. }
  68. for (var i=parseInt(arrRows[0]); i<=parseInt(arrRows[2]); i++) {
  69. model.setValue("/root/main/mypatinfo/mypatlist["+i+"]/mysetting", currentMysetting);
  70. }
  71. } else {
  72. var currentMysetting = model.getValue("/root/main/mypatinfo/mypatlist["+grd_mypatlist.selectedRow(0)+"]/mysetting")
  73. if (currentMysetting == "true") {
  74. model.setValue("/root/main/mypatinfo/mypatlist["+grd_mypatlist.selectedRow(0)+"]/mysetting","false");
  75. } else {
  76. model.setValue("/root/main/mypatinfo/mypatlist["+grd_mypatlist.selectedRow(0)+"]/mysetting","true");
  77. }
  78. }
  79. }
  80. grd_mypatlist.rebuildStyle(0, 0, grd_mypatlist.rows-1, grd_mypatlist.cols-1);
  81. setRowStyle("grd_mypatlist", "0", "true", "mysetting", "equal");
  82. }
  83. //내환자저장
  84. function fSave(){
  85. model.removenode("/root/send");
  86. model.makeValue("/root/send/mypatlist", grd_mypatlist.getUpdateDataAll("u"));
  87. if(grd_mypatlist.rows > 1){
  88. if (submit("TXMND03301") ) {
  89. grd_mypatlist.clearStatus(); // submit() 성공하면 그리드의 i,u,d 상태 제거
  90. fGetPatList("setting"); // 환자리스트 조회
  91. model.setValue("/root/main/saveinfo/message", " " + model.getValue("/root/main/settinginfo/settingtime") + "\n ["+ getUserName() + "]간호사의 \n 내환자가 Setting 되었습니다.");
  92. grd_mypatlist.attribute("height") = "405";
  93. tar_settinginfo.visible = true;
  94. tar_settinginfo.refresh();
  95. }
  96. } else {
  97. messageBox("저장할 내역이 ", "I004")
  98. }
  99. }
  100. //병동선택변경시
  101. function fWardcdChanged(){
  102. model.removenode("/root/send");
  103. model.makeValue("/root/send/wardcd", model.getValue("root/main/cond/wardcd"));
  104. submit("TRMND03302");
  105. grd_mypatlist.rebuildStyle(0, 0, grd_mypatlist.rows-1, grd_mypatlist.cols-1);
  106. setRowStyle("grd_mypatlist", "0", "true", "mysetting", "equal");
  107. }