SMLBD01100_헌혈증번호관리.xrw 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  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>Untitle</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root>
  9. <main>
  10. <brgstinfo>
  11. <brgstlist>
  12. <rgstdd/>
  13. <minbrgstno/>
  14. <maxbrgstno/>
  15. <donkind/>
  16. <brgststocqty/>
  17. <cmtcnts/>
  18. <fstrgstrid/>
  19. </brgstlist>
  20. </brgstinfo>
  21. <brgstinfo1>
  22. <brgstdetl>
  23. <rgstdd/>
  24. <minbrgstno/>
  25. <maxbrgstno/>
  26. <donkind/>
  27. <brgststocqty/>
  28. <cmtcnts/>
  29. <iudgb/>
  30. </brgstdetl>
  31. </brgstinfo1>
  32. <popupendflag/>
  33. </main>
  34. <init>
  35. <cmbinfo>
  36. <payflagcd>
  37. <M0029>
  38. <cdid/>
  39. <cdnm/>
  40. </M0029>
  41. </payflagcd>
  42. </cmbinfo>
  43. </init>
  44. <send>
  45. <baseinfo>
  46. <sdate/>
  47. <tdate/>
  48. </baseinfo>
  49. <globalinstance>
  50. <instance1/>
  51. </globalinstance>
  52. </send>
  53. <hidden>
  54. <count/>
  55. </hidden>
  56. </root>
  57. </instance>
  58. <script type="javascript">
  59. <![CDATA[
  60. function readfunc(){
  61. btn_save.disabled = false;
  62. btn_upd.disabled = true;
  63. btn_del.disabled = true;
  64. ipt_rgstdd.disabled = false;
  65. model.removeNodeset("/root/main/brgstinfo/brgstlist");
  66. model.resetInstanceNode("/root/main/brgstinfo1/brgstdetl");
  67. model.setValue("/root/main/brgstinfo1/brgstdetl/iudgb", "I");
  68. if (submit("TRLBD01101")){
  69. }
  70. if (model.getValue("/root/main/brgstinfo/brgstlist[" + 1 + "]/rgstdd") == ""){
  71. model.removeNodeset("/root/main/brgstinfo/brgstlist");
  72. }
  73. model.refresh();
  74. }
  75. function readfunc1(){
  76. btn_save.disabled = true;
  77. btn_upd.disabled = false;
  78. btn_del.disabled = false;
  79. ipt_rgstdd.disabled = true;
  80. var irow = datagrid1.row;
  81. model.resetInstanceNode("/root/main/brgstinfo1/brgstdetl");
  82. model.setValue("/root/main/brgstinfo1/brgstdetl/rgstdd", model.getValue("/root/main/brgstinfo/brgstlist[" + irow + "]/rgstdd"));
  83. model.setValue("/root/main/brgstinfo1/brgstdetl/minbrgstno", model.getValue("/root/main/brgstinfo/brgstlist[" + irow + "]/minbrgstno"));
  84. model.setValue("/root/main/brgstinfo1/brgstdetl/maxbrgstno", model.getValue("/root/main/brgstinfo/brgstlist[" + irow + "]/maxbrgstno"));
  85. model.setValue("/root/main/brgstinfo1/brgstdetl/donkind", model.getValue("/root/main/brgstinfo/brgstlist[" + irow + "]/donkind"));
  86. model.setValue("/root/main/brgstinfo1/brgstdetl/cmtcnts", model.getValue("/root/main/brgstinfo/brgstlist[" + irow + "]/cmtcnts"));
  87. model.setValue("/root/main/brgstinfo1/brgstdetl/brgststocqty", model.getValue("/root/main/brgstinfo/brgstlist[" + irow + "]/brgststocqty"));
  88. model.setValue("/root/main/brgstinfo1/brgstdetl/iudgb", "U");
  89. model.refresh();
  90. }
  91. function fSaveData(){
  92. if (datacheck() == false){
  93. return;
  94. }
  95. //fCalcuqty();
  96. if(submit("TXLBD01101")){
  97. readfunc();
  98. }
  99. }
  100. function datacheck(){
  101. if (model.getValue("/root/main/brgstinfo1/brgstdetl/rgstdd") == ""){
  102. messageBox("입고일자는 필수 입력항목입니다.", "E999", "");
  103. return false;
  104. }
  105. if (isDate(model.getValue("/root/main/brgstinfo1/brgstdetl/rgstdd")) == false){
  106. messageBox("입고일자의 날짜 형식이 잘못 입력되었습니다.", "E999", "");
  107. return false;
  108. }
  109. var ibgstno1 = model.getValue("/root/main/brgstinfo1/brgstdetl/minbrgstno");
  110. var ibgstno2 = model.getValue("/root/main/brgstinfo1/brgstdetl/maxbrgstno");
  111. if (ibgstno1.length != 10){
  112. messageBox("Min 헌혈증번호는 10자리로 입력하셔야 합니다.", "E999", "");
  113. return false;
  114. }
  115. if (ibgstno2.length != 10){
  116. messageBox("Max 헌혈증번호는 10자리로 입력하셔야 합니다.", "E999", "");
  117. return false;
  118. }
  119. if (ibgstno1 > ibgstno2){
  120. messageBox("Min 헌혈증번호가 Max 헌혈증번호 보다 큽니다.", "E999", "");
  121. return false;
  122. }
  123. }
  124. function fCalcuqty(){
  125. var iqty1 = model.getValue("/root/main/brgstinfo1/brgstdetl/minbrgstno");
  126. var iqty2 = model.getValue("/root/main/brgstinfo1/brgstdetl/maxbrgstno");
  127. var iqty = parseFloat(iqty2) - parseFloat(iqty1) +1;
  128. if (iqty < 0){
  129. model.setValue("/root/main/brgstinfo1/brgstdetl/brgststocqty", 0);
  130. }else{
  131. model.setValue("/root/main/brgstinfo1/brgstdetl/brgststocqty", iqty);
  132. }
  133. model.refresh();
  134. }
  135. function isDate(str) { // 날짜 형식에 대한 적합여부 체크
  136. if (str == "") return true; // 빈건 체크안함
  137. if (trim(str) == "") return true; // 빈건 체크안함
  138. if (isNaN(parseInt(str))) return false; // 숫자가 아니면 false
  139. if (str.length != 8) return false; // 8자리(yyyymmdd)가 아니면 false
  140. var yy = new Number(str.substring(0, 4));
  141. var mm = new Number(str.substring(4, 6)) - 1;
  142. var dd = new Number(str.substring(6, 8));
  143. var date = new Date(yy, mm, dd);
  144. //alert(date.getFullYear() +"-" + (date.getMonth()+1) + "-" + date.getDate());
  145. if (yy != date.getFullYear() ||
  146. mm != date.getMonth() ||
  147. dd != date.getDate()) {
  148. return false; // 존재하지 않는 날짜
  149. }
  150. return true; // 존재하는 날짜
  151. }
  152. function trim(data){ // 문자에 대한 TRIM 작업
  153. return data.replace(/(^\s*)|(\s*$)/g, "");
  154. }
  155. ]]>
  156. </script>
  157. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  158. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  159. <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
  160. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  161. <script type="javascript" src="../../../ast/commonweb/js/AST.js"/>
  162. <script type="javascript" src="../../../com/userdeptinfoweb/js/ZSU001.js"/>
  163. <script type="javascript" src="../../../ast/examcureweb/js/AEZ0001.js"/>
  164. <script type="javascript" src="../../../com/departmentcodeweb/js/ZSD001.js"/>
  165. <script type="javascript" ev:event="xforms-ready">
  166. <![CDATA[
  167. //zbcfGetCodeList( new Array("M0029"), new Array("/root/init/cmbinfo/payflagcd"));
  168. readfunc();
  169. model.refresh();
  170. ]]>
  171. </script>
  172. <submission id="TRLBD01101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/baseinfo" resultref="/root/main/brgstinfo"/>
  173. <submission id="TXLBD01101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/main/brgstinfo1" resultref="/root/hidden"/>
  174. </model>
  175. </xhtml:head>
  176. <xhtml:body style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  177. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  178. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:224px; height:14px; ">헌혈증번호 관리</caption>
  179. </group>
  180. <group id="group3" scroll="auto" style="left:0px; top:40px; width:1195px; height:744px; ">
  181. <input id="input2" ref="/root/main/brgstinfo1/brgstdetl/maxbrgstno" navindex="3" format="99-99-999999" style="left:585px; top:669px; width:125px; height:19px; text-align:center; ">
  182. <script type="javascript" ev:event="xforms-value-changed">
  183. <![CDATA[
  184. fCalcuqty();
  185. ]]>
  186. </script>
  187. </input>
  188. <line id="line1" class="line_1" style="x1:0px; y1:65px; x2:1194px; y2:65px; "/>
  189. <button id="button2" class="btn2_letter2" style="left:1152px; top:44px; width:42px; height:19px; ">
  190. <caption>엑셀</caption>
  191. <script type="javascript" ev:event="DOMActivate">
  192. <![CDATA[
  193. var file = window.fileDialog("save","","true","","xls","All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  194. if(file != "") {
  195. datagrid1.saveExcel(file);
  196. }
  197. ]]>
  198. </script>
  199. </button>
  200. <caption id="caption58" class="cell_1" style="left:0px; top:668px; width:100px; height:23px; vertical-align:middle; ">헌혈종류</caption>
  201. <caption id="caption1" class="cell_1" style="left:0px; top:692px; width:100px; height:23px; vertical-align:middle; ">비고사항</caption>
  202. <select1 id="combo1" ref="/root/main/brgstinfo1/brgstdetl/donkind" navindex="1" appearance="minimal" style="left:105px; top:669px; width:115px; height:19px; ">
  203. <choices>
  204. <item>
  205. <label>혈소판헌혈</label>
  206. <value>1</value>
  207. </item>
  208. <item>
  209. <label>백혈구헌혈</label>
  210. <value>2</value>
  211. </item>
  212. <item>
  213. <label>기타헌혈</label>
  214. <value>9</value>
  215. </item>
  216. </choices>
  217. </select1>
  218. <caption id="caption2" class="cell_1" style="left:230px; top:668px; width:105px; height:23px; vertical-align:middle; ">Min 헌혈증번호</caption>
  219. <caption id="caption3" class="cell_1" style="left:475px; top:668px; width:105px; height:23px; vertical-align:middle; ">Max 헌혈증번호</caption>
  220. <input id="input1" ref="/root/main/brgstinfo1/brgstdetl/minbrgstno" navindex="2" format="99-99-999999" style="left:340px; top:669px; width:125px; height:19px; text-align:center; ">
  221. <script type="javascript" ev:event="xforms-value-changed">
  222. <![CDATA[
  223. fCalcuqty();
  224. ]]>
  225. </script>
  226. </input>
  227. <caption id="caption4" class="cell_1" style="left:930px; top:668px; width:75px; height:23px; vertical-align:middle; ">입고일자</caption>
  228. <input id="ipt_rgstdd" ref="/root/main/brgstinfo1/brgstdetl/rgstdd" class="input_search" navindex="4" inputtype="date" format="yyyy-mm-dd" style="left:1010px; top:669px; width:125px; height:19px; text-align:center; "/>
  229. <input id="input3" ref="/root/main/brgstinfo1/brgstdetl/cmtcnts" navindex="5" style="left:105px; top:693px; width:1030px; height:19px; "/>
  230. <datagrid id="datagrid1" nodeset="/root/main/brgstinfo/brgstlist" caption="입고일자^Min 헌혈증 번호^Max 헌혈증 번호^헌혈구분^입고량^입고자^비고사항" colsep="^" colwidth="128, 144, 146, 120, 100, 80, 535" explorerbar="sortshow" mergecellsfixedrows="bycolrec" rowsep="|" style="left:0px; top:70px; width:1193px; height:565px; ">
  231. <col ref="rgstdd" format="yyyy-mm-dd" style="text-align:center; "/>
  232. <col ref="minbrgstno" format="99-99-999999" style="text-align:center; "/>
  233. <col ref="maxbrgstno" format="99-99-999999" style="text-align:center; "/>
  234. <col disabled="true" ref="donkind" type="combo">
  235. <choices>
  236. <item>
  237. <label>혈소판헌혈</label>
  238. <value>1</value>
  239. </item>
  240. <item>
  241. <label>백혈구헌혈</label>
  242. <value>2</value>
  243. </item>
  244. <item>
  245. <label>기타헌혈</label>
  246. <value>9</value>
  247. </item>
  248. </choices>
  249. </col>
  250. <col ref="brgststocqty" format="#,###" style="text-align:center; "/>
  251. <col ref="fstrgstrid"/>
  252. <col ref="cmtcnts"/>
  253. <script type="javascript" ev:event="onaftersort">
  254. <![CDATA[
  255. datagrid1.gridToInstance();
  256. ]]>
  257. </script>
  258. <script type="javascript" ev:event="onclick">
  259. <![CDATA[
  260. if ( (datagrid1.row >= datagrid1.fixedRows) && (datagrid1.isCell(event.target))) {
  261. readfunc1();
  262. }
  263. ]]>
  264. </script>
  265. </datagrid>
  266. <caption id="caption5" class="cell_1" style="left:720px; top:668px; width:75px; height:23px; vertical-align:middle; ">입고량</caption>
  267. <input id="input4" ref="/root/main/brgstinfo1/brgstdetl/brgststocqty" format="#,###" style="left:800px; top:669px; width:120px; height:19px; text-align:center; "/>
  268. <group id="group2" style="left:0px; top:5px; width:1195px; height:35px; ">
  269. <shape id="roundrect1" class="roundrect_search" appearance="roundrect" ellipsewidth="20" ellipseheight="20" style="left:0px; top:0px; width:1195px; height:35px; "/>
  270. <line id="line11" class="line_4" style="x1:1114px; y1:7px; x2:1114px; y2:29px; "/>
  271. <button id="btn_search" class="btn1_letter2" style="left:1126px; top:7px; width:56px; height:22px; ">
  272. <caption>조회</caption>
  273. <script type="javascript" ev:event="DOMActivate">
  274. <![CDATA[
  275. readfunc();
  276. ]]>
  277. </script>
  278. </button>
  279. </group>
  280. <caption id="caption7" class="tit_2" style="left:5px; top:49px; width:131px; height:13px; ">헌혈증번호</caption>
  281. <line id="line8" class="line_2" style="x1:0px; y1:690px; x2:600px; y2:690px; "/>
  282. <caption id="caption19" class="tit_2" style="left:5px; top:648px; width:139px; height:14px; background-image:../../../com/commonweb/images/tit_bullet2.gif; ">헌혈증 상세</caption>
  283. <line id="line7" class="line_1" style="x1:0px; y1:663px; x2:1193px; y2:663px; "/>
  284. <line id="line2" class="line_2" style="x1:0px; y1:690px; x2:1193px; y2:690px; "/>
  285. <caption id="caption8" class="cell_1" style="left:0px; top:692px; width:100px; height:23px; vertical-align:middle; ">비고사항</caption>
  286. <caption id="caption9" class="cell_1" style="left:230px; top:668px; width:105px; height:23px; vertical-align:middle; ">Min 헌혈증번호</caption>
  287. <select1 id="combo2" ref="/root/main/brgstinfo1/brgstdetl/donkind" navindex="1" appearance="minimal" style="left:105px; top:669px; width:115px; height:19px; ">
  288. <choices>
  289. <item>
  290. <label>혈소판헌혈</label>
  291. <value>1</value>
  292. </item>
  293. <item>
  294. <label>백혈구헌혈</label>
  295. <value>2</value>
  296. </item>
  297. <item>
  298. <label>기타헌혈</label>
  299. <value>9</value>
  300. </item>
  301. </choices>
  302. </select1>
  303. <caption id="caption10" class="cell_1" style="left:475px; top:668px; width:105px; height:23px; vertical-align:middle; ">Max 헌혈증번호</caption>
  304. <caption id="caption11" class="cell_1" style="left:0px; top:668px; width:100px; height:23px; vertical-align:middle; ">헌혈종류</caption>
  305. <input id="input5" ref="/root/main/brgstinfo1/brgstdetl/minbrgstno" navindex="2" format="99-99-999999" style="left:340px; top:669px; width:125px; height:19px; text-align:center; ">
  306. <script type="javascript" ev:event="xforms-value-changed">
  307. <![CDATA[
  308. fCalcuqty();
  309. ]]>
  310. </script>
  311. </input>
  312. <line id="line3" class="line_3" style="x1:0px; y1:714px; x2:1193px; y2:714px; "/>
  313. </group>
  314. <group id="group4" scroll="auto" style="left:0px; top:13px; width:1195px; height:27px; ">
  315. <line id="line17" class="line_6" style="x1:0px; y1:25px; x2:1194px; y2:25px; "/>
  316. <button id="btn_cre" class="btn4_letter2" disabled="true" navindex="9" visibility="hidden" style="left:1139px; top:3px; width:56px; height:22px; ">
  317. <caption>신규</caption>
  318. <script type="javascript" ev:event="onclick">
  319. <![CDATA[
  320. model.resetInstanceNode("/root/main/brgstinfo1/brgstdetl");
  321. model.setValue("/root/main/brgstinfo1/brgstdetl/iudgb", "I");
  322. model.refresh();
  323. ]]>
  324. </script>
  325. </button>
  326. <button id="btn_upd" class="btn4_letter2" disabled="true" navindex="7" style="left:1078px; top:3px; width:56px; height:22px; ">
  327. <caption>수정</caption>
  328. <script type="javascript" ev:event="DOMActivate">
  329. <![CDATA[
  330. fSaveData();
  331. ]]>
  332. </script>
  333. </button>
  334. <button id="btn_del" class="btn4_letter2" disabled="true" navindex="8" style="left:1137px; top:3px; width:56px; height:22px; ">
  335. <caption>삭제</caption>
  336. <script type="javascript" ev:event="onclick">
  337. <![CDATA[
  338. model.setValue("/root/main/brgstinfo1/brgstdetl/iudgb", "D");
  339. fSaveData();
  340. ]]>
  341. </script>
  342. </button>
  343. <button id="btn_save" class="btn4_letter2" disabled="true" navindex="6" style="left:1018px; top:3px; width:56px; height:22px; ">
  344. <caption>저장</caption>
  345. <script type="javascript" ev:event="DOMActivate">
  346. <![CDATA[
  347. var rgstdd = model.getValue("/root/main/brgstinfo1/brgstdetl/rgstdd");
  348. var irow = datagrid1.findRow(rgstdd, 1, datagrid1.colRef("rgstdd"), false, false);
  349. if (irow > 0){
  350. messageBox("선택한 날짜에 등록된 자료가 존재합니다.", "E999", "");
  351. return;
  352. }
  353. fSaveData();
  354. ]]>
  355. </script>
  356. </button>
  357. </group>
  358. </xhtml:body>
  359. </xhtml:html>