123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643 |
- /* ---------------------------------------------------------------------
-
- SMRSD07100_처방성물품사용현황조회.xrw (SMRSD07100.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- : Create By Chungpd.
- : 2010.12.08
- ---------------------------------------------------------------------- */
- var vProgramCls = "SMRSD07100";
- //
- var vGoodReqPath = "/root/main/list/goodreq/goodreqlist";
- var xAuth = !(checkAuth("X"));
- var pAuth = !(checkAuth("P"));
- var DataPath = "/root/main/RscmggbnEmpData";
- var MainPath = "/root/main/RscmggbnLists/rscmggbnlist";
- var ListsPath = "/root/main/RscmggbnEmpLists";
- var ListPath = "/root/main/RscmggbnEmpLists/rscmggbnemplist";
-
- var HidePath = "/root/WorkData/HideData";
-
- var TreePath = "/root/main/RscmgubnLists/TreeList";
- var WorkPath = "/root/init/WorkInit";
- var CompPath = "/root/init/CompareInit";
-
- var TreeSendPath = "/root/send/SearchTree";
-
- var trv_setcode_index = -1;
- // --------------------------------------------------
- // Tree정보 가져오기
- // --------------------------------------------------
- function fInit() {
-
- // 화면 Control을 초기화한다
- fInitialize();
-
- return;
- }
-
- // --------------------------------------------------------------
- // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
- // --------------------------------------------------------------
- function fInitialize() {
-
- // 처방내역 그리드 초기화
- misfGridInit(grd_prcppatcaselist);
-
- model.setValue(opt_instcd.attribute("ref") , getUserInfo("dutplceinstcd")); // 기관코드
- model.setValue(opt_instcdnm.attribute("ref") , getUserInfo("dutplceinstnm")); // 기관코드명
-
- if(!fCheckDeptAuth(getUserInfo("dutplcecd"), getUserInfo("dutplceinstcd"))) { // 부서권한 확인
- ipt_prcpdeptcd.value = getUserInfo("dutplcecd");
- ipt_prcpdeptnm.value = getUserInfo("dutplcenm");
-
- ipt_prcpdeptcd.disabled = true;
- btn_prcpdeptcd.disabled = true;
- btn_deliveqtysave.visible = false;
- btn_excel.visible = false;
- btn_wardprint.visible = false;
- btn_deptstoc.visible = false;
- rdo_viewcls.disabled = true;
- }
-
- var curdate = getCurrentDate();
- var cvtdate = curdate.toDate("YYYYMMDD");
-
- model.setValue(ipt_acptdd.attribute("ref") , curdate);
- model.setValue(rdo_sumflag.attribute("ref") , "Y");
- model.setValue(rdo_ioflag.attribute("ref") , "");
- model.setValue(rdo_prntmthd.attribute("ref") , "G");
-
- model.removeNodeset("/root/main/list/prcpgoodcase/prcpgoodcaselist");
- model.removeNodeset("/root/main/list/prcppatcase/prcppatcaselist");
-
- misfComboComCdListMulti("030R0034,R0450","rdo_erprcpflag,chk_wareflag");
-
- // 접속기관 스타일 변경
- fInitInstStyle();
-
- rdo_erprcpflag.select(0);
-
- ipt_acptdd.dispatch("xforms-value-changed");
-
- model.refresh();
- }
-
- // 접속기관 스타일 변경
- function fInitInstStyle() {
- if(getScreenID() == "SMRSD07100") {
-
- // 경북대학교병원 적용
- if(getUserInfo("dutplceinstcd") == "031") {
- // 본원에서 접근시 '일반+응급' 항목 추가표시
- addComboItem("rdo_erprcpflag", "정규+응급", "A", "above");
- rdo_erprcpflag.refresh();
-
- grd_prcpgoodcaselist.colWidth(grd_prcpgoodcaselist.colRef("safestocqty")) = 0;
- grd_prcpgoodcaselist.colWidth(grd_prcpgoodcaselist.colRef("delivecnfmqty")) = 0;
- grd_prcpgoodcaselist.colHidden(grd_prcpgoodcaselist.colRef("safestocqty")) = true;
- grd_prcpgoodcaselist.colHidden(grd_prcpgoodcaselist.colRef("delivecnfmqty")) = true;
-
- btn_deliveqtysave.visible = false;
- }
-
- // 칠곡경북대학교병원 적용
- if(getUserInfo("dutplceinstcd") == "032") {
-
- var gridCaption = grd_prcpgoodcaselist.caption;
- gridCaption = gridCaption.replace("^총수량", "^처방집계수량");
- grd_prcpgoodcaselist.caption = gridCaption;
-
- grd_prcpgoodcaselist.colWidth(grd_prcpgoodcaselist.colRef("deliveqty")) = 0;
- grd_prcpgoodcaselist.colHidden(grd_prcpgoodcaselist.colRef("deliveqty")) = true;
-
- var userid = getUserInfo("userid");
- if(userid == "10012" || userid == "12008" || userid == "06157" || userid == "MIS") {
- //if(getUserInfo("dutplcenm") == "4020334000") {
- btn_enddelive.visible = true;
- btn_enddelivedept.visible = true;
- btn_canceldelivedept.visible = true;
- btn_save. visible = true;
- } else {
- btn_enddelive.visible = false;
- btn_enddelivedept.visible = false;
- btn_canceldelivedept.visible = false;
- btn_save. visible = false;
-
- grd_deptstoc.colWidth(grd_deptstoc.colRef("appyn")) = 0;
- grd_deptstoc.colHidden(grd_deptstoc.colRef("appyn")) = true;
- grd_deptstoc.colHidden(grd_deptstoc.colRef("deliveyn")) = true; // 불출여부 컬럼 숨김
- }
-
- model.setValue(chk_prcpinptflag.attribute("ref"),"ignore");
- chk_prcpinptflag.refresh();
- rdo_erprcpflag.disabled = true;
- }
- }
- }
-
- function fDataSearchTree() {
-
- // if (fCheckRetrieveData(false) == false) return;
-
- misfGridInit(grd_prcppatcaselist);
-
- if(submit("TRRSD07103")) {
- trv_setcode.rebuild();
-
- if(rdo_viewcls.value == "0" && instance1.selectNodes("/root/main/PrcpGoodTrees/TreeList[depth='2']").length == 1) {
- trv_setcode.value = instance1.selectSingleNode("/root/main/PrcpGoodTrees/TreeList[depth='2']/pcode").value;
- // 트러스트폼 트리뷰 focusIndex 값 오류로 전역변수에 인덱스 저장
- trv_setcode_index = 1;
- trv_setcode.dispatch("xforms-value-changed");
- }else if(rdo_viewcls.value != "0" && instance1.selectNodes("/root/main/PrcpGoodTrees/TreeList[depth='1']").length == 1) {
- trv_setcode.value = instance1.selectSingleNode("/root/main/PrcpGoodTrees/TreeList[depth='1']/pcode").value;
- // 트러스트폼 트리뷰 focusIndex 값 오류로 전역변수에 인덱스 저장
- trv_setcode_index = 0;
- trv_setcode.dispatch("xforms-value-changed");
- }
- trv_setcode.refresh();
- }
- }
-
- // 처방전달물품내역조회
- function fDataSearchDetail(pIdx)
- {
- var rPath = "/root/send/SearchTree";
- var dPath = "/root/send/prcppatcaseinfo";
- var tPath = "/root/main/PrcpGoodTrees/TreeList";
-
- var vCaption = " 처방전달물품";
-
- // if (fCheckRetrieveData(false) == false)return; // 입력항목 Check
-
- if(pIdx == -1) pIdx = trv_setcode_index;
- else trv_setcode_index = pIdx;
-
- var Idx = pIdx + 1;
- var sDepth = model.getValue(tPath +"["+Idx+"]/depth" );
- var vCodeCd = model.getValue(tPath +"["+Idx+"]/codecd" );
- var vCodeNm = model.getValue(tPath +"["+Idx+"]/codenm" );
- var vBaseCd = model.getValue(tPath +"["+Idx+"]/basecode");
- var Tree2 = trv_setcode.item(pIdx);
- var ioflag = model.getValue(rdo_ioflag.attribute("ref"));
-
- misfGridInit(grd_prcppatcaselist);
- misfGridInit(grd_prcpgoodcaselist);
- misfGridInit(grd_deptstoc);
-
- if (vCodeCd == "") return;
-
- model.setValue(dPath + "/instcd" , model.getValue(rPath + "/instcd" )); // 01 기관코드
- model.setValue(dPath + "/acptdd" , model.getValue(rPath + "/acptdd" )); // 02 처방일자
- model.setValue(dPath + "/sumflag" , model.getValue(rPath + "/sumflag" )); // 04 집계여부
- model.setValue(dPath + "/reqflag" , model.getValue(rPath + "/reqflag" )); // 05 청구구분
- model.setValue(dPath + "/reqdeptcd" , "" ); // 06 처방부서
- model.setValue(dPath + "/reqprid" , model.getValue(rPath + "/reqprid" )); // 07 청구주기
- model.setValue(dPath + "/prcpdeptcd" , "" ); // 08 시행부서
- model.setValue(dPath + "/goodcd" , model.getValue(rPath + "/goodcd" )); // 09 물품코드
- model.setValue(dPath + "/ioflag" , model.getValue(rPath + "/ioflag" )); // 10 입외구분
- model.setValue(dPath + "/deptgr" , "" ); // 11 부서그룹
- model.setValue(dPath + "/pid" , model.getValue(rPath + "/pid" )); // 12 환자번호
- model.setValue(dPath + "/patnm" , model.getValue(rPath + "/patnm" )); // 13 환자명
- model.setValue(dPath + "/purcflag" , model.getValue(rPath + "/purcflag" )); // 14 구매구분
- model.setValue(dPath + "/prodcmpynm" , model.getValue(rPath + "/prodcmpynm" )); // 15 제조회사명
- model.setValue(dPath + "/suplplcecdnm", model.getValue(rPath + "/suplplcecdnm" )); // 16 주거래처명
- model.setValue(dPath + "/suppcustnm" , model.getValue(rPath + "/suppcustnm" )); // 17 보조거래처명
- model.setValue(dPath + "/prntmthd" , model.getValue(rPath + "/prntmthd" )); // 18 출력형식
- model.setValue(dPath + "/sumcnt" , model.getValue(rPath + "/sumcnt" )); // 19 집계횟수
- model.setValue(dPath + "/scrnid" , model.getValue(rPath + "/scrnid" )); // 20 화면ID
- model.setValue(dPath + "/erprcpflag" , model.getValue(rPath + "/erprcpflag" )); // 21 응급여부
- model.setValue(dPath + "/prcpinptflag", model.getValue(rPath + "/prcpinptflag" )); // 22 처방입력구분
-
- // 선불출 조회조건 추가 이창록
- model.makeValue(dPath + "/querycls" , model.getValue("/root/send/SearchTree/querycls")); // 19 라디오박스 선불출코드
- // 물류창고 조회조건 추가
- model.setValue(dPath + "/wareflag" , model.getValue(rPath + "/wareflag" )); // 창고구분(물류창고)
-
- if(getScreenID() == "SMRSD07100"){ // 처방집계 출력화면일 경우
- model.setValue(dPath + "/wareflagarr" , model.getValue(rPath + "/wareflagarr" )); // 창고구분배열 조건
- model.setValue(dPath + "/acntcd" , model.getValue(rPath + "/acntcd" )); // 계정과목
- model.setValue(dPath + "/acpttodd" , model.getValue(rPath + "/acpttodd" )); // 집계종료일자
- model.setValue(dPath + "/querycls" , model.getValue(rPath + "/querycls" )); // 부서조회여부
- }
- var vCls = parseInt(rdo_viewcls.value+sDepth);
-
- switch(vCls) {
- case 01 :
- vCaption = " :: 전체" ;
- break;
- case 02 :
- model.setValue(dPath + "/prcpdeptcd" , vCodeCd );
- vCaption = "시행부서 : "+vCodeCd + " - " + vCodeNm;
- break;
- case 11 :
- model.setValue(dPath + "/reqdeptcd" , vCodeCd);
- vCaption = "처방부서 : "+ vCodeCd + " - " + vCodeNm;
- break;
- case 12 :
- model.setValue(dPath + "/prcpdeptcd" , vCodeCd );
- vCode = model.getValue(tPath +"["+(Tree2.parentindex + 1)+"]/codecd" );
- vName = model.getValue(tPath +"["+(Tree2.parentindex + 1)+"]/codenm" );
-
- model.setValue(dPath + "/reqdeptcd" , vCode );
-
- vCaption = "처방부서 : "+vCode + " - " + vName + " >> 시행부서 : "+vCodeCd+ " - "+vCodeNm;
- break;
- case 21 :
- model.setValue(dPath + "/prcpdeptcd" , vCodeCd );
-
- vCaption = "시행부서 : "+vCodeCd + " - " + vCodeNm;
- break;
- case 22 :
- model.setValue(dPath + "/reqdeptcd" , vCodeCd);
-
- vCode = model.getValue(tPath +"["+(Tree2.parentindex + 1)+"]/codecd" );
- vName = model.getValue(tPath +"["+(Tree2.parentindex + 1)+"]/codenm" );
-
- model.setValue(dPath + "/prcpdeptcd" , vCode );
-
- vCaption = "시행부서 : "+vCode + " - " + vName + " >> 처방부서 : "+vCodeCd+ " - "+vCodeNm ;
- break;
- case 31 :
- model.setValue(dPath + "/prcpdeptcd" , vCodeCd );
-
- vCaption = "시행부서 : "+vCodeCd + " - " + vCodeNm;
- break;
- case 32 :
- model.setValue(dPath + "/goodcd" , vCodeCd);
-
- vCode = model.getValue(tPath +"["+(Tree2.parentindex + 1)+"]/codecd" );
- vName = model.getValue(tPath +"["+(Tree2.parentindex + 1)+"]/codenm" );
-
- model.setValue(dPath + "/prcpdeptcd" , vCode );
-
- vCaption = "시행부서 : "+vCode + " - " + vName + " >> 물품코드 : "+vCodeCd+ " - "+vCodeNm ;
- }
-
- cap_prcpgoodcasetitle.hint = "";
-
- if (model.getValue(dPath + "/prntmthd") == "P"){
- submit("TRRSD07101",false); //환자별 집계내역
- btn_prcpgoodcase.visible = false;
- btn_prcppatcase.visible = true;
- if(btn_prcppatcase.selected == true) {
- model.toggle("cse_prcppatcase");
- btn_prcppatcase.selected = true;
- }
- }else{
- submit("TRRSD07102",false); //물품별 집계내역
- btn_prcppatcase.visible = false;
- btn_prcpgoodcase.visible = true;
- if(btn_prcpgoodcase.selected == true) {
- model.toggle("cse_prcpgoodcase");
- btn_prcpgoodcase.selected = true;
- }
- var tooltip = "";
- tooltip = model.getValue("/root/main/list/prcpgoodcase/prcpsuminfo/sumcmt");
-
- cap_prcpgoodcasetitle.hint = tooltip;
- }
- model.refresh();
-
- fGrdiDataValid();
-
- if(model.getValue("/root/main/list/prcpgoodcase/deptstoccaselist/prnyn") == "N") {
- btn_enddelive.disabled = false;
- } else {
- btn_enddelive.disabled = true;
- }
- var chkSave = instance1.selectNodes("/root/main/list/prcpgoodcase/deptstoccaselist[edityn='Y']/edityn");
- if(chkSave != null && chkSave.length > 0) {
- btn_save.disabled = false;
- } else {
- btn_save.disabled = true;
- }
-
- var deptcd = grd_deptstoc.valueMatrix(1,grd_deptstoc.colRef("prcpdeptcd"));
- var others = instance1.selectNodes(grd_deptstoc.nodeset + "[prcpdeptcd != '" + deptcd + "']");
-
- var sameDeptcd = false;
- var flag1 = true;
- var flag2 = true;
- if(deptcd != null && others.length == 0) sameDeptcd = true;
- if(sameDeptcd) {
- var deliveCnt1 = instance1.selectNodes("/root/main/list/prcpgoodcase/deptstoccaselist[deliveendflag='N']").length;
- var deliveCnt2 = instance1.selectNodes("/root/main/list/prcpgoodcase/deptstoccaselist[deliveendflag='Y' and execyn!='Y']").length;
-
- if(deliveCnt1 > 0) flag1 = false;
- if(deliveCnt2 > 0) flag2 = false;
- }
- btn_enddelivedept.disabled = flag1;
- btn_canceldelivedept.disabled = flag2;
- }
-
- // 처방전달물품내역
- function fDataPartToggle(pCls) {
-
- if (pCls =="0") { // Key 조회
- // 메인 Grup
- grp_main.attribute("left" ) = "350px";
- // grp_main.attribute("top" ) = "8px" ;
- grp_main.attribute("width" ) = "835px";
- // grp_main.attribute("height" ) = "747px";
-
- btn_excel2.attribute("left" ) = "778px";
- lin_main.attribute("x2" ) = "835px";
- grd_prcppatcaselist.attribute("width") = "835px";
-
- if (vProgramCls == "SMRSD02203") {
- btn_save.attribute("left" ) = "715px";
- }
- } else { //
- // 메인 Grup
- grp_main.attribute("left" ) = "0px" ;
- //grp_main.attribute("top" ) = "8px" ;
- grp_main.attribute("width" ) = "1192px";
- //grp_main.attribute("height" ) = "747px" ;
-
- btn_excel2.attribute("left" ) = "1135px";
- lin_main.attribute("x2" ) = "1192px";
- grd_prcppatcaselist.attribute("width") = "1192px";
- if (vProgramCls == "SMRSD02203") {
- btn_save.attribute("left" ) = "1072px";
- }
- }
-
- grp_main.refresh();
- }
-
- // 조회 결과 Count Setting
- function fAfterRetrieve() {
- // case 1 count
- model.setValue(opt_goodreqcnt.attribute("ref"),(grd_goodreq.rows-grd_goodreq.fixedRows));
-
- // case 2 count
- // model.setValue(opt_searchgoodcnt.attribute("ref"),(grd_prcppatcaselist.rows-grd_prcppatcaselist.fixedRows));
- model.refresh();
- }
- // Grid의 데이터를 확인하여 오류 데이터시 색상 변경
- // 물품Master의 All size && 집계 여부시 색상변경
- function fGrdiDataValid() {
- grd_deptstoc.rebuildStyle();
- var deptstocList = instance1.selectNodes(grd_deptstoc.nodeset);
-
- grd_deptstoc.colStyle(2, "data", "background-color") = "pink";
-
- if(deptstocList != null && deptstocList.length > 0) {
- for(var i=0; i<deptstocList.length; i++) {
- var selectNode = deptstocList.item(i);
- if(selectNode.selectSingleNode("edityn").value == "N") {
- selectNode.selectSingleNode("appyn").readOnly = "1";
-
- if(selectNode.selectSingleNode("appyn").value == "Y") {
- grd_deptstoc.cellstyle("background-color", grd_deptstoc.fixedRows + i, grd_deptstoc.colRef("deliveyn"), grd_deptstoc.fixedRows + i, grd_deptstoc.colRef("deliveyn")) = "green";
- selectNode.selectSingleNode("deliveyn").value = "√";
- }
- }
- }
- grd_deptstoc.refresh();
- }
-
- grd_prcpgoodcaselist.rebuildStyle();
- var delivecnfmqtyCol = grd_prcpgoodcaselist.colRef("delivecnfmqty");
- var deptAuth = fCheckDeptAuth(getUserInfo("dutplcecd"), getUserInfo("dutplceinstcd"));
-
- for(var i=grd_prcpgoodcaselist.fixedRows; i<grd_prcpgoodcaselist.rows; i++) {
- var comment = grd_prcpgoodcaselist.valueMatrix(i, grd_prcpgoodcaselist.colRef("cmt2"));
- var edityn = grd_prcpgoodcaselist.valueMatrix(i, grd_prcpgoodcaselist.colRef("edityn"));
- var cmt_view = grd_prcpgoodcaselist.valueMatrix(i, grd_prcpgoodcaselist.colRef("cmt_view"));
-
- var safestocqty = grd_prcpgoodcaselist.valueMatrix(i, grd_prcpgoodcaselist.colRef("safestocqty"));
- var totqty = grd_prcpgoodcaselist.valueMatrix(i, grd_prcpgoodcaselist.colRef("totqty"));
- var delivecnfmqty = grd_prcpgoodcaselist.valueMatrix(i, grd_prcpgoodcaselist.colRef("delivecnfmqty"));
- var deliveqty = grd_prcpgoodcaselist.valueMatrix(i, grd_prcpgoodcaselist.colRef("deliveqty"));
-
- var equalFlag = (parseInt(deliveqty) == parseInt(delivecnfmqty));
-
- if(comment != null && comment.length > 0) {
- if(!equalFlag) {
- grd_prcpgoodcaselist.cellstyle("color", i, delivecnfmqtyCol, i, delivecnfmqtyCol) = "blue";
- }
- grd_prcpgoodcaselist.tooltipText(i, delivecnfmqtyCol) = comment;
- } else {
- grd_prcpgoodcaselist.tooltipText(i, delivecnfmqtyCol) = "";
- }
- // 부서 불출마감이 입력 되거나 부서재고가 입고 처리 된 경우 수정불가 처리(edityn)
- // 내시경검사실의 사용부서가 물류파트 인 일부 물품은 불출확정수량 수정불가 처리(cmt_view)
- if(deptAuth && (edityn == "N" || cmt_view == "N")) {
- grd_prcpgoodcaselist.isReadOnly(i, delivecnfmqtyCol, i, delivecnfmqtyCol) = false;
- } else {
- grd_prcpgoodcaselist.isReadOnly(i, delivecnfmqtyCol, i, delivecnfmqtyCol) = true;
- }
- // 안전재고 수량이 비어 있는 경우 붉은 글씨로 표시
- if(equalFlag && safestocqty == "") {
- grd_prcpgoodcaselist.cellstyle("color", i, delivecnfmqtyCol, i, delivecnfmqtyCol) = "red";
- }
- // 처방집계수량이 안전재고 수량보다 많을 경우 붉은 글씨로 표시
- if(!isNaN(safestocqty) && parseInt(safestocqty) < parseInt(delivecnfmqty)) {
- grd_prcpgoodcaselist.cellstyle("color", i, delivecnfmqtyCol, i, delivecnfmqtyCol) = "red";
- }
- }
- grd_prcpgoodcaselist.refresh();
-
- if (grd_prcppatcaselist.rows - grd_prcppatcaselist.fixedRows <= 0 ) return;
-
- grd_prcppatcaselist.rebuildStyle();
-
- for(var cnt = grd_prcppatcaselist.fixedRows; cnt< grd_prcppatcaselist.rows; cnt++) {
- // All SIze 물품이면서 Size 지정이 되지 않고 내려온 처방
- if (grd_prcppatcaselist.valueMatrix( cnt, grd_prcppatcaselist.colRef("allsizeyn" )) == "Y" &&
- grd_prcppatcaselist.valueMatrix( cnt, grd_prcppatcaselist.colRef("allsizespecid")) == "-" ) {
-
- grd_prcppatcaselist.cellstyle("background-color", cnt, grd_prcppatcaselist.colRef("rgstdd"), cnt, grd_prcppatcaselist.colRef("totqty")) = "yellow";
- grd_prcppatcaselist.cellstyle("color" , cnt, grd_prcppatcaselist.colRef("rgstdd"), cnt, grd_prcppatcaselist.colRef("totqty")) = "red";
- // grd_prcppatcaselist.valueMatrix( cnt, grd_prcppatcaselist.colRef("goodspec") ) = "All Size 미지정";
- }
-
- // 처방 집계 여부
- if (grd_prcppatcaselist.valueMatrix( cnt, grd_prcppatcaselist.colRef("sumflag"))=="Y" ) {
- grd_prcppatcaselist.cellstyle("background-color", cnt, grd_prcppatcaselist.colRef("sumflagnm"), cnt, grd_prcppatcaselist.colRef("sumflagnm") ) = "green";
- } else{
- grd_prcppatcaselist.cellstyle("background-color", cnt, grd_prcppatcaselist.colRef("sumflagnm"), cnt, grd_prcppatcaselist.colRef("sumflagnm") ) = "pink";
- }
-
- if (model.getValue(grd_prcppatcaselist.nodeset + "[" + cnt + "]/allsizeyn") == "Y" ) {
-
- grd_prcppatcaselist.cellstyle("background-color", cnt, 4) = "#FFFF00";
-
- //if (model.getValue(grd_prcppatcaselist.nodeset + "[" + cnt + "]/allsizespecid") == "-" ) {
- // grd_prcppatcaselist.colAttribute ( 1, "disabled" ) = true;
-
-
- // grd_prcppatcaselist.coldisabled(grd_prcppatcaselist.colRef("beforqty")) = true;
- //}
- //} else {
- // grd_reqsetlist.cellstyle("background-color", j, 5) = "transparent";
- }
- }
- grd_prcppatcaselist.refresh();
- }
-
- /***********************************************************
- * 물품 처방 집계에서 사용한 Script
- ************************************************************/
- // 부서코드 읽어오기...
- function fDeptValidationCheck(pData1, pData2, pCodeName) {
-
- if (pData1.value.length == 0) {
- pData2.value = "";
- } else {
- rszfValidationCheck("TRRPZ00201", "deptcodelist", "refcond,deptnm","deptnm," + pData1.value,"", pCodeName, pData1, "SPRPZ00200", "","");
- }
-
- model.refresh();
- }
- function fSaveDeptStocList() {
- var updtdata = "";
-
- updtdata = getGridUpdateData(grd_deptstoc);
-
- if(updtdata == ""){
- messageBox("저장할 데이타가 ","E014");
- return false;
- }
-
- model.makeValue("/root/send/save/deptstoclist", updtdata);
-
- if (submit("TXRSD07101")){
- messageBox("저장이","I002");
-
- fDataSearchDetail(trv_setcode.focusIndex);
- //btn_search.dispatch("DOMActivate");
- } else {
- messageBox("저장","E009");
- return;
- }
- }
- // 출고마감 저장
- function fSaveDeptStocEnd(deptcd) {
-
- var updtdata = "";
- updtdata = getGridUpdateData(grd_deptstoc);
-
- if(updtdata != ""){
- messageBox("변경사항이 저장 되지 않았습니다.","E");
- return;
- }
-
- if(grd_deptstoc.rows - grd_deptstoc.fixedRows > 0) {
- var instcd = grd_deptstoc.valueMatrix(1,grd_deptstoc.colRef("instcd"));
- var acptdd = grd_deptstoc.valueMatrix(1,grd_deptstoc.colRef("acptdd"));
- var sumcnt = grd_deptstoc.valueMatrix(1,grd_deptstoc.colRef("sumcnt"));
-
- model.removeNodeSet("/root/send/save/delivestocend")
-
- model.makeNode("/root/send/save/delivestocend");
- model.makeValue("/root/send/save/delivestocend/instcd",instcd);
- model.makeValue("/root/send/save/delivestocend/acptdd",acptdd);
- model.makeValue("/root/send/save/delivestocend/sumcnt",sumcnt);
- model.makeValue("/root/send/save/delivestocend/deptcd",deptcd);
-
- if (submit("TXRSD07102")){
- messageBox("저장이","I002");
-
- fDataSearchDetail(trv_setcode.focusIndex);
- //btn_search.dispatch("DOMActivate");
- } else {
- messageBox("저장","E009");
- return;
- }
- }
- }
- // 출고마감 취소
- function fSaveDeptStocEndCancel(deptcd) {
- if(grd_deptstoc.rows - grd_deptstoc.fixedRows > 0) {
- var instcd = grd_deptstoc.valueMatrix(1,grd_deptstoc.colRef("instcd"));
- var acptdd = grd_deptstoc.valueMatrix(1,grd_deptstoc.colRef("acptdd"));
- var sumcnt = grd_deptstoc.valueMatrix(1,grd_deptstoc.colRef("sumcnt"));
-
- model.removeNodeSet("/root/send/save/delivestocend")
-
- model.makeNode("/root/send/save/delivestocend");
- model.makeValue("/root/send/save/delivestocend/instcd",instcd);
- model.makeValue("/root/send/save/delivestocend/acptdd",acptdd);
- model.makeValue("/root/send/save/delivestocend/sumcnt",sumcnt);
- model.makeValue("/root/send/save/delivestocend/deptcd",deptcd);
-
- if (submit("TXRSD07103")){
- messageBox("저장이","I002");
-
- fDataSearchDetail(trv_setcode.focusIndex);
- //btn_search.dispatch("DOMActivate");
- } else {
- messageBox("저장","E009");
- return;
- }
- }
- }
- // (칠곡) 불출확정수량 저장
- function fSaveDeliveCnfmQtyList() {
-
- var updtdata = "";
-
- var tarGrid = grd_prcpgoodcaselist;
-
- for(var i=tarGrid.fixedRows; i<tarGrid.rows; i++) {
- var bfdelivecnfmqty = parseFloat(tarGrid.valueMatrix(i,tarGrid.colRef("bfdelivecnfmqty")));
- var delivecnfmqty = parseFloat(tarGrid.valueMatrix(i,tarGrid.colRef("delivecnfmqty")));
- if(bfdelivecnfmqty != delivecnfmqty) {
- tarGrid.rowStatus(i) = "2";
- } else {
- tarGrid.rowStatus(i) = "0";
- }
- }
- tarGrid.refresh();
-
- updtdata = getGridUpdateData(tarGrid);
-
- if(updtdata == ""){
- messageBox("저장할 데이타가 ","E014");
- return false;
- }
- //alert(updtdata);
- model.makeValue("/root/send/save/delivecnfmqtylist", updtdata);
-
- if (submit("TXRSD07104")){
- messageBox("저장이","I002");
-
- fDataSearchDetail(trv_setcode.focusIndex);
- //btn_search.dispatch("DOMActivate");
- } else {
- messageBox("저장","E009");
- return;
- }
- }
- // 부서권한 확인
- function fCheckDeptAuth(pDeptcd, pInstcd) {
- if( (pInstcd == "031" && pDeptcd == "3080000000") // 본원 진료재료파트
- || (pInstcd == "031" && pDeptcd == "4020334000") // 본원 물류파트
- || (pInstcd == "032" && pDeptcd == "4020334000") // 칠곡 물류파트
- || (pInstcd == "032" && pDeptcd == "3360000000")) { // 칠곡 중앙공급실
- return true;
- } else {
- return false;
- }
- }
- /* ------------------------------------------------- */
- /* ------End Of List ------------------------------- */
- /* -------------------------------------------------- */
|