SMRSM00700_월별취급대장입력현황조회.xrw 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  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. <ym/>
  12. <deptcd/>
  13. <deptnm/>
  14. </condition>
  15. <matrlist>
  16. <deptcd/>
  17. <deptnm/>
  18. <matrcd/>
  19. <matrnm/>
  20. <prodcmpynm/>
  21. <cnt/>
  22. <cnfm/>
  23. </matrlist>
  24. </main>
  25. <send/>
  26. <init/>
  27. <hidden>
  28. </hidden>
  29. <temp>
  30. </temp>
  31. </root>
  32. </instance>
  33. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  34. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  35. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  36. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  37. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  38. <script type="javascript" src="../../../mis/miscommonweb/js/RAC001.js"/>
  39. <script type="javascript" src="../../../com/zipcodeweb/js/ZBP001.js"/>
  40. <script type="javascript" src="../../../mis/miscommonweb/js/RSZ001.js"/>
  41. <!--script type="javascript" src="../../../mis/purcbaseweb/js/SMRSC05302.js"/-->
  42. <script type="javascript" ev:event="xforms-ready">
  43. <![CDATA[
  44. fOpenForm();
  45. ]]>
  46. </script>
  47. <script type="javascript">
  48. <![CDATA[
  49. //========================================================================================
  50. //화면 로드시 초기화 함수
  51. //========================================================================================
  52. function fOpenForm() {
  53. //model.removenode("/root/main/goodlist");
  54. //model.removenode("/root/main/deptlist");
  55. //model.refresh();
  56. misfGridInit(grd_matrlist);
  57. //model.setValue("/root/main/condition/fromdd" , getCurrentDate().toDate().getAddDate(-1, "M").getDateFormat("YYYYMMDD") ); //기간 설정 //getCurrentDate() //.substr(0,6)); //.toDate().getAddDate(-1, "D").getDateFormat("YYYYMMDD")
  58. model.setValue("/root/main/condition/ym" , getCurrentDate().substr(0,6) ); //기간 설정 //.substr(0,6));
  59. model.refresh();
  60. //fGetMatrList();//코드 목록 조회
  61. // if(model.getValue("/root/main/goodlist[1]/matrcd") != "") {
  62. // grd_goodlist.isSelected(1) = true;
  63. // fGetGoodInfo(1);
  64. // }else {
  65. // fCopyInstance();
  66. // }
  67. }
  68. //========================================================================================
  69. //인스턴스 Copy 함수
  70. //========================================================================================
  71. function fCopyInstance() {
  72. //----model.copyNode("/root/hidden/goodinfo", "/root/main/goodinfo");
  73. model.refresh();
  74. }
  75. //========================================================================================
  76. //코드 목록 조회 함수
  77. //========================================================================================
  78. function fGetMatrList() {
  79. misfGridInit(grd_matrlist);
  80. //model.resetInstanceNode("/root/main/goodinfo");//조회시 기존 데이터 삭제
  81. model.copyNode("/root/send", "/root/main/condition");
  82. submit("TRRSM00701");
  83. model.refresh();
  84. }
  85. //========================================================================================
  86. //목록 -> 상세내역
  87. //========================================================================================
  88. function fGetGoodInfo(pRow) {
  89. if ( pRow > 0 ) {
  90. model.copyNode("/root/main/goodinfo", "/root/main/goodlist[" + pRow + "]");
  91. //model.refresh();
  92. ipt_matrnm.refresh();
  93. opt_goodcd.refresh();
  94. opt_goodnm.refresh();
  95. opt_goodspec.refresh();
  96. ipt_prodcmpycd.refresh();
  97. opt_prodcmpynm.refresh();
  98. ipt_maincustlastsuplplce.refresh();
  99. opt_maincustlastsuplplcenm.refresh();
  100. ipt_frgstdd.refresh();
  101. ta_cmt.refresh();
  102. }
  103. }
  104. //========================================================================================
  105. //상세내역 -> 목록
  106. //========================================================================================
  107. function fPutGoodInfo() {
  108. if ( true ) {
  109. var iRow = grd_goodlist.findRow(opt_goodcd.value, 1, grd_goodlist.colRef("goodcd"), true, true);
  110. //alert(iRow);
  111. model.setValue(grd_goodlist.nodeset + "[" + iRow + "]/matrnm", ipt_matrnm.value.getTrim());
  112. model.setValue(grd_goodlist.nodeset + "[" + iRow + "]/prodcmpycd", ipt_prodcmpycd.value.getTrim());
  113. model.setValue(grd_goodlist.nodeset + "[" + iRow + "]/prodcmpynm", opt_prodcmpynm.value);
  114. model.setValue(grd_goodlist.nodeset + "[" + iRow + "]/maincustlastsuplplce", ipt_maincustlastsuplplce.value.getTrim());
  115. model.setValue(grd_goodlist.nodeset + "[" + iRow + "]/maincustlastsuplplcenm", opt_maincustlastsuplplcenm.value);
  116. model.setValue(grd_goodlist.nodeset + "[" + iRow + "]/frgstdd", ipt_frgstdd.value);
  117. model.setValue(grd_goodlist.nodeset + "[" + iRow + "]/cmt", ta_cmt.value);
  118. //model.refresh();
  119. grd_goodlist.refresh();
  120. }
  121. }
  122. //========================================================================================
  123. //신규 버턴 클릭시 인스턴스 초기화
  124. //========================================================================================
  125. function fSetMatrInfo() {
  126. ipt_matrcd.disabled = false;
  127. // 아래 두줄로 변경
  128. //model.resetInstanceNode("/root/main/goodinfo");
  129. model.resetInstanceNode("/root/main/goodinfo");
  130. //model.resetInstanceNode("/root/main/goodinfo/deptlist");
  131. misfGridInit(grd_deptlist);
  132. //return;
  133. model.setFocus("ipt_matrcd");
  134. model.setValue("/root/main/goodinfo/status", "i");
  135. model.setValue("/root/main/goodinfo/msdsflag", "Y");
  136. // 서식에서 징수의무자 상호(법인명)으로 쓰임. 기본값으로 경북대학교병원장 셋팅.
  137. //model.setValue("/root/main/goodinfo/prntnm1" , "경북대학교병원장");
  138. fCopyInstance();
  139. }
  140. //========================================================================================
  141. // 저장버튼 클릭시 저장 수행 함수
  142. //========================================================================================
  143. function fClickSaveBtn() {
  144. var iCheckCount = 0;
  145. for(var i = 1; i < grd_matrlist.rows; i++) {
  146. if(grd_matrlist.valueMatrix(i, grd_matrlist.colRef("checkflag")) == "Y") {
  147. iCheckCount = 1;
  148. break;
  149. }
  150. }
  151. if(iCheckCount == 0) {
  152. messageBox("선택된 물품이 없습니다. 먼저 코드 등록할 물품을 선택하십시요. ", "E999", "");
  153. return false;
  154. }
  155. if(opt_goodcd.value != "") {
  156. fPutGoodInfo();
  157. }
  158. if(!fIsValidForSave())//저장전 유효성 검사
  159. return;
  160. //model.resetInstanceNode("/root/send");
  161. //model.makeNode("root/send/detail");
  162. //model.copyNode("/root/send", "/root/main/goodinfo");
  163. model.makeValue("/root/send/goodlist", grd_matrlist.getUpdateData());
  164. //return;
  165. if(submit("TXRSM00501")) {
  166. btn_search.dispatch("DOMActivate");
  167. //fGetMatrList();//코드 목록 재조회
  168. //model.copyNode("/root/send", "/root/main/goodinfo");
  169. //submit("TRRSM00102"); //상세내역 및 조사표 재조회
  170. //model.setValue("/root/main/goodinfo/status", "-");
  171. //grd_deptlist.clearStatus();
  172. //--model.makeNode("/root/hidden/goodinfo");
  173. //model.makeNode("/root/hidden/goodinfo");
  174. //fCopyInstance();
  175. //ipt_matrcd.disabled = true;
  176. }
  177. }
  178. //========================================================================================
  179. //저장전 유효성 검사
  180. //========================================================================================
  181. function fIsValidForSave() {
  182. //필수 입력 항목 체크(공통 ftHelper.js)
  183. //if(!isRequiredControls("ipt_matrcd","ipt_matrnm")) { //,"ipt_prodcmpycd"
  184. // return false;
  185. //}
  186. //var sStatus = model.getValue("/root/main/goodinfo/status");
  187. //var sNewData = fGetNodeText("/root/main/goodinfo");
  188. //var sOldData = fGetNodeText("/root/hidden/goodinfo");
  189. for(var i = 1; i < grd_matrlist.rows; i++) {
  190. if(grd_matrlist.valueMatrix(i, grd_matrlist.colRef("checkflag")) == "N") continue;
  191. if(grd_matrlist.valueMatrix(i, grd_matrlist.colRef("matrnm")) == "" ){
  192. messageBox("물품코드 " + grd_matrlist.valueMatrix(i, grd_matrlist.colRef("goodcd")) + " 의 물질명이 등록되지 않았습니다. ", "E999", "");
  193. return false;
  194. }
  195. if(grd_matrlist.valueMatrix(i, grd_matrlist.colRef("prodcmpycd")) == "" ){
  196. messageBox("물품코드 " + grd_matrlist.valueMatrix(i, grd_matrlist.colRef("goodcd")) + " 의 제조회사가 등록되지 않았습니다. ", "E999", "");
  197. return false;
  198. }
  199. }
  200. return true;
  201. /*
  202. //상세내역에 변경된 정보가 있는지 확인
  203. if(sNewData != sOldData && sStatus == "-") { // 데이터 수정일 경우
  204. model.setValue("/root/main/goodinfo/status","u");
  205. return true;
  206. } else if(sNewData == sOldData && sStatus == "-" ) { //변경된 값이 없을경우
  207. //messageBox("변경된 정보가 ", "I004");
  208. //return false;
  209. return true;
  210. }else if(sStatus == "i") { //데이터 입력일 경우
  211. return true;
  212. }else if(sStatus = "d") { //데이터 삭제일 경우
  213. return true;
  214. }
  215. */
  216. }
  217. //========================================================================================
  218. //엑셀입력(excel file을 그리드에 입력)
  219. //========================================================================================
  220. function fInputExcel(pGrid) {
  221. var fileName = window.fileDialog("open", ",", false, "", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  222. if(fileName != "") {
  223. pGrid.loadExcel(fileName, 1, true);
  224. pGrid.deleteRow(1);
  225. pGrid.refresh();
  226. }
  227. }
  228. //========================================================================================
  229. //동일한 Depth의 인스턴스의 값을 스트링형으로 변환
  230. //========================================================================================
  231. function fGetNodeText(pNode) {
  232. var trgNdoe = instance1.selectSingleNode(pNode);
  233. var trgNdoeList = trgNdoe.childNodes;
  234. var childNode;
  235. var allText = "";
  236. while( childNode = trgNdoeList.nextNode() ) {
  237. allText += childNode.text;
  238. }
  239. return allText;
  240. }
  241. function fOpenPopupDeptHelp(pControl, pInstance)
  242. {
  243. misfOpenPopUpList("02", pControl, "", pInstance);
  244. model.refresh();
  245. }
  246. ]]>
  247. </script>
  248. <submission id="TRRSM00701" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/matrlist"/>
  249. </model>
  250. </xhtml:head>
  251. <xhtml:body guideline="1,1193;1,1406;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  252. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  253. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:331px; height:14px; ">특별관리물질취급일지 입력현황 조회</caption>
  254. <caption id="caption4" class="patient_text_black" style="left:922px; top:0px; width:272px; "/>
  255. </group>
  256. <group id="group3" scroll="auto" style="left:0px; top:40; width:1195px; height:744px; ">
  257. <group id="grp_sea" style="left:0px; top:10px; width:1194; height:35px; vertical-align:top; ">
  258. <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; "/>
  259. <caption id="caption7" class="search_name" style="left:476px; top:9px; width:82px; height:17px; ">입력년월</caption>
  260. <line id="line5" class="line_4" style="x1:660px; y1:6px; x2:660px; y2:28px; border-color:#ffe4bb; border-left-style:solid; "/>
  261. <button id="btn_search" class="btn1_letter2" navindex="4" style="left:678px; top:7px; width:56px; height:22px; text-align:left; ">
  262. <caption>조회</caption>
  263. <script type="javascript" ev:event="DOMActivate">
  264. <![CDATA[
  265. if( ipt_ym.value.length < 6 ) {
  266. messageBox("입력년월을 정확하게 입력하십시요. ", "E999", "");
  267. model.setFocus("ipt_ym");
  268. return;
  269. }
  270. fGetMatrList();
  271. ]]>
  272. </script>
  273. </button>
  274. <input id="ipt_ym" ref="/root/main/condition/ym" class="input_default" navindex="3" inputtype="date" format="yyyy-mm" style="left:559px; top:8px; width:76px; height:19px; text-align:center; "/>
  275. <output id="opt_deptnm" ref="/root/main/condition/deptnm" class="output_fix" appearance="output" style="left:248px; top:8px; width:200px; height:19px; "/>
  276. <caption id="caption1" class="search_name" style="left:70px; top:9px; width:76px; height:17px; ">부서코드</caption>
  277. <input id="ipt_deptcd" ref="/root/main/condition/deptcd" class="input_default" navindex="0" style="left:151px; top:8px; width:75px; height:19px; ">
  278. <script type="javascript" ev:event="xforms-value-changed">
  279. <![CDATA[
  280. //2013.02.26 박준범 : 부서코드 변경시 부서코드명을 먼저 지워준다.
  281. opt_deptnm.value = "";
  282. misfValidationCheck("02", "", "deptcd,deptnm" );
  283. ]]>
  284. </script>
  285. <script type="javascript" ev:event="onkeypress">
  286. <![CDATA[
  287. //if( event.keyCode == 13 ) {
  288. //btn_search.dispatch("DOMActivate");
  289. // --> 위의 코드를 사용하면 input에 입력된 값이 인식이 안됨. TrustForm bug 같습니다.
  290. // --> 대신, 아래 코드 사용하면 input의 값이 인식이 됨
  291. //input 에서 EnterKey 이벤트 인식시 아래 function을 사용하세요!!
  292. inputEnterKey("ipt_deptcd", "xforms-value-changed");
  293. //}
  294. ]]>
  295. </script>
  296. </input>
  297. <button id="btn_deptcd" class="icon_search" navindex="2" style="left:229px; top:9px; width:16px; height:16px; ">
  298. <caption/>
  299. <script type="javascript" ev:event="DOMActivate">
  300. <![CDATA[
  301. var vOrigDeptcd = ipt_deptcd.value; //popup을 열기전 부서 저장
  302. var recv_list = "deptcd,deptnm";
  303. misfOpenPopUpList("02", ipt_deptcd,"", recv_list) ;
  304. ipt_deptcd.refresh();
  305. opt_deptnm.refresh();
  306. if(vOrigDeptcd != ipt_deptcd.value) { //부서코드가 변경되었다면
  307. //조회조건 변경시 초기화 및 check
  308. //fSearchCondChanged("ipt_delivedeptcd");
  309. }
  310. ]]>
  311. </script>
  312. </button>
  313. </group>
  314. <line id="line3" class="line_1" style="x1:0px; y1:75px; x2:1193; y2:75px; "/>
  315. <caption id="caption21" class="tit_2" style="left:5px; top:60px; width:266px; height:14px; ">취급일지 입력현황</caption>
  316. <datagrid id="grd_matrlist" nodeset="/root/main/matrlist" caption="부서코드^부서명^물질코드^물질명^제조회사^입력건수^확정여부" colsep="^" colwidth="88, 202, 61, 267, 139, 64, 64" explorerbar="sortshow" mergecells="byrestriccol" mergecellsfixedrows="bycolrec" rowheader="select" rowheight="16" rowsep="|" navindex="5" style="left:0px; top:80px; width:1193px; height:640px; ">
  317. <col ref="deptcd" style="text-align:center; vertical-align:middle; "/>
  318. <col ref="deptnm" style="vertical-align:middle; "/>
  319. <col class="text_center" ref="matrcd" style="text-align:center; "/>
  320. <col ref="matrnm"/>
  321. <col ref="prodcmpynm"/>
  322. <col ref="cnt" style="text-align:center; "/>
  323. <col ref="cnfm" style="text-align:center; "/>
  324. <script type="javascript" ev:event="onaftersort">
  325. <![CDATA[
  326. grd_matrlist.gridToInstance();
  327. ]]>
  328. </script>
  329. </datagrid>
  330. <button id="btn_excel" class="btn2_letter4" navindex="6" style="left:1129px; top:55px; width:64px; height:19px; text-align:left; ">
  331. <caption>엑셀출력</caption>
  332. <script type="javascript" ev:event="onclick">
  333. <![CDATA[
  334. //radfSaveExcel(ipt_detailist);
  335. var fileName = window.fileDialog("save", ",", false, "excel", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  336. grd_matrlist.saveExcel(fileName,"sheetname:savetype");
  337. ]]>
  338. </script>
  339. </button>
  340. </group>
  341. <group id="group4" scroll="auto" style="left:0px; top:13; width:1195px; height:27px; ">
  342. <line id="line2" class="line_6" style="x1:0px; y1:25px; x2:1194px; y2:25px; "/>
  343. <button id="btn_gen" class="btn4_letter4" visibility="hidden" style="left:1113px; top:3px; width:80px; height:22px; ">
  344. <caption>취급일지</caption>
  345. <script type="javascript" ev:event="DOMActivate">
  346. <![CDATA[
  347. window.load("SMRSM00400.xrw", "modal","", "", "","");
  348. ]]>
  349. </script>
  350. </button>
  351. </group>
  352. </xhtml:body>
  353. </xhtml:html>