SMRSM00400_유해화학물질취급관리대장.xrw 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/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:my="http://www.comsquare.co.kr/example" xmlns:ms="urn:schemas-microsoft-com:xslt" 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. <deptcd/>
  12. <deptnm/>
  13. <matrcd/>
  14. <matrnm/>
  15. <ym/>
  16. <popflag/>
  17. <confirmflag/>
  18. </condition>
  19. <matrlist>
  20. <deptcd/>
  21. <matrcd/>
  22. <usedd/>
  23. <winqty/>
  24. <useqty/>
  25. <stocqty/>
  26. <workcnts/>
  27. <writid/>
  28. <writnm/>
  29. <cnfmnm/>
  30. </matrlist>
  31. <prntlist>
  32. <deptcd/>
  33. <deptnm/>
  34. <matrcd/>
  35. <matrnm/>
  36. <usedd/>
  37. <winqty/>
  38. <useqty/>
  39. <stocqty/>
  40. <workcnts/>
  41. <writid/>
  42. <writnm/>
  43. <cnfmnm/>
  44. </prntlist>
  45. </main>
  46. <send/>
  47. <init>
  48. <prvg/>
  49. </init>
  50. <hidden>
  51. </hidden>
  52. <temp>
  53. </temp>
  54. <popdata>
  55. <matrcd/>
  56. </popdata>
  57. <popmatr>
  58. <matrcd/>
  59. <matrnm/>
  60. <deptcd/>
  61. <returntype/>
  62. <selectyn/>
  63. </popmatr>
  64. </root>
  65. </instance>
  66. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  67. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  68. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  69. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  70. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  71. <script type="javascript" src="../../../mis/miscommonweb/js/RAC001.js"/>
  72. <script type="javascript" src="../../../com/zipcodeweb/js/ZBP001.js"/>
  73. <script type="javascript" src="../../../mis/miscommonweb/js/RSZ001.js"/>
  74. <!--script type="javascript" src="../../../mis/purcbaseweb/js/SMRSC05302.js"/-->
  75. <script type="javascript" ev:event="xforms-ready">
  76. <![CDATA[
  77. fOpenForm();
  78. ]]>
  79. </script>
  80. <script type="javascript">
  81. <![CDATA[
  82. //========================================================================================
  83. //화면 로드시 초기화 함수
  84. //========================================================================================
  85. function fOpenForm() {
  86. //model.removenode("/root/main/matrlist");
  87. //model.removenode("/root/main/deptlist");
  88. //model.refresh();
  89. //model.setValue("/root/main/condition/fromdd" , getCurrentDate().toDate().getAddDate(-1, "M").getDateFormat("YYYYMMDD") ); //기간 설정 //getCurrentDate() //.substr(0,6)); //.toDate().getAddDate(-1, "D").getDateFormat("YYYYMMDD")
  90. //model.setValue("/root/main/condition/todd" , getCurrentDate() ); //기간 설정 //.substr(0,6));
  91. //model.setValue("/root/main/condition/ym" , getCurrentDate().substr(0,6) ); //기간 설정 //.substr(0,6));
  92. //ipt_fromdd.refresh();
  93. //ipt_todd.refresh();
  94. //ipt_ym.refresh();
  95. misfGridInit(grd_matrlist);
  96. //model.copyNode("/root/send", "/root/main/condition");
  97. //화학물질 관리권한 확인 : 관리권한이 있는 자만 확정취소 가능
  98. if (submit("TRRSM00403")) {
  99. //alert(model.getValue("/root/init/prvg/cnt"));
  100. if(model.getValue("/root/init/prvg/cnt") == "1") {
  101. btn_cancel.disabled = false;
  102. }
  103. }
  104. //model.refresh();
  105. if (model.getValue("/root/main/condition/popflag") == "Y") { //popup으로 호출된 경우
  106. //ipt_deptcd.disabled = true;
  107. //btn_deptcd.disabled = true;
  108. //ipt_matrcd.disabled = true;
  109. //btn_matrcd.disabled = true;
  110. //btn_cnfm.visible = false;
  111. //btn_cancel.visible = false;
  112. fGetMatrList();// 조회
  113. } else { //전달 받은 parameter없이 그냥 여는 경우
  114. ipt_ym.value = getCurrentDate().substr(0,6); //기간 설정
  115. }
  116. //fGetMatrList();//코드 목록 조회
  117. // if(model.getValue("/root/main/matrlist[1]/matrcd") != "") {
  118. // grd_matrlist.isSelected(1) = true;
  119. // fGetMatrInfo(1);
  120. // }else {
  121. // fCopyInstance();
  122. // }
  123. }
  124. //========================================================================================
  125. //인스턴스 Copy 함수
  126. //========================================================================================
  127. function fCopyInstance() {
  128. //----model.copyNode("/root/hidden/matrinfo/detail", "/root/main/matrinfo/detail");
  129. model.copyNode("/root/hidden/matrinfo", "/root/main/matrinfo");
  130. model.refresh();
  131. }
  132. //========================================================================================
  133. //코드 목록 조회 함수
  134. //========================================================================================
  135. function fGetMatrList() {
  136. //model.removenode("/root/main/matrlist");//조회시 기존 데이터 삭제
  137. //misfGridInit(grd_matrlist);
  138. ipt_deptcd.value = ipt_deptcd.value.getTrim();
  139. ipt_matrcd.value = ipt_matrcd.value.getTrim();
  140. if(ipt_deptcd.value == "") {
  141. messageBox("부서코드가 선택되지 않았습니다. \n먼저 부서코드를 선택하십시요.", "E999", "");
  142. model.setFocus("ipt_deptcd");
  143. return;
  144. }
  145. if(ipt_matrcd.value == "") {
  146. messageBox("물질코드가 선택되지 않았습니다. \n먼저 물질코드를 선택하십시요.", "E999", "");
  147. model.setFocus("ipt_matrcd");
  148. return;
  149. }
  150. if( ipt_ym.value.length != 6 ) {
  151. messageBox("입력년월을 정확하게 입력하십시요. ", "E999", "");
  152. model.setFocus("ipt_ym");
  153. return;
  154. }
  155. model.copyNode("/root/send", "/root/main/condition");
  156. if(submit("TRRSM00401")) {
  157. //2017.02.07 본인이 작성한 자료만 수정이 가능하다.
  158. for(var i = 1; i < grd_matrlist.rows; i++) {
  159. var writid = grd_matrlist.valueMatrix(i, grd_matrlist.colRef("writid"));
  160. if(writid != "" && writid != getUserInfo("userid") ) {
  161. misfSetReadOnlyCol(grd_matrlist, "winqty,useqty,stocqty,workcnts",true,i);
  162. }
  163. }
  164. }
  165. model.refresh();
  166. }
  167. //========================================================================================
  168. //화학물질 상세정보 및 조사표 조회
  169. //========================================================================================
  170. function fGetMatrInfo(pRow) {
  171. if ( pRow > 0 ) {
  172. model.resetInstanceNode("/root/send");
  173. model.copyNode("/root/send", "/root/main/matrlist["+ pRow + "]");
  174. submit("TRRSM00102");
  175. ipt_matrcd.disabled = true;
  176. fCopyInstance();
  177. }
  178. }
  179. //========================================================================================
  180. //신규 버턴 클릭시 인스턴스 초기화
  181. //========================================================================================
  182. function fSetMatrInfo() {
  183. ipt_matrcd.disabled = false;
  184. // 아래 두줄로 변경
  185. //model.resetInstanceNode("/root/main/matrinfo");
  186. model.resetInstanceNode("/root/main/matrinfo/detail");
  187. //model.resetInstanceNode("/root/main/matrinfo/deptlist");
  188. misfGridInit(grd_deptlist);
  189. //return;
  190. model.setFocus("ipt_matrcd");
  191. model.setValue("/root/main/matrinfo/detail/status", "i");
  192. model.setValue("/root/main/matrinfo/detail/msdsflag", "Y");
  193. // 서식에서 징수의무자 상호(법인명)으로 쓰임. 기본값으로 경북대학교병원장 셋팅.
  194. //model.setValue("/root/main/matrinfo/prntnm1" , "경북대학교병원장");
  195. fCopyInstance();
  196. }
  197. //========================================================================================
  198. // 저장버튼 클릭시 저장 수행 함수
  199. //========================================================================================
  200. function fClickSaveBtn() {
  201. /*
  202. if(!fIsValidForSave())//저장전 유효성 검사
  203. return;
  204. */
  205. /* 20150413 - 조회결과를 달력형태로 보여주도록 수정함으로써 이 check로직 불필요하여 comment처리함
  206. for(var i = 1; i < grd_matrlist.rows; i++) {
  207. if ( grd_matrlist.valueMatrix(i, grd_matrlist.colRef("usedd")).length < 8 &&
  208. grd_matrlist.rowStatus(i) != 0 &&
  209. grd_matrlist.rowStatus(i) != 4 ) {
  210. messageBox("일자가 정확하게 입력되지 않았습니다. 일자를 확인하십시요. ", "E999", "");
  211. return;
  212. }
  213. }
  214. */
  215. model.resetInstanceNode("/root/send");
  216. //model.makeNode("root/send/condition");
  217. model.copyNode("/root/send", "/root/main/condition");
  218. model.makeValue("/root/send/matrlist", grd_matrlist.getUpdateData());
  219. //return;
  220. if(submit("TXRSM00401")) {
  221. fGetMatrList();//코드 목록 재조회
  222. //model.copyNode("/root/send", "/root/main/matrinfo/detail");
  223. //submit("TRRSM00102"); //상세내역 및 조사표 재조회
  224. //model.setValue("/root/main/matrinfo/detail/status", "-");
  225. //grd_deptlist.clearStatus();
  226. //--model.makeNode("/root/hidden/matrinfo/detail");
  227. //model.makeNode("/root/hidden/matrinfo");
  228. //fCopyInstance();
  229. //ipt_matrcd.disabled = true;
  230. }
  231. }
  232. //========================================================================================
  233. //저장전 유효성 검사
  234. //========================================================================================
  235. function fIsValidForSave() {
  236. //필수 입력 항목 체크(공통 ftHelper.js)
  237. if(!isRequiredControls("ipt_matrcd","ipt_matrnm")) { //,"ipt_prodcmpycd"
  238. return false;
  239. }
  240. var sStatus = model.getValue("/root/main/matrinfo/detail/status");
  241. var sNewData = fGetNodeText("/root/main/matrinfo/detail");
  242. var sOldData = fGetNodeText("/root/hidden/matrinfo/detail");
  243. //상세내역에 변경된 정보가 있는지 확인
  244. if(sNewData != sOldData && sStatus == "-") { // 데이터 수정일 경우
  245. model.setValue("/root/main/matrinfo/detail/status","u");
  246. return true;
  247. } else if(sNewData == sOldData && sStatus == "-" ) { //변경된 값이 없을경우
  248. //messageBox("변경된 정보가 ", "I004");
  249. //return false;
  250. return true;
  251. }else if(sStatus == "i") { //데이터 입력일 경우
  252. return true;
  253. }else if(sStatus = "d") { //데이터 삭제일 경우
  254. return true;
  255. }
  256. }
  257. //========================================================================================
  258. //엑셀입력(excel file을 그리드에 입력)
  259. //========================================================================================
  260. function fInputExcel(pGrid) {
  261. var fileName = window.fileDialog("open", ",", false, "", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  262. if(fileName != "") {
  263. pGrid.loadExcel(fileName, 1, true);
  264. pGrid.deleteRow(1);
  265. pGrid.refresh();
  266. }
  267. }
  268. //========================================================================================
  269. //동일한 Depth의 인스턴스의 값을 스트링형으로 변환
  270. //========================================================================================
  271. function fGetNodeText(pNode) {
  272. var trgNdoe = instance1.selectSingleNode(pNode);
  273. var trgNdoeList = trgNdoe.childNodes;
  274. var childNode;
  275. var allText = "";
  276. while( childNode = trgNdoeList.nextNode() ) {
  277. allText += childNode.text;
  278. }
  279. return allText;
  280. }
  281. function fOpenPopupDeptHelp(pControl, pInstance)
  282. {
  283. misfOpenPopUpList("02", pControl, "", pInstance);
  284. model.refresh();
  285. }
  286. ]]>
  287. </script>
  288. <!--submission id="TRRSM00102" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/matrinfo"/-->
  289. <submission id="TRRSM00401" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/matrlist"/>
  290. <submission id="TRRSM00402" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/prntist"/>
  291. <submission id="TRRSM00403" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/init/prvg"/>
  292. <submission id="TXRSM00401" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/temp"/>
  293. <submission id="TXRSM00402" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/temp"/>
  294. </model>
  295. </xhtml:head>
  296. <xhtml:body guideline="1,1193;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  297. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  298. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:293px; height:14px; ">특별관리물질취급일지 입력</caption>
  299. <caption id="caption4" class="patient_text_black" style="left:922px; top:0px; width:272px; "/>
  300. </group>
  301. <group id="group3" scroll="auto" style="left:0px; top:40; width:1195px; height:744px; ">
  302. <group id="grp_sea" style="left:0px; top:10px; width:1194; height:35px; vertical-align:top; ">
  303. <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; "/>
  304. <line id="line5" class="line_4" style="x1:1024px; y1:6px; x2:1024px; y2:28px; border-color:#ffe4bb; border-left-style:solid; "/>
  305. <button id="btn_search" class="btn1_letter2" navindex="7" style="left:1040px; top:7px; width:56px; height:22px; text-align:left; ">
  306. <caption>조회</caption>
  307. <script type="javascript" ev:event="DOMActivate">
  308. <![CDATA[
  309. fGetMatrList();
  310. ]]>
  311. </script>
  312. </button>
  313. <output id="opt_deptnm" ref="/root/main/condition/deptnm" class="output_fix" appearance="output" style="left:230px; top:8px; width:180px; height:19px; "/>
  314. <caption id="caption1" class="search_name" style="left:50px; top:9px; width:76px; height:17px; ">부서코드</caption>
  315. <input id="ipt_deptcd" ref="/root/main/condition/deptcd" class="input_default" navindex="1" style="left:131px; top:8px; width:75px; height:19px; ">
  316. <script type="javascript" ev:event="xforms-value-changed">
  317. <![CDATA[
  318. misfGridInit(grd_matrlist); //그리드 지움
  319. //2013.02.26 박준범 : 부서코드 변경시 부서코드명을 먼저 지워준다.
  320. opt_deptnm.value = "";
  321. misfValidationCheck("02", "", "deptcd,deptnm" );
  322. ]]>
  323. </script>
  324. <script type="javascript" ev:event="onkeypress">
  325. <![CDATA[
  326. //if( event.keyCode == 13 ) {
  327. //btn_search.dispatch("DOMActivate");
  328. // --> 위의 코드를 사용하면 input에 입력된 값이 인식이 안됨. TrustForm bug 같습니다.
  329. // --> 대신, 아래 코드 사용하면 input의 값이 인식이 됨
  330. //input 에서 EnterKey 이벤트 인식시 아래 function을 사용하세요!!
  331. inputEnterKey("ipt_deptcd", "xforms-value-changed");
  332. //}
  333. ]]>
  334. </script>
  335. </input>
  336. <button id="btn_deptcd" class="icon_search" navindex="2" style="left:210px; top:9px; width:16px; height:16px; ">
  337. <caption/>
  338. <script type="javascript" ev:event="DOMActivate">
  339. <![CDATA[
  340. var vOrigDeptcd = ipt_deptcd.value; //popup을 열기전 부서 저장
  341. var recv_list = "deptcd,deptnm";
  342. misfOpenPopUpList("02", ipt_deptcd,"", recv_list) ;
  343. ipt_deptcd.refresh();
  344. opt_deptnm.refresh();
  345. if(vOrigDeptcd != ipt_deptcd.value) { //부서코드가 변경되었다면
  346. //조회조건 변경시 초기화 및 check
  347. //fSearchCondChanged("ipt_delivedeptcd");
  348. misfGridInit(grd_matrlist); //그리드 지움
  349. }
  350. ]]>
  351. </script>
  352. </button>
  353. <caption id="caption9" class="search_name" style="left:835px; top:9px; width:76px; height:17px; ">입력년월</caption>
  354. <input id="ipt_ym" ref="/root/main/condition/ym" class="input_default" navindex="5" inputtype="date" format="yyyy-mm" style="left:915px; top:8px; width:76px; height:19px; text-align:center; ">
  355. <script type="javascript" ev:event="xforms-value-changed">
  356. <![CDATA[
  357. misfGridInit(grd_matrlist); //그리드 지움
  358. ]]>
  359. </script>
  360. </input>
  361. <output id="opt_matrnm" ref="/root/main/condition/matrnm" class="output_fix" appearance="output" style="left:578px; top:8px; width:232px; height:19px; "/>
  362. <button id="btn_matrcd" class="icon_search" navindex="4" style="left:559px; top:9px; width:16px; height:16px; ">
  363. <caption/>
  364. <script type="javascript" ev:event="DOMActivate">
  365. <![CDATA[
  366. //popup 에 전달할 parameter를 setting한다.
  367. //model.setValue("/root/popmatr/returntype", "2"); //matrnm도 함께 return 받고자 할때, returntype을 "2" 로 설정.
  368. model.setValue("/root/popmatr/deptcd", ipt_deptcd.value);
  369. //selectyn(popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값) 을 초기화함
  370. model.setValue("/root/popmatr/selectyn", "");
  371. //popup 프로그램 호출
  372. window.load("SPRSM00100.xrw", "modal","", "", "/root/popmatr","/root/popdata");
  373. //popup에서 특정 물품코드를 선택한 경우, 해당 물품코드에 대한 상세 사항을 조회해서 그리드에 보여준다.
  374. if(model.getValue("/root/popmatr/selectyn") == "Y") { //popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값
  375. //조회조건 변경시 Grid 초기화
  376. //fSearchCondChanged();
  377. misfGridInit(grd_matrlist); //그리드 지움
  378. model.setValue("/root/main/condition/matrcd", model.getValue("/root/popmatr/matrcd"));
  379. model.setValue("/root/main/condition/matrnm", model.getValue("/root/popmatr/matrnm"));
  380. ipt_matrcd.refresh();
  381. opt_matrnm.refresh();
  382. }
  383. ]]>
  384. </script>
  385. </button>
  386. <input id="ipt_matrcd" ref="/root/main/condition/matrcd" class="input_default" navindex="3" maxlength="12" style="left:510px; top:8px; width:45px; height:19px; ">
  387. <script type="javascript" ev:event="xforms-value-changed">
  388. <![CDATA[
  389. //조회조건 변경시 Grid 초기화
  390. //fSearchCondChanged();
  391. misfGridInit(grd_matrlist); //그리드 지움
  392. /*
  393. if(ipt_matrcd.value == ""){
  394. model.setValue("/root/main/condition/matrnm", "");
  395. opt_matrnm.refresh();
  396. }
  397. */
  398. opt_matrnm.value = "";
  399. ]]>
  400. </script>
  401. </input>
  402. <caption id="caption7" class="search_name" style="left:432px; top:9px; width:76px; height:17px; ">물질코드</caption>
  403. </group>
  404. <line id="line3" class="line_1" style="x1:0px; y1:75px; x2:1193px; y2:75px; "/>
  405. <caption id="caption21" class="tit_2" style="left:5px; top:60px; width:131px; height:14px; ">취급일지</caption>
  406. <datagrid id="grd_matrlist" nodeset="/root/main/matrlist" caption="부서코드^물질코드^일자^*입고량^*사용량^*재고량^*작업내용(취급용도)^작성자^확인자^작성자id" colsep="^" colwidth="75, 60, 110, 110, 110, 110, 270, 77, 77, 69" mergecellsfixedrows="bycolrec" rowheader="update" rowheight="16" rowsep="|" navindex="8" style="left:0px; top:80px; width:1193px; height:575px; ">
  407. <col class="text_center" ref="deptcd" visibility="hidden"/>
  408. <col class="text_center" ref="matrcd" visibility="hidden"/>
  409. <col class="text_center" ref="usedd" format="yyyy-mm-dd"/>
  410. <col class="text_center" ref="winqty" type="input"/>
  411. <col class="text_center" ref="useqty" type="input"/>
  412. <col class="text_center" ref="stocqty" type="input"/>
  413. <col class="text_left" ref="workcnts" type="input"/>
  414. <col class="text_center" ref="writnm"/>
  415. <col class="text_center" ref="cnfmnm"/>
  416. <col ref="writid" visibility="hidden"/>
  417. <!--script type="javascript" ev:event="onclick">
  418. <![CDATA[
  419. var cur_row = grd_matrlist.row;
  420. fGetMatrInfo(cur_row);
  421. ]]>
  422. </script-->
  423. </datagrid>
  424. <button id="btn_excel" class="btn2_letter4" style="left:1129px; top:55px; width:64px; height:19px; text-align:left; ">
  425. <caption>엑셀출력</caption>
  426. <script type="javascript" ev:event="onclick">
  427. <![CDATA[
  428. //radfSaveExcel(ipt_detailist);
  429. var fileName = window.fileDialog("save", ",", false, "excel", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  430. if(fileName != "") {
  431. grd_matrlist.saveExcel(fileName,"sheetname:savetype");
  432. }
  433. ]]>
  434. </script>
  435. </button>
  436. <caption id="caption2" style="left:16px; top:680px; width:362px; height:20px; ">2. 출력은 확정처리 이후에 가능합니다.</caption>
  437. <caption id="caption3" style="left:0px; top:660px; width:372px; height:20px; ">※ 1. 화학물질별 월별 확정처리 이후에는 데이터 수정이 불가합니다.</caption>
  438. <caption id="caption5" style="left:16px; top:700px; width:616px; height:20px; ">3. 확정처리 이후 자료를 수정하기 위해 확정취소를 원하시는 경우에는 화학물질 담당자에게 연락주시기 바랍니다.</caption>
  439. <button id="btn_rowdelete" class="btn2_letter3" style="left:1073px; top:55px; width:53px; height:19px; text-align:left; ">
  440. <caption>행삭제</caption>
  441. <script type="javascript" ev:event="DOMActivate">
  442. <![CDATA[
  443. if(grd_matrlist.row < 1) return;
  444. if(getUserInfo("userid") != grd_matrlist.valueMatrix(grd_matrlist.row, grd_matrlist.colRef("writid")) ) {
  445. messageBox("본인이 작성한 자료만 행삭제가 가능합니다. ", "E999", "");
  446. return;
  447. }
  448. //misfGridIUD(grd_matrlist, "D");
  449. /*
  450. - 0 : read : 조회시
  451. - 1 : insert : 행추가시
  452. - 2 : update : 조회한 것을 수정시
  453. - 3 : insert & new : 행추가한 것을 수정시
  454. - 4 : delete
  455. - 5 : delete & insert
  456. - 6 : delete & update
  457. */
  458. var status = grd_matrlist.rowStatus(grd_matrlist.row) ;
  459. if(status == 0) {
  460. grd_matrlist.addStatus(grd_matrlist.row, "delete");
  461. }else if(status == 1) {
  462. grd_matrlist.deleteRow(grd_matrlist.row);
  463. }else if(status == 2) {
  464. grd_matrlist.addStatus(grd_matrlist.row, "delete");
  465. }else if(status == 3) {
  466. grd_matrlist.deleteRow(grd_matrlist.row);
  467. }else if(status == 4) {
  468. grd_matrlist.removeStatus(grd_matrlist.row, "delete");
  469. }else if(status == 5) { // insert된 data는 삭제시 위에서 addStatus("delete")하지 않고, 바로 deleteRow했기 때문에 5의 경우는 발생하지 않음.
  470. grd_matrlist.removeStatus(grd_matrlist.row, "delete");
  471. }else if(status == 6) {
  472. grd_matrlist.removeStatus(grd_matrlist.row, "delete");
  473. }
  474. ]]>
  475. </script>
  476. </button>
  477. <caption id="caption8" style="left:16px; top:720px; width:616px; height:20px; color:#ff0000; ">4. 본인이 작성한 자료에 한해 수정 및 삭제가 가능합니다.</caption>
  478. </group>
  479. <group id="group4" scroll="auto" style="left:0px; top:13; width:1195px; height:27px; ">
  480. <line id="line2" class="line_6" style="x1:0px; y1:25px; x2:1194px; y2:25px; "/>
  481. <button id="btn_save" class="btn4_letter2" style="left:972px; top:3px; width:56px; height:22px; ">
  482. <caption>저장</caption>
  483. <script type="javascript" ev:event="DOMActivate">
  484. <![CDATA[
  485. fClickSaveBtn();
  486. ]]>
  487. </script>
  488. </button>
  489. <button id="btn_cnfm" class="btn4_letter4" style="left:1031px; top:3px; width:80px; height:22px; ">
  490. <caption>확정처리</caption>
  491. <script type="javascript" ev:event="DOMActivate">
  492. <![CDATA[
  493. if(grd_matrlist.rows == 1) {
  494. messageBox("조회된 자료가 없습니다. \n먼저 조회 후, 확정처리를 진행하시기 바랍니다. ", "I999", "");
  495. return;
  496. }
  497. if (messageBox("확정처리 후에는 데이터수정이 불가합니다. \n계속하시겠습니까?", "Q999", "") == 6){
  498. model.setValue("/root/main/condition/confirmflag", "Y");
  499. model.copyNode("/root/send", "/root/main/condition");
  500. if (submit("TXRSM00402")) {
  501. btn_search.dispatch("DOMActivate");
  502. }
  503. //model.setValue("/root/main/matrinfo/detail/status", "d");
  504. //model.reset();
  505. // model.refresh();
  506. }
  507. ]]>
  508. </script>
  509. </button>
  510. <button id="btn_prt" class="btn6_letter2" style="left:0px; top:3px; width:56px; height:22px; ">
  511. <caption>출력</caption>
  512. <script type="javascript" ev:event="DOMActivate">
  513. <![CDATA[
  514. ipt_deptcd.value = ipt_deptcd.value.getTrim();
  515. ipt_matrcd.value = ipt_matrcd.value.getTrim();
  516. if(ipt_deptcd.value == "") {
  517. messageBox("부서코드가 선택되지 않았습니다. \n먼저 부서코드를 선택하십시요.", "E999", "");
  518. model.setFocus("ipt_deptcd");
  519. return;
  520. }
  521. if(ipt_matrcd.value == "") {
  522. messageBox("물질코드가 선택되지 않았습니다. \n먼저 물질코드를 선택하십시요.", "E999", "");
  523. model.setFocus("ipt_matrcd");
  524. return;
  525. }
  526. if( ipt_ym.value.length != 6 ) {
  527. messageBox("입력년월을 정확하게 입력하십시요. ", "E999", "");
  528. model.setFocus("ipt_ym");
  529. return;
  530. }
  531. model.removeNodeset("/root/main/prntlist");
  532. model.copyNode("/root/send", "/root/main/condition");
  533. if (submit("TRRSM00402")) {
  534. model.refresh();
  535. exeReportPreview("RPRSM00401", "XMLSTR");//, "/root/main/payamt");
  536. }
  537. //조회된 자료가 없으면 먼저 조회하라고 message
  538. //if(grd_matrlist.rows < 3) {
  539. //if( instance1.selectNodes("/root/main/prntlist").length < 1 ) {
  540. // messageBox("조회된 결과가 존재하지 않습니다. \n먼저 조회 후 출력하십시요.", "E999", "");
  541. // return;
  542. //}
  543. //model.removeNodeset("/root/main/harmlist");
  544. //submit("TRRSM00302");
  545. //창고명을 report 에 넘겨주기 위해 instance에 setting한다.
  546. //model.setValue("/root/send/search/wareflagnm", cmb_wareflag.label);
  547. ]]>
  548. </script>
  549. </button>
  550. <button id="btn_cancel" class="btn4_letter4" disabled="true" style="left:1114px; top:3px; width:80px; height:22px; ">
  551. <caption>확정취소</caption>
  552. <script type="javascript" ev:event="DOMActivate">
  553. <![CDATA[
  554. if(grd_matrlist.rows == 1) {
  555. messageBox("조회된 자료가 없습니다. \n먼저 조회 후, 확정취소를 진행하시기 바랍니다. ", "I999", "");
  556. return;
  557. }
  558. if (messageBox("조회된 자료의 확정을 취소하시겠습니까?", "Q999", "") == 6){
  559. model.setValue("/root/main/condition/confirmflag", "N");
  560. model.copyNode("/root/send", "/root/main/condition");
  561. if (submit("TXRSM00402")) {
  562. btn_search.dispatch("DOMActivate");
  563. }
  564. // model.refresh();
  565. }
  566. ]]>
  567. </script>
  568. </button>
  569. </group>
  570. </xhtml:body>
  571. </xhtml:html>