SPRSC00210_SET등록.xrw 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  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>SET 등록</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <list>
  11. <goodset>
  12. <goodsetlist/>
  13. </goodset>
  14. </list>
  15. </main>
  16. <target>
  17. <defaultvalue>
  18. <instcd/>
  19. <setplceordflag/>
  20. <goodcd/>
  21. <goodnm/>
  22. <goodflag/>
  23. </defaultvalue>
  24. </target>
  25. <send>
  26. <instcd/>
  27. <proddrugsetflag/>
  28. <goodcd/>
  29. <goodnm/>
  30. <save>
  31. <goodsetlist/>
  32. </save>
  33. <goodflag/>
  34. </send>
  35. <init/>
  36. <hidden/>
  37. <temp/>
  38. </root>
  39. </instance>
  40. <script type="javascript" ev:event="xforms-ready">
  41. <![CDATA[
  42. //화면 Control을 초기화한다
  43. fCheckAuth();
  44. fInitialize();
  45. ]]>
  46. </script>
  47. <submission id="TRRSC00210" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/list/goodset"/>
  48. <submission id="TXRSC00210" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/save" resultref="/root/hidden/temp"/>
  49. </model>
  50. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  51. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  52. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  53. <script type="javascript" src="../../../mis/miscommonweb/js/RSZ001.js"/>
  54. <script type="javascript">
  55. <![CDATA[
  56. // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
  57. function fInitialize() {
  58. misfGridInit(grd_setlist);
  59. misfMsterDetailSet(grd_setlist,null, "TRRSC00210" ,"Y");
  60. misfGridComboComCdList("R0034",grd_setlist,"compsgoodunit");
  61. misfComboComCdListMulti("Z0007,R0068", "cmb_instcd,cmb_proddrugsetflag"); //기관코드,set 제제약 구분
  62. model.refresh();
  63. model.setValue("/root/send/instcd", model.getValue(PURTARGET_NODE + "/instcd"));
  64. model.setValue("/root/send/proddrugsetflag", model.getValue(PURTARGET_NODE + "/proddrugsetflag"));
  65. model.setValue("/root/send/goodcd", model.getValue(PURTARGET_NODE + "/goodcd"));
  66. model.setValue("/root/send/goodnm", model.getValue(PURTARGET_NODE + "/goodnm"));
  67. model.setValue("/root/send/goodflag", model.getValue(PURTARGET_NODE + "/goodflag"));
  68. btn_search.dispatch("DOMActivate");
  69. model.refresh();
  70. }
  71. function fCheckAuth() {
  72. btn_search.disabled = !checkAuth("R") ;
  73. btn_save.disabled = !checkAuth("X") ;
  74. }
  75. function fDefaultSetting(prow)
  76. {
  77. model.setValue(grd_setlist.nodeset + "["+ prow + "]/instcd" , model.getValue("root/send/instcd"));
  78. model.setValue(grd_setlist.nodeset + "["+ prow+ "]/proddrugsetflag" , model.getValue("root/send/proddrugsetflag"));
  79. model.setValue(grd_setlist.nodeset + "["+ prow + "]/goodcd" , model.getValue("root/send/goodcd"));
  80. }
  81. function fSettingGoodList(pnode, nodename){
  82. var codynode = instance1.selectNodes(pnode + "/*");
  83. var addRow = grd_setlist.rows - grd_setlist.fixedRows;
  84. if(model.getValue(grd_setlist.nodeset + "/goodsetlist[" + addRow + "]/comdrugtoolcd").length > 0)addRow = addRow + 1;
  85. for (var j = 1; j <= codynode.length ; j++) {
  86. if(addRow > grd_setlist.rows - grd_setlist.fixedRows)
  87. {
  88. misfGridIUD(grd_setlist,"A");
  89. addRow = grd_setlist.rows - grd_setlist.fixedRows;
  90. fDefaultSetting(addRow );
  91. }
  92. model.setValue(grd_setlist.nodeset + "[" + addRow + "]/comdrugtoolcd" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodcd"));
  93. model.setValue(grd_setlist.nodeset + "[" + addRow + "]/consitemnm" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodnm"));
  94. model.setValue(grd_setlist.nodeset + "[" + addRow + "]/compsgoodunit" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purcunit"));
  95. model.setValue(grd_setlist.nodeset + "[" + addRow + "]/consqty" , model.getValue(pnode +"/" + nodename + "[" + j + "]/userqty"));
  96. addRow = addRow + 1;
  97. }
  98. //model.removenode(pnode);
  99. model.refresh();
  100. }
  101. function fCheckRetrieveData(pmsg)
  102. {
  103. if(model.getValue(cmb_instcd.attribute("ref")).length== 0 )
  104. {
  105. if(pmsg == true)
  106. {
  107. messageBox("기관코드는" ,"I003");
  108. model.setFocus("cmb_instcd");
  109. }
  110. return false;
  111. }
  112. if(model.getValue(cmb_proddrugsetflag.attribute("ref")).length== 0 )
  113. {
  114. if(pmsg == true)
  115. {
  116. messageBox("SET구분은" ,"I003");
  117. model.setFocus("cmb_instcd");
  118. }
  119. return false;
  120. }
  121. if(model.getValue(opt_goodcd.attribute("ref")).length== 0 )
  122. {
  123. if(pmsg == true)
  124. {
  125. messageBox("물품구분" ,"I003");
  126. model.setFocus("cmb_instcd");
  127. }
  128. return false;
  129. }
  130. return true;
  131. }
  132. function fCheckSaveData()
  133. {
  134. if(model.getValue(cmb_instcd.attribute("ref")).length== 0 )
  135. {
  136. messageBox("기관코드는" ,"I003");
  137. model.setFocus("cmb_instcd");
  138. return false;
  139. }
  140. if(model.getValue(cmb_proddrugsetflag.attribute("ref")).length== 0 )
  141. {
  142. messageBox("SET구분은" ,"I003");
  143. model.setFocus("cmb_instcd");
  144. return false;
  145. }
  146. if(model.getValue(opt_goodcd.attribute("ref")).length== 0 )
  147. {
  148. messageBox("물품구분" ,"I003");
  149. model.setFocus("cmb_instcd");
  150. return false;
  151. }
  152. for(var currow = 1 ; currow < grd_setlist.rows ; currow++)
  153. {
  154. if(grd_setlist.valueMatrix(currow , grd_setlist.colRef("comdrugtoolcd")).length == 0)
  155. {
  156. messageBox(currow + " 번째 물품코드를" ,"C001");
  157. grd_setlist.row = currow;
  158. grd_setlist.col= grd_setlist.colRef("comdrugtoolcd");
  159. grd_setlist.editCell();
  160. return false;
  161. }
  162. if(grd_setlist.valueMatrix(currow , grd_setlist.colRef("consqty")) == 0)
  163. {
  164. messageBox(currow + " 번째 수량을" ,"C001");
  165. grd_setlist.row = currow;
  166. grd_setlist.col= grd_setlist.colRef("consqty");
  167. grd_setlist.editCell();
  168. return false;
  169. }
  170. if(grd_setlist.valueMatrix(currow , grd_setlist.colRef("compsgoodunit")) == 0)
  171. {
  172. messageBox(currow + " 번째 단위를" ,"C001");
  173. grd_setlist.row = currow;
  174. grd_setlist.col= grd_setlist.colRef("compsgoodunit");
  175. return false;
  176. }
  177. }
  178. return true;
  179. }
  180. ]]>
  181. </script>
  182. </xhtml:head>
  183. <xhtml:body pagewidth="1000" pageheight="530" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  184. <group id="grp_biz" scroll="auto" style="left:0px; top:0px; width:945px; height:475px; ">
  185. <group id="grp_sea" style="left:0px; top:30px; width:940px; height:35px; vertical-align:top; ">
  186. <shape id="roundrect1" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:940px; height:35px; background-color:#fffbf2; border-color:#ffd799; "/>
  187. <caption id="caption2" class="search_name" style="left:242px; top:9px; width:86px; height:17px; ">SET구분 :</caption>
  188. <button id="btn_search" class="btn1_letter2" style="left:874px; top:7px; width:56px; height:22px; ">
  189. <caption>조회</caption>
  190. <script type="javascript" ev:event="DOMActivate">
  191. <![CDATA[
  192. if(fCheckRetrieveData(false) == false)return;
  193. misfGridInit(grd_setlist);
  194. misfMsterDetailRetrieve();
  195. ]]>
  196. </script>
  197. </button>
  198. <line id="line13" class="line_4" style="x1:859px; y1:7px; x2:859px; y2:29px; border-color:#ffe4bb; border-left-style:solid; "/>
  199. <caption id="caption62" class="search_name" style="left:10px; top:9px; width:86px; height:17px; ">기관코드 :</caption>
  200. <caption id="caption1" class="search_name" style="left:451px; top:10px; width:86px; height:17px; ">물품코드 :</caption>
  201. <output id="opt_goodcd" ref="/root/send/goodcd" navindex="2" style="left:538px; top:8px; width:90px; height:19px; text-align:right; "/>
  202. <output id="opt_goodnm" ref="/root/send/goodnm" navindex="2" style="left:629px; top:8px; width:219px; height:19px; text-align:right; "/>
  203. <select1 id="cmb_proddrugsetflag" ref="/root/send/proddrugsetflag" class="combo_essential" appearance="minimal" style="left:329px; top:8px; width:116px; height:19px; ">
  204. <choices>
  205. <itemset nodeset="/root/init/proddrugsetflag">
  206. <label/>
  207. <value/>
  208. </itemset>
  209. </choices>
  210. <script type="javascript" ev:event="xforms-value-changed">
  211. <![CDATA[
  212. btn_search.dispatch("DOMActivate");
  213. ]]>
  214. </script>
  215. </select1>
  216. <select1 id="cmb_instcd" ref="/root/send/instcd" class="combo_essential" appearance="minimal" style="left:97px; top:8px; width:138px; height:19px; ">
  217. <choices>
  218. <itemset nodeset="/root/init/instcd">
  219. <label ref="cdnm"/>
  220. <value ref="cdid"/>
  221. </itemset>
  222. </choices>
  223. <script type="javascript" ev:event="xforms-value-changed">
  224. <![CDATA[
  225. btn_search.dispatch("DOMActivate");
  226. ]]>
  227. </script>
  228. </select1>
  229. <output id="opt_goodflag" ref="/root/send/goodflag" visibility="hidden" style="left:435px; top:0px; width:100px; height:19px; "/>
  230. </group>
  231. <line id="line1" class="line_1" style="x1:0px; y1:86px; x2:940px; y2:86px; "/>
  232. <datagrid id="grd_setlist" nodeset="/root/main/list/goodset/goodsetlist" caption="기관코드^제제약, SET구분^물품코드^순번^구성물품코드^구성품명^구성수량^단위^비고" colsep="^" colwidth="0, 0, 0, 39, 111, 380, 72, 85, 230" dataheight="25" extendlastcol="scroll" mergecellsfixedrows="bycolrec" rowheader="update" rowheight="25" rowsep="|" style="left:0px; top:91px; width:940px; height:382px; ">
  233. <col ref="instcd" visibility="hidden"/>
  234. <col ref="proddrugsetflag" visibility="hidden"/>
  235. <col ref="goodcd" visibility="hidden"/>
  236. <col ref="proddrugseqno"/>
  237. <col ref="comdrugtoolcd" type="inputbutton"/>
  238. <col ref="consitemnm"/>
  239. <col ref="consqty" type="input" format="#,###" style="text-align:right; "/>
  240. <col ref="compsgoodunit" type="combo">
  241. <choices>
  242. <itemset>
  243. <label/>
  244. <value/>
  245. </itemset>
  246. </choices>
  247. </col>
  248. <col ref="cmt" type="input"/>
  249. <script type="javascript" ev:event="onbuttonclick">
  250. <![CDATA[
  251. if (grd_setlist.col == grd_setlist.colRef("comdrugtoolcd")) {//구성물품코드를 눌렀을 경우
  252. model.removenode("/root/copynode");
  253. model.removenode(gvParamPath +"/SMRSD00400_/SMRSD00400_value");
  254. model.makeNode("/root/copynode");
  255. rszfOpenPopUpListByWndName(grd_setlist,"","comdrugtoolcd,consitemnm","SPRSD00190","instcd,goodflag","cmb_instcd,opt_goodflag");
  256. var cur_row = grd_setlist.row;
  257. var status = grd_setlist.valueMatrix(cur_row, grd_setlist.colRef("m"));
  258. var CSV = model.getValue(gvParamPath +"/SMRSD00400_/SMRSD00400_value");
  259. setCSVToNode("/root/copynode", CSV, "goodsetlist");
  260. fSettingGoodList("/root/copynode", "goodsetlist");
  261. }
  262. ]]>
  263. </script>
  264. <script type="javascript" ev:event="xforms-value-changed">
  265. <![CDATA[
  266. if(grd_setlist.col == grd_setlist.colRef("comdrugtoolcd") && grd_setlist.valueMatrix(grd_setlist.row, grd_setlist.colRef("consitemnm")).length> 0 ) {
  267. model.removenode("/root/copynode");
  268. model.removenode(gvParamPath +"/SMRSD00400_/SMRSD00400_value");
  269. model.makeNode("/root/copynode");
  270. rszfValidationCheck("TRRSD00191", "goodlist" , "refcond,instcd,goodflag,goodcd,goodnm,indexgb,indexnm","goodcd," + model.getValue(cmb_instcd.attribute("ref")) + "," +model.getValue(grd_setlist.nodeset + "[" + (grd_setlist.row - grd_setlist.fixedRows + 1)+ "]/goodflag") + "," + model.getValue(grd_setlist.nodeset + "[" + (grd_setlist.row - grd_setlist.fixedRows + 1)+ "]/comdrugtoolcd") + ",,,," ,"","minexch",grd_setlist,"SPRSD00190","instcd,goodflag","cmb_instcd," + model.getValue(grd_setlist.nodeset + "[" + (grd_setlist.row - grd_setlist.fixedRows + 1)+ "]/goodflag"),"Y");
  271. model.refresh();
  272. if( grd_setlist.valueMatrix(cur_row, grd_setlist.colRef("consitemnm")).length> 0)
  273. {
  274. if(model.getValue(grd_setlist.nodeset + "[" + (grd_setlist.row - grd_setlist.fixedRows + 1)+ "]/minexch") > 0) model.setValue(grd_setlist.nodeset + "[" + (grd_setlist.row - grd_setlist.fixedRows + 1)+ "]/consqty",model.getValue(grd_setlist.nodeset + "[" + (grd_setlist.row - grd_setlist.fixedRows + 1)+ "]/minexch") );
  275. else model.setValue(grd_setlist.nodeset + "[" + (grd_setlist.row - grd_setlist.fixedRows + 1)+ "]/consqty","1");
  276. model.setValue(grd_setlist.nodeset + "[" + (grd_setlist.row - grd_setlist.fixedRows + 1) + "]/comdrugtoolcd" , model.getValue("/root/init/main/goodlist/goodcd"));
  277. model.setValue(grd_setlist.nodeset + "[" + (grd_setlist.row - grd_setlist.fixedRows + 1) + "]/consitemnm" , model.getValue("/root/init/main/goodlist/goodnm"));
  278. model.setValue(grd_setlist.nodeset + "[" + (grd_setlist.row - grd_setlist.fixedRows + 1) + "]/compsgoodunit" , model.getValue("/root/init/main/goodlist/purcunit"));
  279. }
  280. model.refresh();
  281. var cur_row = grd_setlist.row;
  282. var status = grd_setlist.valueMatrix(cur_row, grd_setlist.colRef("m"));
  283. var CSV = model.getValue(gvParamPath +"/SMRSD00400_/SMRSD00400_value");
  284. if(CSV.length == 0 && grd_setlist.valueMatrix(cur_row, grd_setlist.colRef("consitemnm")).length == 0)
  285. {
  286. model.setValue(grd_setlist.nodeset + "[" + (grd_setlist.row - grd_setlist.fixedRows + 1) + "]/comdrugtoolcd" , "");
  287. model.setValue(grd_setlist.nodeset + "[" + (grd_setlist.row - grd_setlist.fixedRows + 1) + "]/consitemnm" , "");
  288. model.setValue(grd_setlist.nodeset + "[" + (grd_setlist.row - grd_setlist.fixedRows + 1) + "]/compsgoodunit" , "");
  289. model.setValue(grd_setlist.nodeset + "[" + (grd_setlist.row - grd_setlist.fixedRows + 1) + "]/consqty" , "");
  290. grd_setlist.col = grd_setlist.colRef("comdrugtoolcd");
  291. grd_setlist.editCell();
  292. }
  293. if(CSV.length > 0)
  294. {
  295. model.setValue(grd_setlist.nodeset + "[" + (grd_setlist.row - grd_setlist.fixedRows + 1)+ "]/comdrugtoolcd","");
  296. setCSVToNode("/root/copynode", CSV, "goodsetlist");
  297. fSettingGoodList("/root/copynode", "goodsetlist");
  298. }
  299. }
  300. ]]>
  301. </script>
  302. <script type="javascript" ev:event="onkeydown">
  303. <![CDATA[
  304. if(event.keyCode == 9)
  305. {
  306. if(event.shiftKey)
  307. {
  308. if(grd_setlist.colAttribute(grd_setlist.col + 1, "type").indexOf ("input") > -1)
  309. {
  310. for(curcol = grd_setlist.col -1 ; curcol > -1 ; curcol--)
  311. {
  312. if(grd_setlist.colAttribute(curcol, "type").indexOf ("input") > -1)
  313. {
  314. grd_setlist.col = curcol;
  315. grd_setlist.editCell();
  316. return;
  317. }
  318. }
  319. }
  320. }
  321. else
  322. {
  323. if(grd_setlist.colAttribute(grd_setlist.col, "type").indexOf ("input") == -1)
  324. {
  325. if(grd_setlist.col - 1 == grd_setlist.colRef("comdrugtoolcd") && grd_setlist.valueMatrix(grd_setlist.row, grd_setlist.col - 1).length == 0)
  326. {
  327. grd_setlist.col = grd_setlist.colRef("comdrugtoolcd");
  328. grd_setlist.editCell();
  329. return;
  330. }
  331. for(curcol = grd_setlist.col ; curcol <grd_setlist.cols ; curcol++)
  332. {
  333. if(grd_setlist.colAttribute(curcol, "type").indexOf ("input") > -1)
  334. {
  335. grd_setlist.col = curcol;
  336. grd_setlist.editCell();
  337. return;
  338. }
  339. }
  340. }
  341. }
  342. }
  343. ]]>
  344. </script>
  345. </datagrid>
  346. <button id="button2" class="btn2_letter3" style="left:887px; top:66px; width:53px; height:19px; ">
  347. <caption>행삭제</caption>
  348. <script type="javascript" ev:event="DOMActivate">
  349. <![CDATA[
  350. misfGridIUD(grd_setlist, "D");
  351. ]]>
  352. </script>
  353. </button>
  354. <button id="button6" class="btn2_letter3" style="left:832px; top:66px; width:53px; height:19px; ">
  355. <caption>행추가</caption>
  356. <script type="javascript" ev:event="DOMActivate">
  357. <![CDATA[
  358. if(fCheckRetrieveData(true) == false)return;
  359. misfGridIUD(grd_setlist, "A");
  360. grd_setlist.row = grd_setlist.rows -grd_setlist.fixedRows ;
  361. fDefaultSetting(grd_setlist.row);
  362. grd_setlist.col = grd_setlist.colRef("comdrugtoolcd");
  363. grd_setlist.editCell();
  364. ]]>
  365. </script>
  366. </button>
  367. <caption id="caption4" class="tit_2" style="left:5px; top:71px; width:100px; height:13px; ">Set 제원내역</caption>
  368. <button id="btn_excel" class="btn2_letter2" style="left:788px; top:66px; width:42px; height:19px; ">
  369. <caption>엑셀</caption>
  370. <script type="javascript" ev:event="DOMActivate">
  371. <![CDATA[
  372. misfSaveExcel(grd_setlist);
  373. ]]>
  374. </script>
  375. </button>
  376. <group id="group4" style="left:2px; top:3px; width:938px; height:27px; ">
  377. <line id="line17" class="line_2" style="x1:0px; y1:25px; x2:933px; y2:25px; "/>
  378. <button id="btn_save" class="btn4_letter2" style="left:814px; top:3px; width:56px; height:22px; ">
  379. <caption>저장</caption>
  380. <script type="javascript" ev:event="DOMActivate">
  381. <![CDATA[
  382. if(fCheckSaveData() == false)return;
  383. misfSave("TXRSC00210");
  384. btn_search.dispatch("DOMActivate");
  385. ]]>
  386. </script>
  387. </button>
  388. <button id="btn_clear" class="btn4_letter3" style="left:870px; top:3px; width:68px; height:22px; ">
  389. <caption>초기화</caption>
  390. <script type="javascript" ev:event="DOMActivate">
  391. <![CDATA[
  392. fInitialize();
  393. ]]>
  394. </script>
  395. </button>
  396. <button id="btn_scrnmove" class="btn3_letter4" visibility="hidden" style="left:56px; top:3px; width:80px; height:22px; ">
  397. <caption>화면이동</caption>
  398. </button>
  399. <button id="btn_prt" class="btn6_letter2" visibility="hidden" style="left:0px; top:3px; width:56px; height:22px; ">
  400. <caption>출력</caption>
  401. </button>
  402. </group>
  403. </group>
  404. </xhtml:body>
  405. </xhtml:html>