SMAHB02700_유해물질관리.xrw 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <!--
  3. * 제 목 : SMAHB02700.xrw
  4. * 설 명 : 유해물질관리
  5. * 설 계 자 : 이성인
  6. * 작 성 자 : 이성인
  7. * 작 성 일 : 2007.12.10
  8. * 수정이력 :
  9. * 기 타 :
  10. -->
  11. <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
  12. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
  13. <xhtml:head>
  14. <xhtml:title>유해물질관리</xhtml:title>
  15. <model id="model1">
  16. <instance id="instance1">
  17. <root xmlns="">
  18. <main>
  19. <MatrList>
  20. <matrcd/>
  21. <matrnm/>
  22. <lastupdtrid/>
  23. <lastupdtdt/>
  24. </MatrList>
  25. </main>
  26. <send>
  27. <choiflag/>
  28. <matrnm/>
  29. <matrcd/>
  30. <updatedata/>
  31. </send>
  32. <init/>
  33. <properties>
  34. <error>
  35. <msg/>
  36. </error>
  37. </properties>
  38. </root>
  39. </instance>
  40. <submission id="TRAHB02701" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/MatrList"/>
  41. <submission id="TXAHB02702" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/updatedata" replace="instance" resultref="/root/main/MatrList"/>
  42. </model>
  43. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  44. <script type="javascript">
  45. <![CDATA[
  46. function fChoiValue(choiflag){
  47. //전체/유해물질명/유해물질코드
  48. if (choiflag == '1' ) {
  49. ipt_matrnm.visible = false;
  50. ipt_matrcd.visible = false;
  51. model.setValue("/root/send/matrnm", "");
  52. model.setValue("/root/send/matrcd", "");
  53. } else if (choiflag == '2') {
  54. ipt_matrnm.attribute("left") = "265px";
  55. ipt_matrnm.visible = true;
  56. ipt_matrcd.visible = false;
  57. model.setValue("/root/send/matrcd", "");
  58. model.setFocus("ipt_matrnm");
  59. } else if (choiflag == '3') {
  60. ipt_matrcd.attribute("left") = "265px";
  61. ipt_matrcd.visible = true;
  62. ipt_matrnm.visible = false;
  63. model.setValue("/root/send/matrnm", "");
  64. model.setFocus("ipt_matrcd");
  65. }
  66. }//fChoiValue() end
  67. function fInit(){
  68. model.removeNodeset("/root/main/MatrList");
  69. model.resetInstanceNode("/root/main/MatrList");
  70. model.resetInstanceNode("/root/send");
  71. model.refresh();
  72. }//fInit() end
  73. function fsave(){
  74. var rows = grd_matrlist.rows - grd_matrlist.fixedRows;
  75. for( i = rows; i > 0 ; i--){
  76. var tempmatrcd = model.getValue("/root/main/MatrList["+i+"]/matrcd");
  77. var bbb = tempmatrcd.length;
  78. if(tempmatrcd ==""||tempmatrcd.length < 1){
  79. messageBox("값을","C001");
  80. return false;
  81. }//if end
  82. }//for end
  83. return true;
  84. }//fsave() end
  85. ]]>
  86. </script>
  87. <script type="javascript" ev:event="xforms-ready">
  88. <![CDATA[
  89. fInit();
  90. ]]>
  91. </script>
  92. </xhtml:head>
  93. <xhtml:body guideline="1,799;2,49;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  94. <group id="group1" style="left:0px; top:0px; width:800px; height:13px; ">
  95. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:254px; height:14px; ">유해물질관리</caption>
  96. </group>
  97. <group id="group3" scroll="auto" style="left:0px; top:13px; width:800px; height:662px; ">
  98. <group id="group4" style="left:0px; top:10px; width:800px; height:35px; vertical-align:top; ">
  99. <shape id="roundrect3" class="roundrect_search" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:800px; height:35px; background-color:#fffbf2; border-color:#ffd799; "/>
  100. <caption id="caption2" class="search_name" style="left:15px; top:8px; width:91px; height:17px; ">검색조건 :</caption>
  101. <select1 id="cmb_choiflag" ref="/root/send/choiflag" class="combo_s_essential" navindex="1" appearance="minimal" style="left:105px; top:7px; width:150px; height:19px; ">
  102. <choices>
  103. <item>
  104. <label>전체</label>
  105. <value>1</value>
  106. </item>
  107. <item>
  108. <label>유해물질명</label>
  109. <value>2</value>
  110. </item>
  111. <item>
  112. <label>유해물질코드</label>
  113. <value>3</value>
  114. </item>
  115. </choices>
  116. <script type="javascript" ev:event="xforms-select">
  117. <![CDATA[
  118. var choiflag = model.getValue("/root/send/choiflag");
  119. //검색조건
  120. fChoiValue(choiflag);
  121. ]]>
  122. </script>
  123. </select1>
  124. <input id="ipt_matrnm" ref="/root/send/matrnm" navindex="2" visibility="hidden" style="left:265px; top:7px; width:198px; height:19px; "/>
  125. <input id="ipt_matrcd" ref="/root/send/matrcd" navindex="3" visibility="hidden" imemode="disabled" maxlength="6" style="left:300px; top:7px; width:198px; height:19px; ">
  126. <script type="javascript" ev:event="xforms-value-changed">
  127. <![CDATA[
  128. var tempmatrcd = model.getValue("/root/send/matrcd");
  129. model.resetInstanceNode("/root/send/matrcd");
  130. model.setValue("/root/send/matrcd", tempmatrcd.toUpperCase());
  131. ]]>
  132. </script>
  133. </input>
  134. <line id="line2" class="line_4" style="x1:716px; y1:7px; x2:716px; y2:29px; border-color:#ffe4bb; border-left-style:solid; "/>
  135. <button id="btn_search" class="btn1_letter2" navindex="4" style="left:732px; top:7px; width:56px; height:22px; background-image:../../../com/commonweb/images/btn1_letter2.gif; ">
  136. <caption>조회</caption>
  137. <script type="javascript" ev:event="DOMActivate">
  138. <![CDATA[
  139. if(cmb_choiflag.value == ""){
  140. messageBox("조회항목을","C002");
  141. return false;
  142. }//end if
  143. else if (cmb_choiflag.value =="2" && ipt_matrnm.value ==""){
  144. messageBox("조회항목을","C002");
  145. return false;
  146. }//end if
  147. else if(cmb_choiflag.value =="3" && ipt_matrcd.value ==""){
  148. messageBox("조회항목을","C002");
  149. return false;
  150. }//end if
  151. else {
  152. submit("TRAHB02701");
  153. }// else if
  154. ]]>
  155. </script>
  156. </button>
  157. </group>
  158. <caption id="caption4" class="tit_2" style="left:6px; top:55px; width:139px; height:14px; ">유해물질코드내역</caption>
  159. <line id="line3" class="line_1" style="x1:0px; y1:70px; x2:800px; y2:70px; "/>
  160. <datagrid id="grd_matrlist" nodeset="/root/main/MatrList" caption="유해물질코드^유해물질 명^최종수정자^최종수정일자" colsep="^" colwidth="101, 493,85, 98" dataheight="25" extendlastcol="scroll" mergecellsfixedrows="bycolrec" rowheader="update" rowsep="|" style="left:0px; top:75px; width:800px; height:581px; vertical-align:middle; ">
  161. <col autonext="false" ref="matrcd" type="input" maxlength="6" style="text-align:left; vertical-align:middle; "/>
  162. <col ref="matrnm" type="input" style="text-align:left; vertical-align:middle; "/>
  163. <col ref="lastupdtrid" type="output" style="text-align:center; vertical-align:middle; "/>
  164. <col ref="lastupdtdt" type="output" format="yyyy-mm-dd" style="text-align:center; vertical-align:middle; "/>
  165. <script type="javascript" ev:event="xforms-value-changed">
  166. <![CDATA[
  167. var col = grd_matrlist.col;
  168. var row = grd_matrlist.row;
  169. var title = grd_matrlist.labelMatrix(0,col);
  170. //유해물질코드, 유해물질 명 대문자로 변환
  171. if(title == "유해물질코드" || title == "유해물질 명"){
  172. var tempmatrcd = model.getValue("/root/main/MatrList["+row+"]/matrcd");
  173. for( i = 0 ; i < tempmatrcd.length; i ++){
  174. if( tempmatrcd.charAt(i) == ' '){
  175. messageBox("코드입력시 공백을 사용","E001");
  176. model.setValue("/root/main/MatrList["+row+"]/matrcd", "");
  177. return false;
  178. }//if end
  179. }//for end
  180. // var tempmatrcd = getTrim()
  181. model.resetInstanceNode("/root/main/MatrList["+row+"]/matrcd");
  182. model.setValue("/root/main/MatrList["+row+"]/matrcd", tempmatrcd.toUpperCase());
  183. var tempmatrnm = model.getValue("/root/main/MatrList["+row+"]/matrnm");
  184. model.resetInstanceNode("/root/main/MatrList["+row+"]/matrnm");
  185. model.setValue("/root/main/MatrList["+row+"]/matrnm", tempmatrnm.toUpperCase());
  186. grd_matrlist.refresh();
  187. }// if end
  188. ]]>
  189. </script>
  190. <script type="javascript" ev:event="onstartedit">
  191. <![CDATA[
  192. if ( grd_matrlist.rowStatus(grd_matrlist.row) == 0 || grd_matrlist.rowStatus(grd_matrlist.row) == 2 ){
  193. if(grd_matrlist.col == 1){
  194. event.preventDefault();
  195. }//inner if end
  196. }//if end
  197. ]]>
  198. </script>
  199. </datagrid>
  200. <button id="button4" class="btn2_letter3" navindex="7" disable.background-image="../../../com/commonweb/images/dis_btn2_letter3.gif" style="left:635px; top:50px; width:53px; height:19px; background-image:../../../com/commonweb/images/btn2_letter3.gif; ">
  201. <caption>행복사</caption>
  202. <script type="javascript" ev:event="DOMActivate">
  203. <![CDATA[
  204. var row = grd_matrlist.row;
  205. var rows = grd_matrlist.rows;
  206. if (row < 1 ){
  207. messageBox("복사할 행을 다시", "C002");
  208. }else{
  209. grd_matrlist.addItem();
  210. model.copyNode("/root/main/MatrList["+ rows +"]","/root/main/MatrList["+ row +"]");
  211. grd_matrlist.refresh();
  212. grd_matrlist.addStatus(rows,"insert");
  213. }//else end
  214. ]]>
  215. </script>
  216. </button>
  217. <button id="button52" class="btn2_letter3" navindex="8" disable.background-image="../../../com/commonweb/images/dis_btn2_letter3.gif" style="left:690px; top:50px; width:53px; height:19px; background-image:../../../com/commonweb/images/btn2_letter3.gif; ">
  218. <caption>행추가</caption>
  219. <script type="javascript" ev:event="DOMActivate">
  220. <![CDATA[
  221. grd_matrlist.addRow();
  222. ]]>
  223. </script>
  224. </button>
  225. <button id="button53" accesskey="f1" class="btn5_letter3" navindex="9" disable.background-image="../../../com/commonweb/images/dis_btn5_letter3.gif" style="left:745px; top:50px; width:53px; height:19px; background-image:../../../com/commonweb/images/btn5_letter3.gif; ">
  226. <caption>행삭제</caption>
  227. <script type="javascript" ev:event="DOMActivate">
  228. <![CDATA[
  229. var row = grd_matrlist.row;
  230. if(row < 0){
  231. messageBox("선택된 행이", "I004");
  232. }else{
  233. if( grd_matrlist.rowStatus(row) == 1){
  234. grd_matrlist.deleteRow(row);
  235. } else {
  236. grd_matrlist.addStatus(row, "delete");
  237. messageBox("삭제하시겠습니까?", "Q999");
  238. //삭제할 행의 정보를 send에 넣는다.
  239. model.setValue("/root/send/updatedata", grd_matrlist.getUpdateData("delete"));
  240. if ( submit("TXAHB02702") ) {
  241. // grd_matrlist.clearStatus(); // submit() 성공하면 그리드의 d상태 제거
  242. model.refresh();
  243. var submitchk = model.getValue("/root/properties/error/msg");
  244. alert(submitchk );
  245. fInit();
  246. }//if end
  247. }// inner else end
  248. }//else end
  249. ]]>
  250. </script>
  251. </button>
  252. </group>
  253. <group id="group2" scroll="auto" style="left:0px; top:675px; width:800px; height:27px; ">
  254. <line id="line32" class="line_6" style="x1:0px; y1:0px; x2:800px; y2:0px; "/>
  255. </group>
  256. <button id="btn_update" class="btn4_letter2" navindex="5" disable.background-image="../../../com/commonweb/images/dis_btn4_letter2.gif" style="left:676px; top:680px; width:56px; height:22px; background-image:../../../com/commonweb/images/btn4_letter2.gif; ">
  257. <caption>저장</caption>
  258. <script type="javascript" ev:event="DOMActivate">
  259. <![CDATA[
  260. if(fsave() == true){
  261. model.setValue("/root/send/updatedata", grd_matrlist.getUpdateData());
  262. if ( submit("TXAHB02702") ) {
  263. grd_matrlist.clearStatus(); // submit() 성공하면 그리드의 i,u 상태 제거
  264. model.refresh();
  265. var submitchk = model.getValue("/root/properties/error/msg");
  266. alert(submitchk );
  267. }//if end
  268. }//if end
  269. fInit();
  270. ]]>
  271. </script>
  272. </button>
  273. <button id="btn_clear" class="btn4_letter3" navindex="6" disable.background-image="../../../com/commonweb/images/dis_btn4_letter3.gif" style="left:734px; top:680px; width:68px; height:22px; background-image:../../../com/commonweb/images/btn4_letter3.gif; ">
  274. <caption>초기화</caption>
  275. <script type="javascript" ev:event="DOMActivate">
  276. <![CDATA[
  277. //화면 초기화
  278. fInit();
  279. ]]>
  280. </script>
  281. </button>
  282. </xhtml:body>
  283. </xhtml:html>