SMAEB02000_재료소모코드관리.xrw 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  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. <!-- grid 컨트롤에 mapping되는 instance - 시작 -->
  11. <matrcstcodelist>
  12. <item>
  13. <!-- 검사 코드(영문+숫자 조합) -->
  14. <excucd/>
  15. <!-- 검사 코드명 -->
  16. <excucdnm/>
  17. <!-- 핵종 코드 -->
  18. <nuclcd/>
  19. <!-- 화합물 코드 -->
  20. <compdcd/>
  21. <!-- 약물 투여량 -->
  22. <drugqty/>
  23. <!-- 약물 투여방법 -->
  24. <drugmthdcd/>
  25. <!-- 소모량 -->
  26. <cstqty/>
  27. <!-- IV.SITE -->
  28. <injpartcd/>
  29. <!-- 공급처 -->
  30. <suplcustcd/>
  31. <!-- 검사자 -->
  32. <execrid/>
  33. <!-- 지원부서코드 -->
  34. <basesuppdeptcd/>
  35. </item>
  36. </matrcstcodelist>
  37. </main>
  38. <!-- grid 컨트롤에 mapping되는 instance - 종료 -->
  39. <send>
  40. <srchexcucd/>
  41. <srchexcucdnm/>
  42. <req>
  43. <data/>
  44. </req>
  45. <globalinstance>
  46. <instance1/>
  47. </globalinstance>
  48. <windowloadinstance>SMAEB02000</windowloadinstance>
  49. </send>
  50. <init>
  51. <cmb_info>
  52. <initnuclcd>
  53. <nuclcdid/>
  54. <nuclcdnm/>
  55. </initnuclcd>
  56. <initcompdcd>
  57. <compdcdid/>
  58. <compdcdnm/>
  59. </initcompdcd>
  60. <initdrugmthdcd>
  61. <drugmthdcdid/>
  62. <drugmthdcdnm/>
  63. </initdrugmthdcd>
  64. <initinjpartcd>
  65. <injpartcdid/>
  66. <injpartcdnm/>
  67. </initinjpartcd>
  68. <initsuplcustcd>
  69. <suplcustcdid/>
  70. <suplcustcdnm/>
  71. </initsuplcustcd>
  72. <initexecrid>
  73. <execridid/>
  74. <execridnm/>
  75. </initexecrid>
  76. </cmb_info>
  77. </init>
  78. <hidden>
  79. <count/>
  80. </hidden>
  81. </root>
  82. </instance>
  83. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  84. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  85. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  86. <script type="javascript" src="../../../com/commonweb/js/numericHelper.js"/>
  87. <script type="javascript" src="../../../ast/examcureweb/js/AEZ0001.js"/>
  88. <submission id="TRAEA02301" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/globalinstance" replace="instance" resultref="/root/init/cmb_info"/>
  89. <submission id="TRAEB02001" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/matrcstcodelist"/>
  90. <submission id="TXAEB02001" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/req" replace="instance" resultref="/root/hidden"/>
  91. <script type="javascript" ev:event="xforms-ready">
  92. <![CDATA[
  93. aezfSetSuppDeptcd();
  94. submit("TRAEA02301");
  95. submit("TRAEB02001");
  96. //model.removeNodeset("/root/main/matrcstcodelist/item");
  97. model.refresh();
  98. model.setFocus("ipt_excucd");
  99. ]]>
  100. </script>
  101. <script type="javascript">
  102. <![CDATA[
  103. function isDecimalNumber(param) {
  104. if( typeof( param ) == "undefined" ) return false;
  105. if( param.length == 0 ) return false;
  106. var thisSting = param.toString();
  107. for ( var i=0; i < thisSting.length; i++ ) {
  108. var thisNumber = thisSting.substring( i, i+1 );
  109. // 숫자, 혹은 소수점이 아니면 FALSE 리턴
  110. if (thisNumber != "." && isNaN( thisNumber )) return false;
  111. // 공백이면 FALSE 리턴
  112. if( " " == thisNumber ) return false;
  113. }
  114. return true;
  115. }
  116. function chkMandatoryData() {
  117. var msg = "";
  118. for (var i = 1; i < parseInt(grd_matrcstcode.rows); i++) {
  119. var _code = model.getValue("/root/main/matrcstcodelist/item[" + i + "]/excucd");
  120. var _cdnm = model.getValue("/root/main/matrcstcodelist/item[" + i + "]/excucdnm");
  121. var _nucl = model.getValue("/root/main/matrcstcodelist/item[" + i + "]/nuclcd");
  122. // if ( _code == "" || _cdnm == "" || _nucl == "" ) {
  123. // msg += i + "/";
  124. // }
  125. if ( _code == "" || _nucl == "" ) {
  126. msg += i + "/";
  127. }
  128. }
  129. if ( msg != "" ) {
  130. messageBox("필수입력항목(검사코드, 코드명, 핵종)에 대한 내용이 누락되었습니다. " + msg + "번 째 row를 저장", "E001");
  131. return false;
  132. }
  133. }
  134. function chkUpdatedData() {
  135. if ( messageBox("", "Q002") == 6 ) {
  136. var update = getGridUpdateData(grd_matrcstcode);
  137. if ( update == "" ) {
  138. messageBox("업데이트 정보가 없습니다.", "I");
  139. model.setFocus("ipt_excucd");
  140. }
  141. else {
  142. var _msg = "";
  143. if ( chkMandatoryData() == false ) {
  144. return true;
  145. }
  146. for (var i = 1; i < parseInt(grd_matrcstcode.rows); i++) {
  147. var dqty = model.getValue("/root/main/matrcstcodelist/item[" + i + "]/drugqty");
  148. var cqty = model.getValue("/root/main/matrcstcodelist/item[" + i + "]/cstqty");
  149. if (isDecimalNumber(dqty) == false || isDecimalNumber(cqty) == false) {
  150. _msg += i + "/";
  151. }
  152. }
  153. if ( _msg != "" ) {
  154. messageBox("투여량/소모량 입력은 숫자만이 가능합니다." + _msg + "번 째 row를 확인해 주십시오.", "E");
  155. return true;
  156. }
  157. model.setValue("/root/send/req/data", update);
  158. submit("TXAEB02001");
  159. submit("TRAEB02001");
  160. model.refresh();
  161. }
  162. }
  163. }
  164. ]]>
  165. </script>
  166. </model>
  167. </xhtml:head>
  168. <xhtml:body guideline="1,1195;2,757;2,784;">
  169. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  170. <!-- 메인 타이틀 -->
  171. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:142px; height:14px; ">재료소모코드관리</caption>
  172. </group>
  173. <group id="group3" scroll="auto" style="left:0px; top:13px; width:1195px; height:744px; ">
  174. <group id="grp_sea" style="left:0px; top:10px; width:1195px; height:35px; vertical-align:top; ">
  175. <!-- 조회영역 배경 -->
  176. <shape id="roundrect2" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:1195px; height:35px; background-color:#fffbf2; border-color:#ffd799; "/>
  177. <!-- 검사코드 입력부분 -->
  178. <caption id="caption3" class="search_name" style="left:15px; top:9px; width:60px; height:17px; ">코드 :</caption>
  179. <input id="ipt_excucd" ref="/root/send/srchexcucd" class="input_search" style="left:78px; top:8px; width:150px; height:19px; "/>
  180. <script type="javascript" ev:event="onkeyup">
  181. <![CDATA[
  182. inputEnterKey("btn_sea", "DOMActivate");
  183. ]]>
  184. </script>
  185. <!-- 검사코드명 입력부분 -->
  186. <caption id="caption1" class="search_name" style="left:260px; top:9px; width:75px; height:17px; ">코드명 :</caption>
  187. <input id="ipt_excucdnm" ref="/root/send/srchexcucdnm" class="input_search" style="left:338px; top:8px; width:150px; height:19px; "/>
  188. <line id="line13" class="line_4" style="x1:1108px; y1:9px; x2:1108px; y2:31px; "/>
  189. <!-- 조회 버튼 -->
  190. <button id="btn_sea" class="btn1_letter2" style="left:1124px; top:7px; width:56px; height:22px; ">
  191. <caption>조회</caption>
  192. <script type="javascript" ev:event="DOMActivate">
  193. <![CDATA[
  194. submit("TRAEB02001");
  195. model.setValue("/root/send/srchexcucd", "");
  196. model.setValue("/root/send/srchexcucdnm", "");
  197. model.refresh();
  198. ]]>
  199. </script>
  200. </button>
  201. </group>
  202. <!-- Grid에 행 추가 -->
  203. <button id="btn_grdadd" class="btn2_letter3" style="left:1020px; top:49px; width:53px; height:19px; ">
  204. <caption>행추가</caption>
  205. <script type="javascript" ev:event="DOMActivate">
  206. <![CDATA[
  207. grd_matrcstcode.addItem();
  208. var i = parseInt(grd_matrcstcode.row);
  209. model.setValue("/root/main/matrcstcodelist/item[" + i + "]/basesuppdeptcd",
  210. model.getValue("/root/send/globalinstance/instance1") );
  211. model.setValue("/root/main/matrcstcodelist/item[" + i + "]/drugqty", 0);
  212. model.setValue("/root/main/matrcstcodelist/item[" + i + "]/cstqty", 0);
  213. ]]>
  214. </script>
  215. </button>
  216. <!-- Grid에 있는 행 삭제 -->
  217. <button id="btn_grddel" class="btn2_letter3" style="left:1076px; top:49px; width:53px; height:19px; ">
  218. <caption>행삭제</caption>
  219. <script type="javascript" ev:event="DOMActivate">
  220. <![CDATA[
  221. deleteSelectedRows(grd_matrcstcode, true);
  222. //datagrid1.addStatus(datagrid1.row,"delete");
  223. ]]>
  224. </script>
  225. </button>
  226. <!-- Grid에 있는 목록을 Excel에 저장 -->
  227. <button id="btn_excsave" class="btn2_letter4" style="left:1131px; top:49px; width:42px; height:19px; ">
  228. <caption>엑셀저장</caption>
  229. <script type="javascript" ev:event="DOMActivate">
  230. <![CDATA[
  231. var file = window.fileDialog("save","","false","","xls","Excel Files(*.xls)|*.xls");
  232. grd_matrcstcode.saveExcel(file);
  233. ]]>
  234. </script>
  235. </button>
  236. <!-- Grid 타이틀 -->
  237. <line id="line1" class="line_1" style="x1:0px; y1:69px; x2:1195px; y2:69px; "/>
  238. <caption id="caption14" class="tit_2" style="left:5px; top:54px; width:130px; height:14px; ">재료소모코드관리</caption>
  239. <datagrid id="grd_matrcstcode" nodeset="/root/main/matrcstcodelist/item" caption="검사(처방)코드^검사(처방)코드명^핵종^화합물^투여량^투여방법^소모량^IV.SITE^공급처^검사자^지원부서" colsep="^" colwidth="104, 292, 95, 95, 95, 95, 95, 95, 95, 95, 0" mergecellsfixedrows="bycolrec" rowheader="update" rowsep="|" style="left:0px; top:74px; width:1195px; height:670px; ">
  240. <!-- 검사 코드 -->
  241. <col ref="excucd" type="inputbutton" _key="true"/>
  242. <!-- 검사 코드명 -->
  243. <col ref="excucdnm"/>
  244. <!-- 핵종 코드 -->
  245. <col ref="nuclcd" type="combo">
  246. <choices>
  247. <itemset nodeset="/root/init/cmb_info/initnuclcd">
  248. <label ref="nuclcdnm"/>
  249. <value ref="nuclcdid"/>
  250. </itemset>
  251. </choices>
  252. </col>
  253. <!-- 화합물 코드 -->
  254. <col ref="compdcd" type="combo">
  255. <choices>
  256. <itemset nodeset="/root/init/cmb_info/initcompdcd">
  257. <label ref="compdcdnm"/>
  258. <value ref="compdcdid"/>
  259. </itemset>
  260. </choices>
  261. </col>
  262. <!-- 약물 투여량 -->
  263. <col ref="drugqty" type="input" format="#,###.000" style="text-align:right; "/>
  264. <!-- 약물 투여방법 -->
  265. <col ref="drugmthdcd" type="combo">
  266. <choices>
  267. <itemset nodeset="/root/init/cmb_info/initdrugmthdcd">
  268. <label ref="drugmthdcdnm"/>
  269. <value ref="drugmthdcdid"/>
  270. </itemset>
  271. </choices>
  272. </col>
  273. <!-- 소모량 -->
  274. <col ref="cstqty" type="input" format="#,###.000" style="text-align:right; "/>
  275. <!-- IV.SITE -->
  276. <col ref="injpartcd" type="combo">
  277. <choices>
  278. <itemset nodeset="/root/init/cmb_info/initinjpartcd">
  279. <label ref="injpartcdnm"/>
  280. <value ref="injpartcdid"/>
  281. </itemset>
  282. </choices>
  283. </col>
  284. <!-- 공급처 -->
  285. <col ref="suplcustcd" type="combo">
  286. <choices>
  287. <itemset nodeset="/root/init/cmb_info/initsuplcustcd">
  288. <label ref="suplcustcdnm"/>
  289. <value ref="suplcustcdid"/>
  290. </itemset>
  291. </choices>
  292. </col>
  293. <!-- 검사자 -->
  294. <col ref="execrid" type="combo">
  295. <choices>
  296. <itemset nodeset="/root/init/cmb_info/initexecrid">
  297. <label ref="execridnm"/>
  298. <value ref="execridid"/>
  299. </itemset>
  300. </choices>
  301. </col>
  302. <!-- 지원부서코드 -->
  303. <col ref="basesuppdeptcd"/>
  304. <!-- 검사(처방)코드 column의 박스를 클릭했을 때의 이벤트 (팝업창 띄우기) -->
  305. <script type="javascript" ev:event="onbuttonclick">
  306. <![CDATA[
  307. var colidx = grd_matrcstcode.col;
  308. if ( colidx == 1) {
  309. window.load( "SPAEA02302_코드조회(검사치료).xrw","modal","code", "left:100px; top:150px; width:530px; height:380px;min:hidden;max:hidden;resize:false;" );
  310. }
  311. ]]>
  312. </script>
  313. <!-- 검사(처방)코드 column의 내용을 수정했을 때의 이벤트 (업데이트 표시) -->
  314. <script type="javascript" ev:event="onclick">
  315. <![CDATA[
  316. var iRow = grd_matrcstcode.row;
  317. if(grd_matrcstcode.mouseCol == 1){
  318. grd_matrcstcode.addStatus(iRow, "update");
  319. }
  320. ]]>
  321. </script>
  322. </datagrid>
  323. </group>
  324. <group id="grp_btn" style="left:0px; top:757px; width:1195px; height:27px; ">
  325. <!-- 초기화 버튼 -->
  326. <button id="btn_clear" class="btn4_letter3" style="left:1127px; top:5px; width:56px; height:22px; ">
  327. <caption>초기화</caption>
  328. <script type="javascript" ev:event="DOMActivate">
  329. <![CDATA[
  330. if ( messageBox("초기화하시겠습니까?", "Q") == 6) {
  331. model.reset();
  332. }
  333. model.setFocus("ipt_excucd");
  334. ]]>
  335. </script>
  336. </button>
  337. <!-- 저장 버튼 -->
  338. <button id="btn_save" class="btn4_letter2" style="left:1069px; top:5px; width:56px; height:22px; ">
  339. <caption>저장</caption>
  340. <script type="javascript" ev:event="DOMActivate">
  341. <![CDATA[
  342. chkUpdatedData();
  343. ]]>
  344. </script>
  345. </button>
  346. </group>
  347. </xhtml:body>
  348. </xhtml:html>