SMADT10320_선불출조회.xrw 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  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>선불출조회</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <cond>
  11. <srchfromdd/>
  12. <srchtodd/>
  13. <pid/>
  14. <drugno/>
  15. <prcpdd/>
  16. <hngnm/>
  17. </cond>
  18. <sumdeptlist>
  19. <info/>
  20. </sumdeptlist>
  21. <forminfo>
  22. <info>
  23. <sumdeptcd/>
  24. <sumdeptnm/>
  25. <sumdeptflag/>
  26. <prcpexecdeptcd/>
  27. <prcpexecdeptnm/>
  28. <useyn>Y</useyn>
  29. <status>I</status>
  30. </info>
  31. </forminfo>
  32. <patinfo/>
  33. </main>
  34. <init>
  35. <tmp/>
  36. <deptflag/>
  37. <deptinfo/>
  38. </init>
  39. <send>
  40. <reqdata/>
  41. <cond/>
  42. <deptinfo/>
  43. </send>
  44. <temp>
  45. <initsrch/>
  46. </temp>
  47. </root>
  48. </instance>
  49. <script type="javascript" ev:event="xforms-ready">
  50. <![CDATA[
  51. fInitialize();
  52. ]]>
  53. </script>
  54. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  55. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  56. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  57. <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
  58. <script type="javascript">
  59. <![CDATA[
  60. var ref = "/root/main/sumdeptlist/info";
  61. var saveFlag = "";
  62. function fInitialize(){
  63. //오늘 날짜로 초기화 하는 부분.(조회일자를 default로 오늘 날짜로 선택함)
  64. var currDate;
  65. currDate = getCurrentDate();
  66. var addDy;
  67. addDy = currDate.toDate().getAddDate(-7,"D");
  68. addDy = addDy.getDateFormat("YYYYMMDD");
  69. model.setValue("/root/main/cond/srchfromdd", addDy );
  70. model.setValue("/root/main/cond/srchtodd", getCurrentDate() );
  71. //부서코드 조회
  72. //zbcfGetDeptCodeList(getUserInfo("dutplceinstcd"), "", "", "/root/init/deptinfo"); //부서 콤보조회
  73. fGetSumDeptList();
  74. }
  75. function fGetSumDeptList(){
  76. if( !isRequiredControls("ipt_searchfromdd","ipt_searchtodd") ){
  77. return;
  78. }
  79. model.removenode("/root/send/cond");
  80. model.makeNode("/root/send/cond");
  81. model.copyNode("/root/send/cond", "/root/main/cond");
  82. submit("TRADT10341", true);
  83. }
  84. /* 저장한다. */
  85. function fSaveInfo(flag, qestyn){
  86. var saveDataNodes = instance1.selectNodes(ref + "[status!='']");
  87. if( saveDataNodes.length <= 0 ){
  88. messageBox( "저장할 데이터가", "I004"); //없습니다
  89. return;
  90. }
  91. model.removeNodeset("root/send/savedata");
  92. model.makeNode("root/send/savedata");
  93. copyNodeListType("root/send/savedata", "/root/main/sumdeptlist/info[status!='']", "replace", model, model);
  94. //model.setValue("root/send/savedata", grd_sumdeptlist.getUpdateData());
  95. if( submit("TXADT10334", false) ){
  96. grd_sumdeptlist.clearStatus();
  97. grd_sumdeptlist.refresh();
  98. return true;
  99. }else{
  100. return false;
  101. }
  102. }
  103. function fAddRow(){
  104. grd_sumdeptlist.addRow();
  105. //copyNodeType("/root/main/sumdeptlist", "/root/main/forminfo/info", "after", model, model);
  106. var iRows = grd_sumdeptlist.rows-1;
  107. model.setValue(ref + "[" + iRows + "]/status", "I");
  108. model.setValue(ref + "[" + iRows + "]/useyn", "Y");
  109. }
  110. function fDelRow(){
  111. var selectedRows = grd_sumdeptlist.selectedRows;
  112. var iStatus = "";
  113. for (var i=selectedRows-1; i>=0; i--) {
  114. iStatus = rowStatus = model.getValue( ref + "[" + grd_sumdeptlist.selectedrow(i) + "]/status" );
  115. if( iStatus == "I" ){
  116. //model.removeNodeset(ref + "[" + grd_sumdeptlist.selectedrow(i) +"]");
  117. grd_sumdeptlist.deleteRow(grd_sumdeptlist.selectedrow(i));
  118. }else{
  119. if( iStatus == "D" ){
  120. model.setValue ( ref + "[" + grd_sumdeptlist.selectedrow(i) + "]/status", "" );
  121. grd_sumdeptlist.rowStatus(grd_sumdeptlist.selectedrow(i)) = 0; //delete status
  122. }else{
  123. model.setValue ( ref + "[" + grd_sumdeptlist.selectedrow(i) + "]/status", "D" );
  124. grd_sumdeptlist.rowStatus(grd_sumdeptlist.selectedrow(i)) = 4; //delete status
  125. }
  126. }
  127. }
  128. }
  129. function fPatSrch(s_val, flag){
  130. if(flag == "1"){
  131. model.makeValue("/root/temp/pid", s_val);
  132. } else if(flag == "2"){
  133. model.makeValue("/root/temp/hngnm", s_val);
  134. }
  135. model.makeValue("/root/temp/srchcond", flag);
  136. model.makeValue("/root/temp/autoflag","Y"); // 1건인경우 자동으로닫힘
  137. model.resetInstanceNode("/root/main/patinfo/patinfolist");
  138. modal("SPPMC02500", 1,10, 10, "SPPMC02500", "/root/temp", "/root/send");
  139. model.refresh();
  140. }
  141. ]]>
  142. </script>
  143. <submission id="TRADT10341" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/sumdeptlist"/>
  144. <script type="javascript" ev:event="xforms-model-construct-done">
  145. <![CDATA[
  146. grd_sumdeptlist.explorerbar = "sortshow";
  147. ]]>
  148. </script>
  149. </model>
  150. </xhtml:head>
  151. <xhtml:body guideline="1,1195;2,783;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  152. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  153. <caption id="cap_title" class="tit_1" style="left:0px; top:0px; width:257px; height:14px; ">선불출조회</caption>
  154. </group>
  155. <group id="group5" class="datagrid2" scroll="auto" style="left:0px; top:13px; width:1195px; height:771px; ">
  156. <group id="grp_sea" style="left:0px; top:10px; width:1195px; height:35px; vertical-align:top; ">
  157. <shape id="roundrect1" class="roundrect_search" appearance="roundrect" style="left:0px; top:0px; width:1195px; height:35px; "/>
  158. <button id="button1" class="btn1_letter2" navindex="6" style="left:1041px; top:7px; width:56px; height:22px; ">
  159. <caption>조회</caption>
  160. <script type="javascript" ev:event="DOMActivate">
  161. <![CDATA[
  162. fGetSumDeptList();
  163. ]]>
  164. </script>
  165. </button>
  166. <line id="line13" class="line_4" style="x1:1020px; y1:7px; x2:1020px; y2:29px; "/>
  167. <button id="button3" class="btn1_letter4" style="left:1102px; top:7px; width:80px; height:22px; ">
  168. <caption>엑셀저장</caption>
  169. <script type="javascript" ev:event="DOMActivate">
  170. <![CDATA[
  171. var fileName = window.fileDialog("save", ",", false, "선불출리스트", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  172. if (fileName != "") grd_sumdeptlist.saveExcel(fileName, "선불출리스트", false, false, "", "", false);
  173. ]]>
  174. </script>
  175. </button>
  176. <caption id="caption1" class="search_name" style="left:785px; top:10px; width:86px; height:17px; ">처방일자 :</caption>
  177. <caption id="caption4" style="left:194px; top:10px; width:15px; height:15px; text-align:center; ">-</caption>
  178. <input id="ipt_searchtodd" ref="/root/main/cond/srchtodd" class="input_s_essential" navindex="2" inputtype="date" style="left:209px; top:9px; width:90px; height:19px; "/>
  179. <input id="ipt_searchfromdd" ref="/root/main/cond/srchfromdd" class="input_s_essential" navindex="1" inputtype="date" style="left:104px; top:9px; width:90px; height:19px; "/>
  180. <caption id="caption2" class="search_name" style="left:570px; top:10px; width:86px; height:17px; ">투약번호 :</caption>
  181. <input id="input2" ref="/root/main/cond/prcpdd" class="input_search" navindex="2" inputtype="date" style="left:875px; top:10px; width:90px; height:19px; "/>
  182. <input id="input3" ref="/root/main/cond/drugno" class="input_search" navindex="3" style="left:660px; top:10px; width:90px; height:19px; "/>
  183. <caption id="cap_searchfromdd" class="search_name" visibility="hidden" style="left:0px; top:5px; width:20px; height:17px; ">집계시작일자</caption>
  184. <caption id="cap_srchdd" class="search_name" style="left:15px; top:10px; width:99px; height:17px; ">집계일자 :</caption>
  185. <caption id="cap_searchtodd" class="search_name" visibility="hidden" style="left:0px; top:15px; width:30px; height:17px; ">집계종료일자</caption>
  186. <caption id="cap_srchpat" class="search_name" style="left:335px; top:10px; width:86px; height:17px; ">환자번호 :</caption>
  187. <input id="ipt_srchpat" ref="/root/main/cond/pid" class="input_search" navindex="3" style="left:425px; top:10px; width:90px; height:19px; ">
  188. <script type="javascript" ev:event="onkeypress">
  189. <![CDATA[
  190. inputEnterKey("btn_srchpat", "DOMActivate");
  191. ]]>
  192. </script>
  193. </input>
  194. <button id="btn_srchpat" class="icon_search" style="left:520px; top:12px; width:16px; height:16px; ">
  195. <caption/>
  196. <script type="javascript" ev:event="DOMActivate">
  197. <![CDATA[
  198. model.makeNode("/root/main/patinfo/patinfolist");
  199. var pid = model.getValue("/root/main/cond/pid");
  200. var hngnm = model.getValue("/root/main/cond/hngnm");
  201. if((pid !="")){
  202. fPatSrch(pid, "1");
  203. } else {
  204. modal("SPPMC02500")
  205. }
  206. model.setValue("/root/main/cond/pid", model.getValue("/root/main/patinfo/patinfolist/pid"));
  207. model.setValue("/root/main/cond/hngnm", model.getValue("/root/main/patinfo/patinfolist/hngnm"));
  208. model.refresh();
  209. ]]>
  210. </script>
  211. </button>
  212. </group>
  213. <line id="line2" class="line_1" style="x1:0px; y1:75px; x2:1195px; y2:75px; "/>
  214. <line id="line1" class="line_3" style="x1:0px; y1:764px; x2:1195px; y2:764px; "/>
  215. <datagrid id="grd_sumdeptlist" nodeset="/root/main/sumdeptlist/info" class="datagrid1" caption="집계일시^집계부서코드^집계부서명^투약일자^투약번호^투약순번^등록번호^내원구분^처방일자^처방코드^처방명^용량^단위^수량^단위^횟수^일수^집계횟수^반환수량^반환일자^반환일시^prcpno^prcphistno^execprcpno^execprcpuniqno" colsep="^" colwidth="80, 80, 125, 80, 90, 70, 85, 55, 80, 85, 110, 45, 50, 45, 50, 35, 35, 55, 62, 80, 56, 10, 10, 10, 10" ellipsis="true" rowheader="update" rowsep="|" tooltip="true" style="left:0px; top:80px; width:1195px; height:683px; ">
  216. <col ref="sumdt" type="output" format="yyyy-mm-dd" style="text-align:center; "/>
  217. <col ref="sumdeptcd" type="output" style="text-align:center; "/>
  218. <col ref="sumdeptnm" type="output"/>
  219. <col ref="drugdd" type="output" format="yyyy-mm-dd" style="text-align:center; "/>
  220. <col ref="drugno" style="text-align:center; "/>
  221. <col checkvalue="Y,N" ref="drugseqno" type="output"/>
  222. <col ref="pid"/>
  223. <col ref="ordddioflag" style="text-align:center; "/>
  224. <col ref="prcpdd" format="yyyy-mm-dd" style="text-align:center; "/>
  225. <col ref="prcpcd"/>
  226. <col ref="prcpnm"/>
  227. <col ref="prcpvol" style="text-align:right; "/>
  228. <col ref="prcpvolunit"/>
  229. <col ref="prcpqty" style="text-align:right; "/>
  230. <col ref="prcpqtyunit"/>
  231. <col ref="prcptims" style="text-align:right; "/>
  232. <col ref="prcpdayno" style="text-align:right; "/>
  233. <col ref="sumqty" style="text-align:right; "/>
  234. <col ref="rtnqty" style="text-align:right; "/>
  235. <col ref="rtndd" format="yyyy-mm-dd" style="text-align:center; "/>
  236. <col ref="rtntm" format="hh:nn:ss" style="text-align:center; "/>
  237. <col ref="prcpno" visibility="hidden"/>
  238. <col ref="prcphistno" visibility="hidden"/>
  239. <col ref="execprcpno" visibility="hidden"/>
  240. <col ref="execprcpuniqno" visibility="hidden"/>
  241. <script type="javascript" ev:event="xforms-value-changed">
  242. <![CDATA[
  243. var iRow = grd_sumdeptlist.row;
  244. var iCol = grd_sumdeptlist.col; //12~13 신청, 14~15 수행
  245. var rowStatus = "";
  246. if( iRow > 0 && iRow <= grd_sumdeptlist.rows ){
  247. rowStatus = model.getValue( ref + "[" + iRow + "]/status" );
  248. //rowStatus = grd_sumdeptlist.rowStatus(iRow);
  249. if( rowStatus == "I" ){
  250. model.setValue( ref + "[" + iRow + "]/status", "I" );
  251. grd_sumdeptlist.rowStatus(iRow) = 1; //insert status
  252. }else{
  253. model.setValue( ref + "[" + iRow + "]/status", "U" );
  254. grd_sumdeptlist.rowStatus(iRow) = 2; //delete status
  255. }
  256. }
  257. ]]>
  258. </script>
  259. <script type="javascript" ev:event="onaftersort">
  260. <![CDATA[
  261. grd_sumdeptlist.gridToInstance();
  262. ]]>
  263. </script>
  264. <script type="javascript" ev:event="onendedit">
  265. <![CDATA[
  266. var iRow = grd_sumdeptlist.row;
  267. var iCol = grd_sumdeptlist.col; //12~13 신청, 14~15 수행
  268. var rowStatus = "";
  269. var inputSumdeptcd = "";
  270. var inputPrcpexecdeptcd = "";
  271. var inpitDeptCd = "";
  272. var iStatus = "";
  273. if( iRow > 0 && iRow <= grd_sumdeptlist.rows ){
  274. iStatus = model.getValue( ref + "[" + iRow + "]/status" );
  275. /*
  276. if( iCol == grd_sumdeptlist.colRef("sumdeptcd") ){
  277. inputSumdeptcd = model.getValue( ref + "[" + iRow + "]/sumdeptcd" );
  278. inpitDeptCd = inputSumdeptcd;
  279. }else
  280. */
  281. if( iCol == grd_sumdeptlist.colRef("prcpexecdeptcd") ){
  282. inputPrcpexecdeptcd = model.getValue( ref + "[" + iRow + "]/prcpexecdeptcd" );
  283. inpitDeptCd = inputPrcpexecdeptcd;
  284. }
  285. if( !isNull(inpitDeptCd) ){
  286. var deptList = instance1.selectNodes("/root/init/deptinfo/dept");
  287. var node = null;
  288. var iDeptNode = null;
  289. var iDeptCd = "";
  290. var iDeptNm = "";
  291. for(var i=0; i<deptList.length; i++ ){
  292. node = deptList.item(i);
  293. iDeptNode = node.selectSingleNode("deptcd");
  294. if( iDeptNode != null ){
  295. iDeptCd = iDeptNode.text;
  296. if( iDeptCd == inpitDeptCd ){
  297. iDeptNm = node.selectSingleNode("depthngnm").text;
  298. break;
  299. }
  300. }
  301. }
  302. /*
  303. if( !isNull(inputSumdeptcd) ){
  304. if( !isNull(iDeptNm) )
  305. model.setValue(ref + "[" + iRow + "]/sumdeptnm", iDeptNm);
  306. else
  307. model.setValue(ref + "[" + iRow + "]/sumdeptnm", "");
  308. }
  309. */
  310. if( !isNull(inputPrcpexecdeptcd) ){
  311. if( !isNull(iDeptNm) )
  312. model.setValue(ref + "[" + iRow + "]/prcpexecdeptnm", iDeptNm);
  313. else
  314. model.setValue(ref + "[" + iRow + "]/prcpexecdeptnm", "");
  315. }
  316. }
  317. //grd_sumdeptlist.refresh();
  318. }
  319. ]]>
  320. </script>
  321. </datagrid>
  322. <caption id="caption19" class="tit_2" style="left:5px; top:59px; width:100px; height:14px; ">선불출 리스트</caption>
  323. </group>
  324. </xhtml:body>
  325. </xhtml:html>