123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767 |
- <?xml version="1.0" encoding="utf-8"?>
- <Script type="xscript4.0"><![CDATA[/* ---------------------------------------------------------------------
-
- SMRSD07100_처방성물품사용현황조회.xrw (SMRSD07100.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- : Create By Chungpd.
- : 2010.12.08
- ---------------------------------------------------------------------- */
- var vProgramCls = "SMRSD07100";
- var vGoodReqPath = "ds_main_list_goodreq_goodreqlist";
- var xAuth = frmf_checkAuth("X");
- var pAuth = frmf_checkAuth("P");
- var DataPath = "ds_main_RscmggbnEmpData";
- var MainPath = "ds_main_RscmggbnLists_rscmggbnlist";
- var ListsPath = "ds_main_RscmggbnEmpLists";
- var ListPath = "ds_main_RscmggbnEmpLists_rscmggbnemplist";
- var HidePath = "ds_WorkData_HideData";
- var TreePath = "ds_main_RscmgubnLists_TreeList";
- var WorkPath = "ds_init_WorkInit";
- var CompPath = "ds_init_CompareInit";
- var TreeSendPath = "ds_send_SearchTree";
- var trv_setcode_index = -1;
- /****************************************************************************************
- * Argument : N/A
- * Description : Tree정보 가져오기
- ****************************************************************************************/
- function fInit() {
- // 화면 Control을 초기화한다
- fInitialize();
- return;
- }
- /****************************************************************************************
- * Argument : N/A
- * Description : 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
- ****************************************************************************************/
- function fInitialize() {
- // 처방내역 그리드 초기화
- misfGridInit(group5.switch1.cse_prcppatcase.grd_prcppatcaselist);
- group5.grp_key.opt_instcd.value = sysf_getUserInfo("dutplceinstcd"); // 기관코드
- group5.grp_key.opt_instcdnm.value = sysf_getUserInfo("dutplceinstnm"); // 기관코드명
- if(!fCheckDeptAuth(sysf_getUserInfo("dutplcecd"), sysf_getUserInfo("dutplceinstcd"))) { // 부서권한 확인
- group5.grp_key.ipt_prcpdeptcd.value = sysf_getUserInfo("dutplcecd");
- group5.grp_key.ipt_prcpdeptnm.value = sysf_getUserInfo("dutplcenm");
- group5.grp_key.ipt_prcpdeptcd.enable = false;
- group5.grp_key.btn_prcpdeptcd.enable = false;
- group5.switch1.cse_prcpgoodcase.btn_deliveqtysave.visible = false;
- group5.switch1.cse_prcpgoodcase.btn_excel.visible = false;
- group5.switch1.cse_prcpgoodcase.btn_wardprint.visible = false;
- grp_tabbtn.btn_deptstoc.visible = false;
- group5.grp_detail.rdo_viewcls.enable = false;
- }
- var curdate = utlf_getCurrentDate();
- var cvtdate = curdate.toDate("YYYYMMDD");
- group5.grp_key.ipt_acptdd.value = curdate;
- group5.grp_key.rdo_sumflag.value = "Y";
- group5.grp_key.rdo_ioflag.value = "";
- group5.grp_key.rdo_prntmthd.value = "G";
- ds_main_list_prcpgoodcase_prcpgoodcaselist.clearData();
- ds_main_list_prcppatcase_prcppatcaselist.clearData();
- misfComboComCdListMulti("030R0034,R0450","group5.grp_key.rdo_erprcpflag,group5.grp_key.chk_wareflag");
- // 접속기관 스타일 변경
- fInitInstStyle();
- group5.grp_key.rdo_erprcpflag.index = 0;
-
- frmf_inputEnterKey("group5.grp_key.ipt_acptdd", "onchanged", new ChangeEventInfo);
- }
- /****************************************************************************************
- * Argument : N/A
- * Description : 접속기관 스타일 변경
- ****************************************************************************************/
- function fInitInstStyle() {
- if(frmf_getScreenID() == "SMRSD07100") {
- // 경북대학교병원 적용
- if(sysf_getUserInfo("dutplceinstcd") == "031") {
- // 본원에서 접근시 '일반+응급' 항목 추가표시
- frmf_addComboItem("group5.grp_key.rdo_erprcpflag", "정규+응급", "A", "above");
- misfColHidden(group5.switch1.cse_prcpgoodcase.grd_prcpgoodcaselist, "safestocqty,delivecnfmqty", true);
- group5.switch1.cse_prcpgoodcase.btn_deliveqtysave.visible = false;
- }
- // 칠곡경북대학교병원 적용
- if(sysf_getUserInfo("dutplceinstcd") == "032") {
- for(var i = 0 ; i < group5.switch1.cse_prcpgoodcase.grd_prcpgoodcaselist.getCellCount("Head") ; i++) {
- var hText = group5.switch1.cse_prcpgoodcase.grd_prcpgoodcaselist.getCellText(-1,i);
- if(hText == "총수량") {
- group5.switch1.cse_prcpgoodcase.grd_prcpgoodcaselist.setCellProperty("Head",i,"text","처방집계수량");
- break;
- }
- }
- misfColHidden(group5.switch1.cse_prcpgoodcase.grd_prcpgoodcaselist, "deliveqty", true);
- var userid = sysf_getUserInfo("userid");
- if(userid == "10012" || userid == "12008" || userid == "06157" || userid == "MIS") {
- group5.switch1.cse_deptstoc.btn_enddelive.visible = true;
- group5.switch1.cse_deptstoc.btn_enddelivedept.visible = true;
- group5.switch1.cse_deptstoc.btn_canceldelivedept.visible = true;
- group5.switch1.cse_deptstoc.btn_save.visible = true;
- } else {
- group5.switch1.cse_deptstoc.btn_enddelive.visible = false;
- group5.switch1.cse_deptstoc.btn_enddelivedept.visible = false;
- group5.switch1.cse_deptstoc.btn_canceldelivedept.visible = false;
- group5.switch1.cse_deptstoc.btn_save.visible = false;
- misfColHidden(group5.switch1.cse_deptstoc.grd_deptstoc, "appyn,deliveyn", true); // 불출여부 컬럼 숨김
- }
- group5.grp_key.chk_prcpinptflag.value = "ignore";
- group5.grp_key.rdo_erprcpflag.enable = false;
- }
- }
- }
- /****************************************************************************************
- * Argument : N/A
- * Description : 조회
- ****************************************************************************************/
- function fDataSearchTree() {
- misfGridInit(group5.switch1.cse_prcppatcase.grd_prcppatcaselist);
- var oParam = {};
- oParam.id = "TRRSD07103";
- oParam.service = "reqapp.ReqMngt";
- oParam.method = "reqGetSearchGoodTree2";
- oParam.inds = "req=ds_send_SearchTree";
- oParam.outds = "ds_main_PrcpGoodTrees_TreeList=TreeList";
- oParam.async = false;
- oParam.callback = "cf_TRRSD07103";
- tranf_submit(oParam);
-
- if(arErrorCode.pop("TRRSD07103") > -1) {
- var nCnt1 = 0;
- var nCnt2 = 0;
-
- ds_main_PrcpGoodTrees_TreeList.enableevent = false;
- ds_main_PrcpGoodTrees_TreeList.updatecontrol = false;
-
- ds_main_PrcpGoodTrees_TreeList.filter("depth=='2'");
- nCnt1 = ds_main_PrcpGoodTrees_TreeList.rowcount;
- ds_main_PrcpGoodTrees_TreeList.filter("depth=='1'");
- nCnt2 = ds_main_PrcpGoodTrees_TreeList.rowcount;
- ds_main_PrcpGoodTrees_TreeList.filter("");
-
- ds_main_PrcpGoodTrees_TreeList.updatecontrol = true;
- ds_main_PrcpGoodTrees_TreeList.enableevent = true;
-
- ds_main_PrcpGoodTrees_TreeList.rowposition = -1;
-
- if( group5.grp_detail.rdo_viewcls.value == "0" ){
- ds_main_PrcpGoodTrees_TreeList.rowposition = 0;//ds_main_PrcpGoodTrees_TreeList.findRow("depth", "2");
- //trv_setcode.value = instance1.selectSingleNode("/root/main/PrcpGoodTrees/TreeList[depth='2']/pcode").value;
- // 트러스트폼 트리뷰 focusIndex 값 오류로 전역변수에 인덱스 저장
- trv_setcode_index = 1;
-
- group5_grp_detail_trv_setcode_oncellclick();
- }else if( group5.grp_detail.rdo_viewcls.value != "0" ){
- ds_main_PrcpGoodTrees_TreeList.rowposition = ds_main_PrcpGoodTrees_TreeList.findRow("depth", "1");
- //trv_setcode.value = instance1.selectSingleNode("/root/main/PrcpGoodTrees/TreeList[depth='1']/pcode").value;
- // 트러스트폼 트리뷰 focusIndex 값 오류로 전역변수에 인덱스 저장
- trv_setcode_index = 0;
-
- group5_grp_detail_trv_setcode_oncellclick();
- }
- }
- }
- function cf_TRRSD07103(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
-
- /****************************************************************************************
- * Argument : N/A
- * Description : 처방전달물품내역조회
- ****************************************************************************************/
- function fDataSearchDetail(pIdx)
- {
- var rPath = "ds_send_SearchTree";
- var dPath = "ds_send_prcppatcaseinfo";
- var tPath = "ds_main_PrcpGoodTrees_TreeList";
- var vCaption = " 처방전달물품";
- if(pIdx == -1) pIdx = trv_setcode_index;
- else trv_setcode_index = pIdx;
- var Idx = pIdx;
- var sDepth = eval(tPath).getColumn(Idx, "depth" );
- var vCodeCd = eval(tPath).getColumn(Idx, "codecd" );
- var vCodeNm = eval(tPath).getColumn(Idx, "codenm" );
- var vBaseCd = eval(tPath).getColumn(Idx, "basecode");
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // var Tree2 = trv_setcode.item(pIdx); //어떻게 사용하는지 보고 맞게 수정
- var Tree2PDI = eval(tPath).findRowExpr("depth > '"+pIdx+"'",2);
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- var ioflag = group5.grp_key.rdo_ioflag.value;
- misfGridInit(group5.switch1.cse_prcppatcase.grd_prcppatcaselist);
- misfGridInit(group5.switch1.cse_prcpgoodcase.grd_prcpgoodcaselist);
- misfGridInit(group5.switch1.cse_deptstoc.grd_deptstoc);
- if (vCodeCd == "") return;
- eval(dPath).setColumn(0, "instcd" , eval(rPath).getColumn(0, "instcd" )); // 01 기관코드
- eval(dPath).setColumn(0, "acptdd" , eval(rPath).getColumn(0, "acptdd" )); // 02 처방일자
- eval(dPath).setColumn(0, "sumflag" , eval(rPath).getColumn(0, "sumflag" )); // 04 집계여부
- eval(dPath).setColumn(0, "reqflag" , eval(rPath).getColumn(0, "reqflag" )); // 05 청구구분
- eval(dPath).setColumn(0, "reqdeptcd" , "" ); // 06 처방부서
- eval(dPath).setColumn(0, "reqprid" , eval(rPath).getColumn(0, "reqprid" )); // 07 청구주기
- eval(dPath).setColumn(0, "prcpdeptcd" , "" ); // 08 시행부서
- eval(dPath).setColumn(0, "goodcd" , eval(rPath).getColumn(0, "goodcd" )); // 09 물품코드
- eval(dPath).setColumn(0, "ioflag" , eval(rPath).getColumn(0, "ioflag" )); // 10 입외구분
- eval(dPath).setColumn(0, "deptgr" , "" ); // 11 부서그룹
- eval(dPath).setColumn(0, "pid" , eval(rPath).getColumn(0, "pid" )); // 12 환자번호
- eval(dPath).setColumn(0, "patnm" , eval(rPath).getColumn(0, "patnm" )); // 13 환자명
- eval(dPath).setColumn(0, "purcflag" , eval(rPath).getColumn(0, "purcflag" )); // 14 구매구분
- eval(dPath).setColumn(0, "prodcmpynm" , eval(rPath).getColumn(0, "prodcmpynm" )); // 15 제조회사명
- eval(dPath).setColumn(0, "suplplcecdnm", eval(rPath).getColumn(0, "suplplcecdnm" )); // 16 주거래처명
- eval(dPath).setColumn(0, "suppcustnm" , eval(rPath).getColumn(0, "suppcustnm" )); // 17 보조거래처명
- eval(dPath).setColumn(0, "prntmthd" , eval(rPath).getColumn(0, "prntmthd" )); // 18 출력형식
- eval(dPath).setColumn(0, "sumcnt" , eval(rPath).getColumn(0, "sumcnt" )); // 19 집계횟수
- eval(dPath).setColumn(0, "scrnid" , eval(rPath).getColumn(0, "scrnid" )); // 20 화면ID
- eval(dPath).setColumn(0, "erprcpflag" , eval(rPath).getColumn(0, "erprcpflag" )); // 21 응급여부
- eval(dPath).setColumn(0, "prcpinptflag", eval(rPath).getColumn(0, "prcpinptflag" )); // 22 처방입력구분
- // 선불출 조회조건 추가 이창록
- dsf_makeValue(eval(dPath), "querycls", "string", ds_send_SearchTree.getColumn(0,"querycls")); // 19 라디오박스 선불출코드
- // 물류창고 조회조건 추가
- eval(dPath).setColumn(0, "wareflag", eval(rPath).getColumn(0, "wareflag" )); // 창고구분(물류창고)
- if(frmf_getScreenID() == "SMRSD07100"){ // 처방집계 출력화면일 경우
- eval(dPath).setColumn(0, "wareflagarr" , eval(rPath).getColumn(0, "wareflagarr" )); // 창고구분배열 조건
- eval(dPath).setColumn(0, "acntcd" , eval(rPath).getColumn(0, "acntcd" )); // 계정과목
- eval(dPath).setColumn(0, "acpttodd" , eval(rPath).getColumn(0, "acpttodd" )); // 집계종료일자
- eval(dPath).setColumn(0, "querycls" , eval(rPath).getColumn(0, "querycls" )); // 부서조회여부
- }
- var vCls = parseInt(group5.grp_detail.rdo_viewcls.value+sDepth);
- switch(vCls) {
- case 01 :
- vCaption = " :: 전체" ;
- break;
- case 02 :
- eval(dPath).setColumn(0, "prcpdeptcd" , vCodeCd );
- vCaption = "시행부서 : "+vCodeCd + " - " + vCodeNm;
- break;
- case 11 :
- eval(dPath).setColumn(0, "reqdeptcd" , vCodeCd);
- vCaption = "처방부서 : "+ vCodeCd + " - " + vCodeNm;
- break;
- case 12 :
- eval(dPath).setColumn(0, "prcpdeptcd" , vCodeCd );
- vCode = eval(tPath).getColumn(Tree2PDI,"codecd" ); //체크
- vName = eval(tPath).getColumn(Tree2PDI,"codenm" ); //체크
- eval(dPath).setColumn(0, "reqdeptcd" , vCode );
- vCaption = "처방부서 : "+vCode + " - " + vName + " >> 시행부서 : "+vCodeCd+ " - "+vCodeNm;
- break;
- case 21 :
- eval(dPath).setColumn(0, "prcpdeptcd" , vCodeCd );
- vCaption = "시행부서 : "+vCodeCd + " - " + vCodeNm;
- break;
- case 22 :
- eval(dPath).setColumn(0, "reqdeptcd" , vCodeCd);
- vCode = eval(tPath).getColumn(Tree2PDI,"codecd" ); //체크
- vName = eval(tPath).getColumn(Tree2PDI,"codenm" ); //체크
- eval(dPath).setColumn(0, "prcpdeptcd" , vCode );
- vCaption = "시행부서 : "+vCode + " - " + vName + " >> 처방부서 : "+vCodeCd+ " - "+vCodeNm ;
- break;
- case 31 :
- eval(dPath).setColumn(0, "prcpdeptcd" , vCodeCd );
- vCaption = "시행부서 : "+vCodeCd + " - " + vCodeNm;
- break;
- case 32 :
- eval(dPath).setColumn(0, "goodcd" , vCodeCd);
- vCode = eval(tPath).getColumn(Tree2PDI,"codecd" ); //체크
- vName = eval(tPath).getColumn(Tree2PDI,"codenm" ); //체크
- eval(dPath).setColumn(0, "prcpdeptcd" , vCode );
- vCaption = "시행부서 : "+vCode + " - " + vName + " >> 물품코드 : "+vCodeCd+ " - "+vCodeNm ;
- }
- group5.switch1.cse_prcpgoodcase.cap_prcpgoodcasetitle.tooltiptext = "";
- if (eval(dPath).getColumn(0,"prntmthd") == "P") {
- //환자별 집계내역
- var oParam = {};
- oParam.id = "TRRSD07101";
- oParam.service = "reqapp.ReqMngt";
- oParam.method = "reqGetPrcpPatCaseList";
- oParam.inds = "req="+dPath;
- oParam.outds = "ds_main_list_prcppatcase_prcppatcaselist=prcppatcaselist";
- oParam.async = false;
- oParam.callback = "cf_TRRSD07101";
- tranf_submit(oParam);
- grp_tabbtn.btn_prcpgoodcase.visible = false;
- grp_tabbtn.btn_prcppatcase.visible = true;
-
- if( grp_tabbtn.btn_prcppatcase.getSelectStatus() == true ){
- grp_tabbtn.btn_prcppatcase.click();
- }
- }else{
- //물품별 집계내역
- var oParam = {};
- oParam.id = "TRRSD07102";
- oParam.service = "reqapp.ReqMngt";
- oParam.method = "reqGetPrcpGoodCaseList";
- oParam.inds = "req="+dPath;
- oParam.outds = "ds_main_list_prcpgoodcase_prcpgoodcaselist=prcpgoodcaselist ds_main_list_prcpgoodcase_deptstoccaselist=deptstoccaselist ds_main_list_prcpgoodcase_prcpsuminfo=prcpsuminfo";
- oParam.async = false;
- oParam.callback = "cf_TRRSD07102";
- tranf_submit(oParam);
-
- grp_tabbtn.btn_prcppatcase.visible = false;
- grp_tabbtn.btn_prcpgoodcase.visible = true;
-
- if( grp_tabbtn.btn_prcpgoodcase.getSelectStatus() == true ){
- grp_tabbtn.btn_prcpgoodcase.click();
- }
- var tooltip = "";
- tooltip = ds_main_list_prcpgoodcase_prcpsuminfo.getColumn(0,"sumcmt");
- group5.switch1.cse_prcpgoodcase.cap_prcpgoodcasetitle.tooltiptext = tooltip;
- }
- fGrdiDataValid();
- if(ds_main_list_prcpgoodcase_deptstoccaselist.getColumn(0,"prnyn") == "N") {
- group5.switch1.cse_deptstoc.btn_enddelive.enable = true;
- } else {
- group5.switch1.cse_deptstoc.btn_enddelive.enable = false;
- }
-
- var chkSave = ds_main_list_prcpgoodcase_deptstoccaselist.lookup("edityn","Y","edityn");
- if(!utlf_isNull(chkSave)) {
- group5.switch1.cse_deptstoc.btn_save.enable = true;
- } else {
- group5.switch1.cse_deptstoc.btn_save.enable = false;
- }
- var deptcd = ds_main_list_prcpgoodcase_deptstoccaselist.getColumn(0,"prcpdeptcd");
- var others = ds_main_list_prcpgoodcase_deptstoccaselist.getCaseCount("prcpdeptcd != '" + deptcd + "'");
-
- var sameDeptcd = false;
- var flag1 = true;
- var flag2 = true;
- if(!utlf_isNull(deptcd) && others == 0) sameDeptcd = true;
- if(sameDeptcd) {
- var deliveCnt1 = ds_main_list_prcpgoodcase_deptstoccaselist.getCaseCount("deliveendflag=='N'");
- var deliveCnt2 = ds_main_list_prcpgoodcase_deptstoccaselist.getCaseCount("deliveendflag=='Y' && execyn!='Y'");
- if(deliveCnt1 > 0) flag1 = false;
- if(deliveCnt2 > 0) flag2 = false;
- }
-
- group5.switch1.cse_deptstoc.btn_enddelivedept.enable = !flag1;
- group5.switch1.cse_deptstoc.btn_canceldelivedept.enable = !flag2;
- }
- function cf_TRRSD07101(sSvcId, nErrorCode, sErrorMsg) {
- if(nErrorCode < 0) return;
- ds_main_list_prcppatcase_prcppatcaselist.addColumn("allsizeyn","string");
- ds_main_list_prcppatcase_prcppatcaselist.addColumn("sumflag","string");
- }
- function cf_TRRSD07102(sSvcId, nErrorCode, sErrorMsg) {
- if(nErrorCode < 0) return;
- ds_main_list_prcpgoodcase_prcpgoodcaselist.addColumn("bfdelivecnfmqty","string");
- ds_main_list_prcpgoodcase_prcpgoodcaselist.updatecontrol = false;
- for(var i = 0 ; i < ds_main_list_prcpgoodcase_prcpgoodcaselist.rowcount ; i++) {
- ds_main_list_prcpgoodcase_prcpgoodcaselist.setColumn(i,"bfdelivecnfmqty",ds_main_list_prcpgoodcase_prcpgoodcaselist.getColumn(i,"delivecnfmqty"));
- }
- ds_main_list_prcpgoodcase_prcpgoodcaselist.updatecontrol = true;
- }
-
- // 처방전달물품내역
- 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();
- }
- /****************************************************************************************
- * Argument : N/A
- * Description : Grid의 데이터를 확인하여 오류 데이터시 색상 변경
- * : 물품Master의 All size && 집계 여부시 색상변경
- ****************************************************************************************/
- function fGrdiDataValid() {
- var deptstocList = group5.switch1.cse_deptstoc.grd_deptstoc.binddataset;
- group5.switch1.cse_deptstoc.grd_deptstoc.setCellProperty("body",2,"background","pink");
- group5.switch1.cse_deptstoc.grd_deptstoc.setCellProperty("body",2,"background2","pink");
- if(!utlf_isNull(deptstocList) && eval(deptstocList).rowcount > 0) {
- ds_main_list_prcpgoodcase_deptstoccaselist.updatecontrol = false;
-
- for(var i = 0 ; i < eval(deptstocList).rowcount ; i++) {
- if(eval(deptstocList).getColumn(i,"edityn") == "N") {
- misfSetReadOnlyCol(group5.switch1.cse_deptstoc.grd_deptstoc, "appyn", true, i);
- ds_main_list_prcpgoodcase_deptstoccaselist.updatecontrol = false;
-
- if(eval(deptstocList).getColumn(i,"appyn") == "Y") {
- dsf_makeValue(eval(deptstocList),"deliveyn","string","√",i);
- misfSetGridColor(group5.switch1.cse_deptstoc.grd_deptstoc, "deliveyn", "green", "B", i);
- ds_main_list_prcpgoodcase_deptstoccaselist.updatecontrol = false;
- }else{
- misfSetGridColor(group5.switch1.cse_deptstoc.grd_deptstoc, "deliveyn", "pink", "B", i);
- ds_main_list_prcpgoodcase_deptstoccaselist.updatecontrol = false;
- }
- }else{
- misfSetReadOnlyCol(group5.switch1.cse_deptstoc.grd_deptstoc, "appyn", false, i);
- ds_main_list_prcpgoodcase_deptstoccaselist.updatecontrol = false;
- }
- }
-
- ds_main_list_prcpgoodcase_deptstoccaselist.updatecontrol = true;
- }
-
- var delivecnfmqtyCol = group5.switch1.cse_prcpgoodcase.grd_prcpgoodcaselist.getBindCellIndex("body","delivecnfmqty");
- var deptAuth = fCheckDeptAuth(sysf_getUserInfo("dutplcecd"), sysf_getUserInfo("dutplceinstcd"));
- group5.switch1.cse_prcpgoodcase.grd_prcpgoodcaselist.setCellProperty("body",delivecnfmqtyCol,"tooltiptext","expr:utlf_isNull(cmt2) ? '' : 'bind:cmt2'");
- for(var i = 0 ; i < ds_main_list_prcpgoodcase_prcpgoodcaselist.rowcount ; i++) {
- var comment = ds_main_list_prcpgoodcase_prcpgoodcaselist.getColumn(i, "cmt2");
- var edityn = ds_main_list_prcpgoodcase_prcpgoodcaselist.getColumn(i, "edityn");
- var cmt_view = ds_main_list_prcpgoodcase_prcpgoodcaselist.getColumn(i, "cmt_view");
- var safestocqty = ds_main_list_prcpgoodcase_prcpgoodcaselist.getColumn(i, "safestocqty");
- var totqty = ds_main_list_prcpgoodcase_prcpgoodcaselist.getColumn(i, "totqty");
- var delivecnfmqty = ds_main_list_prcpgoodcase_prcpgoodcaselist.getColumn(i, "delivecnfmqty");
- var deliveqty = ds_main_list_prcpgoodcase_prcpgoodcaselist.getColumn(i, "deliveqty");
- var equalFlag = (parseInt(deliveqty) == parseInt(delivecnfmqty));
-
- if(!utlf_isNull(comment)) {
- if(!equalFlag) {
- misfSetGridColor(group5.switch1.cse_prcpgoodcase.grd_prcpgoodcaselist, "delivecnfmqty", "blue", "B", i);
- }
- // grd_prcpgoodcaselist.tooltipText(i, delivecnfmqtyCol) = comment;
- } else {
- // grd_prcpgoodcaselist.tooltipText(i, delivecnfmqtyCol) = "";
- }
- // 부서 불출마감이 입력 되거나 부서재고가 입고 처리 된 경우 수정불가 처리(edityn)
- // 내시경검사실의 사용부서가 물류파트 인 일부 물품은 불출확정수량 수정불가 처리(cmt_view)
- if(deptAuth && (edityn == "N" || cmt_view == "N")) {
- misfSetReadOnlyCol(group5.switch1.cse_prcpgoodcase.grd_prcpgoodcaselist, "delivecnfmqty", false, i);
- } else {
- misfSetReadOnlyCol(group5.switch1.cse_prcpgoodcase.grd_prcpgoodcaselist, "delivecnfmqty", true, i);
- }
- // 안전재고 수량이 비어 있는 경우 붉은 글씨로 표시
- if(equalFlag && utlf_isNull(safestocqty)) {
- misfSetGridColor(group5.switch1.cse_prcpgoodcase.grd_prcpgoodcaselist, "delivecnfmqty", "red", "C", i);
- }
- // 처방집계수량이 안전재고 수량보다 많을 경우 붉은 글씨로 표시
- if(!isNaN(safestocqty) && parseInt(safestocqty) < parseInt(delivecnfmqty)) {
- misfSetGridColor(group5.switch1.cse_prcpgoodcase.grd_prcpgoodcaselist, "delivecnfmqty", "red", "C", i);
- }
- }
-
- if (ds_main_list_prcppatcase_prcppatcaselist.rowcount <= 0 ) return;
- for(var cnt = 0 ; cnt < ds_main_list_prcppatcase_prcppatcaselist.rowcount ; cnt++) {
- // All SIze 물품이면서 Size 지정이 되지 않고 내려온 처방
- if (ds_main_list_prcppatcase_prcppatcaselist.getColumn( cnt, "allsizeyn" ) == "Y" &&
- ds_main_list_prcppatcase_prcppatcaselist.getColumn( cnt, "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";
- misfSetGridColor(group5.switch1.cse_prcppatcase.grd_prcppatcaselist, "totqty", "yellow", "B", cnt);
- misfSetGridColor(group5.switch1.cse_prcppatcase.grd_prcppatcaselist, "totqty", "red", "C", cnt);
- // grd_prcppatcaselist.valueMatrix( cnt, grd_prcppatcaselist.colRef("goodspec") ) = "All Size 미지정";
- }
- // 처방 집계 여부
- if (ds_main_list_prcppatcase_prcppatcaselist.getColumn( cnt, "sumflag")=="Y" ) {
- misfSetGridColor(group5.switch1.cse_prcppatcase.grd_prcppatcaselist, "sumflagnm", "green", "B", cnt);
- } else {
- misfSetGridColor(group5.switch1.cse_prcppatcase.grd_prcppatcaselist, "sumflagnm", "pink", "B", cnt);
- }
-
- if (ds_main_list_prcppatcase_prcppatcaselist.getColumn(cnt, "allsizeyn") == "Y" ) {
- misfSetGridColor(group5.switch1.cse_prcppatcase.grd_prcppatcaselist, "patnm", "#FFFF00", "B", cnt);
- }
- }
- }
-
- /***********************************************************
- * 물품 처방 집계에서 사용한 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();
- }
- /****************************************************************************************
- * Argument : N/A
- * Description : 부서재고 집계저장
- ****************************************************************************************/
- function fSaveDeptStocList() {
- var dsUpdate = grdf_getGridUpdateData(group5.switch1.cse_deptstoc.grd_deptstoc, "all");
- grdf_setStatusColumn(dsUpdate, "status");
-
- if(dsUpdate.rowcount == 0){
- sysf_messageBox("저장할 데이타가 ","E014");
- return false;
- }
-
- dsf_createDs("ds_send_save_deptstoclist");
- ds_send_save_deptstoclist.copyData(dsUpdate, true);
-
- var oParam = {};
- oParam.id = "TXRSD07101";
- oParam.service = "reqapp.ReqMngt";
- oParam.method = "reqSaveDeptStocAppn";
- oParam.inds = "req=ds_send_save_deptstoclist";
- oParam.outds = "";
- oParam.async = false;
- oParam.callback = "cf_TXRSD07101";
- tranf_submit(oParam);
-
- if (arErrorCode.pop("TXRSD07101") > -1){
- sysf_messageBox("저장이","I002");
-
- fDataSearchDetail(group5.grp_detail.trv_setcode.currentrow);
- } else {
- sysf_messageBox("저장","E009");
- return;
- }
- }
- function cf_TXRSD07101(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
- /****************************************************************************************
- * Argument : deptcd - 부서
- * Description : 출고마감 저장
- ****************************************************************************************/
- function fSaveDeptStocEnd(deptcd) {
- var dsUpdate = grdf_getGridUpdateData(group5.switch1.cse_deptstoc.grd_deptstoc, "all");
-
- if(dsUpdate.rowcount > 0) {
- sysf_messageBox("변경사항이 저장 되지 않았습니다.","E");
- return;
- }
-
- if(ds_main_list_prcpgoodcase_deptstoccaselist.rowcount > 0) {
- var instcd = ds_main_list_prcpgoodcase_deptstoccaselist.getColumn(0, "instcd");
- var acptdd = ds_main_list_prcpgoodcase_deptstoccaselist.getColumn(0, "acptdd");
- var sumcnt = ds_main_list_prcpgoodcase_deptstoccaselist.getColumn(0, "sumcnt");
-
- dsf_createDsRow("ds_send_save_delivestocend", [
- {col:"instcd", type:"STRING", size:256, val:instcd}
- , {col:"acptdd", type:"STRING", size:256, val:acptdd}
- , {col:"sumcnt", type:"STRING", size:256, val:sumcnt}
- , {col:"deptcd", type:"STRING", size:256, val:deptcd}
- ]);
- var oParam = {};
- oParam.id = "TXRSD07102";
- oParam.service = "reqapp.ReqMngt";
- oParam.method = "reqSaveDeptStocEnd";
- oParam.inds = "req=ds_send_save_delivestocend";
- oParam.outds = "";
- oParam.async = false;
- oParam.callback = "cf_TXRSD07102";
- tranf_submit(oParam);
-
- if (arErrorCode.pop("TXRSD07102") > -1){
- sysf_messageBox("저장이","I002");
-
- fDataSearchDetail(group5.grp_detail.trv_setcode.currentrow);
- } else {
- sysf_messageBox("저장","E009");
- return;
- }
- }
- }
- function cf_TXRSD07102(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
- /****************************************************************************************
- * Argument : deptcd - 부서코드
- * Description : 출고마감 취소
- ****************************************************************************************/
- function fSaveDeptStocEndCancel(deptcd) {
- if(ds_main_list_prcpgoodcase_deptstoccaselist.rowcount > 0) {
- var instcd = ds_main_list_prcpgoodcase_deptstoccaselist.getColumn(0,"instcd");
- var acptdd = ds_main_list_prcpgoodcase_deptstoccaselist.getColumn(0,"acptdd");
- var sumcnt = ds_main_list_prcpgoodcase_deptstoccaselist.getColumn(0,"sumcnt");
-
- dsf_createDsRow("ds_send_save_delivestocend", [
- {col:"instcd", type:"STRING", size:256, val:instcd}
- , {col:"acptdd", type:"STRING", size:256, val:acptdd}
- , {col:"sumcnt", type:"STRING", size:256, val:sumcnt}
- , {col:"deptcd", type:"STRING", size:256, val:deptcd}
- ]);
- var oParam = {};
- oParam.id = "TXRSD07103";
- oParam.service = "reqapp.ReqMngt";
- oParam.method = "reqSaveDeptStocEndCancel";
- oParam.inds = "req=ds_send_save_delivestocend";
- oParam.outds = "";
- oParam.async = false;
- oParam.callback = "cf_TXRSD07103";
- tranf_submit(oParam);
- if (arErrorCode.pop("TXRSD07103") > -1){
- sysf_messageBox("저장이","I002");
-
- fDataSearchDetail(group5.grp_detail.trv_setcode.currentrow);
- } else {
- sysf_messageBox("저장","E009");
- return;
- }
- }
- }
- function cf_TXRSD07103(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
- /******************************************************************
- * Argument : N/A
- * Description : (칠곡) 불출확정수량 저장
- ******************************************************************/
- function fSaveDeliveCnfmQtyList() {
- var tarGrid = group5.switch1.cse_prcpgoodcase.grd_prcpgoodcaselist;
- for(var i = 0; i < ds_main_list_prcpgoodcase_prcpgoodcaselist.rowcount ; i++) {
- var bfdelivecnfmqty = parseFloat(ds_main_list_prcpgoodcase_prcpgoodcaselist.getColumn(i,"bfdelivecnfmqty"));
- var delivecnfmqty = parseFloat(ds_main_list_prcpgoodcase_prcpgoodcaselist.getColumn(i,"delivecnfmqty"));
- if(bfdelivecnfmqty != delivecnfmqty) {
- grdf_setStatus(tarGrid, "U", [i]);
- } else {
- grdf_setStatus(tarGrid, "", [i]);
- }
- }
- var dsUpdate = grdf_getGridUpdateData(tarGrid, "all");
- if(dsUpdate.rowcount == 0){
- sysf_messageBox("저장할 데이타가 ","E014");
- return false;
- }
- grdf_setStatusColumn(dsUpdate, "status");
- dsf_createDs("ds_send_save_delivecnfmqtylist");
- ds_send_save_delivecnfmqtylist.copyData(dsUpdate,true);
- var oParam = {};
- oParam.id = "TXRSD07104";
- oParam.service = "reqapp.ReqMngt";
- oParam.method = "reqSaveDeliveCnfmQtyList";
- oParam.inds = "req=ds_send_save_delivecnfmqtylist";
- oParam.outds = "";
- oParam.async = false;
- oParam.callback = "cf_TXRSD07104";
- tranf_submit(oParam);
- if(arErrorCode.pop("TXRSD07104") > -1) {
- sysf_messageBox("저장이","I002");
- fDataSearchDetail(group5.grp_detail.trv_setcode.currentrow);
- } else {
- sysf_messageBox("저장","E009");
- return;
- }
- }
- function cf_TXRSD07104(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
- /****************************************************************************************
- * Argument : pDeptcd - 부서코드
- * : pInstcd - 기관코드
- * Description : 부서권한 확인
- ****************************************************************************************/
- 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 ------------------------------- */
- /* -------------------------------------------------- */
- ]]></Script>
|