123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- /* ---------------------------------------------------------------------
- 첫수술 ON TIME 시작율 (SMMCT00205.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- : Create By taebum
- : 2009-09-25 오후 4:51:44
- ---------------------------------------------------------------------- */
- /**
- * @group :
- * @ver : 2009-09-25 오후 4:59:42
- * @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/fstopontimerateinfo/fstopontimeratelist");
- grd_fstopontimeratelst.refresh();
- var instcd = getUserInfo("dutplceinstcd");
- var rslt_ref = "/root/init/orddeptlist";
-
- model.setValue("/root/main/condition/orddrid", "");
- //zsdfGetCareOutOrderDepartmentList(instcd, rslt_ref, currDate);
- submit("TRMCT00208");
-
- //수술방 정보 조회 by 박영우 20091223
- 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-25 오후 4:59:44
- * @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 subdeptcd = model.getValue("/root/main/condition/subdeptcd");
- var orddrid = model.getValue("/root/main/condition/orddrid");
- var oproomcd = model.getValue("/root/main/condition/oproomcd");
- var tab = model.getValue("/root/main/condition/tab"); //방별, 과별 선택 탭 by 박영우 20091223
-
- 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시 이전일 경우 조회 조건은 1달이상 조회되지 않도록 함.
- if(sCurrentTm < "1700"){
- var sSearchTerm = getDateInterval(fromdd, todd);
- if(sSearchTerm > 30){
- model.alert("근무시간에는 1달 이상 조회할 수 없습니다.");
- return;
- }
- }
- }
-
- model.setValue("/root/send/todd" , todd );
- model.setValue("/root/send/fromdd" , fromdd );
- model.setValue("/root/send/tab" , tab ); // 방별, 과별, 의사별 구분 추가 by 박영우 20091223
- model.setValue("/root/send/oproomcd" , oproomcd );
- model.setValue("/root/send/subdeptcd", subdeptcd);
- model.setValue("/root/send/orddrid" , orddrid );
- model.removeNodeSet("/root/main/fstopontimerateinfo/fstopontimeratelist");
- grd_fstopontimeratelst.refresh();
- if(submit("TRMCT00205")){
- }else{
- model.alert("온타임율 조회 시 서버 오류가 발생되었습니다.");
- return;
- }
- }
- /**
- * @group :
- * @ver : 2009-09-25 오후 4:59: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 박영우 20091223
-
- 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 박영우 20091223
- submit("TRMNO00104"); // 의사리스트 조회
- addComboItem("cmb_orddrid");
- }
- }
- /**
- * @group :
- * @ver : 2009-12-23 오전 11:15: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 박영우 20091223
- model.removenodeset("/root/main/fstopontimerateinfo");
- model.setValue("/root/main/condition/oproomcd", "");
- model.setValue("/root/main/condition/subdeptcd", "");
- model.setValue("/root/main/condition/orddrid", "");
- caption11.visible = true;
- cmb_oproom.visible = true;
- caption14.visible = false;
- cmb_subdept.visible = false;
- caption5.visible = false;
- cmb_orddrid.visible = false;
- grd_fstopontimeratelst.colHidden(grd_fstopontimeratelst.colref("oproomnm"))=false;
- grd_fstopontimeratelst.colHidden(grd_fstopontimeratelst.colref("deptengabbr"))=true;
- grd_fstopontimeratelst.colHidden(grd_fstopontimeratelst.colref("perfdrnm"))=true;
- model.refresh();
- }else if(sTab == "E"){ //과별 추가 by 박영우 20091216
- //combo변경시 그리드, 과별, 시간 재조정 by 박영우 20091223
- model.removenodeset("/root/main/fstopontimerateinfo");
- model.setValue("/root/main/condition/oproomcd", "");
- model.setValue("/root/main/condition/subdeptcd", "");
- model.setValue("/root/main/condition/orddrid", "");
- caption11.visible = false;
- cmb_oproom.visible = false;
- caption14.visible = true;
- cmb_subdept.visible = true;
- caption5.visible = false;
- cmb_orddrid.visible = false;
- grd_fstopontimeratelst.colHidden(grd_fstopontimeratelst.colref("oproomnm"))=true;
- grd_fstopontimeratelst.colHidden(grd_fstopontimeratelst.colref("deptengabbr"))=false;
- grd_fstopontimeratelst.colHidden(grd_fstopontimeratelst.colref("perfdrnm"))=true;
- model.refresh();
- }else if(sTab == "D"){
- //combo변경시 그리드, 과별, 의사별, 시간 재조정 by 박영우 20091223
- model.removenodeset("/root/main/fstopontimerateinfo");
- model.setValue("/root/main/condition/oproomcd", "");
- model.setValue("/root/main/condition/subdeptcd", "");
- model.setValue("/root/main/condition/orddrid", "");
- caption11.visible = false;
- cmb_oproom.visible = false;
- caption14.visible = true;
- cmb_subdept.visible = true;
- caption5.visible = true;
- cmb_orddrid.visible = true;
-
- grd_fstopontimeratelst.colHidden(grd_fstopontimeratelst.colref("oproomnm"))=true;
- grd_fstopontimeratelst.colHidden(grd_fstopontimeratelst.colref("deptengabbr"))=false;
- grd_fstopontimeratelst.colHidden(grd_fstopontimeratelst.colref("perfdrnm"))=false;
- model.refresh();
- }
- }
- /**
- * @group :
- * @ver : 2009-09-25 오후 4:59:50
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : Excel 저장 버튼 클릭 시
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fOnClickExcelBtn(){
- var tab = model.getValue("/root/main/condition/tab");
- var title = "";
- var fileName = "";
-
- if(tab == "R") {
- title = "ONTIME시작율(방별)_"+getCurrentDate();
- fileName = window.fileDialog("save", ",", false, title, "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
- } else if(tab == "E") {
- title = "ONTIME시작율(과별)_"+getCurrentDate();
- fileName = window.fileDialog("save", ",", false, title, "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
- } else {
- title = "ONTIME시작율(의사별)_"+getCurrentDate();
- fileName = window.fileDialog("save", ",", false, title, "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
- }
-
- if (fileName != "" && fileName != null){
- grd_fstopontimeratelst.saveExcel(fileName, "sheetname: "+title+"; colhiddenextend: false; rowhiddenextend: true;");
-
- var s = fileName.lastIndexOf("\\");
- var fileName=fileName.substring(s+1);
-
- var rmsg = messageBox("저장된 Excel을", "Q004");
- if( rmsg == 6 ){
- window.exec("excel.exe", fileName);
- }
- }
- // fileName = window.fileDialog("save", ",", false, "첫수술ONTIME시작율_"+getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
- // if (fileName != "" && fileName != null) {
- // grd_fstopontimeratelst.saveExcel(fileName, "SheetName", true, true, "", "", false);
- // }
- }
- /**
- * @group :
- * @ver : 2009-12-23 오전 11:36:47
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 수술방 정보 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fGetOproomList(){
- model.setValue("/root/send/fromdd" , getCurrentDate() );
- //현재일자에 유효한 수술방을 조회한다.
- submit("TRMCT00207");
- addComboItem("cmb_oproom");
- }
|