SMRSC01000.js 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750
  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. grp_disp.refresh();
  152. }
  153. //
  154. // 변경여부 Check
  155. //
  156. function fCheckEdit(){
  157. var EditChk = true;
  158. if ( model.getValue(WorkPath + "/depth" ) != model.getValue(CompPath + "/depth" )) return EditChk;
  159. if ( model.getValue(WorkPath + "/goodflag" ) != model.getValue(CompPath + "/goodflag" )) return EditChk;
  160. if ( model.getValue(WorkPath + "/goodflagnm" ) != model.getValue(CompPath + "/goodflagnm" )) return EditChk;
  161. if ( model.getValue(WorkPath + "/lrgcd" ) != model.getValue(CompPath + "/lrgcd" )) return EditChk;
  162. if ( model.getValue(WorkPath + "/lrgnm" ) != model.getValue(CompPath + "/lrgnm" )) return EditChk;
  163. if ( model.getValue(WorkPath + "/mdlcd" ) != model.getValue(CompPath + "/mdlcd" )) return EditChk;
  164. if ( model.getValue(WorkPath + "/mdlnm" ) != model.getValue(CompPath + "/mdlnm" )) return EditChk;
  165. if ( model.getValue(WorkPath + "/smlcd" ) != model.getValue(CompPath + "/smlcd" )) return EditChk;
  166. if ( model.getValue(WorkPath + "/smlnm" ) != model.getValue(CompPath + "/smlnm" )) return EditChk;
  167. if ( model.getValue(WorkPath + "/mainmngtdeptcd") != model.getValue(CompPath + "/mainmngtdeptcd")) return EditChk;
  168. if ( model.getValue(WorkPath + "/mainmngtdeptnm") != model.getValue(CompPath + "/mainmngtdeptnm")) return EditChk;
  169. if ( model.getValue(WorkPath + "/winacnt" ) != model.getValue(CompPath + "/winacnt" )) return EditChk;
  170. if ( model.getValue(WorkPath + "/winacntnm" ) != model.getValue(CompPath + "/winacntnm" )) return EditChk;
  171. if ( model.getValue(WorkPath + "/amtacnt" ) != model.getValue(CompPath + "/amtacnt" )) return EditChk;
  172. if ( model.getValue(WorkPath + "/amtacntnm" ) != model.getValue(CompPath + "/amtacntnm" )) return EditChk;
  173. EditChk = false;
  174. return EditChk;
  175. }
  176. //
  177. // 변경여부 Check
  178. //
  179. function fCompare2Work(){
  180. model.setValue(WorkPath + "/depth" , model.getValue(CompPath + "/depth" ));
  181. model.setValue(WorkPath + "/goodflag" , model.getValue(CompPath + "/goodflag" ));
  182. model.setValue(WorkPath + "/goodflagnm" , model.getValue(CompPath + "/goodflagnm" ));
  183. model.setValue(WorkPath + "/lrgcd" , model.getValue(CompPath + "/lrgcd" ));
  184. model.setValue(WorkPath + "/lrgnm" , model.getValue(CompPath + "/lrgnm" ));
  185. model.setValue(WorkPath + "/mdlcd" , model.getValue(CompPath + "/mdlcd" ));
  186. model.setValue(WorkPath + "/mdlnm" , model.getValue(CompPath + "/mdlnm" ));
  187. model.setValue(WorkPath + "/smlcd" , model.getValue(CompPath + "/smlcd" ));
  188. model.setValue(WorkPath + "/smlnm" , model.getValue(CompPath + "/smlnm" ));
  189. model.setValue(WorkPath + "/mainmngtdeptcd", model.getValue(CompPath + "/mainmngtdeptcd"));
  190. model.setValue(WorkPath + "/mainmngtdeptnm", model.getValue(CompPath + "/mainmngtdeptnm"));
  191. model.setValue(WorkPath + "/winacnt" , model.getValue(CompPath + "/winacnt" ));
  192. model.setValue(WorkPath + "/winacntnm" , model.getValue(CompPath + "/winacntnm" ));
  193. model.setValue(WorkPath + "/amtacnt" , model.getValue(CompPath + "/amtacnt" ));
  194. model.setValue(WorkPath + "/amtacntnm" , model.getValue(CompPath + "/amtacntnm" ));
  195. }
  196. // ------------------------------
  197. // 관리물품선택 Tab Click
  198. // ------------------------------
  199. function fChoisClick(){
  200. var vPcode = "";
  201. var vIdx = -1;
  202. for (var i=0; i<trv_gubn.length; i++)
  203. {
  204. trv_gubn.item(i).checked = 0;
  205. }
  206. // 모든 아이템의 체크된 상태를 해제한다.
  207. if (model.getValue(DataPath + "/jobcls") =="U"){
  208. for(var i=0; i < trv_empdata.length; i++) {
  209. vPcode = model.getValue(ListPath +"["+(i+1)+"]/pcode");
  210. vIdx = fLabelToIndex(vPcode, trv_gubn);
  211. if (vIdx > 0) {
  212. trv_gubn.item(vIdx).checked = 1;
  213. }
  214. }
  215. }
  216. trv_gubn.refresh();
  217. }
  218. // --------------------------------------------------
  219. // 인자로 넘어온 값을 label 로 같은 아이템의 인덱스를 반환
  220. // --------------------------------------------------
  221. function fLabelToIndex(pValue, pTree)
  222. {
  223. for (var i=0; i < pTree.length; i++)
  224. {
  225. if (pTree.item(i).value == pValue)
  226. return i;
  227. }
  228. return -1;
  229. }
  230. // --------------------------------------------------
  231. // GUBUN Tree Click
  232. // --------------------------------------------------
  233. function fGubnTreeClick(fTree, fIdx) {
  234. var Idx = fIdx + 1;
  235. var pIdx = 0;
  236. var sDepth = model.getValue(TreePath +"["+Idx+"]/depth");
  237. var Tree1 = fTree.item(fIdx);
  238. if (sDepth == 1) {
  239. return;
  240. }
  241. //
  242. fTree.item(Tree1.parentindex).checked = 0;
  243. //
  244. if (sDepth == "3") {
  245. Tree2 = fTree.item(Tree1.parentindex);
  246. Tree3 = fTree.item(Tree2.parentindex);
  247. fTree.item(Tree3.index).checked = 0;
  248. }
  249. //----
  250. if (sDepth == "4") {
  251. Tree2 = fTree.item(Tree1.parentindex);
  252. Tree3 = fTree.item(Tree2.parentindex);
  253. fTree.item(Tree3.index).checked = 0;
  254. Tree4 = fTree.item(Tree3.parentindex);
  255. fTree.item(Tree4.index).checked = 0;
  256. }
  257. //----
  258. if (sDepth == "5") {
  259. Tree2 = fTree.item(Tree1.parentindex);
  260. Tree3 = fTree.item(Tree2.parentindex);
  261. fTree.item(Tree3.index).checked = 0;
  262. Tree4 = fTree.item(Tree3.parentindex);
  263. fTree.item(Tree4.index).checked = 0;
  264. Tree5 = fTree.item(Tree4.parentindex);
  265. fTree.item(Tree5.index).checked = 0;
  266. }
  267. // pTree.refresh();
  268. }
  269. // ------------------------------
  270. // 관리물품선택
  271. // ------------------------------
  272. function fChoisData(){
  273. var ii = 1;
  274. var OpCode = "";
  275. var CodeCd = "";
  276. var AppnPath = "/root/WorkData/workinst/AppendLists";
  277. var CopyPath = "/root/WorkData/workinst/CopyList/rscmggbnemplist";
  278. var ApndPath = AppnPath+"/rscmggbnemplist";
  279. model.removenode(AppnPath);
  280. CodeCd = model.getValue(ApndPath +"[pcode='0000']/pcode");
  281. //alert(CodeCd);
  282. for(var i=0; i < trv_gubn.length; i++) {
  283. if (trv_gubn.item(i).checked == 1){
  284. sDepth = model.getValue(TreePath +"["+(i+1)+"]/depth");
  285. OpCode = model.getValue(TreePath +"["+(i+1)+"]/basecd");
  286. CodeCd = model.getValue(ApndPath +"[pcode='"+ OpCode+"']/pcode");
  287. //
  288. if (sDepth == "3") {
  289. if (CodeCd == "") {
  290. Tree2 = trv_gubn.item(i);
  291. ii = fChoisSetData(Tree2.parentindex + 1, ii, "Y");
  292. }
  293. }
  294. //----
  295. if (sDepth == "4") {
  296. if (CodeCd == "") {
  297. Tree2 = trv_gubn.item(i);
  298. Tree3 = trv_gubn.item(Tree2.parentindex);
  299. pIdx2 = Tree3.parentindex + 1;
  300. pIdx3 = Tree2.parentindex + 1;
  301. OpCode = model.getValue(TreePath +"["+pIdx2+"]/pcode");
  302. if (model.getValue(ApndPath +"[pcode='"+ OpCode+"']/pcode") == "") {
  303. ii = fChoisSetData(pIdx2, ii, "Y");
  304. }
  305. ii = fChoisSetData(pIdx3, ii, "Y");
  306. }
  307. }
  308. //----
  309. if (sDepth == "5") {
  310. if (CodeCd == "") {
  311. Tree2 = trv_gubn.item(i); // 자신
  312. Tree3 = trv_gubn.item(Tree2.parentindex);
  313. Tree4 = trv_gubn.item(Tree3.parentindex);
  314. pIdx1 = Tree4.parentindex + 1;
  315. pIdx2 = Tree3.parentindex + 1;
  316. pIdx3 = Tree2.parentindex + 1;
  317. // bbb ="Level3===>>"+pIdx3+":-"+OpCode+"-::-"+CodeCd;
  318. OpCode = model.getValue(TreePath +"["+pIdx1+"]/pcode");
  319. CodeCd = model.getValue(ApndPath +"[pcode='"+ OpCode+"']/pcode");
  320. // aaa ="Level1===>>"+pIdx1+":-"+OpCode+"-::-"+CodeCd;
  321. //
  322. if (CodeCd == "") {
  323. ii = fChoisSetData(pIdx1, ii, "Y");
  324. }
  325. OpCode = model.getValue(TreePath +"["+pIdx2+"]/pcode");
  326. CodeCd = model.getValue(ApndPath +"[pcode='"+ OpCode+"']/pcode");
  327. // aaa +="Level2===>>"+pIdx2+":-"+OpCode+"-::-"+CodeCd;
  328. //
  329. if (CodeCd == "") {
  330. ii = fChoisSetData(pIdx2, ii, "Y");
  331. }
  332. ii = fChoisSetData(pIdx3, ii, "Y");
  333. // alert(aaa+bbb);
  334. }
  335. }
  336. ii = fChoisSetData(i+1, ii, "A");
  337. }
  338. }
  339. pNode = instance1.selectSingleNode(ApndPath);
  340. if (pNode != null) {
  341. model.removeNode(ListPath);
  342. model.makeNode(ListPath);
  343. //
  344. model.setValue(DataPath + "/updateyn" , "Y" );
  345. model.copyNode("/root/main/RscmggbnEmpLists", AppnPath);
  346. bbt_emp.selected="true";
  347. bbt_emp.dispatch("DOMActivate");
  348. // model.removeNode(AppnPath);
  349. btn_save.disabled = false;
  350. trv_empdata.rebuild();
  351. }
  352. }
  353. // ------------------------------
  354. // 관리물품선택
  355. // ------------------------------
  356. function fChoisSetData(pIdx, pRow, pCheckYN){
  357. var AppnPath = "/root/WorkData/workinst/AppendLists";
  358. var CopyPath = "/root/WorkData/workinst/CopyList/rscmggbnemplist";
  359. var ApndPath = AppnPath+"/rscmggbnemplist";
  360. model.setValue(CopyPath+"/depth" , model.getValue(TreePath +"["+pIdx+"]/depth" ));
  361. model.setValue(CopyPath+"/pcode" , model.getValue(TreePath +"["+pIdx+"]/pcode" ));
  362. model.setValue(CopyPath+"/codecd" , model.getValue(TreePath +"["+pIdx+"]/codecd" ));
  363. model.setValue(CopyPath+"/codenm" , model.getValue(TreePath +"["+pIdx+"]/codenm" ));
  364. model.setValue(CopyPath+"/basecd" , model.getValue(TreePath +"["+pIdx+"]/basecd" ));
  365. model.setValue(CopyPath+"/dispnm" , model.getValue(TreePath +"["+pIdx+"]/dispnm" )+ ((pCheckYN == "A") ? "(전체)" : "") );
  366. model.setValue(CopyPath+"/checkyn", pCheckYN);
  367. if (pRow == 1) {
  368. model.makeNode(ApndPath+"["+pRow+"]" );
  369. model.copyNode(ApndPath+"["+pRow+"]", "/root/WorkData/workinst/defaultggbn");
  370. pRow++;
  371. }
  372. model.makeNode(ApndPath+"["+pRow+"]" );
  373. model.copyNode(ApndPath+"["+pRow+"]", CopyPath);
  374. pRow++;
  375. return pRow;
  376. }
  377. // ----------------------------------------------------------------
  378. // 사용자별관리물품권한 자료 저장
  379. // ----------------------------------------------------------------
  380. function fRscmggbnDataSubmit(pCls) {
  381. if ((model.getValue(DataPath + "/emplno") =="") ||
  382. (model.getValue(DataPath + "/emplnm") =="") ) {
  383. messageBox("해당 사원번호를 ", "C001");
  384. return;
  385. }
  386. var pNode = instance1.selectSingleNode(ListPath);
  387. if (pNode == null) {
  388. messageBox("수정(입력)된 자료가 ", "I004");
  389. return;
  390. }
  391. var RscmggbnsList = "status" + "▦" // 1 상태
  392. + "instcd" + "▦" // 2 기관번호
  393. + "emplno" + "▦" // 3 사원번호
  394. + "goodflag" + "▦" // 4 물품구분
  395. + "lrgcd" + "▦" // 5 대분류코드
  396. + "mdlcd" + "▦" // 6 중분류코드
  397. + "smlcd" + "▦" // 7 소분류코드
  398. + "cmt" + "▩"; // 8 비고
  399. var vEmpData2 = ""
  400. var vEmpData1 = pCls + "▦" // 1 상태
  401. + model.getValue(HidePath+"/instcd" )+ "▦" // 2 기관번호
  402. + model.getValue(DataPath+"/emplno" )+ "▦"; // 3 사원번호
  403. //입력
  404. if (pCls == "D") {
  405. vEmpData2 += vEmpData1
  406. + "" + "▦" // 4 물품구분
  407. + "" + "▦" // 5 대분류코드
  408. + "" + "▦" // 6 중분류코드
  409. + "" + "▦" // 7 소분류코드
  410. + "" + "▩"; // 8 비고
  411. } else {
  412. for(var i=0; i < trv_empdata.length; i++) {
  413. sDepth = model.getValue(ListPath +"["+(i+1)+"]/depth");
  414. switch(sDepth) {
  415. case "2" : vGoodflag = model.getValue(ListPath +"["+(i+1)+"]/codecd"); // 4 물품구분
  416. vLrgcd = "%"; // 5 대분류코드
  417. vMdlcd = "%"; // 6 중분류코드
  418. vSmlcd = "%"; // 7 소분류코드
  419. break;
  420. case "3" : vLrgcd = model.getValue(ListPath +"["+(i+1)+"]/codecd"); // 5 대분류코드
  421. vMdlcd = "%"; // 6 중분류코드
  422. vSmlcd = "%"; // 7 소분류코드
  423. break;
  424. case "4" : vMdlcd = model.getValue(ListPath +"["+(i+1)+"]/codecd"); // 6 중분류코드
  425. vSmlcd = "%"; // 7 소분류코드
  426. break;
  427. case "5" : vSmlcd = model.getValue(ListPath +"["+(i+1)+"]/codecd"); // 7 소분류코드
  428. }
  429. //---
  430. if (model.getValue(ListPath +"["+(i+1)+"]/checkyn") == "A") {
  431. vEmpData2 += vEmpData1
  432. + vGoodflag + "▦" // 4 물품구분
  433. + vLrgcd + "▦" // 5 대분류코드
  434. + vMdlcd + "▦" // 6 중분류코드
  435. + vSmlcd + "▦" // 7 소분류코드
  436. + "" + "▩"; // 8 비고
  437. }
  438. }
  439. }
  440. //----
  441. RscmggbnsList += vEmpData2;
  442. model.removenode("/root/send");
  443. model.makeValue("/root/send/rscmggbnlist", RscmggbnsList);
  444. //
  445. if (submit("TXRSC01001", false)) { // 정보저장
  446. messageBox("자료 저장 ", "I002");
  447. // fRscmggbnTree();
  448. }
  449. }
  450. // ----------------------------------------------------------------
  451. // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
  452. // ----------------------------------------------------------------
  453. function fInitialize() {
  454. // grid reset
  455. //misfGridInit(grd_rscmggbn);
  456. //misfGridInit(grd_rscmregb);
  457. //misfGridInit(grd_rscmreus);
  458. //misfGridInit(grd_rscmsude);
  459. //misfGridInit(grd_gooddmnd);
  460. ///////////////////////////////////////////////////////////////////////////////////////////////
  461. // tab1 기관코드 combo setting
  462. //rszfUserInstList(cmb_instcd,getUserInfo("userid")); //사용자소속기관
  463. ///////////////////////////////////////////////////////////////////////////////////////////////
  464. misfComboComCdList("Z0007", cmb_instcd); //전체기관코드
  465. ///////////////////////////////////////////////////////////////////////////////////////////////
  466. //물품구분
  467. //misfComboComCdList("R0025", goodflag); //물품구분
  468. ///////////////////////////////////////////////////////////////////////////////////////////////
  469. //misfGridComboComCdList("R0025",grd_rscmggbn,"goodflag");
  470. // 스위치 오픈 설정.
  471. cse_ggbn.selected=true;
  472. // 막음.황
  473. //rszfGridComboLrgcdList("P", grd_rscmggbn, "lrgcd")
  474. // tab1 .master ,detail set
  475. //misfMsterDetailSet(grd_rscmggbn,null, "TRRSC01001" ,"Y");
  476. // tab2 .master ,detail set
  477. //misfMsterDetailSet(grd_rscmregb,null, "TRRSC01002" ,"Y");
  478. // tab2 master, detail set 청구처리권한 설정
  479. //misfMsterDetailSet(grd_rscmreus, grd_rscmregb, "TRRSC01003", "Y");
  480. // tab2 master, detail set 취합부서 설정
  481. //misfMsterDetailSet(grd_rscmsude, grd_rscmregb, "TRRSC01004", "Y");
  482. //model.setValue(cmb_instcd.attribute("ref") , getUserInfo("dutplceinstcd"));
  483. //model.setValue(opt_purcdmnddeptcd.attribute("ref") , getUserInfo("dutplcecd"));
  484. //model.setValue(opt_purcdmnddeptnm.attribute("ref") , getUserInfo("dutplcenm"));
  485. model.refresh();
  486. }
  487. // ----------------------------------------------------------------
  488. function fCheckRetrieveData(pmsg)
  489. {
  490. if(model.getValue(cmb_instcd.attribute("ref")).length== 0 )
  491. {
  492. if(pmsg == true)
  493. {
  494. messageBox("기관코드를 " ,"C002");
  495. model.setFocus("cmb_instcd");
  496. }
  497. return false;
  498. }
  499. return true;
  500. }
  501. // ----------------------------------------------------------------
  502. function fDefaultSetting(prow)
  503. {
  504. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/purcreqflag",model.getValue("/root/send/gooddmnd/purcreqflag"));
  505. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/instcd" ,model.getValue("/root/send/gooddmnd/instcd") );
  506. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/goodflag" ,model.getValue("/root/send/gooddmnd/goodflag") );
  507. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/purcdmnddd" ,model.getValue("/root/send/gooddmnd/purcdmnddd") );
  508. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/reqdeptcd" ,model.getValue("/root/send/gooddmnd/reqdeptcd") );
  509. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/reqpsn" ,model.getValue("/root/send/gooddmnd/reqpsn") );
  510. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/purcdmndseq",prow);
  511. }
  512. // ----------------------------------------------------------------
  513. function fSettingGoodList(pnode, nodename, userqtynm){
  514. var codynode = instance1.selectNodes(pnode + "/*");
  515. var addRow = grd_gooddmnd.rows - grd_gooddmnd.fixedRows;
  516. if(model.getValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodcd").length > 0)addRow = addRow + 1;
  517. for (var j = 1; j <= codynode.length ; j++) {
  518. if(addRow > grd_gooddmnd.rows - grd_gooddmnd.fixedRows)
  519. {
  520. misfGridIUD(grd_gooddmnd,"A");
  521. addRow = grd_gooddmnd.rows - grd_gooddmnd.fixedRows;
  522. fDefaultSetting(addRow );
  523. }
  524. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodcd" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodcd"));
  525. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodnm" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodnm"));
  526. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodspec" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodspec"));
  527. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodmodel" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodmodel"));
  528. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/prodcmpynm" , model.getValue(pnode +"/" + nodename + "[" + j + "]/prodcmpynm"));
  529. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqpackunit" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purcunit"));
  530. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqpackcnt" , model.getValue(pnode +"/" + nodename + "[" + j + "]/" + userqtynm));
  531. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/requnit" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purcunit"));
  532. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqqty" , model.getValue(pnode +"/" + nodename + "[" + j + "]/" + userqtynm));
  533. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqpackcntperunit" ,1);
  534. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodunitcost" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodunitcost"));
  535. addRow = addRow + 1;
  536. }
  537. model.recalculate();
  538. model.refresh();
  539. }
  540. // ----------------------------------------------------------------
  541. function fCheckSaveData()
  542. {
  543. for(var currow = grd_rscmggbn.fixedRows ; currow < grd_rscmggbn.rows ; currow++)
  544. {
  545. // if (grd_rscmggbn.rowStatus(currow) != '4')
  546. if (grd_rscmggbn.rowStatus(currow) == '1' || grd_rscmggbn.rowStatus(currow) == '2'|| grd_rscmggbn.rowStatus(currow) == '3')
  547. {
  548. if(grd_rscmggbn.valueMatrix(currow , grd_rscmggbn.colRef("emplno")).length == 0)
  549. {
  550. messageBox((currow )+ " 번째 사원번호를 " ,"C001");
  551. grd_rscmggbn.row = currow;
  552. grd_rscmggbn.col= grd_rscmggbn.colRef("emplno");
  553. grd_rscmggbn.editCell();
  554. return false;
  555. }
  556. if(grd_rscmggbn.valueMatrix(currow , grd_rscmggbn.colRef("goodflag")).length == 0)
  557. {
  558. messageBox((currow)+ " 번째 물품구분을 " ,"C001");
  559. grd_rscmggbn.row = currow;
  560. grd_rscmggbn.col= grd_rscmggbn.colRef("goodflag");
  561. grd_rscmggbn.editCell();
  562. return false;
  563. }
  564. if(grd_rscmggbn.valueMatrix(currow , grd_rscmggbn.colRef("lrgcd")).length == 0)
  565. {
  566. messageBox((currow)+ " 번째 대분류코드를 " ,"C001");
  567. grd_rscmggbn.row = currow;
  568. grd_rscmggbn.col= grd_rscmggbn.colRef("lrgcd");
  569. grd_rscmggbn.editCell();
  570. return false;
  571. }
  572. }
  573. }
  574. return true;
  575. }
  576. // trv_base.select(i); 위치...
  577. // trv_base.rebuild();
  578. // if ( btn_trvzoom.attribute("text") == "닫힘" ) {
  579. // trv_base.expandDepth = 0;
  580. // btn_trvzoom.attribute("text") = "펼침";
  581. //
  582. // } else {
  583. // trv_base.expandDepth = -1;
  584. // btn_trvzoom.attribute("text") = "닫힘";
  585. // }
  586. /* ------------------------------------------------- */
  587. /* ------End Of List ------------------------------- */
  588. /* -------------------------------------------------- */