SMPIB02100_심사자정보관리.xrw 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
  3. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
  4. <xhtml:head>
  5. <xhtml:title>심사자정보 관리</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <send>
  10. <data1>
  11. <userid/>
  12. <usernm/>
  13. <posdeptnm/>
  14. <tel/>
  15. <mobiletel/>
  16. <memo/>
  17. </data1>
  18. <list1/>
  19. </send>
  20. <main>
  21. <list1>
  22. <judg>
  23. <userid/>
  24. <usernm/>
  25. <posdeptnm/>
  26. <tel/>
  27. <mobiletel/>
  28. <memo/>
  29. </judg>
  30. </list1>
  31. <list2>
  32. <user/>
  33. </list2>
  34. </main>
  35. <hidden>
  36. <appflag/>
  37. <approw/>
  38. </hidden>
  39. </root>
  40. </instance>
  41. <script type="javascript">
  42. <![CDATA[
  43. // 초기화
  44. function fInitialize()
  45. {
  46. // 심사자정보 초기화
  47. model.resetInstanceNode("/root/send/data1");
  48. // 그리드 초기화
  49. model.removenode("/root/main/list1");
  50. model.makeNode("/root/main/list1");
  51. // 입력수정상태 초기화
  52. model.setValue("/root/hidden/appflag", "I");
  53. model.setValue("/root/hidden/approw", 0);
  54. // 사용자ID 입력상태 초기화
  55. ipt_userid.disabled = false;
  56. // 유저리스트 초기화
  57. grd_userlist.visible = false;
  58. model.refresh();
  59. }
  60. // 심사자 정보 입력
  61. function fInsertJudg() {
  62. // 데이터 검사(사용자ID)
  63. var userid = model.getValue("/root/send/data1/userid");
  64. var usernm = model.getValue("/root/send/data1/usernm");
  65. var posdeptnm = model.getValue("/root/send/data1/posdeptnm");
  66. var tel = model.getValue("/root/send/data1/tel");
  67. var mobiletel = model.getValue("/root/send/data1/mobiletel");
  68. var memo = model.getValue("/root/send/data1/memo");
  69. if (userid == "") {
  70. messageBox("사용자ID를","C001");
  71. return false;
  72. }
  73. var appflag = model.getValue("/root/hidden/appflag");
  74. var approw = model.getValue("/root/hidden/approw");
  75. // 1. 신규 입력
  76. if (appflag == "I") {
  77. // 사용자ID 검증(올바른 사용자ID 인지 체크, 중복된 ID가 아닌지 체크)
  78. if (fGetJudgInfo() && fCheckDuplicate()) {
  79. var name = model.getValue("/root/send/data1/usernm");
  80. var dept = model.getValue("/root/send/data1/posdeptnm");
  81. // 그리드에 데이터 넣기
  82. grd_judglist.AddRow();
  83. var add_row = grd_judglist.row;
  84. model.setValue("/root/main/list1/judg[" + add_row + "]/userid", userid);
  85. model.setValue("/root/main/list1/judg[" + add_row + "]/usernm", name);
  86. model.setValue("/root/main/list1/judg[" + add_row + "]/posdeptnm", dept);
  87. model.setValue("/root/main/list1/judg[" + add_row + "]/tel", tel);
  88. model.setValue("/root/main/list1/judg[" + add_row + "]/mobiletel", mobiletel);
  89. model.setValue("/root/main/list1/judg[" + add_row + "]/memo", memo);
  90. // 그리드 정렬
  91. grd_judglist.select(grd_judglist.row, grd_judglist.colRef("userid")) = true;
  92. }
  93. // 심사자정보 초기화
  94. model.resetInstanceNode("/root/send/data1");
  95. // 2. 수정
  96. } else if (appflag == "U") {
  97. // 수정한 값 세팅
  98. grd_judglist.valueMatrix(approw, grd_judglist.colRef("userid")) = userid;
  99. grd_judglist.valueMatrix(approw, grd_judglist.colRef("usernm")) = usernm;
  100. grd_judglist.valueMatrix(approw, grd_judglist.colRef("posdeptnm")) = posdeptnm;
  101. grd_judglist.valueMatrix(approw, grd_judglist.colRef("tel")) = tel;
  102. grd_judglist.valueMatrix(approw, grd_judglist.colRef("mobiletel")) = mobiletel;
  103. grd_judglist.valueMatrix(approw, grd_judglist.colRef("memo")) = memo;
  104. // 그리드 상태 변경
  105. grd_judglist.rowstatus(approw) = "2";
  106. // 입력 수정 상태 초기화
  107. model.setValue("/root/hidden/appflag", "I");
  108. model.setValue("/root/hidden/approw", 0);
  109. // 심사자정보 초기화
  110. model.resetInstanceNode("/root/send/data1");
  111. ipt_userid.disabled = false;
  112. }
  113. model.refresh();
  114. }
  115. // 심사자 삭제
  116. function fDeleteJudg() {
  117. // 멀티라인 삭제
  118. var rows = grd_judglist.selectedRows;
  119. for (var i = 0; i < rows; i++) {
  120. var sel = grd_judglist.selectedRow(i);
  121. grd_judglist.rowstatus(sel) = 4;
  122. }
  123. }
  124. // 사용자ID를 입력하기 전에 올바른 사용자ID인지 검사한다.
  125. function fGetJudgInfo() {
  126. var userid = model.getValue("/root/send/data1/userid");
  127. var id = model.getValue("/root/main/list2/user[userid="+userid+"]/userid");
  128. if (userid == id) {
  129. model.setValue("/root/send/data1/usernm", model.getValue("/root/main/list2/user[userid="+userid+"]/usernm"));
  130. model.setValue("/root/send/data1/posdeptnm", model.getValue("/root/main/list2/user[userid="+userid+"]/posdeptnm"));
  131. } else {
  132. // 올바르지 않은 사용자ID 입니다.
  133. messageBox("올바르지 않은 사용자ID", "E008");
  134. model.resetInstanceNode("/root/hidden/data1/judginfo");
  135. return false;
  136. }
  137. model.refresh();
  138. return true;
  139. }
  140. // 사용자명을 입력후 엔터를 치면 조회 리스트가 떠야 한다.
  141. function fGetJudgInfo2() {
  142. var userid = model.getValue("/root/send/data1/userid");
  143. var id = model.getValue("/root/main/list2/user[userid="+userid+"]/userid");
  144. // 심사자정보 초기화
  145. //model.resetInstanceNode("/root/send/data1");
  146. if (userid == id) {
  147. model.setValue("/root/send/data1/usernm", model.getValue("/root/main/list2/user[userid="+userid+"]/usernm"));
  148. model.setValue("/root/send/data1/posdeptnm", model.getValue("/root/main/list2/user[userid="+userid+"]/posdeptnm"));
  149. } else {
  150. // 사용자 조회 그리드 띄우기
  151. for (var i = 1; i < grd_userlist.rows; i++) {
  152. var usernm = model.getValue("/root/main/list2/user[" + i + "]/usernm");
  153. if (userid != usernm) {
  154. grd_userlist.rowHidden(i) = true;
  155. } else {
  156. grd_userlist.rowHidden(i) = false;
  157. }
  158. }
  159. grd_userlist.visible = true;
  160. }
  161. model.refresh();
  162. }
  163. // 입력전에 기등록된 심사자와 중복되는지 체크한다.
  164. function fCheckDuplicate() {
  165. var newuserid = model.getValue("/root/send/data1/userid");
  166. // 1. 그리드 내에서 검사(그리드는 DB에 전체 심사자 리스트를 갖고 있으므로 여기서만 중복검사를 하면 된다)
  167. var row = grd_judglist.rows;
  168. for(i = 1; i < row; i++) {
  169. // 삭제된 row는 중복대상에서 제외
  170. if (grd_judglist.rowstatus(i) != "4") {
  171. var olduserid = model.getValue("/root/main/list1/judg["+i+"]/userid");
  172. if (newuserid == olduserid) {
  173. messageBox("이미 등록된 심사자", "E008");
  174. return false;
  175. }
  176. }
  177. }
  178. // 2. DB에서 검사
  179. // submit("02003");
  180. // if (newpid == model.getValue("/root/hidden/data2/pid")) {
  181. // messageBox("이미 등록된 간질환 환자정보", "E008");
  182. // return false;
  183. // }
  184. return true;
  185. }
  186. // 저장
  187. function fSaveJudgList() {
  188. var rtn = window.alert("저장하시겠습니까?", "선택", "4");
  189. if (rtn != 6) return;
  190. model.removeNodeset("/root/send/list1");
  191. var updtdata = getGridUpdateData(grd_judglist); // (tfHelper.js) 그리드 업데이트 데이터 반환, 업데이트 정보가 없을경우 "" 반환
  192. if (updtdata) {
  193. model.makeValue("/root/send/list1/judg", updtdata);
  194. if(submit("TXPIB02101")) {
  195. // 심사자정보 초기화
  196. model.resetInstanceNode("/root/send/data1");
  197. ipt_userid.disabled = false;
  198. // 심사자 리스트 조회
  199. submit("TRPIB02101");
  200. } else {
  201. messageBox("예기치 않은 오류", "E008");
  202. }
  203. }
  204. }
  205. ]]>
  206. </script>
  207. <script type="javascript" ev:event="xforms-ready">
  208. <![CDATA[
  209. fInitialize();
  210. // 심사자 리스트 조회
  211. submit("TRPIB02101");
  212. ]]>
  213. </script>
  214. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  215. <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
  216. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  217. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  218. <submission id="TRPIB02101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main"/>
  219. <submission id="TXPIB02101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/list1"/>
  220. <submission id="TXPIB02103" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/list1"/>
  221. </model>
  222. </xhtml:head>
  223. <xhtml:body pagewidth="720" pageheight="530" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  224. <group id="group1" style="left:0px; top:0px; width:700px; height:13px; ">
  225. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:194px; height:14px; ">심사자정보 관리</caption>
  226. </group>
  227. <group id="group3" scroll="auto" style="left:0px; top:13px; width:700px; height:500px; ">
  228. <group id="group5" scroll="auto" style="left:0px; top:0px; width:700px; height:500 px; ">
  229. <line id="line17" class="line_2" style="x1:0px; y1:54px; x2:675px; y2:54px; "/>
  230. <caption id="caption22" class="tit_2" style="left:5px; top:10px; width:165px; height:13px; ">심사자 정보</caption>
  231. <line id="line19" class="line_1" style="x1:0px; y1:25px; x2:675px; y2:25px; "/>
  232. <caption id="caption23" class="cell_1" style="left:0px; top:30px; width:85px; height:23px; text-align:center; ">사용자ID</caption>
  233. <caption id="caption34" class="cell_1" style="left:240px; top:30px; width:85px; height:23px; text-align:center; ">이름</caption>
  234. <caption id="caption48" class="tit_2" style="left:5px; top:121px; width:188px; height:13px; ">심사자 리스트</caption>
  235. <line id="line20" class="line_1" style="x1:0px; y1:136px; x2:675px; y2:136px; "/>
  236. <datagrid id="grd_judglist" nodeset="/root/main/list1/judg" caption="사용자ID^이름^소속부서^전화번호^휴대폰번호^메모^특례명칭" colsep="^" colwidth="70, 65, 115, 87, 89, 200" dataheight="23" ellipsis="true" extendlastcol="scroll" mergecellsfixedrows="bycolrec" rowheader="update" rowsep="|" tooltip="true" navindex="7" style="left:0px; top:141px; width:675px; height:299px; ">
  237. <col ref="userid" style="text-align:center; "/>
  238. <col ref="usernm" style="text-align:center; "/>
  239. <col ref="posdeptnm"/>
  240. <col ref="tel" style="text-align:center; "/>
  241. <col ref="mobiletel" style="text-align:center; "/>
  242. <col ref="memo"/>
  243. <script type="javascript" ev:event="ondblclick">
  244. <![CDATA[
  245. // 수정하기 위해 그리드의 한 row 를 클릭한다.
  246. var cur_row = grd_judglist.row;
  247. var status = grd_judglist.rowstatus(cur_row);
  248. if (status == "0" || status == "2") {
  249. model.setValue("/root/send/data1/userid", grd_judglist.valueMatrix(cur_row, grd_judglist.colRef("userid")));
  250. model.setValue("/root/send/data1/usernm", grd_judglist.valueMatrix(cur_row, grd_judglist.colRef("usernm")));
  251. model.setValue("/root/send/data1/posdeptnm", grd_judglist.valueMatrix(cur_row, grd_judglist.colRef("posdeptnm")));
  252. model.setValue("/root/send/data1/tel", grd_judglist.valueMatrix(cur_row, grd_judglist.colRef("tel")));
  253. model.setValue("/root/send/data1/mobiletel", grd_judglist.valueMatrix(cur_row, grd_judglist.colRef("mobiletel")));
  254. model.setValue("/root/send/data1/memo", grd_judglist.valueMatrix(cur_row, grd_judglist.colRef("memo")));
  255. model.setValue("/root/hidden/appflag", "U");
  256. model.setValue("/root/hidden/approw", cur_row);
  257. // 심사자ID는 변경 불가
  258. ipt_userid.disabled = true;
  259. model.refresh();
  260. }
  261. ]]>
  262. </script>
  263. </datagrid>
  264. <line id="line24" class="line_3" style="x1:2px; y1:102px; x2:677px; y2:102px; "/>
  265. <button id="btn_save" class="btn4_letter2" navindex="11" style="left:485px; top:445px; width:56px; height:22px; ">
  266. <caption>저장</caption>
  267. <script type="javascript" ev:event="DOMActivate">
  268. <![CDATA[
  269. fSaveJudgList();
  270. model.resetInstanceNode("/root/send/data1");
  271. model.refresh();
  272. ]]>
  273. </script>
  274. </button>
  275. <button id="btn_init" class="btn4_letter3" navindex="12" style="left:546px; top:445px; width:68px; height:22px; ">
  276. <caption>초기화</caption>
  277. <script type="javascript" ev:event="DOMActivate">
  278. <![CDATA[
  279. fInitialize();
  280. // 심사자 리스트 조회
  281. submit("TRPIB02101");
  282. ]]>
  283. </script>
  284. </button>
  285. <button id="btn_srcpid2" class="icon_search" navindex="9" style="left:219px; top:32px; width:16px; height:16px; ">
  286. <caption/>
  287. <script type="javascript" ev:event="DOMActivate">
  288. <![CDATA[
  289. // 사용자 조회 화면 띄우기
  290. modal("SPZSU10100", 1,150, 150, "SPZSU10100", "", "", "", "");
  291. // 사용자 조회팝업으로부터 넘어온 userid 검증
  292. // 사용자 조회팝업으로부터 userid, usernm, posdeptnm 설정하기
  293. // var srch_pid = model.getValue("/root/main/patinfo/patinfolist/pid");
  294. // var patnm = model.getValue("/root/main/patinfo/patinfolist/hngnm");
  295. // var sex = model.getValue("/root/main/patinfo/patinfolist/sex");
  296. // var age = model.getValue("/root/main/patinfo/patinfolist/age");
  297. // if (srch_pid) { // SPPMC02500_환자조회 화면에서 조회한 경우임
  298. // model.removeNodeset("/root/main/patinfo/patinfolist");
  299. // model.makeNode("/root/main/patinfo/patinfolist");
  300. // model.setValue("/root/main/data1/pid", srch_pid);
  301. // model.setValue("/root/main/data1/patnm", patnm);
  302. // model.setValue("/root/main/data1/sex", sex);
  303. // model.setValue("/root/main/data1/age", age);
  304. //
  305. // model.refresh();
  306. // }
  307. ]]>
  308. </script>
  309. </button>
  310. <button id="btn_delete" class="btn2_letter2" navindex="8" visibility="visible" style="left:632px; top:114px; width:42px; height:19px; ">
  311. <caption>삭제</caption>
  312. <script type="javascript" ev:event="DOMActivate">
  313. <![CDATA[
  314. fDeleteJudg();
  315. ]]>
  316. </script>
  317. </button>
  318. <input id="ipt_userid" ref="/root/send/data1/userid" class="input_essential" navindex="1" maxlength="10" style="left:87px; top:31px; width:126px; height:19px; ">
  319. <script type="javascript" ev:event="onkeypress">
  320. <![CDATA[
  321. if (event.keyCode == "13") {
  322. setInputNodeCurText(); // (tfHelper.js) 현재 인풋값 노드 반영
  323. fGetJudgInfo2();
  324. }
  325. ]]>
  326. </script>
  327. </input>
  328. <caption id="caption1" class="cell_1" style="left:458px; top:30px; width:85px; height:23px; text-align:center; ">소속부서</caption>
  329. <input id="ipt_deptnm" ref="/root/send/data1/posdeptnm" class="input_default" navindex="2" style="left:545px; top:31px; width:126px; height:19px; ">
  330. <script type="javascript" ev:event="onkeypress">
  331. <![CDATA[
  332. // if (event.keyCode == "13") {
  333. // setInputNodeCurText(); // (tfHelper.js) 현재 인풋값 노드 반영
  334. // fInsertJudg();
  335. // }
  336. ]]>
  337. </script>
  338. </input>
  339. <input id="ipt_phone1" ref="/root/send/data1/tel" class="input_default" navindex="3" imemode="disabled" maxlength="11" format="####" style="left:87px; top:57px; width:149px; height:19px; ">
  340. <script type="javascript" ev:event="onkeypress">
  341. <![CDATA[
  342. // if (event.keyCode == "13") {
  343. // setInputNodeCurText(); // (tfHelper.js) 현재 인풋값 노드 반영
  344. // fInsertJudg();
  345. // }
  346. ]]>
  347. </script>
  348. </input>
  349. <caption id="caption2" class="cell_1" style="left:0px; top:54px; width:85px; height:23px; text-align:center; ">전화번호</caption>
  350. <line id="line1" class="line_2" style="x1:2px; y1:77px; x2:300px; y2:77px; "/>
  351. <caption id="caption3" class="cell_1" style="left:240px; top:55px; width:85px; height:47px; text-align:center; ">메모</caption>
  352. <caption id="caption4" class="cell_1" style="left:0px; top:79px; width:85px; height:23px; text-align:center; ">휴대폰번호</caption>
  353. <input id="ipt_phone2" ref="/root/send/data1/mobiletel" class="input_default" navindex="4" maxlength="11" format="####" style="left:87px; top:80px; width:149px; height:19px; ">
  354. <script type="javascript" ev:event="onkeypress">
  355. <![CDATA[
  356. // if (event.keyCode == "13") {
  357. // setInputNodeCurText(); // (tfHelper.js) 현재 인풋값 노드 반영
  358. // fInsertJudg();
  359. // }
  360. ]]>
  361. </script>
  362. </input>
  363. <textarea id="txa_memo" ref="/root/send/data1/memo" class="txa_default" navindex="5" style="left:327px; top:57px; width:344px; height:41px; "/>
  364. <button id="btn_insert" class="btn2_letter2" navindex="6" visibility="visible" style="left:632px; top:4px; width:42px; height:19px; ">
  365. <caption>입력</caption>
  366. <script type="javascript" ev:event="DOMActivate">
  367. <![CDATA[
  368. fInsertJudg();
  369. model.resetInstanceNode("/root/send/data1");
  370. model.refresh();
  371. ]]>
  372. </script>
  373. </button>
  374. <output id="output1" ref="/root/send/data1/usernm" class="output_fix" style="left:327px; top:31px; width:128px; height:19px; "/>
  375. <button id="btn_close" class="btn4_letter2" navindex="11" style="left:619px; top:445px; width:56px; height:22px; ">
  376. <caption>닫기</caption>
  377. <script type="javascript" ev:event="DOMActivate">
  378. <![CDATA[
  379. window.close();
  380. ]]>
  381. </script>
  382. </button>
  383. <datagrid id="grd_userlist" nodeset="/root/main/list2/user" caption="사용자ID^이름^소속부서^특례명칭" colsep="^" colwidth="70, 65, 115" dataheight="23" ellipsis="true" extendlastcol="scroll" mergecellsfixedrows="bycolrec" rowheader="update" rowsep="|" tooltip="true" navindex="7" style="left:180px; top:40px; width:300px; height:95px; ">
  384. <col ref="userid" style="text-align:center; "/>
  385. <col ref="usernm" style="text-align:center; "/>
  386. <col ref="posdeptnm"/>
  387. <script type="javascript" ev:event="ondblclick">
  388. <![CDATA[
  389. // 선택된 사용자를 심사자ID, 이름, 부서명에 넣는다.
  390. var cur_row = grd_userlist.row;
  391. if (cur_row > 0 && grd_userlist.isCell(event.target)) {
  392. model.setValue("/root/send/data1/userid", grd_userlist.valueMatrix(cur_row, grd_judglist.colRef("userid")));
  393. model.setValue("/root/send/data1/usernm", grd_userlist.valueMatrix(cur_row, grd_judglist.colRef("usernm")));
  394. model.setValue("/root/send/data1/posdeptnm", grd_userlist.valueMatrix(cur_row, grd_judglist.colRef("posdeptnm")));
  395. model.refresh();
  396. }
  397. grd_userlist.visible = false;
  398. ]]>
  399. </script>
  400. </datagrid>
  401. <button id="button1" class="btn4_letter2" navindex="11" style="left:300px; top:450px; width:56px; height:22px; ">
  402. <caption>배치</caption>
  403. <script type="javascript" ev:event="DOMActivate">
  404. <![CDATA[
  405. submit("TXPIB02103");
  406. ]]>
  407. </script>
  408. </button>
  409. </group>
  410. </group>
  411. </xhtml:body>
  412. </xhtml:html>