123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750 |
- /* ---------------------------------------------------------------------
-
- SMRSC0100_사용자별관리물품권한.xrw (SMRSC0100.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- : Create By Francis Choi
- : 2015.05.02
- ---------------------------------------------------------------------- */
-
- var xAuth = !(checkAuth("X"));
- var pAuth = !(checkAuth("P"));
- var DataPath = "/root/main/RscmggbnEmpData";
- var MainPath = "/root/main/RscmggbnLists/rscmggbnlist";
- var ListsPath = "/root/main/RscmggbnEmpLists";
- var ListPath = "/root/main/RscmggbnEmpLists/rscmggbnemplist";
-
- var HidePath = "/root/WorkData/HideData";
-
- var TreePath = "/root/main/RscmgubnLists/TreeList";
- var WorkPath = "/root/init/WorkInit";
- var CompPath = "/root/init/CompareInit";
-
- var MIS_ADM1 = "20902001"; // MIS 담당자[CHR]
- var MIS_ADM2 = "10109410"; // MIS 담당자[LHM]
- // --------------------------------------------------
- // Tree정보 가져오기
- // --------------------------------------------------
- function fInit() {
- fInitialize();
-
- // grp_lag.disabled = true;
- // grp_dept.disabled = true;
- // grp_mdl.disabled = true;
- // grp_sml.disabled = true;
- // grp_anct.disabled = true;
-
- // btn_save.disabled = !(checkAuth("X"));
- // btn_cdclssysrgst.disabled = !(checkAuth("P"));
-
- var vInstCd = getUserInfo("dutplceinstcd"); // 기관코드
-
- model.setValue(HidePath + "/instcd" , vInstCd ); // 기관코드
- model.setValue(HidePath + "/deptcd" , getUserInfo("dutplcecd") ); // 부서코드
- model.setValue(HidePath + "/deptnm" , getUserInfo("dutplcenm") ); // 부서명
- var vUserId = getUserInfo("userid"); // 기관코드
-
- if ( (vUserId == MIS_ADM1) ||(vUserId == MIS_ADM2) )
- cmb_instcd.disabled = false;
- model.removenode("/root/send");
- model.makeValue("/root/send/goodflag","" ); // 메시지종류
- model.makeValue("/root/send/treeflag","A" ); // 트리구분 T: TREE, L: LARGE
-
- // model.makeValue("/root/send/emplno" ,getUserInfo("userid")); // 사원번호
- submit("TRRSC05104"); // Tree Data 정보를 가져온다.
-
- fRscmggbnTree();
- model.refresh();
- }
-
- // --------------------------------------------------
- // 사용자별관리물품권한를 TREE 조회
- // --------------------------------------------------
- function fRscmggbnTree() {
-
- model.removenode("/root/send");
- model.makeValue("/root/send/viewcls",model.getValue(HidePath + "/viewcls")); // 트리구성구분 E:사번,G:물품구분
- if( model.getValue( cmb_instcd.attribute("ref") ) != null && model.getValue( cmb_instcd.attribute("ref") ) != "" )
- model.makeValue("/root/send/instcd" ,model.getValue( cmb_instcd.attribute("ref") ) ); // 기관코드
- else
- model.makeValue("/root/send/instcd" ,getUserInfo("dutplceinstcd") ); // 기관코드
- if( model.getValue( ipt_deptcd.attribute("ref") ) != null && model.getValue( ipt_deptcd.attribute("ref") ) != "" )
- model.makeValue("/root/send/deptcd" ,model.getValue( ipt_deptcd.attribute("ref") ) ); // 부서코드
- else
- model.makeValue("/root/send/deptcd" ,getUserInfo("dutplcecd" ) ); // 부서코드
- submit("TRRSC01005"); // Tree Data 정보를 가져온다.
-
- trv_setcode.refresh();
- }
-
- // --------------------------------------------------
- // Tree Click
- // --------------------------------------------------
- function fTreeClick(pIdx) {
-
- var OpCode = "";
- var OpDepth = "";
- var vDepth = "";
- var vGoodflag = "";
- var vGoodflagnm = "";
- var vLrgcd = "";
- var vLrgnm = "";
- var vMdlcd = "";
- var vMdlnm = "";
- var vSmlcd = "";
- var vSmlnm = "";
- var vMainmngtdeptcd = "";
- var vMainmngtdeptnm = "";
- var vWinacnt = "";
- var vWinacntnm = "";
- var vAmtacnt = "";
- var vAmtacntnm = "";
- var Idx = pIdx + 1;
-
- bbt_append.disabled = false;
- bbt_delete.disabled = false;
-
- model.setValue(DataPath + "/jobcls" , "I");
- model.setValue(DataPath + "/updateyn" , "N");
-
- var sDepth = model.getValue(MainPath +"["+Idx+"]/depth");
- var vCodeCd = model.getValue(MainPath +"["+Idx+"]/codecd");
- var vCodeNm = model.getValue(MainPath +"["+Idx+"]/codenm");
- var vBaseCd = model.getValue(MainPath +"["+Idx+"]/basecd");
-
- btn_save.disabled = true;
- bbt_delete.disabled = true;
-
- // cmb_instcd.disabled = true;
- cmb_emplno.disabled = true;
- btn_winpsn.disabled = true;
- model.setValue(DataPath + "/depth" , sDepth);
- if (sDepth == "1") {
- model.setValue(DataPath + "/instcd" , vCodeCd);
- bbt_append.disabled = false;
-
- cmb_emplno.disabled = false;
- btn_winpsn.disabled = false;
- return;
- }
-
- //
- model.setValue(DataPath + "/jobcls" , "U");
- model.setValue(DataPath + "/depth" , sDepth);
-
- if (sDepth == "2") {
- model.setValue(DataPath + "/emplno" , vCodeCd);
- model.setValue(DataPath + "/emplnm" , vCodeNm);
- }
-
- //
- if (sDepth == "3") {
- model.setValue(DataPath + "/emplno" , model.getValue(MainPath +"["+Idx+"]/emplno"));
- model.setValue(DataPath + "/emplnm" , model.getValue(MainPath +"["+Idx+"]/usernm"));
- }
-
- model.removenode("/root/send");
- model.makeValue("/root/send/instcd" ,model.getValue(HidePath+"/instcd" )); // "기관코드
- model.makeValue("/root/send/emplno" ,model.getValue(DataPath+"/emplno" )); // "사원번호
-
- submit("TRRSC01006"); // Tree Data 정보를 가져온다.
-
- // btn_save.disabled = false;
- // bbt_delete.disabled = false;
-
- trv_empdata.rebuild();
- //
- grp_disp.refresh();
-
- }
- // --------------------------------------------------
- // Append Data
- // --------------------------------------------------
- function fAppendData() {
-
- var sDepth = model.getValue(DataPath + "/depth");
-
- bbt_append.disabled = true;
-
- if (sDepth == "") {
- alert("상위 분류를 선택 하십시요!! ");
- return;
- }
- //
- if (model.getValue(DataPath + "/updateyn")){
- if (messageBox("데이터가 변경 되었습니다. ", "Q003") == "2") return;
- }
-
- //
- model.removeNode(ListsPath);
-
- model.setValue(DataPath + "/emplno" , "" );
- model.setValue(DataPath + "/emplnm" , "" );
- model.setValue(DataPath + "/updateyn" , "Y");
- btn_save.disabled = false;
- bbt_delete.disabled = true;
- cmb_emplno.disabled = false;
-
- grp_disp.refresh();
- }
- //
- // 변경여부 Check
- //
- function fCheckEdit(){
- var EditChk = true;
- if ( model.getValue(WorkPath + "/depth" ) != model.getValue(CompPath + "/depth" )) return EditChk;
- if ( model.getValue(WorkPath + "/goodflag" ) != model.getValue(CompPath + "/goodflag" )) return EditChk;
- if ( model.getValue(WorkPath + "/goodflagnm" ) != model.getValue(CompPath + "/goodflagnm" )) return EditChk;
- if ( model.getValue(WorkPath + "/lrgcd" ) != model.getValue(CompPath + "/lrgcd" )) return EditChk;
- if ( model.getValue(WorkPath + "/lrgnm" ) != model.getValue(CompPath + "/lrgnm" )) return EditChk;
- if ( model.getValue(WorkPath + "/mdlcd" ) != model.getValue(CompPath + "/mdlcd" )) return EditChk;
- if ( model.getValue(WorkPath + "/mdlnm" ) != model.getValue(CompPath + "/mdlnm" )) return EditChk;
- if ( model.getValue(WorkPath + "/smlcd" ) != model.getValue(CompPath + "/smlcd" )) return EditChk;
- if ( model.getValue(WorkPath + "/smlnm" ) != model.getValue(CompPath + "/smlnm" )) return EditChk;
- if ( model.getValue(WorkPath + "/mainmngtdeptcd") != model.getValue(CompPath + "/mainmngtdeptcd")) return EditChk;
- if ( model.getValue(WorkPath + "/mainmngtdeptnm") != model.getValue(CompPath + "/mainmngtdeptnm")) return EditChk;
- if ( model.getValue(WorkPath + "/winacnt" ) != model.getValue(CompPath + "/winacnt" )) return EditChk;
- if ( model.getValue(WorkPath + "/winacntnm" ) != model.getValue(CompPath + "/winacntnm" )) return EditChk;
- if ( model.getValue(WorkPath + "/amtacnt" ) != model.getValue(CompPath + "/amtacnt" )) return EditChk;
- if ( model.getValue(WorkPath + "/amtacntnm" ) != model.getValue(CompPath + "/amtacntnm" )) return EditChk;
- EditChk = false;
- return EditChk;
- }
- //
- // 변경여부 Check
- //
- function fCompare2Work(){
-
- model.setValue(WorkPath + "/depth" , model.getValue(CompPath + "/depth" ));
- model.setValue(WorkPath + "/goodflag" , model.getValue(CompPath + "/goodflag" ));
- model.setValue(WorkPath + "/goodflagnm" , model.getValue(CompPath + "/goodflagnm" ));
- model.setValue(WorkPath + "/lrgcd" , model.getValue(CompPath + "/lrgcd" ));
- model.setValue(WorkPath + "/lrgnm" , model.getValue(CompPath + "/lrgnm" ));
- model.setValue(WorkPath + "/mdlcd" , model.getValue(CompPath + "/mdlcd" ));
- model.setValue(WorkPath + "/mdlnm" , model.getValue(CompPath + "/mdlnm" ));
- model.setValue(WorkPath + "/smlcd" , model.getValue(CompPath + "/smlcd" ));
- model.setValue(WorkPath + "/smlnm" , model.getValue(CompPath + "/smlnm" ));
- model.setValue(WorkPath + "/mainmngtdeptcd", model.getValue(CompPath + "/mainmngtdeptcd"));
- model.setValue(WorkPath + "/mainmngtdeptnm", model.getValue(CompPath + "/mainmngtdeptnm"));
- model.setValue(WorkPath + "/winacnt" , model.getValue(CompPath + "/winacnt" ));
- model.setValue(WorkPath + "/winacntnm" , model.getValue(CompPath + "/winacntnm" ));
- model.setValue(WorkPath + "/amtacnt" , model.getValue(CompPath + "/amtacnt" ));
- model.setValue(WorkPath + "/amtacntnm" , model.getValue(CompPath + "/amtacntnm" ));
-
- }
- // ------------------------------
- // 관리물품선택 Tab Click
- // ------------------------------
- function fChoisClick(){
-
- var vPcode = "";
- var vIdx = -1;
- for (var i=0; i<trv_gubn.length; i++)
- {
- trv_gubn.item(i).checked = 0;
- }
-
- // 모든 아이템의 체크된 상태를 해제한다.
- if (model.getValue(DataPath + "/jobcls") =="U"){
-
- for(var i=0; i < trv_empdata.length; i++) {
- vPcode = model.getValue(ListPath +"["+(i+1)+"]/pcode");
- vIdx = fLabelToIndex(vPcode, trv_gubn);
-
- if (vIdx > 0) {
- trv_gubn.item(vIdx).checked = 1;
- }
- }
- }
-
- trv_gubn.refresh();
- }
- // --------------------------------------------------
- // 인자로 넘어온 값을 label 로 같은 아이템의 인덱스를 반환
- // --------------------------------------------------
- function fLabelToIndex(pValue, pTree)
- {
- for (var i=0; i < pTree.length; i++)
- {
- if (pTree.item(i).value == pValue)
- return i;
- }
-
- return -1;
- }
-
- // --------------------------------------------------
- // GUBUN Tree Click
- // --------------------------------------------------
- function fGubnTreeClick(fTree, fIdx) {
- var Idx = fIdx + 1;
- var pIdx = 0;
- var sDepth = model.getValue(TreePath +"["+Idx+"]/depth");
-
- var Tree1 = fTree.item(fIdx);
- if (sDepth == 1) {
- return;
- }
- //
- fTree.item(Tree1.parentindex).checked = 0;
- //
- if (sDepth == "3") {
- Tree2 = fTree.item(Tree1.parentindex);
- Tree3 = fTree.item(Tree2.parentindex);
- fTree.item(Tree3.index).checked = 0;
- }
- //----
- if (sDepth == "4") {
- Tree2 = fTree.item(Tree1.parentindex);
- Tree3 = fTree.item(Tree2.parentindex);
- fTree.item(Tree3.index).checked = 0;
- Tree4 = fTree.item(Tree3.parentindex);
-
- fTree.item(Tree4.index).checked = 0;
- }
- //----
- if (sDepth == "5") {
- Tree2 = fTree.item(Tree1.parentindex);
- Tree3 = fTree.item(Tree2.parentindex);
- fTree.item(Tree3.index).checked = 0;
- Tree4 = fTree.item(Tree3.parentindex);
-
- fTree.item(Tree4.index).checked = 0;
- Tree5 = fTree.item(Tree4.parentindex);
-
- fTree.item(Tree5.index).checked = 0;
- }
- // pTree.refresh();
- }
-
- // ------------------------------
- // 관리물품선택
- // ------------------------------
- function fChoisData(){
-
- var ii = 1;
- var OpCode = "";
- var CodeCd = "";
- var AppnPath = "/root/WorkData/workinst/AppendLists";
- var CopyPath = "/root/WorkData/workinst/CopyList/rscmggbnemplist";
- var ApndPath = AppnPath+"/rscmggbnemplist";
- model.removenode(AppnPath);
- CodeCd = model.getValue(ApndPath +"[pcode='0000']/pcode");
-
- //alert(CodeCd);
-
- for(var i=0; i < trv_gubn.length; i++) {
- if (trv_gubn.item(i).checked == 1){
- sDepth = model.getValue(TreePath +"["+(i+1)+"]/depth");
- OpCode = model.getValue(TreePath +"["+(i+1)+"]/basecd");
- CodeCd = model.getValue(ApndPath +"[pcode='"+ OpCode+"']/pcode");
- //
- if (sDepth == "3") {
- if (CodeCd == "") {
- Tree2 = trv_gubn.item(i);
- ii = fChoisSetData(Tree2.parentindex + 1, ii, "Y");
- }
- }
-
- //----
- if (sDepth == "4") {
- if (CodeCd == "") {
- Tree2 = trv_gubn.item(i);
- Tree3 = trv_gubn.item(Tree2.parentindex);
- pIdx2 = Tree3.parentindex + 1;
- pIdx3 = Tree2.parentindex + 1;
- OpCode = model.getValue(TreePath +"["+pIdx2+"]/pcode");
-
- if (model.getValue(ApndPath +"[pcode='"+ OpCode+"']/pcode") == "") {
- ii = fChoisSetData(pIdx2, ii, "Y");
- }
-
- ii = fChoisSetData(pIdx3, ii, "Y");
- }
- }
-
- //----
- if (sDepth == "5") {
- if (CodeCd == "") {
- Tree2 = trv_gubn.item(i); // 자신
- Tree3 = trv_gubn.item(Tree2.parentindex);
- Tree4 = trv_gubn.item(Tree3.parentindex);
-
- pIdx1 = Tree4.parentindex + 1;
- pIdx2 = Tree3.parentindex + 1;
- pIdx3 = Tree2.parentindex + 1;
- // bbb ="Level3===>>"+pIdx3+":-"+OpCode+"-::-"+CodeCd;
-
- OpCode = model.getValue(TreePath +"["+pIdx1+"]/pcode");
- CodeCd = model.getValue(ApndPath +"[pcode='"+ OpCode+"']/pcode");
-
- // aaa ="Level1===>>"+pIdx1+":-"+OpCode+"-::-"+CodeCd;
- //
- if (CodeCd == "") {
- ii = fChoisSetData(pIdx1, ii, "Y");
- }
- OpCode = model.getValue(TreePath +"["+pIdx2+"]/pcode");
- CodeCd = model.getValue(ApndPath +"[pcode='"+ OpCode+"']/pcode");
- // aaa +="Level2===>>"+pIdx2+":-"+OpCode+"-::-"+CodeCd;
- //
- if (CodeCd == "") {
- ii = fChoisSetData(pIdx2, ii, "Y");
- }
-
- ii = fChoisSetData(pIdx3, ii, "Y");
-
- // alert(aaa+bbb);
-
- }
- }
- ii = fChoisSetData(i+1, ii, "A");
-
- }
- }
- pNode = instance1.selectSingleNode(ApndPath);
- if (pNode != null) {
- model.removeNode(ListPath);
-
- model.makeNode(ListPath);
- //
- model.setValue(DataPath + "/updateyn" , "Y" );
- model.copyNode("/root/main/RscmggbnEmpLists", AppnPath);
- bbt_emp.selected="true";
- bbt_emp.dispatch("DOMActivate");
-
- // model.removeNode(AppnPath);
- btn_save.disabled = false;
- trv_empdata.rebuild();
- }
- }
-
- // ------------------------------
- // 관리물품선택
- // ------------------------------
- function fChoisSetData(pIdx, pRow, pCheckYN){
- var AppnPath = "/root/WorkData/workinst/AppendLists";
- var CopyPath = "/root/WorkData/workinst/CopyList/rscmggbnemplist";
- var ApndPath = AppnPath+"/rscmggbnemplist";
-
- model.setValue(CopyPath+"/depth" , model.getValue(TreePath +"["+pIdx+"]/depth" ));
- model.setValue(CopyPath+"/pcode" , model.getValue(TreePath +"["+pIdx+"]/pcode" ));
- model.setValue(CopyPath+"/codecd" , model.getValue(TreePath +"["+pIdx+"]/codecd" ));
- model.setValue(CopyPath+"/codenm" , model.getValue(TreePath +"["+pIdx+"]/codenm" ));
- model.setValue(CopyPath+"/basecd" , model.getValue(TreePath +"["+pIdx+"]/basecd" ));
- model.setValue(CopyPath+"/dispnm" , model.getValue(TreePath +"["+pIdx+"]/dispnm" )+ ((pCheckYN == "A") ? "(전체)" : "") );
- model.setValue(CopyPath+"/checkyn", pCheckYN);
-
- if (pRow == 1) {
- model.makeNode(ApndPath+"["+pRow+"]" );
- model.copyNode(ApndPath+"["+pRow+"]", "/root/WorkData/workinst/defaultggbn");
- pRow++;
- }
- model.makeNode(ApndPath+"["+pRow+"]" );
-
- model.copyNode(ApndPath+"["+pRow+"]", CopyPath);
-
- pRow++;
-
- return pRow;
-
- }
-
- // ----------------------------------------------------------------
- // 사용자별관리물품권한 자료 저장
- // ----------------------------------------------------------------
- function fRscmggbnDataSubmit(pCls) {
- if ((model.getValue(DataPath + "/emplno") =="") ||
- (model.getValue(DataPath + "/emplnm") =="") ) {
-
- messageBox("해당 사원번호를 ", "C001");
- return;
- }
- var pNode = instance1.selectSingleNode(ListPath);
- if (pNode == null) {
- messageBox("수정(입력)된 자료가 ", "I004");
- return;
- }
- var RscmggbnsList = "status" + "▦" // 1 상태
- + "instcd" + "▦" // 2 기관번호
- + "emplno" + "▦" // 3 사원번호
- + "goodflag" + "▦" // 4 물품구분
- + "lrgcd" + "▦" // 5 대분류코드
- + "mdlcd" + "▦" // 6 중분류코드
- + "smlcd" + "▦" // 7 소분류코드
- + "cmt" + "▩"; // 8 비고
- var vEmpData2 = ""
- var vEmpData1 = pCls + "▦" // 1 상태
- + model.getValue(HidePath+"/instcd" )+ "▦" // 2 기관번호
- + model.getValue(DataPath+"/emplno" )+ "▦"; // 3 사원번호
- //입력
- if (pCls == "D") {
- vEmpData2 += vEmpData1
- + "" + "▦" // 4 물품구분
- + "" + "▦" // 5 대분류코드
- + "" + "▦" // 6 중분류코드
- + "" + "▦" // 7 소분류코드
- + "" + "▩"; // 8 비고
-
- } else {
- for(var i=0; i < trv_empdata.length; i++) {
- sDepth = model.getValue(ListPath +"["+(i+1)+"]/depth");
-
- switch(sDepth) {
- case "2" : vGoodflag = model.getValue(ListPath +"["+(i+1)+"]/codecd"); // 4 물품구분
- vLrgcd = "%"; // 5 대분류코드
- vMdlcd = "%"; // 6 중분류코드
- vSmlcd = "%"; // 7 소분류코드
- break;
- case "3" : vLrgcd = model.getValue(ListPath +"["+(i+1)+"]/codecd"); // 5 대분류코드
- vMdlcd = "%"; // 6 중분류코드
- vSmlcd = "%"; // 7 소분류코드
- break;
- case "4" : vMdlcd = model.getValue(ListPath +"["+(i+1)+"]/codecd"); // 6 중분류코드
- vSmlcd = "%"; // 7 소분류코드
- break;
- case "5" : vSmlcd = model.getValue(ListPath +"["+(i+1)+"]/codecd"); // 7 소분류코드
- }
-
- //---
- if (model.getValue(ListPath +"["+(i+1)+"]/checkyn") == "A") {
- vEmpData2 += vEmpData1
- + vGoodflag + "▦" // 4 물품구분
- + vLrgcd + "▦" // 5 대분류코드
- + vMdlcd + "▦" // 6 중분류코드
- + vSmlcd + "▦" // 7 소분류코드
- + "" + "▩"; // 8 비고
- }
- }
- }
- //----
- RscmggbnsList += vEmpData2;
- model.removenode("/root/send");
- model.makeValue("/root/send/rscmggbnlist", RscmggbnsList);
- //
- if (submit("TXRSC01001", false)) { // 정보저장
- messageBox("자료 저장 ", "I002");
- // fRscmggbnTree();
- }
- }
- // ----------------------------------------------------------------
- // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
- // ----------------------------------------------------------------
- function fInitialize() {
- // grid reset
- //misfGridInit(grd_rscmggbn);
- //misfGridInit(grd_rscmregb);
- //misfGridInit(grd_rscmreus);
- //misfGridInit(grd_rscmsude);
- //misfGridInit(grd_gooddmnd);
-
- ///////////////////////////////////////////////////////////////////////////////////////////////
- // tab1 기관코드 combo setting
- //rszfUserInstList(cmb_instcd,getUserInfo("userid")); //사용자소속기관
- ///////////////////////////////////////////////////////////////////////////////////////////////
- misfComboComCdList("Z0007", cmb_instcd); //전체기관코드
-
-
- ///////////////////////////////////////////////////////////////////////////////////////////////
- //물품구분
- //misfComboComCdList("R0025", goodflag); //물품구분
- ///////////////////////////////////////////////////////////////////////////////////////////////
- //misfGridComboComCdList("R0025",grd_rscmggbn,"goodflag");
-
- // 스위치 오픈 설정.
- cse_ggbn.selected=true;
- // 막음.황
- //rszfGridComboLrgcdList("P", grd_rscmggbn, "lrgcd")
-
- // tab1 .master ,detail set
- //misfMsterDetailSet(grd_rscmggbn,null, "TRRSC01001" ,"Y");
- // tab2 .master ,detail set
- //misfMsterDetailSet(grd_rscmregb,null, "TRRSC01002" ,"Y");
- // tab2 master, detail set 청구처리권한 설정
- //misfMsterDetailSet(grd_rscmreus, grd_rscmregb, "TRRSC01003", "Y");
- // tab2 master, detail set 취합부서 설정
- //misfMsterDetailSet(grd_rscmsude, grd_rscmregb, "TRRSC01004", "Y");
- //model.setValue(cmb_instcd.attribute("ref") , getUserInfo("dutplceinstcd"));
- //model.setValue(opt_purcdmnddeptcd.attribute("ref") , getUserInfo("dutplcecd"));
- //model.setValue(opt_purcdmnddeptnm.attribute("ref") , getUserInfo("dutplcenm"));
- model.refresh();
- }
- // ----------------------------------------------------------------
- function fCheckRetrieveData(pmsg)
- {
-
- if(model.getValue(cmb_instcd.attribute("ref")).length== 0 )
- {
- if(pmsg == true)
- {
- messageBox("기관코드를 " ,"C002");
- model.setFocus("cmb_instcd");
- }
- return false;
- }
- return true;
- }
- // ----------------------------------------------------------------
- function fDefaultSetting(prow)
- {
- model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/purcreqflag",model.getValue("/root/send/gooddmnd/purcreqflag"));
- model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/instcd" ,model.getValue("/root/send/gooddmnd/instcd") );
- model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/goodflag" ,model.getValue("/root/send/gooddmnd/goodflag") );
- model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/purcdmnddd" ,model.getValue("/root/send/gooddmnd/purcdmnddd") );
- model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/reqdeptcd" ,model.getValue("/root/send/gooddmnd/reqdeptcd") );
- model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/reqpsn" ,model.getValue("/root/send/gooddmnd/reqpsn") );
- model.setValue(grd_gooddmnd.nodeset+"["+prow+"]/purcdmndseq",prow);
- }
-
- // ----------------------------------------------------------------
- function fSettingGoodList(pnode, nodename, userqtynm){
-
- var codynode = instance1.selectNodes(pnode + "/*");
- var addRow = grd_gooddmnd.rows - grd_gooddmnd.fixedRows;
-
- if(model.getValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodcd").length > 0)addRow = addRow + 1;
- for (var j = 1; j <= codynode.length ; j++) {
- if(addRow > grd_gooddmnd.rows - grd_gooddmnd.fixedRows)
- {
- misfGridIUD(grd_gooddmnd,"A");
- addRow = grd_gooddmnd.rows - grd_gooddmnd.fixedRows;
- fDefaultSetting(addRow );
- }
- model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodcd" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodcd"));
- model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodnm" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodnm"));
- model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodspec" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodspec"));
- model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodmodel" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodmodel"));
- model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/prodcmpynm" , model.getValue(pnode +"/" + nodename + "[" + j + "]/prodcmpynm"));
- model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqpackunit" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purcunit"));
- model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqpackcnt" , model.getValue(pnode +"/" + nodename + "[" + j + "]/" + userqtynm));
- model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/requnit" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purcunit"));
- model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqqty" , model.getValue(pnode +"/" + nodename + "[" + j + "]/" + userqtynm));
- model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/reqpackcntperunit" ,1);
- model.setValue(grd_gooddmnd.nodeset + "[" + addRow + "]/goodunitcost" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodunitcost"));
-
- addRow = addRow + 1;
- }
-
- model.recalculate();
- model.refresh();
- }
-
- // ----------------------------------------------------------------
- function fCheckSaveData()
- {
- for(var currow = grd_rscmggbn.fixedRows ; currow < grd_rscmggbn.rows ; currow++)
- {
-
- // if (grd_rscmggbn.rowStatus(currow) != '4')
- if (grd_rscmggbn.rowStatus(currow) == '1' || grd_rscmggbn.rowStatus(currow) == '2'|| grd_rscmggbn.rowStatus(currow) == '3')
- {
- if(grd_rscmggbn.valueMatrix(currow , grd_rscmggbn.colRef("emplno")).length == 0)
- {
- messageBox((currow )+ " 번째 사원번호를 " ,"C001");
- grd_rscmggbn.row = currow;
- grd_rscmggbn.col= grd_rscmggbn.colRef("emplno");
- grd_rscmggbn.editCell();
- return false;
- }
- if(grd_rscmggbn.valueMatrix(currow , grd_rscmggbn.colRef("goodflag")).length == 0)
- {
- messageBox((currow)+ " 번째 물품구분을 " ,"C001");
- grd_rscmggbn.row = currow;
- grd_rscmggbn.col= grd_rscmggbn.colRef("goodflag");
- grd_rscmggbn.editCell();
- return false;
- }
- if(grd_rscmggbn.valueMatrix(currow , grd_rscmggbn.colRef("lrgcd")).length == 0)
- {
- messageBox((currow)+ " 번째 대분류코드를 " ,"C001");
- grd_rscmggbn.row = currow;
- grd_rscmggbn.col= grd_rscmggbn.colRef("lrgcd");
- grd_rscmggbn.editCell();
- return false;
- }
- }
- }
- return true;
- }
- // trv_base.select(i); 위치...
- // trv_base.rebuild();
- // if ( btn_trvzoom.attribute("text") == "닫힘" ) {
- // trv_base.expandDepth = 0;
- // btn_trvzoom.attribute("text") = "펼침";
- //
- // } else {
- // trv_base.expandDepth = -1;
- // btn_trvzoom.attribute("text") = "닫힘";
- // }
-
- /* ------------------------------------------------- */
- /* ------End Of List ------------------------------- */
- /* -------------------------------------------------- */
|