123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453 |
- /*
-
- 적출물리스트관리(SMMNP00310.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- */
- var xExtListPath = "/root/main/extinfo/extlist";
- var sFlag = "c";
- /**
- * @group :
- * @ver : 2008.07.01
- * @by : dhkim
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 화면초기화
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInit(){
- //인스턴스초기화
- model.removenode('/root/send');
- model.removenode('/root/hidden');
- model.removenode('/root/main/extinfo');
- model.removenode('/root/cond');
-
- model.makenode('/root/send');
- model.makenode('/root/hidden');
- model.makenode('/root/main/extinfo');
- model.makenode('/root/cond/fromdd');
- model.makenode('/root/cond/todd');
- model.makenode('/root/cond/rdocond');
-
-
- //조회조건 초기화
- model.setValue('/root/cond/fromdd', getCurrentDate());
- model.setValue('/root/cond/todd', getCurrentDate());
- model.setValue('/root/main/ipt_extinfo/remvdd', getCurrentDate());
- model.setValue('/root/main/ipt_extinfo/checknurid', getUserInfo("userid"));
- model.setValue('/root/cond/rdocond', sFlag);
-
- //**공통코드 가져오기**//
- zbcfGetCodeList( new Array ( "M0194" // 감염성 질환
- )
- , new Array ( "/root/init/M0194list" // 감염성 질환
- )
- );
- tbGetBscdList( new Array("S02", "S03"),
- new Array("/root/init/DisplayData", // S02 간호사
- "/root/init/DisplayData" // S03 수술방
- )
- );
-
- //수술실간호사리스트 조회(확인자콤보)
- fGetOpNrList();
-
- //화면 버튼 설정
- fValueChangedInfectRdo(sFlag);
-
- grd_extlist.fixedcellcheckbox(0, grd_extlist.colRef("chk")) = true;
- grd_extlist.fixedcellischeck(0, grd_extlist.colRef("chk")) = true;
- fSearch();
-
- }
- /**
- * @group :
- * @ver : 2008.07.02
- * @by : dhkim
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 수술실간호사리스트조회
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fGetOpNrList(){
-
- model.removenode('/root/send');
- model.makeValue('/root/send/reqdata/deptflag', '015');
- model.makeValue('/root/send/reqdata/searchdd', getCurrentDate());
- if(!submit('TRAVT00132')){
- messageBox('초기화를', 'E009');
- return;
- }
-
- }
- /**
- * @group :
- * @ver : 2008.07.01
- * @by : dhkim
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 회복환자조회
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSearch(){
-
-
- var fromdd = model.getValue('/root/cond/fromdd');
- var todd = model.getValue('/root/cond/todd');
- var rdocond = model.getValue('/root/cond/rdocond');
-
- if(fromdd == null || fromdd == ''){
- fromdd = getCurrentDate();
- }
-
- if(todd == null || todd == ''){
- todd = getCurrentDate();
- }
-
- model.setValue('/root/cond/fromdd', fromdd);
- model.setValue('/root/cond/todd', todd);
-
- model.makenode('/root/main/extinfo');
- model.setValue("/root/main/totextinfo/totextcrcnt", "");
- model.setValue("/root/main/totextinfo/totextcrweig", "");
- model.reset('/root/main/ipt_extinfo');
-
- model.removenode('/root/send/reqdata');
- model.makeValue('/root/send/reqdata/fromdd', fromdd);
- model.makeValue('/root/send/reqdata/todd', todd);
- model.makeValue('/root/send/reqdata/rdocond', rdocond);
-
- if(!submit('TRAVT00131', false)){
- messageBox('적출물리스트조회를', 'E009');
- return;
- }
- if(getNodesetCount("/root/main/extinfo/extlist") < 1){
- btn_print.disabled = true;
- btn_saveexcel.disabled = true;
- btn_save.disabled = true;
- btn_cncl.disabled = true;
- ipt_remvdd.disabled = true;
- ipt_remvnm.disabled = true;
- cmb_checknurid.disabled = true;
- model.setValue("/root/main/totextinfo/totextcrcnt", 0);
- model.setValue("/root/main/totextinfo/totextcrweig", 0);
- }else{
- btn_print.disabled = false;
- btn_saveexcel.disabled = false;
- btn_save.disabled = false;
- btn_cncl.disabled = false;
- ipt_remvdd.disabled = false;
- ipt_remvnm.disabled = false;
- cmb_checknurid.disabled = false;
- totalCnt = 0;
- totalWeig = 0;
-
- for(var i = 1 ; i <= getNodesetCount("/root/main/extinfo/extlist") ; i++){
- infectInfo = "";
- infectArray = model.getValue("/root/main/extinfo/extlist["+i+"]/infectflag").split(" ");
- for(var j = 1 ; j <= getNodesetCount("/root/init/M0194list/M0194") ; j++){
- for(var k = 0 ; k <= infectArray[k] ; k++){
- if(infectArray[k] == model.getValue("/root/init/M0194list/M0194["+j+"]/cdid")){
- if(infectInfo == ""){
- infectInfo = model.getValue("/root/init/M0194list/M0194["+j+"]/cdnm");
- }else{
- infectInfo += ", " + model.getValue("/root/init/M0194list/M0194["+j+"]/cdnm");
- }
- }
- }
- }
- //감염정보 입력
- model.setValue("/root/main/extinfo/extlist["+i+"]/infectflag", infectInfo);
-
- //총 개수, 총 중량 합계
- if(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrcnt").isNumber()== true){
- totalCnt += eval(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrcnt"));
- }
- if(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrweig").isNumber() == true ){
- totalWeig += eval(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrweig"));
- }
- }
-
- //총 개수, 총 중량 입력
- model.setValue("/root/main/totextinfo/totextcrcnt", totalCnt);
- model.setValue("/root/main/totextinfo/totextcrweig", totalWeig);
- }
-
- model.refresh();
- }
- /**
- * @group :
- * @ver : 2008.07.01
- * @by : dhkim
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 적출물리스트 수거일자, 수거자, 확인자 수정
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSave(){
- if(fIsValid()){
-
- model.removenode('/root/send');
- model.makeValue('/root/send/reqdata', grd_extlist.getUpdateDataAll('i'));
-
- if(!submit('TXAVT00131')){
- messageBox('적출물정보 수정을', 'E009');
- return;
- }else{
- fSearch();
- }
- }
- }
- /**
- * @group :
- * @ver : 2008.07.01
- * @by : dhkim
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 적출물정보 수정하기전 유효성체크
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fIsValid(){
- if(grd_extlist.findRow("Y", 0, grd_extlist.colRef("chk")) < 1){
- messageBox("수정 또는 저장할 내역을 선택하십시요","I");
- return;
- }
-
- //체크한 환자의 적출물은 입력된 내역으로 한꺼번에 반영하도록 한다.
- //입력받는 내역 : 수거일자, 수거자, 확인자
- var chk;
- var remvdd = model.getValue('/root/main/ipt_extinfo/remvdd'); //입력받은 수거일자
- var remvnm = model.getValue('/root/main/ipt_extinfo/remvnm'); //입력받은 수거자
- var checknurid = model.getValue('/root/main/ipt_extinfo/checknurid'); //입력받은 확인자
-
- if(remvdd == null || remvdd == ''){
- messageBox('수거일자를', 'C001');
- return false;
- }
- if(remvnm == null || remvnm == ''){
- messageBox('수거자를', 'C001');
- return false;
- }
- if(checknurid == null || checknurid == ''){
- messageBox('확인자를', 'C002');
- return;
- }
-
- for(var i = 1; i <= getNodesetCount("/root/main/extinfo/extlist"); i++){
- chk = model.getValue('/root/main/extinfo/extlist[' + i +']/chk');
- if(chk == 'Y'){
- //체크된 환자에게 입력한 적출물 수거 정보를 세팅한다.
- model.setValue('/root/main/extinfo/extlist[' + i + ']/remvdd', remvdd);
- model.setValue('/root/main/extinfo/extlist[' + i + ']/remvnm', remvnm);
- model.setValue('/root/main/extinfo/extlist[' + i + ']/checknurid', checknurid);
- }
- }
-
- //model.refresh();
- return true;
- }
- /**
- * @group :
- * @ver : 2008.07.02
- * @by : dhkim
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : Excel파일로 저장
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSaveExcel(){
- var exceldd = getCurrentDate();
-
- if(rdo_rdocond.value == "b"){
- exceldd = ipt_fromdd.value;
- }
-
- var fileName = window.fileDialog("save", ",", false, "적출물리스트_"+exceldd, "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
- if (fileName != "") {
- grd_extlist.saveExcel(fileName, "SheetName", true, true, "", "", false);
- }
- }
- /**
- * @group :
- * @ver : 2008.07.02
- * @by : dhkim
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 미수거리스트 출력물 미리보기 실행
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fPrint(){
- if(grd_extlist.findRow("Y", 0, grd_extlist.colRef("chk")) < 1){
- messageBox("출력할 내역을 선택하십시요","I");
- return;
- }
- model.makenode("/root/prnt/extinfo");
- model.makenode("/root/prnt/totextinfo");
- totalCnt = 0;
- totalWeig = 0;
- prntyy = "";
- prntmm = "";
- prntdd = "";
-
- for(var i = 1; i <= getNodesetCount("/root/main/extinfo/extlist"); i++){
- chk = model.getValue('/root/main/extinfo/extlist[' + i +']/chk');
- if(chk == 'Y'){
- //체크된 정보 copy
- noderow = eval(getNodesetCount("/root/prnt/extinfo/extlist")) + 1;
- model.makenode("/root/prnt/extinfo/extlist["+noderow+"]");
- model.copyNode("/root/prnt/extinfo/extlist["+noderow+"]", "/root/main/extinfo/extlist["+ i +"]");
-
- //총 개수, 총 중량 합계
- if(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrcnt").isNumber()== true){
- totalCnt += eval(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrcnt"));
- }
- if(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrweig").isNumber() == true ){
- totalWeig += eval(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrweig"));
- }
- }
- }
-
- if(rdo_rdocond.value == "a"){
- prntdd = ipt_fromdd.value.substr(0,4) + "-" + ipt_fromdd.value.substr(4,2) + "-" + ipt_fromdd.value.substr(6,2) + " ~ "
- + ipt_todd.value.substr(0,4) + "-" + ipt_todd.value.substr(4,2) + "-" + ipt_todd.value.substr(6,2)
- }else if(rdo_rdocond.value == "b"){
- prntyy = ipt_fromdd.value.substr(0,4) + "년";
- prntmm = ipt_fromdd.value.substr(4,2) + "월";
- prntdd = ipt_fromdd.value.substr(6,2) + "일";
- }else if(rdo_rdocond.value == "c"){
- prntyy = ipt_remvdd.value.substr(0,4) + "년";
- prntmm = ipt_remvdd.value.substr(4,2) + "월";
- prntdd = ipt_remvdd.value.substr(6,2) + "일";
- }
-
- model.makeValue("/root/prnt/totextinfo/prntflag", rdo_rdocond.value);
- model.makeValue("/root/prnt/totextinfo/prntyy", prntyy);
- model.makeValue("/root/prnt/totextinfo/prntmm", prntmm);
- model.makeValue("/root/prnt/totextinfo/prntdd", prntdd);
- model.makeValue("/root/prnt/totextinfo/totextcrcnt", totalCnt);
- model.makeValue("/root/prnt/totextinfo/totextcrweig", totalWeig);
-
- exeReportPreview("RPAVT00130", "XMLSTR"); //미리보기
-
- model.removeNode("/root/prnt");
- }
- /**
- * @group :
- * @ver : 2008.07.02
- * @by : dhkim
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 수거구분 조회 정보 변경 시 이벤트
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fValueChangedInfectRdo(pParam){
- switch(pParam){
- case "a":
- caption2.visible = true; //조회일자 caption
- ipt_fromdd.visible = true; //from 일자
- caption7.visible = true; //~ caption
- ipt_todd.visible = true; //to 일자
- btn_print.visible = false; //출력버튼
- btn_cncl.visible = false; //수거취소버튼
- break;
- case "b":
- caption2.visible = true; //조회일자 caption
- ipt_fromdd.visible = true; //from 일자
- caption7.visible = false; //~ caption
- ipt_todd.visible = false; //to 일자
- btn_print.visible = true; //출력버튼
- btn_cncl.visible = true; //수거취소버튼
- break;
- case "c":
- caption2.visible = false; //조회일자 caption
- ipt_fromdd.visible = false; //from 일자
- caption7.visible = false; //~ caption
- ipt_todd.visible = false; //to 일자
- btn_print.visible = true; //출력버튼
- btn_cncl.visible = false; //수거취소버튼
- break;
- }
- }
- /**
- * @group :
- * @ver : 2009.01.29
- * @by : dhkim
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 수거취소 버튼 이벤트
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCncl(){
-
- if(grd_extlist.findRow("Y", 0, grd_extlist.colRef("chk")) < 1){
- messageBox("수거 취소할 내역을 선택하십시요.","I");
- return;
- }
- model.removenode('/root/send');
- model.makeValue('/root/send/reqdata', grd_extlist.getUpdateDataAll('u'));
-
- if(!submit('TXAVT00131')){
- messageBox('적출물정보 수정을', 'E009');
- return;
- }else{
- fSearch();
- }
- }
|