12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115 |
- /**
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- 진료 - 밸류리스트관리 ( SMMRF003000_밸류리스트관리.xrw - JScript )
-
- * Version :
- - Ver.1.00.01
-
- * 개발자: 이경희
-
- * 최초작성일:
- - 2008/02/28
-
- * 수정이력:
- - 2008/03/19
- - 2009-04-09 오전 9:04:43 강지훈 수정 : TRMRF00301을 중앙의료원용 TRMRF00303으로 변경
- - 2009-04-09 오전 9:04:43 강지훈 수정 : TRMRF00302을 중앙의료원용 TRMRF00304으로 변경
-
- * 기타:
-
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- */
- var FORMMNGT_SCR_SAVE_DATA = 0; //화면에 밸류리스트 저장할 데이터 (0:없음, 1:있음)
- /**
- * @desc : 화면 초기화
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitialize(){
- model.makeValue("/root/init/today", getCurrentDate());
- 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;
- }
- }
- /**
- * @desc : valsublist초기화
- * @
- * @param :
- * @return :
- * @----------------------- ------------------------------
- */
- function fReqClear(){
- //valsublist초기화
- model.resetInstanceNode("/root/main/list/valsublist");
- grd_valsublist.refresh();
- model.toggle("gruplist");
- }
- /**
- * @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"));
- }
- model.makeValue("/root/main/condition/grupflag", "V");
- model.copyNode("/root/send/reqdata", condPath );
- var value = model.getValue("/root/main/switchon");
-
- if(value == "true")
- {
- if(mode == "valuesub")
- {
- messageBox("데이터 저장용도인 경우 서브항목명으로는 조회할 수", "E001");
- return;
- }
- submit("TRMRF00305");
- }
- else
- {
- submit("TRMRF00303");
- }
- }
- /**
- * @desc : 밸류리스트 조회 newgrup에 복사
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fReqCopyGruplist(){
- if(grd_gruplist.isCell(event.target)){
- iRow = grd_gruplist.row;
- if(iRow < 1){
- return;
- }
- fSetCtrlDisabled3(true);
- model.copyNode("/root/main/newgrup","/root/main/gruplist["+ iRow +"]");
- fReqValueSub(grd_gruplist, "/root/main/condition");
-
- }
- }
- /**
- * @desc : 밸류리스트 추가
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInsertGrup(){
- //버튼 disable
- fSetCtrlDisabled3(false);
- model.resetInstanceNode("/root/main/newgrup");
-
- model.makeValue("/root/main/newgrup/grupfromdt", model.getValue("/root/init/today"));
- model.makeValue("/root/main/newgrup/gruptodt" , "99991231");
- model.makeValue("/root/main/newgrup/grupflag", "V");
- model.makeValue("/root/main/newgrup/itemcduseyn", "Y");
- model.makeValue("/root/main/newgrup/viewyn", "Y");
- //신규 저장시
- model.makeValue("/root/main/newgrup/status","i");
- model.refresh();
- model.setFocus("ipt_listnm");
- }
- /**
- * @desc : 밸류리스트 clear
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fClearValue(){
- for ( var i = grd_gruplist.rows-1 ; i >= grd_gruplist.fixedRows; i--){
- if (grd_gruplist.rowstatus(i) > 0){
- grd_gruplist.deleteitem(i);
- }
- }
- grd_gruplist.clearStatus();
- grd_gruplist.rebuild();
- model.refresh();
- //fSetBtnDisabled(2);
- fSetCtrlDisabled3(true);
- for(var i = 1; i < grd_gruplist.rows; i++){
- grd_gruplist.rowStatus(i) = "0";
- }
- }
- /**
- * @desc : 밸류서브리스트 Clear
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fClearValueSub(){
- model.makeValue("/root/temp/tmp", "");
- for ( var i = grd_valsublist.rows-1 ; i >= grd_valsublist.fixedRows; i--){
- if (grd_valsublist.rowstatus(i) > 0)
- {
- grd_valsublist.deleteitem(i);
- }
- }
- grd_valsublist.clearStatus();
- grd_valsublist.rebuild();
- //model.removeNodeset("/root/main/list/valsublist");
- model.refresh();
- //fSetBtnDisabled(2);
- fSetCtrlDisabled3(true);
- for(var i = 1; i < grd_valsublist.rows; i++){
- grd_valsublist.rowStatus(i) = "0";
- }
- }
- /**
- * @desc : 밸류리스트 수정
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fUpdateGrup(){
- //아이템유효여부 초기화 Y
- cmb_valiyn.disabled = false;
- fSetCtrlDisabled3(false);
- iRow = grd_gruplist.row - grd_gruplist.fixedRows + 1;
- if(iRow < 1){
- messageBox("수정할 행을 ","C002");
- return;
- }
-
- //fValiCheck();
- model.makeValue("/root/temp/valsublist/status", "u");
- model.copyNode("/root/main/newgrup", "/root/main/gruplist[" + iRow + "]");
-
- model.refresh();
- 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 : 밸류리스트 등록
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fRgstValue(){
- var curRow = model.getValue("/root/main/newgrup/rowpos");
- model.copyNode("/root/main/gruplist[" + curRow + "]", "/root/main/newgrup");
- model.refresh();
- }
- /**
- * @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);
- if(status=="" || status==null ){
- return;
- }
- var grupnm = model.getValue("/root/main/newgrup/grupnm");
- if(grupnm=="" || grupnm==null ){
- messageBox("리스트명을 ","C001");
- return;
- }
- // 2010.02.03 대,중,소분류 사용 안한다고 삭제처리
- // if(!isRequiredControls("ipt_deptnm1"))
- // return;
- //수정 여부 check
- if(status == "u"){
- var compare = fCompareNodes1("/root/main/newgrup2","/root/main/newgrup");
-
- if(status=="u" && compare == true){
- messageBox("수정된 내용이","I004");
- return;
- }
-
- //2009.01.21 강지훈 수정
- //변경이력을 남기지 않고 Update.
- var ret = messageBox("변경 이력을 저장", "S001");
- if(ret == "6"){
- model.makeValue("/root/main/newgrup/histsaveyn", "Y");
-
- }
- if(ret == "7"){
- model.makeValue("/root/main/newgrup/histsaveyn", "N");
- }
-
- }
- // 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"));
- model.copyNode("/root/send/grupdata/grupmaster","/root/main/newgrup");
- //fUpdateToDt();
- for (var i= grd_valsublist.fixedRows; i < grd_valsublist.rows ;i++ )
- {
- var aa = grd_valsublist.rowstatus(i) = 1;
- }
-
- model.makeValue("/root/send/grupdata/savedata", grd_valsublist.getUpdateData());
- if(submit("TXMRF00301")){
-
- if(fChkError() == 1){ //저장 중 error유무 확인
- alert("chkerror");
- model.makeValue("/root/main/newgrup/procflag", "Y"); //process처리구분을 무시로 설정, 저장된다.
- model.refresh();
- model.makeValue("/root/temp/errmsg/errcd","");
- model.copyNode("/root/send/grupdata/grupmaster","/root/main/newgrup");
- //fUpdateToDt();
- model.makeValue("/root/send/grupdata/savedata", grd_valsublist.getUpdateData());
- submit("TXMRF00301");
- }
- }
- // 저장후 gruplist 조회
- model.makeValue("/root/main/condition/grupflag", "V");
- 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", "value");
- submit("TRMRF00303");
- grd_gruplist.row = 1;
- model.removeNodeset("/root/main/list/valsublist");
- // 저장후 vallist 조회
- if(status=="u" ){ // 수정만 조회
- model.makeValue("/root/send/reqdata/grupcd",model.getValue("/root/main/gruplist[" + grd_gruplist.row + "]/grupcd"));
-
- if(submit("TRMRF00304")== false){
- model.removeNodeset("/root/main/list/valsublist");
- }
- }
- model.makeValue("/root/main/newgrup/status","");
- //아이템유효여부 초기화 Y
- cmb_valiyn.disabled = true;
- model.makeValue("/root/temp/valiyn","Y");
- fSetCtrlDisabled3(true);
- model.refresh();
- }
- /**
- * @desc : 밸류서브리스트 조회
- * @
- * @param : grdObj 그리드 ID, condPath 조회조건 xpath
- * @return :
- * @---------------------------------------------------
- */
- function fReqValueSub(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/temp/valsublist/grupcd", model.getValue("/root/main/gruplist[" + curRow + "]/grupcd"));
- model.refresh();
- model.copyNode("/root/send/reqdata", condPath);
- submit("TRMRF00304");
- }
- /**
- * @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.makeValue("/root/temp/valsublist/itemremove","Y");
- model.refresh();
- }
- /**
- * @desc : 밸류서브리스트 저장
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSaveValueSub()
- {
- var bModified = false;
- //아이템 삭제 여부 확인
- var itemflag =model.getValue("/root/temp/valsublist/itemremove");
-
- for(var i = 1; i <grd_valsublist.rows; i++)
- {
- rowStatus = grd_valsublist.rowStatus(i);
-
- if(rowStatus != "0" || itemflag=="Y"){
- bModified = true;
- break;
- }
- }
- //현재 row 유무 확인
- if(grd_valsublist.rows == grd_valsublist.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로 조회 (TRMRF00303)
- var grupcd = model.getValue(grd_gruplist.attribute("nodeset") + "[" + grd_gruplist.row + "]/grupcd");
- grupcd++ ;
-
- //삭제된 row의 rowstatus값 clear시킨다
- grd_valsublist.clearstatus();
-
- var curRow = grd_gruplist.row - grd_gruplist.fixedRows + 1;
- var grupGridType = model.getValue(grd_gruplist.attribute("nodeset") + "[" + curRow + "]/grupflag");
-
- //현재 row 유무 확인
- if(grd_valsublist.rows == grd_valsublist.fixedRows )
- {
-
- var irow = "0";
- }
- else
- {
- for (var i= grd_valsublist.fixedRows; i < grd_valsublist.rows ;i++ )
- {
- grd_valsublist.rowstatus(i) = 1;
- }
- } //end if
- model.makeValue("/root/send/grupdata/savedata", grd_valsublist.getUpdateData());
-
- var row = grd_gruplist.row;
-
- if(submit("TXMRF00302")!=true){
- grd_valsublist.clearstatus();
- }
- //alert(model.getValue("/root/main/gruplist[" + row + "]/grupnm"));
-
- model.makeValue("/root/main/condition/grupflag", "V");
- 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/reqgrupflag","code");
- model.makeValue("/root/send/reqdata/grupcd",grupcd);
- submit("TRMRF00303");
-
- grd_gruplist.row = 1;
- //valsublist 다시 조회
- var aa=model.getValue("/root/main/gruplist[" + grd_gruplist.row + "]/grupcd");
-
- model.makeValue("/root/send/reqdata/grupcd",model.getValue("/root/main/gruplist[" + grd_gruplist.row + "]/grupcd"));
- submit("TRMRF00304");
- model.makeValue("/root/temp/valsublist/itemremove","N");
- model.refresh();
- }
- /**
- * @desc : 밸류서브리스트의 순서 변경 up / down
- * @
- * @param : grdObj 그리드ID, direcflag 방향구분(up/down)
- * @return :
- * @---------------------------------------------------
- */
- function fChgValueSubSeq(grdObj, direcflag){
- var srcRow = grdObj.row - grdObj.fixedRows + 1;
- if(srcRow =="0")
- return;
- if(direcflag == "up"){ //위로
- if(srcRow == 1){ //현재 위치가 맨 위일 경우
- return;
- }
- var desRow = srcRow - 1;
- }else if(direcflag == "down"){ //아래로
- if(srcRow == grdObj.rows - grdObj.fixedRows){ //현재 위치가 맨 아래일 경우
- return;
- }
- var desRow = srcRow + 1;
- }
- //순서 변경시 값 뿐만 아니라, 그리드 상태값까지 이동한다.
- var srcflag = grdObj.rowStatus(srcRow);
- var desflag = grdObj.rowStatus(desRow);
- model.copyNode("/root/temp/tmp", "/root/main/list/valsublist[" + srcRow + "]");
- model.copyNode("/root/main/list/valsublist[" + srcRow + "]", "/root/main/list/valsublist[" + desRow + "]");
- model.copyNode("/root/main/list/valsublist[" + desRow + "]", "/root/temp/tmp");
- model.makeValue("/root/temp/valsublist/statusflag", desflag);
- grdObj.rowStatus(desRow) = srcflag;
- grdObj.rowStatus(srcRow) = model.getValue("/root/temp/valsublist/statusflag");
- //alert(model.getValue("/root/temp/valsublist/statusflag"));
-
- for(var i = 1; i < grdObj.rows; i++){ //다양한 case가 발생하기 때문에 전체를 update하여 순서를 재정렬.
- model.makeValue("/root/main/list/valsublist[" + i + "]/sortno", i);
-
- if(grdObj.rowStatus(i) != 1){ //신규를 제외하고 모두 update
- grdObj.rowstatus(i) = 2;
- }
- }
- model.refresh();
- return desRow;
-
- }
- /**
- * @desc : 아이템리스트의 등록
- * @
- * @param
- * @return :
- * @---------------------------------------------------
- */
- function fRgstItemdbClick(){
- var tmp = model.getValue("/root/temp/tmp");
- if (tmp != "item_insert") {
- return;
- }
-
- if(grd_itemlist.isCell(event.target)){
- iRow = grd_itemlist.row;
- if(iRow < 1){
- return;
- }
- var curRow = grd_itemlist.row - grd_itemlist.fixedRows + 1;
-
- var termcd = model.getValue("/root/main/itemlist[" + curRow + "]/termcd");
- var reprtermnm = model.getValue("/root/main/itemlist[" + curRow + "]/reprtermnm");
- termcd = termcd.substring(0,7);
-
- // datagrid1.findRow( 검색string, 검색시작행, 검색컬럼, 대소문자구분, 전체일치여부, )
- var findRow = grd_valsublist.findRow(termcd, 1,grd_valsublist.colref("termbasecd"));
- var itemnm = model.getValue("/root/main/itemlist[" + curRow + "]/itemnm");
-
- if (findRow != -1){
- window.alert("동일한 아이템이 존재합니다.\n\n" + findRow + "번째 " + itemnm, "아이템추가", 0 | 64);
- return;
- }
-
-
- grd_valsublist.addItem();
- var curRow1 = grd_valsublist.row - grd_valsublist.fixedRows + 1;
- var grupcd = model.getValue("/root/temp/valsublist/grupcd");
- model.makeValue("/root/main/list/valsublist[" + curRow1 + "]/grupcd", grupcd);
- model.makeValue("/root/temp/valsublist/rowpos", curRow1);
- var desCurRow = model.getValue("/root/temp/valsublist/rowpos");
- model.makeValue("/root/main/list/valsublist[" + desCurRow + "]/itemnm", itemnm);
- model.makeValue("/root/main/list/valsublist[" + desCurRow + "]/valitemnm", itemnm);
- model.makeValue("/root/main/list/valsublist[" + desCurRow + "]/termbasecd", termcd);
- model.makeValue("/root/main/list/valsublist[" + desCurRow + "]/reprtermnm", reprtermnm);
- model.makeValue("/root/main/list/valsublist[" + desCurRow + "]/sortno", desCurRow);
- model.refresh();
-
- }
- }
- /**
- * @desc : 아이템리스트의 선택
- * @
- * @param
- * @return :
- * @---------------------------------------------------
- */
- function fRgstItemClick(){
- if(grd_itemlist.isCell(event.target)){
- iRow = grd_itemlist.row;
- if(iRow < 1){
- return;
- }
- model.copyNode("/root/main/newitem", "/root/main/itemlist[" + iRow + "]");
- 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");
- submit("TRMRF00202");
- }
- }
- /**
- * @desc : 아이템리스트( 유사어 / 약어) 의 등록
- * @
- * @param
- * @return :
- * @---------------------------------------------------
- */
- function fRgstItemSub(){
- var curRow = grd_termlist.row - grd_termlist.fixedRows + 1;
-
- //유사어 약어 dbclick시 등록
- var termnm = model.getValue("/root/main/termlist[" + curRow + "]/termnm");
- var termcd = model.getValue("/root/main/termlist[" + curRow + "]/termcd");
- termcd = termcd.substring(0,7);
- var grupcd = model.getValue(grd_gruplist.attribute("nodeset") + "[" + grd_gruplist.row + "]/grupcd");
-
- //datagrid1.findRow( data명, 시작row, column위치, 대소문자 구분유무, 전체/부분일치 유무 )
- var rowpos = grd_valsublist.findRow(termcd, 1, grd_valsublist.colref("termbasecd"));
- if(rowpos > 0){
- alert(termnm +"과 같은 누적서브 아이템이 존재합니다.");
- return;
- }
- grd_valsublist.addItem();
- var curRow1 = grd_valsublist.row - grd_valsublist.fixedRows + 1;
- var grupcd = model.getValue("/root/temp/valsublist/grupcd");
- model.makeValue("/root/main/list/valsublist[" + curRow1 + "]/grupcd", grupcd);
- model.makeValue("/root/temp/valsublist/rowpos", curRow1);
- var desCurRow = model.getValue("/root/temp/valsublist/rowpos");
- model.makeValue("/root/main/list/valsublist[" + desCurRow + "]/itemnm", termnm);
- model.makeValue("/root/main/list/valsublist[" + desCurRow + "]/termbasecd", termcd);
- model.makeValue("/root/main/list/valsublist[" + desCurRow + "]/sortno", desCurRow);
- model.refresh();
- }
- /**
- * @desc : 그룹리스트 의 등록
- * @
- * @param
- * @return :
- * @---------------------------------------------------
- */
- function fRgstGrupList(){
- // 등록후 같은이름 다시 등록시 return
- var grupnm = model.getValue("/root/main/gruplist["+grd_gruplist.row+"]/grupnm");
- var listnm = model.getValue("/root/main/newgrup/grupnm");
- if(grupnm ==listnm){
- return;
- }
- var curRow;
- var curStatus = model.getValue("/root/temp/valsublist/status");
- var grupnm = model.getValue("/root/main/newgrup/grupnm");
- if (grupnm==null || grupnm=="")
- {
- return;
- }
- if(curStatus == "u"){
- //1. 현재 선택된 그룹리스트에 신규 정보를 반영한다.
- var curRow = grd_gruplist.row - grd_gruplist.fixedRows + 1;
- model.copyNode("/root/main/gruplist[" + curRow + "]", "/root/main/newgrup");
-
- grd_gruplist.rowStatus(curRow) = "2";
- grd_gruplist.refresh();
- }else{
- //1. 그룹 리스트에 한줄 추가
- grd_gruplist.addRow();
- //2. 신규 데이타를 그리드에 반영
- var curRow = grd_gruplist.row - grd_gruplist.fixedRows + 1;
- model.copyNode("/root/main/gruplist[" + curRow + "]", "/root/main/newgrup");
- //model.makeValue("/root/main/gruplist[" + curRow + "]/grupflag",model.getValue("/root/temp/gridsublist/grupflag"));
- //model.makeValue("/root/main/gruplist[" + curRow + "]/grupflag","G");
- grd_gruplist.refresh();
- }
- }
- /**
- * @desc :버튼 disabled
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetCtrlDisabled3(bool){
- ipt_listnm.disabled = bool;
- ipt_fromdd.disabled = bool;
- ipt_todd.disabled = bool;
- ipt_updt.disabled = bool;
- ipt_rem.disabled = bool;
- cmb_itemcduseyn.disabled = bool;
- cmb_grupflag.disabled = bool;
- btn_search.disabled = bool;
- }
- /**
- * @desc :버튼 disabled
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetBtnDisabled(statusflag){
-
- if(statusflag == 0){ //밸류리스트 조회후
- // btn_addval.disabled = false;
- // btn_updtval.disabled = false;
-
- }else if(statusflag == 1){ //밸류리스트추가
- // btn_addval.disabled = true;
- // btn_updtval.disabled = true;
- btn_rgst.disabled = false;
- btn_cncl.disabled = false;
- btn_itemadd.disabled = true;
- btn_itemdel.disabled = true;
- btn_up.disabled = true;
- btn_itemdown.disabled = true;
- // btn_savevalsub.disabled = true;
- btn_delgrp.disabled = false;
- // btn_saveval.disabled = false;
-
- }else if(statusflag == 2){ //btn_cncl 취소
- //FORMMNGT_SCR_SAVE_DATA = 1;//?????? ?????? ?????? ????.
- btn_itemadd.disabled = false;
- btn_itemdel.disabled = false;
- btn_up.disabled = false;
- btn_itemdown.disabled = false;
- // btn_addval.disabled = false;
- // btn_updtval.disabled = false;
-
- }else if(statusflag == 3){ //아이템 추가
- // btn_addval.disabled = true;
- // btn_updtval.disabled = true;
- // btn_saveval.disabled = true;
- // btn_savevalsub.disabled = false;
- // btn_cncl2.disabled = false;
-
- }else if(statusflag == 4){ //UP, DOWN
- // btn_addval.disabled = false;
- // btn_updtval.disabled = false;
- // btn_saveval.disabled = false;
- // btn_savevalsub.disabled = false;
-
- }else if(statusflag == 5){//btn_updtval 밸류 리스트 수정
- // btn_addval.disabled = true;
- btn_rgst.disabled = false;
- btn_cncl.disabled = false;
- btn_itemadd.disabled = true;
- btn_itemdel.disabled = true;
- btn_up.disabled = true;
- btn_itemdown.disabled = true;
- // btn_savevalsub.disabled = true;
- btn_delgrp.disabled = true;
- }
-
- }
- /*
- ????
- */
- function removeBlank(str){
- str = str.replace(/\s/g,'');
- return str;
- }
- /**
- * @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");
- }
- //아이템유효여부 초기화 Y
- cmb_valiyn.disabled = true;
- fSetCtrlDisabled3(true);
- model.makeValue("/root/main/condition/grupcd", model.getValue("/root/main/gruplist[" + iRow + "]/grupcd"));
- model.makeValue("/root/temp/valsublist/grupcd", model.getValue("/root/main/gruplist[" + iRow + "]/grupcd"));
- model.copyNode("/root/send/reqdata", "/root/main/condition");
- model.makeValue("/root/send/reqdata/indxpathcd",model.getValue("/root/main/gruplist[" + iRow + "]/indxpathcd"));
- submit("TRMRF00304");
- model.refresh();
- }
- /**
- * @desc : valsublist 를 newitem으로 copy
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCopyValSublist(){
- model.toggle("gruplist");
- var curRow = grd_valsublist.row - grd_valsublist.fixedRows + 1;
- model.setValue("/root/main/newitem/itemnm" , model.getValue("/root/main/list/valsublist[" + curRow + "]/itemnm"));
- model.setValue("/root/main/newitem/itemcnts" , model.getValue("/root/main/list/valsublist[" + curRow + "]/itemcnts"));
- model.setValue("/root/main/newitem/datakind" , model.getValue("/root/main/list/valsublist[" + curRow + "]/datakind"));
- model.setValue("/root/main/newitem/cntrkind" , model.getValue("/root/main/list/valsublist[" + curRow + "]/cntrkind"));
- model.setValue("/root/main/newitem/reprtermnm" ,model.getValue("/root/main/list/valsublist[" + curRow + "]/reprtermnm"));
- model.setValue("/root/main/newitem/rem" , model.getValue("/root/main/list/valsublist[" + curRow + "]/itemrem"));
- model.setValue("/root/main/newitem/updtresncnts",model.getValue("/root/main/list/valsublist[" + curRow + "]/itemupdtresncnts"));
- var itemcd = model.getValue("/root/main/list/valsublist[" + curRow + "]/itemcd");
- model.makeValue("/root/send/reqdata/reqdata", itemcd);
- model.makeValue("/root/send/reqdata/reqstatusterm", "Y");
- submit("TRMRF00202");
- model.refresh();
- }
- /**
- * @desc : 색인선택 popup버튼
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fPopupIndex(){
- //model.removeNodeset("/root/send");
- model.makeValue("/root/send/paramindx","");
- model.setValue("/root/main/newgrup/depthnm1" ,"");
- model.setValue("/root/main/newgrup/depthnm2" ,"");
- model.setValue("/root/main/newgrup/depthnm3" ,"");
- setParameter("indxflag","V");
- model.setValue("/root/send/paramindx", model.getValue("/root/temp/condition/indxflag"));
- modal("SPMRF02100", 1,10, 10, "SPMRF02100", "/root/send", "/root/temp/condition/getdata");
- var child = "SPMRF02100";
- if(child != null){
-
- var count = getParameter("count");
- for(var i=0; i<count; i++){
- model.makeValue("/root/main/newgrup/depthnm"+(i+1), getParameter("depthnm"+(i+1)));
- }
- var itemidxseq = getParameter("itemindxseq");
- var pathcd = getParameter("pathcd");
-
- model.makeValue("/root/main/newgrup/itemidxseq", itemidxseq);
- model.makeValue("/root/main/newgrup/indxpathcd", pathcd);
-
- model.refresh();
- }
- }
-
- function fSaveExcel()
- {
- try
- {
- if(grd_gruplist.rows > 1)
- {
- var filePath = window.fileDialog("save", "", "", "", "xls", "Excel File(*.xls)|*.xsl|All Files (*.*)|*.*");
- if (filePath == "")
- return;
-
-
- grd_gruplist.saveExcel(filePath, "sheetname:sheet1;colhiddenextend:false;rowhiddenextend:false;");
- }
- else
- {
- messageBox("조회된 데이터가", "I004");
-
- }
- }
- catch(e)
- {
- }
- }
- function fSaveAllExcel()
- {
- try
- {
- if(group_total.rows > 1)
- {
- var filePath = window.fileDialog("save", "", "", "", "xls", "Excel File(*.xls)|*.xsl|All Files (*.*)|*.*");
- if (filePath == "")
- return;
-
- group_total.saveExcel(filePath, "sheetname:sheet1;colhiddenextend:false;rowhiddenextend:false;");
- }
- else
- {
- messageBox("조회된 데이터가", "I004");
-
- }
- }
- catch(e)
- {
- }
- }
- function fSwitch()
- {
- var value = model.getValue("/root/main/switchon");
-
- if(value == "true")
- {
- // 그리드 감추기
- grd_gruplist.visible = false;
- grd_valsublist.visible = false;
-
- // 버튼 비활성화
- button1.disabled = true; // 밸류리스트 저장
- btn_up.disabled = true; // up 버튼
- btn_itemdown.disabled = true; // down 버튼
- btn_itemadd.disabled = true; // 아이템추가 버튼
- btn_itemdel.disabled = true; // 아이템삭제 버튼
- btn_cncl2.disabled = true; // 취소 버튼
- btn_savevalsub.disabled = true; // 저장 버튼
-
- button5.disabled = true; // 신규 버튼
- button2.disabled = true; // 수정 버튼
- button6.disabled = true; // 저장 버튼
- // 전체 그리드 보이기
- group_total.visible = true;
-
- // 저장버튼 보이기
- button3.visible = true; // 저장 버튼
-
- model.refresh();
- }
- else
- {
- group_total.visible = false;
-
- // 저장버튼 숨기기
- button3.visible = false; // 저장 버튼
-
- grd_gruplist.visible = true;
- grd_valsublist.visible = true;
-
- // 버튼 활성화
- button1.disabled = false; // 밸류리스트 저장
- btn_up.disabled = false; // up 버튼
- btn_itemdown.disabled = false; // down 버튼
- btn_itemadd.disabled = false; // 아이템추가 버튼
- btn_itemdel.disabled = false; // 아이템삭제 버튼
- btn_cncl2.disabled = false; // 취소 버튼
- btn_savevalsub.disabled = false; // 저장 버튼
-
- button5.disabled = false; // 신규 버튼
- button2.disabled = false; // 수정 버튼
- button6.disabled = false; // 저장 버튼
-
- model.refresh();
- }
-
-
- }
|