SMRSC01002.js 32 KB

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