SMMNO03200.js 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. /*
  2. 초진환자_진료부도_지표관리 (SMMNO03200.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. /**
  7. * @group :
  8. * @ver : 2009.10.19
  9. * @by : 김양수
  10. * @---------------------------------------------------
  11. * @type : function
  12. * @access : public
  13. * @desc : 화면 초기화
  14. * @param :
  15. * @return :
  16. * @---------------------------------------------------
  17. */
  18. function fInitialize(){
  19. model.removenode("/root/main/outrsrvpatlist");
  20. model.refresh();
  21. var instcd = getUserInfo("dutplceinstcd");
  22. var rslt_ref = "/root/init/orddept";
  23. var dt = getCurrentDate();
  24. //오늘 날짜로 초기화 하는 부분.(진료일자를 default로 오늘 날짜로 선택함)
  25. model.setValue("/root/main/cond/ordfromdd", dt);
  26. model.setValue("/root/main/cond/ordtodd", dt);
  27. // 간호외래진료부서콤보 (특정하위부서를 포함- 분만실, 육아상담실, 인공신장실)
  28. zsdfGetCareOutOrderDepartmentList(instcd, rslt_ref, dt);
  29. addComboInstance("/root/init/orddept", "deptcd^depthngnm", "0000000000^전체진료과", "dept"); //진료부서 콤보 전체추가
  30. model.resetInstanceNode("/root/main/cond/orddept");
  31. // 공통코드 스크립트 호출
  32. //zbcfGetCodeList( new Array("Z0008"), new Array("/root/init/comcd"));
  33. var dutplcecd = getUserInfo("dutplcecd"); // 근무지부서코드
  34. if (dutplcecd != "") {
  35. model.setValue("/root/main/cond/orddeptcd", dutplcecd); // 근무지부서코드
  36. fDeptDoctSearch(); // 의사리스트조회
  37. }
  38. model.refresh();
  39. }
  40. /**
  41. * @group :
  42. * @ver : 2007.09.17
  43. * @by : 문창곤
  44. * @---------------------------------------------------
  45. * @type : function
  46. * @access : public
  47. * @desc : 진료과의 의사 조회
  48. * @param :
  49. * @return :
  50. * @---------------------------------------------------
  51. */
  52. function fDeptDoctSearch(){
  53. cmb_orddr.disabled = false;
  54. model.removenode("/root/main/outrsrvpatlist");
  55. model.refresh();
  56. model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/cond/ordfromdd"));
  57. model.makeValue("/root/send/reqdata/orddeptcd", model.getValue("/root/main/cond/orddeptcd"));
  58. var sordclsdeptflag = model.getValue("/root/init/orddept/dept[deptcd = '"+model.getValue("/root/main/cond/orddeptcd")+"']/ordclsdeptflag"); // 센터/대표/분과/서브 구분
  59. var ssupdeptcd = model.getValue("/root/init/orddept/dept[deptcd = '"+model.getValue("/root/main/cond/orddeptcd")+"']/supdeptcd"); // 상위부서코드
  60. var sorddeptkind = model.getValue("/root/init/orddept/dept[deptcd = '"+model.getValue("/root/main/cond/orddeptcd")+"']/orddeptkind"); // 센터/대표 구분
  61. var sorddeptflag = "";
  62. if (sorddeptkind == "C") { // 센터이면
  63. sorddeptflag = "C";
  64. //} else if (sorddeptkind != "C" && sordclsdeptflag == "A") { // 센터가 아니면서 분과이면
  65. // sorddeptflag = "A";
  66. } else { // 그외에 기타과
  67. sorddeptflag = "etc";
  68. }
  69. model.setValue("/root/main/cond/ordclsdeptflag",sorddeptflag);
  70. model.setValue("/root/main/cond/supdeptcd",ssupdeptcd);
  71. model.makeValue("/root/send/reqdata/ordclsdeptflag", sorddeptflag);
  72. model.makeValue("/root/send/reqdata/supdeptcd", ssupdeptcd);
  73. submit("TRMNO00104");
  74. if(getNodesetCount("/root/init/orddr/orddr") > 0){
  75. for(var i = 0; i < grd_OutRsrvPatList.cols;i++) {
  76. grd_OutRsrvPatList.colsort(i) = "asc";
  77. }
  78. } else {
  79. model.makenode("/root/init/orddr");
  80. model.makenode("/root/init/orddr/orddr");
  81. model.makenode("/root/init/orddr/orddr/userid");
  82. model.makenode("/root/init/orddr/orddr/usernm");
  83. }
  84. addComboInstance("/root/init/orddr", "userid^userdepthngnm", "00000000^전체의사", "orddr"); //진료의콤보 전체추가
  85. model.resetInstanceNode("/root/main/cond/orddr");
  86. cmb_orddr.refresh();
  87. }
  88. /**
  89. * @group :
  90. * @ver : 2009.10.19
  91. * @by : 김양수
  92. * @---------------------------------------------------
  93. * @type : function
  94. * @access : public
  95. * @desc : 초진 환자리스트 조회
  96. * @param :
  97. * @return :
  98. * @---------------------------------------------------
  99. */
  100. function fBtnRefClicked(){
  101. model.removenode("/root/main/outrsrvpatlist");
  102. model.refresh();
  103. var objGrid = switch1.selectedIndex == 0 ? grd_OutRsrvPatList : grd_OutRsrvPatList2;
  104. if(cmb_orddept.value == "") {
  105. messageBox("진료과를 선택하지 ","E007");
  106. return;
  107. }
  108. //진료의 확인추가(진료의선택하지않아도 전체의사조회됨)-20090910-kys
  109. if(cmb_orddr.value == "") {
  110. messageBox("진료의를 선택하지 ","E007");
  111. return;
  112. }
  113. model.makeValue("/root/main/cond/tabflag", switch1.selectedIndex);
  114. model.makenode("/root/send/req");
  115. model.copynode("/root/send/req", "/root/main/cond");
  116. if(submit("TRMNO03201")){
  117. model.setValue("/root/main/cond/cnt", objGrid.rows - objGrid.fixedRows);
  118. for ( var nCnt = objGrid.fixedRows; nCnt < objGrid.rows; nCnt++ ) {
  119. var strVal = model.getValue("/root/main/outrsrvpatlist/outrsrvpatinfo[" + (nCnt - objGrid.fixedRows + 1) + "]/ordddbf");
  120. if ( strVal == "예약대기" )
  121. objGrid.cellstyle("font-weight", nCnt, 9) = "bold";
  122. }
  123. opt_cnt.refresh();
  124. }
  125. objGrid.refresh();
  126. model.refresh();
  127. }
  128. /**
  129. * @group :
  130. * @ver : 2010.02.05
  131. * @by : 이원태
  132. * @---------------------------------------------------
  133. * @type : function
  134. * @access : public
  135. * @desc : 통계 데이터 저장
  136. * @param :
  137. * @return :
  138. * @---------------------------------------------------
  139. */
  140. function fBtnSaveClicked(){
  141. if ( messageBox("진료일이 현재일 이상일 경우 저장 가능합니다.\n","Q002") == "7" )
  142. return;
  143. model.makeValue("/root/main/cond/tabflag", switch1.selectedIndex);
  144. var sReq = "chk▦instcd▦pid▦orddd▦cretno▦indxitem▦status▦remark▦status_old▦remark_old▩";
  145. var objGrid = switch1.selectedIndex == 0 ? grd_OutRsrvPatList : grd_OutRsrvPatList2;
  146. var strPath = "/root/main/outrsrvpatlist/outrsrvpatinfo";
  147. for ( var nCnt = objGrid.fixedRows; nCnt < objGrid.rows; nCnt++ ) {
  148. sReq += model.getValue(strPath + "[" + nCnt + "]/chk") + "▦"
  149. + model.getValue(strPath + "[" + nCnt + "]/instcd") + "▦"
  150. + model.getValue(strPath + "[" + nCnt + "]/pid") + "▦"
  151. + model.getValue(strPath + "[" + nCnt + "]/orddd") + "▦"
  152. + model.getValue(strPath + "[" + nCnt + "]/cretno") + "▦"
  153. + model.getValue(strPath + "[" + nCnt + "]/indxitem") + "▦"
  154. + model.getValue(strPath + "[" + nCnt + "]/status") + "▦"
  155. + model.getValue(strPath + "[" + nCnt + "]/remark") + "▦"
  156. + model.getValue(strPath + "[" + nCnt + "]/status_old") + "▦"
  157. + model.getValue(strPath + "[" + nCnt + "]/remark_old") + "▩";
  158. }
  159. model.removenode("/root/send/req");
  160. model.makeValue("/root/send/req" , sReq);
  161. submit("TRMNO03202")
  162. fBtnRefClicked();
  163. }
  164. /**
  165. * @group :
  166. * @ver : 2010.02.05
  167. * @by : 이원태
  168. * @---------------------------------------------------
  169. * @type : function
  170. * @access : public
  171. * @desc : 통계 데이터 수정 취소
  172. * @param :
  173. * @return :
  174. * @---------------------------------------------------
  175. */
  176. function fBtnResetClicked(){
  177. if ( messageBox("진료일이 현재일 이상일 경우 취소 가능합니다.\n","Q007") == "7" )
  178. return;
  179. model.makeValue("/root/main/cond/tabflag", switch1.selectedIndex);
  180. var sReq = "chk▦instcd▦pid▦orddd▦cretno▦indxitem▦status▦remark▦status_old▦remark_old▩";
  181. var objGrid = switch1.selectedIndex == 0 ? grd_OutRsrvPatList : grd_OutRsrvPatList2;
  182. var strPath = "/root/main/outrsrvpatlist/outrsrvpatinfo";
  183. for ( var nCnt = objGrid.fixedRows; nCnt < objGrid.rows; nCnt++ ) {
  184. sReq += model.getValue(strPath + "[" + nCnt + "]/chk") + "▦"
  185. + model.getValue(strPath + "[" + nCnt + "]/instcd") + "▦"
  186. + model.getValue(strPath + "[" + nCnt + "]/pid") + "▦"
  187. + model.getValue(strPath + "[" + nCnt + "]/orddd") + "▦"
  188. + model.getValue(strPath + "[" + nCnt + "]/cretno") + "▦"
  189. + model.getValue(strPath + "[" + nCnt + "]/indxitem") + "▦"
  190. + model.getValue(strPath + "[" + nCnt + "]/status") + "▦"
  191. + model.getValue(strPath + "[" + nCnt + "]/remark") + "▦"
  192. + model.getValue(strPath + "[" + nCnt + "]/status_old") + "▦"
  193. + model.getValue(strPath + "[" + nCnt + "]/remark_old") + "▩";
  194. }
  195. model.removenode("/root/send/req");
  196. model.makeValue("/root/send/req" , sReq);
  197. submit("TRMNO03203")
  198. fBtnRefClicked();
  199. }
  200. /**========================================================================================================================================
  201. * 엑셀저장 버튼 클릭시
  202. =========================================================================================================================================*/
  203. function fBtnExcelClicked() {
  204. var objGrid = switch1.selectedIndex == 0 ? grd_OutRsrvPatList : grd_OutRsrvPatList2;
  205. if ( objGrid.rows == objGrid.fixedRows ) {
  206. messageBox("엑셀파일로 저장할 리스트 내역이", "I004");
  207. return;
  208. }
  209. var fileName = window.fileDialog("save", ",", false, "해피콜관리", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  210. if (fileName != "")
  211. objGrid.saveExcel(fileName, "SheetName", false, false, "", "", false);
  212. }
  213. /**
  214. * @desc : 콤보박스에 원하는 instance node와 value를 설정
  215. * @
  216. * @param :
  217. * @event :
  218. * @return :
  219. * @---------------------------------------------------
  220. */
  221. function addComboInstance(combopath, nodename, nodeval, parentnode){
  222. nodename = nodename.split("^");
  223. nodeval = nodeval.split("^");
  224. if(nodename.length != nodeval.length){
  225. return;
  226. }
  227. var label = model.instances(0).createElement(nodename[0]);
  228. var val = model.instances(0).createElement(nodename[1]);
  229. var combo = model.instances(0).createElement(parentnode);
  230. label.value = "" + nodeval[0] + "";
  231. val.value = "" + nodeval[1] + "";
  232. combo.appendChild(label);
  233. combo.appendChild(val);
  234. chkNode = model.instances(0).selectSingleNode(combopath);
  235. if(chkNode == null){
  236. model.makeNode(combopath);
  237. srcNode = model.instances(0).selectSingleNode(combopath);
  238. }else{
  239. srcNode = model.instances(0).selectSingleNode(combopath);
  240. }
  241. desNode = model.instances(0).selectSingleNode(combopath + "/" + parentnode);
  242. srcNode.insertBefore(combo, desNode);
  243. model.refresh();
  244. }