123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386 |
- /*
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- 마취과스케줄 담당관리 ( SPMMO05700_마취과스케줄 담당관리.xrw - JScript )
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- */
- /**
- * @desc : 마취과스케줄 담당관리 초기화
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fInitialize_SPMMO05700(){
- model.removeNodeset("/root/main/chrgschedwlist/chrgschedwlist");
- reqHardCodeInfo("/root/send/reqdata", "/root/init/hardcd", 18);
- var deptcd = model.getValue("/root/init/hardcd/hardcd/hardcd");
- mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist", deptcd);
- model.copyNode("/root/main/userlist", "/root/init/userlist");
-
- fReqChrgScheDWList(); //스케줄 담당요일 조회
-
- fReqOpScheRegTimeList(); //스케줄 정규시간 조회
-
- fSetupRegltmInfo(); //수술스케줄 정규시간 설정가능 범위 조회
- }
- /**
- * @desc : 등록버튼 클릭
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fClkBtnRgst(){
- for(var i = 0; i < grd_anstdrlist.selectedRows; i++){
- var currow = grd_anstdrlist.selectedRow(i);
- var userid = grd_anstdrlist.valueMatrix(currow, grd_anstdrlist.colRef("userid"));
- var usernm = grd_anstdrlist.valueMatrix(currow, grd_anstdrlist.colRef("usernm"));
- //var orddrid = model.getValue("/root/main/chrgschedwlist/chrgschedwlist[orddrid = '" + userid + "']/orddrid");
- //if(orddrid != ""){continue;}
-
- grd_chrgschedwlist.addRow(false, true);
- grd_chrgschedwlist.valueMatrix(grd_chrgschedwlist.row, grd_chrgschedwlist.colRef("orddrid")) = userid;
- grd_chrgschedwlist.valueMatrix(grd_chrgschedwlist.row, grd_chrgschedwlist.colRef("hngnm")) = usernm;
- grd_chrgschedwlist.valueMatrix(grd_chrgschedwlist.row, grd_chrgschedwlist.colRef("status")) = "i";
- }
- grd_chrgschedwlist.refresh();
- group1.attribute("visibility") = "hidden";
- group1.refresh();
- }
- /**
- * @desc : 닫기버튼 클릭
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fClkBtnClose(){
- group1.attribute("visibility") = "hidden";
- group1.refresh();
- }
- /**
- * @desc : 추가버튼 클릭
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fClkBtnAdd(){
- group1.attribute("visibility") = "visible";
- group1.refresh();
- }
- /**
- * @desc : 스케줄 담당요일 저장
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fSaveChrgScheDWList(){
- model.removeNodeset("/root/send/savedata");
- var chrgschedwlist = getNodeListCSV(instance1.selectNodes("/root/main/chrgschedwlist/chrgschedwlist"));
- model.makeValue("/root/send/savedata", chrgschedwlist);
- if(submit("TXMMO05702")){
-
- }
- }
- /**
- * @desc : 스케줄 담당요일 조회
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fReqChrgScheDWList(){
- submit("TRMMO05703");
- }
- /**
- * @desc : 담당스케줄 요일리스트 변경
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fChngChrgScheDWList(){
- var status = grd_chrgschedwlist.valueMatrix(grd_chrgschedwlist.row, grd_chrgschedwlist.colRef("status"));
- if(status != "i"){ //신규
- grd_chrgschedwlist.valueMatrix(grd_chrgschedwlist.row, grd_chrgschedwlist.colRef("status")) = "u";
- }
- grd_chrgschedwlist.refresh();
- }
- /**
- * @desc : 담당스케줄 시간 조회
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fReqOpScheRegTimeList(){
- model.makeValue("/root/send/reqdata/nextdate", "");
- if(submit("TRMMO05705")){
- var rsltxml = instance1.selectSingleNode("/root/main/scheregtimelist/scheregtimelist");
- if(rsltxml == null){
- model.makeNode("/root/main/scheregtimelist/scheregtimelist");
- model.makeValue("/root/main/scheregtimelist/scheregtimelist/regfromtm" , "08");
- model.makeValue("/root/main/scheregtimelist/scheregtimelist/regendtm" , "17");
- model.makeValue("/root/main/scheregtimelist/scheregtimelist/irregfromtm", "17");
- model.makeValue("/root/main/scheregtimelist/scheregtimelist/irregendtm" , "08");
- }
-
- //현재 설정된 값을 변수와 함께 관리, 값 입력 시 범위에 벗어나 값을 롤백시킬 때 필요 (2009.10.23 JJE)
- startfromtmVal = model.getValue("/root/main/scheregtimelist/scheregtimelist/regfromtm");
- starttotmVal = model.getValue("/root/main/scheregtimelist/scheregtimelist/regendtm");
- endfromtmVal = model.getValue("/root/main/scheregtimelist/scheregtimelist/irregfromtm");
- endtotmVal = model.getValue("/root/main/scheregtimelist/scheregtimelist/irregendtm");
- }
- model.refresh();
- }
- /**
- * @desc : 시간 증가, 감사
- * @
- * @param : srctime - 원래시간
- * : chngval - 변경값(+1, -1)
- *
- * @return : destime - 변경시간
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fIncDecTime(srctime, chngval){
- if(srctime.substr(0,1) == "0"){
- srctime = srctime.substr(1,1);
- }
- destime = eval(srctime) + chngval;
- if(destime == -1){
- return "00";
- }else if(destime == 25){
- return "24";
- }
- if(destime < 10){destime = "0".concat(destime);}
- return destime;
- }
- /**
- * @desc : 정규시간 저장
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fSaveOpScheRegTimeList(){
- model.removeNodeset("/root/send/savedata");
- var regfromtm = model.getValue("/root/main/scheregtimelist/scheregtimelist/regfromtm");
- var regendtm = model.getValue("/root/main/scheregtimelist/scheregtimelist/regendtm");
- var irregfromtm = model.getValue("/root/main/scheregtimelist/scheregtimelist/irregfromtm");
- var irregendtm = model.getValue("/root/main/scheregtimelist/scheregtimelist/irregendtm");
- model.makeValue("/root/send/savedata/regfromtm" , regfromtm.concat("0000"));
- model.makeValue("/root/send/savedata/regendtm" , regendtm.concat("0000"));
- model.makeValue("/root/send/savedata/irregfromtm", irregfromtm.concat("0000"));
- model.makeValue("/root/send/savedata/irregendtm" , irregendtm.concat("0000"));
- submit("TXMMO05703");
- }
- /**
- * @desc : 수술스케줄 관리자 조회
- * @
- * @param :
- * @return :
- * @author : 박유미
- * @---------------------------------------------------
- */
- function fGetOpScheSrchList() {
- model.removeNodeset("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/cond", model.getValue("/root/main/cond/srchcond"));
- model.makeValue("/root/send/reqdata/data", model.getValue("/root/main/cond/srchdata"));
- submit("TRMMO05706");
- }
- /**
- * @desc : 수술스케줄 정규시간 설정가능 범위 정보 조회/셋팅 (병원별 정규시간 범위 제한을 달리 해달라고 요청함)
- * @
- * @param :
- * @return :
- * @author : 전지은 (2009.12.23)
- * @---------------------------------------------------
- */
- function fSetupRegltmInfo(){
- var rsltSrc = "/root/init/regltminfo/hardcd";
- startfromtm = "";
- starttotm = "";
- endfromtm = "";
- endtotm = "";
-
- mmbfGetHardCodeInfoNm("/root/send/reqdata", "/root/init/regltminfo" , 137); //20091023 JJE 추가
-
- if( getNodesetCount(rsltSrc) > 0 ){
- var startTmNode = instance1.selectSingleNode(rsltSrc + "[" + 1 + "]/hardcd"); //시작시간 From~To
- var endTmNode = instance1.selectSingleNode(rsltSrc + "[" + 2 + "]/hardcd"); //종료시간 From~To
-
- if( startTmNode != null ) startfromtm = startTmNode.text.split("|")[0];
- if( startTmNode != null ) starttotm = startTmNode.text.split("|")[1];
- if( endTmNode != null ) endfromtm = endTmNode.text.split("|")[0];
- if( endTmNode != null ) endtotm = endTmNode.text.split("|")[1];
-
- model.removeNodeset(rsltSrc);
- }
-
- if( startfromtm == "" ) startfromtm = "08";
- if( starttotm == "" ) starttotm = "-";
- if( endfromtm == "" ) endfromtm = "17";
- if( endtotm == "" ) endtotm = "21";
-
- model.makeValue("/root/init/regltminfo/startfromtm", startfromtm);
- model.makeValue("/root/init/regltminfo/starttotm" , starttotm);
- model.makeValue("/root/init/regltminfo/endfromtm" , endfromtm);
- model.makeValue("/root/init/regltminfo/endtotm" , endtotm);
- }
- /**
- * @desc : fromTm 변경
- * @
- * @param :
- * @return :
- * @author : 전지은 (2009.12.23)
- * @---------------------------------------------------
- */
- function fSetDownFromTm(){
- //정규시작시간 감소
- var srctime = model.getValue("/root/main/scheregtimelist/scheregtimelist/regfromtm");
- if(srctime <= startfromtm){ //제한 기준 변경 8 -> startfromtm (2009.10.23 by JJE)
- return;
- }
- var destime = fIncDecTime(srctime, -1);
- model.setValue("/root/main/scheregtimelist/scheregtimelist/regfromtm", destime);
- model.setValue("/root/main/scheregtimelist/scheregtimelist/irregendtm", destime);
- startfromtmVal = destime;
- endtotmVal = destime;
- model.refresh();
- }
- /**
- * @desc : fromTm 변경
- * @
- * @param :
- * @return :
- * @author : 전지은 (2009.12.23)
- * @---------------------------------------------------
- */
- function fSetUpFromTm(){
- //정규시작시간 증가
- var srctime = model.getValue("/root/main/scheregtimelist/scheregtimelist/regfromtm");
- var tmptime = model.getValue("/root/main/scheregtimelist/scheregtimelist/regendtm");
- if(srctime >= tmptime - 1){ //시작시간이 종료시간보다 크거나 같은 경우
- return;
- }
- var destime = fIncDecTime(srctime, 1);
- model.setValue("/root/main/scheregtimelist/scheregtimelist/regfromtm", destime);
- model.setValue("/root/main/scheregtimelist/scheregtimelist/irregendtm", destime);
- startfromtmVal = destime;
- endtotmVal = destime;
- model.refresh();
- }
-
- /**
- * @desc : toTm 변경
- * @
- * @param :
- * @return :
- * @author : 전지은 (2009.12.23)
- * @---------------------------------------------------
- */
- function fSetDownToTm(){
- //정규종료시간 감소
- var srctime = model.getValue("/root/main/scheregtimelist/scheregtimelist/regendtm");
- if(srctime <= endfromtm){ //제한 기준 변경 17 -> endfromtm (2009.10.23 by JJE)
- return;
- }
- var destime = fIncDecTime(srctime, -1);
- model.setValue("/root/main/scheregtimelist/scheregtimelist/regendtm", destime);
- model.setValue("/root/main/scheregtimelist/scheregtimelist/irregfromtm", destime);
- starttotmVal = destime;
- endfromtmVal = destime;
- model.refresh();
- }
-
-
- /**
- * @desc : toTm 변경
- * @
- * @param :
- * @return :
- * @author : 전지은 (2009.12.23)
- * @---------------------------------------------------
- */
- function fSetUpToTm(){
- //정규종료시간 증가
- var srctime = model.getValue("/root/main/scheregtimelist/scheregtimelist/regendtm");
- if(srctime >= endtotm){ //제한 기준 변경 21 -> endtotm (2009.10.23 by JJE)
- return;
- }
- var destime = fIncDecTime(srctime, 1);
- model.setValue("/root/main/scheregtimelist/scheregtimelist/regendtm", destime);
- model.setValue("/root/main/scheregtimelist/scheregtimelist/irregfromtm", destime);
- starttotmVal = destime;
- endfromtmVal = destime;
- model.refresh();
- }
-
- /**
- * @desc : inputbox에 값 직접 수정 시 체크
- * @
- * @param :
- * @return :
- * @author : 전지은 (2009.12.23)
- * @---------------------------------------------------
- */
- function fCheckVal( flag, val ){
- val = val.getLeftPad(2, "0");
-
- if( flag == "from" ){
- var tmptime = model.getValue("/root/main/scheregtimelist/scheregtimelist/regendtm");
- if( val < startfromtm || val > tmptime - 1 ){
- model.setValue("/root/main/scheregtimelist/scheregtimelist/regfromtm" , startfromtmVal);
- model.setValue("/root/main/scheregtimelist/scheregtimelist/irregendtm", endtotmVal);
- }else{
- model.setValue("/root/main/scheregtimelist/scheregtimelist/regfromtm" , val);
- model.setValue("/root/main/scheregtimelist/scheregtimelist/irregendtm", val);
- startfromtmVal = val;
- endtotmVal = val;
- }
- }else if( flag == "to" ){
- if( val < endfromtm || val > endtotm ){
- model.setValue("/root/main/scheregtimelist/scheregtimelist/regendtm" , starttotmVal);
- model.setValue("/root/main/scheregtimelist/scheregtimelist/irregfromtm", endfromtmVal);
- }else{
- model.setValue("/root/main/scheregtimelist/scheregtimelist/regendtm" , val);
- model.setValue("/root/main/scheregtimelist/scheregtimelist/irregfromtm", val);
- starttotmVal = val;
- endfromtmVal = val;
- }
- }
- model.refresh();
- }
|