123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356 |
- /***************************************************************************************************************************************************
- * create : 2009.01.14
- * author : dhkim
- * desc : 특수주사실 통합통계
- *
- ***************************************************************************************************************************************************/
-
-
-
- /*
- * create : 20090114
- * author : dhkim
- * desc : 초기화
- */
- function fInit(){
-
- //model.removenode('/root/cond');
- model.makeValue('/root/cond/yyyy', getCurrentDate().substring(0, 4));
-
- //default 항암치료시간통계
- model.makeValue('/root/cond/swflag', '1');
- model.toggle("case1");
-
- model.setValue(ipt_fromdd.attribute("ref"), getCurrentDate());
- model.setValue(ipt_todd.attribute("ref"), getCurrentDate());
-
- model.setValue(ipt_srchfromdd.attribute("ref"), getCurrentDate());
- model.setValue(ipt_srchtodd.attribute("ref"), getCurrentDate());
-
-
- ipt_stddd.refresh();
- ipt_fromdd.refresh();
- ipt_todd.refresh();
-
- ipt_srchfromdd.refresh();
- ipt_srchtodd.refresh();
-
- fSearch();
- }
-
- /*
- * create : 20090114
- * author : dhkim
- * desc : 항암치료시간통계 조회
- */
- function fSearchChemoTime(){
-
- var yyyy = model.getValue('/root/cond/yyyy');
- if(yyyy == null || yyyy == ''){
- yyyy = getCurrentDate().substring(0, 4);
- model.setValue('/root/cond/yyyy', yyyy);
- model.refresh();
- }
-
- model.removenode('/root/main/chemotimeinfo');
- model.makenode('/root/main/chemotimeinfo');
-
- model.removenode('/root/send');
- model.makeValue('/root/send/yyyy', yyyy);
- model.refresh();
-
- if(!submit('TRSNW00301')){
- messageBox('항암치료 시간 통계 조회를 실패하였습니다.', 'E999');
- }
- }
-
- /*
- * create : 20090114
- * author : dhkim
- * desc : 임상과별통계 조회
- */
- function fSearchDeptGrp(){
-
- var yyyy = model.getValue('/root/cond/yyyy');
- if(yyyy == null || yyyy == ''){
- yyyy = getCurrentDate().substring(0, 4);
- model.setValue('/root/cond/yyyy', yyyy);
- model.refresh();
- }
-
- model.removenode('/root/main/deptgrpinfo');
- model.makenode('/root/main/deptgrpinfo');
-
- model.removenode('/root/send');
- model.makeValue('/root/send/yyyy', yyyy);
- model.refresh();
-
- if(!submit('TRSNW00302')){
- messageBox('임상과별 이용 통계 조회를 실패하였습니다.', 'E999');
- }
-
- }
-
- /*
- * create : 20090114
- * author : dhkim
- * desc : 요일별통계 조회
- */
- function fSearchDayGrp(){
-
- var yyyy = model.getValue('/root/cond/yyyy');
- if(yyyy == null || yyyy == ''){
- yyyy = getCurrentDate().substring(0, 4);
- model.setValue('/root/cond/yyyy', yyyy);
- model.refresh();
- }
-
- model.removenode('/root/main/daygrpinfo');
- model.makenode('/root/main/daygrpinfo');
-
- model.removenode('/root/send');
- model.makeValue('/root/send/yyyy', yyyy);
- model.refresh();
-
- if(!submit('TRSNW00303')){
- messageBox('요일별 통계 조회를 실패하였습니다.', 'E999');
- }
- }
-
-
-
- /*
- * create : 20090115
- * author : dhkim
- * desc : 조회조건 작년으로 이동
- */
- function fMovePreYear(){
-
- var yyyy = model.getValue('/root/cond/yyyy');
- if(yyyy == null || yyyy == ''){
- yyyy = getCurrentDate().substring(0, 4);
- model.setValue('/root/cond/yyyy', yyyy);
- model.refresh();
- }
-
-
- yyyy = parseInt(yyyy) - 1;
- model.setValue('/root/cond/yyyy', yyyy);
- model.refresh();
-
- fSearch();
-
- }
-
-
-
- /*
- * create : 20090115
- * author : dhkim
- * desc : 조회조건 내년으로 이동
- */
- function fMoveNextYear(){
-
- var yyyy = model.getValue('/root/cond/yyyy');
- if(yyyy == null || yyyy == ''){
- yyyy = getCurrentDate().substring(0, 4);
- model.setValue('/root/cond/yyyy', yyyy);
- model.refresh();
- }
-
-
- yyyy = parseInt(yyyy) + 1;
- model.setValue('/root/cond/yyyy', yyyy);
- model.refresh();
-
- fSearch();
- }
-
- /*
- * create : 20090115
- * author : dhkim
- * desc : 탭별 조회
- */
- function fSearch(){
- fSearchChemoTime();
- fSearchDeptGrp();
- fSearchDayGrp();
- fSearchDayPatCnt();
- fSearchOpRatioInfo();
-
- //var swflag = model.getValue('/root/cond/swflag');
- //if(swflag == '1'){
- // fSearchChemoTime();
- //}else if(swflag == '2'){
- // fSearchDeptGrp();
- //}else if(swflag == '3'){
- // fSearchDayGrp();
- //}
-
- }
-
- function fSearchDayPatCnt() {
- model.copyNode("/root/send", "/root/cond");
-
- submit("TRSNW00304");
- }
- function fSearchOpRatioInfo() {
- model.makeNode("/root/send/reqdata");
- model.copyNode("/root/send/reqdata", "/root/cond");
-
- submit("TRSNW00305");
- }
-
- /**
- * @group :
- * @ver :
- * @by : 김기용
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드 별 엑셀저장
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function saveExcelAll(){
- var paramLen = saveExcelAll.arguments.length;
- // 마지막 인자가 Boolean일 경우 처리
- var extendsCaptionBool;
- if( typeof(saveExcelAll.arguments[paramLen - 1]) == "boolean" ) {
- extendsCaptionBool = saveExcelAll.arguments[paramLen - 1];
- paramLen = paramLen - 1;
- }
- else{
- extendsCaptionBool = false;
- }
- var tmpParamArray = new Array();
- if( extendsCaptionBool ) {
- for( var i = 0; i < paramLen; i++ ) {
- tmpParamArray[i] = saveExcelAll.arguments[i];
- }
- saveExcelAllWithCaption(tmpParamArray);
- }
- else{
- for( var i = 0; i < paramLen; i++ ) {
- tmpParamArray[i] = saveExcelAll.arguments[i];
- }
- saveExcelAllWithNotCaption(tmpParamArray);
- }
- }
- function saveExcelAllWithCaption( sheetArray ) {
- // alert(gridCaptionArray);
- var fileName = window.fileDialog("save", ",", false, "excel", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
- if( fileName == "" )
- return;
- // var sheetArray = new Array("grd_bizprescondstats|업무현황", "grd_patprescondstats|환자현황", "grd_hdstatsinfo|혈액투석현황", "grd_pdstatsinfo|복막투석현황", "grd_pdbizstatsinfo|복막투석업무현황");
- var sheetArrayLen = sheetArray.length;
- var gridId;
- var gridObj;
- for( var i = 0; i < sheetArray.length; i++ ) {
- gridId = sheetArray[i].split("|")[0];
- gridObj = document.all.item(gridId);
- // saveText() 함수는 Caption저장이 불가능 하여 SaveExcel()을 이용한다.
- gridObj.saveExcel("C:\\Temp\\tmp_TFExcel_" + i +".xls");
- }
- // excel application 실행함
- tfexcel.launchnewinstance(0);
- //실행된 excel application에서 새로운 workbook을 생성
- tfexcel.createworkbook();
- tfexcel.activatesheet(1);
- var sheetName;
- var nResult;
- for( var i = 0; i < sheetArrayLen; i++ )
- {
- sheetName = sheetArray[i].split("|")[1];
- if( i > 1 ) {
- nResult = tfexcel.activatesheet(i+1);
- tfexcel.sheetname(i+1) = sheetName;
- }
- else {
- nResult = tfexcel.addsheet(i+1, sheetName);
- }
- if( nResult < 0 ) {
- messageBox(sheetName + " 저장을", "E009");
- // alert(sheetName + " 오류발생");
- return;
- }
- tfexcel.loadCSV("C:\\Temp\\tmp_TFExcel_" + i + ".xls");
- }
- // tfexcel.loadCSV("C:\\Temp\\tmp_TFExcel.xls");
- //workbook을 저장.
- tfexcel.save(fileName);
- //excel application을 종료. excel application 생성 후 반드시 close해야함.
- tfexcel.close();
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- for( var i = 0; i < sheetArrayLen; i++ ) {
- fso.DeleteFile("C:\\Temp\\tmp_TFExcel_" + i + ".xls");
- }
- var rmsg = messageBox("저장된 Excel을", "Q004");
- // var rmsg = window.alert("저장된 Excel을 실행하시겠습니까?", "알림", 36);
- if( rmsg == 6 )
- window.exec("excel.exe", '\"' + fileName + '\"');
- }
-
- function fShowCntrl() {
- var swflag = model.getValue("/root/cond/swflag");
-
- if(swflag == "4") {
- group3.visible = true;
- group1.visible = false;
- group4.visible = false;
- } else if(swflag == "5") {
- group3.visible = false;
- group1.visible = false;
- group4.visible = true;
- } else {
- group3.visible = false;
- group1.visible = true;
- group4.visible = false;
- }
- }
- function fShowCtrl2() {
- var val = rdo_srchflag.value;
-
- if(val == "1") {
- ipt_srchfromdd.visible = true;
- ipt_srchtodd.visible = true;
- cap_bar.visible = true;
- ipt_srchmm.visible = false;
- ipt_srchyy.visible = false;
-
- } else if(val == "2") {
- ipt_srchfromdd.visible = false;
- ipt_srchtodd.visible = false;
- ipt_srchmm.visible = true;
- ipt_srchyy.visible = false;
- cap_bar.visible = false;
- } else if(val == "3") {
- ipt_srchfromdd.visible = false;
- ipt_srchtodd.visible = false;
- ipt_srchmm.visible = false;
- ipt_srchyy.visible = true;
- cap_bar.visible = false;
- }
- }
|