SMLQF00600_QC물질관리.xrw 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <!--
  3. * 제 목 : SMLQF00600_QC물질관리.xrw
  4. * 설 명 : QC물질관리
  5. * 설 계 자 : (주)에이씨케이 -
  6. * 작 성 자 : (주)에이씨케이 - 윤재한
  7. * 작 성 일 : 2007.11.01
  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/>
  15. <model id="model1">
  16. <instance id="instance1">
  17. <root>
  18. <main>
  19. <getmatlist>
  20. <matcd/>
  21. <levlcd/>
  22. <matrfromdd/>
  23. <matrtodd/>
  24. <matrnm/>
  25. <windt/>
  26. <lotno/>
  27. <oclotno/>
  28. <prodcmpy/>
  29. <proddt/>
  30. <levlnm/>
  31. <matrifcd/>
  32. <validd/>
  33. </getmatlist>
  34. </main>
  35. <send>
  36. <matdata/>
  37. <codeflag/>
  38. <userdeptcd/>
  39. <refflag/>
  40. <searchflag/>
  41. <searchtext/>
  42. </send>
  43. <init>
  44. </init>
  45. <hidden>
  46. <refflag/>
  47. <searchflag/>
  48. <searchtext/>
  49. <temp/>
  50. </hidden>
  51. </root>
  52. </instance>
  53. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  54. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  55. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  56. <script type="javascript" ev:event="xforms-ready">
  57. <![CDATA[
  58. fSetInit();
  59. ]]>
  60. </script>
  61. <submission id="TXLQF00601" ref="/root/send" method="post" mediatype="application/x-www-form-urlencoded" replace="instance"/>
  62. <submission id="TRLZZ00101" ref="/root/send" method="post" mediatype="application/x-www-form-urlencoded" replace="instance" resultref="/root/LB0000"/>
  63. <submission id="TRLQF00601" ref="/root/send" method="post" mediatype="application/x-www-form-urlencoded" replace="instance" resultref="/root/main/getmatlist"/>
  64. <submission id="TXLQF00602" ref="/root/send" method="post" mediatype="application/x-www-form-urlencoded" replace="instance"/>
  65. </model>
  66. <script type="javascript">
  67. <![CDATA[
  68. //초기화
  69. function fSetInit() {
  70. model.setValue("/root/send/codeflag", "0000|");
  71. submit("TRLZZ00101", false);
  72. model.makeValue("/root/send/basecdid", model.getValue("/root/init/LB0000/nm"));
  73. model.setValue("/root/send/codeflag", "0501|");
  74. submit("TRLZZ00101"); //사용자 부서별로 레벨코드 조회하기 위해 0000과 0501따로 조회
  75. model.setValue("/root/hidden/refflag", "1");
  76. model.setValue("/root/hidden/searchflag", "1");
  77. model.setValue("/root/hidden/searchtext", "");
  78. grd_matlist.colHidden(4) = true;
  79. model.removeNodeset("/root/main/getmatlist");
  80. fGetMatList();
  81. }
  82. //조회
  83. function fGetMatList() {
  84. model.setValue("/root/send/refflag", model.getValue("/root/hidden/refflag"));
  85. model.setValue("/root/send/searchflag", model.getValue("/root/hidden/searchflag"));
  86. model.setValue("/root/send/searchtext", model.getValue("/root/hidden/searchtext").toUpperCase());
  87. model.setValue("/root/send/userdeptcd", model.getValue("/root/init/LB0000/nm"));
  88. submit("TRLQF00601");
  89. grd_matlist.isReadOnly(1, 1, grd_matlist.rows-1, 4) = true; //물질코드~ 사용종료일자까지 비활성화
  90. }
  91. //행추가
  92. function fAddRow(){
  93. grd_matlist.addrow();
  94. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/matrfromdd", getCurrentDate());
  95. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/matrtodd","99991231");
  96. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/windt", getCurrentDate());
  97. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/lotno","-");
  98. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/oclotno","-");
  99. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/validd","99991231");
  100. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/prodcmpy","-");
  101. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/proddt","19000101");
  102. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/matrifcd","-");
  103. grd_matlist.bottomRow = grd_matlist.rows;
  104. }
  105. //물질변경
  106. function fAddRow2(){
  107. copyNodeListType("/root/hidden/temp", "/root/main/getmatlist["+grd_matlist.row+"]", "replace"); //선택항목 임시노드에 복사
  108. fEndMat(); //선택된항목 물질 종료
  109. grd_matlist.addrow();
  110. //선택했던 물질 정보 복사
  111. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/matrcd" , model.getValue("/root/hidden/temp/getmatlist/matrcd"));
  112. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/levlcd" , model.getValue("/root/hidden/temp/getmatlist/levlcd"));
  113. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/matrnm" , model.getValue("/root/hidden/temp/getmatlist/matrnm"));
  114. //초기 정보 설정
  115. var fromdate = getCurrentDate().toDate("YYYYMMDD").getAddDate(1)
  116. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/matrfromdd", fromdate.getDateFormat("YYYYMMDD")); //새로운 물질 시작일자를 다음날로 변경
  117. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/matrtodd","99991231");
  118. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/windt", getCurrentDate());
  119. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/lotno","-");
  120. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/validd","99991231");
  121. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/prodcmpy","-");
  122. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/proddt","19000101");
  123. model.setValue("/root/main/getmatlist[" + (grd_matlist.rows-1) + "]/matrifcd","-");
  124. grd_matlist.bottomRow = grd_matlist.rows;
  125. }
  126. //종료
  127. function fEndMat() {
  128. var todd = model.getValue("/root/main/getmatlist["+grd_matlist.row+"]/matrtodd");
  129. if(todd < getCurrentDate()){
  130. alert("이미 종료된 물질입니다.");
  131. return;
  132. }
  133. grd_matlist.rowStatus(grd_matlist.row) = 4;
  134. model.setValue("/root/send/matdata", getGridUpdateData(grd_matlist));
  135. model.setValue("/root/send/userdeptcd", model.getValue("/root/init/LB0000/nm"));
  136. submit("TXLQF00602", false);
  137. fGetMatList();
  138. }
  139. //엔터키
  140. function fKeyEvent(){
  141. if(event.keyCode == "13"){
  142. //물질 리스트 조회
  143. if(event.target =="ipt_searchtext"){
  144. model.setValue("/root/hidden/searchtext", ipt_searchtext.currentText);
  145. fGetMatList();
  146. }
  147. }
  148. }
  149. //저장
  150. function fInsMat() {
  151. var row = getNodesetCount("/root/main/getmatlist");
  152. for(i = 1; i <= row; i++) {
  153. if(grd_matlist.rowStatus(i) == 3 || grd_matlist.rowStatus(i) == 1) {
  154. if(model.getValue("/root/main/getmatlist["+ i +"]/matrcd") == "") {
  155. messageBox("QC물질 코드는", "I003");
  156. return;
  157. }else if(model.getValue("/root/main/getmatlist["+ i +"]/levlcd") == "") {
  158. messageBox("레벨코드는", "I003");
  159. return;
  160. }else if(model.getValue("/root/main/getmatlist["+ i +"]/matrfromdd") == "") {
  161. messageBox("사용시작일자는", "I003");
  162. return;
  163. }else if(model.getValue("/root/main/getmatlist["+ i +"]/matrnm") == "") {
  164. messageBox("QC물질명은", "I003");
  165. return;
  166. }else if(model.getValue("/root/main/getmatlist["+ i +"]/matrtodd") == "") {
  167. if(model.getValue("/root/hidden/refflag") =="2") {
  168. messageBox("사용종료일자는", "I003");
  169. return;
  170. } else {
  171. model.setValue("/root/main/getmatlist["+ i +"]/matrtodd", "99991231");
  172. }
  173. }
  174. if(model.getValue("/root/main/getmatlist["+ i +"]/windt") == "") {
  175. model.setValue("/root/main/getmatlist["+ i +"]/windt", getCurrentDate());
  176. }
  177. if(model.getValue("/root/main/getmatlist["+ i +"]/lotno") == "") {
  178. model.setValue("/root/main/getmatlist["+ i +"]/lotno", "-");
  179. }
  180. if(model.getValue("/root/main/getmatlist["+ i +"]/oclotno") == "") {
  181. model.setValue("/root/main/getmatlist["+ i +"]/oclotno", "-");
  182. }
  183. if(model.getValue("/root/main/getmatlist["+ i +"]/prodcmpy") == "") {
  184. model.setValue("/root/main/getmatlist["+ i +"]/prodcmpy", "-");
  185. }
  186. if(model.getValue("/root/main/getmatlist["+ i +"]/proddt") == "") {
  187. model.setValue("/root/main/getmatlist["+ i +"]/proddt", "19000101");
  188. }
  189. if(model.getValue("/root/main/getmatlist["+ i +"]/matrifcd") == "") {
  190. model.setValue("/root/main/getmatlist["+ i +"]/matrifcd", "-");
  191. }
  192. if(model.getValue("/root/main/getmatlist["+ i +"]/levlnm") == "") {
  193. var cd = model.getValue("/root/main/getmatlist["+ i +"]/levlcd");
  194. model.setValue("/root/main/getmatlist["+ i +"]/levlnm", model.getValue("/root/init/LB0501[cd = '"+ cd +"']/etc01"));
  195. }
  196. }
  197. }
  198. model.setValue("/root/send/matdata", getGridUpdateData(grd_matlist));
  199. model.setValue("/root/send/userdeptcd", model.getValue("/root/init/LB0000/nm"));
  200. submit("TXLQF00601");
  201. fGetMatList();
  202. }
  203. ]]>
  204. </script>
  205. </xhtml:head>
  206. <xhtml:body style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  207. <group id="group3" scroll="auto" style="left:0px; top:40px; width:1195px; height:744; ">
  208. <line id="line1" class="line_1" style="x1:0px; y1:70px; x2:1194px; y2:70px; "/>
  209. <caption id="caption1" class="tit_2" style="left:5px; top:55px; width:134px; height:14px; ">QC물질 목록</caption>
  210. <group id="group2" style="left:0px; top:10px; width:1195px; height:35px; vertical-align:top; ">
  211. <shape id="roundrect2" class="roundrect_search" appearance="roundrect" style="left:0px; top:0px; width:1194px; height:35px; "/>
  212. <caption id="caption5" class="search_name" style="left:15px; top:9px; width:86px; height:17px; ">조회구분 :</caption>
  213. <button id="btn_ref" class="btn1_letter2" style="left:1123px; top:7px; width:57px; height:22px; ">
  214. <caption>조회</caption>
  215. <script type="javascript" ev:event="DOMActivate">
  216. <![CDATA[
  217. fGetMatList();
  218. ]]>
  219. </script>
  220. </button>
  221. <line id="line3" class="line_4" style="x1:1108px; y1:6px; x2:1108px; y2:28px; "/>
  222. <select1 id="cmb_refflag" ref="/root/hidden/refflag" class="combo_s_essential" appearance="minimal" style="left:106px; top:8px; width:120px; height:19px; ">
  223. <choices>
  224. <item>
  225. <label>사용자료</label>
  226. <value>1</value>
  227. </item>
  228. <item>
  229. <label>전체자료</label>
  230. <value>2</value>
  231. </item>
  232. </choices>
  233. <script type="javascript" ev:event="xforms-value-changed">
  234. <![CDATA[
  235. if(model.getValue("/root/hidden/refflag") == "2") {
  236. grd_matlist.colHidden(4) = false;
  237. } else {
  238. grd_matlist.colHidden(4) = true;
  239. }
  240. fGetMatList();
  241. model.refresh();
  242. ]]>
  243. </script>
  244. </select1>
  245. <input id="ipt_searchtext" ref="/root/hidden/searchtext" class="input_s_button" style="left:973px; top:9px; width:120px; height:19px; ">
  246. <script type="javascript" ev:event="onkeypress">
  247. <![CDATA[
  248. fKeyEvent();
  249. ]]>
  250. </script>
  251. </input>
  252. <caption id="caption7" class="search_name" style="left:760px; top:10px; width:86px; height:17px; ">검색구분 :</caption>
  253. <select1 id="cmb_searchflag" ref="/root/hidden/searchflag" class="combo_search" appearance="minimal" style="left:850px; top:9px; width:120px; height:19px; ">
  254. <choices>
  255. <item>
  256. <label>물질코드</label>
  257. <value>1</value>
  258. </item>
  259. <item>
  260. <label>물질명</label>
  261. <value>2</value>
  262. </item>
  263. </choices>
  264. </select1>
  265. </group>
  266. <datagrid id="grd_matlist" nodeset="/root/main/getmatlist" caption="QC물질코드^레벨코드^ 사용시작일자^사용종료일자^QC물질명^입고일자^Lot번호^OnCall Lot번호^Expire Date^제조회사^제조일자^라벨명^IF연동코드" colwidth="150, 90, 90, 90, 160, 90, 84, 90, 90, 84, 90, 0, 122" dataheight="23" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="23" rowsep="|" colsep="^" style="left:0px; top:75px; width:1194px; height:644px; ">
  267. <col ref="matrcd" type="input" maxlength="10"/>
  268. <col ref="levlcd" type="combo">
  269. <choices>
  270. <itemset nodeset="/root/init/LB0501">
  271. <label ref="nm"/>
  272. <value ref="cd"/>
  273. </itemset>
  274. </choices>
  275. </col>
  276. <col ref="matrfromdd" type="inputdate" format="yyyy-mm-dd"/>
  277. <col ref="matrtodd" type="outputdate" format="yyyy-mm-dd"/>
  278. <col ref="matrnm" type="input"/>
  279. <col ref="windt" type="inputdate" format="yyyy-mm-dd"/>
  280. <col ref="lotno" type="input"/>
  281. <col ref="oclotno" type="input"/>
  282. <col ref="validd" type="inputdate" format="yyyy-mm-dd"/>
  283. <col ref="prodcmpy" type="input"/>
  284. <col ref="proddt" type="inputdate" format="yyyy-mm-dd"/>
  285. <col ref="levlnm" type="input"/>
  286. <col ref="matrifcd" type="input"/>
  287. </datagrid>
  288. <button id="btn_addrow" class="btn2_letter3" style="left:1141px; top:49px; width:53px; height:19px; ">
  289. <caption>행추가</caption>
  290. <script type="javascript" ev:event="DOMActivate">
  291. <![CDATA[
  292. fAddRow();
  293. ]]>
  294. </script>
  295. </button>
  296. <button id="btn_end" class="btn2_letter2" style="left:1029px; top:49px; width:42px; height:19px; ">
  297. <caption>종료</caption>
  298. <script type="javascript" ev:event="DOMActivate">
  299. <![CDATA[
  300. fEndMat();
  301. model.refresh();
  302. ]]>
  303. </script>
  304. </button>
  305. <button id="button1" class="btn2_letter4" style="left:1074px; top:49px; width:64px; height:19px; ">
  306. <caption>물질변경</caption>
  307. <script type="javascript" ev:event="DOMActivate">
  308. <![CDATA[
  309. fAddRow2();
  310. ]]>
  311. </script>
  312. </button>
  313. </group>
  314. <group id="group4" scroll="auto" style="left:0px; top:13px; width:1195px; height:27px; ">
  315. <button id="btn_init" class="btn4_letter3" style="left:1127px; top:5px; width:68px; height:22px; ">
  316. <caption>초기화</caption>
  317. <script type="javascript" ev:event="DOMActivate">
  318. <![CDATA[
  319. window.reload();
  320. ]]>
  321. </script>
  322. </button>
  323. <line id="line2" class="line_2" style="x1:0px; y1:0px; x2:1194px; y2:0px; "/>
  324. <button id="btn_save" class="btn4_letter2" style="left:1068px; top:5px; width:56px; height:22px; ">
  325. <caption>저장</caption>
  326. <script type="javascript" ev:event="DOMActivate">
  327. <![CDATA[
  328. fInsMat();
  329. ]]>
  330. </script>
  331. </button>
  332. </group>
  333. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  334. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:800px; height:14px; ">QC물질관리</caption>
  335. </group>
  336. </xhtml:body>
  337. </xhtml:html>