123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696 |
- <?xml version="1.0" encoding="utf-8"?>
- <Script type="xscript4.0"><![CDATA[/* ---------------------------------------------------------------------
-
- SMRSC0100_사용자별관리물품권한.xrw (SMRSC0100.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- : Create By Francis Choi
- : 2015.05.02
- ---------------------------------------------------------------------- */
- var xAuth = !(frmf_checkAuth("X"));
- var pAuth = !(frmf_checkAuth("P"));
- var DataPath = "ds_main_RscmggbnEmpData";
- var MainPath = "ds_main_RscmggbnLists_rscmggbnlist";
- var ListsPath = "ds_main_RscmggbnEmpLists";
- var ListPath = "ds_main_RscmggbnEmpLists_rscmggbnemplist";
- var HidePath = "ds_WorkData_HideData";
- var TreePath = "ds_main_RscmgubnLists_TreeList";
- var WorkPath = "ds_init_WorkInit";
- var CompPath = "ds_init_CompareInit";
- var MIS_ADM1 = "20902001"; // MIS 담당자[CHR]
- var MIS_ADM2 = "10109410"; // MIS 담당자[LHM]
- /****************************************************************************************
- * Argument : N/A
- * Description : Tree정보 가져오기
- ****************************************************************************************/
- function fInit() {
- fInitialize();
- var vInstCd = sysf_getUserInfo("dutplceinstcd"); // 기관코드
- eval(HidePath).setColumn( 0, "instcd", vInstCd); // 기관코드
- eval(HidePath).setColumn( 0, "deptcd", sysf_getUserInfo("dutplcecd") ); // 부서코드
- eval(HidePath).setColumn( 0, "deptnm", sysf_getUserInfo("dutplcenm") ); // 부서명
- var vUserId = sysf_getUserInfo("userid"); // 기관코드
- if ( (vUserId == MIS_ADM1) ||(vUserId == MIS_ADM2) )
- group3.group1.cmb_instcd.enable = true;
- ds_send.clearData();
- dsf_makeValue( ds_send, "goodflag", "string", "" ); // 메시지종류
- dsf_makeValue( ds_send, "treeflag", "string", "A" ); // 트리구분 T: TREE, L: LARGE
- // Tree Data 정보를 가져온다.
- grp_disp.trv_data.tabindex = 1;
- var oParam = {};
- oParam.id = "TRRSC05104";
- oParam.service = "purcbaseapp.GoodCdMngt";
- oParam.method = "reqGetTreeCodeList";
- oParam.inds = "req=ds_send";
- oParam.outds = "ds_main_RscmgubnLists_TreeList=TreeList";
- oParam.async = false;
- oParam.callback = "cf_TRRSC05104";
- tranf_submit(oParam);
- fRscmggbnTree();
- }
- function cf_TRRSC05104(sSvcId, nErrorCode, sErrorMsg) {
- if(nErrorCode < 0) return;
- ds_main_RscmgubnLists_TreeList.addColumn("check","string");
- grdf_expandDepth(grp_disp.trv_data.case2.trv_gubn, 1);
- }
-
- /****************************************************************************************
- * Argument : N/A
- * Description : 사용자별관리물품권한를 TREE 조회
- ****************************************************************************************/
- function fRscmggbnTree() {
- ds_send.clearData();
- dsf_makeValue( ds_send, "viewcls", "string", eval(HidePath).getColumn(0,"viewcls")); // 트리구성구분 E:사번,G:물품구분
- if( !utlf_isNull(group3.group1.cmb_instcd.value) )
- dsf_makeValue( ds_send, "instcd", "string", group3.group1.cmb_instcd.value); // 기관코드
- else
- dsf_makeValue( ds_send, "instcd", "string", sysf_getUserInfo("dutplceinstcd") ); // 기관코드
- if( !utlf_isNull(group3.group1.ipt_deptcd.value) )
- dsf_makeValue( ds_send, "deptcd", "string", group3.group1.ipt_deptcd.value); // 부서코드
- else
- dsf_makeValue( ds_send, "deptcd", "string", sysf_getUserInfo("dutplcecd" ) ); // 부서코드
- // Tree Data 정보를 가져온다.
- var oParam = {};
- oParam.id = "TRRSC01005";
- oParam.service = "purcbaseapp.GoodCdMngt";
- oParam.method = "reqGetRscmggbnTreeList";
- oParam.inds = "req=ds_send";
- oParam.outds = "ds_main_RscmggbnLists_rscmggbnlist=rscmggbnlist";
- oParam.async = false;
- oParam.callback = "cf_TRRSC01005";
- tranf_submit(oParam);
- }
- function cf_TRRSC01005(sSvcId, nErrorCode, sErrorMsg) {
- if(nErrorCode < 0) return;
- grdf_expandDepth(group3.trv_setcode, 1);
- }
- /****************************************************************************************
- * Argument : pIdx - 선택인덱스
- * Description : Tree Click
- ****************************************************************************************/
- function fTreeClick(pIdx) {
- ds_main_RscmggbnEmpData.enableevent = false;
- 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;
- grp_disp.bbt_append.enable = true;
- grp_disp.bbt_delete.enable = true;
- eval(DataPath).setColumn( 0, "jobcls", "I");
- eval(DataPath).setColumn( 0, "updateyn", "N");
- var sDepth = eval(MainPath).getColumn(Idx, "depth");
- var vCodeCd = eval(MainPath).getColumn(Idx, "codecd");
- var vCodeNm = eval(MainPath).getColumn(Idx, "codenm");
- var vBaseCd = eval(MainPath).getColumn(Idx, "basecd");
- grp_disp.btn_save.enable = false;
- grp_disp.bbt_delete.enable = false;
- grp_disp.cmb_emplno.enable = false;
- grp_disp.btn_winpsn.enable = false;
- eval(DataPath).setColumn( 0, "depth", sDepth);
- if (sDepth == "1") {
- eval(DataPath).setColumn( 0, "instcd", vCodeCd);
- grp_disp.bbt_append.enable = true;
- grp_disp.cmb_emplno.enable = true;
- grp_disp.btn_winpsn.enable = true;
- return;
- }
- eval(DataPath).setColumn( 0, "jobcls", "U");
- eval(DataPath).setColumn( 0, "depth", sDepth);
- if (sDepth == "2") {
- eval(DataPath).setColumn( 0, "emplno", vCodeCd);
- eval(DataPath).setColumn( 0, "emplnm", vCodeNm);
- }
- if (sDepth == "3") {
- eval(DataPath).setColumn(0, "emplno" , eval(MainPath).getColumn(Idx, "emplno"));
- eval(DataPath).setColumn(0, "emplnm" , eval(MainPath).getColumn(Idx, "usernm"));
- }
- ds_send.clearData();
- dsf_makeValue( ds_send, "instcd", "string", eval(HidePath).getColumn(0, "instcd" )); // "기관코드
- dsf_makeValue( ds_send, "emplno", "string", eval(DataPath).getColumn(0, "emplno" )); // "사원번호
- // Tree Data 정보를 가져온다.
- var oParam = {};
- oParam.id = "TRRSC01006";
- oParam.service = "purcbaseapp.GoodCdMngt";
- oParam.method = "reqGetRscmggbnEmpTreeList";
- oParam.inds = "req=ds_send";
- oParam.outds = "ds_main_RscmggbnEmpLists_rscmggbnemplist=rscmggbnemplist";
- oParam.async = false;
- oParam.callback = "cf_TRRSC01006";
- tranf_submit(oParam);
- ds_main_RscmggbnEmpData.enableevent = true;
- grp_disp.trv_data.case1.trv_empdata.treeinitstatus = "expand,null";
- }
- function cf_TRRSC01006(sSvcId, nErrorCode, sErrorMsg) {
- if(nErrorCode < 0) return;
- grdf_expandDepth(grp_disp.trv_data.case1.trv_empdata, 1);
- }
- /****************************************************************************************
- * Argument : N/A
- * Description : Append Data
- ****************************************************************************************/
- function fAppendData() {
- var sDepth = eval(DataPath).getColumn(0, "depth");
- grp_disp.bbt_append.enable = false;
- if (utlf_isNull(sDepth)) {
- alert("상위 분류를 선택 하십시요!! ");
- return;
- }
-
- if (eval(DataPath).getColumn(0, "updateyn")) {
- if (sysf_messageBox("데이터가 변경 되었습니다. ", "Q003") == "2") return;
- }
- eval(ListPath).clearData();
- eval(DataPath).enableevent = false;
- eval(DataPath).updatecontrol = false;
-
- eval(DataPath).setColumn( 0, "emplno", "");
- eval(DataPath).setColumn( 0, "emplnm", "");
- eval(DataPath).setColumn( 0, "updateyn", "Y");
-
- eval(DataPath).updatecontrol = true;
- eval(DataPath).enableevent = true;
- grp_disp.btn_save.enable = true;
- grp_disp.bbt_delete.enable = false;
- grp_disp.cmb_emplno.enable = true;
- grp_disp.btn_winpsn.enable = true;
- grp_disp.trv_data.tabindex = 1;
- grp_disp.cmb_emplno.setFocus();
- }
- //
- // 변경여부 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" ));
-
- }
- /****************************************************************************************
- * Argument : N/A
- * Description : 관리물품선택 Tab Click
- ****************************************************************************************/
- function fChoisClick(){
- var vPcode = "";
- var vIdx = -1;
- dsf_setFixVal(eval(TreePath), "check:0");
- // 모든 아이템의 체크된 상태를 해제한다.
- if (this.objects[DataPath].getColumn(0, "jobcls") == "U"){
- for(var i=0; i < this.objects[ListPath].rowcount; i++) {
- vPcode = this.objects[ListPath].getColumn(i, "pcode");
- vChkyn = this.objects[ListPath].getColumn(i, "checkyn");
- if(vChkyn == "A") {
- vIdx = fLabelToIndex(vPcode, grp_disp.trv_data.case2.trv_gubn);
-
- if (vIdx > 0) {
- this.objects[TreePath].enableevent = false;
- this.objects[TreePath].updatecontrol = false;
- this.objects[TreePath].setColumn(eval(vIdx), "check", 1);
- this.objects[TreePath].updatecontrol = true;
- this.objects[TreePath].enableevent = true;
- }
- }
- }
- }
- }
- /****************************************************************************************
- * Argument : N/A
- * Description : 인자로 넘어온 값을 label 로 같은 아이템의 인덱스를 반환
- ****************************************************************************************/
- function fLabelToIndex(pValue, pTree) {
- for (var i=0; i < eval(pTree.binddataset).rowcount; i++)
- {
- if (eval(pTree.binddataset).getColumn(i, "pcode") == pValue) return i;
- }
- return -1;
- }
- /****************************************************************************************
- * Argument : N/A
- * Description : GUBUN Tree Click
- ****************************************************************************************/
- function fGubnTreeClick(fTree, fIdx) {
- var Idx = fIdx;
- var pIdx = 0;
- var sDepth = eval(TreePath).getColumn(Idx, "depth");
- // var Tree1 = fTree.item(fIdx);
- var cRow = fTree.getTreeParentRow(fIdx);
- if (sDepth == "1") {
- return;
- }
-
- eval(fTree.binddataset).setColumn(cRow, "check", 0);
- if (sDepth == "3") {
- var cRow1 = fTree.getTreeParentRow(cRow);
-
- eval(fTree.binddataset).setColumn(cRow1, "check", 0);
- }
-
- if (sDepth == "4") {
- var cRow1 = fTree.getTreeParentRow(cRow);
- var cRow2 = fTree.getTreeParentRow(cRow1);
-
- eval(fTree.binddataset).setColumn(cRow1, "check", 0);
- eval(fTree.binddataset).setColumn(cRow2, "check", 0);
- }
-
- if (sDepth == "5") {
- var cRow1 = fTree.getTreeParentRow(cRow);
- var cRow2 = fTree.getTreeParentRow(cRow1);
- var cRow3 = fTree.getTreeParentRow(cRow2);
-
- eval(fTree.binddataset).setColumn(cRow1, "check", 0);
- eval(fTree.binddataset).setColumn(cRow2, "check", 0);
- eval(fTree.binddataset).setColumn(cRow3, "check", 0);
- }
- }
- /****************************************************************************************
- * Argument : N/A
- * Description : 관리물품선택
- ****************************************************************************************/
- function fChoisData() {
- var ii = 0;
- var OpCode = "";
- var CodeCd = "";
- var ApndPath = "ds_WorkData_workinst_AppendLists_rscmggbnemplist";
- var CopyPath = "ds_WorkData_workinst_CopyList_rscmggbnemplist";
- // CodeCd = eval(ApndPath).lookup("pcode","0000","pcode");
- eval(ApndPath).clear();
- for(var i = 0; i < eval(TreePath).rowcount; i++) {
- if (eval(TreePath).getColumn(i, "check") == 1){
- sDepth = eval(TreePath).getColumn(i, "depth");
- OpCode = eval(TreePath).getColumn(i, "basecd");
- CodeCd = eval(ApndPath).lookup("pcode", OpCode, "pcode");
- // trace(i+ " sDepth : "+sDepth+ " OpCode : "+OpCode+ " CodeCd : "+CodeCd);
- if (sDepth == "3") {
- if (utlf_isNull(CodeCd)) {
- //Tree2 = trv_gubn.item(i);
- var cRow1 = grp_disp.trv_data.case2.trv_gubn.getTreeParentRow(i);
- ii = fChoisSetData( cRow1, ii, "Y");
- }
- }
-
- if (sDepth == "4") {
- if (utlf_isNull(CodeCd)) {
- var cRow1 = grp_disp.trv_data.case2.trv_gubn.getTreeParentRow(i);
- var cRow2 = grp_disp.trv_data.case2.trv_gubn.getTreeParentRow(cRow1);
-
- pIdx2 = cRow2;
- pIdx3 = cRow1;
-
- OpCode = eval(TreePath).getColumn(pIdx2, "pcode");
-
- if (utlf_isNull(eval(ApndPath).lookup("pcode", OpCode, "pcode"))) {
- ii = fChoisSetData(pIdx2, ii, "Y");
- }
- ii = fChoisSetData(pIdx3, ii, "Y");
- }
- }
-
- if (sDepth == "5") {
- if (utlf_isNull(CodeCd)) {
- var cRow1 = grp_disp.trv_data.case2.trv_gubn.getTreeParentRow(i);
- var cRow2 = grp_disp.trv_data.case2.trv_gubn.getTreeParentRow(cRow1);
- var cRow3 = grp_disp.trv_data.case2.trv_gubn.getTreeParentRow(cRow2);
-
- pIdx1 = cRow3;
- pIdx2 = cRow2;
- pIdx3 = cRow1;
-
- OpCode = eval(TreePath).getColumn(pIdx1, "pcode");
- CodeCd = eval(ApndPath).lookup("pcode", OpCode, "pcode");
-
- if (utlf_isNull(CodeCd)) {
- ii = fChoisSetData(pIdx1, ii, "Y");
- }
-
- OpCode = eval(TreePath).getColumn(pIdx2, "pcode");
- CodeCd = eval(ApndPath).lookup("pcode", OpCode, "pcode");
-
- if (utlf_isNull(CodeCd)) {
- ii = fChoisSetData(pIdx2, ii, "Y");
- }
- ii = fChoisSetData(pIdx3, ii, "Y");
- }
- }
- ii = fChoisSetData(i, ii, "A");
- }
- }
- if (eval(ApndPath).rowcount > 0) {
- eval(ListPath).clear();
- eval(DataPath).setColumn(0, "updateyn", "Y");
- eval(ListPath).copyData(eval(ApndPath));
- grp_disp.trv_data.case1.trv_empdata.treeinitstatus = "expand,null";
- grp_disp.btn_save.enable = true;
- }
- }
-
- /****************************************************************************************
- * Argument : N/A
- * Description : 관리물품선택
- ****************************************************************************************/
- function fChoisSetData(pIdx, pRow, pCheckYN){
- //trace("pIdx : "+ pIdx +" / pRow : "+ pRow + " / pCheckYN : "+ pCheckYN);
- var ApndPath = "ds_WorkData_workinst_AppendLists_rscmggbnemplist";
- var CopyPath = "ds_WorkData_workinst_CopyList_rscmggbnemplist";
- // var ApndPath = AppnPath+"_rscmggbnemplist";
- eval(CopyPath).setColumn(0, "depth" , eval(TreePath).getColumn(pIdx, "depth" ));
- eval(CopyPath).setColumn(0, "pcode" , eval(TreePath).getColumn(pIdx, "pcode" ));
- eval(CopyPath).setColumn(0, "codecd" , eval(TreePath).getColumn(pIdx, "codecd" ));
- eval(CopyPath).setColumn(0, "codenm" , eval(TreePath).getColumn(pIdx, "codenm" ));
- eval(CopyPath).setColumn(0, "basecd" , eval(TreePath).getColumn(pIdx, "basecd" ));
- eval(CopyPath).setColumn(0, "dispnm" , eval(TreePath).getColumn(pIdx, "dispnm" )+ ((pCheckYN == "A") ? "(전체)" : "") );
- eval(CopyPath).setColumn(0, "checkyn", pCheckYN);
- if (pRow == 0) {
- eval(ApndPath).clear();
- dsf_copyColInfo(eval(ApndPath), ds_WorkData_workinst_defaultggbn);
- eval(ApndPath).insertRow(pRow);
- eval(ApndPath).copyRow(pRow, ds_WorkData_workinst_defaultggbn, 0);
- pRow++;
- }
- eval(ApndPath).insertRow(pRow);
- eval(ApndPath).copyRow(pRow, eval(CopyPath), 0);
- pRow++;
- return pRow;
- }
-
- /****************************************************************************************
- * Argument : pCls
- * Description : 사용자별관리물품권한 자료 저장
- ****************************************************************************************/
- function fRscmggbnDataSubmit(pCls) {
- if(grp_disp.trv_data.tabindex == 1) { // case2 선택시 선택버튼 클릭
- fChoisData();
- }
- if (utlf_isNull(eval(DataPath).getColumn(0, "emplno")) || utlf_isNull(eval(DataPath).getColumn(0, "emplnm"))) {
- sysf_messageBox("해당 사원번호를 ", "C001");
- return;
- }
- // var pNode = instance1.selectSingleNode(ListPath);
- if (eval(ListPath).rowcount == 0) {
- sysf_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 상태
- + eval(HidePath).getColumn(0, "instcd" )+ "▦" // 2 기관번호
- + eval(DataPath).getColumn(0, "emplno" )+ "▦"; // 3 사원번호
- //입력
- if (pCls == "D") {
- vEmpData2 += vEmpData1
- + "" + "▦" // 4 물품구분
- + "" + "▦" // 5 대분류코드
- + "" + "▦" // 6 중분류코드
- + "" + "▦" // 7 소분류코드
- + "" + "▩"; // 8 비고
- } else {
- for(var i=0; i < grp_disp.trv_data.case1.trv_empdata.rowcount ; i++) {
- var sDepth = eval(ListPath).getColumn(i+1, "depth");
- switch(sDepth) {
- case "2" : vGoodflag = eval(ListPath).getColumn(i+1, "codecd"); // 4 물품구분
- vLrgcd = "%"; // 5 대분류코드
- vMdlcd = "%"; // 6 중분류코드
- vSmlcd = "%"; // 7 소분류코드
- break;
- case "3" : vLrgcd = eval(ListPath).getColumn(i+1, "codecd"); // 5 대분류코드
- vMdlcd = "%"; // 6 중분류코드
- vSmlcd = "%"; // 7 소분류코드
- break;
- case "4" : vMdlcd = eval(ListPath).getColumn(i+1, "codecd"); // 6 중분류코드
- vSmlcd = "%"; // 7 소분류코드
- break;
- case "5" : vSmlcd = eval(ListPath).getColumn(i+1, "codecd"); // 7 소분류코드
- }
- if (eval(ListPath).getColumn(i+1, "checkyn") == "A") {
- vEmpData2 += vEmpData1
- + vGoodflag + "▦" // 4 물품구분
- + vLrgcd + "▦" // 5 대분류코드
- + vMdlcd + "▦" // 6 중분류코드
- + vSmlcd + "▦" // 7 소분류코드
- + "" + "▩"; // 8 비고
- }
- }
- }
- RscmggbnsList += vEmpData2;
- dsf_setCSVToDs("ds_send_rscmggbnlist", RscmggbnsList);
- var oParam = {};
- oParam.id = "TXRSC01001";
- oParam.service = "purcbaseapp.GoodCdMngt";
- oParam.method = "reqExeSaveRscmggbn";
- oParam.inds = "req=ds_send_rscmggbnlist";
- oParam.async = false;
- oParam.callback = "cf_TXRSC01001";
- tranf_submit(oParam);
- if (arErrorCode.pop("TXRSC01001") > -1) { // 정보저장
- sysf_messageBox("자료 저장 ", "I002");
- }
- }
- function cf_TXRSC01001(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
- /****************************************************************************************
- * Argument : N/A
- * Description : 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
- ****************************************************************************************/
- function fInitialize() {
- misfComboComCdList("Z0007", group3.group1.cmb_instcd); //전체기관코드
- }
- // ----------------------------------------------------------------
- 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) == '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;
- }
- /* ------------------------------------------------- */
- /* ------End Of List ------------------------------- */
- /* -------------------------------------------------- */ ]]></Script>
|