SPMRJ00800_의사임상권한등록조회.xrw 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.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. <init>
  10. <setflag/>
  11. </init>
  12. <hidden>
  13. <attach>
  14. <file/>
  15. <delyn/>
  16. </attach>
  17. </hidden>
  18. <send>
  19. <flag/>
  20. <searchitem/>
  21. <reqdata>
  22. <setflag/>
  23. <authno/>
  24. <clinicauth>
  25. <instcd/>
  26. <authno/>
  27. <orddrid/>
  28. <orddrnm/>
  29. <orddeptcd/>
  30. <orddeptnm/>
  31. <valifromdd/>
  32. <valitodd/>
  33. <appuserid/>
  34. <appdt/>
  35. <histstat/>
  36. </clinicauth>
  37. <attachlist>
  38. <attach>
  39. <attauthno/>
  40. <attfileseq/>
  41. <attfilenm/>
  42. <status/>
  43. <delyn/>
  44. <file/>
  45. </attach>
  46. </attachlist>
  47. <attach_bck>
  48. <delyn/>
  49. </attach_bck>
  50. <updlist>
  51. <attach>
  52. <attauthno/>
  53. <attfileseq/>
  54. <attfilenm/>
  55. <status/>
  56. <delyn/>
  57. </attach>
  58. </updlist>
  59. </reqdata>
  60. </send>
  61. <main>
  62. <attachlist>
  63. <attach>
  64. <attfilenm/>
  65. <attfileseq/>
  66. <authno/>
  67. <status/>
  68. <delyn/>
  69. </attach>
  70. </attachlist>
  71. <clinicauth>
  72. <instcd/>
  73. <authno/>
  74. <orddrid/>
  75. <orddrnm/>
  76. <orddeptcd/>
  77. <orddeptnm/>
  78. <valifromdd/>
  79. <valitodd/>
  80. <appuserid/>
  81. <appdt/>
  82. <histstat/>
  83. </clinicauth>
  84. <copyset/>
  85. </main>
  86. <temp>
  87. <count/>
  88. <setflag/>
  89. </temp>
  90. </root>
  91. </instance>
  92. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  93. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  94. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  95. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  96. <script type="javascript">
  97. <![CDATA[
  98. function fRowDelete( grdName, grdPath ){
  99. var iRow = grdName.row - grdName.fixedRows + 1;
  100. if(iRow < 1){
  101. return;
  102. }
  103. var status = grdName.rowStatus(iRow);
  104. //alert("grd status : " + status);
  105. if(status == 1){
  106. grdName.deleteRow(iRow, false);
  107. }else{
  108. grdName.rowStatus(iRow)= 4;
  109. }
  110. model.makeValue(grdPath, "D");
  111. if(grdName.row - grdName.fixedRows <= 0 ){
  112. //model.setValue("/root/main/hospinfcinfo/hospinfc/info/woundclssflag", "");
  113. //model.setValue("/root/main/hospinfcinfo/hospinfc/info/asaclssflag", "");
  114. //model.setValue("/root/main/hospinfcinfo/hospinfc/info/riskindxpnt", "");
  115. //model.setValue("/root/main/hospinfcinfo/hospinfc/info/generalanesthesiayn", "");
  116. //model.setValue("/root/main/hospinfcinfo/hospinfc/info/endoscopicopyn", "");
  117. //model.setValue("/root/main/hospinfcinfo/hospinfc/info/anstkind", "");
  118. }
  119. model.refresh();
  120. }
  121. function fGetUserInfo(userid,usernm,deptcd,deptnm) {
  122. // 검색결과 부서명과 부서코드 매핑설정
  123. model.setValue("/root/main/clinicauth/orddeptnm", deptnm);
  124. model.setValue("/root/main/clinicauth/orddeptcd", deptcd);
  125. model.setValue("/root/main/clinicauth/orddrnm", usernm);
  126. model.setValue("/root/main/clinicauth/orddrid", userid);
  127. if ( usernm == "" || userid == "" || deptnm == "" || deptcd == "" ) {
  128. messageBox("검색하신 사번에 해당하는 교직원이", "E014");
  129. model.setValue("/root/main/clinicauth/orddeptnm", "");
  130. model.setValue("/root/main/clinicauth/orddeptcd", "");
  131. model.setValue("/root/main/clinicauth/orddrnm", "");
  132. model.setValue("/root/main/clinicauth/orddrid", "");
  133. model.refresh();
  134. return;
  135. }
  136. model.refresh();
  137. }
  138. ]]>
  139. </script>
  140. <script type="javascript" ev:event="xforms-ready">
  141. <![CDATA[
  142. // fInit();
  143. // 부모창에서 수정을 위한 조회로 팝업창을 띄웠는지, 신규등록을 위해서 팝업창을 띄웠는지 구분값 확인
  144. model.removeNodeset("/root/main/attachlist");
  145. model.removeNodeset("/root/send/reqdata/attachlist/attach");
  146. var newyn = opener.model.getValue("/root/send/reqdata/newyn");
  147. var viewyn = opener.model.getValue("/root/send/reqdata/viewyn");
  148. var authno = opener.model.getValue("/root/send/reqdata/authno");
  149. var orddrid = opener.model.getValue("/root/send/reqdata/orddrid");
  150. if ( viewyn == "Y" ) {
  151. button1.text = "수정";
  152. ipt_empno.disabled = true;
  153. ipt_empnm.disabled = true;
  154. model.makeValue("/root/temp/setflag", "set");
  155. model.makeValue("/root/send/reqdata/authno", authno);
  156. model.makeValue("/root/send/reqdata/orddrid", orddrid);
  157. submit("TRMRJ00802");
  158. model.copyNode("/root/send/reqdata/attachlist", "/root/main/attachlist");
  159. model.refresh();
  160. }
  161. if ( newyn == "Y" ) {
  162. model.makeValue("/root/temp/setflag", "ins");
  163. button3.attribute("visibility") = "hidden";
  164. }
  165. model.refresh();
  166. ]]>
  167. </script>
  168. <!-- SUBMISSION 시작 -->
  169. <submission id="TRMRJ00802" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqdata" resultref="/root/main"/>
  170. <submission id="TXMRJ00801" mediatype="multipart/form-data" method="form-data-post" ref="/root/send/reqdata" resultref="/root/temp"/>
  171. <!--
  172. <submission id="TXMRJ00801" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqdata" resultref="/root/temp"/>
  173. -->
  174. <submission id="TRZSU10104" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/list"/>
  175. <!-- SUBMISSION 종료 -->
  176. </model>
  177. </xhtml:head>
  178. <xhtml:body pagewidth="604" pageheight="510" guideline="1,722;" style="margin-left:8; margin-right:8; ">
  179. <!-- 입력항목 1열 시작 -->
  180. <caption id="caption1" class="tit_2" style="left:5px; top:11px; width:175px; height:13px; ">의사임상권한 등록/수정</caption>
  181. <line id="line1" class="line_1" style="x1:5px; y1:29px; x2:580px; y2:30px; "/>
  182. <caption id="caption2" class="cell_1" style="left:5px; top:35px; width:80px; height:23px; text-align:center; vertical-align:middle; ">사번</caption>
  183. <input id="ipt_empno" ref="/root/main/clinicauth/orddrid" style="left:89px; top:37px; width:86px; height:19px; text-align:left; ">
  184. <script type="javascript" ev:event="onkeypress">
  185. <![CDATA[
  186. if(event.keyCode == "13") {
  187. var orddrid = ipt_empno.currentText;
  188. model.setValue("/root/main/clinicauth/orddeptnm", "");
  189. model.setValue("/root/main/clinicauth/orddeptcd", "");
  190. model.setValue("/root/main/clinicauth/orddrnm", "");
  191. model.setValue("/root/main/clinicauth/orddrid", "");
  192. model.refresh();
  193. setParameter("reqflag", "userid");
  194. setParameter("userid", orddrid);
  195. setParameter("autortnyn","Y");
  196. modal("SPMRF03200");
  197. }
  198. ]]>
  199. </script>
  200. </input>
  201. <caption id="caption3" class="cell_1" style="left:179px; top:35px; width:56px; height:23px; text-align:center; vertical-align:middle; ">성명</caption>
  202. <input id="ipt_empnm" ref="/root/main/clinicauth/orddrnm" style="left:240px; top:37px; width:90px; height:19px; text-align:left; ">
  203. <script type="javascript" ev:event="onkeypress">
  204. <![CDATA[
  205. if(event.keyCode == "13") {
  206. var orddrnm = ipt_empnm.currentText;
  207. model.setValue("/root/main/clinicauth/orddeptnm", "");
  208. model.setValue("/root/main/clinicauth/orddeptcd", "");
  209. model.setValue("/root/main/clinicauth/orddrnm", "");
  210. model.setValue("/root/main/clinicauth/orddrid", "");
  211. model.refresh();
  212. setParameter("reqflag", "usernm");
  213. setParameter("usernm", orddrnm);
  214. setParameter("autortnyn","Y");
  215. modal("SPMRF03200");
  216. }
  217. ]]>
  218. </script>
  219. </input>
  220. <caption id="caption4" class="cell_1" style="left:335px; top:35px; width:105px; height:23px; text-align:center; vertical-align:middle; ">부서명</caption>
  221. <button id="btn_addfile" class="btn2_letter4" style="left:445px; top:63px; width:64px; height:19px; ">
  222. <caption>파일추가</caption>
  223. <script type="javascript" ev:event="DOMActivate">
  224. <![CDATA[
  225. var maxBytes = 1572864;
  226. files = window.fileDialog("open", "|", true);
  227. //window.fileDialog("open","","","","","All Files (*.*)|*.*|JPEG Files(*.jpg)|*.jpg|GIF Files(*.gif)|*.gif|BMP Files(*.bmp)|*.bmp");//openImageFileDialog(1572864);
  228. filelist = files.split("|");
  229. for(var i = 0 ; i < filelist.length ; i++ ) {
  230. if(filelist[i] != "") {
  231. // 파일 용량 체크
  232. var fso = new ActiveXObject("Scripting.FileSystemObject");
  233. var f = fso.GetFile(filelist[i]);
  234. if (f.size > maxBytes) {
  235. messageBox( ( i+1 ) + "번째 파일 크기가 최대치("+(maxBytes/1024)+"K)를","E003");
  236. }
  237. else {
  238. fileextnt = filelist[i].split(".");
  239. // 파일 확장자 체크
  240. // 제일 마지막 "." 뒤의 문자가 확장자 이다.
  241. var strextnt = fileextnt[fileextnt.length-1];
  242. if ( strextnt.toUpperCase() != "JPG" && strextnt.toUpperCase() != "JPEG" &&
  243. strextnt.toUpperCase() != "BMP" ) { // 이미지 업로드 허용 유형 추가시 여기에 확장자명 추가하면 됨
  244. messageBox("허용되지 않는 확장자입니다. 이미지 파일의 유형이 JPEG, BMP인지", "I007");
  245. return;
  246. }
  247. grd_attach.addRow(false);
  248. grd_attach.valueMatrix(grd_attach.rows - 1, 1) = "신규";
  249. grd_attach.rowStatus(grd_attach.rows - 1) = 1;
  250. grd_attach.valueMatrix(grd_attach.rows - 1, grd_attach.colRef("attfilenm")) = filelist[i];
  251. grd_attach.valueMatrix(grd_attach.rows - 1, grd_attach.colRef("file")) = filelist[i];
  252. grd_attach.valueMatrix(grd_attach.rows - 1, grd_attach.colRef("status")) = "N";
  253. }
  254. }
  255. }
  256. model.refresh();
  257. ]]>
  258. </script>
  259. </button>
  260. <button id="btn_delfile" class="btn5_letter4" style="left:514px; top:63px; width:64px; height:19px; ">
  261. <caption>파일삭제</caption>
  262. <script type="javascript" ev:event="DOMActivate">
  263. <![CDATA[
  264. var iRow = grd_attach.row - grd_attach.fixedRows + 1;
  265. fRowDelete(grd_attach, "/root/send/reqdata/attachlist/attach[" + iRow + "]/status");
  266. ]]>
  267. </script>
  268. </button>
  269. <upload id="upload1" nodeset="/root/send/reqdata/attachlist/attach/file" style="left:325px; top:10px; width:95px; height:20px; "/>
  270. <button id="button1" class="btn1_letter2" style="left:464px; top:5px; width:56px; height:22px; ">
  271. <caption>등록</caption>
  272. <script type="javascript" ev:event="DOMActivate">
  273. <![CDATA[
  274. // 사번, 성명, 부서코드, 유효기간 체크(권한 첨부파일 여부 체크는 현업의사 문의 후 추가 예정)
  275. var orddrid = model.getValue("/root/main/clinicauth/orddrid");
  276. if ( orddrid == null || orddrid == "" ) {
  277. messageBox("임상권한 진료의를 검색하여", "C002");
  278. return;
  279. }
  280. var orddeptcd = model.getValue("/root/main/clinicauth/orddeptcd");
  281. if ( orddeptcd == null || orddeptcd == "" ) {
  282. messageBox("임상권한 진료의의 소속 진료과 코드가 존재하지", "I011");
  283. return;
  284. }
  285. var valifromdd = model.getValue("/root/main/clinicauth/valifromdd");
  286. if ( valifromdd == null || valifromdd == "" ) {
  287. messageBox("권한 유효기간 시작일자는", "I003");
  288. return;
  289. }
  290. var valitodd = model.getValue("/root/main/clinicauth/valitodd");
  291. if ( valitodd == null || valitodd == "" ) {
  292. messageBox("권한 유효기간 종료일자는", "I003");
  293. return;
  294. }
  295. // 첨부파일 리스트 copyset 노드와 변동유무 체크 필요 (변동될수 있는 항목은 정상건이 삭제로 상태 변경되는 것 뿐이다)
  296. model.copyNode("/root/send/reqdata/clinicauth", "/root/main/clinicauth");
  297. model.makeValue("/root/send/reqdata/setflag", model.getValue("/root/temp/setflag"));
  298. // 수정(삭제포함)된 첨부 파일만 따로 인스턴스에 저장( 신규 파일 등록이 있을 경우, 동시에 전송하지 못하기 때문임)
  299. model.removeNode("/root/send/reqdata/updlist");
  300. for ( var i = 1 ; i < grd_attach.rows ; i++ ) {
  301. var status = grd_attach.valueMatrix(i, grd_attach.colRef("status")) ;
  302. if ( status != "" && status != "N" ) { // 수정되고 신규건이 아닌 경우에 한함.
  303. grd_upd_attach.addRow(false);
  304. grd_upd_attach.valueMatrix(grd_upd_attach.rows - 1, grd_upd_attach.colRef("attauthno")) = grd_attach.valueMatrix(i, grd_attach.colRef("attauthno"));
  305. grd_upd_attach.valueMatrix(grd_upd_attach.rows - 1, grd_upd_attach.colRef("attfileseq")) = grd_attach.valueMatrix(i, grd_attach.colRef("attfileseq"));
  306. grd_upd_attach.valueMatrix(grd_upd_attach.rows - 1, grd_upd_attach.colRef("attfilenm")) = grd_attach.valueMatrix(i, grd_attach.colRef("attfilenm"));
  307. grd_upd_attach.valueMatrix(grd_upd_attach.rows - 1, grd_upd_attach.colRef("status")) = grd_attach.valueMatrix(i, grd_attach.colRef("status"));
  308. grd_upd_attach.valueMatrix(grd_upd_attach.rows - 1, grd_upd_attach.colRef("delyn")) = grd_attach.valueMatrix(i, grd_attach.colRef("delyn"));
  309. }
  310. }
  311. // 첨부파일 신규건이 있는 경우, 신규건만 업로드시킨다.
  312. // 만약 기존 존재 파일을 삭제하고, 신규추가를 동시에 한 경우, 신규추가만 반영 된다.
  313. var newExistYn = "N";
  314. for ( var i = 1 ; i < grd_attach.rows ; i++ ) {
  315. var status = grd_attach.valueMatrix(i, grd_attach.colRef("status")) ;
  316. if ( status == "N" ) {
  317. newExistYn = "Y";
  318. }
  319. }
  320. if ( newExistYn == "Y" ) {
  321. for ( var i = grd_attach.rows ; i > 0 ; i-- ) {
  322. var status = grd_attach.valueMatrix(i, grd_attach.colRef("status")) ;
  323. if ( status != "N" ) {
  324. grd_attach.deleteRow(i, false);
  325. model.refresh();
  326. }
  327. }
  328. }
  329. submit("TXMRJ00801");
  330. // 부모창 검색 함수 실행(부모인스턴스의 authno 무효처리)
  331. opener.model.makeValue("/root/send/reqdata/authno", "");
  332. opener.model.makeValue("/root/send/reqdata/fileseq", "");
  333. opener.javascript.fClinicAuthSearch();
  334. // 윈도우 창 닫기
  335. window.close();
  336. ]]>
  337. </script>
  338. </button>
  339. <button id="button2" class="btn1_letter2" style="left:522px; top:5px; width:56px; height:22px; ">
  340. <caption>취소</caption>
  341. <script type="javascript" ev:event="DOMActivate">
  342. <![CDATA[
  343. window.close();
  344. ]]>
  345. </script>
  346. </button>
  347. <!-- 입력항목 1열 종료 -->
  348. <!-- 입력항목 2열 시작 -->
  349. <caption id="caption5" class="cell_1" style="left:5px; top:61px; width:80px; height:23px; text-align:center; vertical-align:middle; ">유효기간</caption>
  350. <input id="ipt_reqfromstnddd" ref="/root/main/clinicauth/valifromdd" inputtype="date" format="yyyy-mm-dd" style="left:88px; top:63px; width:90px; height:19px; "/>
  351. <caption id="caption11" class="search_n_b" style="left:181px; top:65px; width:12px; height:17px; font-weight:bolder; ">~</caption>
  352. <input id="ipt_reqtostnddd" ref="/root/main/clinicauth/valitodd" inputtype="date" format="yyyy-mm-dd" style="left:194px; top:63px; width:90px; height:19px; "/>
  353. <caption id="caption6" class="cell_1" style="left:335px; top:61px; width:105px; height:23px; text-align:center; vertical-align:middle; ">임상권한 업로드</caption>
  354. <!-- 입력항목 2열 종료 -->
  355. <!-- 임상권한 첨부 파일 리스트 시작 -->
  356. <datagrid id="grd_attach" nodeset="/root/send/reqdata/attachlist/attach" class="datagrid2" caption="삭제유무^임상권한 파일명^파일정보^파일순번^승인번호^상태" colwidth="54, 500, 10, 10, 10, 10" ellipsis="true" mergecellsfixedrows="bycolrec" rowheader="update" style="left:5px; top:88px; width:576px; height:392px; ">
  357. <col ref="delyn" style="text-align:center; "/>
  358. <col ref="attfilenm"/>
  359. <col ref="file" visibility="hidden"/>
  360. <col ref="attfileseq" visibility="hidden"/>
  361. <col ref="attauthno" visibility="hidden"/>
  362. <col ref="status" visibility="hidden"/>
  363. </datagrid>
  364. <!-- 임상권한 첨부 파일 리스트 종료 -->
  365. <!-- 입력폼 테두리 처리 시작 -->
  366. <line id="line2" style="x1:5px; y1:59px; x2:581px; y2:59px; border-color:#c0c0c0; "/>
  367. <line id="line3" style="x1:5px; y1:85px; x2:581px; y2:85px; border-color:#c0c0c0; "/>
  368. <!-- 입력폼 테두리 처리 종료 -->
  369. <!-- 화면하단 창닫기 버튼 시작 -->
  370. <button id="btn_close" class="btn4_letter2" visibility="visible" style="left:519px; top:485px; width:56px; height:22px; ">
  371. <caption>닫기</caption>
  372. <script type="javascript" ev:event="DOMActivate">
  373. <![CDATA[
  374. window.close();
  375. ]]>
  376. </script>
  377. </button>
  378. <!-- 화면하당 창닫기 버튼 종료 -->
  379. <button id="button3" class="btn1_letter2" style="left:406px; top:5px; width:56px; height:22px; ">
  380. <caption>삭제</caption>
  381. <script type="javascript" ev:event="DOMActivate">
  382. <![CDATA[
  383. //fSave();
  384. var msgRtn = messageBox("선택하신 임상권한 건을", "Q001");
  385. if ( msgRtn != "6" ) return; // 삭제승인 버튼을 클릭하지않으면 중단한다.
  386. model.copyNode("/root/send/reqdata", "/root/main");
  387. model.makeValue("/root/send/reqdata/setflag", "del");
  388. submit("TXMRJ00801");
  389. // 부모창 검색 함수 실행
  390. opener.model.makeValue("/root/send/reqdata/authno", "");
  391. opener.javascript.submit("TRMRJ00801");
  392. // 윈도우 창 닫기
  393. window.close();
  394. ]]>
  395. </script>
  396. </button>
  397. <input id="input1" ref="/root/main/clinicauth/orddeptnm" disabled="true" style="left:445px; top:37px; width:130px; height:19px; text-align:left; "/>
  398. <datagrid id="grd_upd_attach" nodeset="/root/send/reqdata/updlist/attach" class="datagrid2" visibility="hidden" caption="삭제유무^임상권한 파일경로^파일순번^승인번호^상태" colsep="^" colwidth="54, 125, 10, 10, 10" ellipsis="true" mergecellsfixedrows="bycolrec" rowsep="|" style="left:5px; top:415px; width:230px; height:60px; ">
  399. <col ref="delyn" visibility="hidden"/>
  400. <col ref="attfilenm" visibility="hidden"/>
  401. <col ref="attfileseq"/>
  402. <col ref="attauthno" style="text-align:center; "/>
  403. <col ref="status" visibility="hidden"/>
  404. </datagrid>
  405. </xhtml:body>
  406. </xhtml:html>