123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785 |
- /**
- * 파 일 명 : SMADT30200.js
- * 설 명 : 마약향정처방관리 Javascriot
- * 설 계 자 : 김치국
- * 작 성 자 : 김치국
- * 수정이력 : 2015.04.22
- */
- var sNarc_Menu_Param = "";
- var sNarc_Dept_Param = "";
- var sSMADT30400_Fromdd = "";
- /**
- * 초기화
- */
- function fInit() {
-
- var instcd =getUserInfo("dutplceinstcd");
-
-
- grd_narclist.fixedcellcheckbox(0,1) = true;
-
- //화면구성용 파라미터
- sNarc_Menu_Param = getScreenMenuParameter(); // I: 입원 O:외래
-
- //sNarc_Menu_Param = "O";
- //상단에서 정보 조회
- var node = getGlobalVariable("paminfo");
- setCSVToNode("/root/temp/topinfo", node);
- if(sNarc_Menu_Param.length > 1){
- sNarc_Dept_Param = sNarc_Menu_Param.substr(1,sNarc_Menu_Param.length);
- sNarc_Menu_Param = sNarc_Menu_Param.substr(0,1);
- }
- // 화면구성
- //alert(opener.javascript.getParameter("Narc_Menu_Param"));
- if (sNarc_Menu_Param == "I") {
- model.setValue("/root/temp/srchinfo/srchioflag","I");
- } else if(sNarc_Menu_Param == "O"){
- model.setValue("/root/temp/srchinfo/srchioflag","O");
- } else {
- sNarc_Menu_Param = model.getAttribute("Narc_Menu_Param");
- if(sNarc_Menu_Param.length > 1){
- sNarc_Dept_Param = sNarc_Menu_Param.substr(2,sNarc_Menu_Param.length);
- sNarc_Menu_Param = sNarc_Menu_Param.substr(0,1);
- }
- if (sNarc_Menu_Param == "I") {
- model.setValue("/root/temp/srchinfo/srchioflag","I");
- } else if(sNarc_Menu_Param == "O"){
- model.setValue("/root/temp/srchinfo/srchioflag","O");
- } else {
- sNarc_Menu_Param = model.getValue("/root/temp/topinfo/list/ioflag");
- if (sNarc_Menu_Param == "I") {
- model.setValue("/root/temp/srchinfo/srchioflag","I");
- } else if(sNarc_Menu_Param == "O"){
- model.setValue("/root/temp/srchinfo/srchioflag","O");
- } else {
- model.setValue("/root/temp/srchinfo/srchioflag","I");
- }
- }
- }
-
-
- fChgIOFlag();
- model.makeValue("/root/hidden/narc_dept", sNarc_Dept_Param);
-
- //마취과, 내시경실 불출부서코드 조회
- var narc_dept = "";
- if(sNarc_Dept_Param != "") {
- submit("TRADT30407");
- narc_dept = model.getValue("/root/init/execdeptlist/dept/deptcd");
- }
-
-
- if(sNarc_Dept_Param == "op"){
- //마취과에서 연 팝업일경우 불출신청부서 셋팅 N002
- //model.setValue("/root/temp/srchinfo/drugdeptcd", "3073100000");
- model.setValue("/root/temp/srchinfo/drugdeptcd", narc_dept);
- } else if (sNarc_Dept_Param == "esop") {
- model.setValue("/root/temp/srchinfo/srchdrugdeptflag", "Y");
- cap_n003.value = model.getValue("/root/init/execdeptlist/dept/deptnm"); // 20100114_laboru
- //model.setValue("/root/temp/srchinfo/drugdeptcd", "2010302030");
- model.setValue("/root/temp/srchinfo/drugdeptcd", narc_dept);
-
- // 2011.03.22 pymi
- //내시경실 메뉴는 무조건 외래에 부서는 내시경 검사실로 세팅
- if(model.getValue("/root/temp/srchinfo/srchioflag") == "O") {
- model.setValue("/root/temp/srchinfo/srchdutplcecd", narc_dept);
- }
- // (e)
- }
-
-
- model.setAttribute("Narc_Menu_Param", "");
-
-
- //구분 초기화(전체)
- model.setValue("/root/temp/srchinfo/narcflag", "M");
- model.setValue("/root/temp/srchinfo/srchdrugkind", "I");
- model.setValue("/root/temp/srchinfo/drugflag", "I");
- // fChkIOTotal();
- model.setValue("/root/temp/srchinfo/narcstat", "T");
- // rdo_cncl.disabled = true;
- model.setValue("/root/temp/srchinfo/cnclstat", "");
- // rdo_rtn.disabled = true;
- model.setValue("/root/temp/srchinfo/rtnstat", "");
- model.setValue("/root/temp/srchinfo/narctypeflag", "T");
- model.setValue("/root/temp/srchinfo/srchioflag", "I");
- model.setValue("/root/temp/srchinfo/drugkind", "I");
- fChgIOFlag();
-
-
- //토글초기화
- //model.setValue("/root/temp/srchinfo/srchroot", "M");
- //model.toggle("case1");
-
-
- //조회날짜 초기화
- //model.setValue("/root/temp/srchinfo/fst_dd", getCurrentDate());
- //model.setValue("/root/temp/srchinfo/last_dd", getCurrentDate());
-
- //카덱스에서 시작일자를 넘겨줌_20090513_SMY
- sSMADT30400_Fromdd = model.getAttribute("SMADT30400_Fromdd");
- if(sSMADT30400_Fromdd != ""){
- model.setValue("/root/temp/srchinfo/fst_dd", sSMADT30400_Fromdd);
- }else{
- model.setValue("/root/temp/srchinfo/fst_dd", getCurrentDate());
-
- }
- model.setValue("/root/temp/srchinfo/last_dd", getCurrentDate());
-
- model.setAttribute("SMADT30400_Fromdd", "");
-
- //로그인 사용자 셋팅
- var userid = getUserId();
- model.setValue("/root/temp/srchinfo/srchid", userid);
- fChgUserID();
-
- fGetNarcData();
-
- //환자별 조회라면 체크 표시
- //fChkPatSearch(); // -- 오류 발생으로 인한 자동체크 기능 막음(간호 마약/항정약 처방관리 화면에서 쓰던 로직을 그대로 반영해서 발생 _2015.12.31_by.Shaun
- model.setValue("/root/temp/userinfo/userinfo/userdeptcd", getUserInfo("dutplcecd"));
- model.setValue("/root/temp/userinfo/userinfo/userdeptnm", getUserInfo("dutplcenm"));
-
- model.setValue("/root/temp/srchinfo/drugdeptcd", model.getValue("/root/temp/userinfo/userinfo/userdeptcd"));
- model.setValue("/root/temp/srchinfo/drugdeptnm", model.getValue("/root/temp/userinfo/userinfo/userdeptnm"));
-
- model.refresh();
- }
- /**
- * 병동변경시 병실 조회
- */
- function fSrchRoomCD(){
- model.setValue("/root/temp/srchinfo/srchpid", "");
- model.setValue("/root/temp/srchinfo/srchpatnm", "");
- model.setValue("/root/temp/srchinfo/srchroomcd", "");
- model.setValue("/root/send/srchcond/wardcd", model.getValue("/root/temp/srchinfo/srchward"));
- model.setValue("/root/send/srchcond/deptflag", "2");
- submit("TRADT30404");
-
- }
- /**
- * 마약리스트 조회
- */
- function fGetNarcData() {
- initGridStyle("grd_narclist");
-
- grd_narclist.fixedcellischeck(0, 1) = false;
-
- model.removeNode("/root/send/srchinfo");
- model.makeNode("/root/send/srchinfo");
- model.copyNode("/root/send/srchinfo","/root/temp/srchinfo");
- if( model.getValue("/root/temp/srchinfo/prtab") == "Y") { // 향정반환반납장부 출력조건 2009.05.18 pymi
- model.setValue("/root/send/srchinfo/cnclflag", "Y");
- model.setValue("/root/send/srchinfo/rtnflag", "Y");
- model.setValue("/root/send/srchinfo/rtnstat", "T");
- model.setValue("/root/send/srchinfo/cnclstat", "T");
- model.setValue("/root/send/srchinfo/narcstat", "");
- }
- // (e)
- // alert("row:226 Call");
- submit("TRADT30105");
-
- submit("TRADT30402");
- //fBtnDisable();
- ///2015년 5월11 일 김치국
-
- for(var i = grd_narclist.fixedRows; i < grd_narclist.rows; i++){
- // if ( model.getValue("/root/main/narclist/narclist["+(i-1)+"]/narcflag") =="H" ){
- // grd_narclist.isReadOnly( i, grd_narclist.colRef("sel") )=false;
- // } else {
- // grd_narclist.isReadOnly( i, grd_narclist.colRef("sel") )=false;
- // }
-
- // if ( model.getValue("/root/main/narclist/narclist["+(i-1)+"]/prcpkindcd") =="35" ){
- // grd_narclist.cellStyle("background-color", i, grd_narclist.colRef("drugnm")) = "#c8e67b";
- // }
-
- if(fChkEndYN(i)) {
- grd_narclist.isReadOnly( i, grd_narclist.colRef("sel"))=true;
- } else {
- grd_narclist.isReadOnly( i, grd_narclist.colRef("sel"))=false;
- }
- // grd_narclist.refresh();
- }
- ///////
- //색깔처리
- setCellStyle("grd_narclist" , "6" , "0" , "cnclstat", "equal");
- setCellStyle("grd_narclist" , "6" , "0" , "rtnstat", "equal");
- grd_narclist.refresh();
-
- }
- function fChkEndYN(row){
- //더이상 진행될 처방이 아닌 경우 선택박스 비활성화_20090509_SMY
- var narcstat = model.getValue("/root/main/narclist/narclist["+(row)+"]/narcstat"); //불출상태
- var cnclstat = model.getValue("/root/main/narclist/narclist["+(row)+"]/cnclstat"); //반환상태
- var rtnstat = model.getValue("/root/main/narclist/narclist["+(row)+"]/rtnstat"); //잔량반납상태
- var narcflag = model.getValue("/root/main/narclist/narclist["+(row)+"]/narcflag"); //불출상태
- var drugno = model.getValue("/root/main/narclist/narclist["+(row)+"]/drugno"); //투약번호
- var vname = model.getValue("/root/main/narclist/narclist["+(row)+"]/patnm"); //불출상태
-
- /* 진행완료 상태의 항목들 선택박스 비활성화
- 1. 부서확인 (정상종료의 경우)
- 2. 반환확인 (부서확인 이후 반환신청이 가능, 잔량 없을 경우)
- 3. 잔량확인 (정상종료이면서 잔량이 생성된 처방인 경우)
- 4. 반환확인 & 잔량확인 (PO의 경우 횟수처방이 가능하기 때문에 부분 반환이 가능함. 반환량과 잔량이 동시에 생성될 수 있음)
- 5. 반환종료 (불출 이전에 DC된 경우 * 단, all 반환일때만)
- 6. 향정의 경우 미신청이면서 투약번호가 없을때 (향정은 약국에서만 마감가능하고, 간호에서 미신청일때도 투약기록 가능)
- * 과거 처방중 투약번호가 있으면서 미신청인 항목이 존재하기 때문에 투약번호 존재여부 조건을 줌. */
- // if( (narcstat == "6" && cnclstat == "" && rtnstat == "")
- // || (narcstat == "6" && rtnstat == "")
- // || (cnclstat == "" && rtnstat == "2") || (cnclstat == "2" && rtnstat == "2")
- // || (cnclstat == "7")
- // || (narcflag == "H" && narcstat == "1" && drugno == '')){
- // return true;
- // }else return false;
- if(
- (narcstat != "6" )
- || ((narcstat == "6" && cnclstat == "2") || (narcstat == "6" && cnclstat == "7") )
- || (narcstat == "6" && rtnstat == "2")
- //(narcstat == "6" && cnclstat == "" && rtnstat == "")
- // || (narcstat == "6" && cnclstat == "" && rtnstat == "1")
- // || (narcstat == "6" && rtnstat == "1")
-
- // || (cnclstat == "2" && rtnstat == "")
- // || (cnclstat == "" && rtnstat == "2") || (cnclstat == "2" && rtnstat == "2")
- // || (cnclstat == "7")
- // || (narcflag == "H" && narcstat == "1" && drugno == ''))
- ){
-
- return true;
- }else return false; ///-- alert(row + ":"+vname+" ok");
- }
- /**
- * 바코드 변경시
- */
- function fChgBarcode() {
- model.setValue("/root/temp/srchinfo/srchpid", "");
- model.setValue("/root/temp/srchinfo/srchpatnm", "");
- model.setValue("/root/temp/srchinfo/srchward", "");
- model.setValue("/root/temp/srchinfo/srchroomcd", "");
- var sBar = model.getValue("/root/temp/srchinfo/barcode");
- if(sBar.length >= 21){
- if(model.getValue("/root/temp/userinfo/userinfo/userid") == ""){
- messageBox("사용자ID가 없습니다. 사용자ID부터","C001");
- //model.setValue("/root/temp/srchinfo/srchid","");
- model.setFocus("input1");
- } else if(sBar.substr(0,1) != "M"){
- messageBox("바코드 정보가 다릅니다. 바코드를 다시","C001");
- model.setValue("/root/temp/srchinfo/barcode","");
- model.setFocus("input9");
- } else {
- //바코드로 먼저 해당처방을 조회함
- fGetNarcData();
- //바코드로 Acting처리가 가능한 처방인지 체크함
- //바코드로 처리가능한 Acting : 부서확인
- //바코드로 조회시 데이터는 한건만 조회됨.
- if(model.getValue("/root/main/narclist/narclist["+1+"]/narcstat")=="5"){
- //불출상태가 아니면 부서확인을 할수없음.조회만가능
- //반환바코드는 약국에서 출력하므로 로직에서 제외함
- model.setValue("/root/main/narclist/narclist["+1+"]/sel","Y");
- fNarcActing("acpt");
- }
- }
- } else {
- messageBox("바코드 정보가 다릅니다.\n다시","C001");
- model.setValue("/root/temp/srchinfo/barcode","");
- model.setFocus("input9");
- }
- model.refresh();
- }
- function fCountStat(sActing){
-
- if(sActing == "drug") narcstat = "2"; // 불출신청
- if(sActing == "drugcncl") narcstat = "1"; // 불출취소
- if(sActing == "acpt") narcstat = ""; // 부서확인
-
- if(sActing == "rtn") narcstat = ""; // 반환신청
-
- if(sActing == "spre") narcstat = ""; // 잔량확인
- if(sActing == "sprein") narcstat = ""; // 잔량신청
- for(var i=grd_narclist.fixedRows; i < grd_narclist.rows; i++){
-
- }
- }
- /**
- * 마약 Acting 버튼 클릭시
- */
- function fNarcActing(sActing) {
- if(model.getValue("/root/temp/userinfo/userinfo/userid") == ""){
- messageBox("사용자ID가 없습니다. 사용자ID를","C001");
- model.setValue("/root/temp/srchinfo/barcode","");
- model.setFocus("input1");
- model.refresh();
- return;
- }
- if(model.getValue("/root/temp/srchinfo/drugdeptcd") == ""){
- messageBox("잔량신청부서가 없습니다. 잔량신청부서를","C001");
- model.setValue("/root/temp/srchinfo/barcode","");
- model.setFocus("input1");
- model.refresh();
- return;
- }
- model.removeNodeset("/root/send/narcinfo/narclist");
- var iSel_Cnt = 0;
- var iActing_Cnt = 0;
- var sActing_nm = "";
- var sActing_After = "";
- var iRtn_Cnt = 0;
- var iRtn_Chk = 0;
- var issmsg = "";
-
- //액팅전 체크표시 cash
- fChkCash("before");
- for(var i=grd_narclist.fixedRows; i < grd_narclist.rows; i++){
- var sel = model.getValue("/root/main/narclist/narclist["+(i)+"]/sel");
- var sNarcStat = model.getValue("/root/main/narclist/narclist["+(i)+"]/narcstat");
- var sCnclStat = model.getValue("/root/main/narclist/narclist["+(i)+"]/cnclstat");
- var sRtnStat = model.getValue("/root/main/narclist/narclist["+(i)+"]/rtnstat");
- var ioflag = model.getValue("/root/temp/srchinfo/srchioflag");
- var sInclprcpcd = model.getValue("/root/main/narclist/narclist["+(i)+"]/inclprcpcd");
- var issdeptcd = model.getValue("/root/main/narclist/narclist["+(i)+"]/issdeptcd");
- var deptchgyn = model.getValue("/root/main/narclist/narclist["+(i)+"]/deptchgyn");
- var vprcpcd = model.getValue("/root/main/narclist/narclist["+(i)+"]/prcpcd");
-
- if(sel == 'Y'){
- if ( sActing =="rtn" ){
- //alert("spre");
- if(sCnclStat != "0" || sNarcStat == "5"){
- //alert("rtn");
- sActing="spre";
- }
- }
- iSel_Cnt++;
- if(sActing == "drug"){
- if(sNarcStat == "1"){
- astfCopyNodeSet("/root/send/narcinfo/narclist", "/root/main/narclist/narclist["+(i-1)+"]");
- //model.makeValue("/root/send/narcinfo/narclist["+getNodesetCount("/root/send/narcinfo/narclist")+"]/acting_after", "-");
- iActing_Cnt++;
-
- //수행부서와 다른 부서의 간호사가 불출신청을 할 경우 안내 팝업(M-SET제외)_20090509_SMY
- //if((sInclprcpcd == "-" || sInclprcpcd == "") && issdeptcd != getUserInfo("dutplcecd")){
- if(deptchgyn == "Y" && issdeptcd != getUserInfo("dutplcecd")){
- issmsg = "Y";
- }
- }
- sActing_nm = "불출신청";
- } else if(sActing == "drugcncl"){
- if(sNarcStat == "2"){
- astfCopyNodeSet("/root/send/narcinfo/narclist", "/root/main/narclist/narclist["+(i-1)+"]");
- //model.makeValue("/root/send/narcinfo/narclist["+getNodesetCount("/root/send/narcinfo/narclist")+"]/acting_after", "-");
- iActing_Cnt++;
- }
- sActing_nm = "불출취소";
- } else if(sActing == "acpt"){
- if(sNarcStat == "5"){
- astfCopyNodeSet("/root/send/narcinfo/narclist", "/root/main/narclist/narclist["+(i-1)+"]");
- //model.makeValue("/root/send/narcinfo/narclist["+getNodesetCount("/root/send/narcinfo/narclist")+"]/acting_after", "-");
- iActing_Cnt++;
- }
- sActing_nm = "부서확인";
- } else if(sActing == "spre"){
- if(sRtnStat == "1" && sNarcStat == "6"){
- astfCopyNodeSet("/root/send/narcinfo/narclist", "/root/main/narclist/narclist["+(i-1)+"]");
- iActing_Cnt++;
- if(sCnclStat == "0" && sNarcStat != "5"){
- var vb_prcpcd = model.getValue("/root/main/narclist/narclist["+(i-1)+"]/prcpcd");
- model.makeValue("/root/send/narcinfo/narclist["+getNodesetCount("/root/send/narcinfo/narclist")+"]/acting_after", "rtn");
- } else {
- model.makeValue("/root/send/narcinfo/narclist["+getNodesetCount("/root/send/narcinfo/narclist")+"]/acting_after", "-");
- }
- }
- sActing_nm = "반납/반환신청";
- if(sNarcStat != "6"){
- iRtn_Cnt++;
- }
- } else if(sActing == "sprein"){
-
- var Pprcpvol = model.getValue("/root/main/narclist/narclist["+(i)+"]/prcpvol");
- var Psprevol = model.getValue("/root/main/narclist/narclist["+(i)+"]/sprevol");
- var totdrugqty = model.getValue("/root/main/narclist/narclist["+(i)+"]/totdrugqty");
-
-
- if ( Psprevol == 0 ) {
- for(var i=grd_narclist.fixedRows; i < grd_narclist.rows; i++){
- var sel = model.getValue("/root/main/narclist/narclist["+(i)+"]/sel");
- if(sel == 'Y'){
- model.setValue("/root/main/narclist/narclist["+(i)+"]/rtnstat","");
- }
- }
-
- messageBox("신청잔량이 0","I009");
- return;
- }
- //alert(parseFloat(Pprcpvol));
- //alert(parseFloat(Psprevol) * parseFloat(totdrugqty));
- if ( parseFloat(Pprcpvol) <= (parseFloat(Psprevol) * parseFloat(totdrugqty)) ) {
- for(var i=grd_narclist.fixedRows; i < grd_narclist.rows; i++){
- var sel = model.getValue("/root/main/narclist/narclist["+(i)+"]/sel");
- if(sel == 'Y'){
- model.setValue("/root/main/narclist/narclist["+(i)+"]/rtnstat","");
- }
- }
- messageBox(vprcpcd +"코드가 총용량보다 잔량신청량이 작아야","I006");
- return;
- }
- var PRtncnts = model.getValue("/root/main/narclist/narclist["+(i)+"]/rtncnts");
- if ( PRtncnts == "") {
- for(var i=grd_narclist.fixedRows; i < grd_narclist.rows; i++){
- var sel = model.getValue("/root/main/narclist/narclist["+(i)+"]/sel");
- if(sel == 'Y'){
- model.setValue("/root/main/narclist/narclist["+(i)+"]/rtnstat","");
- }
- }
-
- messageBox("잔량신청 사유가 있어야 ","I006");
- return;
- }
-
-
- if(sRtnStat == "1" && sNarcStat == "6"){
- astfCopyNodeSet("/root/send/narcinfo/narclist", "/root/main/narclist/narclist["+(i)+"]");
- iActing_Cnt++;
- if(sCnclStat == "0" && sNarcStat != "5"){
- var vb_prcpcd = model.getValue("/root/main/narclist/narclist["+(i)+"]/prcpcd");
- model.makeValue("/root/send/narcinfo/narclist["+getNodesetCount("/root/send/narcinfo/narclist")+"]/acting_after", "rtn");
- } else {
- model.makeValue("/root/send/narcinfo/narclist["+getNodesetCount("/root/send/narcinfo/narclist")+"]/acting_after", "-");
- }
- }
- sActing_nm = "반납/반환신청";
- if(sNarcStat != "6"){
- iRtn_Cnt++;
- }
- } else if(sActing == "SpreCncl"){ // ***잔량신청 취소***
- if(sRtnStat == "1" ){ // [잔량신청 취소] 일 때
- astfCopyNodeSet("/root/send/narcinfo/narclist", "/root/main/narclist/narclist["+i+"]");
- //alert(model.getValue("/root/main/narclist/narclist["+(i)+"]/sprevol"));
- iActing_Cnt++;
- }
-
- sActing_nm = "잔량신청취소";
- } else if(sActing == "rtn"){
- if(sCnclStat == "0" && sNarcStat != "5"){
- astfCopyNodeSet("/root/send/narcinfo/narclist", "/root/main/narclist/narclist["+(i-1)+"]");
- iActing_Cnt++;
- if(sRtnStat == "0" && sNarcStat == "6"){
- var vb_prcpcd = model.getValue("/root/main/narclist/narclist["+(i-1)+"]/prcpcd");
- model.makeValue("/root/send/narcinfo/narclist["+getNodesetCount("/root/send/narcinfo/narclist")+"]/acting_after", "spre");
- } else {
- model.makeValue("/root/send/narcinfo/narclist["+getNodesetCount("/root/send/narcinfo/narclist")+"]/acting_after", "-");
- if(model.getValue("/root/main/narclist/narclist["+(i-1)+"]/returnqty") == ""){
- iRtn_Chk = 2;
- }
- }
- }
- sActing_nm = "반납/반환신청";
- if(sNarcStat == "5"){
- iRtn_Cnt++;
- }
- }
- }
- }
-
- if(iSel_Cnt == 0){
- messageBox("선택된 데이터가","I004");
- return;
- } else if(iActing_Cnt == 0){
- if (iRtn_Cnt != 0){
- //if(ioflag == "O") { //주석처리_20090512_SMY
- messageBox("부서확인 이후에 "+sActing_nm+"이","I006");
- return;
- //}
- } else if(iRtn_Chk == 2){
- messageBox("투약기록에서 반환처리 이후에 "+sActing_nm+"이","I006");
- return;
- }
- /*else if(model.getValue("/root/temp/srchinfo/barcode") == ""){
- messageBox("선택된 데이터중에 "+sActing_nm+"할 데이터가","I004");
- return;
- } else if(model.getValue("/root/temp/srchinfo/barcode") != ""){
- messageBox("이미","I001");
- model.setValue("/root/temp/srchinfo/barcode","");
- model.setFocus("input9");
- model.refresh();
- return;
- }*/
- }
- // debugger;
- var msg_val = 6;
- if(sActing == "drug"){
- //msg_val = messageBox(model.getValue("/root/temp/srchinfo/drugdeptnm")+"(으)로 불출신청","S001");
-
- //수행부서와 다른 부서의 간호사가 불출신청을 할 경우 안내 팝업(M-SET제외)_20090509_SMY
- if(issmsg == "Y"){
- msg_val = messageBox("수행부서가 "+ getUserInfo("dutplcenm") + "(으)로 변경되어 신청됩니다.","I");
- }
- msg_val = 6;
- } else if(sActing == "spre"){
- msg_val = messageBox(model.getValue("/root/temp/srchinfo/drugdeptnm")+"(으)로 잔량확인","Q003");
- } else if(sActing == "sprein"){
- // msg_val = messageBox(model.getValue("/root/temp/srchinfo/drugdeptnm")+"(으)로 잔량신청","Q003");
- msg_val = messageBox("마약,향정 잔량신청을 ","Q003");
- } else if(sActing == "rtn"){
- msg_val = messageBox(model.getValue("/root/temp/srchinfo/drugdeptnm")+"(으)로 반환신청","Q003");
- }
- if(msg_val == 6){
- model.copyNode("/root/send/narcinfo/srchinfo","/root/temp/srchinfo");
- model.copyNode("/root/send/narcinfo/userinfo","/root/temp/userinfo/userinfo");
- model.makeValue("/root/send/narcinfo/srchinfo/acting", sActing);
- // alert("SMADT30200.JS Row:463 TXADT30401 Call ");
- if(sActing == "SpreCncl"){
- if(submit("TXADT30101")) {
- // alert("SMADT30200.JS Row:463 TXADT30101 Call ");
- grd_narclist.fixedcellischeck(0, 1) = false;
- var count = model.getValue("/root/main/narclist/ret/count");
- messageBox(iActing_Cnt+"건의 데이터가 "+sActing_nm,"I001");
- grd_narclist.rebuildStyle();
- }
- } else {
- if(submit("TXADT30401")) {
- // alert("SMADT30200.JS Row:463 TXADT30401 Call ");
- grd_narclist.fixedcellischeck(0, 1) = false;
- var count = model.getValue("/root/main/narclist/ret/count");
- messageBox(iActing_Cnt+"건의 데이터가 "+sActing_nm,"I001");
- grd_narclist.rebuildStyle();
- }
- }
- //submit("TXADT30101"); TXADT30401
- }
- //액팅전 체크표시 다시 표시
- fChkCash("after");
-
- //재조회_20090512_SMY
- fGetNarcData();
- }
- /**
- * userid 변경시
- */
- function fChgUserID() {
- var sUserid = model.getValue("/root/temp/srchinfo/srchid");
- //----------------(20100621:경북대)
- //if(sUserid.length == 8 || sUserid.length == 9 || sUserid.length == 10){
- //----------------(20100621)
- model.setValue("/root/send/userinfo/userid", sUserid);
- submit("TRADT30403");
- if(model.getValue("/root/temp/userinfo/userinfo/userid") == ""){
- messageBox("사용자ID 정보가 없습니다.\n다시","C001");
- //model.setValue("/root/temp/srchinfo/srchid","");
- model.setFocus("input1");
- } else {
- //model.setValue("/root/temp/srchinfo/srchid","");
- model.setFocus("input1");
- model.refresh();
- model.setFocus("input9");
- }
- //----------------(20100621:경북대)
- //} else {
- // messageBox("사용자ID 정보가 다릅니다.\n다시","C001");
- // //model.setValue("/root/temp/srchinfo/srchid","");
- // model.setFocus("input1");
- //}
- //----------------(20100621:경북대)
-
- model.refresh();
- }
- //외래 부서구분 변경시
- function fChgOutDept() {
- var sDeptcd = model.getValue("/root/temp/srchinfo/srchdutplcenm");
- model.setValue("/root/send/dutdeptinfo/deptcd", sDeptcd);
- submit("TRADT30405");
- if(model.getValue("/root/temp/dutdeptinfo/dept/deptcd") == ""){
- messageBox("조회된 부서 정보가 없습니다.\n다시","C001");
- model.setValue("/root/temp/srchinfo/srchdutplcenm","");
- model.setFocus("input2");
- } else {
- rdo_dutdept.visible = true;
- if(getNodesetCount("/root/temp/dutdeptinfo/dept") == 1 ){
- model.setValue("/root/temp/srchinfo/srchdutplcenm",model.getValue("/root/temp/dutdeptinfo/dept/deptnm"));
- model.setValue("/root/temp/srchinfo/srchdutplcecd",model.getValue("/root/temp/dutdeptinfo/dept/deptcd"));
- rdo.dutdept.visible = false;
- }
- }
-
-
- model.refresh();
- }
- /**
- * 입원외래구분 변경시
- */
- function fChgIOFlag(){
- var ioflag = model.getValue("/root/temp/srchinfo/srchioflag");
- // 화면구성
- if (ioflag == "I") {
- model.setValue("/root/temp/srchinfo/srchioflag","I");
- model.toggle("case3");
- model.setValue("/root/temp/srchinfo/drugkind", "I");
- rdo_drugkind.visible = true;
- combo5.visible = true;
- combo4.visible = true;
- caption7.text = '병동 :';
- caption6.visible = true;
- combo1.visible = false;
-
- //병동 Combo 조회
- model.makeValue("/root/send/srchcond/deptflag", "W");
- model.makeValue("/root/send/srchcond/narcflag", "M");
- submit("TRADT30401");
- model.copyNode("/root/temp/drugdeptinfo","/root/temp/srchcond"); //불출신청부서 셋팅
- astfAddCombo("/root/temp/srchcond", "dept", "deptcd,deptnm", ",");
- model.refresh();
- //상단에서 정보 조회
- //var node = getGlobalVariable("paminfo");
- //setCSVToNode("/root/temp/topinfo", node);
- if(model.getValue("/root/temp/topinfo/list/wardcd") != ""){
- model.setValue("/root/temp/srchinfo/srchward", model.getValue("/root/temp/topinfo/list/wardcd"));
- model.refresh();
- if(combo1.label == ""){
- model.setValue("/root/temp/srchinfo/srchward", "");
- } else {
- fSrchRoomCD();
- model.setValue("/root/temp/srchinfo/srchroomcd", model.getValue("/root/temp/topinfo/list/roomcd"));
- model.refresh();
- if(combo3.label == "") model.setValue("/root/temp/srchinfo/srchroomcd", "");
- }
- }
-
- combo2.select(1);//그외 적용일자
-
- } else if(ioflag == "O"){
- model.setValue("/root/temp/srchinfo/srchioflag","O");
- model.toggle("case4");
- rdo_drugkind.visible = false;
- //
- combo5.visible = false;
- combo4.visible = false;
- caption7.text = '부서 :';
- caption6.visible = false;
- combo1.visible = true;
- model.setValue("/root/temp/srchinfo/drugkind", "I"); //외래는 주사만 보여짐
-
-
- //
- //외래용 시행부서 조회
- model.makeValue("/root/send/dutdeptinfo/deptcd", "");
- submit("TRADT30405");
- model.copyNode("/root/temp/drugdeptinfo","/root/temp/dutdeptinfo"); //불출신청부서 셋팅
- astfAddCombo("/root/temp/dutdeptinfo", "dept", "deptcd,deptnm", ",전체");
-
-
- var dutplcecd = getUserInfo("dutplcecd");
- var dutplcenm = getUserInfo("dutplcenm");
- model.setValue("/root/temp/srchinfo/srchdutplcecd", dutplcecd);
- model.setValue("/root/temp/srchinfo/srchdutplcenm", dutplcenm);
- if(combo4.label == ""){
- model.setValue("/root/temp/srchinfo/srchdutplcecd", "");
- }
-
- if(model.getValue("/root/temp/topinfo/list/pid") != ""){
- model.setValue("/root/temp/srchinfo/srchpid",model.getValue("/root/temp/topinfo/list/pid"));
- model.setValue("/root/temp/srchinfo/srchpatnm",model.getValue("/root/temp/topinfo/list/hngnm"));
- }
- if(model.getValue("/root/temp/srchinfo/narcflag") == "H") {
- combo2.select(2);//외래향정일때 실시일자
- } else {
- combo2.select(1);//그외 적용일자
- }
- //외래일경우 병동은 클리어
- model.setValue("/root/temp/srchinfo/srchward", "");
- model.setValue("/root/temp/srchinfo/srchdeptcd", "");
- }
-
- if(model.getValue("/root/temp/topinfo/list/pid") != ""){
- model.setValue("/root/temp/srchinfo/srchpid",model.getValue("/root/temp/topinfo/list/pid"));
- model.setValue("/root/temp/srchinfo/srchpatnm",model.getValue("/root/temp/topinfo/list/hngnm"));
- } else {
- model.setValue("/root/temp/srchinfo/srchward", getUserInfo("dutplcecd"));
- }
-
- model.refresh();
- }
- /**
- * 환자별 조회인지 체크
- */
- function fChkPatSearch() {
- var pid = model.getValue("/root/temp/srchinfo/srchpid");
- if(pid != "" && grd_narclist.rows != 0){
- for(var i = grd_narclist.fixedRows; i < grd_narclist.rows; i++){
- if ( model.getValue("/root/main/narclist/narclist["+(i-1)+"]/prcpno")== model.getValue("/root/temp/srchinfo/chkprcpno") ){
- if(!fChkEndYN(i)) model.setValue("/root/main/narclist/narclist["+(i-1)+"]/sel", "Y"); // 2009-06-09 김귀남
- }
- }
- model.refresh();
- }
- }
- /**
- * 액팅후 체크표시 cach
- */
- function fChkCash(chk) {
-
- var pid = model.getValue("/root/temp/srchinfo/srchpid");
- if(pid != "" && grd_narclist.rows != 0){
- if(chk == "before"){
- model.removeNodeset("/root/temp/chkcashinfo/narclist");
- for(var i = grd_narclist.fixedRows; i < grd_narclist.rows; i++){
- if(model.getValue("/root/main/narclist/narclist["+(i-1)+"]/sel") == "Y"){
- astfCopyNodeSet("/root/temp/chkcashinfo/narclist", "/root/main/narclist/narclist["+(i-1)+"]");
- }
- }
- } else if (chk == "after"){
- for(var a = 1; a <= getNodesetCount("/root/temp/chkcashinfo/narclist"); a++){
- var cash_prcpdd = model.getValue("/root/temp/chkcashinfo/narclist["+a+"]/prcpdd");
- var cash_prcpno = model.getValue("/root/temp/chkcashinfo/narclist["+a+"]/prcpno");
- for(var b = grd_narclist.fixedRows; b < grd_narclist.rows; b++){
- var search_prcpdd = model.getValue("/root/main/narclist/narclist["+b+"]/prcpdd");
- var search_prcpno = model.getValue("/root/main/narclist/narclist["+b+"]/prcpno");
- if(cash_prcpdd == search_prcpdd && cash_prcpno == search_prcpno){
- model.setValue("/root/main/narclist/narclist["+b+"]/sel", "Y");
- }
- }
- }
- } else {
-
- }
- model.refresh();
- }
- }
- /**
- * 마약/향정체크시 버튼 변경
- */
-
- function fBtnDisable(){
- if(model.getValue("/root/temp/srchinfo/narcflag") != "M"){
- btn_drug.disabled = true; // 불출신청 비활성화
- btn_drugcncl.disabled = true; // 불출취소 비활성화
- }else{
- btn_drug.disabled = false; // 불출신청 활성화
- btn_drugcncl.disabled = false; // 불출취소 활성화
- }
- model.refresh();
- }
|