SMRSC01000.xjs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Script type="xscript4.0"><![CDATA[/* ---------------------------------------------------------------------
  3. SMRSC0100_사용자별관리물품권한.xrw (SMRSC0100.xfm - JScript )
  4. - Version :
  5. 1) : Ver.1.00.01
  6. : Create By Francis Choi
  7. : 2015.05.02
  8. ---------------------------------------------------------------------- */
  9. var xAuth = !(frmf_checkAuth("X"));
  10. var pAuth = !(frmf_checkAuth("P"));
  11. var DataPath = "ds_main_RscmggbnEmpData";
  12. var MainPath = "ds_main_RscmggbnLists_rscmggbnlist";
  13. var ListsPath = "ds_main_RscmggbnEmpLists";
  14. var ListPath = "ds_main_RscmggbnEmpLists_rscmggbnemplist";
  15. var HidePath = "ds_WorkData_HideData";
  16. var TreePath = "ds_main_RscmgubnLists_TreeList";
  17. var WorkPath = "ds_init_WorkInit";
  18. var CompPath = "ds_init_CompareInit";
  19. var MIS_ADM1 = "20902001"; // MIS 담당자[CHR]
  20. var MIS_ADM2 = "10109410"; // MIS 담당자[LHM]
  21. /****************************************************************************************
  22. * Argument : N/A
  23. * Description : Tree정보 가져오기
  24. ****************************************************************************************/
  25. function fInit() {
  26. fInitialize();
  27. var vInstCd = sysf_getUserInfo("dutplceinstcd"); // 기관코드
  28. eval(HidePath).setColumn( 0, "instcd", vInstCd); // 기관코드
  29. eval(HidePath).setColumn( 0, "deptcd", sysf_getUserInfo("dutplcecd") ); // 부서코드
  30. eval(HidePath).setColumn( 0, "deptnm", sysf_getUserInfo("dutplcenm") ); // 부서명
  31. var vUserId = sysf_getUserInfo("userid"); // 기관코드
  32. if ( (vUserId == MIS_ADM1) ||(vUserId == MIS_ADM2) )
  33. group3.group1.cmb_instcd.enable = true;
  34. ds_send.clearData();
  35. dsf_makeValue( ds_send, "goodflag", "string", "" ); // 메시지종류
  36. dsf_makeValue( ds_send, "treeflag", "string", "A" ); // 트리구분 T: TREE, L: LARGE
  37. // Tree Data 정보를 가져온다.
  38. grp_disp.trv_data.tabindex = 1;
  39. var oParam = {};
  40. oParam.id = "TRRSC05104";
  41. oParam.service = "purcbaseapp.GoodCdMngt";
  42. oParam.method = "reqGetTreeCodeList";
  43. oParam.inds = "req=ds_send";
  44. oParam.outds = "ds_main_RscmgubnLists_TreeList=TreeList";
  45. oParam.async = false;
  46. oParam.callback = "cf_TRRSC05104";
  47. tranf_submit(oParam);
  48. fRscmggbnTree();
  49. }
  50. function cf_TRRSC05104(sSvcId, nErrorCode, sErrorMsg) {
  51. if(nErrorCode < 0) return;
  52. ds_main_RscmgubnLists_TreeList.addColumn("check","string");
  53. grdf_expandDepth(grp_disp.trv_data.case2.trv_gubn, 1);
  54. }
  55. /****************************************************************************************
  56. * Argument : N/A
  57. * Description : 사용자별관리물품권한를 TREE 조회
  58. ****************************************************************************************/
  59. function fRscmggbnTree() {
  60. ds_send.clearData();
  61. dsf_makeValue( ds_send, "viewcls", "string", eval(HidePath).getColumn(0,"viewcls")); // 트리구성구분 E:사번,G:물품구분
  62. if( !utlf_isNull(group3.group1.cmb_instcd.value) )
  63. dsf_makeValue( ds_send, "instcd", "string", group3.group1.cmb_instcd.value); // 기관코드
  64. else
  65. dsf_makeValue( ds_send, "instcd", "string", sysf_getUserInfo("dutplceinstcd") ); // 기관코드
  66. if( !utlf_isNull(group3.group1.ipt_deptcd.value) )
  67. dsf_makeValue( ds_send, "deptcd", "string", group3.group1.ipt_deptcd.value); // 부서코드
  68. else
  69. dsf_makeValue( ds_send, "deptcd", "string", sysf_getUserInfo("dutplcecd" ) ); // 부서코드
  70. // Tree Data 정보를 가져온다.
  71. var oParam = {};
  72. oParam.id = "TRRSC01005";
  73. oParam.service = "purcbaseapp.GoodCdMngt";
  74. oParam.method = "reqGetRscmggbnTreeList";
  75. oParam.inds = "req=ds_send";
  76. oParam.outds = "ds_main_RscmggbnLists_rscmggbnlist=rscmggbnlist";
  77. oParam.async = false;
  78. oParam.callback = "cf_TRRSC01005";
  79. tranf_submit(oParam);
  80. }
  81. function cf_TRRSC01005(sSvcId, nErrorCode, sErrorMsg) {
  82. if(nErrorCode < 0) return;
  83. grdf_expandDepth(group3.trv_setcode, 1);
  84. }
  85. /****************************************************************************************
  86. * Argument : pIdx - 선택인덱스
  87. * Description : Tree Click
  88. ****************************************************************************************/
  89. function fTreeClick(pIdx) {
  90. ds_main_RscmggbnEmpData.enableevent = false;
  91. var OpCode = "";
  92. var OpDepth = "";
  93. var vDepth = "";
  94. var vGoodflag = "";
  95. var vGoodflagnm = "";
  96. var vLrgcd = "";
  97. var vLrgnm = "";
  98. var vMdlcd = "";
  99. var vMdlnm = "";
  100. var vSmlcd = "";
  101. var vSmlnm = "";
  102. var vMainmngtdeptcd = "";
  103. var vMainmngtdeptnm = "";
  104. var vWinacnt = "";
  105. var vWinacntnm = "";
  106. var vAmtacnt = "";
  107. var vAmtacntnm = "";
  108. var Idx = pIdx;
  109. grp_disp.bbt_append.enable = true;
  110. grp_disp.bbt_delete.enable = true;
  111. eval(DataPath).setColumn( 0, "jobcls", "I");
  112. eval(DataPath).setColumn( 0, "updateyn", "N");
  113. var sDepth = eval(MainPath).getColumn(Idx, "depth");
  114. var vCodeCd = eval(MainPath).getColumn(Idx, "codecd");
  115. var vCodeNm = eval(MainPath).getColumn(Idx, "codenm");
  116. var vBaseCd = eval(MainPath).getColumn(Idx, "basecd");
  117. grp_disp.btn_save.enable = false;
  118. grp_disp.bbt_delete.enable = false;
  119. grp_disp.cmb_emplno.enable = false;
  120. grp_disp.btn_winpsn.enable = false;
  121. eval(DataPath).setColumn( 0, "depth", sDepth);
  122. if (sDepth == "1") {
  123. eval(DataPath).setColumn( 0, "instcd", vCodeCd);
  124. grp_disp.bbt_append.enable = true;
  125. grp_disp.cmb_emplno.enable = true;
  126. grp_disp.btn_winpsn.enable = true;
  127. return;
  128. }
  129. eval(DataPath).setColumn( 0, "jobcls", "U");
  130. eval(DataPath).setColumn( 0, "depth", sDepth);
  131. if (sDepth == "2") {
  132. eval(DataPath).setColumn( 0, "emplno", vCodeCd);
  133. eval(DataPath).setColumn( 0, "emplnm", vCodeNm);
  134. }
  135. if (sDepth == "3") {
  136. eval(DataPath).setColumn(0, "emplno" , eval(MainPath).getColumn(Idx, "emplno"));
  137. eval(DataPath).setColumn(0, "emplnm" , eval(MainPath).getColumn(Idx, "usernm"));
  138. }
  139. ds_send.clearData();
  140. dsf_makeValue( ds_send, "instcd", "string", eval(HidePath).getColumn(0, "instcd" )); // "기관코드
  141. dsf_makeValue( ds_send, "emplno", "string", eval(DataPath).getColumn(0, "emplno" )); // "사원번호
  142. // Tree Data 정보를 가져온다.
  143. var oParam = {};
  144. oParam.id = "TRRSC01006";
  145. oParam.service = "purcbaseapp.GoodCdMngt";
  146. oParam.method = "reqGetRscmggbnEmpTreeList";
  147. oParam.inds = "req=ds_send";
  148. oParam.outds = "ds_main_RscmggbnEmpLists_rscmggbnemplist=rscmggbnemplist";
  149. oParam.async = false;
  150. oParam.callback = "cf_TRRSC01006";
  151. tranf_submit(oParam);
  152. ds_main_RscmggbnEmpData.enableevent = true;
  153. grp_disp.trv_data.case1.trv_empdata.treeinitstatus = "expand,null";
  154. }
  155. function cf_TRRSC01006(sSvcId, nErrorCode, sErrorMsg) {
  156. if(nErrorCode < 0) return;
  157. grdf_expandDepth(grp_disp.trv_data.case1.trv_empdata, 1);
  158. }
  159. /****************************************************************************************
  160. * Argument : N/A
  161. * Description : Append Data
  162. ****************************************************************************************/
  163. function fAppendData() {
  164. var sDepth = eval(DataPath).getColumn(0, "depth");
  165. grp_disp.bbt_append.enable = false;
  166. if (utlf_isNull(sDepth)) {
  167. alert("상위 분류를 선택 하십시요!! ");
  168. return;
  169. }
  170. if (eval(DataPath).getColumn(0, "updateyn")) {
  171. if (sysf_messageBox("데이터가 변경 되었습니다. ", "Q003") == "2") return;
  172. }
  173. eval(ListPath).clearData();
  174. eval(DataPath).enableevent = false;
  175. eval(DataPath).updatecontrol = false;
  176. eval(DataPath).setColumn( 0, "emplno", "");
  177. eval(DataPath).setColumn( 0, "emplnm", "");
  178. eval(DataPath).setColumn( 0, "updateyn", "Y");
  179. eval(DataPath).updatecontrol = true;
  180. eval(DataPath).enableevent = true;
  181. grp_disp.btn_save.enable = true;
  182. grp_disp.bbt_delete.enable = false;
  183. grp_disp.cmb_emplno.enable = true;
  184. grp_disp.btn_winpsn.enable = true;
  185. grp_disp.trv_data.tabindex = 1;
  186. grp_disp.cmb_emplno.setFocus();
  187. }
  188. //
  189. // 변경여부 Check
  190. //
  191. function fCheckEdit(){
  192. var EditChk = true;
  193. if ( model.getValue(WorkPath + "/depth" ) != model.getValue(CompPath + "/depth" )) return EditChk;
  194. if ( model.getValue(WorkPath + "/goodflag" ) != model.getValue(CompPath + "/goodflag" )) return EditChk;
  195. if ( model.getValue(WorkPath + "/goodflagnm" ) != model.getValue(CompPath + "/goodflagnm" )) return EditChk;
  196. if ( model.getValue(WorkPath + "/lrgcd" ) != model.getValue(CompPath + "/lrgcd" )) return EditChk;
  197. if ( model.getValue(WorkPath + "/lrgnm" ) != model.getValue(CompPath + "/lrgnm" )) return EditChk;
  198. if ( model.getValue(WorkPath + "/mdlcd" ) != model.getValue(CompPath + "/mdlcd" )) return EditChk;
  199. if ( model.getValue(WorkPath + "/mdlnm" ) != model.getValue(CompPath + "/mdlnm" )) return EditChk;
  200. if ( model.getValue(WorkPath + "/smlcd" ) != model.getValue(CompPath + "/smlcd" )) return EditChk;
  201. if ( model.getValue(WorkPath + "/smlnm" ) != model.getValue(CompPath + "/smlnm" )) return EditChk;
  202. if ( model.getValue(WorkPath + "/mainmngtdeptcd") != model.getValue(CompPath + "/mainmngtdeptcd")) return EditChk;
  203. if ( model.getValue(WorkPath + "/mainmngtdeptnm") != model.getValue(CompPath + "/mainmngtdeptnm")) return EditChk;
  204. if ( model.getValue(WorkPath + "/winacnt" ) != model.getValue(CompPath + "/winacnt" )) return EditChk;
  205. if ( model.getValue(WorkPath + "/winacntnm" ) != model.getValue(CompPath + "/winacntnm" )) return EditChk;
  206. if ( model.getValue(WorkPath + "/amtacnt" ) != model.getValue(CompPath + "/amtacnt" )) return EditChk;
  207. if ( model.getValue(WorkPath + "/amtacntnm" ) != model.getValue(CompPath + "/amtacntnm" )) return EditChk;
  208. EditChk = false;
  209. return EditChk;
  210. }
  211. //
  212. // 변경여부 Check
  213. //
  214. function fCompare2Work(){
  215. model.setValue(WorkPath + "/depth" , model.getValue(CompPath + "/depth" ));
  216. model.setValue(WorkPath + "/goodflag" , model.getValue(CompPath + "/goodflag" ));
  217. model.setValue(WorkPath + "/goodflagnm" , model.getValue(CompPath + "/goodflagnm" ));
  218. model.setValue(WorkPath + "/lrgcd" , model.getValue(CompPath + "/lrgcd" ));
  219. model.setValue(WorkPath + "/lrgnm" , model.getValue(CompPath + "/lrgnm" ));
  220. model.setValue(WorkPath + "/mdlcd" , model.getValue(CompPath + "/mdlcd" ));
  221. model.setValue(WorkPath + "/mdlnm" , model.getValue(CompPath + "/mdlnm" ));
  222. model.setValue(WorkPath + "/smlcd" , model.getValue(CompPath + "/smlcd" ));
  223. model.setValue(WorkPath + "/smlnm" , model.getValue(CompPath + "/smlnm" ));
  224. model.setValue(WorkPath + "/mainmngtdeptcd", model.getValue(CompPath + "/mainmngtdeptcd"));
  225. model.setValue(WorkPath + "/mainmngtdeptnm", model.getValue(CompPath + "/mainmngtdeptnm"));
  226. model.setValue(WorkPath + "/winacnt" , model.getValue(CompPath + "/winacnt" ));
  227. model.setValue(WorkPath + "/winacntnm" , model.getValue(CompPath + "/winacntnm" ));
  228. model.setValue(WorkPath + "/amtacnt" , model.getValue(CompPath + "/amtacnt" ));
  229. model.setValue(WorkPath + "/amtacntnm" , model.getValue(CompPath + "/amtacntnm" ));
  230. }
  231. /****************************************************************************************
  232. * Argument : N/A
  233. * Description : 관리물품선택 Tab Click
  234. ****************************************************************************************/
  235. function fChoisClick(){
  236. var vPcode = "";
  237. var vIdx = -1;
  238. dsf_setFixVal(eval(TreePath), "check:0");
  239. // 모든 아이템의 체크된 상태를 해제한다.
  240. if (this.objects[DataPath].getColumn(0, "jobcls") == "U"){
  241. for(var i=0; i < this.objects[ListPath].rowcount; i++) {
  242. vPcode = this.objects[ListPath].getColumn(i, "pcode");
  243. vChkyn = this.objects[ListPath].getColumn(i, "checkyn");
  244. if(vChkyn == "A") {
  245. vIdx = fLabelToIndex(vPcode, grp_disp.trv_data.case2.trv_gubn);
  246. if (vIdx > 0) {
  247. this.objects[TreePath].enableevent = false;
  248. this.objects[TreePath].updatecontrol = false;
  249. this.objects[TreePath].setColumn(eval(vIdx), "check", 1);
  250. this.objects[TreePath].updatecontrol = true;
  251. this.objects[TreePath].enableevent = true;
  252. }
  253. }
  254. }
  255. }
  256. }
  257. /****************************************************************************************
  258. * Argument : N/A
  259. * Description : 인자로 넘어온 값을 label 로 같은 아이템의 인덱스를 반환
  260. ****************************************************************************************/
  261. function fLabelToIndex(pValue, pTree) {
  262. for (var i=0; i < eval(pTree.binddataset).rowcount; i++)
  263. {
  264. if (eval(pTree.binddataset).getColumn(i, "pcode") == pValue) return i;
  265. }
  266. return -1;
  267. }
  268. /****************************************************************************************
  269. * Argument : N/A
  270. * Description : GUBUN Tree Click
  271. ****************************************************************************************/
  272. function fGubnTreeClick(fTree, fIdx) {
  273. var Idx = fIdx;
  274. var pIdx = 0;
  275. var sDepth = eval(TreePath).getColumn(Idx, "depth");
  276. // var Tree1 = fTree.item(fIdx);
  277. var cRow = fTree.getTreeParentRow(fIdx);
  278. if (sDepth == "1") {
  279. return;
  280. }
  281. eval(fTree.binddataset).setColumn(cRow, "check", 0);
  282. if (sDepth == "3") {
  283. var cRow1 = fTree.getTreeParentRow(cRow);
  284. eval(fTree.binddataset).setColumn(cRow1, "check", 0);
  285. }
  286. if (sDepth == "4") {
  287. var cRow1 = fTree.getTreeParentRow(cRow);
  288. var cRow2 = fTree.getTreeParentRow(cRow1);
  289. eval(fTree.binddataset).setColumn(cRow1, "check", 0);
  290. eval(fTree.binddataset).setColumn(cRow2, "check", 0);
  291. }
  292. if (sDepth == "5") {
  293. var cRow1 = fTree.getTreeParentRow(cRow);
  294. var cRow2 = fTree.getTreeParentRow(cRow1);
  295. var cRow3 = fTree.getTreeParentRow(cRow2);
  296. eval(fTree.binddataset).setColumn(cRow1, "check", 0);
  297. eval(fTree.binddataset).setColumn(cRow2, "check", 0);
  298. eval(fTree.binddataset).setColumn(cRow3, "check", 0);
  299. }
  300. }
  301. /****************************************************************************************
  302. * Argument : N/A
  303. * Description : 관리물품선택
  304. ****************************************************************************************/
  305. function fChoisData() {
  306. var ii = 0;
  307. var OpCode = "";
  308. var CodeCd = "";
  309. var ApndPath = "ds_WorkData_workinst_AppendLists_rscmggbnemplist";
  310. var CopyPath = "ds_WorkData_workinst_CopyList_rscmggbnemplist";
  311. // CodeCd = eval(ApndPath).lookup("pcode","0000","pcode");
  312. eval(ApndPath).clear();
  313. for(var i = 0; i < eval(TreePath).rowcount; i++) {
  314. if (eval(TreePath).getColumn(i, "check") == 1){
  315. sDepth = eval(TreePath).getColumn(i, "depth");
  316. OpCode = eval(TreePath).getColumn(i, "basecd");
  317. CodeCd = eval(ApndPath).lookup("pcode", OpCode, "pcode");
  318. // trace(i+ " sDepth : "+sDepth+ " OpCode : "+OpCode+ " CodeCd : "+CodeCd);
  319. if (sDepth == "3") {
  320. if (utlf_isNull(CodeCd)) {
  321. //Tree2 = trv_gubn.item(i);
  322. var cRow1 = grp_disp.trv_data.case2.trv_gubn.getTreeParentRow(i);
  323. ii = fChoisSetData( cRow1, ii, "Y");
  324. }
  325. }
  326. if (sDepth == "4") {
  327. if (utlf_isNull(CodeCd)) {
  328. var cRow1 = grp_disp.trv_data.case2.trv_gubn.getTreeParentRow(i);
  329. var cRow2 = grp_disp.trv_data.case2.trv_gubn.getTreeParentRow(cRow1);
  330. pIdx2 = cRow2;
  331. pIdx3 = cRow1;
  332. OpCode = eval(TreePath).getColumn(pIdx2, "pcode");
  333. if (utlf_isNull(eval(ApndPath).lookup("pcode", OpCode, "pcode"))) {
  334. ii = fChoisSetData(pIdx2, ii, "Y");
  335. }
  336. ii = fChoisSetData(pIdx3, ii, "Y");
  337. }
  338. }
  339. if (sDepth == "5") {
  340. if (utlf_isNull(CodeCd)) {
  341. var cRow1 = grp_disp.trv_data.case2.trv_gubn.getTreeParentRow(i);
  342. var cRow2 = grp_disp.trv_data.case2.trv_gubn.getTreeParentRow(cRow1);
  343. var cRow3 = grp_disp.trv_data.case2.trv_gubn.getTreeParentRow(cRow2);
  344. pIdx1 = cRow3;
  345. pIdx2 = cRow2;
  346. pIdx3 = cRow1;
  347. OpCode = eval(TreePath).getColumn(pIdx1, "pcode");
  348. CodeCd = eval(ApndPath).lookup("pcode", OpCode, "pcode");
  349. if (utlf_isNull(CodeCd)) {
  350. ii = fChoisSetData(pIdx1, ii, "Y");
  351. }
  352. OpCode = eval(TreePath).getColumn(pIdx2, "pcode");
  353. CodeCd = eval(ApndPath).lookup("pcode", OpCode, "pcode");
  354. if (utlf_isNull(CodeCd)) {
  355. ii = fChoisSetData(pIdx2, ii, "Y");
  356. }
  357. ii = fChoisSetData(pIdx3, ii, "Y");
  358. }
  359. }
  360. ii = fChoisSetData(i, ii, "A");
  361. }
  362. }
  363. if (eval(ApndPath).rowcount > 0) {
  364. eval(ListPath).clear();
  365. eval(DataPath).setColumn(0, "updateyn", "Y");
  366. eval(ListPath).copyData(eval(ApndPath));
  367. grp_disp.trv_data.case1.trv_empdata.treeinitstatus = "expand,null";
  368. grp_disp.btn_save.enable = true;
  369. }
  370. }
  371. /****************************************************************************************
  372. * Argument : N/A
  373. * Description : 관리물품선택
  374. ****************************************************************************************/
  375. function fChoisSetData(pIdx, pRow, pCheckYN){
  376. //trace("pIdx : "+ pIdx +" / pRow : "+ pRow + " / pCheckYN : "+ pCheckYN);
  377. var ApndPath = "ds_WorkData_workinst_AppendLists_rscmggbnemplist";
  378. var CopyPath = "ds_WorkData_workinst_CopyList_rscmggbnemplist";
  379. // var ApndPath = AppnPath+"_rscmggbnemplist";
  380. eval(CopyPath).setColumn(0, "depth" , eval(TreePath).getColumn(pIdx, "depth" ));
  381. eval(CopyPath).setColumn(0, "pcode" , eval(TreePath).getColumn(pIdx, "pcode" ));
  382. eval(CopyPath).setColumn(0, "codecd" , eval(TreePath).getColumn(pIdx, "codecd" ));
  383. eval(CopyPath).setColumn(0, "codenm" , eval(TreePath).getColumn(pIdx, "codenm" ));
  384. eval(CopyPath).setColumn(0, "basecd" , eval(TreePath).getColumn(pIdx, "basecd" ));
  385. eval(CopyPath).setColumn(0, "dispnm" , eval(TreePath).getColumn(pIdx, "dispnm" )+ ((pCheckYN == "A") ? "(전체)" : "") );
  386. eval(CopyPath).setColumn(0, "checkyn", pCheckYN);
  387. if (pRow == 0) {
  388. eval(ApndPath).clear();
  389. dsf_copyColInfo(eval(ApndPath), ds_WorkData_workinst_defaultggbn);
  390. eval(ApndPath).insertRow(pRow);
  391. eval(ApndPath).copyRow(pRow, ds_WorkData_workinst_defaultggbn, 0);
  392. pRow++;
  393. }
  394. eval(ApndPath).insertRow(pRow);
  395. eval(ApndPath).copyRow(pRow, eval(CopyPath), 0);
  396. pRow++;
  397. return pRow;
  398. }
  399. /****************************************************************************************
  400. * Argument : pCls
  401. * Description : 사용자별관리물품권한 자료 저장
  402. ****************************************************************************************/
  403. function fRscmggbnDataSubmit(pCls) {
  404. if(grp_disp.trv_data.tabindex == 1) { // case2 선택시 선택버튼 클릭
  405. fChoisData();
  406. }
  407. if (utlf_isNull(eval(DataPath).getColumn(0, "emplno")) || utlf_isNull(eval(DataPath).getColumn(0, "emplnm"))) {
  408. sysf_messageBox("해당 사원번호를 ", "C001");
  409. return;
  410. }
  411. // var pNode = instance1.selectSingleNode(ListPath);
  412. if (eval(ListPath).rowcount == 0) {
  413. sysf_messageBox("수정(입력)된 자료가 ", "I004");
  414. return;
  415. }
  416. var RscmggbnsList = "status" + "▦" // 1 상태
  417. + "instcd" + "▦" // 2 기관번호
  418. + "emplno" + "▦" // 3 사원번호
  419. + "goodflag" + "▦" // 4 물품구분
  420. + "lrgcd" + "▦" // 5 대분류코드
  421. + "mdlcd" + "▦" // 6 중분류코드
  422. + "smlcd" + "▦" // 7 소분류코드
  423. + "cmt" + "▩"; // 8 비고
  424. var vEmpData2 = ""
  425. var vEmpData1 = pCls + "▦" // 1 상태
  426. + eval(HidePath).getColumn(0, "instcd" )+ "▦" // 2 기관번호
  427. + eval(DataPath).getColumn(0, "emplno" )+ "▦"; // 3 사원번호
  428. //입력
  429. if (pCls == "D") {
  430. vEmpData2 += vEmpData1
  431. + "" + "▦" // 4 물품구분
  432. + "" + "▦" // 5 대분류코드
  433. + "" + "▦" // 6 중분류코드
  434. + "" + "▦" // 7 소분류코드
  435. + "" + "▩"; // 8 비고
  436. } else {
  437. for(var i=0; i < grp_disp.trv_data.case1.trv_empdata.rowcount ; i++) {
  438. var sDepth = eval(ListPath).getColumn(i+1, "depth");
  439. switch(sDepth) {
  440. case "2" : vGoodflag = eval(ListPath).getColumn(i+1, "codecd"); // 4 물품구분
  441. vLrgcd = "%"; // 5 대분류코드
  442. vMdlcd = "%"; // 6 중분류코드
  443. vSmlcd = "%"; // 7 소분류코드
  444. break;
  445. case "3" : vLrgcd = eval(ListPath).getColumn(i+1, "codecd"); // 5 대분류코드
  446. vMdlcd = "%"; // 6 중분류코드
  447. vSmlcd = "%"; // 7 소분류코드
  448. break;
  449. case "4" : vMdlcd = eval(ListPath).getColumn(i+1, "codecd"); // 6 중분류코드
  450. vSmlcd = "%"; // 7 소분류코드
  451. break;
  452. case "5" : vSmlcd = eval(ListPath).getColumn(i+1, "codecd"); // 7 소분류코드
  453. }
  454. if (eval(ListPath).getColumn(i+1, "checkyn") == "A") {
  455. vEmpData2 += vEmpData1
  456. + vGoodflag + "▦" // 4 물품구분
  457. + vLrgcd + "▦" // 5 대분류코드
  458. + vMdlcd + "▦" // 6 중분류코드
  459. + vSmlcd + "▦" // 7 소분류코드
  460. + "" + "▩"; // 8 비고
  461. }
  462. }
  463. }
  464. RscmggbnsList += vEmpData2;
  465. dsf_setCSVToDs("ds_send_rscmggbnlist", RscmggbnsList);
  466. var oParam = {};
  467. oParam.id = "TXRSC01001";
  468. oParam.service = "purcbaseapp.GoodCdMngt";
  469. oParam.method = "reqExeSaveRscmggbn";
  470. oParam.inds = "req=ds_send_rscmggbnlist";
  471. oParam.async = false;
  472. oParam.callback = "cf_TXRSC01001";
  473. tranf_submit(oParam);
  474. if (arErrorCode.pop("TXRSC01001") > -1) { // 정보저장
  475. sysf_messageBox("자료 저장 ", "I002");
  476. }
  477. }
  478. function cf_TXRSC01001(sSvcId, nErrorCode, sErrorMsg) {
  479. arErrorCode.push(sSvcId, nErrorCode);
  480. }
  481. /****************************************************************************************
  482. * Argument : N/A
  483. * Description : 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
  484. ****************************************************************************************/
  485. function fInitialize() {
  486. misfComboComCdList("Z0007", group3.group1.cmb_instcd); //전체기관코드
  487. }
  488. // ----------------------------------------------------------------
  489. function fCheckRetrieveData(pmsg)
  490. {
  491. if(model.getValue(cmb_instcd.attribute("ref")).length== 0 )
  492. {
  493. if(pmsg == true)
  494. {
  495. messageBox("기관코드를 " ,"C002");
  496. model.setFocus("cmb_instcd");
  497. }
  498. return false;
  499. }
  500. return true;
  501. }
  502. // ----------------------------------------------------------------
  503. function fDefaultSetting(prow)
  504. {
  505. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/purcreqflag",model.getValue("/root/send/gooddmnd/purcreqflag"));
  506. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/instcd" ,model.getValue("/root/send/gooddmnd/instcd") );
  507. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/goodflag" ,model.getValue("/root/send/gooddmnd/goodflag") );
  508. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/purcdmnddd" ,model.getValue("/root/send/gooddmnd/purcdmnddd") );
  509. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/reqdeptcd" ,model.getValue("/root/send/gooddmnd/reqdeptcd") );
  510. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/reqpsn" ,model.getValue("/root/send/gooddmnd/reqpsn") );
  511. model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/purcdmndseq",prow);
  512. }
  513. // ----------------------------------------------------------------
  514. function fSettingGoodList(pnode, nodename, userqtynm){
  515. var codynode = instance1.selectNodes(pnode + "/*");
  516. var addRow = grd_gooddmnd.rows - grd_gooddmnd.fixedRows;
  517. if(model.getValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodcd").length > 0)addRow = addRow + 1;
  518. for (var j = 1; j <= codynode.length ; j++) {
  519. if(addRow > grd_gooddmnd.rows - grd_gooddmnd.fixedRows)
  520. {
  521. misfGridIUD(grd_gooddmnd,"A");
  522. addRow = grd_gooddmnd.rows - grd_gooddmnd.fixedRows;
  523. fDefaultSetting(addRow );
  524. }
  525. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodcd" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodcd"));
  526. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodnm" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodnm"));
  527. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodspec" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodspec"));
  528. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodmodel" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodmodel"));
  529. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/prodcmpynm" , model.getValue(pnode +"/" + nodename + "[" + j + "]/prodcmpynm"));
  530. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqpackunit" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purcunit"));
  531. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqpackcnt" , model.getValue(pnode +"/" + nodename + "[" + j + "]/" + userqtynm));
  532. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/requnit" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purcunit"));
  533. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqqty" , model.getValue(pnode +"/" + nodename + "[" + j + "]/" + userqtynm));
  534. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqpackcntperunit" ,1);
  535. model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodunitcost" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodunitcost"));
  536. addRow = addRow + 1;
  537. }
  538. model.recalculate();
  539. model.refresh();
  540. }
  541. // ----------------------------------------------------------------
  542. function fCheckSaveData()
  543. {
  544. for(var currow = grd_rscmggbn.fixedRows ; currow < grd_rscmggbn.rows ; currow++)
  545. {
  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. /* ------------------------------------------------- */
  577. /* ------End Of List ------------------------------- */
  578. /* -------------------------------------------------- */ ]]></Script>