SMMRC02500.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. /**
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 의료정보 - 안내문관리 ( SMMRC02500_안내문관리.xrw - JScript )
  4. - Version :
  5. 1) : Ver.1.00.01
  6. - Author : 이은영
  7. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  8. **/
  9. var xGuideDocuInfoPath = "/root/main/guidedocuinfo/guidedocu";
  10. var xGuideDocuHistInfoPath = "/root/main/guidedocuhistinfo/guidedocuhistlist";
  11. /**
  12. * @ver : 2008-02-29
  13. * @desc : 화면초기화
  14. * @
  15. * @by : 이은영
  16. * @param :
  17. * @return :
  18. * @---------------------------------------------------
  19. */
  20. function fInitialize(){
  21. fSrchGuideDocuHist();
  22. fDisabled(true);
  23. btn_update.disabled = true;
  24. btn_delete.disabled = true;
  25. btn_save.disabled =true;
  26. model.refresh();
  27. }
  28. /**
  29. * @ver : 2008-02-29
  30. * @desc : 이력조회
  31. * @
  32. * @by : 이은영
  33. * @param :
  34. * @return :
  35. * @---------------------------------------------------
  36. */
  37. function fSrchGuideDocuHist(){
  38. model.removenode("/root/send");
  39. model.makeNode("/root/send");
  40. model.copyNode("/root/send", "/root/main/cond");
  41. submit("TRMRC02501");
  42. }
  43. /**
  44. * @ver : 2008-02-29
  45. * @desc : 파일 추가
  46. * @
  47. * @by : 이은영
  48. * @param :
  49. * @return :
  50. * @---------------------------------------------------
  51. */
  52. function fUploadGuideDocuFile(){
  53. var file = window.fileDialog("open","","false","","","RTF Files(*.rtf)|*.rtf");
  54. if (file == "") {
  55. return;
  56. }
  57. // 선택한 파일을 RTF viewer로 보여준다.
  58. rtfviewer.OpenRtfFile(file);
  59. rtfviewer.ReadOnly = "true";
  60. model.setValue(xGuideDocuInfoPath+"/guidedocunm",fGetFileName(file));
  61. model.setValue(xGuideDocuInfoPath+"/guidedocudata",rtfviewer.TextRtf);
  62. model.refresh();
  63. }
  64. /**
  65. * @ver : 2008-02-29
  66. * @desc : 파일명 가져오기
  67. * @
  68. * @by : 이은영
  69. * @param :
  70. * @return :
  71. * @---------------------------------------------------
  72. */
  73. function fGetFileName(path) {
  74. var lastIdx = path.lastIndexOf("\\");
  75. if (lastIdx >= 0) {
  76. return path.substr(lastIdx+1);
  77. } else {
  78. return path;
  79. }
  80. }
  81. /**
  82. * @ver : 2008-02-29
  83. * @desc : 신규 안내문
  84. * @
  85. * @by : 이은영
  86. * @param :
  87. * @return :
  88. * @---------------------------------------------------
  89. */
  90. function fNewGuideDocu(){
  91. alert("안내문 구분 추가에 관련된 업무협의 중으로 신규작성 제한 중.");
  92. return ;
  93. model.resetInstanceNode(xGuideDocuInfoPath);
  94. rtfviewer.clear();
  95. fDisabled(false);
  96. btn_update.disabled = true;
  97. btn_delete.disabled = true;
  98. btn_save.disabled =false;
  99. model.setValue(xGuideDocuInfoPath+"/status","i");
  100. model.refresh();
  101. }
  102. /**
  103. * @ver : 2008-02-29
  104. * @desc : 안내문 수정
  105. * @
  106. * @by : 이은영
  107. * @param :
  108. * @return :
  109. * @---------------------------------------------------
  110. */
  111. function fUpdateGuideDocu(){
  112. var status = model.getValue(xGuideDocuInfoPath +"/status");
  113. if(status == "i" || status == ""){
  114. messageBox("해당 안내문을","C002");
  115. return;
  116. }
  117. fDisabled(false);
  118. btn_update.disabled = true;
  119. btn_delete.disabled = false;
  120. btn_save.disabled =false;
  121. model.refresh();
  122. }
  123. /**
  124. * @ver : 2008-02-29
  125. * @desc : 안내문 삭제
  126. * @
  127. * @by : 이은영
  128. * @param :
  129. * @return :
  130. * @---------------------------------------------------
  131. */
  132. function fDelGuideDocu(){
  133. alert("권한이 있는 자만 삭제가 가능합니다. ");
  134. return ;
  135. var status = model.getValue(xGuideDocuInfoPath +"/status");
  136. if(status == "i" || status == ""){
  137. messageBox("해당 안내문을","C002");
  138. return;
  139. }
  140. model.setValue(xGuideDocuInfoPath +"/status","d");
  141. fSave();
  142. }
  143. /**
  144. * @ver : 2008-02-29
  145. * @desc : 비활성화 여부
  146. * @
  147. * @by : 이은영
  148. * @param :
  149. * @return :
  150. * @---------------------------------------------------
  151. */
  152. function fDisabled(pFlag){
  153. cmb_guidedocuflag.disabled=pFlag;
  154. ipt_guidedocunm.disabled = pFlag;
  155. btn_addfile.disabled = pFlag;
  156. }
  157. /**
  158. * @ver : 2008-02-29
  159. * @desc : 저장
  160. * @
  161. * @by : 이은영
  162. * @param :
  163. * @return :
  164. * @---------------------------------------------------
  165. */
  166. function fSave(){
  167. if(model.getValue(xGuideDocuInfoPath+"/guidedocuflag") == ""){
  168. messageBox("안내문 구분을","C001");
  169. return;
  170. }
  171. if(model.getValue(xGuideDocuInfoPath+"/guidedocunm") == ""){
  172. messageBox("안내문명을","C001");
  173. return;
  174. }
  175. if(model.getValue(xGuideDocuInfoPath+"/guidedocudata") == ""){
  176. messageBox("파일을 추가","I008");
  177. return;
  178. }
  179. model.removenode("/root/send");
  180. model.makeNode("/root/send");
  181. model.copyNode("/root/send", xGuideDocuInfoPath);
  182. model.makeValue("/root/send/srchflag", model.getValue("/root/main/cond/srchflag"));
  183. model.removenodeset("/root/main/guidedocuhistinfo");
  184. if(submit("TXMRC02501")){
  185. model.resetInstanceNode(xGuideDocuInfoPath);
  186. rtfviewer.clear();
  187. fDisabled(true);
  188. btn_update.disabled = true;
  189. btn_delete.disabled = true;
  190. btn_save.disabled =true;
  191. model.refresh();
  192. }
  193. }
  194. /**
  195. * @ver : 2008-02-29
  196. * @desc : 안내문 정보를 조회
  197. * @
  198. * @by : 이은영
  199. * @param :
  200. * @return :
  201. * @---------------------------------------------------
  202. */
  203. function fSrchGuideDocuInfo(){
  204. if(grd_guidedoculist.isCell(event.target)){
  205. var iRow = grd_guidedoculist.row;
  206. if(iRow < 1) return;
  207. model.removenode("/root/send");
  208. model.makeValue("/root/send/guidedocucd", model.getValue(xGuideDocuHistInfoPath+"["+iRow+"]/guidedocucd"));
  209. if(submit("TRMRC02502")){
  210. rtfviewer.TextRtf = model.getValue(xGuideDocuInfoPath+"/guidedocudata");
  211. rtfviewer.ReadOnly = "true";
  212. fDisabled(true);
  213. btn_update.disabled = false;
  214. btn_delete.disabled = false;
  215. btn_save.disabled =true;
  216. model.refresh();
  217. }
  218. }
  219. }
  220. /**
  221. * @ver : 2008-02-29
  222. * @desc : 조회
  223. * @
  224. * @by :
  225. * @param :
  226. * @return :
  227. * @---------------------------------------------------
  228. */
  229. function fSearch(){
  230. alert("안내문 구분 추가에 관련된 업무협의 중입니다.");
  231. }