SMRSM00600_부서별물품별청구현황조회.xrw 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
  3. <xhtml:html xmlns:ex="http://www.comsquare.co.kr/xforms/excel" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:my="http://www.comsquare.co.kr/example" 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" xmlns:cs="http://www.comsquare.co.kr/xforms">
  4. <xhtml:head>
  5. <xhtml:title>미등록물질 청구 부서 조회</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <condition>
  11. <fromdd/>
  12. <todd/>
  13. </condition>
  14. <goodlist>
  15. <reqdeptcd/>
  16. <reqdeptnm/>
  17. <goodcd/>
  18. <goodnm/>
  19. <goodspec/>
  20. <prodcmpynm/>
  21. <maincustlastsuplplcenm/>
  22. </goodlist>
  23. </main>
  24. <send/>
  25. <init/>
  26. <hidden>
  27. </hidden>
  28. <temp>
  29. </temp>
  30. </root>
  31. </instance>
  32. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  33. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  34. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  35. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  36. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  37. <script type="javascript" src="../../../mis/miscommonweb/js/RAC001.js"/>
  38. <script type="javascript" src="../../../com/zipcodeweb/js/ZBP001.js"/>
  39. <script type="javascript" src="../../../mis/miscommonweb/js/RSZ001.js"/>
  40. <!--script type="javascript" src="../../../mis/purcbaseweb/js/SMRSC05302.js"/-->
  41. <script type="javascript" ev:event="xforms-ready">
  42. <![CDATA[
  43. fOpenForm();
  44. ]]>
  45. </script>
  46. <script type="javascript">
  47. <![CDATA[
  48. //========================================================================================
  49. //화면 로드시 초기화 함수
  50. //========================================================================================
  51. function fOpenForm() {
  52. //model.removenode("/root/main/goodlist");
  53. //model.removenode("/root/main/deptlist");
  54. //model.refresh();
  55. misfGridInit(grd_goodlist);
  56. model.setValue("/root/main/condition/fromdd" , getCurrentDate().toDate().getAddDate(-1, "M").getDateFormat("YYYYMMDD") ); //기간 설정 //getCurrentDate() //.substr(0,6)); //.toDate().getAddDate(-1, "D").getDateFormat("YYYYMMDD")
  57. model.setValue("/root/main/condition/todd" , getCurrentDate() ); //기간 설정 //.substr(0,6));
  58. model.refresh();
  59. //fGetGoodList();//코드 목록 조회
  60. // if(model.getValue("/root/main/goodlist[1]/matrcd") != "") {
  61. // grd_goodlist.isSelected(1) = true;
  62. // fGetGoodInfo(1);
  63. // }else {
  64. // fCopyInstance();
  65. // }
  66. }
  67. //========================================================================================
  68. //인스턴스 Copy 함수
  69. //========================================================================================
  70. function fCopyInstance() {
  71. //----model.copyNode("/root/hidden/goodinfo", "/root/main/goodinfo");
  72. model.refresh();
  73. }
  74. //========================================================================================
  75. //코드 목록 조회 함수
  76. //========================================================================================
  77. function fGetGoodList() {
  78. misfGridInit(grd_goodlist);
  79. //model.resetInstanceNode("/root/main/goodinfo");//조회시 기존 데이터 삭제
  80. model.copyNode("/root/send", "/root/main/condition");
  81. submit("TRRSM00601");
  82. model.refresh();
  83. }
  84. //========================================================================================
  85. //목록 -> 상세내역
  86. //========================================================================================
  87. function fGetGoodInfo(pRow) {
  88. if ( pRow > 0 ) {
  89. model.copyNode("/root/main/goodinfo", "/root/main/goodlist[" + pRow + "]");
  90. //model.refresh();
  91. ipt_matrnm.refresh();
  92. opt_goodcd.refresh();
  93. opt_goodnm.refresh();
  94. opt_goodspec.refresh();
  95. ipt_prodcmpycd.refresh();
  96. opt_prodcmpynm.refresh();
  97. ipt_maincustlastsuplplce.refresh();
  98. opt_maincustlastsuplplcenm.refresh();
  99. ipt_frgstdd.refresh();
  100. ta_cmt.refresh();
  101. }
  102. }
  103. //========================================================================================
  104. //상세내역 -> 목록
  105. //========================================================================================
  106. function fPutGoodInfo() {
  107. if ( true ) {
  108. var iRow = grd_goodlist.findRow(opt_goodcd.value, 1, grd_goodlist.colRef("goodcd"), true, true);
  109. //alert(iRow);
  110. model.setValue(grd_goodlist.nodeset + "[" + iRow + "]/matrnm", ipt_matrnm.value.getTrim());
  111. model.setValue(grd_goodlist.nodeset + "[" + iRow + "]/prodcmpycd", ipt_prodcmpycd.value.getTrim());
  112. model.setValue(grd_goodlist.nodeset + "[" + iRow + "]/prodcmpynm", opt_prodcmpynm.value);
  113. model.setValue(grd_goodlist.nodeset + "[" + iRow + "]/maincustlastsuplplce", ipt_maincustlastsuplplce.value.getTrim());
  114. model.setValue(grd_goodlist.nodeset + "[" + iRow + "]/maincustlastsuplplcenm", opt_maincustlastsuplplcenm.value);
  115. model.setValue(grd_goodlist.nodeset + "[" + iRow + "]/frgstdd", ipt_frgstdd.value);
  116. model.setValue(grd_goodlist.nodeset + "[" + iRow + "]/cmt", ta_cmt.value);
  117. //model.refresh();
  118. grd_goodlist.refresh();
  119. }
  120. }
  121. //========================================================================================
  122. //신규 버턴 클릭시 인스턴스 초기화
  123. //========================================================================================
  124. function fSetMatrInfo() {
  125. ipt_matrcd.disabled = false;
  126. // 아래 두줄로 변경
  127. //model.resetInstanceNode("/root/main/goodinfo");
  128. model.resetInstanceNode("/root/main/goodinfo");
  129. //model.resetInstanceNode("/root/main/goodinfo/deptlist");
  130. misfGridInit(grd_deptlist);
  131. //return;
  132. model.setFocus("ipt_matrcd");
  133. model.setValue("/root/main/goodinfo/status", "i");
  134. model.setValue("/root/main/goodinfo/msdsflag", "Y");
  135. // 서식에서 징수의무자 상호(법인명)으로 쓰임. 기본값으로 경북대학교병원장 셋팅.
  136. //model.setValue("/root/main/goodinfo/prntnm1" , "경북대학교병원장");
  137. fCopyInstance();
  138. }
  139. //========================================================================================
  140. // 저장버튼 클릭시 저장 수행 함수
  141. //========================================================================================
  142. function fClickSaveBtn() {
  143. var iCheckCount = 0;
  144. for(var i = 1; i < grd_goodlist.rows; i++) {
  145. if(grd_goodlist.valueMatrix(i, grd_goodlist.colRef("checkflag")) == "Y") {
  146. iCheckCount = 1;
  147. break;
  148. }
  149. }
  150. if(iCheckCount == 0) {
  151. messageBox("선택된 물품이 없습니다. 먼저 코드 등록할 물품을 선택하십시요. ", "E999", "");
  152. return false;
  153. }
  154. if(opt_goodcd.value != "") {
  155. fPutGoodInfo();
  156. }
  157. if(!fIsValidForSave())//저장전 유효성 검사
  158. return;
  159. //model.resetInstanceNode("/root/send");
  160. //model.makeNode("root/send/detail");
  161. //model.copyNode("/root/send", "/root/main/goodinfo");
  162. model.makeValue("/root/send/goodlist", grd_goodlist.getUpdateData());
  163. //return;
  164. if(submit("TXRSM00501")) {
  165. btn_search.dispatch("DOMActivate");
  166. //fGetGoodList();//코드 목록 재조회
  167. //model.copyNode("/root/send", "/root/main/goodinfo");
  168. //submit("TRRSM00102"); //상세내역 및 조사표 재조회
  169. //model.setValue("/root/main/goodinfo/status", "-");
  170. //grd_deptlist.clearStatus();
  171. //--model.makeNode("/root/hidden/goodinfo");
  172. //model.makeNode("/root/hidden/goodinfo");
  173. //fCopyInstance();
  174. //ipt_matrcd.disabled = true;
  175. }
  176. }
  177. //========================================================================================
  178. //저장전 유효성 검사
  179. //========================================================================================
  180. function fIsValidForSave() {
  181. //필수 입력 항목 체크(공통 ftHelper.js)
  182. //if(!isRequiredControls("ipt_matrcd","ipt_matrnm")) { //,"ipt_prodcmpycd"
  183. // return false;
  184. //}
  185. //var sStatus = model.getValue("/root/main/goodinfo/status");
  186. //var sNewData = fGetNodeText("/root/main/goodinfo");
  187. //var sOldData = fGetNodeText("/root/hidden/goodinfo");
  188. for(var i = 1; i < grd_goodlist.rows; i++) {
  189. if(grd_goodlist.valueMatrix(i, grd_goodlist.colRef("checkflag")) == "N") continue;
  190. if(grd_goodlist.valueMatrix(i, grd_goodlist.colRef("matrnm")) == "" ){
  191. messageBox("물품코드 " + grd_goodlist.valueMatrix(i, grd_goodlist.colRef("goodcd")) + " 의 물질명이 등록되지 않았습니다. ", "E999", "");
  192. return false;
  193. }
  194. if(grd_goodlist.valueMatrix(i, grd_goodlist.colRef("prodcmpycd")) == "" ){
  195. messageBox("물품코드 " + grd_goodlist.valueMatrix(i, grd_goodlist.colRef("goodcd")) + " 의 제조회사가 등록되지 않았습니다. ", "E999", "");
  196. return false;
  197. }
  198. }
  199. return true;
  200. /*
  201. //상세내역에 변경된 정보가 있는지 확인
  202. if(sNewData != sOldData && sStatus == "-") { // 데이터 수정일 경우
  203. model.setValue("/root/main/goodinfo/status","u");
  204. return true;
  205. } else if(sNewData == sOldData && sStatus == "-" ) { //변경된 값이 없을경우
  206. //messageBox("변경된 정보가 ", "I004");
  207. //return false;
  208. return true;
  209. }else if(sStatus == "i") { //데이터 입력일 경우
  210. return true;
  211. }else if(sStatus = "d") { //데이터 삭제일 경우
  212. return true;
  213. }
  214. */
  215. }
  216. //========================================================================================
  217. //엑셀입력(excel file을 그리드에 입력)
  218. //========================================================================================
  219. function fInputExcel(pGrid) {
  220. var fileName = window.fileDialog("open", ",", false, "", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  221. if(fileName != "") {
  222. pGrid.loadExcel(fileName, 1, true);
  223. pGrid.deleteRow(1);
  224. pGrid.refresh();
  225. }
  226. }
  227. //========================================================================================
  228. //동일한 Depth의 인스턴스의 값을 스트링형으로 변환
  229. //========================================================================================
  230. function fGetNodeText(pNode) {
  231. var trgNdoe = instance1.selectSingleNode(pNode);
  232. var trgNdoeList = trgNdoe.childNodes;
  233. var childNode;
  234. var allText = "";
  235. while( childNode = trgNdoeList.nextNode() ) {
  236. allText += childNode.text;
  237. }
  238. return allText;
  239. }
  240. function fOpenPopupDeptHelp(pControl, pInstance)
  241. {
  242. misfOpenPopUpList("02", pControl, "", pInstance);
  243. model.refresh();
  244. }
  245. ]]>
  246. </script>
  247. <submission id="TRRSM00601" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/goodlist"/>
  248. </model>
  249. </xhtml:head>
  250. <xhtml:body guideline="1,1193;1,1406;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  251. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  252. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:331px; height:14px; ">미등록물질 청구 부서 조회</caption>
  253. <caption id="caption4" class="patient_text_black" style="left:922px; top:0px; width:272px; "/>
  254. </group>
  255. <group id="group3" scroll="auto" style="left:0px; top:40; width:1195px; height:744px; ">
  256. <group id="grp_sea" style="left:0px; top:10px; width:1194; height:35px; vertical-align:top; ">
  257. <shape id="roundrect1" class="roundrect_search" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:1194; height:35px; background-color:#fffbf2; border-color:#ffd799; "/>
  258. <caption id="caption7" class="search_name" style="left:71px; top:9px; width:79px; height:17px; ">청구일자</caption>
  259. <line id="line5" class="line_4" style="x1:380px; y1:6px; x2:380px; y2:28px; border-color:#ffe4bb; border-left-style:solid; "/>
  260. <button id="btn_search" class="btn1_letter2" navindex="4" style="left:403px; top:7px; width:56px; height:22px; text-align:left; ">
  261. <caption>조회</caption>
  262. <script type="javascript" ev:event="DOMActivate">
  263. <![CDATA[
  264. fGetGoodList();
  265. ]]>
  266. </script>
  267. </button>
  268. <caption id="caption1" style="left:247px; top:11px; width:11px; height:15px; ">~</caption>
  269. <input id="ipt_fromdd" ref="/root/main/condition/fromdd" class="input_default" navindex="1" inputtype="date" format="yyyy-mm-dd" style="left:154px; top:8px; width:91px; height:19px; text-align:center; "/>
  270. <input id="ipt_todd" ref="/root/main/condition/todd" class="input_default" navindex="1" inputtype="date" format="yyyy-mm-dd" style="left:261px; top:8px; width:91px; height:19px; text-align:center; "/>
  271. </group>
  272. <line id="line3" class="line_1" style="x1:0px; y1:75px; x2:1193; y2:75px; "/>
  273. <caption id="caption21" class="tit_2" style="left:5px; top:60px; width:245px; height:14px; ">부서별 미등록된 물류 MSDS물품 목록</caption>
  274. <datagrid id="grd_goodlist" nodeset="/root/main/goodlist" caption="부서코드^청구부서명^물품코드^물품명^규격^제조회사^주거래처" colsep="^" colwidth="79, 202, 77, 313, 181, 139, 138" explorerbar="sortshow" mergecells="byrestriccol" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="16" rowsep="|" navindex="5" style="left:0px; top:80px; width:1193px; height:600px; ">
  275. <col ref="reqdeptcd" style="text-align:center; vertical-align:middle; "/>
  276. <col ref="reqdeptnm" style="vertical-align:middle; "/>
  277. <col class="text_center" ref="goodcd" style="text-align:center; "/>
  278. <col ref="goodnm"/>
  279. <col ref="goodspec"/>
  280. <col ref="prodcmpynm"/>
  281. <col ref="maincustlastsuplplcenm"/>
  282. <script type="javascript" ev:event="onaftersort">
  283. <![CDATA[
  284. grd_goodlist.gridToInstance();
  285. ]]>
  286. </script>
  287. </datagrid>
  288. <caption id="caption3" style="left:5px; top:685px; width:1065px; height:20px; color:#ff0000; ">※ 1. 소모품 청구건 만을 대상으로 합니다.</caption>
  289. <button id="btn_excel" class="btn2_letter4" style="left:1129px; top:55px; width:64px; height:19px; text-align:left; ">
  290. <caption>엑셀출력</caption>
  291. <script type="javascript" ev:event="onclick">
  292. <![CDATA[
  293. //radfSaveExcel(ipt_detailist);
  294. var fileName = window.fileDialog("save", ",", false, "excel", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  295. grd_goodlist.saveExcel(fileName,"sheetname:savetype");
  296. ]]>
  297. </script>
  298. </button>
  299. <caption id="caption2" style="left:20px; top:705px; width:1064px; height:20px; color:#ff0000; ">2. 물류 물품마스터에서 물품코드의 제조회사를 변경하였을 경우, 해당 물품코드가 화학물질코드로 기등록된 것이면 제조회사와 무관하게 위의 목록 상에는 나타나지 않음을 양지하시기 바랍니다.</caption>
  300. </group>
  301. <group id="group4" scroll="auto" style="left:0px; top:13; width:1195px; height:27px; ">
  302. <line id="line2" class="line_6" style="x1:0px; y1:25px; x2:1194px; y2:25px; "/>
  303. </group>
  304. </xhtml:body>
  305. </xhtml:html>