SMAEA06100.js 10.0 KB

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