123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969 |
- /**
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- 진료 - 누적관리( SMMRF00900_누적관리.xrw - JScript )
-
- * Version :
- - Ver.1.00.01
-
- * 개발자: 이경희
-
- * 최초작성일:
- - 2007/03/28
-
- * 수정이력:
- - 2008/03/19 (생성일자 오류 수정)
- - 2009-04-09 오전 8:48:23 강지훈 : TRMRF00901을 중앙의료원용 TRMRF00903으로 변경 TRMRF00901은 다른화면에서 사용중.
- - 2009-04-09 오전 8:48:23 강지훈 : TRMRF00902을 중앙의료원용 TRMRF00904으로 변경 TRMRF00902는 다른화면에서 사용중.
- * 기타:
-
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- */
- var FORMMNGT_SCR_SAVE_DATA = 0; //화면에 누적리스트 저장할 데이터 (0:없음, 1:있음)
- /**
- * @desc : 화면 초기화
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitialize(){
- model.setValue("/root/main/newgrup/grupfromdt", getCurrentDate());
- model.setValue("/root/main/newgrup/gruptodt","99991231");
- model.copyNode("/root/temp/newgrup", "/root/main/newgrup");
- model.setFocus("ipt_valreqdata");
- model.toggle("gruplist");
- model.refresh();
- }
- /**
- * @desc : ?????? ???? ?? error check
- * @param :
- * @return : 0 : error 1 : no error
- * @---------------------------------------------------
- */
- function fChkError(){
- var errcd = model.getValue("/root/temp/errmsg/errcd");
- if(errcd == "err01"){ // insert error
- var itemnm = model.getValue("/root/main/newgrup/grupnm");
- var useYN = messageBox(itemnm + "과 같은 이름이 있습니다. 입력", "S001");
- }else if(errcd == "err02"){
- var termnm = model.getValue("/root/main/newterm/termnm");
- var useYN = messageBox(termnm + "과 같은 이름이 있습니다. 입력", "S001");
- }
- if(useYN == 6){
- return 1;
- }else{
- return 0;
- }
- }
-
- function fSetCtrlDisabled2(bool){
- ipt_listnm.disabled = bool;
- ipt_fromdd.disabled = bool;
- ipt_todd.disabled = bool;
- //ipt_listdesc.disabled = bool;
- ipt_updtresncnts.disabled = bool;
- ipt_rem.disabled = bool;
- cmb_grupflag.disabled = bool;
- }
-
- /*
- ????
- */
- function removeBlank(str){
- str = str.replace(/\s/g,'');
- return str;
- }
- /**
- * @desc : 누적리스트 조회
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fReqValue(condPath)
- {
- var mode = model.getValue("/root/main/condition/reqgrupflag");
-
- if(mode == "code")
- {
- model.setValue("/root/main/condition/grupcd", model.getValue("/root/main/condition/grupnm"));
- }
-
- fSetCtrlDisabled2(true)
- model.setValue("/root/main/condition/grupflag", "G");
-
- model.copyNode("/root/send/reqdata", condPath );
- submit("TRMRF00903");
- }
- /**
- * @desc :누적리스트 추가
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInsertGrup(){
- model.copyNode("/root/main/newgrup", "/root/temp/newgrup");
- model.refresh();
- // 컨트롤을 Enable 한다.
- fDisabledCtrlForNewGrup(false);
- // fucus이동
- model.setFocus("ipt_listnm");
- model.makeValue("/root/main/newgrup/status","i");
- }
- /**
- * @desc :누적리스트 추가
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fUpdateGrup(){
- iRow = grd_gruplist.row - grd_gruplist.fixedRows + 1;
- if(iRow < 1){
- messageBox("수정할 행을 ","C002");
- return;
- }
- //fValiCheck();
- // 컨트롤을 Enable 한다.
- fDisabledCtrlForNewGrup(false);
- cmb_valiyn.disabled = false;
- // fucus이동
- model.setFocus("ipt_listnm");
- model.makeValue("/root/main/newgrup/status","u");
- //fCompareNodes 비교위해 copynode
- model.makeNode("/root/main/newgrup2");
- model.copyNode("/root/main/newgrup2","/root/main/newgrup");
- }
- /**
- * @desc : 버튼 disable
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fDisabledCtrlForNewGrup(bDisable)
- {
- ipt_listnm.disabled = bDisable;
- ipt_fromdd.disabled = bDisable;
- ipt_todd.disabled = bDisable;
- cmb_grupflag.disabled = bDisable;
- //ipt_listdesc.disabled = bDisable;
- //cmb_valiyn.disabled = bDisable;
- ipt_updtresncnts.disabled = bDisable;
- ipt_rem.disabled = bDisable;
- }
- /**
- * @group :
- * @ver : 2007.06.13
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 두개의 노드셋을 비교한다.
- * @param : originalNode :
- * @param : copyNode :
- * @return : true, false
- * @---------------------------------------------------
- */
- function fCompareNodes1(originalNode, copyNode){
- var ins = document.models( 0 ).instances( 0 );
- var original = ins.selectSingleNode(originalNode).xml;
- var copy = ins.selectSingleNode(copyNode).xml;
- var replace = original.setReplaceWord("newgrup2","newgrup");
-
- if(replace == null || copy == null){
-
- return false;
- }else if (replace == copy){
-
- return true;
- }else{
-
- return false;
- }
- }
- /**
- * @desc : 누적리스트 저장
- * @
- * @param : grdObj 그리드 ID
- * @return :
- * @---------------------------------------------------
- */
- function fSaveGrup()
- {
- var status = model.getValue("/root/main/newgrup/status");
-
- //alert(status); // i: 신규저장, u: 수정
-
- if(status=="" || status==null ) {
- return;
- }
- var grupnm = model.getValue("/root/main/newgrup/grupnm");
-
- if(grupnm=="" || grupnm==null ) {
- messageBox("리스트명을 ","C001");
- return;
- }
-
- //수정 여부 check
- if(status == "u"){
- var compare = fCompareNodes1("/root/main/newgrup2","/root/main/newgrup");
- if(status=="u" && compare == true){
- messageBox("수정된 내용이","I004");
- return;
- }
- }
- // grd_gridlist조회 위한 grupcd
- var curRow = grd_gruplist.row - grd_gruplist.fixedRows + 1;
- model.makeValue("/root/send/reqdata/grupcd", model.getValue("/root/main/gruplist[" + curRow + "]/grupcd"));
- model.makeValue("/root/send/reqdata/grupflag", model.getValue("/root/main/gruplist[" + curRow + "]/grupflag"));
-
- // alert("groupcode:" + model.getValue("/root/send/reqdata/grupcd")); // 0001349001
- // alert("groupflag:" + model.getValue("/root/send/reqdata/grupflag")); // Y
-
- model.copyNode("/root/send/grupdata/grupmaster","/root/main/newgrup");
-
- if(status == "u"){
- //2009.01.21 강지훈 수정
- //변경이력을 남기지 않고 Update.
- var ret = messageBox("변경 이력을 저장", "S001");
- if(ret == "6"){
- model.makeValue("/root/send/grupdata/histsaveyn", "Y");
- }
- else if(ret == "7"){
- model.makeValue("/root/send/grupdata/histsaveyn", "N");
- }
- else{
- return;
- }
- }
- //fUpdateTodt();
- for (var i= grd_gridsublist.fixedRows; i < grd_gridsublist.rows ;i++ )
- {
- var aa = grd_gridsublist.rowstatus(i) = 1;
- }
- var saveData = grd_gridsublist.getUpdateData();
- model.setValue("/root/send/grupdata/savedata", saveData);
-
- if(submit("TXMRF00901"))
- {
- if(fChkError() == 1)
- {
- //저장 중 error유무 확인
- model.makeValue("/root/main/newgrup/procflag", "Y"); //process처리구분을 무시로 설정, 저장된다.
- model.refresh();
- model.setValue("/root/temp/errmsg/errcd","");
- model.copyNode("/root/send/grupdata/grupmaster","/root/main/newgrup");
-
- //fUpdateTodt();
- for (var i= grd_gridsublist.fixedRows; i < grd_gridsublist.rows ;i++ )
- {
- var aa = grd_gridsublist.rowstatus(i) = 1;
- }
- model.setValue("/root/send/grupdata/savedata", grd_gridsublist.getUpdateData());
- submit("TXMRF00901");
- }
- }
- // 저장후 gruplist 조회
- model.setValue("/root/main/condition/grupflag", model.getValue("/root/main/gruplist["+curRow+"]/grupflag"));
- model.copyNode("/root/send/reqdata","/root/main/condition" );
- model.makeValue("/root/send/reqdata/grupnm",model.getValue("/root/main/newgrup/grupnm"));
- model.makeValue("/root/send/reqdata/reqgrupflag", "grid");
- submit("TRMRF00903");
- grd_gruplist.row = 1;
- model.removeNodeset("/root/main/gridsublist");
- // 저장후 gridlist 조회
- if(status=="u" ){ // 수정만 조회
- model.makeValue("/root/send/reqdata/grupcd",model.getValue("/root/main/gruplist[" + grd_gruplist.row + "]/grupcd"));
-
- if(submit("TRMRF00904")== false){
-
- model.removeNodeset("/root/main/gridsublist");
- }
-
- }
- model.makeValue("/root/main/newgrup/status","");
- //아이템유효여부 초기화 Y
- cmb_valiyn.disabled = true;
- model.setValue("/root/temp/valiyn","Y");
- fDisabledCtrlForNewGrup(true);
-
- model.refresh();
- }
- /**
- * @desc : 누적서브리스트 조회
- * @
- * @param : grdObj 그리드 ID, condPath 조회조건 xpath
- * @return :
- * @---------------------------------------------------
- */
- function fReqGridSub(grdObj, condPath){
- var curRow = grdObj.row - grdObj.fixedRows + 1;
- model.makeValue("/root/main/condition/grupcd", model.getValue("/root/main/gruplist[" + curRow + "]/grupcd"));
- model.makeValue("/root/main/condition/grupflag", model.getValue("/root/main/gruplist[" + curRow + "]/grupflag"));
- model.refresh();
-
- model.copyNode("/root/send/reqdata", condPath);
- submit("TRMRF00904");
-
-
- }
- /**
- * @desc : 누적서브리스트 조회시 초기화
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fReqClear(){
- //gridsublist초기화
- model.resetInstanceNode("/root/main/gridsublist");
- grd_gridsublist.refresh();
- model.toggle("gruplist");
-
- }
- /**
- * @desc : 누적서브리스트 조회, newgrup에 복사
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fReqCopyGruplist(){
- model.toggle("gruplist");
- iRow = grd_gruplist.row;
- if(iRow < 1){
- return;
- }
- model.copyNode("/root/main/newgrup", "/root/main/gruplist[" + iRow + "]");
- model.refresh();
- fSetCtrlDisabled2(true)
- fReqGridSub(grd_gruplist, "/root/main/condition");
- }
- /**
- * @desc : 누적서브리스트 추가
- * @
- * @param : grdObj 그리드ID
- * @return :
- * @---------------------------------------------------
- */
- function fAddValueSub(grdObj){
- model.toggle("itemlist");
- model.refresh();
-
- var curRow = grdObj.row - grdObj.fixedRows + 1;
- var grupcd = model.getValue("/root/temp/gridsublist/grupcd");
- // model.setValue("/root/main/gridsublist[" + curRow + "]/grupcd", grupcd);
- model.setValue("/root/temp/gridsublist/rowpos", curRow);
- model.refresh();
-
- }
- /**
- * @desc : 밸류서브리스트 삭제
- * @
- * @param : grdObj 그리드ID
- * @return :
- * @---------------------------------------------------
- */
- function fDelValueSub(grdObj){
- var curRow = grdObj.row - grdObj.fixedRows + 1;
-
- if(curRow < 1){
- alert("삭제할 아이템을 선택하세요");
- return;
- }
- var statusFlag = grdObj.rowStatus(curRow);
- grdObj.deleteItem(curRow);
- model.setValue("/root/temp/gridsublist/itemremove","Y");
- model.refresh();
- }
- /**
- * @desc : 누적서브리스트 등록
- * @
- * @param : grdObj 그리드ID
- * @return :
- * @---------------------------------------------------
- */
- function fRgstGridSub(grdObj, grdObj2){
-
- var curRow = grd_itemlist.row - grd_itemlist.fixedRows + 1;
- var itemnm = model.getValue("/root/main/itemlist[" + curRow + "]/itemnm");
- var termcd = model.getValue("/root/main/itemlist[" + curRow + "]/termcd");
- var reprtermnm = model.getValue("/root/main/itemlist[" + curRow + "]/reprtermnm");
- termcd = termcd.substring(0,7);
- var axflag = model.getValue("/root/temp/gridsublist/axflag");
- var grupcd = model.getValue(grd_gruplist.attribute("nodeset") + "[" + grd_gruplist.row + "]/grupcd");
- // datagrid1.findRow( data명, 시작row, column위치, 대소문자 구분유무, 전체/부분일치 유무 )
- var rowpos = grd_gridsublist.findRow(termcd, 1, grd_gridsublist.colref("termbasecd"));
-
- if(rowpos > 0){
- alert( itemnm +"은 이미 존재하는 누적서브 아이템입니다.");
- return;
- }
- grd_gridsublist.addItem();
- var desCurRow = grd_gridsublist.rows - grdObj2.fixedRows;
- model.setValue("/root/main/gridsublist[" + desCurRow + "]/sortno", desCurRow);
- model.setValue("/root/main/gridsublist[" + desCurRow + "]/itemnm", itemnm);
- model.setValue("/root/main/gridsublist[" + desCurRow + "]/inptkind", '2');
- model.setValue("/root/main/gridsublist[" + desCurRow + "]/termbasecd", termcd);
- model.setValue("/root/main/gridsublist[" + desCurRow + "]/grupcd", grupcd);
- model.setValue("/root/main/gridsublist[" + desCurRow + "]/axflag", axflag);
- model.setValue("/root/main/gridsublist[" + desCurRow + "]/reprtermnm", reprtermnm);
- grd_gridsublist.refresh();
-
-
- }
- function fRgstGridSubDelay(){
- iRow = grd_itemlist.row;
- if(iRow < 1){
- return;
- }
- model.toggle("itemlist");
- model.copyNode("/root/main/newitem", "/root/main/itemlist[" + iRow + "]");
- model.refresh();
-
- var itemcd = model.getValue("/root/main/newitem/itemcd");
- model.makeNode("/root/send/reqdata/reqdata");
- model.makeNode("/root/send/reqdata/reqflag");
- model.makeValue("/root/send/reqdata/reqdata", itemcd);
- model.makeValue("/root/send/reqdata/reqflag", "itemcd");
- model.makeValue("/root/send/reqdata/reqstatusterm", "Y");
- model.refresh();
-
- submit("TRMRF00202");
- }
- /**
- * @desc : 누적서브리스트 유사어/약어 등록
- * @
- * @param : grdObj 그리드ID
- * @return :
- * @---------------------------------------------------
- */
- function fRgstItemSub(){
-
- var curRow = grd_termlist.row - grd_termlist.fixedRows + 1;
- //유사어 약어 dbclick시 등록
- var itemnm = model.getValue("/root/main/termlist[" + curRow + "]/termnm");
- //var itemcd = model.getValue("/root/main/termlist[" + curRow + "]/itemcd");
- var termcd = model.getValue("/root/main/termlist[" + curRow + "]/termcd");
- termcd = termcd.substring(0,7);
- var axflag = model.getValue("/root/temp/gridsublist/axflag");
- var grupcd = model.getValue(grd_gruplist.attribute("nodeset") + "[" + grd_gruplist.row + "]/grupcd");
- //datagrid1.findRow( data명, 시작row, column위치, 대소문자 구분유무, 전체/부분일치 유무 )
- var rowpos = grd_gridsublist.findRow(termcd, 1, grd_gridsublist.colref("termbasecd"));
- if(rowpos > 0){
- alert( itemnm +"과 같은 누적서브 아이템이 존재합니다.");
- return;
- }
- grd_gridsublist.addItem();
- var desCurRow = grd_gridsublist.rows - grd_gridsublist.fixedRows;
- model.setValue("/root/main/gridsublist[" + desCurRow + "]/sortno", desCurRow);
- model.setValue("/root/main/gridsublist[" + desCurRow + "]/itemnm", itemnm);
- model.setValue("/root/main/gridsublist[" + desCurRow + "]/termbasecd", termcd);
- model.setValue("/root/main/gridsublist[" + desCurRow + "]/grupcd", grupcd);
- model.setValue("/root/main/gridsublist[" + desCurRow + "]/axflag", axflag);
- model.setValue("/root/main/gridsublist[" + desCurRow + "]/inptkind", "2");
- grd_gridsublist.refresh();
-
-
- }
- /**
- * @desc : 누적서브리스트 아이템리스트 등록
- * @
- * @param : grdObj 그리드ID
- * @return :
- * @---------------------------------------------------
- */
- function fRgstItemList(){
- var iRow = grd_itemlist.rows;
- //alert(iRow);
- if(iRow < 1){
- return;
- }
- model.toggle("itemlist");
- model.copyNode("/root/main/newitem", "/root/main/itemlist[" + iRow + "]");
- model.refresh();
- //var itemcd = model.getValue("/root/main/newitem/itemcd");
- model.makeNode("/root/send/reqdata/reqdata");
- model.makeNode("/root/send/reqdata/reqflag");
- model.setValue("/root/send/reqdata/reqdata", itemcd);
- model.setValue("/root/send/reqdata/reqflag", "itemcd");
- model.refresh();
-
- submit("TRMRF00202");
- }
- /**
- * @desc : 누적서브리스트 등록(누적 그룹 아이템 추가 후 저장)
- * @
- * @param : grdObj 그리드ID
- * @return :
- * @---------------------------------------------------
- */
- function fSaveValueSub()
- {
- var bModified = false;
- //아이템 삭제 여부 확인
- var itemflag =model.getValue("/root/temp/gridsublist/itemremove");
-
- for(var i = 1; i <grd_gridsublist.rows; i++)
- {
- rowStatus = grd_gridsublist.rowStatus(i);
- if(rowStatus != "0" || itemflag=="Y") {
- bModified = true;
- break;
- }
- }
- //현재 row 유무 확인
- if(grd_gridsublist.rows == grd_gridsublist.fixedRows && itemflag=="Y") {
- bModified = true;
- }
- if(!bModified)
- return;
- model.copyNode("/root/send/grupdata/grupmaster", grd_gruplist.attribute("nodeset") + "[" + grd_gruplist.row + "]" );
-
- //2009.02.03 강지훈 수정
- //변경이력을 남기지 않고 Update.
- var ret = messageBox("변경 이력을 저장", "S001");
- if(ret == "6"){
- model.makeValue("/root/send/grupdata/grupmaster/histsaveyn", "Y");
-
- }
- else if(ret == "7"){
- model.makeValue("/root/send/grupdata/grupmaster/histsaveyn", "N");
- }
- else{
- return;
- }
-
- // 저장후 grupcd로 조회(TRMRF00903)
- var grupcd = model.getValue(grd_gruplist.attribute("nodeset") + "[" + grd_gruplist.row + "]/grupcd");
- grupcd++;
- //삭제된 row의 rowstatus값 clear시킨다
- grd_gridsublist.clearstatus();
- //var gtype = model.getValue("/root/temp/gridsublist/gridtype");
- var curRow = grd_gruplist.row - grd_gruplist.fixedRows + 1;
- var grupGridType = model.getValue(grd_gruplist.attribute("nodeset") + "[" + curRow + "]/grupflag");
- if(grupGridType == 'X' || grupGridType =='Y'){
- //조건 같은값 비교
- var nodeList = instance1.selectNodes("root/main/gridsublist[axflag='" + grupGridType + "']");
- //현재 row 유무 확인
- if(grd_gridsublist.rows == grd_gridsublist.fixedRows ) {
- var irow = "0";
- }
- else {
- var subAxFlag = model.getValue("root/main/gridsublist/axflag");
-
- if(grupGridType != subAxFlag)
- {
- alert("첫번째 축구분값에는 GRID항목과 같은값이 있어야합니다.");
- return;
- }
- if(nodeList.length != 1)
- {
- alert("누적 그룹의 축구분과 같은 값은 하나만 존재해야합니다.");
- return;
- }
- } // X,Y비교 종료
- if(grupGridType =='G'){
- for (var i= grd_gridsublist.fixedRows; i < grd_gridsublist.rows ;i++ )
- {
-
- var subAXFlag = model.getValue("root/main/gridsublist["+ i +"]/axflag");
- if(subAXFlag !='X')
- {
- alert("X축만 사용가능합니다.");
- return;
- }
- }// G 비교 종료
- }
- for (var i= grd_gridsublist.fixedRows; i < grd_gridsublist.rows ;i++ )
- {
- grd_gridsublist.rowstatus(i) = 1;
-
- }
- } //end if
- //그리드,표 일경우
- for (var i= grd_gridsublist.fixedRows; i < grd_gridsublist.rows ;i++ )
- {
- grd_gridsublist.rowstatus(i) = 1;
-
- }
- model.setValue("/root/send/grupdata/savedata", grd_gridsublist.getUpdateData());
-
-
- //alert( grd_gridsublist.getUpdateData() );
- var row = grd_gruplist.row;
- if(submit("TXMRF00902")!=true) {
- grd_gridsublist.clearstatus();
- }
- //alert(model.getValue("/root/main/gruplist[" + row + "]/grupnm"));
- model.setValue("/root/main/condition/grupflag", model.getValue("/root/main/gruplist["+ row +"]/grupflag"));
- model.copyNode("/root/send/reqdata", "/root/main/condition");
- model.makeValue("/root/send/reqdata/grupnm",model.getValue("/root/main/gruplist[" + row + "]/grupnm"));
- model.makeValue("/root/send/reqdata/grupcd",grupcd);
-
- submit("TRMRF00903");
- grd_gruplist.row = 1;
- model.setValue("/root/temp/gridsublist/itemremove","N");
- }
- /**
- * @desc : 누적서브리스트의 순서 변경 up / down
- * @
- * @param : grdObj 그리드ID, direcflag 방향구분(up/down)
- * @return :
- * @---------------------------------------------------
- */
- function fChgValueSubSeq(grdObj, direcflag){
- var srcRow = grdObj.row - grdObj.fixedRows + 1;
- var row = grd_gridsublist.row;
- //alert("row->"+row);
- if(direcflag == "up"){ //위로
- if(srcRow == 1){ //현재 위치가 맨 위일 경우
- return;
- }
- var desRow = srcRow - 1;
-
- grd_gridsublist.row = row-1;
-
- }else if(direcflag == "down"){ //아래로
- if(srcRow == grdObj.rows - grdObj.fixedRows){ //현재 위치가 맨 아래일 경우
- return;
- }
- var desRow = srcRow + 1;
-
- grd_gridsublist.row = row+1;
- }
- // alert("row1111->"+grd_gridsublist.row);
- //순서 변경시 값 뿐만 아니라, 그리드 상태값까지 이동한다.
- var srcflag = grdObj.rowStatus(srcRow);
- var desflag = grdObj.rowStatus(desRow);
-
- model.copyNode("/root/temp/tmp", "/root/main/gridsublist[" + srcRow + "]");
- model.copyNode("/root/main/gridsublist[" + srcRow + "]", "/root/main/gridsublist[" + desRow + "]");
- model.copyNode("/root/main/gridsublist[" + desRow + "]", "/root/temp/tmp");
-
- model.setValue("/root/temp/gridsublist/statusflag", desflag);
- grdObj.rowStatus(desRow) = srcflag;
- grdObj.rowStatus(srcRow) = model.getValue("/root/temp/gridsublist/statusflag");
-
- for(var i = 1; i < grdObj.rows; i++){ //다양한 case가 발생하기 때문에 전체를 update하여 순서를 재정렬.
- model.setValue("/root/main/gridsublist[" + i + "]/sortno", i);
- if(grdObj.rowStatus(i) != 1){ //신규를 제외하고 모두 update
- grdObj.rowstatus(i) = 2;
- }
- }
- model.refresh();
- }
- /**
- * @desc :
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetCtrlDisabled3(bool){
- input4.disabled = bool;
- input9.disabled = bool;
- input12.disabled = bool;
- gridtype.disabled = bool;
- input5.disabled = bool;
- input8.disabled = bool;
- input7.disabled = bool;
- combo3.disabled = bool;
- }
- function fSetCtrlDisabled(bool){
- input4.disabled = bool;
- input9.disabled = bool;
- input12.disabled = bool;
- gridtype.disabled = bool;
- input5.disabled = bool;
- input8.disabled = bool;
- input7.disabled = bool;
- btn_rgst.disabled = bool;
- btn_cncl.disabled = bool;
- combo3.disabled = bool;
- btn_saveval.disabled = bool;
- btn_savevalsub.disabled = bool;
-
- }
- /**
- * @desc :
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetBtnDisabled(statusflag){
-
- if(statusflag == 0){ //누적리스트 조회후
- // btn_updtval.disabled = false;
-
- }else if(statusflag == 1){ //누적리스트추가, 수정 후
- btn_updtval.disabled = true;
- btn_rgst.disabled = false;
- btn_cncl.disabled = false;
- btn_savevalsub.disabled = true;
- btn_saveval.disabled = false;
- }else if(statusflag == 2){ //누적리스트 등록
- btn_rgst.disabled = true;
- btn_cncl.disabled = true;
- FORMMNGT_SCR_SAVE_DATA = 1;//화면에 저장할 데이터 있음.
-
- }else if(statusflag == 3){ //누적리스트 취소
- btn_rgst.disabled = true;
- btn_cncl.disabled = true;
- if(FORMMNGT_SCR_SAVE_DATA == 0){ //화면에 저장할 데이터가 없으면
- btn_saveval.disabled = true;
- }else{
- btn_saveval.disabled = false;
- }
-
- }else if(statusflag == 4){ //UP, DOWN클릭 후, 아이템그리드 클릭 후
- btn_savevalsub.disabled = false;
- }else if(statusflag == 5){
- }
-
- }
- /**
- * @desc : 무효 아이템 수정시 valicheck변경
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fValiCheck(){
- // 무효 아이템 수정시 valicheck변경
- var todt = model.getValue("/root/main/newgrup/gruptodt");
-
- if(getCurrentDate()+getCurrentTime > todt){
- model.setValue("/root/main/valicheck","Y");
-
- }
- }
- /**
- * @desc : 무효화된 단위 수정시 gruptodt 새로 넣어준다.
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fUpdateTodt(){
- //무효화된 grupcd 수정시 gruptodt 새로 넣어준다.
- var valicheck = model.getValue("/root/main/valicheck");
- if(valicheck=="Y"){
- model.setValue("/root/send/grupdata/grupmaster/gruptodt","29991231000000");
- model.setValue("/root/main/valicheck","N");
- model.refresh();
- }
- }
- /**
- * @desc : gruplist 를 newgrup으로 copy
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCopyNewGrup(){
- model.copyNode("/root/main/newgrup", "/root/main/gruplist[" + iRow + "]");
- //유효여부 변경하기
- var todt = model.getValue("/root/main/gruplist[" + iRow + "]/gruptodt");
- var fromdt = model.getValue("/root/main/gruplist[" + iRow + "]/grupfromdt");
- if(fromdt <= getCurrentDate()+getCurrentTime && todt > getCurrentDate()+getCurrentTime ){
- model.setValue("/root/temp/valiyn","Y");
-
- } else {
- model.setValue("/root/temp/valiyn","N");
-
- }
- model.refresh();
-
- fSetCtrlDisabled2(true)
- cmb_valiyn.disabled = true;
- }
- /**
- * @desc : gridsublist 를 newitem으로 copy
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCopyGridSublist(){
- model.toggle("gruplist");
- var curRow = grd_gridsublist.row - grd_gridsublist.fixedRows + 1;
- model.setValue("/root/main/newitem/itemnm" , model.getValue("/root/main/gridsublist[" + curRow + "]/itemnm"));
- model.setValue("/root/main/newitem/itemcnts" , model.getValue("/root/main/gridsublist[" + curRow + "]/itemcnts"));
- model.setValue("/root/main/newitem/datakind" , model.getValue("/root/main/gridsublist[" + curRow + "]/datakind"));
- model.setValue("/root/main/newitem/cntrkind" , model.getValue("/root/main/gridsublist[" + curRow + "]/cntrkind"));
- model.setValue("/root/main/newitem/reprtermnm" ,model.getValue("/root/main/gridsublist[" + curRow + "]/reprtermnm"));
- model.setValue("/root/main/newitem/rem" , model.getValue("/root/main/gridsublist[" + curRow + "]/itemrem"));
- model.setValue("/root/main/newitem/updtresncnts",model.getValue("/root/main/gridsublist[" + curRow + "]/itemupdtresncnts"));
- var itemcd = model.getValue("/root/main/gridsublist[" + curRow + "]/itemcd");
- model.makeValue("/root/send/reqdata/reqdata", itemcd);
- model.makeValue("/root/send/reqdata/reqstatusterm", "Y");
- submit("TRMRF00202");
- model.refresh();
- }
- /**
- * @desc : 유사어/약어 정보 newitem으로 복사
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCopyTermlist(){
- if(grd_termlist.isCell(event.target)){
- iRow = grd_termlist.row;
- if(iRow < 1){
- return;
- }
- fSetCtrlitemDisabled(true);
- cmb_valiyn.disabled = true;
- model.toggle("itemlist");
- iRow = grd_termlist.row;
- model.setValue("/root/main/newitem/itemnm",model.getValue("/root/main/termlist[" + iRow + "]/termnm"));
- model.setValue("/root/main/newitem/itemfromdt",model.getValue("/root/main/termlist[" + iRow + "]/termfromdt"));
- model.setValue("/root/main/newitem/itemtodt",model.getValue("/root/main/termlist[" + iRow + "]/termtodt"));
- model.setValue("/root/main/newitem/updtresncnts",model.getValue("/root/main/termlist[" + iRow + "]/updtresncnts"));
- model.setValue("/root/main/newitem/rem",model.getValue("/root/main/termlist[" + iRow + "]/rem"));
- model.setValue("/root/main/newitem/termcd",model.getValue("/root/main/termlist[" + iRow + "]/termcd"));
- model.setValue("/root/main/newitem/fstrgstrid",model.getValue("/root/main/termlist[" + iRow + "]/fstrgstrid"));
- model.setValue("/root/main/newitem/repryn",model.getValue("/root/main/termlist[" + iRow + "]/repryn"));
-
- var termgubun = model.getValue("/root/main/termlist[" + iRow + "]/repryn");
-
- if (termgubun == "Y") {
- chkmaster.visible = false;
- } else {
- chkmaster.visible= true;
- }
-
- if(termgubun =="N") {
- model.setValue("/root/main/newitem/repryn","");
- }
- model.refresh();
- fSetCtrlDisabled2(true);
- }
- }
|