SMMNO01100.js 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. /*
  2. SMS전송 관리(SMMNO01100.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var xOpatListPath = "/root/main/opatlist/opatlist";
  7. var xBaseCodeListBKPath = "/root/temp/basecodelist/basecodelistinfo";
  8. var xSMSCodeListPath = "/root/main/smscodelist/smscodelistinfo";
  9. var xDoctListPath = "/root/main/doctlist/doctlistinfo";
  10. var g_initGrdData; // 리스트 관련 초기 Instance값
  11. var g_updateData;
  12. /**
  13. * @group :
  14. * @ver : 2007.07.04
  15. * @by : 정경화
  16. * @---------------------------------------------------
  17. * @type : function
  18. * @access : public
  19. * @desc : 화면 초기화
  20. * @param :
  21. * @return :
  22. * @---------------------------------------------------
  23. */
  24. function fInitialize(){
  25. g_updateData = grd_opatmngt.getUpdateData("update");
  26. //오늘 날짜로 초기화 하는 부분.(진료일자를 default로 오늘 날짜로 선택함)
  27. var dt = getCurrentDate();
  28. grd_opatmngt.fixedcellcheckbox(0,1) = true;
  29. model.removeNodeset(xOpatListPath);
  30. model.setValue("/root/main/cond/orddd", dt);
  31. var instcd = getUserInfo("dutplceinstcd");
  32. var standard_yn = "rcptuseyn";
  33. var ord_deptflag = 'X';
  34. var rslt_ref = "/root/hidden/orddeptlist";
  35. var sort_field = "depthngnm";
  36. var sort_method = "asc";
  37. var dt = getCurrentDate();
  38. //zbcfGetDeptCodeList(instcd, standard_yn, ord_deptflag, rslt_ref, "depthngnm", "asc");
  39. //zsdfGetOutOrdDeptList( instcd, rslt_ref, sort_field, sort_method, dt );
  40. // 간호외래진료부서콤보 (특정하위부서를 포함- 분만실, 육아상담실, 인공신장실)
  41. zsdfGetCareOutOrderDepartmentList(instcd, rslt_ref, dt);
  42. model.setValue("/root/main/cond/orddeptcd", getUserInfo("dutplcecd")); // 근무지부서코드
  43. fDeptChanged(); //진료과내의 의사정보 조회
  44. fBaseCodeSearch("B"); // 전송구분 조회
  45. model.refresh();
  46. }
  47. /**
  48. * @group :
  49. * @ver : 2007.07.04
  50. * @by : 정경화
  51. * @---------------------------------------------------
  52. * @type : function
  53. * @access : public
  54. * @desc : 전송구분 조회
  55. * @param :
  56. * @return :
  57. * @---------------------------------------------------
  58. */
  59. function fBaseCodeSearch(typegubn){
  60. model.setValue("/root/main/cond/baseclsflag", "O"); // 외래기준자료
  61. model.setValue("/root/main/cond/basetypecd", typegubn);
  62. model.setValue("/root/main/cond/supbasetypecd", "O");
  63. model.copynode("/root/send/req", "/root/main/cond");
  64. if(submit("TRMNO00801")){
  65. model.removeNodeset("/root/main/basecodelist/basecodelistinfo");
  66. cmb_sendgb.select(0);
  67. }
  68. }
  69. /**
  70. * @group :
  71. * @ver : 2007.07.04
  72. * @by : 정경화
  73. * @---------------------------------------------------
  74. * @type : function
  75. * @access : public
  76. * @desc : 진료과내의 의사정보 조회
  77. * @param :
  78. * @return :
  79. * @---------------------------------------------------
  80. */
  81. function fDeptChanged() {
  82. if(model.getValue("/root/main/cond/orddeptcd") <= ""){
  83. return;
  84. }
  85. cmb_orddr.disabled = false;
  86. model.resetInstanceNode("/root/main/condition/orddrid");
  87. model.makeValue("/root/send/req/orddeptcd", model.getValue("/root/main/cond/orddeptcd"));
  88. model.makeValue("/root/send/req/orddd", model.getValue("/root/main/cond/orddd"));
  89. var sordclsdeptflag = model.getValue("/root/hidden/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/cond/orddeptcd")+"']/ordclsdeptflag"); // 센터/대표/분과/서브 구분
  90. var sorddeptkind = model.getValue("/root/hidden/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/cond/orddeptcd")+"']/orddeptkind"); // 센터/대표 구분
  91. var ssupdeptcd = model.getValue("/root/hidden/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/cond/orddeptcd")+"']/supdeptcd"); // 상위부서코드
  92. var sorddeptflag = "";
  93. if (sorddeptkind == "C") { // 센터이면
  94. sorddeptflag = "C";
  95. //} else if (sorddeptkind != "C" && sordclsdeptflag == "A") { // 센터가 아니면서 분과이면
  96. // sorddeptflag = "A";
  97. } else { // 그외에 기타과
  98. sorddeptflag = "etc";
  99. }
  100. model.setValue("/root/main/cond/ordclsdeptflag",sorddeptflag);
  101. model.setValue("/root/main/cond/supdeptcd",ssupdeptcd);
  102. model.makeValue("/root/send/req/ordclsdeptflag", model.getValue("/root/main/cond/ordclsdeptflag"));
  103. model.makeValue("/root/send/req/supdeptcd", model.getValue("/root/main/cond/supdeptcd"));
  104. //추가. 20081103
  105. model.makeValue("/root/send/req/prcpspecflag", model.getValue("/root/main/cond/prcpspecflag"));
  106. submit("TRMNO00104");
  107. model.refresh();
  108. //model.setFocus("btn_ref");
  109. }
  110. /**
  111. * @group :
  112. * @ver : 2007.07.04
  113. * @by : 정경화
  114. * @---------------------------------------------------
  115. * @type : function
  116. * @access : public
  117. * @desc : SMS 상용구의 중분류에서 기준코드조회
  118. * @param :
  119. * @return :
  120. * @---------------------------------------------------
  121. */
  122. function fGubnChanged() {
  123. model.removeNodeset(xBaseCodeListBKPath);
  124. grd_baselist.refresh();
  125. //model.setValue("/root/main/cond/supbasetypecd", model.getValue("/root/send/req/basegubn"));
  126. model.setValue("/root/main/cond/baseclsflag", "O"); // 외래기준자료
  127. model.copynode("/root/send/req", "/root/main/cond");
  128. submit("TRMNO00800");
  129. }
  130. /**
  131. * @group :
  132. * @ver : 2007.07.04
  133. * @by : 정경화
  134. * @---------------------------------------------------
  135. * @type : function
  136. * @access : public
  137. * @desc : 기준 Code 리스트 초기화
  138. * @param : grid : grid Name
  139. * @return :
  140. * @---------------------------------------------------
  141. */
  142. function fBaseCodeReset(pPath, GrdControl) {
  143. model.removeNodeset(pPath);
  144. GrdControl.Rebuild();
  145. }
  146. /**
  147. * @group :
  148. * @ver : 2007.07.04
  149. * @by : 정경화
  150. * @---------------------------------------------------
  151. * @type : function
  152. * @access : public
  153. * @desc : 진료예약 대상자를 조회
  154. * @param :
  155. * @return :
  156. * @---------------------------------------------------
  157. */
  158. function fBtnRefClicked(){
  159. if(isRequiredControls("ipt_orddd", "cmb_orddept", "cmb_orddr")) {
  160. grd_opatmngt.fixedcellischeck(0,1) = false;
  161. model.removeNodeset(xOpatListPath);
  162. grd_opatmngt.refresh();
  163. model.makeValue("/root/send/req/stat", "4"); // 전체 조회
  164. model.copynode("/root/send/req", "/root/main/cond");
  165. // 날짜 변경시 의사스케쥴재조회
  166. fDeptChanged();
  167. submit("TRMNO01100");
  168. //조회 후 상태 정보 clear
  169. grd_opatmngt.clearStatus();
  170. }
  171. model.setValue("/root/main/cond/cntctel", model.getValue("/root/main/opatlist/opatlist[1]/cntctel"));
  172. ipt_cntctel.refresh();
  173. }
  174. /**
  175. * @group :
  176. * @ver : 2007.07.04
  177. * @by : 정경화
  178. * @---------------------------------------------------
  179. * @type : function
  180. * @access : public
  181. * @desc : 그리드 클릭시 선택컬럼 값 변경
  182. * @param :
  183. * @return :
  184. * @---------------------------------------------------
  185. */
  186. function fClickedGridRow(){
  187. var iRow = 0;
  188. var iCol = 0;
  189. iRow = grd_opatmngt.row;
  190. iCol = grd_opatmngt.col;
  191. //** 전체선택 체크박스 기능 추가_20081128(ByJA) ******************************************//
  192. if(iRow == "0"){
  193. if(grd_opatmngt.fixedcellischeck(0, grd_opatmngt.colRef("acptyn"))==true){ // 선택시
  194. for(i=1;i<=getNodesetCount(xOpatListPath);i++){
  195. model.makeValue(xOpatListPath + "[" + i + "]/acptyn", "true");
  196. grd_opatmngt.rowStatus(i) = 2;
  197. }
  198. } else{
  199. for(i=1;i<=getNodesetCount(xOpatListPath);i++){
  200. model.makeValue(xOpatListPath + "[" + i + "]/acptyn", "false");
  201. grd_opatmngt.removeStatus(i, "update");
  202. }
  203. }
  204. }
  205. //***************************************************************************************//
  206. if(iCol == 1) return;
  207. if(iRow < 1) return;
  208. if(model.getValue(xOpatListPath+"["+iRow+"]/acptyn") == "true"){
  209. model.setValue(xOpatListPath+"["+iRow+"]/acptyn","false");
  210. grd_opatmngt.removeStatus(iRow, "update");
  211. }else{
  212. model.setValue(xOpatListPath+"["+iRow+"]/acptyn", "true");
  213. grd_opatmngt.rowStatus(iRow) = 2;
  214. }
  215. }
  216. /**
  217. * @group :
  218. * @ver : 2007.07.04
  219. * @by : 정경화
  220. * @---------------------------------------------------
  221. * @type : function
  222. * @access : public
  223. * @desc : SMS 자료 전송
  224. * @param :
  225. * @return :
  226. * @---------------------------------------------------
  227. */
  228. function fCallMngtInfo(){
  229. if(model.getValue("/root/item") == ""){
  230. messageBox("전송내용을 입력하지 ","E007");
  231. return;
  232. }
  233. // 발신번호 Setting
  234. for(var i=1; i<=getNodesetCount(xOpatListPath); i++){
  235. model.setValue(xOpatListPath + "[" + i + "]/cntctel", model.getValue("/root/main/cond/cntctel"));
  236. }
  237. var updatedata = grd_opatmngt.getUpdateData("update");
  238. if(updatedata == g_updateData){
  239. messageBox("SMS 전송대상이 ", "I004")
  240. return;
  241. }
  242. for(var iRow = grd_opatmngt.fixedrows; iRow <= grd_opatmngt.rows - grd_opatmngt.fixedrows; iRow++){
  243. if((model.getValue(xOpatListPath+"["+iRow+"]/mpphontel").length < 10) &&
  244. (model.getValue(xOpatListPath+"["+iRow+"]/acptyn") == "true")){
  245. messageBox(model.getValue(xOpatListPath+"["+iRow+"]/hngnm") + "의 휴대전화번호가 ","C001");
  246. return;
  247. }
  248. }
  249. var sRtnMsg = messageBox("SMS 전송을 ", "Q003");
  250. if(sRtnMsg != 6) return;
  251. model.copynode("/root/send", "/root/main/cond");
  252. model.makeValue("/root/send/msgparam", model.getValue("/root/item"));
  253. model.makeValue("/root/send/opatinfo",updatedata);
  254. if(submit("TXMNO01101")){
  255. grd_opatmngt.fixedcellischeck(0,1) = false;
  256. model.setValue("/root/item","");
  257. model.removenode("/root/send/opatinfo");
  258. model.refresh();
  259. //2009-06-15 오전 11:18:12 taebum 전송 후 Grid Data Clear 로직 추가
  260. grd_opatmngt.refresh();
  261. grd_opatmngt.clearStatus();
  262. }else{
  263. //2009-06-15 오전 11:18:12 taebum 전송 후 Grid Data Clear 로직 추가
  264. grd_opatmngt.refresh();
  265. grd_opatmngt.clearStatus();
  266. }
  267. }