123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282 |
- /* ---------------------------------------------------------------------
- 수술방별 가동율 (SMMCT00200.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- : Create By taebum
- : 2009-09-21 오전 8:53:33
- ---------------------------------------------------------------------- */
- /**
- * @group :
- * @ver : 2009-09-15 오후 6:45:47
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 초기화
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInit(){
- var currDate = getCurrentDate();
-
- model.setValue("/root/main/condition/fromdd" , fCalcDate(currDate,-1));
- model.setValue("/root/main/condition/todd" , currDate);
- model.refresh();
-
- model.removeNodeSet("/root/main/oproomuserateinfo/oproomuseratelist");
- grd_oproomuseratelst.refresh();
- model.removeNodeSet("/root/main/opdeptdoctopinfo/opdeptdoctoplist");
- grd_opdeptdoctlist.refresh();
-
- var instcd = getUserInfo("dutplceinstcd");
- var rslt_ref = "/root/init/orddeptlist";
-
- //model.setValue("/root/main/cond/orddeptcd", "%");
- model.setValue("/root/main/condition/orddrid", "");
- //zsdfGetCareOutOrderDepartmentList(instcd, rslt_ref, currDate);
- submit("TRMCT00208");
- //수술방 정보 조회
- fGetOproomList();
- addComboItem("cmb_subdept");
- fValueChangedSchCombo();
-
-
- }
- /*
- * 1달을 자동 세팅되게 하는 함수
- * sDate : 일자(string)
- * iFlag : int 1/-1 (1달 이전/이후의 날짜 계산용도)
- */
- function fCalcDate(sDt,iFlag){
- var sDate = sDt.toDate("YYYYMMDD").getAddDate(iFlag, "M").getAddDate(-(iFlag), "D")
- //alert(sDt.toDate("YYYYMMDD").getAddDate(iFlag, "M").getAddDate(-(iFlag), "D").getDayOfWeek("K")); -- 해당요일
- rtnDate = sDate.getFullYear();
- rtnDate = rtnDate.toString() + (( sDate.getMonth() + 1 > 9 ) ? sDate.getMonth() + 1 : "0" + (sDate.getMonth() + 1));
- rtnDate = rtnDate.toString() + (( sDate.getDate() > 9 ) ? sDate.getDate() : "0" + sDate.getDate()) ;
- return rtnDate;
- }
- /**
- * @group :
- * @ver : 2009-09-15 오후 6:45:47
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fClickSearchBtn(){
- model.resetInstanceNode("/root/send");
- var todd = model.getValue("/root/main/condition/todd");
- var fromdd = model.getValue("/root/main/condition/fromdd");
- var oproomcd = model.getValue("/root/main/condition/oproomcd");
- var subdeptcd = model.getValue("/root/main/condition/subdeptcd");
- var orddrid = model.getValue("/root/main/condition/orddrid");
- var inrmtm = model.getValue("/root/main/condition/inrmtm");
- var tab = model.getValue("/root/main/condition/tab"); //방별, 과별 선택 탭 by 박영우 20091217
-
- if(fromdd == "" || fromdd == "undefined" || fromdd == null){
- model.alert("시작일자는 필수 입력 항목입니다.");
- return;
- }
-
- if(todd == "" || todd == "undefined" || todd == null){
- model.alert("종료일자는 필수 입력 항목입니다.");
- return;
- }
-
- //현재시간을 비교하여 근무시간 이후일 경우 6개월이상 조회가능 하도록 설정
- var sCurrentTm = getCurrentTime().substr(0,4);
- var sCurrentDay = getCurrentDate().toDate("YYYYMMDD").getDayOfWeek("K");
-
- if(sCurrentDay == "월" || sCurrentDay == "화" || sCurrentDay == "수" ||
- sCurrentDay == "목" || sCurrentDay == "금"){
-
- //오후 5시 이전일 경우 조회 조건은 6달이상 조회되지 않도록 함.
- if(sCurrentTm < "1700"){
- var sSearchTerm = getDateInterval(fromdd, todd);
- if(sSearchTerm > 183){
- model.alert("근무시간에는 6개월 이상 조회할 수 없습니다.");
- return;
- }
- }
- }
-
- model.setValue("/root/send/todd" , todd );
- model.setValue("/root/send/fromdd" , fromdd );
- model.setValue("/root/send/oproomcd" , oproomcd );
- model.setValue("/root/send/subdeptcd", subdeptcd);
- model.setValue("/root/send/orddrid" , orddrid );
- model.setValue("/root/send/tab" , tab );
- model.setValue("/root/send/inrmtm" , inrmtm );
-
- model.removeNodeSet("/root/main/operpretcondinfo/operpretcondinfolist");
- grd_oproomuseratelst.refresh();
-
- if(tab == "R"){ //수술방별
- if(submit("TRMCT00200")){
- var iGridCnt = getNodesetCount("/root/main/oproomuserateinfo/oproomuseratelist");
- if(iGridCnt > 1){
- var iRegtm = eval(model.getValue("/root/main/oproomuserateinfo/oproomuseratelist["+iGridCnt+"]/regtm"));
- var iRealoptime = eval(model.getValue("/root/main/oproomuserateinfo/oproomuseratelist["+iGridCnt+"]/realoptime"));
- var iOptime = eval(model.getValue("/root/main/oproomuserateinfo/oproomuseratelist["+iGridCnt+"]/optime"));
-
- var sOprate = (Math.round((iOptime/iRegtm)*1000))/10;
- var sRealOprate = (Math.round((iRealoptime/iRegtm)*1000))/10;
- model.setValue("/root/main/oproomuserateinfo/oproomuseratelist["+iGridCnt+"]/userate" ,sOprate);
- model.setValue("/root/main/oproomuserateinfo/oproomuseratelist["+iGridCnt+"]/useratetotal",sRealOprate);
- grd_oproomuseratelst.refresh();
- }
- }
- }else if(tab == "D" || tab == "E"){ //과별 의사별, 과별 추가 by 박영우 20091217
- if(submit("TRMCT00206")){
-
- }
- }
- }
- /**
- * @group :
- * @ver : 2009-09-15 오후 6:45:47
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 진료과 변경시 의사 조회 이벤트
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fValueChangedOrddrCombo(){
- var sordclsdeptflag = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/ordclsdeptflag"); // 대표/분과/서브 구분
- var sorddeptkind = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/orddeptkind"); // 센터/대표 구분
- var ssupdeptcd = model.getValue("/root/init/orddeptlist/dept[deptcd = '"+model.getValue("/root/main/condition/subdeptcd")+"']/supdeptcd"); // 상위부서코드
- var tab = model.getValue("/root/main/condition/tab"); //방별, 과별 선택 탭 by 박영우 20091217
- var sorddeptflag = "";
-
- if (sorddeptkind == "C") { // 센터이면
- sorddeptflag = "C";
- } else if (sorddeptkind != "C" && sordclsdeptflag == "A") { // 센터가 아니면서 분과이면
- sorddeptflag = "A";
- } else { // 그외에 기타과
- sorddeptflag = "etc";
- }
-
- if(model.getValue("/root/main/condition/subdeptcd") == ""){
- model.setValue("/root/main/condition/orddrid","");
- cmb_orddrid.refresh();
- }
-
- model.makeValue("/root/send/reqdata/ordclsdeptflag", sorddeptflag);
- model.makeValue("/root/send/reqdata/supdeptcd", ssupdeptcd);
- model.makeValue("/root/send/reqdata/prcpspecflag", "Y");
-
- model.makeValue("/root/send/reqdata/orddd", getCurrentDate());
- model.makeValue("/root/send/reqdata/orddeptcd", model.getValue("/root/main/condition/subdeptcd"));
- if(tab=="D") { //과,의사별일 경우에만 의사리스트 조회 by 박영우 20091217
- submit("TRMNO00104"); // 의사리스트 조회
- addComboItem("cmb_orddrid");
- }
- }
- /**
- * @group :
- * @ver : 2009-09-15 오후 6:45:47
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 검색 combo 변경시 이벤트
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fValueChangedSchCombo(){
- var sTab = model.getValue("/root/main/condition/tab");
- if(sTab == "R"){ //방별
- //combo변경시 시간 재조정 by 박영우 20091222
- model.removenodeset("/root/main/oproomuserateinfo");
- model.setValue("/root/main/condition/inrmtm", "0800");
- caption7.visible = true;
- cmb_oproom.visible = true;
-
- caption14.visible = false;
- cmb_subdept.visible = false;
- caption1.visible = false;
- cmb_orddrid.visible = false;
-
- grd_oproomuseratelst.visible = true;
- grd_opdeptdoctlist.visible = false;
- model.refresh();
- }else if(sTab == "E"){ //과별 추가 by 박영우 20091216
- //combo변경시 그리드, 과별, 시간 재조정 by 박영우 20091222
- model.removenodeset("/root/main/opdeptdoctopinfo");
- model.setValue("/root/main/condition/subdeptcd", "");
- model.setValue("/root/main/condition/inrmtm", "0800");
- caption14.visible = true;
- cmb_subdept.visible = true;
- caption1.visible = false;
- cmb_orddrid.visible = false;
-
- caption7.visible = false;
- cmb_oproom.visible = false;
-
- grd_oproomuseratelst.visible = false;
- grd_opdeptdoctlist.visible = true;
- grd_opdeptdoctlist.colHidden(grd_opdeptdoctlist.colref("perfdrnm"))=true;
- model.refresh();
- }else if(sTab == "D"){
- //combo변경시 그리드, 과별, 의사별, 시간 재조정 by 박영우 20091222
- model.removenodeset("/root/main/opdeptdoctopinfo");
- model.setValue("/root/main/condition/subdeptcd", "");
- model.setValue("/root/main/condition/orddrid", "");
- model.setValue("/root/main/condition/inrmtm", "0800");
- caption14.visible = true;
- cmb_subdept.visible = true;
- caption1.visible = true;
- cmb_orddrid.visible = true;
-
- caption7.visible = false;
- cmb_oproom.visible = false;
-
- grd_oproomuseratelst.visible = false;
- grd_opdeptdoctlist.visible = true;
- grd_opdeptdoctlist.colHidden(grd_opdeptdoctlist.colref("perfdrnm"))=false;
- model.refresh();
- }
- }
- /**
- * @group :
- * @ver : 2009-09-15 오후 6:45:47
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 수술방 정보 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fGetOproomList(){
- model.setValue("/root/send/fromdd" , getCurrentDate() );
- //현재일자에 유효한 수술방을 조회한다.
- submit("TRMCT00207");
- addComboItem("cmb_oproom");
- }
|