123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395 |
- <?xml version="1.0" encoding="utf-8"?>
- <Script type="xscript4.0"><![CDATA[/***************************************************************************************************************************************************
- * create : 2009.01.14
- * author : dhkim
- * desc : 특수주사실 통합통계
- *
- ***************************************************************************************************************************************************/
-
-
-
- /*
- * create : 20090114
- * author : dhkim
- * desc : 초기화
- */
- function fInit(){
-
- ds_cond.setColumn(0, "yyyy", utlf_getCurrentDate().substring(0, 4));
-
- //default 항암치료시간통계
- ds_cond.setColumn(0, "swflag", '1');
-
- ds_cond.setColumn(0, "fromdd", utlf_getCurrentDate());
- ds_cond.setColumn(0, "todd", utlf_getCurrentDate());
-
- ds_cond.setColumn(0, "srchfromdd", utlf_getCurrentDate());
- ds_cond.setColumn(0, "srchtodd", utlf_getCurrentDate());
-
- fSearch();
- }
-
- /*
- * create : 20090114
- * author : dhkim
- * desc : 항암치료시간통계 조회
- */
- function fSearchChemoTime(){
-
- var yyyy = ds_cond.getColumn(0, "yyyy");
- if( utlf_isNull(yyyy) ){
- yyyy = utlf_getCurrentDate().substring(0, 4);
- ds_cond.setColumn(0, "yyyy", yyyy);
- }
-
- ds_main_chemotimeinfo_chemotimelist.clearData();
-
- ds_send.setColumn(0, "yyyy", yyyy);
-
- var oParam = {};
- oParam.id = "TRSNW00301";
- oParam.service = "stsenrapp.StsEnrInjSpecialRoomMngt";
- oParam.method = "reqGetChemoTime";
- oParam.inds = "req=ds_send";
- oParam.outds = "ds_main_chemotimeinfo_chemotimelist=chemotimelist";
- oParam.async = false;
- oParam.callback = "cf_TRSNW00301";
- tranf_submit(oParam);
-
- if( arErrorCode.pop("TRSNW00301") < 0 ){
- sysf_messageBox('항암치료 시간 통계 조회를 실패하였습니다.', 'E999');
- }
- }
-
- function cf_TRSNW00301(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
-
- /*
- * create : 20090114
- * author : dhkim
- * desc : 임상과별통계 조회
- */
- function fSearchDeptGrp(){
-
- var yyyy = ds_cond.getColumn(0, "yyyy");
- if( utlf_isNull(yyyy) ){
- yyyy = utlf_getCurrentDate().substring(0, 4);
- ds_cond.setColumn(0, "yyyy", yyyy);
- }
-
- ds_main_deptgrpinfo_deptgrplist.clearData();
-
- ds_send.setColumn(0, "yyyy", yyyy);
-
- var oParam = {};
- oParam.id = "TRSNW00302";
- oParam.service = "stsenrapp.StsEnrInjSpecialRoomMngt";
- oParam.method = "reqGetDeptGrp";
- oParam.inds = "req=ds_send";
- oParam.outds = "ds_main_deptgrpinfo_deptgrplist=deptgrplist";
- oParam.async = false;
- oParam.callback = "cf_TRSNW00302";
- tranf_submit(oParam);
-
- if( arErrorCode.pop("TRSNW00302") < 0 ){
- sysf_messageBox('임상과별 이용 통계 조회를 실패하였습니다.', 'E999');
- }
-
- }
-
- function cf_TRSNW00302(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
-
- /*
- * create : 20090114
- * author : dhkim
- * desc : 요일별통계 조회
- */
- function fSearchDayGrp(){
-
- var yyyy = ds_cond.getColumn(0, "yyyy");
- if( utlf_isNull(yyyy) ){
- yyyy = utlf_getCurrentDate().substring(0, 4);
- ds_cond.setColumn(0, "yyyy", yyyy);
- }
-
- ds_main_daygrpinfo_daygrplist.clearData();
-
- ds_send.setColumn(0, "yyyy", yyyy);
-
- var oParam = {};
- oParam.id = "TRSNW00303";
- oParam.service = "stsenrapp.StsEnrInjSpecialRoomMngt";
- oParam.method = "reqGetDayGrp";
- oParam.inds = "req=ds_send";
- oParam.outds = "ds_main_daygrpinfo_daygrplist=daygrplist";
- oParam.async = false;
- oParam.callback = "cf_TRSNW00303";
- tranf_submit(oParam);
-
- if( arErrorCode.pop("TRSNW00303") < 0 ){
- sysf_messageBox('요일별 통계 조회를 실패하였습니다.', 'E999');
- }
- }
-
- function cf_TRSNW00303(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
-
-
-
- /*
- * create : 20090115
- * author : dhkim
- * desc : 조회조건 작년으로 이동
- */
- function fMovePreYear(){
-
- var yyyy = ds_cond.getColumn(0, "yyyy");
- if( utlf_isNull(yyyy) ){
- yyyy = utlf_getCurrentDate().substring(0, 4);
- ds_cond.setColumn(0, "yyyy", yyyy);
- }
-
- yyyy = parseInt(yyyy) - 1;
- ds_cond.setColumn(0, "yyyy", yyyy);
-
- fSearch();
- }
-
-
-
- /*
- * create : 20090115
- * author : dhkim
- * desc : 조회조건 내년으로 이동
- */
- function fMoveNextYear(){
-
- var yyyy = ds_cond.getColumn(0, "yyyy");
- if( utlf_isNull(yyyy) ){
- yyyy = utlf_getCurrentDate().substring(0, 4);
- ds_cond.setColumn(0, "yyyy", yyyy);
- }
-
-
- yyyy = parseInt(yyyy) + 1;
- ds_cond.setColumn(0, "yyyy", yyyy);
-
- 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() {
- ds_send.copyRow(0, ds_cond, 0);
-
- var oParam = {};
- oParam.id = "TRSNW00304";
- oParam.service = "stsenrapp.StsEnrInjSpecialRoomMngt";
- oParam.method = "reqGetDayPatCntInfo";
- oParam.inds = "req=ds_send";
- oParam.outds = "ds_main_daypatcntinfo_daypatcntlist=daypatcntlist";
- oParam.async = false;
- //oParam.callback = "cf_TRSNW00304";
- tranf_submit(oParam);
- }
- function fSearchOpRatioInfo() {
- ds_send_reqdata.copyRow(0, ds_cond, 0);
-
- ds_send_reqdata.setColumn(0, "srchmm", utlf_transNullToEmpty(ds_send_reqdata.getColumn(0, "srchmm")).substr(0,6));
- ds_send_reqdata.setColumn(0, "srchyy", utlf_transNullToEmpty(ds_send_reqdata.getColumn(0, "srchyy")).substr(0,4));
-
- var oParam = {};
- oParam.id = "TRSNW00305";
- oParam.service = "stsenrapp.StsEnrInjSpecialRoomMngt";
- oParam.method = "reqGetRoomOpRatioInfo";
- oParam.inds = "req=ds_send_reqdata";
- oParam.outds = "ds_main_roomopratioinfo_roomopratiolist=roomopratiolist";
- oParam.async = false;
- //oParam.callback = "cf_TRSNW00305";
- tranf_submit(oParam);
- }
-
- /**
- * @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 ) {
- sysf_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 = sysf_messageBox("저장된 Excel을", "Q004");
- // var rmsg = window.alert("저장된 Excel을 실행하시겠습니까?", "알림", 36);
- if( rmsg == 6 )
- window.exec("excel.exe", '\"' + fileName + '\"');
- }
-
- function fShowCntrl() {
- var swflag = ds_cond.getColumn(0, "swflag");
-
- if(swflag == "4") {
- group2.group3.visible = true;
- group2.group1.visible = false;
- group2.group4.visible = false;
- } else if(swflag == "5") {
- group2.group3.visible = false;
- group2.group1.visible = false;
- group2.group4.visible = true;
- } else {
- group2.group3.visible = false;
- group2.group1.visible = true;
- group2.group4.visible = false;
- }
- }
- function fShowCtrl2() {
- var val = group2.group4.rdo_srchflag.value;
-
- if(val == "1") {
- group2.group4.ipt_srchfromdd.visible = true;
- group2.group4.ipt_srchtodd.visible = true;
- group2.group4.cap_bar.visible = true;
- group2.group4.ipt_srchmm.visible = false;
- group2.group4.ipt_srchyy.visible = false;
-
- } else if(val == "2") {
- group2.group4.ipt_srchfromdd.visible = false;
- group2.group4.ipt_srchtodd.visible = false;
- group2.group4.ipt_srchmm.visible = true;
- group2.group4.ipt_srchyy.visible = false;
- group2.group4.cap_bar.visible = false;
- } else if(val == "3") {
- group2.group4.ipt_srchfromdd.visible = false;
- group2.group4.ipt_srchtodd.visible = false;
- group2.group4.ipt_srchmm.visible = false;
- group2.group4.ipt_srchyy.visible = true;
- group2.group4.cap_bar.visible = false;
- }
- }
- ]]></Script>
|