SMRSC01000.js 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749
  1. /* ---------------------------------------------------------------------
  2. SMRSC0100_사용자별관리물품권한.xrw (SMRSC0100.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By Francis Choi
  6. : 2015.05.02
  7. ---------------------------------------------------------------------- */
  8. var xAuth = !(checkAuth("X"));
  9. var pAuth = !(checkAuth("P"));
  10. var DataPath = "/root/main/RscmggbnEmpData";
  11. var MainPath = "/root/main/RscmggbnLists/rscmggbnlist";
  12. var ListsPath = "/root/main/RscmggbnEmpLists";
  13. var ListPath = "/root/main/RscmggbnEmpLists/rscmggbnemplist";
  14. var HidePath = "/root/WorkData/HideData";
  15. var TreePath = "/root/main/RscmgubnLists/TreeList";
  16. var WorkPath = "/root/init/WorkInit";
  17. var CompPath = "/root/init/CompareInit";
  18. var MIS_ADM1 = "20902001"; // MIS 담당자[CHR]
  19. var MIS_ADM2 = "10109410"; // MIS 담당자[LHM]
  20. // --------------------------------------------------
  21. // Tree정보 가져오기
  22. // --------------------------------------------------
  23. function fInit() {
  24. fInitialize();
  25. // grp_lag.disabled = true;
  26. // grp_dept.disabled = true;
  27. // grp_mdl.disabled = true;
  28. // grp_sml.disabled = true;
  29. // grp_anct.disabled = true;
  30. // btn_save.disabled = !(checkAuth("X"));
  31. // btn_cdclssysrgst.disabled = !(checkAuth("P"));
  32. var vInstCd = getUserInfo("dutplceinstcd"); // 기관코드
  33. model.setValue(HidePath + "/instcd" , vInstCd ); // 기관코드
  34. model.setValue(HidePath + "/deptcd" , getUserInfo("dutplcecd") ); // 부서코드
  35. model.setValue(HidePath + "/deptnm" , getUserInfo("dutplcenm") ); // 부서명
  36. var vUserId = getUserInfo("userid"); // 기관코드
  37. if ( (vUserId == MIS_ADM1) ||(vUserId == MIS_ADM2) )
  38. cmb_instcd.disabled = false;
  39. model.removenode("/root/send");
  40. model.makeValue("/root/send/goodflag","" ); // 메시지종류
  41. model.makeValue("/root/send/treeflag","A" ); // 트리구분 T: TREE, L: LARGE
  42. // model.makeValue("/root/send/emplno" ,getUserInfo("userid")); // 사원번호
  43. submit("TRRSC05104"); // Tree Data 정보를 가져온다.
  44. fRscmggbnTree();
  45. model.refresh();
  46. }
  47. // --------------------------------------------------
  48. // 사용자별관리물품권한를 TREE 조회
  49. // --------------------------------------------------
  50. function fRscmggbnTree() {
  51. model.removenode("/root/send");
  52. model.makeValue("/root/send/viewcls",model.getValue(HidePath + "/viewcls")); // 트리구성구분 E:사번,G:물품구분
  53. if( model.getValue( cmb_instcd.attribute("ref") ) != null && model.getValue( cmb_instcd.attribute("ref") ) != "" )
  54. model.makeValue("/root/send/instcd" ,model.getValue( cmb_instcd.attribute("ref") ) ); // 기관코드
  55. else
  56. model.makeValue("/root/send/instcd" ,getUserInfo("dutplceinstcd") ); // 기관코드
  57. if( model.getValue( ipt_deptcd.attribute("ref") ) != null && model.getValue( ipt_deptcd.attribute("ref") ) != "" )
  58. model.makeValue("/root/send/deptcd" ,model.getValue( ipt_deptcd.attribute("ref") ) ); // 부서코드
  59. else
  60. model.makeValue("/root/send/deptcd" ,getUserInfo("dutplcecd" ) ); // 부서코드
  61. submit("TRRSC01005"); // Tree Data 정보를 가져온다.
  62. trv_setcode.refresh();
  63. }
  64. // --------------------------------------------------
  65. // Tree Click
  66. // --------------------------------------------------
  67. function fTreeClick(pIdx) {
  68. var OpCode = "";
  69. var OpDepth = "";
  70. var vDepth = "";
  71. var vGoodflag = "";
  72. var vGoodflagnm = "";
  73. var vLrgcd = "";
  74. var vLrgnm = "";
  75. var vMdlcd = "";
  76. var vMdlnm = "";
  77. var vSmlcd = "";
  78. var vSmlnm = "";
  79. var vMainmngtdeptcd = "";
  80. var vMainmngtdeptnm = "";
  81. var vWinacnt = "";
  82. var vWinacntnm = "";
  83. var vAmtacnt = "";
  84. var vAmtacntnm = "";
  85. var Idx = pIdx + 1;
  86. bbt_append.disabled = false;
  87. bbt_delete.disabled = false;
  88. model.setValue(DataPath + "/jobcls" , "I");
  89. model.setValue(DataPath + "/updateyn" , "N");
  90. var sDepth = model.getValue(MainPath +"["+Idx+"]/depth");
  91. var vCodeCd = model.getValue(MainPath +"["+Idx+"]/codecd");
  92. var vCodeNm = model.getValue(MainPath +"["+Idx+"]/codenm");
  93. var vBaseCd = model.getValue(MainPath +"["+Idx+"]/basecd");
  94. btn_save.disabled = true;
  95. bbt_delete.disabled = true;
  96. // cmb_instcd.disabled = true;
  97. cmb_emplno.disabled = true;
  98. btn_winpsn.disabled = true;
  99. model.setValue(DataPath + "/depth" , sDepth);
  100. if (sDepth == "1") {
  101. model.setValue(DataPath + "/instcd" , vCodeCd);
  102. bbt_append.disabled = false;
  103. cmb_emplno.disabled = false;
  104. btn_winpsn.disabled = false;
  105. return;
  106. }
  107. //
  108. model.setValue(DataPath + "/jobcls" , "U");
  109. model.setValue(DataPath + "/depth" , sDepth);
  110. if (sDepth == "2") {
  111. model.setValue(DataPath + "/emplno" , vCodeCd);
  112. model.setValue(DataPath + "/emplnm" , vCodeNm);
  113. }
  114. //
  115. if (sDepth == "3") {
  116. model.setValue(DataPath + "/emplno" , model.getValue(MainPath +"["+Idx+"]/emplno"));
  117. model.setValue(DataPath + "/emplnm" , model.getValue(MainPath +"["+Idx+"]/usernm"));
  118. }
  119. model.removenode("/root/send");
  120. model.makeValue("/root/send/instcd" ,model.getValue(HidePath+"/instcd" )); // "기관코드
  121. model.makeValue("/root/send/emplno" ,model.getValue(DataPath+"/emplno" )); // "사원번호
  122. submit("TRRSC01006"); // Tree Data 정보를 가져온다.
  123. // btn_save.disabled = false;
  124. // bbt_delete.disabled = false;
  125. trv_empdata.rebuild();
  126. //
  127. grp_disp.refresh();
  128. }
  129. // --------------------------------------------------
  130. // Append Data
  131. // --------------------------------------------------
  132. function fAppendData() {
  133. var sDepth = model.getValue(DataPath + "/depth");
  134. bbt_append.disabled = true;
  135. if (sDepth == "") {
  136. alert("상위 분류를 선택 하십시요!! ");
  137. return;
  138. }
  139. //
  140. if (model.getValue(DataPath + "/updateyn")){
  141. if (messageBox("데이터가 변경 되었습니다. ", "Q003") == "2") return;
  142. }
  143. //
  144. model.removeNode(ListsPath);
  145. model.setValue(DataPath + "/emplno" , "" );
  146. model.setValue(DataPath + "/emplnm" , "" );
  147. model.setValue(DataPath + "/updateyn" , "Y");
  148. btn_save.disabled = false;
  149. bbt_delete.disabled = true;
  150. cmb_emplno.disabled = false;
  151. btn_winpsn.disabled = false;
  152. bbt_sel.selected="true";
  153. bbt_sel.dispatch("DOMActivate");
  154. model.setFocus("cmb_emplno")
  155. grp_disp.refresh();
  156. }
  157. //
  158. // 변경여부 Check
  159. //
  160. function fCheckEdit(){
  161. var EditChk = true;
  162. if ( model.getValue(WorkPath + "/depth" ) != model.getValue(CompPath + "/depth" )) return EditChk;
  163. if ( model.getValue(WorkPath + "/goodflag" ) != model.getValue(CompPath + "/goodflag" )) return EditChk;
  164. if ( model.getValue(WorkPath + "/goodflagnm" ) != model.getValue(CompPath + "/goodflagnm" )) return EditChk;
  165. if ( model.getValue(WorkPath + "/lrgcd" ) != model.getValue(CompPath + "/lrgcd" )) return EditChk;
  166. if ( model.getValue(WorkPath + "/lrgnm" ) != model.getValue(CompPath + "/lrgnm" )) return EditChk;
  167. if ( model.getValue(WorkPath + "/mdlcd" ) != model.getValue(CompPath + "/mdlcd" )) return EditChk;
  168. if ( model.getValue(WorkPath + "/mdlnm" ) != model.getValue(CompPath + "/mdlnm" )) return EditChk;
  169. if ( model.getValue(WorkPath + "/smlcd" ) != model.getValue(CompPath + "/smlcd" )) return EditChk;
  170. if ( model.getValue(WorkPath + "/smlnm" ) != model.getValue(CompPath + "/smlnm" )) return EditChk;
  171. if ( model.getValue(WorkPath + "/mainmngtdeptcd") != model.getValue(CompPath + "/mainmngtdeptcd")) return EditChk;
  172. if ( model.getValue(WorkPath + "/mainmngtdeptnm") != model.getValue(CompPath + "/mainmngtdeptnm")) return EditChk;
  173. if ( model.getValue(WorkPath + "/winacnt" ) != model.getValue(CompPath + "/winacnt" )) return EditChk;
  174. if ( model.getValue(WorkPath + "/winacntnm" ) != model.getValue(CompPath + "/winacntnm" )) return EditChk;
  175. if ( model.getValue(WorkPath + "/amtacnt" ) != model.getValue(CompPath + "/amtacnt" )) return EditChk;
  176. if ( model.getValue(WorkPath + "/amtacntnm" ) != model.getValue(CompPath + "/amtacntnm" )) return EditChk;
  177. EditChk = false;
  178. return EditChk;
  179. }
  180. //
  181. // 변경여부 Check
  182. //
  183. function fCompare2Work(){
  184. model.setValue(WorkPath + "/depth" , model.getValue(CompPath + "/depth" ));
  185. model.setValue(WorkPath + "/goodflag" , model.getValue(CompPath + "/goodflag" ));
  186. model.setValue(WorkPath + "/goodflagnm" , model.getValue(CompPath + "/goodflagnm" ));
  187. model.setValue(WorkPath + "/lrgcd" , model.getValue(CompPath + "/lrgcd" ));
  188. model.setValue(WorkPath + "/lrgnm" , model.getValue(CompPath + "/lrgnm" ));
  189. model.setValue(WorkPath + "/mdlcd" , model.getValue(CompPath + "/mdlcd" ));
  190. model.setValue(WorkPath + "/mdlnm" , model.getValue(CompPath + "/mdlnm" ));
  191. model.setValue(WorkPath + "/smlcd" , model.getValue(CompPath + "/smlcd" ));
  192. model.setValue(WorkPath + "/smlnm" , model.getValue(CompPath + "/smlnm" ));
  193. model.setValue(WorkPath + "/mainmngtdeptcd", model.getValue(CompPath + "/mainmngtdeptcd"));
  194. model.setValue(WorkPath + "/mainmngtdeptnm", model.getValue(CompPath + "/mainmngtdeptnm"));
  195. model.setValue(WorkPath + "/winacnt" , model.getValue(CompPath + "/winacnt" ));
  196. model.setValue(WorkPath + "/winacntnm" , model.getValue(CompPath + "/winacntnm" ));
  197. model.setValue(WorkPath + "/amtacnt" , model.getValue(CompPath + "/amtacnt" ));
  198. model.setValue(WorkPath + "/amtacntnm" , model.getValue(CompPath + "/amtacntnm" ));
  199. }
  200. // ------------------------------
  201. // 관리물품선택 Tab Click
  202. // ------------------------------
  203. function fChoisClick(){
  204. var vPcode = "";
  205. var vIdx = -1;
  206. for (var i=0; i<trv_gubn.length; i++)
  207. {
  208. trv_gubn.item(i).checked = 0;
  209. }
  210. // 모든 아이템의 체크된 상태를 해제한다.
  211. if (model.getValue(DataPath + "/jobcls") =="U"){
  212. for(var i=0; i < trv_empdata.length; i++) {
  213. vPcode = model.getValue(ListPath +"["+(i+1)+"]/pcode");
  214. vChkyn = model.getValue(ListPath +"["+(i+1)+"]/checkyn");
  215. if(vChkyn == "A") {
  216. vIdx = fLabelToIndex(vPcode, trv_gubn);
  217. if (vIdx > 0) {
  218. trv_gubn.item(vIdx).checked = 1;
  219. }
  220. }
  221. }
  222. }
  223. trv_gubn.refresh();
  224. }
  225. // --------------------------------------------------
  226. // 인자로 넘어온 값을 label 로 같은 아이템의 인덱스를 반환
  227. // --------------------------------------------------
  228. function fLabelToIndex(pValue, pTree)
  229. {
  230. for (var i=0; i < pTree.length; i++)
  231. {
  232. if (pTree.item(i).value == pValue)
  233. return i;
  234. }
  235. return -1;
  236. }
  237. // --------------------------------------------------
  238. // GUBUN Tree Click
  239. // --------------------------------------------------
  240. function fGubnTreeClick(fTree, fIdx) {
  241. var Idx = fIdx + 1;
  242. var pIdx = 0;
  243. var sDepth = model.getValue(TreePath +"["+Idx+"]/depth");
  244. var Tree1 = fTree.item(fIdx);
  245. if (sDepth == 1) {
  246. return;
  247. }
  248. fTree.item(Tree1.parentindex).checked = 0;
  249. if (sDepth == "3") {
  250. Tree2 = fTree.item(Tree1.parentindex);
  251. Tree3 = fTree.item(Tree2.parentindex);
  252. fTree.item(Tree3.index).checked = 0;
  253. }
  254. if (sDepth == "4") {
  255. Tree2 = fTree.item(Tree1.parentindex);
  256. Tree3 = fTree.item(Tree2.parentindex);
  257. fTree.item(Tree3.index).checked = 0;
  258. Tree4 = fTree.item(Tree3.parentindex);
  259. fTree.item(Tree4.index).checked = 0;
  260. }
  261. if (sDepth == "5") {
  262. Tree2 = fTree.item(Tree1.parentindex);
  263. Tree3 = fTree.item(Tree2.parentindex);
  264. fTree.item(Tree3.index).checked = 0;
  265. Tree4 = fTree.item(Tree3.parentindex);
  266. fTree.item(Tree4.index).checked = 0;
  267. Tree5 = fTree.item(Tree4.parentindex);
  268. fTree.item(Tree5.index).checked = 0;
  269. }
  270. // pTree.refresh();
  271. }
  272. // ------------------------------
  273. // 관리물품선택
  274. // ------------------------------
  275. function fChoisData() {
  276. var ii = 1;
  277. var OpCode = "";
  278. var CodeCd = "";
  279. var AppnPath = "/root/WorkData/workinst/AppendLists";
  280. var CopyPath = "/root/WorkData/workinst/CopyList/rscmggbnemplist";
  281. var ApndPath = AppnPath+"/rscmggbnemplist";
  282. model.removenode(AppnPath);
  283. CodeCd = model.getValue(ApndPath +"[pcode='0000']/pcode");
  284. for(var i=0; i < trv_gubn.length; i++) {
  285. if (trv_gubn.item(i).checked == 1){
  286. sDepth = model.getValue(TreePath +"["+(i+1)+"]/depth");
  287. OpCode = model.getValue(TreePath +"["+(i+1)+"]/basecd");
  288. CodeCd = model.getValue(ApndPath +"[pcode='"+ OpCode+"']/pcode");
  289. //
  290. if (sDepth == "3") {
  291. if (CodeCd == "") {
  292. Tree2 = trv_gubn.item(i);
  293. ii = fChoisSetData(Tree2.parentindex + 1, ii, "Y");
  294. }
  295. }
  296. //----
  297. if (sDepth == "4") {
  298. if (CodeCd == "") {
  299. Tree2 = trv_gubn.item(i);
  300. Tree3 = trv_gubn.item(Tree2.parentindex);
  301. pIdx2 = Tree3.parentindex + 1;
  302. pIdx3 = Tree2.parentindex + 1;
  303. OpCode = model.getValue(TreePath +"["+pIdx2+"]/pcode");
  304. if (model.getValue(ApndPath +"[pcode='"+ OpCode+"']/pcode") == "") {
  305. ii = fChoisSetData(pIdx2, ii, "Y");
  306. }
  307. ii = fChoisSetData(pIdx3, ii, "Y");
  308. }
  309. }
  310. //----
  311. if (sDepth == "5") {
  312. if (CodeCd == "") {
  313. Tree2 = trv_gubn.item(i); // 자신
  314. Tree3 = trv_gubn.item(Tree2.parentindex);
  315. Tree4 = trv_gubn.item(Tree3.parentindex);
  316. pIdx1 = Tree4.parentindex + 1;
  317. pIdx2 = Tree3.parentindex + 1;
  318. pIdx3 = Tree2.parentindex + 1;
  319. // bbb ="Level3===>>"+pIdx3+":-"+OpCode+"-::-"+CodeCd;
  320. OpCode = model.getValue(TreePath +"["+pIdx1+"]/pcode");
  321. CodeCd = model.getValue(ApndPath +"[pcode='"+ OpCode+"']/pcode");
  322. // aaa ="Level1===>>"+pIdx1+":-"+OpCode+"-::-"+CodeCd;
  323. //
  324. if (CodeCd == "") {
  325. ii = fChoisSetData(pIdx1, ii, "Y");
  326. }
  327. OpCode = model.getValue(TreePath +"["+pIdx2+"]/pcode");
  328. CodeCd = model.getValue(ApndPath +"[pcode='"+ OpCode+"']/pcode");
  329. // aaa +="Level2===>>"+pIdx2+":-"+OpCode+"-::-"+CodeCd;
  330. //
  331. if (CodeCd == "") {
  332. ii = fChoisSetData(pIdx2, ii, "Y");
  333. }
  334. ii = fChoisSetData(pIdx3, ii, "Y");
  335. // alert(aaa+bbb);
  336. }
  337. }
  338. ii = fChoisSetData(i+1, ii, "A");
  339. }
  340. }
  341. pNode = instance1.selectSingleNode(ApndPath);
  342. if (pNode != null) {
  343. model.removeNode(ListPath);
  344. model.makeNode(ListPath);
  345. //
  346. model.setValue(DataPath + "/updateyn" , "Y" );
  347. model.copyNode("/root/main/RscmggbnEmpLists", AppnPath);
  348. //bbt_emp.selected="true";
  349. //bbt_emp.dispatch("DOMActivate");
  350. // model.removeNode(AppnPath);
  351. btn_save.disabled = false;
  352. trv_empdata.rebuild();
  353. }
  354. }
  355. // ------------------------------
  356. // 관리물품선택
  357. // ------------------------------
  358. function fChoisSetData(pIdx, pRow, pCheckYN){
  359. var AppnPath = "/root/WorkData/workinst/AppendLists";
  360. var CopyPath = "/root/WorkData/workinst/CopyList/rscmggbnemplist";
  361. var ApndPath = AppnPath+"/rscmggbnemplist";
  362. model.setValue(CopyPath+"/depth" , model.getValue(TreePath +"["+pIdx+"]/depth" ));
  363. model.setValue(CopyPath+"/pcode" , model.getValue(TreePath +"["+pIdx+"]/pcode" ));
  364. model.setValue(CopyPath+"/codecd" , model.getValue(TreePath +"["+pIdx+"]/codecd" ));
  365. model.setValue(CopyPath+"/codenm" , model.getValue(TreePath +"["+pIdx+"]/codenm" ));
  366. model.setValue(CopyPath+"/basecd" , model.getValue(TreePath +"["+pIdx+"]/basecd" ));
  367. model.setValue(CopyPath+"/dispnm" , model.getValue(TreePath +"["+pIdx+"]/dispnm" )+ ((pCheckYN == "A") ? "(전체)" : "") );
  368. model.setValue(CopyPath+"/checkyn", pCheckYN);
  369. if (pRow == 1) {
  370. model.makeNode(ApndPath+"["+pRow+"]" );
  371. model.copyNode(ApndPath+"["+pRow+"]", "/root/WorkData/workinst/defaultggbn");
  372. pRow++;
  373. }
  374. model.makeNode(ApndPath+"["+pRow+"]" );
  375. model.copyNode(ApndPath+"["+pRow+"]", CopyPath);
  376. pRow++;
  377. return pRow;
  378. }
  379. // ----------------------------------------------------------------
  380. // 사용자별관리물품권한 자료 저장
  381. // ----------------------------------------------------------------
  382. function fRscmggbnDataSubmit(pCls) {
  383. if(trv_data.selectedIndex == 1) { // case2 선택시 선택버튼 클릭
  384. fChoisData();
  385. }
  386. if ((model.getValue(DataPath + "/emplno") =="") ||
  387. (model.getValue(DataPath + "/emplnm") =="") ) {
  388. messageBox("해당 사원번호를 ", "C001");
  389. return;
  390. }
  391. var pNode = instance1.selectSingleNode(ListPath);
  392. if (pNode == null) {
  393. messageBox("수정(입력)된 자료가 ", "I004");
  394. return;
  395. }
  396. var RscmggbnsList = "status" + "▦" // 1 상태
  397. + "instcd" + "▦" // 2 기관번호
  398. + "emplno" + "▦" // 3 사원번호
  399. + "goodflag" + "▦" // 4 물품구분
  400. + "lrgcd" + "▦" // 5 대분류코드
  401. + "mdlcd" + "▦" // 6 중분류코드
  402. + "smlcd" + "▦" // 7 소분류코드
  403. + "cmt" + "▩"; // 8 비고
  404. var vEmpData2 = ""
  405. var vEmpData1 = pCls + "▦" // 1 상태
  406. + model.getValue(HidePath+"/instcd" )+ "▦" // 2 기관번호
  407. + model.getValue(DataPath+"/emplno" )+ "▦"; // 3 사원번호
  408. //입력
  409. if (pCls == "D") {
  410. vEmpData2 += vEmpData1
  411. + "" + "▦" // 4 물품구분
  412. + "" + "▦" // 5 대분류코드
  413. + "" + "▦" // 6 중분류코드
  414. + "" + "▦" // 7 소분류코드
  415. + "" + "▩"; // 8 비고
  416. } else {
  417. for(var i=0; i < trv_empdata.length; i++) {
  418. sDepth = model.getValue(ListPath +"["+(i+1)+"]/depth");
  419. switch(sDepth) {
  420. case "2" : vGoodflag = model.getValue(ListPath +"["+(i+1)+"]/codecd"); // 4 물품구분
  421. vLrgcd = "%"; // 5 대분류코드
  422. vMdlcd = "%"; // 6 중분류코드
  423. vSmlcd = "%"; // 7 소분류코드
  424. break;
  425. case "3" : vLrgcd = model.getValue(ListPath +"["+(i+1)+"]/codecd"); // 5 대분류코드
  426. vMdlcd = "%"; // 6 중분류코드
  427. vSmlcd = "%"; // 7 소분류코드
  428. break;
  429. case "4" : vMdlcd = model.getValue(ListPath +"["+(i+1)+"]/codecd"); // 6 중분류코드
  430. vSmlcd = "%"; // 7 소분류코드
  431. break;
  432. case "5" : vSmlcd = model.getValue(ListPath +"["+(i+1)+"]/codecd"); // 7 소분류코드
  433. }
  434. //---
  435. if (model.getValue(ListPath +"["+(i+1)+"]/checkyn") == "A") {
  436. vEmpData2 += vEmpData1
  437. + vGoodflag + "▦" // 4 물품구분
  438. + vLrgcd + "▦" // 5 대분류코드
  439. + vMdlcd + "▦" // 6 중분류코드
  440. + vSmlcd + "▦" // 7 소분류코드
  441. + "" + "▩"; // 8 비고
  442. }
  443. }
  444. }
  445. //----
  446. RscmggbnsList += vEmpData2;
  447. model.removenode("/root/send");
  448. model.makeValue("/root/send/rscmggbnlist", RscmggbnsList);
  449. //
  450. if (submit("TXRSC01001", false)) { // 정보저장
  451. messageBox("자료 저장 ", "I002");
  452. // fRscmggbnTree();
  453. }
  454. }
  455. // ----------------------------------------------------------------
  456. // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
  457. // ----------------------------------------------------------------
  458. function fInitialize() {
  459. // grid reset
  460. //misfGridInit(grd_rscmggbn);
  461. //misfGridInit(grd_rscmregb);
  462. //misfGridInit(grd_rscmreus);
  463. //misfGridInit(grd_rscmsude);
  464. //misfGridInit(grd_gooddmnd);
  465. ///////////////////////////////////////////////////////////////////////////////////////////////
  466. // tab1 기관코드 combo setting
  467. //rszfUserInstList(cmb_instcd,getUserInfo("userid")); //사용자소속기관
  468. ///////////////////////////////////////////////////////////////////////////////////////////////
  469. misfComboComCdList("Z0007", cmb_instcd); //전체기관코드
  470. ///////////////////////////////////////////////////////////////////////////////////////////////
  471. //물품구분
  472. //misfComboComCdList("R0025", goodflag); //물품구분
  473. ///////////////////////////////////////////////////////////////////////////////////////////////
  474. //misfGridComboComCdList("R0025",grd_rscmggbn,"goodflag");
  475. // 스위치 오픈 설정.
  476. cse_ggbn.selected=true;
  477. // 막음.황
  478. //rszfGridComboLrgcdList("P", grd_rscmggbn, "lrgcd")
  479. // tab1 .master ,detail set
  480. //misfMsterDetailSet(grd_rscmggbn,null, "TRRSC01001" ,"Y");
  481. // tab2 .master ,detail set
  482. //misfMsterDetailSet(grd_rscmregb,null, "TRRSC01002" ,"Y");
  483. // tab2 master, detail set 청구처리권한 설정
  484. //misfMsterDetailSet(grd_rscmreus, grd_rscmregb, "TRRSC01003", "Y");
  485. // tab2 master, detail set 취합부서 설정
  486. //misfMsterDetailSet(grd_rscmsude, grd_rscmregb, "TRRSC01004", "Y");
  487. //model.setValue(cmb_instcd.attribute("ref") , getUserInfo("dutplceinstcd"));
  488. //model.setValue(opt_purcdmnddeptcd.attribute("ref") , getUserInfo("dutplcecd"));
  489. //model.setValue(opt_purcdmnddeptnm.attribute("ref") , getUserInfo("dutplcenm"));
  490. model.refresh();
  491. }
  492. // ----------------------------------------------------------------
  493. function fCheckRetrieveData(pmsg)
  494. {
  495. if(model.getValue(cmb_instcd.attribute("ref")).length== 0 )
  496. {
  497. if(pmsg == true)
  498. {
  499. messageBox("기관코드를 " ,"C002");
  500. model.setFocus("cmb_instcd");
  501. }
  502. return false;
  503. }
  504. return true;
  505. }
  506. // ----------------------------------------------------------------
  507. function fDefaultSetting(prow)
  508. {
  509. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/purcreqflag",model.getValue("/root/send/gooddmnd/purcreqflag"));
  510. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/instcd" ,model.getValue("/root/send/gooddmnd/instcd") );
  511. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/goodflag" ,model.getValue("/root/send/gooddmnd/goodflag") );
  512. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/purcdmnddd" ,model.getValue("/root/send/gooddmnd/purcdmnddd") );
  513. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/reqdeptcd" ,model.getValue("/root/send/gooddmnd/reqdeptcd") );
  514. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/reqpsn" ,model.getValue("/root/send/gooddmnd/reqpsn") );
  515. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/purcdmndseq",prow);
  516. }
  517. // ----------------------------------------------------------------
  518. function fSettingGoodList(pnode, nodename, userqtynm){
  519. var codynode = instance1.selectNodes(pnode + "/*");
  520. var addRow = grd_gooddmnd.rows - grd_gooddmnd.fixedRows;
  521. if(model.getValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodcd").length > 0)addRow = addRow + 1;
  522. for (var j = 1; j <= codynode.length ; j++) {
  523. if(addRow > grd_gooddmnd.rows - grd_gooddmnd.fixedRows)
  524. {
  525. misfGridIUD(grd_gooddmnd,"A");
  526. addRow = grd_gooddmnd.rows - grd_gooddmnd.fixedRows;
  527. fDefaultSetting(addRow );
  528. }
  529. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodcd" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodcd"));
  530. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodnm" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodnm"));
  531. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodspec" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodspec"));
  532. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodmodel" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodmodel"));
  533. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/prodcmpynm" , model.getValue(pnode +"/" + nodename + "[" + j + "]/prodcmpynm"));
  534. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqpackunit" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purcunit"));
  535. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqpackcnt" , model.getValue(pnode +"/" + nodename + "[" + j + "]/" + userqtynm));
  536. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/requnit" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purcunit"));
  537. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqqty" , model.getValue(pnode +"/" + nodename + "[" + j + "]/" + userqtynm));
  538. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqpackcntperunit" ,1);
  539. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodunitcost" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodunitcost"));
  540. addRow = addRow + 1;
  541. }
  542. model.recalculate();
  543. model.refresh();
  544. }
  545. // ----------------------------------------------------------------
  546. function fCheckSaveData()
  547. {
  548. for(var currow = grd_rscmggbn.fixedRows ; currow < grd_rscmggbn.rows ; currow++)
  549. {
  550. // if (grd_rscmggbn.rowStatus(currow) != '4')
  551. if (grd_rscmggbn.rowStatus(currow) == '1' || grd_rscmggbn.rowStatus(currow) == '2'|| grd_rscmggbn.rowStatus(currow) == '3')
  552. {
  553. if(grd_rscmggbn.valueMatrix(currow , grd_rscmggbn.colRef("emplno")).length == 0)
  554. {
  555. messageBox((currow )+ " 번째 사원번호를 " ,"C001");
  556. grd_rscmggbn.row = currow;
  557. grd_rscmggbn.col= grd_rscmggbn.colRef("emplno");
  558. grd_rscmggbn.editCell();
  559. return false;
  560. }
  561. if(grd_rscmggbn.valueMatrix(currow , grd_rscmggbn.colRef("goodflag")).length == 0)
  562. {
  563. messageBox((currow)+ " 번째 물품구분을 " ,"C001");
  564. grd_rscmggbn.row = currow;
  565. grd_rscmggbn.col= grd_rscmggbn.colRef("goodflag");
  566. grd_rscmggbn.editCell();
  567. return false;
  568. }
  569. if(grd_rscmggbn.valueMatrix(currow , grd_rscmggbn.colRef("lrgcd")).length == 0)
  570. {
  571. messageBox((currow)+ " 번째 대분류코드를 " ,"C001");
  572. grd_rscmggbn.row = currow;
  573. grd_rscmggbn.col= grd_rscmggbn.colRef("lrgcd");
  574. grd_rscmggbn.editCell();
  575. return false;
  576. }
  577. }
  578. }
  579. return true;
  580. }
  581. // trv_base.select(i); 위치...
  582. // trv_base.rebuild();
  583. // if ( btn_trvzoom.attribute("text") == "닫힘" ) {
  584. // trv_base.expandDepth = 0;
  585. // btn_trvzoom.attribute("text") = "펼침";
  586. //
  587. // } else {
  588. // trv_base.expandDepth = -1;
  589. // btn_trvzoom.attribute("text") = "닫힘";
  590. // }
  591. /* ------------------------------------------------- */
  592. /* ------End Of List ------------------------------- */
  593. /* -------------------------------------------------- */