SMRSM01000_화학물질취급관리조사.xrw 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113
  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. <reptdd/>
  12. <deptcd/>
  13. <deptnm/>
  14. <tempyn/>
  15. <popflag/>
  16. <confirmflag/>
  17. </condition>
  18. <matrlist>
  19. <reptdd/>
  20. <reptseq/>
  21. <matrcd/>
  22. <deptcd/>
  23. <workflag/>
  24. <appdd/>
  25. <usge/>
  26. <useqtym/>
  27. <useqtyy/>
  28. <trethrd/>
  29. <workdcntm/>
  30. <tretmcnt/>
  31. <ctnryn/>
  32. <ctnrsignyn/>
  33. <msdsyn/>
  34. <matrnm/>
  35. <prodcmpynm/>
  36. <maincustlastsuplplcenm/>
  37. <fstname/>
  38. <fstid/>
  39. <orguseqtym/>
  40. <orguseqtyy/>
  41. <orgusge/>
  42. <orgtrethrd/>
  43. <orgworkdcntm/>
  44. <orgtretmcnt/>
  45. <orgctnryn/>
  46. <orgctnrsignyn/>
  47. <orgmsdsyn/>
  48. </matrlist>
  49. </main>
  50. <send/>
  51. <init>
  52. <prvg/>
  53. </init>
  54. <hidden>
  55. </hidden>
  56. <temp>
  57. </temp>
  58. <popdata->
  59. <matrcd-/>
  60. </popdata->
  61. <popmatr>
  62. <matrcd/>
  63. <matrnm/>
  64. <deptcd/>
  65. <prodcmpynm/>
  66. <maincustlastsuplplcenm/>
  67. <returntype/>
  68. <selectyn/>
  69. </popmatr>
  70. </root>
  71. </instance>
  72. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  73. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  74. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  75. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  76. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  77. <script type="javascript" src="../../../mis/miscommonweb/js/RAC001.js"/>
  78. <script type="javascript" src="../../../com/zipcodeweb/js/ZBP001.js"/>
  79. <script type="javascript" src="../../../mis/miscommonweb/js/RSZ001.js"/>
  80. <!--script type="javascript" src="../../../mis/purcbaseweb/js/SMRSC05302.js"/-->
  81. <script type="javascript" ev:event="xforms-ready">
  82. <![CDATA[
  83. fOpenForm();
  84. ]]>
  85. </script>
  86. <script type="javascript">
  87. <![CDATA[
  88. //========================================================================================
  89. //화면 로드시 초기화 함수
  90. //========================================================================================
  91. function fOpenForm() {
  92. //model.removenode("/root/main/matrlist");
  93. //model.removenode("/root/main/deptlist");
  94. //model.refresh();
  95. //model.setValue("/root/main/condition/fromdd" , getCurrentDate().toDate().getAddDate(-1, "M").getDateFormat("YYYYMMDD") ); //기간 설정 //getCurrentDate() //.substr(0,6)); //.toDate().getAddDate(-1, "D").getDateFormat("YYYYMMDD")
  96. //model.setValue("/root/main/condition/todd" , getCurrentDate() ); //기간 설정 //.substr(0,6));
  97. //model.setValue("/root/main/condition/ym" , getCurrentDate().substr(0,6) ); //기간 설정 //.substr(0,6));
  98. //ipt_fromdd.refresh();
  99. //ipt_todd.refresh();
  100. //ipt_ym.refresh();
  101. //ipt_reptdd.value = getCurrentDate() ; //기간 설정
  102. misfGridInit(grd_matrlist);
  103. //model.copyNode("/root/send", "/root/main/condition");
  104. /*
  105. //화학물질 관리권한 확인 : 관리권한이 있는 자만 확정취소 가능
  106. if (submit("TRRSM00403")) {
  107. //alert(model.getValue("/root/init/prvg/cnt"));
  108. if(model.getValue("/root/init/prvg/cnt") == "1") {
  109. btn_cancel.disabled = false;
  110. }
  111. }
  112. //model.refresh();
  113. if (model.getValue("/root/main/condition/popflag") == "Y") { //popup으로 호출된 경우
  114. //ipt_deptcd.disabled = true;
  115. //btn_deptcd.disabled = true;
  116. //ipt_matrcd.disabled = true;
  117. //btn_matrcd.disabled = true;
  118. //btn_cnfm.visible = false;
  119. //btn_cancel.visible = false;
  120. fGetMatrList();// 조회
  121. } else { //전달 받은 parameter없이 그냥 여는 경우
  122. ipt_ym.value = getCurrentDate().substr(0,6); //기간 설정
  123. }
  124. */
  125. //fGetMatrList();//코드 목록 조회
  126. // if(model.getValue("/root/main/matrlist[1]/matrcd") != "") {
  127. // grd_matrlist.isSelected(1) = true;
  128. // fGetMatrInfo(1);
  129. // }else {
  130. // fCopyInstance();
  131. // }
  132. }
  133. //========================================================================================
  134. //인스턴스 Copy 함수
  135. //========================================================================================
  136. function fCopyInstance() {
  137. //----model.copyNode("/root/hidden/matrinfo/detail", "/root/main/matrinfo/detail");
  138. model.copyNode("/root/hidden/matrinfo", "/root/main/matrinfo");
  139. model.refresh();
  140. }
  141. //========================================================================================
  142. //코드 목록 조회 함수
  143. //========================================================================================
  144. function fGetMatrList() {
  145. //model.removenode("/root/main/matrlist");//조회시 기존 데이터 삭제
  146. //misfGridInit(grd_matrlist);
  147. ipt_deptcd.value = ipt_deptcd.value.getTrim();
  148. if(ipt_deptcd.value == "") {
  149. messageBox("부서코드가 선택되지 않았습니다. \n먼저 부서코드를 선택하십시요.", "E999", "");
  150. model.setFocus("ipt_deptcd");
  151. return;
  152. }
  153. //if(ipt_matrcd.value == "") {
  154. // messageBox("물질코드가 선택되지 않았습니다. \n먼저 물질코드를 선택하십시요.", "E999", "");
  155. // model.setFocus("ipt_matrcd");
  156. // return;
  157. //}
  158. model.copyNode("/root/send", "/root/main/condition");
  159. if (submit("TRRSM01001")) {
  160. //임시저장 자료를 조회시 보고일자를 찾아 setting
  161. if(cbx_temp.value == "Y") {
  162. for(var i = grd_matrlist.fixedRows; i < grd_matrlist.rows; i++) {
  163. if(grd_matrlist.valueMatrix(i, grd_matrlist.colRef("reptdd")) != "") {
  164. ipt_reptdd.value = grd_matrlist.valueMatrix(i, grd_matrlist.colRef("reptdd"));
  165. break;
  166. }
  167. }
  168. }
  169. //작성자 본인만이 기존 자료에 추가 또는 수정이 가능하다. 이에 따른 저장버튼과 전송버튼 처리
  170. var sFstid = ""; //최초작성자
  171. if(grd_matrlist.rows > grd_matrlist.fixedRows) {
  172. for(var i = grd_matrlist.fixedRows; i < grd_matrlist.rows; i++) {
  173. if(grd_matrlist.valueMatrix(i, grd_matrlist.colRef("fstid")) != "") {
  174. sFstid = grd_matrlist.valueMatrix(i, grd_matrlist.colRef("fstid"));
  175. break;
  176. }
  177. }
  178. }
  179. if ( sFstid == "" || sFstid == getUserInfo("userid") ) {
  180. btn_save.disabled = false;
  181. //2017.07.07 본인이 아니어도 전송 가능토록 comment처리
  182. //btn_send.disabled = false;
  183. } else {
  184. btn_save.disabled = true;
  185. //2017.07.07 본인이 아니어도 전송 가능토록 comment처리
  186. //btn_send.disabled = true;
  187. messageBox("본인이 등록한 자료가 아닌 경우, 조회만 가능합니다.", "E999", "");
  188. }
  189. //임시저장 자료를 조회하고, 본인이 작성한 자료의 경우에만 임시저장 자료 삭제가 가능하도록 button control
  190. if(cbx_temp.value == "Y" && sFstid == getUserInfo("userid") ) {
  191. btn_saveDelete.disabled = false;
  192. } else {
  193. btn_saveDelete.disabled = true;
  194. }
  195. //2017.07.07 임시저장 자료 조회시에 전송 enable
  196. if(cbx_temp.value == "Y" ) {
  197. btn_send.disabled = false;
  198. } else {
  199. btn_send.disabled = true;
  200. }
  201. for(var irow = grd_matrlist.fixedRows; irow < grd_matrlist.rows; irow++) {
  202. var flag = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("workflag")); //작업구분(N:신규 C:변경 S:중단)
  203. if(flag == "") {
  204. grd_matrlist.cellStyle("color", irow, grd_matrlist.colRef("workflag")) = "";
  205. misfSetReadOnlyCol(grd_matrlist, "matrcd", true, irow);
  206. } else if(flag == "N") {
  207. grd_matrlist.cellStyle("color", irow, grd_matrlist.colRef("workflag")) = "#ff0000";
  208. } else if(flag == "C") {
  209. grd_matrlist.cellStyle("color", irow, grd_matrlist.colRef("workflag")) = "#ff0000";
  210. misfSetReadOnlyCol(grd_matrlist, "matrcd", true, irow);
  211. //var iCol = grd_matrlist.col;
  212. //var iRow =grd_matrlist.row;
  213. var iFlagCol = grd_matrlist.colRef("workflag");
  214. fSetStyleAndFlag("usge", irow, iFlagCol);
  215. fSetStyleAndFlag("useqtym", irow, iFlagCol);
  216. fSetStyleAndFlag("useqtyy", irow, iFlagCol);
  217. fSetStyleAndFlag("trethrd", irow, iFlagCol);
  218. fSetStyleAndFlag("workdcntm", irow, iFlagCol);
  219. fSetStyleAndFlag("tretmcnt", irow, iFlagCol);
  220. fSetStyleAndFlag("ctnryn", irow, iFlagCol);
  221. fSetStyleAndFlag("ctnrsignyn", irow, iFlagCol);
  222. fSetStyleAndFlag("msdsyn", irow, iFlagCol);
  223. } else if(flag == "S") {
  224. grd_matrlist.cellStyle("color", irow, grd_matrlist.colRef("workflag")) = "#ff0000";
  225. misfSetReadOnlyCol(grd_matrlist, "matrcd", true, irow);
  226. misfSetReadOnlyCol(grd_matrlist, "usge,useqtym,useqtyy,trethrd,workdcntm,tretmcnt,ctnryn,ctnrsignyn,msdsyn", true, irow);
  227. }
  228. }
  229. /*
  230. if(flag == "" || flag == "C" || flag == "S") {
  231. //grd_matrlist.cellAttribute("disabled", i, grd_matrlist.colRef("matrcd")) = "true";
  232. misfSetReadOnlyCol(grd_matrlist, "matrcd", true, i);
  233. grd_matrlist.cellAttribute("disabled", i, grd_matrlist.colRef("usge")) = "false";
  234. grd_matrlist.cellAttribute("disabled", i, grd_matrlist.colRef("useqtym")) = "false";
  235. grd_matrlist.cellAttribute("disabled", i, grd_matrlist.colRef("useqtyy")) = "false";
  236. grd_matrlist.cellAttribute("disabled", i, grd_matrlist.colRef("trethrd")) = "false";
  237. grd_matrlist.cellAttribute("disabled", i, grd_matrlist.colRef("workdcntm")) = "false";
  238. grd_matrlist.cellAttribute("disabled", i, grd_matrlist.colRef("tretmcnt")) = "false";
  239. grd_matrlist.cellAttribute("disabled", i, grd_matrlist.colRef("ctnryn")) = "false";
  240. grd_matrlist.cellAttribute("disabled", i, grd_matrlist.colRef("ctnrsignyn")) = "false";
  241. grd_matrlist.cellAttribute("disabled", i, grd_matrlist.colRef("msdsyn")) = "false";
  242. }
  243. */
  244. model.refresh();
  245. }
  246. }
  247. //========================================================================================
  248. //화학물질 상세정보 및 조사표 조회
  249. //========================================================================================
  250. function fGetMatrInfo(pRow) {
  251. if ( pRow > 0 ) {
  252. model.resetInstanceNode("/root/send");
  253. model.copyNode("/root/send", "/root/main/matrlist["+ pRow + "]");
  254. submit("TRRSM00102");
  255. ipt_matrcd.disabled = true;
  256. fCopyInstance();
  257. }
  258. }
  259. //========================================================================================
  260. //신규 버턴 클릭시 인스턴스 초기화
  261. //========================================================================================
  262. function fSetMatrInfo() {
  263. ipt_matrcd.disabled = false;
  264. // 아래 두줄로 변경
  265. //model.resetInstanceNode("/root/main/matrinfo");
  266. model.resetInstanceNode("/root/main/matrinfo/detail");
  267. //model.resetInstanceNode("/root/main/matrinfo/deptlist");
  268. misfGridInit(grd_deptlist);
  269. //return;
  270. model.setFocus("ipt_matrcd");
  271. model.setValue("/root/main/matrinfo/detail/status", "i");
  272. model.setValue("/root/main/matrinfo/detail/msdsflag", "Y");
  273. // 서식에서 징수의무자 상호(법인명)으로 쓰임. 기본값으로 경북대학교병원장 셋팅.
  274. //model.setValue("/root/main/matrinfo/prntnm1" , "경북대학교병원장");
  275. fCopyInstance();
  276. }
  277. //========================================================================================
  278. // 저장버튼 클릭시 저장 수행 함수
  279. //========================================================================================
  280. function fClickSaveBtn() {
  281. /*
  282. if(!fIsValidForSave())//저장전 유효성 검사
  283. return;
  284. */
  285. if(ipt_reptdd.value.length < 8) {
  286. messageBox("보고일자가 정확하게 입력되지 않았습니다. ", "E999", "");
  287. model.setFocus("ipt_reptdd");
  288. return;
  289. }
  290. for(var i = grd_matrlist.fixedRows; i < grd_matrlist.rows; i++) {
  291. var flag = grd_matrlist.valueMatrix(i, grd_matrlist.colRef("workflag"));
  292. if (flag != "") {
  293. if ( grd_matrlist.valueMatrix(i, grd_matrlist.colRef("appdd")).length < 8 ) {
  294. messageBox("적용시작일자가 정확하게 입력되지 않았습니다. \n" + (i -1) + "번째 행을 확인하십시요. ", "E999", "");
  295. return;
  296. }
  297. if ( grd_matrlist.valueMatrix(i, grd_matrlist.colRef("matrcd")) == "" ) {
  298. messageBox("물질코드가 선택되지 않았습니다. \n" + (i -1) + "번째 행을 확인하십시요. ", "E999", "");
  299. return;
  300. }
  301. }
  302. /*
  303. //구분값을 기준으로 실제 추가, 변경, 중단된 row에만 status 를 표시한다.
  304. if(flag == "") {
  305. grd_matrlist.rowStatus(i) = 0;
  306. } else {
  307. grd_matrlist.rowStatus(i) = 1; //1:insert
  308. grd_matrlist.valueMatrix(i, grd_matrlist.colRef("reptdd")) = ipt_reptdd.value; //보고일자
  309. }
  310. */
  311. grd_matrlist.valueMatrix(i, grd_matrlist.colRef("reptdd")) = ipt_reptdd.value; //보고일자
  312. }
  313. /*
  314. //그리드에 변경된 자료가 있는지 확인
  315. var updtdata = getGridUpdateData(grd_matrlist);
  316. if (updtdata == "") {
  317. messageBox("변경된 데이터가", "I004");
  318. return;
  319. }
  320. */
  321. model.resetInstanceNode("/root/send");
  322. //model.makeNode("root/send/condition");
  323. model.copyNode("/root/send", "/root/main/condition");
  324. model.makeValue("/root/send/matrlist", grd_matrlist.getUpdateDataAll("i") );
  325. //return;
  326. if(submit("TXRSM01001")) {
  327. //model.copyNode("/root/send", "/root/main/matrinfo/detail");
  328. //submit("TRRSM00102"); //상세내역 및 조사표 재조회
  329. //model.setValue("/root/main/matrinfo/detail/status", "-");
  330. //grd_deptlist.clearStatus();
  331. //--model.makeNode("/root/hidden/matrinfo/detail");
  332. //model.makeNode("/root/hidden/matrinfo");
  333. //fCopyInstance();
  334. //ipt_matrcd.disabled = true;
  335. return true;
  336. } else {
  337. return false;
  338. }
  339. }
  340. //========================================================================================
  341. // 임시저장자료 삭제버튼 클릭시 저장 수행 함수
  342. //========================================================================================
  343. function fClickSaveDeleteBtn() {
  344. /*
  345. if(!fIsValidForSave())//저장전 유효성 검사
  346. return;
  347. */
  348. /*
  349. if(ipt_reptdd.value.length < 8) {
  350. messageBox("보고일자가 정확하게 입력되지 않았습니다. ", "E999", "");
  351. model.setFocus("ipt_reptdd");
  352. return;
  353. }
  354. */
  355. model.resetInstanceNode("/root/send");
  356. //model.makeNode("root/send/condition");
  357. model.copyNode("/root/send", "/root/main/condition");
  358. //model.makeValue("/root/send/matrlist", grd_matrlist.getUpdateDataAll("i") );
  359. //return;
  360. if(submit("TXRSM01003")) {
  361. //model.copyNode("/root/send", "/root/main/matrinfo/detail");
  362. //submit("TRRSM00102"); //상세내역 및 조사표 재조회
  363. //model.setValue("/root/main/matrinfo/detail/status", "-");
  364. //grd_deptlist.clearStatus();
  365. //--model.makeNode("/root/hidden/matrinfo/detail");
  366. //model.makeNode("/root/hidden/matrinfo");
  367. //fCopyInstance();
  368. //ipt_matrcd.disabled = true;
  369. return true;
  370. } else {
  371. return false;
  372. }
  373. }
  374. //========================================================================================
  375. //저장전 유효성 검사
  376. //========================================================================================
  377. function fIsValidForSave() {
  378. //필수 입력 항목 체크(공통 ftHelper.js)
  379. if(!isRequiredControls("ipt_matrcd","ipt_matrnm")) { //,"ipt_prodcmpycd"
  380. return false;
  381. }
  382. var sStatus = model.getValue("/root/main/matrinfo/detail/status");
  383. var sNewData = fGetNodeText("/root/main/matrinfo/detail");
  384. var sOldData = fGetNodeText("/root/hidden/matrinfo/detail");
  385. //상세내역에 변경된 정보가 있는지 확인
  386. if(sNewData != sOldData && sStatus == "-") { // 데이터 수정일 경우
  387. model.setValue("/root/main/matrinfo/detail/status","u");
  388. return true;
  389. } else if(sNewData == sOldData && sStatus == "-" ) { //변경된 값이 없을경우
  390. //messageBox("변경된 정보가 ", "I004");
  391. //return false;
  392. return true;
  393. }else if(sStatus == "i") { //데이터 입력일 경우
  394. return true;
  395. }else if(sStatus = "d") { //데이터 삭제일 경우
  396. return true;
  397. }
  398. }
  399. //========================================================================================
  400. // 전송버튼 클릭시 전송 수행 함수
  401. //========================================================================================
  402. function fClickSendBtn() {
  403. /*
  404. if(!fIsValidForSave())//저장전 유효성 검사
  405. return;
  406. */
  407. /*
  408. var iChangedRowCnt = 0;
  409. for(var i = grd_matrlist.fixedRows; i < grd_matrlist.rows; i++) {
  410. //신규, 변경, 중단 작업을 하지 않은 row는 status를 초기화 한다.
  411. if(grd_matrlist.valueMatrix(i, grd_matrlist.colRef("workflag")) == "") {
  412. grd_matrlist.rowStatus(i) = 0; //0: new
  413. } else {
  414. iChangedRowCnt++;
  415. }
  416. }
  417. if(iChangedRowCnt == 0) {
  418. messageBox("전송할 \n먼저 저장 후에 다시 전송 버튼을 눌러주세요 ", "I999", "");
  419. return;
  420. }
  421. var updateData = getGridUpdateData(grd_matrlist);
  422. alert(updateData);
  423. if(updateData == "") {
  424. messageBox("작업하신 내용이 저장되지 않았습니다. \n먼저 저장 후에 다시 전송 버튼을 눌러주세요 ", "I999", "");
  425. return;
  426. }
  427. model.resetInstanceNode("/root/send");
  428. //model.makeNode("root/send/condition");
  429. model.copyNode("/root/send", "/root/main/condition");
  430. //model.makeValue("/root/send/matrlist", grd_matrlist.getUpdateData());
  431. //return;
  432. */
  433. if(submit("TXRSM01002")) {
  434. //임시저장 자료를 조회하여 보여준다.
  435. cbx_temp.value = "Y";
  436. fGetMatrList();//코드 목록 재조회
  437. //model.copyNode("/root/send", "/root/main/matrinfo/detail");
  438. //submit("TRRSM00102"); //상세내역 및 조사표 재조회
  439. //model.setValue("/root/main/matrinfo/detail/status", "-");
  440. //grd_deptlist.clearStatus();
  441. //--model.makeNode("/root/hidden/matrinfo/detail");
  442. //model.makeNode("/root/hidden/matrinfo");
  443. //fCopyInstance();
  444. //ipt_matrcd.disabled = true;
  445. //messageBox("전송이 완료되었습니다. ", "I999", "");
  446. }
  447. }
  448. //========================================================================================
  449. //엑셀입력(excel file을 그리드에 입력)
  450. //========================================================================================
  451. function fInputExcel(pGrid) {
  452. var fileName = window.fileDialog("open", ",", false, "", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  453. if(fileName != "") {
  454. pGrid.loadExcel(fileName, 1, true);
  455. pGrid.deleteRow(1);
  456. pGrid.refresh();
  457. }
  458. }
  459. //========================================================================================
  460. //동일한 Depth의 인스턴스의 값을 스트링형으로 변환
  461. //========================================================================================
  462. function fGetNodeText(pNode) {
  463. var trgNdoe = instance1.selectSingleNode(pNode);
  464. var trgNdoeList = trgNdoe.childNodes;
  465. var childNode;
  466. var allText = "";
  467. while( childNode = trgNdoeList.nextNode() ) {
  468. allText += childNode.text;
  469. }
  470. return allText;
  471. }
  472. function fOpenPopupDeptHelp(pControl, pInstance)
  473. {
  474. misfOpenPopUpList("02", pControl, "", pInstance);
  475. model.refresh();
  476. }
  477. //컬럼(pColname) 의 값이 원래의 값(org + 컬럼명인 컬럼)과 다른 경우 해당 컬럼의 font색상을 변경하고 구분을 "C" 로 변경한다.
  478. //pColname : 컬럼명
  479. //pRow : Row index
  480. //pFlagCol : 구분(workflag)을 나타내는 컬럼의 index
  481. function fSetStyleAndFlag(pColname, pRow, pFlagCol)
  482. {
  483. var pCol = grd_matrlist.colRef(pColname);
  484. if(grd_matrlist.valueMatrix(pRow, pCol) == grd_matrlist.valueMatrix(pRow, grd_matrlist.colRef("org" + pColname)) ) {
  485. grd_matrlist.cellStyle("color", pRow, pCol) = ""; //Font Color
  486. //구분 컬럼
  487. //grd_matrlist.cellStyle("color", pRow, pFlagCol) = ""; //Font Color
  488. } else {
  489. grd_matrlist.cellStyle("color", pRow, pCol) = "#ff0000";
  490. //구분 컬럼
  491. grd_matrlist.cellStyle("color", pRow, pFlagCol) = "#ff0000";
  492. grd_matrlist.valueMatrix(pRow, pFlagCol) = "C"; //작업구분(N:신규 C:변경 S:중단)
  493. }
  494. }
  495. ]]>
  496. </script>
  497. <!--submission id="TRRSM00102" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/matrinfo"/-->
  498. <submission id="TRRSM00402" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/prntist"/>
  499. <submission id="TRRSM00403" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/init/prvg"/>
  500. <submission id="TXRSM01001" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/temp"/>
  501. <submission id="TXRSM01002" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/temp"/>
  502. <submission id="TXRSM01003" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/temp"/>
  503. <submission id="TRRSM01001" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/matrlist"/>
  504. </model>
  505. </xhtml:head>
  506. <xhtml:body guideline="1,1193;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  507. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  508. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:293px; height:14px; ">화학물질 취급 변경사항 보고</caption>
  509. <caption id="caption4" class="patient_text_black" style="left:922px; top:0px; width:272px; "/>
  510. </group>
  511. <group id="group3" scroll="auto" style="left:0px; top:40; width:1195px; height:744px; ">
  512. <group id="grp_sea" style="left:0px; top:10px; width:1194px; height:35px; vertical-align:top; ">
  513. <shape id="roundrect1" class="roundrect_search" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:1194px; height:35px; background-color:#fffbf2; border-color:#ffd799; "/>
  514. <line id="line5" class="line_4" style="x1:475px; y1:7px; x2:475px; y2:28px; border-color:#ffe4bb; border-left-style:solid; "/>
  515. <button id="btn_search" class="btn1_letter2" navindex="7" style="left:490px; top:7px; width:56px; height:22px; text-align:left; ">
  516. <caption>조회</caption>
  517. <script type="javascript" ev:event="DOMActivate">
  518. <![CDATA[
  519. fGetMatrList();
  520. ]]>
  521. </script>
  522. </button>
  523. <output id="opt_deptnm" ref="/root/main/condition/deptnm" class="output_fix" appearance="output" style="left:265px; top:8px; width:190px; height:19px; "/>
  524. <caption id="caption1" class="search_name" style="left:85px; top:9px; width:76px; height:17px; ">부서코드</caption>
  525. <input id="ipt_deptcd" ref="/root/main/condition/deptcd" class="input_default" navindex="1" style="left:166px; top:8px; width:75px; height:19px; ">
  526. <script type="javascript" ev:event="xforms-value-changed">
  527. <![CDATA[
  528. misfGridInit(grd_matrlist); //그리드 지움
  529. //2013.02.26 박준범 : 부서코드 변경시 부서코드명을 먼저 지워준다.
  530. opt_deptnm.value = "";
  531. misfValidationCheck("02", "", "deptcd,deptnm" );
  532. ]]>
  533. </script>
  534. <script type="javascript" ev:event="onkeypress">
  535. <![CDATA[
  536. //if( event.keyCode == 13 ) {
  537. //btn_search.dispatch("DOMActivate");
  538. // --> 위의 코드를 사용하면 input에 입력된 값이 인식이 안됨. TrustForm bug 같습니다.
  539. // --> 대신, 아래 코드 사용하면 input의 값이 인식이 됨
  540. //input 에서 EnterKey 이벤트 인식시 아래 function을 사용하세요!!
  541. inputEnterKey("ipt_deptcd", "xforms-value-changed");
  542. //}
  543. ]]>
  544. </script>
  545. </input>
  546. <button id="btn_deptcd" class="icon_search" navindex="2" style="left:245px; top:9px; width:16px; height:16px; ">
  547. <caption/>
  548. <script type="javascript" ev:event="DOMActivate">
  549. <![CDATA[
  550. var vOrigDeptcd = ipt_deptcd.value; //popup을 열기전 부서 저장
  551. var recv_list = "deptcd,deptnm";
  552. misfOpenPopUpList("02", ipt_deptcd,"", recv_list) ;
  553. ipt_deptcd.refresh();
  554. opt_deptnm.refresh();
  555. if(vOrigDeptcd != ipt_deptcd.value) { //부서코드가 변경되었다면
  556. //조회조건 변경시 초기화 및 check
  557. //fSearchCondChanged("ipt_delivedeptcd");
  558. misfGridInit(grd_matrlist); //그리드 지움
  559. }
  560. ]]>
  561. </script>
  562. </button>
  563. <caption id="caption9" style="left:823px; top:9px; width:67px; height:17px; font-weight:bold; color:#993300; ">보고일자 :</caption>
  564. <input id="ipt_reptdd" ref="/root/main/condition/reptdd" class="input_default" navindex="5" inputtype="date" format="yyyy-mm-dd" style="left:890px; top:8px; width:90px; height:19px; text-align:center; "/>
  565. <select id="cbx_temp" ref="/root/main/condition/tempyn" overflow="visible" appearance="full" style="left:559px; top:11px; width:106px; height:20px; vertical-align:middle; border-style:none; ">
  566. <choices>
  567. <item>
  568. <label>임시저장 자료</label>
  569. <value>Y</value>
  570. </item>
  571. </choices>
  572. <script type="javascript" ev:event="xforms-value-changed">
  573. <![CDATA[
  574. misfGridInit(grd_matrlist); //그리드 지움
  575. if(cbx_temp.value != "Y") {
  576. ipt_reptdd.value = "";
  577. btn_send.disabled = true;
  578. } else {
  579. btn_send.disabled = false;
  580. }
  581. ]]>
  582. </script>
  583. </select>
  584. </group>
  585. <line id="line3" class="line_1" style="x1:0px; y1:75px; x2:1193px; y2:75px; "/>
  586. <caption id="caption21" class="tit_2" style="left:5px; top:60px; width:80px; height:14px; ">조사표</caption>
  587. <button id="btn_insert" class="btn2_letter7" style="left:840px; top:55px; width:97px; height:19px; text-align:left; ">
  588. <caption>신규물질 추가</caption>
  589. <script type="javascript" ev:event="onclick">
  590. <![CDATA[
  591. ipt_deptcd.value = ipt_deptcd.value.getTrim();
  592. if(ipt_deptcd.value == "") {
  593. messageBox("부서코드가 선택되지 않았습니다. \n먼저 부서코드를 선택하십시요.", "E999", "");
  594. model.setFocus("ipt_deptcd");
  595. return;
  596. }
  597. misfGridIUD(grd_matrlist, "A");
  598. var irow = grd_matrlist.row;
  599. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("deptcd")) = ipt_deptcd.value;
  600. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("workflag")) = "N"; // 작업구분 - N:신규, C:변경, S:중단
  601. grd_matrlist.cellStyle("color", irow, grd_matrlist.colRef("workflag")) = "#ff0000";
  602. grd_matrlist.cellAttribute("disabled", irow, grd_matrlist.colRef("workflag")) = "true";
  603. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("ctnryn")) = "N";
  604. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("ctnrsignyn")) = "N";
  605. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("msdsyn")) = "N";
  606. /*
  607. grd_matrlist.cellAttribute("disabled", irow, grd_matrlist.colRef("usge")) = "false";
  608. grd_matrlist.cellAttribute("disabled", irow, grd_matrlist.colRef("useqtym")) = "false";
  609. grd_matrlist.cellAttribute("disabled", irow, grd_matrlist.colRef("useqtyy")) = "false";
  610. grd_matrlist.cellAttribute("disabled", irow, grd_matrlist.colRef("trethrd")) = "false";
  611. grd_matrlist.cellAttribute("disabled", irow, grd_matrlist.colRef("workdcntm")) = "false";
  612. grd_matrlist.cellAttribute("disabled", irow, grd_matrlist.colRef("tretmcnt")) = "false";
  613. grd_matrlist.cellAttribute("disabled", irow, grd_matrlist.colRef("ctnryn")) = "false";
  614. grd_matrlist.cellAttribute("disabled", irow, grd_matrlist.colRef("ctnrsignyn")) = "false";
  615. grd_matrlist.cellAttribute("disabled", irow, grd_matrlist.colRef("msdsyn")) = "false";
  616. */
  617. //misfSetReadOnlyCol(grd_etcproflist, "pumno,incmflag,name,rrgstno,paydd,getdd,paytotamt", true, irow);
  618. //grd_matrlist.rowStyle(irow, "all", "background-color") = "#ff99cc";
  619. ]]>
  620. </script>
  621. </button>
  622. <button id="btn_delete" class="btn2_letter6" style="left:1040px; top:55px; width:86px; height:19px; text-align:left; ">
  623. <caption>취소 및 삭제</caption>
  624. <script type="javascript" ev:event="onclick">
  625. <![CDATA[
  626. if(grd_matrlist.Rows <= grd_matrlist.fixedRows) return;
  627. var irow = grd_matrlist.row;
  628. var flag = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("workflag")); //작업구분(N:신규 C:변경 S:중단)
  629. if(flag == "") {
  630. messageBox("취소처리할 작업 내용이 없습니다. 물질을 확인하십시요. ", "E999", "");
  631. return;
  632. } else if(flag == "C") {
  633. //초기화
  634. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("workflag")) = "";
  635. //grd_matrlist.cellStyle("color", irow, grd_matrlist.colRef("workflag")) = "";
  636. grd_matrlist.rowStyle(irow, "all", "color") = "";
  637. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("appdd")) = "";
  638. //조회시의 값으로 setting
  639. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("usge")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orgusge"));
  640. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("useqtym")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orguseqtym"));
  641. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("useqtyy")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orguseqtyy"));
  642. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("trethrd")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orgtrethrd"));
  643. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("workdcntm")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orgworkdcntm"));
  644. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("tretmcnt")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orgtretmcnt"));
  645. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("ctnryn")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orgctnryn"));
  646. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("ctnrsignyn")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orgctnrsignyn"));
  647. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("msdsyn")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orgmsdsyn"));
  648. } else if(flag == "N") {
  649. //삭제
  650. grd_matrlist.deleteRow(irow);
  651. } else if(flag == "S") {
  652. //초기화
  653. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("workflag")) = "";
  654. grd_matrlist.cellStyle("color", irow, grd_matrlist.colRef("workflag")) = "";
  655. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("appdd")) = "";
  656. misfSetReadOnlyCol(grd_matrlist, "usge,useqtym,useqtyy,trethrd,workdcntm,tretmcnt,ctnryn,ctnrsignyn,msdsyn", false, irow);
  657. }
  658. ]]>
  659. </script>
  660. </button>
  661. <caption id="caption2" style="left:16px; top:720px; width:520px; height:20px; ">2. 임시저장한 자료는 수정 및 삭제가 가능하나, 전송 이후에는 수정이 불가합니다.</caption>
  662. <caption id="caption3" style="left:0px; top:700px; width:472px; height:20px; ">※ 1. 작성자 본인의 자료는 수정이 가능하나, 타인이 작성한 자료는 조회만 가능합니다.</caption>
  663. <button id="btn_excel" class="btn2_letter4" navindex="6" style="left:1129px; top:55px; width:64px; height:19px; text-align:left; ">
  664. <caption>엑셀출력</caption>
  665. <script type="javascript" ev:event="onclick">
  666. <![CDATA[
  667. //radfSaveExcel(grd_matrlist);
  668. misfSaveExcel(grd_matrlist, "조사표");
  669. //var fileName = window.fileDialog("save", ",", false, "excel", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  670. //grd_matrlist.saveExcel(fileName,"sheetname:savetype");
  671. ]]>
  672. </script>
  673. </button>
  674. <datagrid id="grd_matrlist" nodeset="/root/main/matrlist" caption="구분^적용시작일자^물질&#xA;코드^물질명^제조사^공급처^용도^월&#xA;사용량^연간&#xA;사용량^1일&#xA;취급시간^월&#xA;작업일수^취급자&#xA;수^소분용기&#xA;유무^원용기&#xA;경고표지^MSDS&#xA;유무^작성자^보고일자^순번^부서코드^작성자ID^orguseqtym^orguseqtyy^orgusge^orgtrethrd^orgworkdcntm^orgtretmcnt^orgctnryn^orgctnrsignyn^orgmsdsyn|구분^적용시작일자^물질&#xA;코드^물질명^제조사^공급처^용도^월&#xA;사용량^연간&#xA;사용량^1일&#xA;취급시간^월&#xA;작업일수^취급자&#xA;수^소분용기&#xA;유무^원용기&#xA;경고표지^MSDS&#xA;유무^작성자^보고일자^순번^부서코드^작성자ID^orguseqtym^orguseqtyy^orgusge^orgtrethrd^orgworkdcntm^orgtretmcnt^orgctnryn^orgctnrsignyn^orgmsdsyn" colsep="^" colwidth="46, 92, 52, 140, 111, 111, 111, 55, 55, 55, 55, 55, 55, 55, 55, 53, 64, 32, 57, 54, 77, 72, 63, 65, 83, 74, 64, 89, 72" mergecellsfixedrows="bycolrec" rowheader="update" rowheight="16" rowsep="|" style="left:0px; top:80px; width:1193px; height:610px; ">
  675. <col disabled="true" ref="workflag" type="combo" style="font-weight:bold; text-align:center; ">
  676. <choices>
  677. <item>
  678. <label>-</label>
  679. <value/>
  680. </item>
  681. <item>
  682. <label>신규</label>
  683. <value>N</value>
  684. </item>
  685. <item>
  686. <label>변경</label>
  687. <value>C</value>
  688. </item>
  689. <item>
  690. <label>중단</label>
  691. <value>S</value>
  692. </item>
  693. </choices>
  694. </col>
  695. <col ref="appdd" type="inputdate" format="yyyy-mm-dd" style="color:#ff0000; text-align:center; "/>
  696. <col editable="false" ref="matrcd" type="inputbutton" style="text-align:center; "/>
  697. <col ref="matrnm"/>
  698. <col ref="prodcmpynm"/>
  699. <col ref="maincustlastsuplplcenm"/>
  700. <col ref="usge" type="input"/>
  701. <col ref="useqtym" type="input" style="text-align:center; "/>
  702. <col ref="useqtyy" type="input" style="text-align:center; "/>
  703. <col ref="trethrd" type="input" style="text-align:center; "/>
  704. <col ref="workdcntm" type="input" style="text-align:center; "/>
  705. <col ref="tretmcnt" type="input" style="text-align:center; "/>
  706. <col ref="ctnryn" type="combo" style="text-align:center; ">
  707. <choices>
  708. <item>
  709. <label>-</label>
  710. <value/>
  711. </item>
  712. <item>
  713. <label>Y</label>
  714. <value>Y</value>
  715. </item>
  716. <item>
  717. <label>N</label>
  718. <value>N</value>
  719. </item>
  720. </choices>
  721. </col>
  722. <col ref="ctnrsignyn" type="combo" style="text-align:center; ">
  723. <choices>
  724. <item>
  725. <label>-</label>
  726. <value/>
  727. </item>
  728. <item>
  729. <label>Y</label>
  730. <value>Y</value>
  731. </item>
  732. <item>
  733. <label>N</label>
  734. <value>N</value>
  735. </item>
  736. </choices>
  737. </col>
  738. <col ref="msdsyn" type="combo" style="text-align:center; ">
  739. <choices>
  740. <item>
  741. <label>-</label>
  742. <value/>
  743. </item>
  744. <item>
  745. <label>Y</label>
  746. <value>Y</value>
  747. </item>
  748. <item>
  749. <label>N</label>
  750. <value>N</value>
  751. </item>
  752. </choices>
  753. </col>
  754. <col ref="fstname" style="text-align:center; "/>
  755. <col ref="reptdd" visibility="hidden"/>
  756. <col ref="reptseq" visibility="hidden"/>
  757. <col ref="deptcd" visibility="hidden"/>
  758. <col ref="fstid" visibility="hidden"/>
  759. <col ref="orguseqtym" visibility="hidden"/>
  760. <col ref="orguseqtyy" visibility="hidden"/>
  761. <col ref="orgusge" visibility="hidden"/>
  762. <col ref="orgtrethrd" visibility="hidden"/>
  763. <col ref="orgworkdcntm" visibility="hidden"/>
  764. <col ref="orgtretmcnt" visibility="hidden"/>
  765. <col ref="orgctnryn" visibility="hidden"/>
  766. <col ref="orgctnrsignyn" visibility="hidden"/>
  767. <col ref="orgmsdsyn" visibility="hidden"/>
  768. <script type="javascript" ev:event="onbuttonclick">
  769. <![CDATA[
  770. if(grd_matrlist.col == grd_matrlist.colRef("matrcd")){
  771. var irow = grd_matrlist.row;
  772. //popup 에 전달할 parameter를 setting한다.
  773. model.setValue("/root/popmatr/returntype", "3"); //prodcmpynm, maincustlastsuplplcenm도 함께 return 받고자 할때, returntype을 "3" 로 설정.
  774. //workFlag 작업구분 - N:신규, C:변경, S:중단
  775. var workFlag = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("workflag"));
  776. if(workFlag == "N") {
  777. model.setValue("/root/popmatr/deptcd", "");
  778. } else {
  779. model.setValue("/root/popmatr/deptcd", ipt_deptcd.value);
  780. }
  781. //selectyn(popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값) 을 초기화함
  782. model.setValue("/root/popmatr/selectyn", "");
  783. //popup 프로그램 호출
  784. window.load("SPRSM00100.xrw", "modal","", "", "/root/popmatr","/root/popdata");
  785. //popup에서 특정 물품코드를 선택한 경우, 해당 물품코드에 대한 상세 사항을 조회해서 그리드에 보여준다.
  786. if(model.getValue("/root/popmatr/selectyn") == "Y") { //popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값
  787. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("matrcd")) = model.getValue("/root/popmatr/matrcd");
  788. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("matrnm")) = model.getValue("/root/popmatr/matrnm");
  789. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("prodcmpynm")) = model.getValue("/root/popmatr/prodcmpynm");
  790. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("maincustlastsuplplcenm")) = model.getValue("/root/popmatr/maincustlastsuplplcenm");
  791. }
  792. }
  793. ]]>
  794. </script>
  795. <script type="javascript" ev:event="xforms-value-changed">
  796. <![CDATA[
  797. //컬럼값 변경시 해당 Cell의 색상 변경
  798. // - 용도, 월사용량, 연간사용량, 1일취급시간, 월작업일수, 취급자수, 소분용기유무, 원용기경고표지, MSDS유무
  799. //var iCol = grd_matrlist.col;
  800. var iRow = grd_matrlist.row;
  801. var iFlagCol = grd_matrlist.colRef("workflag");
  802. var flag = grd_matrlist.valueMatrix(iRow, iFlagCol); //작업구분(N:신규 C:변경 S:중단)
  803. if(flag == "" || flag == "C") {
  804. grd_matrlist.valueMatrix(iRow, iFlagCol) = ""; //우선 workflag를 초기화하고 시작한다.
  805. grd_matrlist.cellStyle("color", iRow, iFlagCol) = ""; //workflag의 Font Color 초기화
  806. fSetStyleAndFlag("usge", iRow, iFlagCol);
  807. fSetStyleAndFlag("useqtym", iRow, iFlagCol);
  808. fSetStyleAndFlag("useqtyy", iRow, iFlagCol);
  809. fSetStyleAndFlag("trethrd", iRow, iFlagCol);
  810. fSetStyleAndFlag("workdcntm", iRow, iFlagCol);
  811. fSetStyleAndFlag("tretmcnt", iRow, iFlagCol);
  812. fSetStyleAndFlag("ctnryn", iRow, iFlagCol);
  813. fSetStyleAndFlag("ctnrsignyn", iRow, iFlagCol);
  814. fSetStyleAndFlag("msdsyn", iRow, iFlagCol);
  815. }
  816. ]]>
  817. </script>
  818. </datagrid>
  819. <button id="btn_insertstop" class="btn2_letter7" style="left:940px; top:55px; width:97px; height:19px; text-align:left; ">
  820. <caption>사용중단 처리</caption>
  821. <script type="javascript" ev:event="onclick">
  822. <![CDATA[
  823. if(grd_matrlist.Rows <= grd_matrlist.fixedRows) return;
  824. var irow = grd_matrlist.row;
  825. var flag = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("workflag")); //작업구분(N:신규 C:변경 S:중단)
  826. if(flag == "") {
  827. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("workflag")) = "S";
  828. grd_matrlist.cellStyle("color", irow, grd_matrlist.colRef("workflag")) = "#ff0000";
  829. misfSetReadOnlyCol(grd_matrlist, "usge,useqtym,useqtyy,trethrd,workdcntm,tretmcnt,ctnryn,ctnrsignyn,msdsyn", true, irow);
  830. } else if(flag == "C") {
  831. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("workflag")) = "S";
  832. grd_matrlist.rowStyle(irow, "all", "color") = "";
  833. grd_matrlist.cellStyle("color", irow, grd_matrlist.colRef("workflag")) = "#ff0000";
  834. misfSetReadOnlyCol(grd_matrlist, "usge,useqtym,useqtyy,trethrd,workdcntm,tretmcnt,ctnryn,ctnrsignyn,msdsyn", true, irow);
  835. //조회시의 값으로 setting
  836. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("usge")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orgusge"));
  837. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("useqtym")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orguseqtym"));
  838. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("useqtyy")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orguseqtyy"));
  839. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("trethrd")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orgtrethrd"));
  840. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("workdcntm")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orgworkdcntm"));
  841. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("tretmcnt")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orgtretmcnt"));
  842. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("ctnryn")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orgctnryn"));
  843. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("ctnrsignyn")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orgctnrsignyn"));
  844. grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("msdsyn")) = grd_matrlist.valueMatrix(irow, grd_matrlist.colRef("orgmsdsyn"));
  845. } else if(flag == "N") {
  846. messageBox("신규추가 물질을 바로 사용중단 처리할 수 없습니다. ", "E999", "");
  847. return;
  848. } else if(flag == "S") {
  849. messageBox("이미 사용중단 처리되었습니다. ", "E999", "");
  850. return;
  851. }
  852. ]]>
  853. </script>
  854. </button>
  855. </group>
  856. <group id="group4" scroll="auto" style="left:0px; top:13; width:1195px; height:27px; ">
  857. <line id="line2" class="line_6" style="x1:0px; y1:25px; x2:1194px; y2:25px; "/>
  858. <button id="btn_save" class="btn4_letter4" style="left:912px; top:3px; width:80px; height:22px; ">
  859. <caption>임시저장</caption>
  860. <script type="javascript" ev:event="DOMActivate">
  861. <![CDATA[
  862. if(grd_matrlist.rows == grd_matrlist.fixedRows) return;
  863. if( fClickSaveBtn() ) {
  864. //임시저장 자료를 조회하여 보여준다.
  865. cbx_temp.value = "Y";
  866. fGetMatrList();//코드 목록 재조회
  867. }
  868. ]]>
  869. </script>
  870. </button>
  871. <button id="btn_send" class="btn4_letter2" disabled="true" style="left:1138px; top:3px; width:56px; height:22px; ">
  872. <caption>전송</caption>
  873. <script type="javascript" ev:event="DOMActivate">
  874. <![CDATA[
  875. if(grd_matrlist.rows == grd_matrlist.fixedRows) return;
  876. if (messageBox("전송처리 이후에는 수정이 불가합니다. 전송하시겠습니까?", "Q999") != 6) return;
  877. /* 2017.07.07 부서장이 전송처리를 하게 되면서 저장 기능을 제외하고, 아래에 구현
  878. if( fClickSaveBtn() ) {
  879. submit("TXRSM01002")
  880. //임시저장 자료를 조회하여 보여준다. submit 성공여부와 무관하게.
  881. cbx_temp.value = "Y";
  882. ipt_reptdd.value = ""; //보고일자 초기화
  883. fGetMatrList();//코드 목록 재조회
  884. }
  885. */
  886. if( submit("TXRSM01002")) {
  887. //임시저장 자료를 조회하여 보여준다.
  888. cbx_temp.value = "Y";
  889. ipt_reptdd.value = ""; //보고일자 초기화
  890. fGetMatrList();//코드 목록 재조회
  891. }
  892. ]]>
  893. </script>
  894. </button>
  895. <button id="btn_saveDelete" class="btn4_letter9" disabled="true" style="left:995px; top:3px; width:140px; height:22px; ">
  896. <caption>임시저장 자료 삭제</caption>
  897. <script type="javascript" ev:event="DOMActivate">
  898. <![CDATA[
  899. if(cbx_temp.value != "Y" || grd_matrlist.rows == grd_matrlist.fixedRows) {
  900. messageBox("먼저 임시저장 자료를 조회한 후, 삭제 작업을 하십시요.", "I999", "");
  901. return;
  902. }
  903. //작성자 본인만이 기존 자료에 추가 또는 수정이 가능하다. 이에 따른 저장버튼과 전송버튼 처리
  904. var sFstid = ""; //최초작성자
  905. if(grd_matrlist.rows > grd_matrlist.fixedRows) {
  906. for(var i = grd_matrlist.fixedRows; i < grd_matrlist.rows; i++) {
  907. if(grd_matrlist.valueMatrix(i, grd_matrlist.colRef("fstid")) != "") {
  908. sFstid = grd_matrlist.valueMatrix(i, grd_matrlist.colRef("fstid"));
  909. break;
  910. }
  911. }
  912. }
  913. //본인이 작성한 자료의 경우에만 임시저장 자료 삭제가 가능하다.
  914. if(sFstid != getUserInfo("userid") ) {
  915. messageBox("본인이 등록한 자료만 삭제가 가능합니다.", "E999", "");
  916. return;
  917. }
  918. if (messageBox("임시저장된 부서 조사표 자료를 삭제하시겠습니까?", "Q999") != 6) return;
  919. if( fClickSaveDeleteBtn() ) {
  920. //임시저장 자료를 조회하여 보여준다.
  921. fGetMatrList();//코드 목록 재조회
  922. }
  923. ]]>
  924. </script>
  925. </button>
  926. </group>
  927. </xhtml:body>
  928. </xhtml:html>