SMRSM00100_화학물질코드관리.xrw 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  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. <matrnm/>
  12. <goodcd/>
  13. <goodnm/>
  14. </condition>
  15. <matrlist>
  16. <matrcd/>
  17. <matrnm/>
  18. <prodcmpynm/>
  19. <mkdeptnm/>
  20. <goodcd/>
  21. <goodnm/>
  22. <goodspec/>
  23. </matrlist>
  24. <matrinfo>
  25. <detail>
  26. <status/>
  27. <matrcd/>
  28. <matrnm/>
  29. <goodcd/>
  30. <goodnm/>
  31. <goodspec/>
  32. <prodcmpycd/>
  33. <prodcmpynm/>
  34. <maincustlastsuplplce/>
  35. <maincustlastsuplplcenm/>
  36. <mkdeptcd/>
  37. <mkdeptnm/>
  38. <frgstdd/>
  39. <cmt/>
  40. <msdsflag/>
  41. </detail>
  42. <deptlist>
  43. <matrcd/>
  44. <deptcd/>
  45. <deptnm/>
  46. <tretopendd/>
  47. <tretclosdd/>
  48. <usge/>
  49. <useqtym/>
  50. <useqtyy/>
  51. <trethrd/>
  52. <workdcntm/>
  53. <tretmcnt/>
  54. <ctnryn/>
  55. <ctnrsignyn/>
  56. <old_deptcd/>
  57. <old_tretclosdd/>
  58. </deptlist>
  59. </matrinfo>
  60. </main>
  61. <send/>
  62. <init/>
  63. <hidden>
  64. <matrinfo>
  65. <detail/>
  66. <deptlist/>
  67. </matrinfo>
  68. </hidden>
  69. <temp>
  70. </temp>
  71. <popgood>
  72. <instcd/>
  73. <wareflag/>
  74. <goodcd/>
  75. <goodnm/>
  76. <returntype/>
  77. <selectyn/>
  78. </popgood>
  79. <popdata>
  80. <matrcd/>
  81. </popdata>
  82. </root>
  83. </instance>
  84. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  85. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  86. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  87. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  88. <script type="javascript" src="../../../mis/miscommonweb/js/RAC001.js"/>
  89. <script type="javascript" src="../../../com/zipcodeweb/js/ZBP001.js"/>
  90. <script type="javascript" src="../../../mis/miscommonweb/js/RSZ001.js"/>
  91. <!--script type="javascript" src="../../../mis/purcbaseweb/js/SMRSC05302.js"/-->
  92. <script type="javascript" ev:event="xforms-ready">
  93. <![CDATA[
  94. fOpenForm();
  95. ]]>
  96. </script>
  97. <script type="javascript">
  98. <![CDATA[
  99. //========================================================================================
  100. //화면 로드시 초기화 함수
  101. //========================================================================================
  102. function fOpenForm() {
  103. //model.removenode("/root/main/matrlist");
  104. //model.removenode("/root/main/deptlist");
  105. //model.refresh();
  106. misfGridInit(grd_deptlist);
  107. fGetMatrList();//코드 목록 조회
  108. // if(model.getValue("/root/main/matrlist[1]/matrcd") != "") {
  109. // grd_matrlist.isSelected(1) = true;
  110. // fGetMatrInfo(1);
  111. // }else {
  112. // fCopyInstance();
  113. // }
  114. }
  115. //========================================================================================
  116. //인스턴스 Copy 함수
  117. //========================================================================================
  118. function fCopyInstance() {
  119. //----model.copyNode("/root/hidden/matrinfo/detail", "/root/main/matrinfo/detail");
  120. model.copyNode("/root/hidden/matrinfo", "/root/main/matrinfo");
  121. model.refresh();
  122. }
  123. //========================================================================================
  124. //코드 목록 조회 함수
  125. //========================================================================================
  126. function fGetMatrList() {
  127. //model.removenode("/root/main/matrlist");//조회시 기존 데이터 삭제
  128. misfGridInit(grd_matrlist);
  129. model.copyNode("/root/send", "/root/main/condition");
  130. submit("TRRSM00101");
  131. model.refresh();
  132. }
  133. //========================================================================================
  134. //화학물질 상세정보 및 조사표 조회
  135. //========================================================================================
  136. function fGetMatrInfo(pRow) {
  137. if ( pRow > 0 ) {
  138. model.resetInstanceNode("/root/send");
  139. model.copyNode("/root/send", "/root/main/matrlist["+ pRow + "]");
  140. submit("TRRSM00102");
  141. ipt_matrcd.disabled = true;
  142. fCopyInstance();
  143. }
  144. }
  145. //========================================================================================
  146. //신규 버턴 클릭시 인스턴스 초기화
  147. //========================================================================================
  148. function fSetMatrInfo() {
  149. ipt_matrcd.disabled = false;
  150. // 아래 두줄로 변경
  151. //model.resetInstanceNode("/root/main/matrinfo");
  152. model.resetInstanceNode("/root/main/matrinfo/detail");
  153. //model.resetInstanceNode("/root/main/matrinfo/deptlist");
  154. misfGridInit(grd_deptlist);
  155. //return;
  156. model.setFocus("ipt_matrcd");
  157. model.setValue("/root/main/matrinfo/detail/status", "i");
  158. model.setValue("/root/main/matrinfo/detail/msdsflag", "Y");
  159. // 서식에서 징수의무자 상호(법인명)으로 쓰임. 기본값으로 경북대학교병원장 셋팅.
  160. //model.setValue("/root/main/matrinfo/prntnm1" , "경북대학교병원장");
  161. fCopyInstance();
  162. }
  163. //========================================================================================
  164. // 저장버튼 클릭시 저장 수행 함수
  165. //========================================================================================
  166. function fClickSaveBtn() {
  167. if(!fIsValidForSave())//저장전 유효성 검사
  168. return;
  169. for(var i = 2; i < grd_deptlist.rows; i++) {
  170. grd_deptlist.valueMatrix(i, grd_deptlist.colRef("matrcd")) = ipt_matrcd.value;
  171. }
  172. model.resetInstanceNode("/root/send");
  173. //model.makeNode("root/send/detail");
  174. model.copyNode("/root/send", "/root/main/matrinfo/detail");
  175. model.makeValue("/root/send/deptlist", grd_deptlist.getUpdateData());
  176. //return;
  177. if(submit("TXRSM00101")) {
  178. fGetMatrList();//코드 목록 재조회
  179. model.copyNode("/root/send", "/root/main/matrinfo/detail");
  180. submit("TRRSM00102"); //상세내역 및 조사표 재조회
  181. //model.setValue("/root/main/matrinfo/detail/status", "-");
  182. //grd_deptlist.clearStatus();
  183. //--model.makeNode("/root/hidden/matrinfo/detail");
  184. model.makeNode("/root/hidden/matrinfo");
  185. fCopyInstance();
  186. ipt_matrcd.disabled = true;
  187. }
  188. }
  189. //========================================================================================
  190. //저장전 유효성 검사
  191. //========================================================================================
  192. function fIsValidForSave() {
  193. //필수 입력 항목 체크(공통 ftHelper.js)
  194. if(!isRequiredControls("ipt_matrcd","ipt_matrnm")) { //,"ipt_prodcmpycd"
  195. return false;
  196. }
  197. var tretopendd = "";
  198. var tretclosdd = "";
  199. for(var i = 2; i < grd_deptlist.rows; i++) {
  200. if(grd_deptlist.rowStatus(i) < 4) { //행삭제가 아닌 Record만 check한다.
  201. if(grd_deptlist.valueMatrix(i, grd_deptlist.colRef("deptcd")) == "") {
  202. messageBox("부서코드가 입력되지 않았습니다. \n조사표의 부서코드를 확인하십시요. ", "E999", "");
  203. return false;
  204. }
  205. tretopendd = grd_deptlist.valueMatrix(i, grd_deptlist.colRef("tretopendd"));
  206. if( tretopendd.length != 8 ) {
  207. messageBox("취급개시일이 정확하게 입력되지 않았습니다. \n취급개시일을 확인하십시요. ", "E999", "");
  208. return false;
  209. }
  210. tretclosdd = grd_deptlist.valueMatrix(i, grd_deptlist.colRef("tretclosdd"));
  211. if( tretclosdd.length != 8 ) {
  212. messageBox("취급종료일이 정확하게 입력되지 않았습니다. \n취급종료일을 확인하십시요. ", "E999", "");
  213. return false;
  214. }
  215. if( tretopendd > tretclosdd ) {
  216. messageBox("취급개시일이 취급종료일보다 큽니다. 취급일을 확인하십시요. ", "E999", "");
  217. return false;
  218. }
  219. }
  220. }
  221. var sStatus = model.getValue("/root/main/matrinfo/detail/status");
  222. var sNewData = fGetNodeText("/root/main/matrinfo/detail");
  223. var sOldData = fGetNodeText("/root/hidden/matrinfo/detail");
  224. //상세내역에 변경된 정보가 있는지 확인
  225. if(sNewData != sOldData && sStatus == "-") { // 데이터 수정일 경우
  226. model.setValue("/root/main/matrinfo/detail/status","u");
  227. return true;
  228. } else if(sNewData == sOldData && sStatus == "-" ) { //변경된 값이 없을경우
  229. //messageBox("변경된 정보가 ", "I004");
  230. //return false;
  231. return true;
  232. }else if(sStatus == "i") { //데이터 입력일 경우
  233. return true;
  234. }else if(sStatus = "d") { //데이터 삭제일 경우
  235. return true;
  236. }
  237. }
  238. //========================================================================================
  239. //엑셀입력(excel file을 그리드에 입력)
  240. //========================================================================================
  241. function fInputExcel(pGrid) {
  242. var fileName = window.fileDialog("open", ",", false, "", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  243. if(fileName != "") {
  244. pGrid.loadExcel(fileName, 1, true);
  245. pGrid.deleteRow(1);
  246. pGrid.refresh();
  247. }
  248. }
  249. //========================================================================================
  250. //동일한 Depth의 인스턴스의 값을 스트링형으로 변환
  251. //========================================================================================
  252. function fGetNodeText(pNode) {
  253. var trgNdoe = instance1.selectSingleNode(pNode);
  254. var trgNdoeList = trgNdoe.childNodes;
  255. var childNode;
  256. var allText = "";
  257. while( childNode = trgNdoeList.nextNode() ) {
  258. allText += childNode.text;
  259. }
  260. return allText;
  261. }
  262. function fOpenPopupDeptHelp(pControl, pInstance)
  263. {
  264. misfOpenPopUpList("02", pControl, "", pInstance);
  265. model.refresh();
  266. }
  267. ]]>
  268. </script>
  269. <submission id="TRRSM00101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/matrlist"/>
  270. <submission id="TRRSM00102" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/matrinfo"/>
  271. <submission id="TXRSM00101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/temp"/>
  272. </model>
  273. </xhtml:head>
  274. <xhtml:body guideline="1,1193;1,1406;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  275. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  276. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:293px; height:14px; ">화학물질 코드 등록</caption>
  277. <caption id="caption4" class="patient_text_black" style="left:922px; top:0px; width:272px; "/>
  278. </group>
  279. <group id="group3" scroll="auto" style="left:0px; top:40; width:1195px; height:744px; ">
  280. <group id="grp_sea" style="left:0px; top:10px; width:1194; height:35px; vertical-align:top; ">
  281. <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; "/>
  282. <caption id="caption7" class="search_name" style="left:56px; top:9px; width:64px; height:17px; ">물질명</caption>
  283. <line id="line5" class="line_4" style="x1:704px; y1:6px; x2:704px; y2:28px; border-color:#ffe4bb; border-left-style:solid; "/>
  284. <button id="btn_search" class="btn1_letter2" navindex="5" style="left:720px; top:7px; width:56px; height:22px; text-align:left; ">
  285. <caption>조회</caption>
  286. <script type="javascript" ev:event="DOMActivate">
  287. <![CDATA[
  288. fGetMatrList();
  289. ]]>
  290. </script>
  291. </button>
  292. <caption id="caption1" class="search_name" style="left:246px; top:9px; width:114px; height:17px; ">(물류)물품코드</caption>
  293. <input id="ipt_matrnm_search" ref="/root/main/condition/matrnm" class="input_default" navindex="2" style="left:124px; top:8px; width:100px; height:19px; "/>
  294. <input id="ipt_goodcd_search" ref="/root/main/condition/goodcd" class="input_default" navindex="3" maxlength="12" style="left:365px; top:8px; width:88px; height:19px; "/>
  295. <button id="btn_goodcd_search" class="icon_search" navindex="4" style="left:456px; top:8px; width:16px; height:16px; ">
  296. <caption/>
  297. <script type="javascript" ev:event="DOMActivate">
  298. <![CDATA[
  299. //popup 에 전달할 parameter를 setting한다.
  300. model.setValue("/root/popgood/instcd", getUserInfo("dutplceinstcd"));
  301. model.setValue("/root/popgood/wareflag", ""); //창고별 물품인 경우에는 창고코드 넣어줌( cmb_wareflag.value )
  302. model.setValue("/root/popgood/returntype", "2"); //goodnm도 함께 return 받고자 할때, returntype을 "2" 로 설정.
  303. //selectyn(popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값) 을 초기화함
  304. model.setValue("/root/popgood/selectyn", "");
  305. //popup 프로그램 호출
  306. window.load("SPRSO20300.xrw", "modal","", "", "/root/popgood","/root/popdata");
  307. //popup에서 특정 물품코드를 선택한 경우, 해당 물품코드에 대한 상세 사항을 보여준다.
  308. if(model.getValue("/root/popgood/selectyn") == "Y") { //popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값
  309. ipt_goodcd_search.value = model.getValue("/root/popgood/goodcd");
  310. opt_goodnm_search.value = model.getValue("/root/popgood/goodnm");
  311. }
  312. ]]>
  313. </script>
  314. </button>
  315. <output id="opt_goodnm_search" ref="/root/main/condition/goodnm" class="output_fix" appearance="output" style="left:474px; top:8px; width:208px; height:19px; "/>
  316. </group>
  317. <line id="line3" class="line_1" style="x1:0px; y1:75px; x2:450px; y2:75px; "/>
  318. <line id="line1" class="line_1" style="x1:455px; y1:75px; x2:1187px; y2:75px; "/>
  319. <line id="line13" class="line_2" style="x1:456px; y1:103px; x2:1078px; y2:103px; "/>
  320. <caption id="caption21" class="tit_2" style="left:5px; top:60px; width:131px; height:13px; ">코드 목록</caption>
  321. <caption id="caption20" class="tit_2" style="left:459px; top:60px; width:131px; height:13px; ">상세내역</caption>
  322. <datagrid id="grd_matrlist" nodeset="/root/main/matrlist" caption="코드^물질명^제조회사^제작부서^(물류)물품코드^물품명^규격" colsep="^" colwidth="37, 198, 96, 102, 89, 145, 105" explorerbar="sortshow" mergecellsfixedrows="bycolrec" rowheader="select" rowheight="16" rowsep="|" navindex="6" style="left:0px; top:80px; width:450px; height:655px; ">
  323. <col class="text_center" ref="matrcd"/>
  324. <col class="text_left" ref="matrnm" style="text-align:left; "/>
  325. <col class="text_left" ref="prodcmpynm" style="text-align:left; "/>
  326. <col ref="mkdeptnm"/>
  327. <col class="text_center" ref="goodcd" style="text-align:center; "/>
  328. <col ref="goodnm"/>
  329. <col ref="goodspec"/>
  330. <script type="javascript" ev:event="onclick">
  331. <![CDATA[
  332. var cur_row = grd_matrlist.row;
  333. fGetMatrInfo(cur_row);
  334. ]]>
  335. </script>
  336. <script type="javascript" ev:event="onaftersort">
  337. <![CDATA[
  338. grd_matrlist.gridToInstance();
  339. ]]>
  340. </script>
  341. </datagrid>
  342. <caption id="cap_matrcd" class="cell_1" style="left:455px; top:80px; width:150px; height:23px; text-align:center; vertical-align:middle; ">물질코드</caption>
  343. <caption id="cap_matrnm" class="cell_1" style="left:455px; top:105px; width:150px; height:23px; text-align:center; vertical-align:middle; ">물 질 명</caption>
  344. <input id="ipt_matrnm" ref="/root/main/matrinfo/detail/matrnm" class="input_essential" navindex="8" style="left:608px; top:107px; width:400px; height:19px; "/>
  345. <line id="line4" class="line_2" style="x1:456px; y1:128px; x2:1078px; y2:128px; "/>
  346. <caption id="caption5" class="cell_1" style="left:793px; top:280px; width:115px; height:23px; text-align:center; vertical-align:middle; ">MSDS 유무</caption>
  347. <line id="line16" class="line_2" style="x1:455px; y1:278px; x2:1077px; y2:278px; "/>
  348. <line id="line17" class="line_2" style="x1:455px; y1:303px; x2:1077px; y2:303px; "/>
  349. <line id="line18" class="line_2" style="x1:455px; y1:361px; x2:1077px; y2:361px; "/>
  350. <caption id="caption24" class="cell_1" style="left:455px; top:255px; width:150px; height:23px; text-align:center; vertical-align:middle; ">제작부서</caption>
  351. <caption id="caption25" class="cell_1" style="left:455px; top:130px; width:150px; height:23px; text-align:center; vertical-align:middle; ">(물류)물품코드</caption>
  352. <caption id="caption27" class="cell_1" style="left:455px; top:305px; width:150px; height:56px; text-align:center; vertical-align:middle; ">비 고</caption>
  353. <caption id="caption29" class="cell_1" style="left:455px; top:280px; width:150px; height:23px; text-align:center; vertical-align:middle; ">최초등록일</caption>
  354. <input id="ipt_frgstdd" ref="/root/main/matrinfo/detail/frgstdd" class="input_default" navindex="20" inputtype="date" format="yyyy-mm-dd" style="left:608px; top:282px; width:90px; height:19px; "/>
  355. <line id="line19" class="line_2" style="x1:455px; y1:153px; x2:1077px; y2:153px; "/>
  356. <textarea id="txtea_reason" ref="/root/main/matrinfo/detail/cmt" navindex="22" style="left:608px; top:307px; width:400px; height:52px; padding-left:4; padding-top:4; padding-right:4; padding-bottom:4; "/>
  357. <input id="ipt_mkdeptcd" ref="/root/main/matrinfo/detail/mkdeptcd" class="input_default" navindex="18" style="left:608px; top:257px; width:75px; height:19px; text-align:center; ">
  358. <script type="javascript" ev:event="xforms-value-changed">
  359. <![CDATA[
  360. //2013.02.26 박준범 : 부서코드 변경시 부서코드명을 먼저 지워준다.
  361. opt_mkdeptnm.value = "";
  362. misfValidationCheck("02", "", "mkdeptcd,mkdeptnm" );
  363. ]]>
  364. </script>
  365. <script type="javascript" ev:event="onkeypress">
  366. <![CDATA[
  367. //if( event.keyCode == 13 ) {
  368. //btn_search.dispatch("DOMActivate");
  369. // --> 위의 코드를 사용하면 input에 입력된 값이 인식이 안됨. TrustForm bug 같습니다.
  370. // --> 대신, 아래 코드 사용하면 input의 값이 인식이 됨
  371. //input 에서 EnterKey 이벤트 인식시 아래 function을 사용하세요!!
  372. inputEnterKey("ipt_mkdeptcd", "xforms-value-changed");
  373. //}
  374. ]]>
  375. </script>
  376. </input>
  377. <button id="btn_mkdeptcd" class="icon_search" navindex="19" style="left:687px; top:258px; width:16px; height:16px; ">
  378. <caption/>
  379. <script type="javascript" ev:event="DOMActivate">
  380. <![CDATA[
  381. var vOrigDeptcd = ipt_mkdeptcd.value; //popup을 열기전 부서 저장
  382. var recv_list = "mkdeptcd,mkdeptnm";
  383. misfOpenPopUpList("02", ipt_mkdeptcd,"", recv_list) ;
  384. ipt_mkdeptcd.refresh();
  385. opt_mkdeptnm.refresh();
  386. if(vOrigDeptcd != ipt_mkdeptcd.value) { //부서코드가 변경되었다면
  387. //조회조건 변경시 초기화 및 check
  388. //fSearchCondChanged("ipt_delivedeptcd");
  389. }
  390. ]]>
  391. </script>
  392. </button>
  393. <output id="opt_mkdeptnm" ref="/root/main/matrinfo/detail/mkdeptnm" class="output_fix" appearance="output" style="left:707px; top:257px; width:301px; height:19px; "/>
  394. <button id="btn_goodcd" class="icon_search" navindex="10" style="left:702px; top:133px; width:16px; height:16px; ">
  395. <caption/>
  396. <script type="javascript" ev:event="DOMActivate">
  397. <![CDATA[
  398. //popup 에 전달할 parameter를 setting한다.
  399. model.setValue("/root/popgood/instcd", getUserInfo("dutplceinstcd"));
  400. model.setValue("/root/popgood/wareflag", ""); //창고별 물품인 경우에는 창고코드 넣어줌( cmb_wareflag.value )
  401. model.setValue("/root/popgood/returntype", "2"); //goodnm도 함께 return 받고자 할때, returntype을 "2" 로 설정.
  402. //selectyn(popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값) 을 초기화함
  403. model.setValue("/root/popgood/selectyn", "");
  404. //popup 프로그램 호출
  405. window.load("SPRSO20300.xrw", "modal","", "", "/root/popgood","/root/popdata");
  406. //popup에서 특정 물품코드를 선택한 경우, 해당 물품코드에 대한 상세 사항을 보여준다.
  407. if(model.getValue("/root/popgood/selectyn") == "Y") { //popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값
  408. ipt_goodcd.value = model.getValue("/root/popgood/goodcd");
  409. ipt_goodnm.value = model.getValue("/root/popgood/goodnm");
  410. }
  411. ]]>
  412. </script>
  413. </button>
  414. <input id="ipt_goodcd" ref="/root/main/matrinfo/detail/goodcd" class="input_default" navindex="9" style="left:608px; top:132px; width:90px; height:19px; "/>
  415. <caption id="caption2" class="cell_1" style="left:455px; top:155px; width:150px; height:23px; text-align:center; vertical-align:middle; ">(물류)물품명</caption>
  416. <line id="line7" class="line_2" style="x1:456px; y1:178px; x2:1078px; y2:178px; "/>
  417. <input id="ipt_goodspec" ref="/root/main/matrinfo/detail/goodspec" class="input_default" navindex="12" style="left:608px; top:182px; width:400px; height:19px; "/>
  418. <line id="line20" class="line_2" style="x1:456px; y1:203px; x2:1078px; y2:203px; "/>
  419. <caption id="caption11" class="cell_1" style="left:455px; top:180px; width:150px; height:23px; text-align:center; vertical-align:middle; ">규 격</caption>
  420. <line id="line9" class="line_2" style="x1:456px; y1:228px; x2:1078px; y2:228px; "/>
  421. <caption id="caption8" class="cell_1" style="left:455px; top:205px; width:150px; height:23px; text-align:center; vertical-align:middle; ">제조회사</caption>
  422. <line id="line10" class="line_2" style="x1:456px; y1:253px; x2:1078px; y2:253px; "/>
  423. <caption id="caption12" class="cell_1" style="left:455px; top:230px; width:150px; height:23px; text-align:center; vertical-align:middle; ">주거래처</caption>
  424. <button id="btn_prodcmpycd" class="icon_search" navindex="14" style="left:662px; top:208px; width:16px; height:16px; ">
  425. <caption/>
  426. <script type="javascript" ev:event="DOMActivate">
  427. <![CDATA[
  428. rszfOpenPopUpListByWndName(ipt_prodcmpycd,"","prodcmpycd,prodcmpynm","SPRSD00160","","");
  429. model.refresh();
  430. ]]>
  431. </script>
  432. </button>
  433. <input id="ipt_prodcmpycd" ref="/root/main/matrinfo/detail/prodcmpycd" class="input_default" navindex="13" style="left:608px; top:207px; width:50px; height:19px; ">
  434. <!--script type="javascript" ev:event="xforms-value-changed">
  435. <![CDATA[
  436. //if ( model.getValue(ipt_prodcmpycd.attribute("ref")).length == 0 ) model.setValue(opt_prodcmpynm.attribute("ref"),"");
  437. //else
  438. rszfValidationCheck("TRRSD00161", "prodcmpylist", "refcond,prodcmpycd,prodcmpynm","prodcmpycd," + model.getValue(ipt_prodcmpycd.attribute("ref"))+"," ,"","prodcmpycd,prodcmpynm" ,ipt_prodcmpycd,"SPRSD00160","","");
  439. model.refresh();
  440. ]]>
  441. </script-->
  442. <!--script type="javascript" ev:event="onkeydown">
  443. <![CDATA[
  444. if(event.keyCode == 9)
  445. {
  446. if(event.shiftKey)model.setFocus("cmb_prodplce");
  447. else model.setFocus("ipt_goodmodel");
  448. }
  449. ]]>
  450. </script-->
  451. </input>
  452. <output id="opt_maincustlastsuplplcenm" ref="/root/main/matrinfo/detail/maincustlastsuplplcenm" class="output_fix" appearance="output" style="left:681px; top:232px; width:327px; height:19px; "/>
  453. <input id="ipt_maincustlastsuplplce" ref="/root/main/matrinfo/detail/maincustlastsuplplce" class="input_default" navindex="16" style="left:608px; top:232px; width:50px; height:19px; text-align:center; "/>
  454. <button id="btn_maincustlastsuplplce" class="icon_search" navindex="17" style="left:662px; top:233px; width:16px; height:16px; ">
  455. <caption/>
  456. <script type="javascript" ev:event="DOMActivate">
  457. <![CDATA[
  458. //rszfOpenPopUpListByWndName(ipt_maincustlastsuplplce,"","maincustlastsuplplce,maincustlastsuplplcenm","SPRSD00180","goodflag,prodcmpycd,prodcmpynm","cmb_goodflag,ipt_prodcmpycd,opt_prodcmpynm");
  459. rszfOpenPopUpListByWndName(ipt_maincustlastsuplplce,"","maincustlastsuplplce,maincustlastsuplplcenm","SPRSD00220"); // ,"instcd","opt_instcd");
  460. model.refresh();
  461. ]]>
  462. </script>
  463. </button>
  464. <select1 id="rdo_dentyn" ref="/root/main/matrinfo/detail/msdsflag" navindex="21" appearance="full" cols="2" overflow="visible" style="left:918px; top:283px; width:80px; height:20px; border-style:none; ">
  465. <choices>
  466. <item>
  467. <label>Yes</label>
  468. <value>Y</value>
  469. </item>
  470. <item>
  471. <label>No</label>
  472. <value>N</value>
  473. </item>
  474. </choices>
  475. </select1>
  476. <input id="ipt_goodnm" ref="/root/main/matrinfo/detail/goodnm" class="input_default" disabled="true" navindex="11" appearance="input" style="left:608px; top:157px; width:400px; height:19px; "/>
  477. <input id="ipt_matrcd" ref="/root/main/matrinfo/detail/matrcd" class="input_default" disabled="true" navindex="7" style="left:608px; top:82px; width:90px; height:19px; ">
  478. <script type="javascript" ev:event="DOMFocusOut">
  479. <![CDATA[
  480. //var sMatrcd = model.getValue("/root/main/matrinfo/matrcd").getLeftPad(3,0);
  481. var sMatrcd = model.getValue("/root/main/matrinfo/detail/matrcd").getTrim();
  482. model.makeNode("/root/send/matrcd");
  483. model.setValue("/root/send/matrcd", sMatrcd);
  484. submit("TRRSM00102");
  485. if(model.getValue("/root/main/matrinfo/detail/matrcd") == "") {
  486. model.makeNode("/root/main/matrinfo");
  487. //--model.copyNode("/root/main/matrinfo/detail", "/root/hidden/matrinfo/detail");
  488. model.copyNode("/root/main/matrinfo", "/root/hidden/matrinfo");
  489. model.setValue("/root/main/matrinfo/detail/status", "i");
  490. model.setValue("/root/main/matrinfo/detail/matrcd", sMatrcd);
  491. model.setFocus("ipt_matrnm");
  492. model.refresh();
  493. }
  494. ]]>
  495. </script>
  496. </input>
  497. <caption id="caption3" class="tit_2" style="left:459px; top:400px; width:150px; height:13px; ">조사표</caption>
  498. <line id="line6" class="line_1" style="x1:455px; y1:415px; x2:1187px; y2:415px; "/>
  499. <datagrid id="grd_deptlist" nodeset="/root/main/matrinfo/deptlist" caption="부서명^취급개시일^취급종료일^용도^월&#xA;사용량^연간&#xA;사용량^1일&#xA;취급시간^월&#xA;작업일수^취급자&#xA;수^소분용기&#xA;유무^원용기&#xA;경고표지^부서코드^물질코드^old_부서코드^old_취급종료일|부서명^취급개시일^취급종료일^용도^월&#xA;사용량^연간&#xA;사용량^1일&#xA;취급시간^월&#xA;작업일수^취급자&#xA;수^소분용기&#xA;유무^원용기&#xA;경고표지^부서코드^물질코드^old_부서코드^old_취급종료일" colsep="^" colwidth="136, 86, 86, 108, 55, 55, 55, 55, 55, 55, 55, 53, 59, 77, 88" mergecellsfixedrows="bycolrec" rowheader="update" rowheight="16" rowsep="|" style="left:455px; top:420px; width:732px; height:315px; ">
  500. <col class="text_left" editable="false" ref="deptnm" type="inputbutton" style="text-align:left; "/>
  501. <col ref="tretopendd" type="inputdate" format="yyyy-mm-dd" style="text-align:center; "/>
  502. <col ref="tretclosdd" type="inputdate" format="yyyy-mm-dd" style="text-align:center; "/>
  503. <col ref="usge" type="input"/>
  504. <col class="text_center" ref="useqtym" type="input"/>
  505. <col class="text_center" ref="useqtyy" type="input"/>
  506. <col class="text_center" ref="trethrd" type="input"/>
  507. <col class="text_center" ref="workdcntm" type="input"/>
  508. <col class="text_center" ref="tretmcnt" type="input"/>
  509. <col class="text_center" ref="ctnryn" type="combo">
  510. <choices>
  511. <item>
  512. <label>-</label>
  513. <value/>
  514. </item>
  515. <item>
  516. <label>Y</label>
  517. <value>Y</value>
  518. </item>
  519. <item>
  520. <label>N</label>
  521. <value>N</value>
  522. </item>
  523. </choices>
  524. </col>
  525. <col class="text_center" ref="ctnrsignyn" type="combo">
  526. <choices>
  527. <item>
  528. <label>-</label>
  529. <value/>
  530. </item>
  531. <item>
  532. <label>Y</label>
  533. <value>Y</value>
  534. </item>
  535. <item>
  536. <label>N</label>
  537. <value>N</value>
  538. </item>
  539. </choices>
  540. </col>
  541. <col ref="deptcd" visibility="hidden"/>
  542. <col ref="matrcd" visibility="hidden"/>
  543. <col ref="old_deptcd" visibility="hidden"/>
  544. <col ref="old_tretclosdd" visibility="hidden"/>
  545. <script type="javascript" ev:event="onbuttonclick">
  546. <![CDATA[
  547. //if(grd_deptlist.col == grd_deptlist.colRef("deptcd")){
  548. // misfOpenPopUpList("02", grd_deptlist, "", "deptcd,deptnm");
  549. //}
  550. if(grd_deptlist.col == grd_deptlist.colRef("deptnm")){
  551. misfOpenPopUpList("02", grd_deptlist, "", "deptcd,deptnm");
  552. }
  553. ]]>
  554. </script>
  555. </datagrid>
  556. <button id="btn_deptexcel" class="btn2_letter4" style="left:1118px; top:395px; width:64px; height:19px; text-align:left; ">
  557. <caption>엑셀출력</caption>
  558. <script type="javascript" ev:event="onclick">
  559. <![CDATA[
  560. //radfSaveExcel(ipt_detailist);
  561. var fileName = window.fileDialog("save", ",", false, "excel", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  562. if(fileName != "") {
  563. grd_deptlist.saveExcel(fileName,"sheetname:savetype");
  564. }
  565. ]]>
  566. </script>
  567. </button>
  568. <button id="btn_insert" class="btn2_letter3" style="left:1008px; top:395px; width:53px; height:19px; text-align:left; ">
  569. <caption>행추가</caption>
  570. <script type="javascript" ev:event="onclick">
  571. <![CDATA[
  572. misfGridIUD(grd_deptlist, "A");
  573. grd_deptlist.valueMatrix(grd_deptlist.row, grd_deptlist.colRef("tretclosdd")) = '99991231'; //취급종료일 setting
  574. //var irow = grd_deptlist.row;
  575. /*
  576. //2012.09.06 박준범 : 기관코드 combo를 추가함에 따라 instcd 코딩 추가
  577. datagrid1.valueMatrix(datagrid1.row, datagrid1.colRef("instcd")) = cmb_instcd.value;
  578. datagrid1.valueMatrix(datagrid1.row, datagrid1.colRef("taxbillflag")) = "1";
  579. datagrid1.valueMatrix(datagrid1.row, datagrid1.colRef("taxbillkind")) = "4";
  580. datagrid1.valueMatrix(datagrid1.row, datagrid1.colRef("kygubun")) = "N";
  581. datagrid1.valueMatrix(datagrid1.row, datagrid1.colRef("ebillflag")) = "00";
  582. datagrid1.valueMatrix(datagrid1.row, datagrid1.colRef("kyymd")) = getCurrentDate();
  583. datagrid1.valueMatrix(datagrid1.row, datagrid1.colRef("genrdd")) = getCurrentDate();
  584. datagrid1.valueMatrix(datagrid1.row, datagrid1.colRef("balsongymd")) = getCurrentDate();
  585. datagrid1.valueMatrix(datagrid1.row, datagrid1.colRef("flagcd")) = "1";
  586. datagrid1.valueMatrix(datagrid1.row, datagrid1.colRef("iogubun")) = "I";
  587. datagrid1.valueMatrix(datagrid1.row, datagrid1.colRef("sekeumgubun")) = "1";
  588. datagrid1.valueMatrix(datagrid1.row, datagrid1.colRef("gubun")) = "2";
  589. var flag = datagrid1.valueMatrix(datagrid1.row, datagrid1.colRef("genrdd")) ;
  590. if(flag.substr(4,4) >= '0101' && flag.substr(4,4) <= '0331'){
  591. datagrid1.valueMatrix(datagrid1.row, datagrid1.colRef("reptkind")) = "1";
  592. }else if(flag.substr(4,4) >= '0401' && flag.substr(4,4) <= '0630'){
  593. datagrid1.valueMatrix(datagrid1.row, datagrid1.colRef("reptkind")) = "2";
  594. }else if(flag.substr(4,4) >= '0701' && flag.substr(4,4) <= '0930'){
  595. datagrid1.valueMatrix(datagrid1.row, datagrid1.colRef("reptkind")) = "3";
  596. }else if(flag.substr(4,4) >= '1001' && flag.substr(4,4) <= '1231'){
  597. datagrid1.valueMatrix(datagrid1.row, datagrid1.colRef("reptkind")) = "4";
  598. }
  599. */
  600. ]]>
  601. </script>
  602. </button>
  603. <button id="btn_delete" class="btn2_letter3" style="left:1063px; top:395px; width:53px; height:19px; text-align:left; ">
  604. <caption>행삭제</caption>
  605. <script type="javascript" ev:event="onclick">
  606. <![CDATA[
  607. //2012.09.12 박준범 - 2줄 comment후, 아래에 행삭제 새로 구현
  608. //misfGridIUD(datagrid1, "D");
  609. //model.refresh();
  610. /*
  611. - 0 : read : 조회시
  612. - 1 : insert : 행추가시
  613. - 2 : update : 조회한 것을 수정시
  614. - 3 : insert & new : 행추가한 것을 수정시
  615. - 4 : delete
  616. - 5 : delete & insert
  617. - 6 : delete & update
  618. */
  619. var status = grd_deptlist.rowStatus(grd_deptlist.row) ;
  620. if(status == 0) {
  621. grd_deptlist.addStatus(grd_deptlist.row, "delete");
  622. }else if(status == 1) {
  623. grd_deptlist.deleteRow(grd_deptlist.row);
  624. }else if(status == 2) {
  625. grd_deptlist.addStatus(grd_deptlist.row, "delete");
  626. }else if(status == 3) {
  627. grd_deptlist.deleteRow(grd_deptlist.row);
  628. }else if(status == 4) {
  629. grd_deptlist.removeStatus(grd_deptlist.row, "delete");
  630. }else if(status == 5) { // insert된 data는 삭제시 위에서 addStatus("delete")하지 않고, 바로 deleteRow했기 때문에 5의 경우는 발생하지 않음.
  631. grd_deptlist.removeStatus(grd_deptlist.row, "delete");
  632. }else if(status == 6) {
  633. grd_deptlist.removeStatus(grd_deptlist.row, "delete");
  634. }
  635. ]]>
  636. </script>
  637. </button>
  638. <button id="button4" class="btn2_letter4" style="left:383px; top:54px; width:64px; height:19px; text-align:left; ">
  639. <caption>엑셀출력</caption>
  640. <script type="javascript" ev:event="onclick">
  641. <![CDATA[
  642. //radfSaveExcel(ipt_detailist);
  643. var fileName = window.fileDialog("save", ",", false, "excel", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  644. if (fileName != "") {
  645. grd_matrlist.saveExcel(fileName,"sheetname:savetype");
  646. }
  647. ]]>
  648. </script>
  649. </button>
  650. <button id="btn_gen" class="btn4_letter9" style="left:460px; top:366px; width:140px; height:22px; ">
  651. <caption>화학물질 종합관리</caption>
  652. <script type="javascript" ev:event="DOMActivate">
  653. <![CDATA[
  654. if(model.getValue("/root/main/matrinfo/detail/status") == "i") {
  655. messageBox("신규 코드를 등록 중입니다." + "\n" + "저장 후에 종합관리 내역을 등록할 수 있습니다. ", "I999", "");
  656. return;
  657. }
  658. else if(ipt_matrcd.value.length == 0) {
  659. messageBox("화학물질이 선택되지 않았습니다. ", "I999", "");
  660. return;
  661. }
  662. model.setValue("/root/popdata/matrcd", model.getValue("/root/main/matrinfo/detail/matrcd"));
  663. window.load("SMRSM00200.xrw", "modal","", "", "/root/popdata","/root/main/condition");
  664. ]]>
  665. </script>
  666. </button>
  667. <input id="ipt_prodcmpynm" ref="/root/main/matrinfo/detail/prodcmpynm" class="input_default" navindex="15" style="left:681px; top:207px; width:327px; height:19px; "/>
  668. </group>
  669. <group id="group4" scroll="auto" style="left:0px; top:13; width:1195px; height:27px; ">
  670. <line id="line2" class="line_6" style="x1:0px; y1:25px; x2:1194px; y2:25px; "/>
  671. <button id="btn_save" class="btn4_letter2" style="left:1137px; top:3px; width:56px; height:22px; ">
  672. <caption>저장</caption>
  673. <script type="javascript" ev:event="DOMActivate">
  674. <![CDATA[
  675. fClickSaveBtn();
  676. ]]>
  677. </script>
  678. </button>
  679. <button id="button1" class="btn4_letter2" style="left:1079px; top:3px; width:56px; height:22px; ">
  680. <caption>삭제</caption>
  681. <script type="javascript" ev:event="DOMActivate">
  682. <![CDATA[
  683. if(model.getValue("/root/main/matrinfo/detail/matrcd") == "") {
  684. messageBox("삭제할 자료가 없습니다.", "I999", "");
  685. return;
  686. }
  687. if (messageBox("코드를", "Q001") == 6){
  688. model.setValue("/root/main/matrinfo/detail/status", "d");
  689. fClickSaveBtn();
  690. //model.reset();
  691. model.refresh();
  692. }
  693. ]]>
  694. </script>
  695. </button>
  696. <button id="btn_prt" class="btn6_letter2" visibility="hidden" style="left:0px; top:3px; width:56px; height:22px; ">
  697. <caption>출력</caption>
  698. </button>
  699. <button id="button2" class="btn4_letter2" style="left:1021px; top:3px; width:56px; height:22px; ">
  700. <caption>신규</caption>
  701. <script type="javascript" ev:event="DOMActivate">
  702. <![CDATA[
  703. fSetMatrInfo();
  704. ]]>
  705. </script>
  706. </button>
  707. </group>
  708. </xhtml:body>
  709. </xhtml:html>