123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765 |
- /*
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- 서식 수가 매핑 관리 ( SMMRF04800_서식수가매핑관리.xrw )
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- */
- var g_grdEditrow = "";
- var gf_grdEditrow = "";
- /**
- * @desc : 줄 추가
- * @id :
- * @event : xforms-select
- * @return : void
- * @authur :
- */
- function fAddGridRow_back(pGrid)
- {
- var sGridID = document.controls(pGrid);
- var ref = sGridID.attribute("nodeset");
-
- g_grdEditrow = sGridID.rows;
-
- if(g_grdEditrow >= "2") {
- sGridID.addRow();
- //sGridID.isselected(g_grdEditrow) = true;
-
- g_grdEditrow = sGridID.rows;
-
- sGridID.topRow = g_grdEditrow;
-
- // 업무용도 세팅
- //var bizflag = model.getValue("/root/send/reqdata/bizflag");
- //model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (g_grdEditrow-2) + "]/bizflag", bizflag);
- var fstrgstdt = getCurrentDate();
- model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (g_grdEditrow-2) + "]/fstrgstdt", fstrgstdt);
- model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (g_grdEditrow-2) + "]/status", "1");
-
- // 수가구분
- //model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (g_grdEditrow-2) + "]/calcscorflag", "O");
-
- model.refresh();
- }
- }
-
- /**
- * @desc : 줄 삭제
- * @id :
- * @event : xforms-select
- * @return : void
- * @authur :
- */
- //function fDelGridRow(pGrid)
- function fDelGridRow_back()
- {
- //var sGridID = document.controls(pGrid);
- //var ref = sGridID.attribute("nodeset");
- //var iRow = sGridID.row;
- //if(iRow < 1) return;
-
- //var iStatus = sGridID.rowStatus(iRow);
-
- //for (var i = 1; i < sGridID.selectedRows; i++){
- //if(iStatus == 1 || iStatus == 3){
- //sGridID.deleteRow(iRow);
- //}else{
- //sGridID.rowStatus(iRow) = 4;
- //}
- var arrRows = new Array();
- for(var i = 0; i < grd_ocrmechlist.selectedRows; i++)
- {
- arrRows[i] = grd_ocrmechlist.selectedRow(i);
- }
-
- for(var j = arrRows.length - 1; j >= 0; j--)
- {
- //grd_ocrmechlist.deleteRow(arrRows[j]);
- alert(arrRows[j]);
- grd_ocrmechlist.rowStatus(arrRows[j]) = 4;
- model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + j + "]/status", "4");
- alert(model.getValue("/root/main/ocrmechlist/ocrmechlistinfo[" + j + "]/status"));
- }
- //}
- g_grdEditrow = "";
- model.refresh();
- }
- function fAddRow(flag) {
- var iRow = 0;
- var currentTime = getCurrentTime();
- var fstrgstdt = getCurrentDate();
- if(flag == "I") {
- grd_ocrmechlist.addItem();
- iRow = grd_ocrmechlist.row - grd_ocrmechlist.fixedRows + 1;
- model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + iRow + "]/status", "1");
- model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + iRow + "]/fstrgstdt", fstrgstdt);
-
- } else if(flag == "D") {
- grd_ocrmechlist.addItem();
- iRow = grd_ocrmechlist.row - grd_ocrmechlist.fixedRows + 1;
- model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + iRow + "]/status", "I" );
- }
-
- //var colNum = grd_ocrmechlist.colRef("graph");
- grd_ocrmechlist.cellstyle("background-image", grd_ocrmechlist.row - grd_ocrmechlist.fixedRows + 2, 0) = "../../../com/commonweb/images/icon_i.gif"
- grd_ocrmechlist.cellstyle("background-position", grd_ocrmechlist.row - grd_ocrmechlist.fixedRows + 2, 0) = "center center"
-
- }
- function fDelRow(flag) {
- var iRow = grd_ocrmechlist.row - grd_ocrmechlist.fixedRows + 1;
- var currentTime = getCurrentTime();
- if(model.getValue("/root/main/ocrmechlist/ocrmechlistinfo[" + iRow + "]/calcscorcd") == ""){
- return;
- }
- if(flag == "I") {
- iRow = grd_ocrmechlist.row - grd_ocrmechlist.fixedRows + 1;
- model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + iRow + "]/status", "4");
- grd_ocrmechlist.cellstyle("background-image", iRow+1, 0) = "../../../com/commonweb/images/icon_d.gif"
- grd_ocrmechlist.cellstyle("background-position", iRow+1, 0) = "center center"
- }
- model.refresh();
- }
- // 동의서 코드찾기 Popup
- function fCodePopUp(pFlag)
- {
- //var gridObj = window.document.controls("grd_ocrmechlist");
- //var CurrentRow = gridObj.attribute("row");
- var CurrentRow = grd_ocrmechlist.row - grd_ocrmechlist.fixedRows + 1;
-
- //if( CurrentRow == (g_grdEditrow-1) )
- var chk = model.getValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (grd_ocrmechlist.row-1) + "]/status");
-
- //수정되기 전 데이터.
- var preFormcd = model.getValue("/root/main/ocrmechlist/ocrmechlistinfo[" + CurrentRow + "]/formcd");
-
- //수정되기 전 데이터를 저장하기 위한 Element생성
- var selNode = instance1.selectSingleNode("/root/main/ocrmechlist/ocrmechlistinfo[" + CurrentRow + "]");
- var preFormcdNode = instance1.createElement("preformcd");
-
- //수정되기전 데이터 맵핑.
- model.setValue(preFormcdNode, preFormcd);
-
- var preFormcdIndex = instance1.selectSingleNode("/root/main/ocrmechlist/ocrmechlistinfo[" + CurrentRow + "]/preformcd");
- // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
- var preCalcscorcd = model.getValue("/root/main/ocrmechlist/ocrmechlistinfo[" + CurrentRow + "]/calcscorcd");
- var preCalcscorcdNode = instance1.createElement("precalcscorcd");
- model.setValue(preCalcscorcdNode, preCalcscorcd);
- var preCalcscorcdIndex = instance1.selectSingleNode("/root/main/ocrmechlist/ocrmechlistinfo[" + CurrentRow + "]/precalcscorcd");
-
- //한번만 append 실행.
- if(preCalcscorcdIndex == null) {
- selNode.appendChild(preCalcscorcdNode);
- }
- // KNUH_20101020_박성호_end
-
- //한번만 append 실행.
- if(preFormcdIndex == null) {
- selNode.appendChild(preFormcdNode);
- }
- if(pFlag == "1" && chk == "1" || pFlag == "1" && chk == "")
- {
- //modal("../../../pam/calcscormngtweb/xrw/SMPIC00200", 1,10, 10, "SMPIC00200", "/root/send", "/root/main");
- model.removeNode("/root/temp/mech");
- modal("SMPIC00200", 1,10, 10, "SMPIC00200", "", "/root/temp/mech");
-
-
- var hngnm = model.getValue("/root/temp/mech/hngnm");
- var calcscorcd = model.getValue("root/temp/mech/calcscorcd");
- var fromdd = model.getValue("root/temp/mech/fromdd");
- var todd = model.getValue("root/temp/mech/todd");
-
- //Popup에서 선택하지 않고 닫았을 경우 기존 데이터 보존.
- if(calcscorcd == "") {
- return;
- }
- model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (grd_ocrmechlist.row-1) + "]/hngnm",hngnm);
- model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (grd_ocrmechlist.row-1) + "]/calcscorcd",calcscorcd);
- model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (grd_ocrmechlist.row-1) + "]/fromdd",fromdd);
- model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (grd_ocrmechlist.row-1) + "]/todd",todd);
-
- model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + CurrentRow + "]/status", "1");
- grd_ocrmechlist.cellstyle("background-image", CurrentRow+1, 0) = "../../../com/commonweb/images/icon_i.gif"
- grd_ocrmechlist.cellstyle("background-position", CurrentRow+1, 0) = "center center"
-
-
- }else if(pFlag == "2"){
- setParameter("srch_cond", "OCR:Y");
-
- //modal("SPMRF03600", 1,10, 10, "SPMRF03600", "", "/root/main/formlist");
- modal("SPMRF03600", 1,10, 10);
-
- var formnm = getParameter("formnm");
- var formcd = getParameter("formcd");
-
- //Popup에서 선택하지 않고 닫았을 경우 기존 데이터 보존.
- if(formcd == "") {
- return;
- }
-
- model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (grd_ocrmechlist.row-1) + "]/formnm",formnm);
- model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (grd_ocrmechlist.row-1) + "]/formcd",formcd);
-
- if(chk == "") { //INSERT
- model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + CurrentRow + "]/status", "1");
- grd_ocrmechlist.cellstyle("background-image", CurrentRow+1, 0) = "../../../com/commonweb/images/icon_i.gif"
- grd_ocrmechlist.cellstyle("background-position", CurrentRow+1, 0) = "center center"
- } else if(chk == "0" || chk == "2") { //UPDATE
- model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + CurrentRow + "]/status", "2");
-
- grd_ocrmechlist.cellstyle("background-image", CurrentRow+1, 0) = "../../../com/commonweb/images/icon_u.gif"
- grd_ocrmechlist.cellstyle("background-position", CurrentRow+1, 0) = "center center"
- }
- }
- model.refresh();
- }
- // 제증명 코드찾기 Popup
- function fPROFCodePopUp(pFlag)
- {
- var gridObj = window.document.controls("grd_mechlist");
- var CurrentRow = gridObj.attribute("row");
- var gridrowcnt = document.controls("grd_mechlist");
- gf_grdEditrow = gridrowcnt.rows;
-
- //마지막 Row의 서식이름 가져오기 (마지막 Row가 Insert인지 Update인지 확인하기 위한 것)
- var endCell = model.getValue("/root/main/mechlist/mechlistinfo[" + (gf_grdEditrow-1) + "]/formnm");
-
- //수정되기 전 데이터
- var preFormcd = model.getValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/formcd");
-
- //수정되기 전 데이터를 저장하기 위한 Element생성
- var selNode = instance1.selectSingleNode("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]");
- var preFormcdNode = instance1.createElement("preformcd");
-
- //수정되기전 데이터 맵핑.
- model.setValue(preFormcdNode, preFormcd);
-
- var preFormcdIndex = instance1.selectSingleNode("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/preformcd");
-
- // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
- var preCalcscorcd = model.getValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/calcscorcd");
- var preCalcscorcdNode = instance1.createElement("precalcscorcd");
- model.setValue(preCalcscorcdNode, preCalcscorcd);
- var preCalcscorcdIndex = instance1.selectSingleNode("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/precalcscorcd");
-
- //한번만 append 실행.
- if(preCalcscorcdIndex == null) {
- selNode.appendChild(preCalcscorcdNode);
- }
- // KNUH_20101020_박성호_end
-
- //한번만 append 실행.
- if(preFormcdIndex == null) {
- selNode.appendChild(preFormcdNode);
- }
-
- if( CurrentRow == (gf_grdEditrow-1) && endCell == "")
- {
- if(pFlag == "1")
- {
- //modal("../../../pam/calcscormngtweb/xrw/SMPIC00200", 1,10, 10, "SMPIC00200", "/root/send", "/root/main");
- model.removeNode("/root/temp/mech");
- modal("SMPIC00200", 1,10, 10, "SMPIC00200", "", "/root/temp/mech");
-
- var hngnm = model.getValue("/root/temp/mech/hngnm");
- var calcscorcd = model.getValue("root/temp/mech/calcscorcd");
-
- if(calcscorcd == "") {
- return;
- } else {
- model.setValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/hngnm",hngnm);
- model.setValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/calcscorcd",calcscorcd);
- }
- } else if(pFlag == "2"){
-
- setParameter("srch_cond", "OCR:Y");
-
- //modal("SPMRF03600", 1,10, 10, "SPMRF03600", "", "/root/main/formlist");
- modal("SPMRF03600", 1,10, 10);
-
- var formnm = getParameter("formnm");
- var formcd = getParameter("formcd");
- if(formcd == "") {
- return;
- } else {
- model.setValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/formnm",formnm);
- model.setValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/formcd",formcd);
- }
- }
- var iRow = grd_mechlist.row;
- grd_mechlist.rowStatus(iRow) = 1;
- } else {
- if(pFlag == "2"){
- setParameter("srch_cond", "OCR:Y");
-
- //modal("SPMRF03600", 1,10, 10, "SPMRF03600", "", "/root/main/formlist");
- modal("SPMRF03600", 1,10, 10);
-
- var formnm = getParameter("formnm");
- var formcd = getParameter("formcd");
- if(formcd == "") {
- return;
- } else {
- model.setValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/formnm",formnm);
- model.setValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/formcd",formcd);
-
- var iRow = grd_mechlist.row;
- grd_mechlist.rowStatus(iRow) = 2;
-
- }
- }
- // KNUH_20101019_박성호_start 수가 수정 가능하도록 수정
- else if (pFlag == "1")
- {
- //modal("../../../pam/calcscormngtweb/xrw/SMPIC00200", 1,10, 10, "SMPIC00200", "/root/send", "/root/main");
- model.removeNode("/root/temp/mech");
- modal("SMPIC00200", 1,10, 10, "SMPIC00200", "", "/root/temp/mech");
-
- var hngnm = model.getValue("/root/temp/mech/hngnm");
- var calcscorcd = model.getValue("root/temp/mech/calcscorcd");
-
- if(calcscorcd == "") {
- return;
- } else {
- model.setValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/hngnm",hngnm);
- model.setValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/calcscorcd",calcscorcd);
-
- var iRow = grd_mechlist.row;
- grd_mechlist.rowStatus(iRow) = 2;
- }
- }
- // KNUH_20101019_박성호_end
- model.refresh();
- }
- }
- function fSaveComn_back()
- {
- var ref = "/root/main/ocrmechlist/ocrmechlistinfo";
- var ref2 = "/root/send/savedata";
- var gridObj = grd_ocrmechlist;
- var savedata = "status▦calcscorcd▦formcd▦calcscorflag▦bizflag▦detcalcscorflag▩";
- var dataString = "";
-
- for ( var i = 1; i < gridObj.rows; i++){
- if (gridObj.rowStatus(i) != 0) {
- var instcd = model.getValue(ref + "[" + i + "]/instcd");
- var calcscorcd = model.getValue(ref + "[" + i + "]/calcscorcd");
- var formcd = model.getValue(ref + "[" + i + "]/formcd");
- var calcscorflag = model.getValue(ref + "[" + i + "]/calcscorflag");
- var bizflag = model.getValue(ref + "[" + i + "]/bizflag");
- var detcalcscorflag = model.getValue(ref + "[" + i + "]/detcalcscorflag");
-
- if ((calcscorcd != "") && (formcd != "")){
- if (gridObj.rowStatus(i) == 1 || gridObj.rowStatus(i) == 3) {
- model.makeValue(ref2 + "[" + i + "]/status", "i");
- model.makeValue(ref2 + "[" + i + "]/instcd", instcd);
- model.makeValue(ref2 + "[" + i + "]/calcscorcd", calcscorcd);
- model.makeValue(ref2 + "[" + i + "]/formcd", formcd);
- model.makeValue(ref2 + "[" + i + "]/calcscorflag", calcscorflag);
- model.makeValue(ref2 + "[" + i + "]/bizflag", bizflag);
- model.makeValue(ref2 + "[" + i + "]/detcalcscorflag", detcalcscorflag);
- }
- if (gridObj.rowStatus(i) == 4) {
- model.makeValue(ref2 + "[" + i + "]/status", "d");
- model.makeValue(ref2 + "[" + i + "]/instcd", instcd);
- model.makeValue(ref2 + "[" + i + "]/calcscorcd", calcscorcd);
- model.makeValue(ref2 + "[" + i + "]/formcd", formcd);
- model.makeValue(ref2 + "[" + i + "]/calcscorflag", calcscorflag);
- model.makeValue(ref2 + "[" + i + "]/bizflag", bizflag);
- model.makeValue(ref2 + "[" + i + "]/detcalcscorflag", detcalcscorflag);
- }
- }
- }
- }
- if(calcscorcd == ""){
- messageBox("수가코드를 ", "C001");
- return;
- }
- if(formcd == ""){
- messageBox("서식코드를 ", "C001");
- return;
- }
- if (calcscorcd.length > 0){
- model.removenode("/root/send/savedata");
- model.makeValue("/root/send/savedata", savedata + dataString);
- model.refresh();
- submit("TXMRF04801");
- }
- }
-
- function fSaveComn()
- {
- var ref = "/root/main/ocrmechlist/ocrmechlistinfo";
- var gridObj = grd_ocrmechlist;
- var savedata = "status▦calcscorcd▦formcd▦calcscorflag▦bizflag▦detcalcscorflag▩";
- var dataString = "";
-
- for ( var i = 1; i < gridObj.rows; i++){
- //if (gridObj.rowStatus(i) != 0) {
- if (gridObj.rowStatus(i) != 0) {
- var instcd = model.getValue(ref + "[" + (i-1) + "]/instcd");
- var calcscorcd = model.getValue(ref + "[" + (i-1) + "]/calcscorcd");
- var formcd = model.getValue(ref + "[" + (i-1) + "]/formcd");
- var calcscorflag = model.getValue(ref + "[" + (i-1) + "]/calcscorflag");
- var bizflag = model.getValue(ref + "[" + (i-1) + "]/bizflag");
- var detcalcscorflag = model.getValue(ref + "[" + (i-1) + "]/detcalcscorflag");
- if ((calcscorcd != "") && (formcd != "")){
- if (gridObj.rowStatus(i) == 1 || gridObj.rowStatus(i) == 3) {
- dataString = dataString + "i▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▩";
- }
- if (gridObj.rowStatus(i) == 4) {
- dataString = dataString + "d▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▩";
- }
- }
- }
- }
- if (calcscorcd.length > 0){
- model.removenode("/root/send/savedata");
- model.makeValue("/root/send/savedata", savedata + dataString);
- model.refresh();
- submit("TXMRF04801");
- }
- }
- function fOCRSave(){
- var ref = "/root/main/ocrmechlist/ocrmechlistinfo";
- var RowCnt = grd_ocrmechlist.rows;
- // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
- //var savedata = "status▦calcscorcd▦formcd▦calcscorflag▦bizflag▦detcalcscorflag▦preformcd▩";
- var savedata = "status▦calcscorcd▦formcd▦calcscorflag▦bizflag▦detcalcscorflag▦preformcd▦precalcscorcd▩";
- // KNUH_20101020_박성호_end
-
- var dataString = "";
-
- for ( i=1; i<=RowCnt; i++) {
-
- if(model.getValue("/root/main/ocrmechlist/ocrmechlistinfo[" + i + "]/status") == "1" ||
- model.getValue("/root/main/ocrmechlist/ocrmechlistinfo[" + i + "]/status") == "4" ||
- model.getValue("/root/main/ocrmechlist/ocrmechlistinfo[" + i + "]/status") == "2") {
-
- var flag = model.getValue(ref + "[" + i + "]/status");
- var instcd = model.getValue(ref + "[" + i + "]/instcd");
- var calcscorcd = model.getValue(ref + "[" + i + "]/calcscorcd");
- var formcd = model.getValue(ref + "[" + i + "]/formcd");
- var calcscorflag = model.getValue(ref + "[" + i + "]/calcscorflag");
- var bizflag = model.getValue(ref + "[" + i + "]/bizflag");
- var detcalcscorflag = model.getValue(ref + "[" + i + "]/detcalcscorflag");
- var precalcscorcd = model.getValue(ref + "[" + i + "]/precalcscorcd");
- var preformcd = model.getValue(ref + "[" + i + "]/preformcd");
-
- // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
- var precalcscorcd = model.getValue(ref + "[" + i + "]/precalcscorcd");
- // KNUH_20101020_박성호_end
- if ((calcscorcd != "") && (formcd != "")){
- //if (gridObj.rowStatus(i) == 1 || gridObj.rowStatus(i) == 3) {
- if (flag == 1 || flag == 3) {
- // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
- //dataString = dataString + "i▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▦" + preformcd + "▩";
- dataString = dataString + "i▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▦" + preformcd + "▦" + precalcscorcd + "▩";
- // KNUH_20101020_박성호_end
- }
- //if (gridObj.rowStatus(i) == 4) {
- if (flag == 4) {
- // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
- //dataString = dataString + "d▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▦" + preformcd + "▩";
- dataString = dataString + "d▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▦" + preformcd + "▦" + precalcscorcd + "▩";
- // KNUH_20101020_박성호_end
- }
- if (flag == 2) {
- // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
- //dataString = dataString + "u▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▦" + preformcd + "▩";
- dataString = dataString + "u▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▦" + preformcd + "▦" + precalcscorcd + "▩";
- // KNUH_20101020_박성호_end
- }
- }
- grd_ocrmechlist.cellstyle("background-image", i+1, 0) = "../../../com/commonweb/images/grid_bg.gif"
- }
- }
-
- model.removenode("/root/send/savedata");
- model.makeValue("/root/send/savedata", savedata + dataString);
- submit("TXMRF04801");
-
- // KNUH_20101101_박성호_start 오류 수정(저장후 그리드 행 추가 버튼시 에러)
- //for(var i = 1 ; i <= grd_ocrmechlist.rows ; i++) {
- // model.makeValue("/root/main/ocrmechlist/ocrmechlistinfo[" + i + "]/status", 0);
- //}
-
- for(var i = 3 ; i <= grd_ocrmechlist.rows ; i++) {
- model.makeValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (i-2) + "]/status", 0);
- }
- // KNUH_20101020_박성호_end
-
- }
- function fSavePrnt()
- {
- var ref = "/root/main/prntmechlist/prntmechlistinfo";
- var gridObj = grd_prntmechlist;
- var savedata = "status▦prntcnt▦formcd▦formfromdt▦formtodt▦deptcd▩";
- var dataString = "";
-
- for ( var i = 1; i < gridObj.rows; i++)
- {
- //if (gridObj.rowStatus(i) != 0) {
- if(model.getValue("/root/main/prntmechlist/prntmechlistinfo[" + i + "]/status") == "U"){
- var instcd = model.getValue(ref + "[" + i + "]/instcd");
- var formcd = model.getValue(ref + "[" + i + "]/formcd");
- var formfromdt = model.getValue(ref + "[" + i + "]/formfromdt");
- var formtodt = model.getValue(ref + "[" + i + "]/formtodt");
- var deptcd = model.getValue(ref + "[" + i + "]/deptcd");
- //if (gridObj.rowStatus(i) == 2){
- var prntcnt = model.getValue(ref + "[" + i + "]/prntcnt");
- dataString = dataString + "u▦" + prntcnt + "▦" + formcd + "▦" + formfromdt + "▦" + formtodt + "▦" + deptcd + "▩";
- //}
- }
- }
- if (formcd.length > 0){
- model.removenode("/root/send/savedata");
- model.makeValue("/root/send/savedata", savedata + dataString);
- model.refresh();
- submit("TXMRF04803");
- }
- submit("TRMRF04803");
- model.refresh();
- }
- // 진정동의서 팝업
- function fJinJeongPopUp(pFlag)
- {
- var CurrentRow = grd_jinjeonglist.row - grd_jinjeonglist.fixedRows + 1;
-
- var chk = model.getValue("/root/main/jinjeonglist/jinjeonglistinfo[" + (grd_jinjeonglist.row-1) + "]/status");
-
- //수정되기 전 데이터.
- var preFormcd = model.getValue("/root/main/jinjeonglist/jinjeonglistinfo[" + CurrentRow + "]/formcd");
-
- //수정되기 전 데이터를 저장하기 위한 Element생성
- var selNode = instance1.selectSingleNode("/root/main/jinjeonglist/jinjeonglistinfo[" + CurrentRow + "]");
- var preFormcdNode = instance1.createElement("preformcd");
-
- //수정되기전 데이터 맵핑.
- model.setValue(preFormcdNode, preFormcd);
-
- var preFormcdIndex = instance1.selectSingleNode("/root/main/jinjeonglist/jinjeonglistinfo[" + CurrentRow + "]/preformcd");
- var preCalcscorcd = model.getValue("/root/main/jinjeonglist/jinjeonglistinfo[" + CurrentRow + "]/calcscorcd");
- var preCalcscorcdNode = instance1.createElement("precalcscorcd");
- model.setValue(preCalcscorcdNode, preCalcscorcd);
- var preCalcscorcdIndex = instance1.selectSingleNode("/root/main/jinjeonglist/jinjeonglistinfo[" + CurrentRow + "]/precalcscorcd");
-
- //한번만 append 실행.
- if(preCalcscorcdIndex == null) {
- selNode.appendChild(preCalcscorcdNode);
- }
- // KNUH_20101020_박성호_end
-
- //한번만 append 실행.
- if(preFormcdIndex == null) {
- selNode.appendChild(preFormcdNode);
- }
- if(pFlag == "2"){
- setParameter("srch_cond", "JINJEONG:Y");
-
- modal("SPMRF03600", 1,10, 10);
-
- var formnm = getParameter("formnm");
- var formcd = getParameter("formcd");
-
- //Popup에서 선택하지 않고 닫았을 경우 기존 데이터 보존.
- if(formcd == "") {
- return;
- }
-
- model.setValue("/root/main/jinjeonglist/jinjeonglistinfo[" + (grd_jinjeonglist.row-1) + "]/formnm",formnm);
- model.setValue("/root/main/jinjeonglist/jinjeonglistinfo[" + (grd_jinjeonglist.row-1) + "]/formcd",formcd);
-
- if(chk == "") { //INSERT
- model.setValue("/root/main/jinjeonglist/jinjeonglistinfo[" + CurrentRow + "]/status", "1");
- grd_jinjeonglist.cellstyle("background-image", CurrentRow+1, 0) = "../../../com/commonweb/images/icon_i.gif"
- grd_jinjeonglist.cellstyle("background-position", CurrentRow+1, 0) = "center center"
- } else if(chk == "0" || chk == "2") { //UPDATE
- model.setValue("/root/main/jinjeonglist/jinjeonglistinfo[" + CurrentRow + "]/status", "2");
-
- grd_jinjeonglist.cellstyle("background-image", CurrentRow+1, 0) = "../../../com/commonweb/images/icon_u.gif"
- grd_jinjeonglist.cellstyle("background-position", CurrentRow+1, 0) = "center center"
- }
- }
- model.refresh();
- }
- //진정동의서 한줄 추가
- function fAddRow_JinJeong(flag) {
- var iRow = 0;
- if(flag == "I") {
- grd_jinjeonglist.addItem();
- iRow = grd_jinjeonglist.row - grd_jinjeonglist.fixedRows + 1;
- model.setValue("/root/main/jinjeonglist/jinjeonglistinfo[" + iRow + "]/status", "1");
-
- } else if(flag == "D") {
- grd_jinjeonglist.addItem();
- iRow = grd_jinjeonglist.row - grd_jinjeonglist.fixedRows + 1;
- model.setValue("/root/main/jinjeonglist/jinjeonglistinfo[" + iRow + "]/status", "I" );
- }
-
- //var colNum = grd_jinjeonglist.colRef("graph");
- grd_jinjeonglist.cellstyle("background-image", grd_jinjeonglist.row - grd_jinjeonglist.fixedRows + 2, 0) = "../../../com/commonweb/images/icon_i.gif"
- grd_jinjeonglist.cellstyle("background-position", grd_jinjeonglist.row - grd_jinjeonglist.fixedRows + 2, 0) = "center center"
-
- }
- //진정동의서 한줄 삭제
- function fDelRow_JinJeong(flag) {
- var iRow = grd_jinjeonglist.row - grd_jinjeonglist.fixedRows + 1;
- if(model.getValue("/root/main/jinjeonglist/jinjeonglistinfo[" + iRow + "]/formcd") == ""){
- return;
- }
- if(flag == "I") {
- iRow = grd_jinjeonglist.row - grd_jinjeonglist.fixedRows + 1;
- model.setValue("/root/main/jinjeonglist/jinjeonglistinfo[" + iRow + "]/status", "4");
- grd_jinjeonglist.cellstyle("background-image", iRow+1, 0) = "../../../com/commonweb/images/icon_d.gif"
- grd_jinjeonglist.cellstyle("background-position", iRow+1, 0) = "center center"
- }
- model.refresh();
- }
- //진정동의서 저장
- function fJinJeongSave(){
- var ref = "/root/main/jinjeonglist/jinjeonglistinfo";
- var RowCnt = grd_jinjeonglist.rows;
- var savedata = "status▦formcd▦preformcd▩";
-
- var dataString = "";
-
- for ( i=1; i<=RowCnt; i++) {
-
- if(model.getValue("/root/main/jinjeonglist/jinjeonglistinfo[" + i + "]/status") == "1" ||
- model.getValue("/root/main/jinjeonglist/jinjeonglistinfo[" + i + "]/status") == "4" ||
- model.getValue("/root/main/jinjeonglist/jinjeonglistinfo[" + i + "]/status") == "2") {
-
- var flag = model.getValue(ref + "[" + (i) + "]/status");
- var instcd = model.getValue(ref + "[" + (i) + "]/instcd");
- var formcd = model.getValue(ref + "[" + (i) + "]/formcd");
- var preformcd = model.getValue(ref + "[" + (i) + "]/preformcd");
- if (formcd != ""){
- if (flag == 1 || flag == 3) { //인서트
- dataString = dataString + "i▦" + formcd + "▩";
- }
- if (flag == 4) { //삭제
- dataString = dataString + "d▦" + formcd + "▩";
- }
- if (flag == 2) { //갱신
- dataString = dataString + "u▦" + formcd + "▦" + preformcd + "▩";
- }
- }
- grd_jinjeonglist.cellstyle("background-image", i+1, 0) = "../../../com/commonweb/images/grid_bg.gif"
- }
- }
-
- model.removenode("/root/send/savedata");
- model.makeValue("/root/send/savedata", savedata + dataString);
- model.refresh();
- submit("TXMRF04804");
-
- for(var i = 3 ; i <= grd_jinjeonglist.rows ; i++) {
- model.makeValue("/root/main/jinjeonglist/jinjeonglistinfo[" + (i-2) + "]/status", 0);
- }
- }
- function fSavePROF()
- {
- var ref = "/root/main/mechlist/mechlistinfo";
- var gridObj = grd_mechlist;
- // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
- //var savedata = "status▦calcscorcd▦formcd▦calcscorflag▦bizflag▦detcalcscorflag▦preformcd▩";
- var savedata = "status▦calcscorcd▦formcd▦calcscorflag▦bizflag▦detcalcscorflag▦preformcd▦precalcscorcd▩";
- // KNUH_20101020_박성호_end
-
- var dataString = "";
-
- for ( var i = 1; i < gridObj.rows; i++){
- if (gridObj.rowStatus(i) != 0) {
- var instcd = model.getValue(ref + "[" + i + "]/instcd");
- var calcscorcd = model.getValue(ref + "[" + i + "]/calcscorcd");
- var formcd = model.getValue(ref + "[" + i + "]/formcd");
- var calcscorflag = model.getValue(ref + "[" + i + "]/calcscorflag");
- var bizflag = model.getValue(ref + "[" + i + "]/bizflag");
- var detcalcscorflag = model.getValue(ref + "[" + i + "]/detcalcscorflag");
- var preformcd = model.getValue(ref + "[" + i + "]/preformcd");
- // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
- var precalcscorcd = model.getValue(ref + "[" + i + "]/precalcscorcd");
- // KNUH_20101020_박성호_end
-
- if ((calcscorcd != "") && (formcd != "")){
- if (gridObj.rowStatus(i) == 1 || gridObj.rowStatus(i) == 3) {
- dataString = dataString + "i▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▩";
- }
- if (gridObj.rowStatus(i) == 4) {
- dataString = dataString + "d▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▩";
- }
- if(gridObj.rowStatus(i) == 2) {
- // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
- //dataString = dataString + "u▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▦" + preformcd + "▩";
- dataString = dataString + "u▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▦" + preformcd + "▦" + precalcscorcd + "▩";
- // KNUH_20101020_박성호_end
- }
- }
- }
- }
- if (calcscorcd.length > 0){
- model.removenode("/root/send/savedata");
- model.makeValue("/root/send/savedata", savedata + dataString);
- model.refresh();
- submit("TXMRF04802");
- }
- }
- // 제증명 수가를 엑셀로 저장
- function excel_save(){
- var fileName = window.fileDialog("save", "|", true, "", "", "Excel Files(*.xls)|*.xls");
-
- if (fileName != ""){
- grd_mechlist.saveExcel(fileName, "SheetName", false, false, "", "", false);
- }
- }
|