SMMMO00600.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. var sETCPRMSPRCPSETLIST = "/root/main/etcprmsprcpsetinfo/etcprmsprcpsetlist";
  2. var sETCPRMSPRCPSETDETLLIST = "/root/main/etcprmsprcpsetdetlinfo/etcprmsprcpsetdetllist";
  3. var sETCPRMSPRCPSETLIST_TMP = "/root/hidden/etcprmsprcpsettmp/etcprmsprcpsetlist";
  4. var sETCPRMSPRCPSETLIST_HIDDEN = "/root/hidden/etcprmsprcpsetinfo/etcprmsprcpsetlist";
  5. var sDIAGHISTINFO = "/root/hidden/diaghistinfo/diaghist";
  6. /**
  7. * @desc : 화면 초기화
  8. * @
  9. * @param :
  10. * @return :
  11. * @---------------------------------------------------
  12. */
  13. function fInitialize(){
  14. model.removeNodeset(sETCPRMSPRCPSETDETLLIST);
  15. group1.attribute("height") = 0;
  16. model.makeNode("/root/send/reqdata/settypecd");
  17. model.setValue("/root/send/reqdata/settypecd", "D");
  18. model.refresh();
  19. if(submit("TRMMB00601")){
  20. copyNodeSet(sETCPRMSPRCPSETLIST_TMP, sETCPRMSPRCPSETLIST);
  21. }
  22. }
  23. /**
  24. * @desc : 마우스 오른쪽 버튼 팝업창
  25. * @
  26. * @param :
  27. * @return :
  28. * @---------------------------------------------------
  29. */
  30. function fMouseRghtBtnPopup(){
  31. if(event.button == 3){
  32. if(trv_etcprmsprcpsetlist.isCell(event.target)){
  33. window.setPopupMenu(true, "/root/hidden/menu/menu", "label", "func", false); //팝업창 셋팅
  34. }else{
  35. window.setPopupMenu(false);
  36. }
  37. }
  38. }
  39. /**
  40. * @desc : 마우스 오른쪽 버튼 팝업창
  41. * @
  42. * @param :
  43. * @return :
  44. * @---------------------------------------------------
  45. */
  46. function fMouseRghtBtnPopupDetlCD(){
  47. if(event.button == 3){
  48. if(grd_etcprmsprcpdetl.isCell(event.target)){
  49. window.setPopupMenu(true, "/root/hidden/menu2/menu", "label", "func", false); //팝업창 셋팅
  50. }else{
  51. window.setPopupMenu(false);
  52. }
  53. }
  54. }
  55. /**
  56. * @desc : 새폴더 추가
  57. * @
  58. * @param :
  59. * @return :
  60. * @---------------------------------------------------
  61. */
  62. function fAddPrmsDiagSet(){
  63. var item = trv_etcprmsprcpsetlist.item(trv_etcprmsprcpsetlist.selectedIndex);
  64. var rowPos = item.index + 1;
  65. fSetPrmsDiagInfo(rowPos, "i");
  66. model.setValue(sETCPRMSPRCPSETLIST_HIDDEN + "/status", "i");
  67. model.refresh();
  68. //alert(setno + "," + supsetno + "," + setkindcd + "," + setclscd + "," + settrgtcd + "," + settypecd + "," + setnm);
  69. fShowWndIptBox();
  70. }
  71. /**
  72. * @desc : 폴더 삭제
  73. * @
  74. * @param :
  75. * @return :
  76. * @---------------------------------------------------
  77. */
  78. function fDelPrmsDiagSet(){
  79. var item = trv_etcprmsprcpsetlist.item(trv_etcprmsprcpsetlist.selectedIndex);
  80. var rowPos = item.index + 1;
  81. if(fSetPrmsDiagInfo(rowPos, "d")!= -1){
  82. fSavePrmsDiagSet();
  83. }
  84. //alert(setno + "," + supsetno + "," + setkindcd + "," + setclscd + "," + settrgtcd + "," + settypecd + "," + setnm);*/
  85. }
  86. /**
  87. * @desc : 폴더 수정
  88. * @
  89. * @param :
  90. * @return :
  91. * @---------------------------------------------------
  92. */
  93. function fUpdtPrmsDiagSet(){
  94. var item = trv_etcprmsprcpsetlist.item(trv_etcprmsprcpsetlist.selectedIndex);
  95. var rowPos = item.index + 1;
  96. if(fSetPrmsDiagInfo(rowPos, "u")!=-1){
  97. fShowWndIptBox();
  98. }
  99. }
  100. /**
  101. * @desc : 약속진단 SET저장
  102. * @
  103. * @param :
  104. * @return :
  105. * @---------------------------------------------------
  106. */
  107. function fSavePrmsDiagSet(){
  108. var setnm = model.getValue("/root/hidden/inputbox/setnm");
  109. model.setValue(sETCPRMSPRCPSETLIST_HIDDEN + "/setnm", setnm);
  110. model.refresh();
  111. model.copyNode("/root/send/savedata", sETCPRMSPRCPSETLIST_HIDDEN);
  112. if(submit("TXMMB00601")){
  113. copyNodeSet(sETCPRMSPRCPSETLIST_TMP, sETCPRMSPRCPSETLIST);
  114. }
  115. }
  116. /**
  117. * @desc : 약속진단관리 폴더명을 입력할 InputBox를 보여줌.
  118. * @
  119. * @param :
  120. * @return :
  121. * @---------------------------------------------------
  122. */
  123. function fShowWndIptBox(){
  124. group1.attribute("top") = event.clientY;
  125. group1.attribute("left") = event.clientX;
  126. group1.attribute("height") = 32;
  127. model.setFocus("ipt_setnm");
  128. model.refresh();
  129. }
  130. /**
  131. * @desc : 약속진단 SET정보 SETTING
  132. * @
  133. * @param :
  134. * @return :
  135. * @---------------------------------------------------
  136. */
  137. function fSetPrmsDiagInfo(rowpos, status){
  138. var setno = model.getValue(sETCPRMSPRCPSETLIST_TMP + "[" + rowpos + "]/setno");
  139. if(status == "u" && setno == 1){
  140. messageBox("선택한 폴더는 수정", "E001");
  141. return -1;
  142. }else if(status == "d" && setno == 1){
  143. messageBox("선택한 폴더는 삭제", "E001");
  144. return -1;
  145. }
  146. var levl = model.getValue(sETCPRMSPRCPSETLIST_TMP + "[" + rowpos + "]/levl");
  147. var supsetno = model.getValue(sETCPRMSPRCPSETLIST_TMP + "[" + rowpos + "]/supsetno");
  148. var setkindcd = model.getValue(sETCPRMSPRCPSETLIST_TMP + "[" + rowpos + "]/setkindcd");
  149. var setclscd = model.getValue(sETCPRMSPRCPSETLIST_TMP + "[" + rowpos + "]/setclscd");
  150. var settrgtcd = model.getValue(sETCPRMSPRCPSETLIST_TMP + "[" + rowpos + "]/settrgtcd");
  151. var settypecd = model.getValue(sETCPRMSPRCPSETLIST_TMP + "[" + rowpos + "]/settypecd");
  152. var setnm = model.getValue(sETCPRMSPRCPSETLIST_TMP + "[" + rowpos + "]/setnm");
  153. model.setValue(sETCPRMSPRCPSETLIST_HIDDEN + "/levl" , levl);
  154. model.setValue(sETCPRMSPRCPSETLIST_HIDDEN + "/setno" , setno);
  155. model.setValue(sETCPRMSPRCPSETLIST_HIDDEN + "/setkindcd", setkindcd);
  156. model.setValue(sETCPRMSPRCPSETLIST_HIDDEN + "/setclscd" , setclscd);
  157. model.setValue(sETCPRMSPRCPSETLIST_HIDDEN + "/settrgtcd", settrgtcd);
  158. model.setValue(sETCPRMSPRCPSETLIST_HIDDEN + "/settypecd", settypecd);
  159. model.setValue(sETCPRMSPRCPSETLIST_HIDDEN + "/status" , status);
  160. if(status == "i"){
  161. model.setValue(sETCPRMSPRCPSETLIST_HIDDEN + "/supsetno" , setno);
  162. }else{
  163. model.setValue(sETCPRMSPRCPSETLIST_HIDDEN + "/supsetno" , supsetno);
  164. }
  165. model.refresh();
  166. }
  167. /**
  168. * @desc : 약속진단SET Drag
  169. * @
  170. * @param :
  171. * @return :
  172. * @---------------------------------------------------
  173. */
  174. function fPrmsDiagSetDrag(){
  175. var item = trv_etcprmsprcpsetlist.item(trv_etcprmsprcpsetlist.selectedIndex);
  176. var rowpos = item.index + 1;
  177. fSetPrmsDiagInfo(rowpos, "u");
  178. var setnm = model.getValue(sETCPRMSPRCPSETLIST_TMP + "[" + rowpos + "]/setnm");
  179. model.setValue("/root/hidden/inputbox/setnm", setnm);
  180. model.refresh();
  181. fSavePrmsDiagSet();
  182. }
  183. /**
  184. * @desc : 약속진단SET Drop
  185. * @
  186. * @param :
  187. * @return :
  188. * @---------------------------------------------------
  189. */
  190. function fPrmsDiagSetDrop(){
  191. var rowpos = trv_etcprmsprcpsetlist.mouseRow + 1;
  192. var levl = model.getValue(sETCPRMSPRCPSETLIST_TMP + "[" + rowpos + "]/levl");
  193. var setno = model.getValue(sETCPRMSPRCPSETLIST_TMP + "[" + rowpos + "]/setno");
  194. var supsetno = model.getValue(sETCPRMSPRCPSETLIST_TMP + "[" + rowpos + "]/supsetno");
  195. var cmplevl = model.getValue(sETCPRMSPRCPSETLIST_HIDDEN + "/levl");
  196. var cmpsetno = model.getValue(sETCPRMSPRCPSETLIST_HIDDEN + "/setno");
  197. var cmpsupsetno = model.getValue(sETCPRMSPRCPSETLIST_HIDDEN + "/supsetno");
  198. if(setno == cmpsetno){
  199. messageBox("동일한 위치로 이동", "E001");
  200. return;
  201. }else if(setno == cmpsupsetno){
  202. messageBox("지정된 위치로 이동", "E001");
  203. return;
  204. }
  205. //이동하는 SET폴더의 depth가 도착하는 곳보다 낮은 레벨일 경우,
  206. //자신의 child node 아래로 이동하는 것을 방지함.
  207. if(cmplevl < levl){
  208. var rootlevl;
  209. var rootsetno;
  210. while(cmplevl != rootlevl){
  211. rootlevl = model.getValue(sETCPRMSPRCPSETLIST_TMP + "[" + rowpos + "]/levl");
  212. rootsetno = model.getValue(sETCPRMSPRCPSETLIST_TMP + "[" + rowpos + "]/setno");
  213. rowpos--;
  214. }
  215. if(rootsetno == cmpsetno){
  216. messageBox("지정된 위치로 이동", "E001");
  217. return;
  218. }
  219. }
  220. model.setValue(sETCPRMSPRCPSETLIST_HIDDEN + "/supsetno" , setno);
  221. model.refresh();
  222. fSavePrmsDiagSet();
  223. }
  224. /**
  225. * @desc : 약속진단SET에 진단추가
  226. * @
  227. * @param :
  228. * @return :
  229. * @---------------------------------------------------
  230. */
  231. function fAddPrmsDiagDetl(){
  232. var setno = model.getValue("/root/hidden/etcprmsprcpsetdetl/setno");
  233. var settypecd = model.getValue("/root/hidden/etcprmsprcpsetdetl/settypecd");
  234. if(setno.length < 1){
  235. messageBox("진단을 등록할 폴더를", "C002");
  236. return;
  237. }
  238. modal("SPMMB00600", "", "", "", "SPMMB00600");
  239. totRow = grd_etcprmsprcpdetl.rows - 1;
  240. var useyn = getParameter("useYN");
  241. if(useyn == "Y"){
  242. var iTotNode = getNodeSetCnt("/root/hidden/diaghistinfo/diaghist");
  243. for(var i = 1; i <= iTotNode ; i++){
  244. var diagcd = model.getValue(sDIAGHISTINFO + "[" + i + "]/diagcd");
  245. var diagnm = model.getValue(sDIAGHISTINFO + "[" + i + "]/icd10engnm");
  246. iChkRow = grd_etcprmsprcpdetl.findRow(diagcd, 1, 4, "true", "true");
  247. if(iChkRow > 0){
  248. messageBox("[" + diagnm + "]은 진단명은 이미", "E005");
  249. continue;
  250. }else{
  251. totRow++;
  252. grd_etcprmsprcpdetl.addRow(false);
  253. model.setValue(sETCPRMSPRCPSETDETLLIST + "[" + totRow + "]/detlsetcd", diagcd);
  254. model.setValue(sETCPRMSPRCPSETDETLLIST + "[" + totRow + "]/termengnm", diagnm);
  255. model.setValue(sETCPRMSPRCPSETDETLLIST + "[" + totRow + "]/setno", setno);
  256. model.setValue(sETCPRMSPRCPSETDETLLIST + "[" + totRow + "]/settypecd", settypecd);
  257. }
  258. }
  259. model.refresh();
  260. }
  261. }
  262. /**
  263. * @desc : 약속진단SET상세 조회
  264. * @
  265. * @param :
  266. * @return :
  267. * @---------------------------------------------------
  268. */
  269. function fReqPrmsDetlDiagSet(){
  270. var item = trv_etcprmsprcpsetlist.item(trv_etcprmsprcpsetlist.selectedIndex);
  271. var rowpos = item.index + 1;
  272. var setno = model.getValue(sETCPRMSPRCPSETLIST_TMP + "[" + rowpos + "]/setno");
  273. var settypecd = model.getValue(sETCPRMSPRCPSETLIST_TMP + "[" + rowpos + "]/settypecd");
  274. model.setValue("/root/hidden/etcprmsprcpsetdetl/setno", setno);
  275. model.setValue("/root/hidden/etcprmsprcpsetdetl/settypecd", settypecd);
  276. model.refresh();
  277. model.makeValue("/root/send/reqdata/setno", setno);
  278. model.makeValue("/root/send/reqdata/settypecd", settypecd);
  279. submit("TRMMB00602");
  280. }
  281. /**
  282. * @desc : 약속진단SET상세 복사
  283. * @
  284. * @param :
  285. * @return :
  286. * @---------------------------------------------------
  287. */
  288. function fCopyDiagCD(){
  289. totRow = grd_etcprmsprcpdetl.rows;
  290. for(var i = 1 ; i < totRow; i++){
  291. if(grd_etcprmsprcpdetl.isSelected(i)==true){
  292. addCopyNode("/root/init/today", "/root/main/etcprmsprcpsetdetlinfo/etcprmsprcpsetdetllist[" + i + "]");
  293. }
  294. }
  295. }
  296. /**
  297. * @desc : 약속진단SET상세 붙여넣기
  298. * @
  299. * @param :
  300. * @return :
  301. * @---------------------------------------------------
  302. */
  303. function fPasteDiagCD(){
  304. }