ZMS00200.js 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 단문메시지형식관리 (ZMS00200.js)
  4. - Version :
  5. 1) : Ver.1.00.00
  6. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  7. */
  8. /**
  9. * @group :
  10. * @ver : 2006.12.20
  11. * @by : 이상준
  12. * @---------------------------------------------------
  13. * @type : function
  14. * @access : public
  15. * @desc : 공통코드스크립트호출
  16. * @return :
  17. * @---------------------------------------------------
  18. */
  19. function fInitcomcd() {
  20. // 공통코드 스크립트 호출
  21. //zbcfGetKindCodeList( new Array("Z0001Z000901"), new Array("/root/init/comcd"));
  22. zbcfGetKindCodeList(new Array("Z0001"), new Array("Z0009"), new Array("/root/init/comcd"), false, new Array("cdnm"), new Array("asc"));
  23. fInsertInstance("Z0001Z0009", "전체", "-");
  24. }
  25. /**
  26. * @group :
  27. * @ver : 2006.12.20
  28. * @by : 이상준
  29. * @---------------------------------------------------
  30. * @type : function
  31. * @access : public
  32. * @desc : 초기화
  33. * @return :
  34. * @---------------------------------------------------
  35. */
  36. function fInitialize() {
  37. model.removeNodeset("/root/main/list/msgfrmtlist");
  38. model.resetInstanceNode("/root/send");
  39. model.resetInstanceNode("/root/main/item");
  40. // 공통코드 스크립트 호출
  41. //zbcfGetCodeList( new Array("Z0001Z000901"), new Array("/root/init/comcd"));
  42. model.refresh();
  43. cmb_bizabbr.select(0);
  44. }
  45. /**
  46. * @group :
  47. * @ver : 2006.12.20
  48. * @by : 이상준
  49. * @---------------------------------------------------
  50. * @type : function
  51. * @access : public
  52. * @desc : 그리드에 있는 데이터를 하단으로 옮겨옴
  53. * @return :
  54. * @---------------------------------------------------
  55. */
  56. function fUpdateGrid() {
  57. var cur_row = grd_msgformatlist.row;
  58. var temp;
  59. var formatID;
  60. if ( cur_row > 0 ) {
  61. model.copyNode("/root/main/item","/root/main/list/msgfrmtlist["+cur_row+"]");
  62. formatID = model.getValue("/root/main/list/msgfrmtlist["+cur_row+"]/msgfrmtid");
  63. temp = formatID.split(".");
  64. model.setValue("/root/hidden/serial", temp[2]);
  65. model.refresh();
  66. }
  67. }
  68. /**
  69. * @group :
  70. * @ver : 2006.12.20
  71. * @by : 이상준
  72. * @---------------------------------------------------
  73. * @type : function
  74. * @access : public
  75. * @desc : 그리드의 데이터를 하단에 반영
  76. * @return :
  77. * @---------------------------------------------------
  78. */
  79. function fFetchFromGrid() {
  80. var cur_row = grd_msgformatlist.row;
  81. var temp;
  82. var formatID;
  83. if ( cur_row > 0 ) {
  84. model.copyNode("/root/main/item","/root/main/list/msgfrmtlist["+cur_row+"]");
  85. formatID = model.getValue("/root/main/list/msgfrmtlist["+cur_row+"]/msgfrmtid");
  86. temp = formatID.split(".");
  87. model.setValue("/root/hidden/serial", temp[2]);
  88. model.refresh();
  89. }
  90. }
  91. /**
  92. * @group :
  93. * @ver : 2006.12.20
  94. * @by : 이상준
  95. * @---------------------------------------------------
  96. * @type : function
  97. * @access : public
  98. * @desc : 하단폼에 입력된 값들을 체크한다.
  99. * @return :
  100. * @---------------------------------------------------
  101. */
  102. function fCheckFormField() {
  103. // 각 필드값을 체크한다.
  104. if(model.getValue("/root/main/item/bizabbr").getTrim()=="")
  105. {
  106. messageBox("업무시스템 ", "I003");
  107. model.setFocus("cmb_syscdinput");
  108. return false;
  109. }
  110. if(model.getValue("/root/hidden/serial").getTrim()=="")
  111. {
  112. messageBox("메시지형식번호는 ", "I003");
  113. model.setFocus("ipt_serial");
  114. return false;
  115. }
  116. if(model.getValue("/root/main/item/replytelno").getTrim()=="")
  117. {
  118. messageBox("회신번호는 ", "I003");
  119. model.setFocus("ipt_replytelno");
  120. return false;
  121. }
  122. if(model.getValue("/root/main/item/rsrvtime").getTrim()=="")
  123. {
  124. messageBox("예약발송시간은 ", "I003");
  125. model.setFocus("ipt_rsrvtime");
  126. return false;
  127. }
  128. if(model.getValue("/root/main/item/rsrvtime").length != 4)
  129. {
  130. messageBox("예약발송시간이 mm:ss 형식과 ", "E004");
  131. model.setFocus("ipt_rsrvtime");
  132. return false;
  133. }
  134. if(model.getValue("/root/main/item/msgfrmtcnts").getTrim()=="")
  135. {
  136. messageBox("메시지형식은 ", "I003");
  137. model.setFocus("tar_msgformat");
  138. return false;
  139. }
  140. return true;
  141. }
  142. /**
  143. * @group :
  144. * @ver : 2006.12.20
  145. * @by : 이상준
  146. * @---------------------------------------------------
  147. * @type : function
  148. * @access : public
  149. * @desc : 업무시스템명과 일련번호를 조합하여 조회조건에 포함될 메시지형식을 만든다.
  150. * @return :
  151. * @---------------------------------------------------
  152. */
  153. function fSetMsgFormatID()
  154. {
  155. var bizabbr = model.getValue("/root/main/item/bizabbr");
  156. var serial = model.getValue("/root/hidden/serial");
  157. switch(serial.length) {
  158. case 1 :
  159. serial = "000"+serial;
  160. break
  161. case 2 :
  162. serial = "00"+serial;
  163. break
  164. case 3 :
  165. serial = "0"+serial;
  166. break
  167. default:
  168. }
  169. model.setValue("/root/hidden/serial", serial);
  170. model.setValue("/root/main/item/msgfrmtid", "sms."+bizabbr+"."+serial);
  171. model.refresh();
  172. }
  173. /**
  174. * @group :
  175. * @ver : 2006.12.20
  176. * @by : 이상준
  177. * @---------------------------------------------------
  178. * @type : function
  179. * @access : public
  180. * @desc : 업무시스템명과 일련번호를 조합하여 메시지형식을 만든다.
  181. * @return :
  182. * @---------------------------------------------------
  183. */
  184. function fChkBizCombo()
  185. {
  186. var bizabbr = model.getValue("/root/send/bizabbr");
  187. var serial = model.getValue("/root/send/serial");
  188. if (bizabbr == "-")
  189. {
  190. model.setValue("/root/send/msgfrmtid", "");
  191. model.setValue("/root/send/serial", "");
  192. ipt_msgfrmtno.disabled = true;
  193. model.refresh();
  194. return;
  195. }
  196. else
  197. {
  198. ipt_msgfrmtno.disabled = false;
  199. }
  200. if(serial.getTrim()=="")
  201. model.setValue("/root/send/msgfrmtid", "");
  202. else
  203. model.setValue("/root/send/msgfrmtid", "sms."+bizabbr+"."+serial);
  204. model.refresh();
  205. }
  206. /**
  207. * @group :
  208. * @ver : 2006.12.20
  209. * @by : 이상준
  210. * @---------------------------------------------------
  211. * @type : function
  212. * @access : public
  213. * @desc : 업무시스템명과 일련번호를 조합하여 메시지형식을 만든다.
  214. * @return :
  215. * @---------------------------------------------------
  216. */
  217. function fChkMsgFormatID()
  218. {
  219. var bizabbr = model.getValue("/root/send/bizabbr");
  220. var serial = model.getValue("/root/send/serial");
  221. if(bizabbr.getTrim()=="-")
  222. {
  223. messageBox("업무시스템을", "C002");
  224. model.setFocus("cmb_bizabbr");
  225. return;
  226. }
  227. if(serial.getTrim()=="")
  228. model.setValue("/root/send/msgfrmtid", "");
  229. else
  230. model.setValue("/root/send/msgfrmtid", "sms."+bizabbr+"."+serial);
  231. model.refresh();
  232. }
  233. /**
  234. * @group :
  235. * @ver : 2006.12.20
  236. * @by : 이상준
  237. * @---------------------------------------------------
  238. * @type : function
  239. * @access : public
  240. * @desc : 지정된 인스턴스를 삽입
  241. * @return :
  242. * @---------------------------------------------------
  243. */
  244. function fInsertInstance(cdGroupID, codeName, codeID) {
  245. model.refresh();
  246. model.copyNode("/root/hidden/comcd","/root/init/comcd");
  247. var nodelist = instance1.selectNodes("/root/hidden/comcd/"+cdGroupID);
  248. var newNode = instance1.createNode("element", cdGroupID, "");
  249. var childnode1 = instance1.createNode("element", "cdnm", "");
  250. var childnode2 = instance1.createNode("element", "cdengabbrnm", "");
  251. newNode.appendChild(childnode1);
  252. newNode.appendChild(childnode2);
  253. if (nodelist.length > 0)
  254. {
  255. var currNode = root.hidden.comcd.insertBefore(newNode, nodelist.item(0));
  256. model.setValue("/root/hidden/comcd/"+cdGroupID+"[1]/cdnm", codeName);
  257. model.setValue("/root/hidden/comcd/"+cdGroupID+"[1]/cdengabbrnm", codeID);
  258. }
  259. }
  260. /**
  261. * @group :
  262. * @ver : 2006.12.20
  263. * @by : 이상준
  264. * @---------------------------------------------------
  265. * @type : function
  266. * @access : public
  267. * @desc : 초기화
  268. * @return :
  269. * @---------------------------------------------------
  270. */
  271. function fChkFormatID() {
  272. var cond = model.getValue("/root/main/item/msgfrmtid");
  273. model.setValue("/root/send/checkcond", cond);
  274. if(submit("TXZMS00202"))
  275. {
  276. messageBox(model.getValue("/root/hidden/msg/info/contents"), "I999");
  277. }
  278. /*
  279. model.resetInstanceNode("/root/send");
  280. model.resetInstanceNode("/root/main/item");
  281. fInsertInstance("bizabbr", "전체", "-");
  282. model.refresh();
  283. cmb_bizabbr.select(0);
  284. */
  285. }
  286. /**
  287. * @group :
  288. * @ver : 2006.12.20
  289. * @by : 이상준
  290. * @---------------------------------------------------
  291. * @type : function
  292. * @access : public
  293. * @desc : 그리드데이터 저장
  294. * @return :
  295. * @---------------------------------------------------
  296. */
  297. function fSaveGrid() {
  298. model.setValue("/root/send/msgfrmtlist",grd_msgformatlist.getUpdateData());
  299. if ( submit("TXZMS00201") ) {
  300. grd_msgformatlist.clearStatus(); // submit() 성공하면 그리드의 i,u,d 상태 제거
  301. }
  302. }