SMAEA00700_예약 변동 관리.xrw 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. <?xml version="1.0" encoding="EUC-KR"?>
  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. <main>
  10. <rsrvupdtinfo>
  11. <rsrvupdt>
  12. <rsrvupdtfromdd/>
  13. <rsrvupdtfromtm/>
  14. <rsrvupdttodd/>
  15. <rsrvupdttotm/>
  16. <updtresndesc/>
  17. <updtresncnts/>
  18. <excuroomcd/>
  19. <suppdeptcd/>
  20. <ioflag/>
  21. </rsrvupdt>
  22. </rsrvupdtinfo>
  23. </main>
  24. <init>
  25. <cmb_info>
  26. <initexecroom>
  27. <excuroomcdid/>
  28. <excuroomcdnm/>
  29. </initexecroom>
  30. <suppdept>
  31. <suppdeptcd/>
  32. <depthngnm/>
  33. </suppdept>
  34. </cmb_info>
  35. </init>
  36. <send>
  37. <baseinfo>
  38. <excuroomcd/>
  39. <suppdeptcd/>
  40. <sdate/>
  41. <tdate/>
  42. </baseinfo>
  43. <execdata>
  44. <rsrvupdt/>
  45. </execdata>
  46. <globalinstance>
  47. <instance1/>
  48. </globalinstance>
  49. </send>
  50. <hidden>
  51. <count/>
  52. </hidden>
  53. <init2>
  54. <cmb_info2>
  55. <initexcuroomcd>
  56. <excuroomcdnm/>
  57. <excuroomcdid/>
  58. </initexcuroomcd>
  59. </cmb_info2>
  60. </init2>
  61. <send1>
  62. <suppdeptcd/>
  63. <excuroomcd/>
  64. <gb/>
  65. <instance1/>
  66. </send1>
  67. </root>
  68. </instance>
  69. <script type="javascript">
  70. <![CDATA[
  71. function readfunc(){
  72. if (model.getValue("/root/send/baseinfo/sdate") == ""){
  73. messageBox("조회 시작일자는 필수 입력항목입니다.", "E999", "");
  74. return;
  75. }
  76. if (isDate(model.getValue("/root/send/baseinfo/sdate")) == false){
  77. messageBox("조회 시작일자의 날짜 형식이 잘못 입력되었습니다.", "E999", "");
  78. return;
  79. }
  80. if (model.getValue("/root/send/baseinfo/tdate") == ""){
  81. messageBox("조회 종료일자는 필수 입력항목입니다.", "E999", "");
  82. return;
  83. }
  84. if (isDate(model.getValue("/root/send/baseinfo/tdate")) == false){
  85. messageBox("조회 종료일자의 날짜 형식이 잘못 입력되었습니다.", "E999", "");
  86. return;
  87. }
  88. if (model.getValue("/root/send/baseinfo/sdate") == model.getValue("/root/send/baseinfo/tdate")){
  89. messageBox("조회 시작일자가 종료일자 보다 큽니다.", "E999", "");
  90. return;
  91. }
  92. model.removeNodeset("/root/main/rsrvupdtinfo/rsrvupdt");
  93. model.setValue("/root/send/baseinfo/suppdeptcd", model.getValue("/root/send/globalinstance/instance1"));
  94. if (submit("TRAEA00701")){
  95. }
  96. model.refresh();
  97. }
  98. function fSaveData() {
  99. for (var i = 1; i < datagrid2.rows; i++){
  100. var fromdt = model.getValue("/root/main/rsrvupdtinfo/rsrvupdt[" + i + "]/rsrvupdtfromdd");
  101. var fromtm = model.getValue("/root/main/rsrvupdtinfo/rsrvupdt[" + i + "]/rsrvupdtfromtm");
  102. var todt = model.getValue("/root/main/rsrvupdtinfo/rsrvupdt[" + i + "]/rsrvupdttodd");
  103. var totm = model.getValue("/root/main/rsrvupdtinfo/rsrvupdt[" + i + "]/rsrvupdttotm");
  104. if (fromdt == ""){
  105. messageBox(i + "번째 시작일시의 일자는 필수 입력 또는 선택 항목입니다. ", "E999", "");
  106. return;
  107. }
  108. if (fromtm == ""){
  109. messageBox(i + "번째 시작일시의 시간은 필수 입력 항목입니다. ", "E999", "");
  110. return;
  111. }
  112. if(!isValidDateTime(fromtm, "hhmm")) {
  113. messageBox(i + "번째 휴무 시작 시간형식이 정확하지 않습니다.", "E999", "");
  114. return;
  115. }
  116. if (todt == ""){
  117. messageBox(i + "번째 종료일시의 일자는 필수 입력 또는 선택 항목입니다. ", "E999", "");
  118. return;
  119. }
  120. if (totm == ""){
  121. messageBox(i + "번째 종료일시의 시간은 필수 입력 항목입니다. ", "E999", "");
  122. return;
  123. }
  124. if(!isValidDateTime(totm, "hhmm")) {
  125. messageBox(i + "번째 휴무 종료 시간형식이 정확하지 않습니다.", "E999", "");
  126. return;
  127. }
  128. if ((fromdt + fromtm) > (todt + totm)){
  129. messageBox(i + "번째 시작일시가 종료일시 보다 큽니다.", "E999", "");
  130. return;
  131. }
  132. }
  133. var mindate = model.getValue("/root/send/baseinfo/sdate");
  134. var maxdate = model.getValue("/root/send/baseinfo/tdate");
  135. for (var i = 1; i < datagrid2.rows; i++){
  136. if (mindate > model.getValue("/root/main/rsrvupdtinfo/rsrvupdt[" + i + "]/rsrvupdtfromdd")){
  137. mindate = model.getValue("/root/main/rsrvupdtinfo/rsrvupdt[" + i + "]/rsrvupdtfromdd");
  138. }
  139. if (maxdate < model.getValue("/root/main/rsrvupdtinfo/rsrvupdt[" + i + "]/rsrvupdtfromdd")){
  140. maxdate = model.getValue("/root/main/rsrvupdtinfo/rsrvupdt[" + i + "]/rsrvupdtfromdd");
  141. }
  142. }
  143. var update = getGridUpdateData(datagrid2);
  144. model.setValue("/root/send/execdata/rsrvupdt",update);
  145. //setAlertOn();
  146. if(submit("TXAEA00701")){
  147. model.setValue("/root/send/baseinfo/sdate", mindate);
  148. model.setValue("/root/send/baseinfo/tdate", maxdate);
  149. readfunc();
  150. }
  151. }
  152. function isDate(str) { // 날짜 형식에 대한 적합여부 체크
  153. if (str == "") return true; // 빈건 체크안함
  154. if (trim(str) == "") return true; // 빈건 체크안함
  155. if (isNaN(parseInt(str))) return false; // 숫자가 아니면 false
  156. if (str.length != 8) return false; // 8자리(yyyymmdd)가 아니면 false
  157. var yy = new Number(str.substring(0, 4));
  158. var mm = new Number(str.substring(4, 6)) - 1;
  159. var dd = new Number(str.substring(6, 8));
  160. var date = new Date(yy, mm, dd);
  161. //alert(date.getFullYear() +"-" + (date.getMonth()+1) + "-" + date.getDate());
  162. if (yy != date.getFullYear() ||
  163. mm != date.getMonth() ||
  164. dd != date.getDate()) {
  165. return false; // 존재하지 않는 날짜
  166. }
  167. return true; // 존재하는 날짜
  168. }
  169. function trim(data){ // 문자에 대한 TRIM 작업
  170. return data.replace(/(^\s*)|(\s*$)/g, "");
  171. }
  172. ]]>
  173. </script>
  174. <submission id="TRZBC00101"/>
  175. <script type="javascript" ev:event="xforms-ready">
  176. <![CDATA[
  177. aezfSetSuppDeptcd();
  178. //검사실코드 갖고오기
  179. submit("TRAEA01301", false);
  180. if( instance1.selectSingleNode("/root/init/cmb_info/suppdept[suppdeptcd='" + model.getValue("/root/send/globalinstance/instance1") + "']") == null ){
  181. caption15.visible = true;
  182. cmb_deptcd.visible = true;
  183. btn_grdadd.disabled = true;
  184. btn_grddel.disabled = true;
  185. btn_save.disabled = true;
  186. }else{
  187. caption15.visible = false;
  188. cmb_deptcd.visible = false;
  189. btn_grdadd.disabled = false;
  190. btn_grddel.disabled = false;
  191. btn_save.disabled = false;
  192. }
  193. //2011.08.10 해당부서,검사실 디폴트셋팅 - 박재영
  194. var suppdept = model.getValue("/root/send1/instance1");
  195. // if(suppdept != null || suppdept != ""){
  196. // alert(suppdept);
  197. // var excuroomcd= model.getValue("/root/send1/excuroomcd");
  198. // model.setValue("/root/send/globalinstance/instance1",suppdept);
  199. // model.setValue("/root/send/baseinfo/excuroomcd",excuroomcd);
  200. // //검사실코드 갖고오기
  201. // submit("TRAEA01301", false);
  202. // }
  203. if(suppdept == null || suppdept == ""){
  204. //alert("aa");
  205. }else{
  206. //alert("bb");
  207. var excuroomcd= model.getValue("/root/send1/excuroomcd");
  208. model.setValue("/root/send/globalinstance/instance1",suppdept);
  209. model.setValue("/root/send/baseinfo/excuroomcd",excuroomcd);
  210. //검사실코드 갖고오기
  211. submit("TRAEA01301", false);
  212. }
  213. model.removeNodeset("/root/main/rsrvupdtinfo/rsrvupdt");
  214. model.setValue("/root/send/baseinfo/sdate", getCurrentDate());
  215. var date = getCurrentDate().toDate().getAddDate(1,"M").getDateFormat("YYYYMMDD");
  216. model.setValue("/root/send/baseinfo/tdate", date);
  217. //*********************************************************************************************************************************************
  218. //담당 검사실 갖고오기
  219. submit("TRAEA01115",false);
  220. //담당 검사실 세팅 2011.08.10 주석처리 - 박재영
  221. //model.setValue("/root/send/baseinfo/excuroomcd",model.getValue("/root/init2/cmb_info/initexcuroomcd[1]/excuroomcd"));
  222. //*********************************************************************************************************************************************
  223. model.refresh();
  224. ]]>
  225. </script>
  226. <submission id="TRAEA01301" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/globalinstance" replace="instance" resultref="/root/init/cmb_info"/>
  227. <submission id="TRAOA01001" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqdata" resultref="/root/main/excuprcplist"/>
  228. <submission id="TRAEA00701" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/baseinfo" resultref="/root/main/rsrvupdtinfo"/>
  229. <submission id="TXAEA00701" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/execdata" resultref="/root/hidden"/>
  230. <submission id="TRAEA01115" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/globalinstance" replace="instance" resultref="/root/init2/cmb_info"/>
  231. </model>
  232. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  233. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  234. <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
  235. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  236. <script type="javascript" src="../../../ast/commonweb/js/AST.js"/>
  237. <script type="javascript" src="../../../com/userdeptinfoweb/js/ZSU001.js"/>
  238. <script type="javascript" src="../../../ast/examcureweb/js/AEZ0001.js"/>
  239. <script type="javascript" src="../../../com/departmentcodeweb/js/ZSD001.js"/>
  240. </xhtml:head>
  241. <xhtml:body pagewidth="1211" pageheight="784" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  242. <group id="group1" style="left:0px; top:0px; width:1095px; height:13px; ">
  243. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:142px; height:14px; ">검사실 휴검관리</caption>
  244. </group>
  245. <line id="line3" class="line_2" style="x1:5px; y1:47px; x2:289px; y2:47px; "/>
  246. <line id="line1" class="line_2" style="x1:5px; y1:73px; x2:289px; y2:73px; "/>
  247. <group id="group3" scroll="auto" style="left:0px; top:18px; width:1095px; height:722px; ">
  248. <group id="grp_sea" style="left:0px; top:10px; width:1080px; height:40px; vertical-align:top; ">
  249. <shape id="roundrect1" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:2px; width:1073px; height:38px; background-color:#fffbf2; border-color:#ffd799; "/>
  250. <caption id="caption5" class="search_name" style="left:540px; top:12px; width:86px; height:17px; ">조회일자</caption>
  251. <caption id="caption7" style="left:729px; top:10px; width:20px; height:20px; vertical-align:middle; ">~</caption>
  252. <input id="input4" ref="/root/send/baseinfo/tdate" class="input_search" navindex="4" inputtype="date" style="left:745px; top:12px; width:102px; height:19px; text-align:center; "/>
  253. <input id="input6" ref="/root/send/baseinfo/sdate" class="input_search" navindex="3" inputtype="date" style="left:626px; top:12px; width:100px; height:19px; text-align:center; "/>
  254. <button id="btn_sea" class="btn1_letter2" navindex="5" style="left:1010px; top:10px; width:56px; height:22px; ">
  255. <caption>조회</caption>
  256. <script type="javascript" ev:event="DOMActivate">
  257. <![CDATA[
  258. readfunc();
  259. ]]>
  260. </script>
  261. </button>
  262. <select1 id="combo2" ref="/root/send/baseinfo/excuroomcd" class="combo_search" navindex="1" appearance="minimal" editmode="inputsearch" style="left:90px; top:12px; width:205px; height:19px; ">
  263. <choices>
  264. <itemset nodeset="/root/init/cmb_info/initexecroom">
  265. <label ref="excuroomcdnm"/>
  266. <value ref="excuroomcdid"/>
  267. </itemset>
  268. </choices>
  269. <script type="javascript" ev:event="xforms-value-changed">
  270. <![CDATA[
  271. readfunc();
  272. ]]>
  273. </script>
  274. </select1>
  275. <select1 id="cmb_deptcd" ref="/root/send/globalinstance/instance1" navindex="2" appearance="minimal" editmode="inputsearch" style="left:405px; top:12px; width:120px; height:19px; ">
  276. <choices>
  277. <itemset nodeset="/root/init/cmb_info/suppdept">
  278. <label ref="depthngnm"/>
  279. <value ref="suppdeptcd"/>
  280. </itemset>
  281. </choices>
  282. <script type="javascript" ev:event="xforms-value-changed">
  283. <![CDATA[
  284. model.removeNodeset("/root/main/rsrvupdtinfo/rsrvupdt");
  285. model.setValue("/root/send/globalinstance/instance1", cmb_deptcd.value);
  286. model.setValue("/root/send/baseinfo/excuroomcd", "");
  287. submit("TRAEA01301", false);
  288. model.refresh();
  289. ]]>
  290. </script>
  291. </select1>
  292. <caption id="caption1" class="search_name" style="left:10px; top:12px; width:73px; height:17px; ">검사실 :</caption>
  293. <caption id="caption15" class="search_name" style="left:315px; top:12px; width:86px; height:17px; ">지원부서 :</caption>
  294. <line id="line13" class="line_4" style="x1:1004px; y1:8px; x2:1004px; y2:35px; "/>
  295. </group>
  296. <datagrid id="datagrid2" nodeset="/root/main/rsrvupdtinfo/rsrvupdt" caption="검사실명^최종변경자^시작일시^시작일시^종료일시^종료일시^사유^Remark^최종변경일시^부서코드^ioflag^지원부서코드^입원외래구분" colsep="^" colwidth="143, 71, 90, 48, 90, 48, 458, 317, 116, 100, 100" mergecellsfixedrows="bycolrec" rowheader="seq" rowsep="|" navindex="8" style="left:0px; top:79px; width:1075px; height:641px; ">
  297. <col ref="excuroomcd" type="combo">
  298. <choices>
  299. <itemset nodeset="/root/init/cmb_info/initexecroom">
  300. <label ref="excuroomcdnm"/>
  301. <value ref="excuroomcdid"/>
  302. </itemset>
  303. </choices>
  304. </col>
  305. <col ref="lastupdtrid" style="text-align:center; "/>
  306. <col disabled="true" ref="rsrvupdtfromdd" type="inputdate" style="text-align:center; "/>
  307. <col disabled="true" ref="rsrvupdtfromtm" type="input" format="hh:nn" style="text-align:center; "/>
  308. <col disabled="true" ref="rsrvupdttodd" type="inputdate" style="text-align:center; "/>
  309. <col disabled="true" ref="rsrvupdttotm" type="input" format="hh:nn" style="text-align:center; "/>
  310. <col ref="updtresndesc" type="input"/>
  311. <col ref="updtresncnts" type="input"/>
  312. <col ref="lastupdtdt" format="yyyy-mm-dd hh:nn:ss" style="text-align:center; "/>
  313. <col ref="suppdeptcd" visibility="hidden"/>
  314. <col ref="ioflag" visibility="hidden"/>
  315. <script type="javascript" ev:event="DOMFocusIn">
  316. <![CDATA[
  317. checkKeyColumn("datagrid2");
  318. ]]>
  319. </script>
  320. </datagrid>
  321. <caption id="caption8" class="tit_2" style="left:0px; top:60px; width:82px; height:13px; ">변경내역</caption>
  322. <line id="line7" class="line_1" style="x1:0px; y1:75px; x2:1075px; y2:75px; "/>
  323. <button id="btn_grddel" class="btn2_letter3" navindex="7" style="left:957px; top:55px; width:53px; height:19px; ">
  324. <caption>행삭제</caption>
  325. <script type="javascript" ev:event="DOMActivate">
  326. <![CDATA[
  327. datagrid2.deleteRow(datagrid2.row);
  328. ]]>
  329. </script>
  330. </button>
  331. <button id="btn_grdadd" class="btn2_letter3" navindex="6" style="left:903px; top:55px; width:53px; height:19px; ">
  332. <caption>행추가</caption>
  333. <script type="javascript" ev:event="DOMActivate">
  334. <![CDATA[
  335. if (model.getValue("/root/send/baseinfo/excuroomcd") == ""){
  336. messageBox("검사실을 선택한 후 처리하시기 바랍니다.", "E999", "");
  337. return;
  338. }
  339. datagrid2.addRow(false);
  340. model.setValue("/root/main/rsrvupdtinfo/rsrvupdt[" + datagrid2.row + "]/excuroomcd", model.getValue("/root/send/baseinfo/excuroomcd"));
  341. model.setValue("/root/main/rsrvupdtinfo/rsrvupdt[" + datagrid2.row + "]/suppdeptcd", model.getValue("/root/send/globalinstance/instance1"));
  342. model.setValue("/root/main/rsrvupdtinfo/rsrvupdt[" + datagrid2.row + "]/ioflag", "-");
  343. model.setValue("/root/main/rsrvupdtinfo/rsrvupdt[" + datagrid2.row + "]/updtresncnts","-");
  344. model.refresh();
  345. ]]>
  346. </script>
  347. </button>
  348. <button id="btn_savexls" class="btn2_letter4" style="left:1011px; top:55px; width:64px; height:19px; ">
  349. <caption>엑셀저장</caption>
  350. <script type="javascript" ev:event="DOMActivate">
  351. <![CDATA[
  352. var period = model.getValue("/root/send/baseinfo/sdate") + "-" + model.getValue("/root/send/baseinfo/tdate");
  353. var filename = window.fileDialog("save", ",", false, "검사실 휴검 내역_" + period, "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  354. datagrid2.saveExcel(filename, "sheetname:휴검내역;colhiddenextend:false;rowhiddenextend:false;col_1:label;");
  355. messageBox("엑셀 저장이 완료되었습니다.", "I999");
  356. ]]>
  357. </script>
  358. </button>
  359. </group>
  360. <button id="btn_prt" class="btn6_letter2" visibility="hidden" style="left:0px; top:745px; width:56px; height:22px; ">
  361. <caption>출력</caption>
  362. </button>
  363. <button id="btn_save" class="btn1_letter2" navindex="9" style="left:1020px; top:745px; width:56px; height:22px; ">
  364. <caption>저장</caption>
  365. <script type="javascript" ev:event="DOMActivate">
  366. <![CDATA[
  367. for (var i = 1; i < datagrid2.rows; i ++){
  368. if(model.getValue("/root/main/rsrvupdtinfo/rsrvupdt[" + i + "]/rsrvupdtfromtm") == ""){
  369. messageBox("종료시간을", "C001");
  370. return;
  371. }
  372. if(model.getValue("/root/main/rsrvupdtinfo/rsrvupdt[" + i + "]/rsrvupdttodd")== ""){
  373. messageBox("종료일자를", "C001");
  374. return;
  375. }
  376. if(model.getValue("/root/main/rsrvupdtinfo/rsrvupdt[" + i + "]/rsrvupdttotm")== ""){
  377. messageBox("시작시간을", "C001");
  378. return;
  379. }
  380. if(model.getValue("/root/main/rsrvupdtinfo/rsrvupdt[" + i + "]/rsrvupdtfromdd")== ""){
  381. messageBox("시작일자를", "C001");
  382. return;
  383. }
  384. if(model.getValue("/root/main/rsrvupdtinfo/rsrvupdt[" + i + "]/updtresndesc")== ""){
  385. messageBox("사유를", "C001");
  386. return;
  387. }
  388. if(model.getValue("/root/main/rsrvupdtinfo/rsrvupdt[" + i + "]/updtresncnts")== ""){
  389. messageBox("Remark을", "C001");
  390. return;
  391. }
  392. }
  393. fSaveData();
  394. ]]>
  395. </script>
  396. </button>
  397. </xhtml:body>
  398. </xhtml:html>