123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529 |
- /**
- * @desc : Source Node의 갯수를 구한다.
- * @
- * @param : path - node path
- * @return :
- * @authur : 김선태 2007. 5. 8
- * @---------------------------------------------------
- */
- function getNodeSetCnt(path)
- {
- var insXml = model.instances(0);
- var nodeList = insXml.selectNodes(path);
- return nodeList.length;
- }
- /**
- * @desc : Source Node의 child nodelist를 Destination의 nodelist로 append한다.
- *
- * @param : strDest - 도착node path
- * : strSrc - 출발node path
- * @return : void
- * @authur : 이상현 2007. 3. 27
- * @---------------------------------------------------
- */
- function addCopyNodeset(strDest, strSrc, mode, destModel, srcModel) {
- if( destModel == null || destModel =="" )
- destModel = document.models.item(0);
-
- if( srcModel == null || srcModel =="" )
- srcModel = document.models.item(0);
-
- var srcNodeList = srcModel.instances(0).selectNodes(strSrc);
- var srcNode;
-
- var pDestNode = destModel.instances.item(0).selectSingleNode(strDest).parentNode;
-
- if( mode == "replace" || mode == null ) {
- destModel.removeNodeset(strDest);
- while( srcNode = srcNodeList.nextNode() ) {
- pDestNode.appendChild(srcNode.cloneNode(true));
- }
- }
-
- else if( mode == "after" ) {
- while( srcNode = srcNodeList.nextNode() ) {
- pDestNode.appendChild(srcNode.cloneNode(true));
- }
- }
-
- else if( mode == "before" ) {
- var destNode;
- for( var i = srcNodeList.length - 1; i >= 0; i-- ) {
- destNode = destModel.instances.item(0).selectSingleNode(strDest + "[1]");
- pDestNode.insertBefore(srcNodeList.item(i).cloneNode(true), destNode);
- }
- }
- }
- /**
- * @desc : 사용자의 권한을 체크하여 버튼셋팅.
- * btn_r 조회버튼, btn_x 저장 및 수정 버튼, btn_p : 출력버튼
- * @return : void
- * @authur : 김선태 2007. 5. 8
- */
- function fchkAuth()
- {
-
- for(var i=0; i<= document.controls.length-1 ; i++){
- if(document.controls.item(i).elementName == "xforms:button"){
- if(document.controls.item(i).attribute("id").substr(0,6) == "btn_r_"){
- document.controls.item(i).disabled = !checkAuth("R");
- }
-
- if(document.controls.item(i).attribute("id").substr(0,6) == "btn_x_"){
- document.controls.item(i).disabled = !checkAuth("X");
- }
-
- if(document.controls.item(i).attribute("id").substr(0,6) == "btn_p_"){
- document.controls.item(i).disabled = !checkAuth("P");
- }
-
- if(document.controls.item(i).attribute("id").substr(0,6) == "btn_e_"){
- document.controls.item(i).disabled = !checkAuth("P");
- }
-
- }
- }
- }
- /**
- * @desc : 폼초기화
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- function fFormInit()
- {
- // 대출목록을 먼저 보여준다.
- btn_rendlsit.dispatch("onclick");
- // 버튼권한체크
- fchkAuth();
- model.removeNodeset("/root/main/rendlist");
- model.removeNodeset("/root/main/unrtnlist");
- model.removeNodeset("/root/main/rtnlist");
- model.removeNodeset("/root/main/chrtstatlist");
- //공통코드 가져오기...
- //M0424:차트상태코드
- zbcfGetCodeList(new Array("M0424"), new Array("/root/init/M0424"));
- // 대출용도, 대출과, 차트과, 차트담당자, 보관장소
- model.makeValue("/root/send/reqdata/ioflag" , "I");
- model.makeValue("/root/send/reqdata/useyn" , "");
- model.makeValue("/root/send/reqdata/allwardyn", "");
- model.refresh();
- submit("TRMRC00100");
-
- var today = getCurrentDate();
- var valitodd = (today.toDate()).getAddDate(-14); // 디폴트는 몇일 이전 기준으로 보여주나??
- valitodd = valitodd.getDateFormat();
- model.setValue("/root/condition/rendlist/fromrenddd" , today);
- model.setValue("/root/condition/rendlist/torenddd" , today);
- model.setValue("/root/condition/rendlist/fromdschdd" , today);
- model.setValue("/root/condition/rendlist/todschdd" , today);
- model.setValue("/root/condition/rendlist/rendcd" , "ALL");
- model.setValue("/root/condition/rendlist/appdeptcd" , "ALL");
-
- model.setValue("/root/condition/rtnlist/fromrtndd" , today);
- model.setValue("/root/condition/rtnlist/tortndd" , today);
- model.setValue("/root/condition/rtnlist/fromrenddd" , today);
- model.setValue("/root/condition/rtnlist/torenddd" , today);
- model.setValue("/root/condition/rtnlist/rendcd" , "ALL");
- model.setValue("/root/condition/rtnlist/appdeptcd" , "ALL");
-
- model.setValue("/root/condition/unrtnlist/fromrtnschedd" , today);
- model.setValue("/root/condition/unrtnlist/tortnschedd" , today);
- model.setValue("/root/condition/unrtnlist/fromrenddd" , today);
- model.setValue("/root/condition/unrtnlist/torenddd" , today);
- model.setValue("/root/condition/unrtnlist/rendcd" , "ALL");
- model.setValue("/root/condition/unrtnlist/appdeptcd" , "ALL");
- model.refresh();
-
- }
- /**
- * @desc : 등록된 환자번호인지 체킹한다..
- * @
- * @param : iptObj - 환자번호 입력 컨트롤 (pid)
- * @return :
- * @authur : 이은영 2008.09.17
- * @---------------------------------------------------
- */
- function fGetPidNo(iptObj, ref)
- {
- var chkyn = model.getValue(ref);
- if (chkyn == "Y") {
- if (iptObj.currentText.length > 0) {
- var pid = iptObj.currentText;
- pid = getCretCheckNo(pid, getUserInfo("dutplceinstcd"));
- model.makeValue(iptObj.attribute("ref"), pid);
- iptObj.refresh();
- }
- }
- }
- /**
- * @desc : 환자등록번호 조회 팝업
- * @
- * @param : refPid - 환자번호 node path
- * @ refPnm - 환자명 node path
- * @return :
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- function fGetPid(refPid, refPnm)
- {
- //조회건수가 1건일 경우 팝업창을 바로 닫는다.
- model.makeValue("/root/hidden/tmp/pidpopupinfo/checkfnexam", "1");
- model.makeValue("/root/hidden/tmp/pidpopupinfo/autoflag", "N");
- if( model.getValue("/root/hidden/tmp/pidpopupinfo/srchcond") == '' ){
- model.makeValue("/root/hidden/tmp/pidpopupinfo/srchcond", '2');
- }
-
- modal("SPPMC02500", "1","150", "150", "SPPMC02500", "/root/hidden/tmp/pidpopupinfo", "/root/send");
- model.resetInstanceNode("/root/source");
- //환자번호 copy
- var popupendflag = model.getValue("/root/main/popupendflag");
-
- if (popupendflag == "ok")
- {
- model.makeValue(refPid, model.getValue("/root/main/patinfo/patinfolist/pid"));
- if (refPnm == null) { refPnm = "" }
- if (refPnm != "") {
- model.makeValue(refPnm, model.getValue("/root/main/patinfo/patinfolist/hngnm"));
- }
- model.refresh();
- }
- }
- /**
- * @desc : 사용자 조회
- * @
- * @param : refUserid - 대출자 ID, refUserDeptcd - 소속부서코드 ( posdeptcd )
- * @return :
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- function fGetUserid(refUserid, refUsernm)
- {
- model.removenode("/root/hidden/tmp/tempuserinfo/list");
- model.reset("/root/hidden/tmp/tempuserinfo");
- var user = model.getValue(refUserid);
- var flag = "userid";
-
- if(isNaN(user)){
- flag = "usernm";
- }
-
- model.setValue("/root/hidden/tmp/userpopupinfo/param", "_OneS");
- model.setValue("/root/hidden/tmp/userpopupinfo/flag", flag);
- model.setValue("/root/hidden/tmp/userpopupinfo/searchitem", user);
-
- modal("SPZSU10103", "", "200", "200", "SPZSU10103","/root/hidden/tmp/userpopupinfo","/root/main/temp");
-
- var iParam = getParameter("SPZSU10103_");
- setCSVToNode("/root/hidden/tmp/tempuserinfo", iParam);
- clearParameter("SPZSU10103_");
-
- model.refresh();
- //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
- if( getNodesetCount("/root/hidden/tmp/tempuserinfo/list") > 0 ){
-
- var userid = model.getValue("/root/hidden/tmp/tempuserinfo/list/userid");
- var usernm = model.getValue("/root/hidden/tmp/tempuserinfo/list/usernm");
- model.makeValue(refUserid, userid);
- if (refUsernm == null) { refUsernm = ""; }
- if (refUsernm != "") {
- model.makeValue(refUsernm, usernm);
- }
- model.refresh();
- }
- }
- /**
- * @desc : 대출목록 조회
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- function fGetLendList()
- {
- model.copyNode("/root/send/reqdata", "/root/condition/rendlist");
- submit("TRMRC03501");
- // 2008.01.02. 대출목록 조회 총건수..
- model.setValue ("/root/hidden/rendcnt", grd_rendlist.rows - 1);
- cap_lendlist.refresh();
- }
- /**
- * @desc : 미반납목록 조회
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- function fGetUnRtnList()
- {
- model.copyNode("/root/send/reqdata", "/root/condition/unrtnlist");
- submit("TRMRC03502");
- // 2008.01.02. 미반납목록 조회 총건수..
- model.setValue ("/root/hidden/unrtncnt", grd_unrtnlist.rows - 1);
- cap_unrtnlist.refresh();
- }
- /**
- * @desc : 반납목록 조회
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- function fGetRtnList()
- {
- model.copyNode("/root/send/reqdata", "/root/condition/rtnlist");
- submit("TRMRC03503");
- // 2008.01.02. 미반납목록 조회 총건수..
- model.setValue ("/root/hidden/rtncnt", grd_rtnlist.rows - 1);
- cap_rtnlist.refresh();
- }
- /**
- * @desc : 분실차트 조회
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.06.11
- * @---------------------------------------------------
- */
- function fGetCherStatList()
- {
- model.copyNode("/root/send/reqdata", "/root/condition/chrtstatlist");
- submit("TRMRC03504");
- // 2008.01.02. 차트 리스트 조회 총건수..
- model.setValue ("/root/hidden/chrtstatcnt", grd_chrtstat.rows - 1);
- cap_chrtstat.refresh();
- }
- /**
- * @desc : 대출목록 - 대출일자 기간 콤보 보여줄까? 말까?
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.05.30
- * @---------------------------------------------------
- */
- function fLendTermDisabled()
- {
- var lendtermdisabled = lendterm_disabled.value;
- if (lendtermdisabled == "Y") {
- var today = getCurrentDate();
- model.setValue("/root/condition/rendlist/fromrenddd", today);
- model.setValue("/root/condition/rendlist/torenddd" , today);
- ipt_fromrenddd.disabled = false;
- ipt_torenddd.disabled = false;
- } else {
- model.setValue("/root/condition/rendlist/fromrenddd", "");
- model.setValue("/root/condition/rendlist/torenddd" , "");
- ipt_fromrenddd.disabled = true;
- ipt_torenddd.disabled = true;
- }
- ipt_fromrenddd.refresh();
- ipt_torenddd.refresh();
- }
- /**
- * @desc : 대출목록 - 퇴원일자 기간 콤보 보여줄까? 말까?
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.05.30
- * @---------------------------------------------------
- */
- function fDschTermDisabled()
- {
- var dschtermdisabled = dschterm_disabled.value;
- if (dschtermdisabled == "Y") {
- var today = getCurrentDate();
- model.setValue("/root/condition/rendlist/fromdschdd", today);
- model.setValue("/root/condition/rendlist/todschdd" , today);
- ipt_fromdschdd.disabled = false;
- ipt_todschdd.disabled = false;
- } else {
- model.setValue("/root/condition/rendlist/fromdschdd", "");
- model.setValue("/root/condition/rendlist/todschdd" , "");
- ipt_fromdschdd.disabled = true;
- ipt_todschdd.disabled = true;
- }
- ipt_fromdschdd.refresh();
- ipt_todschdd.refresh();
- }
- /**
- * @desc : 미반납목록 - 대출일자 기간 콤보 보여줄까? 말까?
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.05.30
- * @---------------------------------------------------
- */
- function fUnRtnLendTermDisabled()
- {
- var lendtermdisabled = unrtnlendterm_disabled.value;
- if (lendtermdisabled == "Y") {
- var today = getCurrentDate();
- model.setValue("/root/condition/unrtnlist/fromrenddd", today);
- model.setValue("/root/condition/unrtnlist/torenddd" , today);
- ipt_unrtnfromrenddd.disabled = false;
- ipt_unrtntorenddd.disabled = false;
- } else {
- model.setValue("/root/condition/unrtnlist/fromrenddd", "");
- model.setValue("/root/condition/unrtnlist/torenddd" , "");
- ipt_unrtnfromrenddd.disabled = true;
- ipt_unrtntorenddd.disabled = true;
- }
- ipt_unrtnfromrenddd.refresh();
- ipt_unrtntorenddd.refresh();
- }
- /**
- * @desc : 미반납목록 - 반납예정일자 기간 콤보 보여줄까? 말까?
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.05.30
- * @---------------------------------------------------
- */
- function fRtnScheTermDisabled()
- {
- var rtnschetermdisabled = rtnscheterm_disabled.value;
- if (rtnschetermdisabled == "Y") {
- var today = getCurrentDate();
- model.setValue("/root/condition/unrtnlist/fromrtnschedd", today);
- model.setValue("/root/condition/unrtnlist/tortnschedd" , today);
- ipt_fromrtnschedd.disabled = false;
- ipt_tortnschedd.disabled = false;
- } else {
- model.setValue("/root/condition/unrtnlist/fromrtnschedd", "");
- model.setValue("/root/condition/unrtnlist/tortnschedd" , "");
- ipt_fromrtnschedd.disabled = true;
- ipt_tortnschedd.disabled = true;
- }
- ipt_fromrtnschedd.refresh();
- ipt_tortnschedd.refresh();
- }
- /**
- * @desc : 반납목록 - 대출일자 기간 콤보 보여줄까? 말까?
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.05.30
- * @---------------------------------------------------
- */
- function fRtnLendTermDisabled()
- {
- var lendtermdisabled = rtnlendterm_disabled.value;
- if (lendtermdisabled == "Y") {
- var today = getCurrentDate();
- model.setValue("/root/condition/rtnlist/fromrenddd", today);
- model.setValue("/root/condition/rtnlist/torenddd" , today);
- ipt_rtnfromrenddd.disabled = false;
- ipt_rtntorenddd.disabled = false;
- } else {
- model.setValue("/root/condition/rtnlist/fromrenddd", "");
- model.setValue("/root/condition/rtnlist/torenddd" , "");
- ipt_rtnfromrenddd.disabled = true;
- ipt_rtntorenddd.disabled = true;
- }
- ipt_rtnfromrenddd.refresh();
- ipt_rtntorenddd.refresh();
- }
- /**
- * @desc : 반납목록 - 반납일자 기간 콤보 보여줄까? 말까?
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.05.30
- * @---------------------------------------------------
- */
- function fRtnRtnTermDisabled()
- {
- var rtntermdisabled = rtnrtnlendterm_disabled.value;
- if (rtntermdisabled == "Y") {
- var today = getCurrentDate();
- model.setValue("/root/condition/rtnlist/fromrtndd" , today);
- model.setValue("/root/condition/rtnlist/tortndd" , today);
- ipt_rtnfromrtndd.disabled = false;
- ipt_rtntortndd.disabled = false;
- } else {
- model.setValue("/root/condition/rtnlist/fromrtndd" , "");
- model.setValue("/root/condition/rtnlist/tortndd" , "");
- ipt_rtnfromrtndd.disabled = true;
- ipt_rtntortndd.disabled = true;
- }
- ipt_rtnfromrtndd.refresh();
- ipt_rtntortndd.refresh();
- }
- /**
- * @desc : excel 저장 하기
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fExcel(gridObj, title){
- if (title == null) { title = "" }
- var fileName = window.fileDialog("save", ",", false, title + "_" + getCurrentDate(), "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
- if (fileName != "") {
- gridObj.saveExcel(fileName, "SheetName", true, true, "", "", true);
- }
- }
|