1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069 |
- /* ---------------------------------------------------------------------
-
- 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";
- // --------------------------------------------------
- // Tree정보 가져오기
- // --------------------------------------------------
- function fInit() {
- //화면 Control을 초기화한다
- fCheckAuth();
- fInitialize();
- fOpenForm();
- return;
- 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.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:물품구분
- model.makeValue("/root/send/instcd" ,getUserInfo("dutplceinstcd") ); // 기관코드
- model.makeValue("/root/send/deptcd" ,getUserInfo("posdeptcd" ) ); // 부서코드
- 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();
- }
- }
- // ----SMRSC05300 Start -------------------------------------------
- // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
- // ----------------------------------------------------------------
- /*
- 2008년 1월 9일 from : 송광호.
- 보험정보(보험여부 EDI,무신정구분) 을 삭제.
- 이유 : 구조상 사용되지 않는 부분이라 황병현과장님의 요청으로 컨트롤 삭제.
- */
-
- ////........
- // 화면이 다른 폼에 의해 불려졌을때 실행!!
- function fOpenForm()
- {
- if(checkOpener())
- {
- if(opener.window.javascript.getScreenID() == "SMPIC00100")
- {
- //입력및 저장관련 컨트롤 설정.
- fOpenFormControlSetting(true);
-
- model.makeNode("/root/temp/good");
- model.copyNode("/root/temp/good", opener.root.main.item1.mchrginfo);
- model.setValue("/root/send/goodlist/goodcd", model.getValue("/root/temp/good/calcscorcd"));
-
-
-
- //팝업으로 띄워졌을경우 물품구분 콤보에 "전체" Item을 추가
- //품목세부사항의 단위 콤보를 설정하기 위해 넘어온 goodcd의 물품구분을 가져와서 설정함.
- if(model.getValue("/root/send/goodlist/goodcd") != "")
- {
- addComboItem("cmb_goodflag_search", "", "", "above");
- var goodcdflag = model.getValue("/root/send/goodlist/goodcd");
-
- var flag = goodcdflag.substr(0,1);
- cmb_goodflag_search.value = flag;
-
- rszfComboUnitList (cmb_prcpunit, model.getValue(opt_instcd.attribute("ref")), model.getValue(cmb_goodflag_search.attribute("ref")));
- misfComboCopyItemSet(cmb_prcpunit, "", cmb_purcunit, ""); //포장단위
- misfComboCopyItemSet(cmb_prcpunit, "", cmb_deliveunit, ""); //수불단위
-
- //cmb_goodflag_search.select(0);
- btn_search.dispatch("DOMActivate");
- }
- }else if(opener.window.javascript.getScreenID() == "SMRSI02600"){ // 평화드림 월정산에서 로드했을시....
- if(model.getValue("/root/temp/goodcd") != "")
- {
- cmb_goodflag_search.value = model.getValue("/root/temp/goodflag");
- ipt_goodcd_search.value = model.getValue("/root/temp/goodcd");
-
- btn_search.dispatch("DOMActivate");
- }
- }
- }
- }
-
- function fOpenFormControlSetting(fBool)
- {
- btn_save.disabled = fBool;
- btn_sgsave.disabled = fBool;
- button2.disabled = fBool;
- btn_choidel.disabled = fBool;
- btn_insert.disabled = fBool;
- btn_photinfo.disabled = fBool;
- btn_goodcdcopy.disabled = fBool;
- btn_useinstinfo.disabled = fBool;
- btn_allsizergst.disabled = fBool;
- btn_goodsetrgst.disabled = fBool;
- }
- // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
- function fInitialize() {
- model.resetInstanceNode("/root/send");
- model.setValue("/root/send/save/setautoins/setyn","N");
-
- //rszfUserGoodFlagList(cmb_goodflag,getUserInfo("userid"));
- rszfGoodFlagListByPgmGubn(cmb_goodflag,"1","N");
-
- misfComboCopyItemSet(cmb_goodflag, "", cmb_goodflag_search, ""); //물품구분
- //rszfReqFlagComboComCdList(getUserInfo("userid"),cmb_reqflag,"Y");
- rszfUserReqFlagList(cmb_reqflag,getUserInfo("dutplceinstcd"),getUserInfo("userid"),"1","P" );
- //[2007.12.08 HBH : cmb_mngtflag (R0094)삭제.
-
- misfComboComCdListMulti("R0092,R0069,R0068,R0047,R0035,R0106,R0093,R0095,R0110,R0111,R0107","cmb_reqmthd,cmb_stocmngtflag,cmb_proddrugsetflag,cmb_curncyunit,cmb_prodplce,cmb_plceordqtycretflag,cmb_reqprid,cmb_conflag,cmb_setplceordflag,cmb_purcflag,cmb_plceordbase");
- //기관코드 읽어오는 부분 넣기
- var instcd = getUserInfo("dutplceinstcd");
- var instnm = getUserInfo("dutplceinstnm");
-
- if(instcd.length > 0)model.setValue(opt_instcd.attribute("ref"), instcd);
- if(instnm.length > 0)model.setValue(opt_instnm.attribute("ref"), instnm);
- //물품구분일 경우 첫번째 index 자동 설정
- if(cmb_goodflag_search.length> 0) cmb_goodflag_search.selectedindex= 0;
-
- misfGridInit(grd_goodlist);
- misfGridInit(grd_gooddetlist);
- misfGridInit(grd_costhistinfo);
- misfGridInit(grd_instinfo);
- misfGridInit(grd_rscdgchglist);
- misfGridIUD(grd_gooddetlist, "A");
- rszfComboUnitList (cmb_prcpunit,model.getValue(opt_instcd.attribute("ref")),model.getValue(cmb_goodflag_search.attribute("ref")));
- misfComboCopyItemSet(cmb_prcpunit, "", cmb_purcunit, ""); //포장단위
- misfComboCopyItemSet(cmb_prcpunit, "", cmb_deliveunit, ""); //수불단위
- // 대분류 코드 콤보 설정.
- rszfLMSComboList(model.getValue(cmb_goodflag_search.attribute("ref")), "", "", "cmb_lrgcd_search", "", "L");
- rszfLMSComboList(model.getValue(cmb_goodflag_search.attribute("ref")), "", "", "cmb_lrgcd", "", "L");
-
- model.setValue(grd_gooddetlist.nodeset + "/goodflag", model.getValue(cmb_goodflag_search.attribute("ref")));
- model.copyNode("/root/main/gooddet/gooddetlist","/root/main/list/gooddet/gooddetlist");
- misfMsterDetailSet(grd_goodlist,null, "TRRSC05301" ,"Y");
- misfMsterDetailSet(grd_gooddetlist,grd_goodlist, "TRRSC05302" ,"Y");
- misfMsterDetailSet(grd_costhistinfo,grd_goodlist, "TRRSC05302" ,"N");
- misfMsterDetailSet(grd_instinfo,grd_goodlist, "TRRSC05302" ,"N");
- misfMsterDetailSet(grd_rscdgchglist,grd_goodlist, "TRRSC03702" ,"N");
-
- // 물품구분별 권한
- fSetGoodFlagAuth();
- //rbo_instflag.select(1);
- model.setValue(rbo_instflag.attribute("ref"),"Y");
-
- grd_goodlist.explorerbar = "sortshow";
- model.setFocus("ipt_goodcd");
- model.refresh();
- }
- // 화면 전체 조회
- function fRetrGoodList(nodecopy) {
- model.resetInstanceNode("/root/main/gooddet/gooddetlist");
- misfMsterDetailRetrieve();
- //fAfterRetrGoodList();
- if(nodecopy == true)fAfterRetrGoodList();
- else if( nodecopy == false && grd_gooddetlist.rows - grd_gooddetlist.fixedRows== 0 )btn_insert.dispatch("DOMActivate");
- // 중분류/소분류 combo setting
-
- rszfLMSComboList(model.getValue(cmb_goodflag_search.attribute("ref")), "", "", "cmb_lrgcd", "", "L");
- if (grd_gooddetlist.valueMatrix(grd_gooddetlist.row,grd_gooddetlist.colRef("mdlcd")).length > 0 )
- {
- rszfLMSComboList(model.getValue("/root/main/gooddet/gooddetlist/goodflag"), cmb_lrgcd.value, "", "cmb_mdlcd", "", "M");
- }
- if (grd_gooddetlist.valueMatrix(grd_gooddetlist.row,grd_gooddetlist.colRef("smlcd")).length > 0 )
- {
- rszfLMSComboList(model.getValue("/root/main/gooddet/gooddetlist/goodflag"), cmb_lrgcd.value, "", "cmb_mdlcd", "", "M");
- rszfLMSComboList(model.getValue("/root/main/gooddet/gooddetlist/goodflag"), cmb_lrgcd.value, cmb_mdlcd.value, "cmb_smlcd", "", "S");
- }
- }
- // 물품구분별 권한체크.
- function fSetGoodFlagAuth()
- {
-
- btn_save.disabled=true;
- btn_sgsave.disabled=true;
- rszfGetPurcGoodFlagAuthInfo(opt_instcd.value , cmb_goodflag_search.value, getUserInfo("userid"), "%");
-
- if(rszfGetGoodFlagAuthInfoByCond("goodflagauth") =="Y")
- {
- btn_save.disabled=false;
- btn_sgsave.disabled=false;
- }
- }
-
-
- function fCheckSaveData()
- {
- if(model.getValue(ipt_goodcd.attribute("ref")).length== 0 )
- {
- messageBox("물품코드는" ,"I003");
- model.setFocus("ipt_goodcd");
- return false;
- }
-
- if(model.getValue(ipt_goodnm.attribute("ref")).length== 0 )
- {
- messageBox("물품코드명은" ,"I003");
- model.setFocus("ipt_goodnm");
- return false;
- }
-
- if(model.getValue(cmb_lrgcd.attribute("ref")).length== 0 )
- {
- messageBox("대분류코드는" ,"I003");
- model.setFocus("cmb_lrgcd");
- return false;
- }
- if(model.getValue(ipt_winacnt.attribute("ref")).length== 0 )
- {
- messageBox("비용계정은" ,"I003");
- model.setFocus("ipt_winacnt");
- return false;
- }
-
- if(model.getValue(ipt_mngtdeptcd.attribute("ref")).length== 0 )
- {
- messageBox("주관리부서는" ,"I003");
- model.setFocus("ipt_mngtdeptcd");
- return false;
- }
-
- if(model.getValue(cmb_reqmthd.attribute("ref")).length== 0 )
- {
- messageBox("청구방법은" ,"I003");
- model.setFocus("cmb_reqmthd");
- return false;
- }
-
- if(model.getValue(cmb_purcunit.attribute("ref")).length== 0 )
- {
- messageBox("구매단위은" ,"I003");
- model.setFocus("cmb_purcunit");
- return false;
- }
-
- if(model.getValue(ipt_exchqty.attribute("ref")).length== 0 )
- {
- messageBox("환산수량은" ,"I003");
- model.setFocus("ipt_exchqty");
- return false;
- }
-
- if(model.getValue(cmb_deliveunit.attribute("ref")).length== 0 )
- {
- messageBox("불출단위는" ,"I003");
- model.setFocus("cmb_deliveunit");
- return false;
- }
-
- if(model.getValue(cmb_stocmngtflag.attribute("ref")).length== 0 )
- {
- messageBox("재고관리기준은" ,"I003");
- model.setFocus("cmb_stocmngtflag");
- return false;
- }
-
- if(model.getValue(cmb_reqmthd.attribute("ref")).length== 0 )
- {
- messageBox("청구방법은" ,"I003");
- model.setFocus("cmb_reqmthd");
- return false;
- }
-
- if(model.getValue(cmb_purcflag.attribute("ref")).length== 0 )
- {
- messageBox("구매구분은" ,"I003");
- model.setFocus("cmb_purcflag");
- return false;
- }
- /*
- if(model.getValue(cmb_asetflag.attribute("ref")).length== 0 )
- {
- messageBox("자산구분은" ,"I003");
- model.setFocus("cmb_asetflag");
- return false;
- }
- */
- if(model.getValue(chk_reuseyn.attribute("ref")) == "Y" && model.getValue(ipt_divusenvalqty.attribute("ref")) == 0)
- {
- messageBox("분할사용여부를 선택하신 경우에는 분할사용수치가 " ,"I003");
- model.setFocus("ipt_divusenvalqty");
- return false;
- }
-
-
- if(model.getValue(ipt_nonusetretdd.attribute("ref")).length > 0 && model.getValue(ipt_nonusetretdd.attribute("ref")) <= getCurrentDate() && model.getValue(ipt_nonusetretresn.attribute("ref")) == 0)
- {
- messageBox("코드 불용일자를 선택하신 경우에는 불용사유가 " ,"I003");
- model.setFocus("ipt_nonusetretresn");
- return false;
- }
-
- if(model.getValue(cmb_conflag.attribute("ref")).length > 0 )
- {
- /*
- if(model.getValue(ipt_fromconterm.attribute("ref")).length == 0 )
- {
- messageBox("계약구분을 선택하신 경우에는 계약시작일자가 " ,"I003");
- model.setFocus("ipt_fromconterm");
- return false;
- }
- if(model.getValue(ipt_toconterm.attribute("ref")).length == 0 )
- {
- messageBox("계약구분을 선택하신 경우에는 계약종료일자가 " ,"I003");
- model.setFocus("ipt_toconterm");
- return false;
- }
- model.setFocus("ipt_nonusetretresn");
- */
- }
- else
- {
- if(model.getValue(ipt_fromconterm.attribute("ref")).length > 0 || model.getValue(ipt_toconterm.attribute("ref")).length > 0)
- {
- messageBox("계약기간을 입력하신 경우에는 계약구분이 " ,"I003");
- model.setFocus("cmb_conflag");
- return false;
- }
-
- }
-
- if(model.getValue(ipt_toconterm.attribute("ref")).length > 0 && (model.getValue(ipt_toconterm.attribute("ref")) < model.getValue(ipt_fromconterm.attribute("ref"))) )
- {
- messageBox("계약시작일자는 계약 종료일자보다 크게 설정","E001");
- model.setFocus("ipt_fromconterm");
- return false;
-
- }
-
- if(model.getValue(ipt_fromconterm.attribute("ref")).length > 0 && (model.getValue(ipt_toconterm.attribute("ref")) < model.getValue(ipt_fromconterm.attribute("ref"))) )
- {
- messageBox("계약시작일자는 계약 종료일자보다 크게 설정","E001");
- model.setFocus("ipt_toconterm");
- return false;
- }
-
- if(model.getValue(cmb_purcflag.attribute("ref")).length > 0 && model.getValue(ipt_lastpurcdd.attribute("ref")) == 0)
- {
- /*
- messageBox("구매구분이 설정되었을 경우에는 최종 구매일자가 " ,"I003");
- model.setFocus("cmb_purcflag");
- return false;
- */
- }
- return true;
- }
-
- function fAfterRetrGoodList()
- {
- // if (grd_gooddetlist.rows == 0 )btn_insert.dispatch("DOMActivate");
- model.copyNode("/root/main/gooddet/gooddetlist","/root/main/list/gooddet/gooddetlist");
-
- if(model.getValue(ipt_nonusetretdd.attribute("ref")).length > 0 && model.getValue(ipt_nonusetretdd.attribute("ref")) < getCurrentDate())ipt_nonusetretdd.attribute("background-color") = "#c0c0c0";
- else ipt_nonusetretdd.attribute("background-color") = "#ffffff";
-
- grp_detail.refresh();
- grp_etcgood.refresh();
-
- grd_gooddetlist.row = 1;
- model.setFocus("ipt_goodcd");
- }
-
- function fCheckAuth() {
- btn_search.disabled = !checkAuth("R") ;
- btn_save.disabled = !checkAuth("X") ;
- //btn_prt.disabled = !checkAuth("P") ;
- }
-
- function fSetDataCopy(){
- if(grd_gooddetlist.rows < grd_goodlist.fixedRows)grd_gooddetlist.row = 1;
- misfGridRowStatusChange(grd_gooddetlist,"/root/main/list/gooddet" , "/root/main/gooddet");
- grp_detail.refresh();
- }
- function fDefaultSetting()
- {
-
- model.setValue(grd_gooddetlist.nodeset + "["+ grd_gooddetlist.row + "]/goodflag" , model.getValue(cmb_goodflag_search.attribute("ref")));
- model.setValue(grd_gooddetlist.nodeset + "["+ grd_gooddetlist.row + "]/goodcd" , "");
- model.setValue(grd_gooddetlist.nodeset + "["+ grd_gooddetlist.row + "]/fromdd" , getCurrentDate());
- model.setValue(grd_gooddetlist.nodeset + "["+ grd_gooddetlist.row + "]/lrgcd" , model.getValue(cmb_lrgcd_search.attribute("ref")));
- model.setValue(grd_gooddetlist.nodeset + "["+ grd_gooddetlist.row + "]/mdlcd" , model.getValue(cmb_mdlcd_search.attribute("ref")));
- model.setValue(grd_gooddetlist.nodeset + "["+ grd_gooddetlist.row + "]/smlcd" , model.getValue(cmb_smlcd_search.attribute("ref")));
- model.setValue(grd_gooddetlist.nodeset + "["+ grd_gooddetlist.row + "]/prodcmpycd" , model.getValue(ipt_prodcmpy_search.attribute("ref")));
- model.setValue(grd_gooddetlist.nodeset + "["+ grd_gooddetlist.row + "]/prodcmpynm" , model.getValue(ipt_prodcmpynm_search.attribute("ref")));
-
- model.setValue(grd_gooddetlist.nodeset + "["+ grd_gooddetlist.row + "]/asetflag", "1");
- // model.setValue("/root/main/gooddet/gooddetlist/asetflag" , '1'); // 자산구부 : '1' 재고자산
- }
-
- function fChkSaveData(pgrid_name, ptarget_node, psource_node) {
- var node1 = instance1.selectNodes(ptarget_node + "/*");
- var node2 = instance1.selectNodes(psource_node + "/*");
- for (var i = 0; i < node1.length ; i++) {
- for (var j = 0; j < node2.length; j++) {
- if (node1.item(i).nodeName == node2.item(j).nodeName) {
- var nextnode1 = instance1.selectNodes(ptarget_node + "/" + node1.item(i).nodeName + "[" + (pgrid_name.row - pgrid_name.fixedRows + 1) + "]" + "/*");
- var nextnode2 = instance1.selectNodes(psource_node + "/" + node2.item(j).nodeName + "/*");
-
- var copytarget = ptarget_node + "/" + node1.item(i).nodeName + "[" + (pgrid_name.row - pgrid_name.fixedRows + 1) + "]";
- var copysource = psource_node + "/" + node2.item(j).nodeName;
-
- for (var k = 0; k < nextnode1.length; k++) {
- for (var p = 0; p < nextnode2.length; p++) {
- if (nextnode1.item(k).nodeName == nextnode2.item(p).nodeName) {
- if (model.getValue(ptarget_node + "/" + node1.item(i).nodeName + "[" + (pgrid_name.row - pgrid_name.fixedRows + 1) + "]" + "/" + nextnode1.item(k).nodeName) !=
- model.getValue(psource_node + "/" + node2.item(j).nodeName + "/" + nextnode2.item(p).nodeName))return true;
- }
- }
- }
- }
- }
- }
- return false;
- }
- function fCheckRetrieveData()
- {
-
- if(model.getValue(cmb_goodflag_search.attribute("ref")).length== 0 )
- {
- if(cmb_goodflag_search.label != "- 전 체 -")
- {
- messageBox("물품구분을 " ,"C002");
- model.setFocus("cmb_goodflag");
- return false;
- }
- }
- /*
- if(model.getValue(cmb_lrgcd_search.attribute("ref")).length== 0 && model.getValue(ipt_oldcd_search.attribute("ref")).length== 0 )
- {
- messageBox("대분류코드를 " ,"C002");
- model.setFocus("cmb_lrgcd_search");
- return false;
- }
- if(model.getValue(ipt_goodcd_search.attribute("ref")).length == 0 && model.getValue(ipt_goodnm_search.attribute("ref")).length < 4)
- {
- messageBox("물품코드 또는 물품명에 최소 2자리를" ,"C001");
- model.setFocus("ipt_goodcd_search");
- return false;
- }
- */
- return true;
- }
- function fInstGoodCdCopy()
- {
- if(grd_goodlist.rows - grd_goodlist.fixedRows == 0)return;
-
- btn_insert.dispatch("DOMActivate");
- model.SetValue(ipt_goodcd.attribute("ref"),model.getValue(grd_goodlist.nodeset+"["+grd_goodlist.row+"]/goodcd"));
- model.SetValue(ipt_goodnm.attribute("ref"),model.getValue(grd_goodlist.nodeset+"["+grd_goodlist.row+"]/goodnm"));
- model.SetValue(ipt_goodhngnm.attribute("ref"),model.getValue(grd_goodlist.nodeset+"["+grd_goodlist.row+"]/goodhngnm"));
- model.SetValue(ipt_goodengnm.attribute("ref"),model.getValue(grd_goodlist.nodeset+"["+grd_goodlist.row+"]/goodengnm"));
- model.SetValue(ipt_goodspec.attribute("ref"),model.getValue(grd_goodlist.nodeset+"["+grd_goodlist.row+"]/goodspec"));
- model.SetValue(ipt_goodmodel.attribute("ref"),model.getValue(grd_goodlist.nodeset+"["+grd_goodlist.row+"]/goodmodel"));
- model.SetValue(cmb_lrgcd.attribute("ref"),model.getValue(grd_goodlist.nodeset+"["+grd_goodlist.row+"]/lrgcd"));
-
- cmb_lrgcd.dispatch("xforms-value-changed"); // 선택한 대분류에 대한 중분류 값을 얻기 위한 action
-
- model.SetValue(cmb_mdlcd.attribute("ref"),model.getValue(grd_goodlist.nodeset+"["+grd_goodlist.row+"]/mdlcd"));
- model.SetValue(cmb_smlcd.attribute("ref"),model.getValue(grd_goodlist.nodeset+"["+grd_goodlist.row+"]/smlcd"));
-
- model.refresh();
-
- model.setFocus("ipt_winacnt");
- }
- function fGoodCdCopy()
- {
- if(model.getValue(cmb_goodflag_search.attribute("ref")).length== 0 )
- {
- messageBox("물품구분을 " ,"C002");
- model.setFocus("cmb_goodflag");
- return false;
- }
- if(model.getValue(cmb_lrgcd.attribute("ref")).length== 0 )
- {
- messageBox("대분류코드를 " ,"C002");
- model.setFocus("cmb_lrgcd");
- return false;
- }
- if(model.getValue(cmb_mdlcd.attribute("ref")).length== 0 )
- {
- messageBox("중분류코드를 " ,"C002");
- model.setFocus("cmb_mdlcd");
- return false;
- }
-
- model.setValue("/root/send/goodcopy/goodflag", model.getValue(cmb_goodflag_search.attribute("ref")));
- model.setValue("/root/send/goodcopy/lrgcd", model.getValue(cmb_lrgcd.attribute("ref")));
- model.setValue("/root/send/goodcopy/mdlcd", model.getValue(cmb_mdlcd.attribute("ref")));
- submit("TRRSC05303");
-
- var goodcd = model.getValue("/root/main/goodcopy/goodlist/goodcd");
- if(goodcd.length == 0)goodcd = model.getValue(cmb_goodflag_search.attribute("ref")) + model.getValue(cmb_lrgcd.attribute("ref")) + model.getValue(cmb_mdlcd.attribute("ref")) + "0001";
-
- model.setValue(ipt_goodcd.attribute("ref"), goodcd);
- grp_detail.refresh();
- }
-
- /* ------------------------------------------------- */
- /* ------End Of List ------------------------------- */
- /* -------------------------------------------------- */
|