123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263 |
- /********************************************************************************
- * @group : APU 업무현황
- * @ver : 2008.09.23
- * @by : dhkim
- * @desc : 성분헌혈실 업무현황 조회
- *********************************************************************************/
- var curYYYYMMStr = getCurrentDate().substring(0, 6);
- /**
- * create : 2008.09.23
- * desc : 화면을 초기화한다.
- */
- function fInit(){
-
- //노드 초기화
- model.removenode('/root/cond');
- model.removenode('/root/main/workinfo');
- model.removenode('/root/hidden/deptinfo');
- model.removenode('/root/hidden/wardinfo');
- model.removenode('/root/hidden/drinfo');
-
- //노드 재생성
- model.makenode('/root/cond');
- model.makenode('/root/main/workinfo');
- model.makenode('/root/hidden/deptinfo');
- model.makenode('/root/hidden/wardinfo');
- model.makenode('/root/hidden/drinfo');
-
- var yyyymm = curYYYYMMStr; //default
- var ioflag = 'A'; //default
-
- fShowCondition('cap_ward', 'cmb_ward', 'cap_dept', 'cmb_dept', 'cap_dr', 'cmb_dr', ioflag);//조건 hidden/visible
-
- //진료과, 병동리스트조회
- fGetDeptInfo('O', yyyymm, '/root/send', '/root/hidden/outdeptinfo');//외래진료과
- fGetDeptInfo('I', yyyymm, '/root/send', '/root/hidden/indeptinfo'); //입원진료과
- fGetDeptInfo('W', yyyymm, '/root/send', '/root/hidden/wardinfo'); //병동
-
-
- //조회조건 default 세팅
- //model.makeValue('/root/cond/yyyymm', curYYYYMMStr);//조회년월 : 현재년월
-
- //20081230
- model.makeValue('/root/cond/fromdd', curYYYYMMStr);//조회시작년월 : 현재년월
- model.makeValue('/root/cond/todd', curYYYYMMStr);//조회종료년월 : 현재년월
-
- //20090902 dhkim 비교기간 추가
- model.makeValue('/root/cond/compfdd', curYYYYMMStr);//비교시작년월 : 현재년월
- model.makeValue('/root/cond/comptdd', curYYYYMMStr);//비교종료년월 : 현재년월
-
- model.makeValue('/root/cond/ioflag', 'A');//외래입원구분 : 전체
- model.makeValue('/root/cond/deptcd', '');//진료과 : 전체
- model.makeValue('/root/cond/wardcd', '');//병동 : 전체
- model.makeValue('/root/cond/drid', '');//주치의 : 전체
-
- model.refresh();
- }
- /**
- * create : 2008.09.23
- * desc : 성분헌혈실 업무현황 조회
- */
- function fSearchApuWorkList(){
-
- //조회조건
- //var stdym = model.getValue('/root/cond/yyyymm');
-
- //20081230
- var fromdd = model.getValue('/root/cond/fromdd');
- var todd = model.getValue('/root/cond/todd');
-
- var ioflag = model.getValue('/root/cond/ioflag');
- var deptcd = model.getValue('/root/cond/deptcd');
- var drid = model.getValue('/root/cond/drid');
- var wardcd = model.getValue('/root/cond/wardcd');
-
- //20090902 dhkim 비교기간 추가
- var compfdd = model.getValue('/root/cond/compfdd');
- var comptdd = model.getValue('/root/cond/comptdd');
-
- //조회조건 널처리
- /*
- if(stdym == null || stdym == ''){
- stdym = curYYYYMMStr;
- }
- */
-
- //20081230
- if(fromdd == null || fromdd == ''){
- fromdd = curYYYYMMStr;
- }
- if(todd == null || todd == ''){
- todd = curYYYYMMStr;
- }
-
- if(ioflag == null || ioflag == ''){
- ioflag = 'A';
- }
- if(deptcd == null){
- deptcd = '';
- }
- if(drid == null){
- drid = '';
- }
- if(wardcd == null){
- wardcd == '';
- }
- if(ioflag == 'O'){
- if(wardcd != null || wardcd != ''){
- wardcd == '';
- }
- }
-
- if(ioflag == 'A'){
- deptcd = '';
- drid = '';
- wardcd = '';
- }
-
- if(deptcd == ''){
- drid = '';
- }
-
- //20090902 dhkim 비교기간 추가
- if(compfdd == null || compfdd == ''){
- compfdd = curYYYYMMStr;
- }
- if(comptdd == null || comptdd == ''){
- comptdd = curYYYYMMStr;
- }
-
- //20090902 dhkim 검색기간 최대 12개월로 blocking
- if(todd < fromdd){
- messageBox('검색시작년월이 검색종료년월보다 과거일자여야 합니다.', 'E999');
- return;
- }
-
- var dut = todd - fromdd;
- if(dut > 99){
- messageBox('검색기간은 최대 12개월까지만 조회가능합니다.', 'E999');
- return;
- }
-
- //20090902 dhkim 검색기간 최대 12개월로 blocking
- if(comptdd < compfdd){
- messageBox('비교시작년월이 비교종료년월보다 과거일자여야 합니다.', 'E999');
- return;
- }
-
- if(compfdd > todd){
- messageBox('비교시작년월이 검색종료년월보다 과거일자여야 합니다.', 'E999');
- return;
- }
-
- //20090902 dhkim 기간에 해당되는 월컬럼이 조회되도록 수정
-
-
- /**
- //20081230
- //같은 년도의 데이터만 조회가능
- if(fromdd.substring(0, 4) != todd.substring(0, 4)){
- messageBox('조회 시작년도와 종료년도를 동일하게 적용해 주십시오', 'E999');
- return;
- }
- */
-
-
- //request전 parameter send처리
- model.removenode('/root/send');
- //model.makeValue('/root/send/stdym', stdym + '%');
-
- //20081230
- model.makeValue('/root/send/fromdd', fromdd + '01');
- model.makeValue('/root/send/todd', todd + '31');
-
- model.makeValue('/root/send/ioflag', ioflag);
- model.makeValue('/root/send/deptcd', deptcd);
- model.makeValue('/root/send/drid', drid);
- model.makeValue('/root/send/wardcd', wardcd);
- model.makeValue('/root/send/eqapuflag', '1');//장비별/혈액불출별
-
- //20090902 dhkim 비교기간 추가
- model.makeValue('/root/send/compfdd', compfdd + '01');
- model.makeValue('/root/send/comptdd', comptdd + '31');
-
- if(submit('TRSNA00103')){
- //화면display변경
- //var lastdd = getLastDay(todd.substring(0, 4), todd.substring(4, 6));
- //fShowDays(datagrid1, datagrid1.cols, lastdd, 3);
- //fShowTotal(datagrid1, datagrid1.cols, 3);
-
- //20090903 dhkim 검색기간에 맞게 그리드 월을 재정렬
- fSortColumn();
-
- //20081230
- fShowTotal(datagrid1, datagrid1.cols, 3);
- }
-
- }
- var cnt = 1;
- //20090903 dhkim 그리스 월컬럼 재정렬
- function fSortColumn(){
- for(var i = 1; i <= 14; i++){
- datagrid1.colHidden(i) = false;
- }
-
- var fromdd = model.getValue('/root/cond/fromdd');
- var todd = model.getValue('/root/cond/todd');
- var frommm = 0;
- var tomm = 0;
- var capstr = '구분^세부항목^';
-
- if(fromdd != null && fromdd != ''){
- frommm = fromdd.substring(4, 6);
- }
- if(todd != null && todd != ''){
- tomm = todd.substring(4, 6);
- }
-
- var colno = 3;
- for(var i = 1; i <= 12; i++){
-
- if(frommm > 12){
- frommm = '01';
- }
-
- if(frommm < 10){
- frommm = '0' + Number(frommm);
- }
-
-
- datagrid1.colAttribute(colno, 'ref') = 'd' + frommm;
- capstr += frommm + '월^';
-
- colno++;
- frommm++;
- }
-
- capstr += 'Total^증감율';
- datagrid1.caption = capstr;
-
- var dstr;
- var idx = 0;
- for(var i = 3; i <=14; i++){
- dstr = Number(datagrid1.colAttribute(i, 'ref').substring(1));
- if(dstr == tomm){
- idx = i+1;
- }
- }
-
- for(var i = idx; i <= 14; i++){
- datagrid1.colHidden(i) = true;
- }
-
- datagrid1.rebuild();
- }
|