123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008 |
- /**
- * @desc : 화면 control disabled 설정
- * @ 화면상태에 따른 control의 disable의 설정
- * @param : control id (ctrlID)
- * @return :
- * @---------------------------------------------------
- */
- function fSetCtrlDisabled(bool, updtFlag)
- {
- ipt_formfromdt.disabled = bool;
- ipt_formtodt.disabled = bool;
- ipt_formnm.disabled = bool;
- ipt_formextnnm.disabled = bool;
- ipt_formcnts.disabled = bool;
- ipt_rem.disabled = bool;
- cmb_formchosflag.disabled = bool;
- cmb_formkind.disabled = bool;
- //cmb_degnappyn.disabled = bool;
- cmb_userconfigyn.disabled = bool;
- cmb_print_only.disabled = bool;
-
- cmb_formuseflag.disabled = bool;
- //cmb_recreflockappyn.disabled = bool;
- textarea1.disabled = bool;
- cmb_reclistviewyn.disabled = bool;
- cmb_langflag.disabled = bool;
-
- // 예진서식 추가 (콤보)
- cmb_foctsnwyn.disabled = bool;
-
- // 공통기록여부
- cmb_mainyn.disabled = bool;
-
- // 인증서로딩여부
- cmb_certuseyn.disabled = bool;
-
- // 대상서식코드
- if(model.getValue("/root/main/newform/formstatus") == "0") // 수정모드 상태로 변경
- {
- ipt_srcformcd.disabled = true;
- }
- else
- {
- ipt_srcformcd.disabled = bool;
- }
-
-
- if(updtFlag == "U"){
- cmb_valiyn.disabled = bool;
-
- if(bool == false)
- ipt_formfromdt.disabled = !bool;
- if(!(bool)){
- chk_ocrflag.disabled = bool;
- if(model.getValue("/root/main/ocrflag") == "OCR"){
- cmb_formtypecls.disabled = bool;
- cmb_ocrtagprntyn.disabled = bool;
- } else {
- cmb_formtypecls.disabled = !(bool);
- cmb_ocrtagprntyn.disabled = !(bool);
- }
- cmb_formbizcls.disabled = bool;
- cmb_progflag.disabled = bool;
- }else{
- chk_ocrflag.disabled = bool;
- cmb_formbizcls.disabled = bool;
- cmb_formtypecls.disabled = bool;
- cmb_ocrtagprntyn.disabled = bool;
- cmb_progflag.disabled = bool;
- }
- }else {
- chk_ocrflag.disabled = bool;
- cmb_formbizcls.disabled = bool;
- cmb_formtypecls.disabled = !(bool);
- cmb_ocrtagprntyn.disabled = !(bool);
- cmb_progflag.disabled = bool;
- }
- btn_srchdept.disabled = bool;
- btn_srchuser.disabled = bool;
- btn_classes.disabled = bool;
- }
- function fSetValiYN()
- {
- var valiyn = model.getValue("/root/temp/valiyn");
-
- if(valiyn=='Y') // 서식유효화(무효인 서식을 유효로 바꿀 경우)
- {
- // 2009.04.14
- // 이경희
- model.setValue("/root/main/newform/formfromdt", getCurrentDate() + getCurrentTime());
-
- model.setValue("/root/main/newform/formtodt","99991231000000");
- model.setValue("/root/main/newform/formstatus", "1");
- }
- else if(valiyn=='N') // 서식무효화(유효인 서식을 무효로 바꿀 경우)
- {
- var strposinstcd = getUserInfo("dutplceinstcd");
- model.makeValue("/root/main/newform/instcd", strposinstcd);
- model.setValue("/root/main/newform/formfromdt", getCurrentDate() + getCurrentTime());
- model.setValue("/root/main/newform/formtodt", getCurrentDate() + getCurrentTime());
-
- model.setValue("/root/main/newform/formstatus", "3");
-
- // 서식을 무효화시킨 userid를 LASTRGSTDT에 저장.
- model.setValue("/root/main/newform/lastupdtrid", getUserId());
- // 서식을 무효화시킨 userid를 LASTRGSTDT에 저장.
- model.setValue("/root/main/newform/lastupdtrnm", getUserName());
-
- model.removeNodeset("/root/send/savedata");
- copyNode(model, model, "/root/send/savedata", "/root/main/newform");
- //copyNodeset("/root/send/savedata", "/root/main/ocrinfo", "append");
-
- model.removeNodeset("/root/main/formlist");
- model.removeNodeset("/root/main/formhist");
- }
-
- model.refresh();
- }
- function fRemoveBlank(str)
- {
- str = str.replace(/\s/g,'');
-
- return str;
- }
-
- function fSelectForm()
- {
- if(!isDataCell())
- return;
- iRow = grd_formlist.row;
- if(iRow < 1){
- return;
- }
- model.removeNodeset("/root/main/ocrinfo");
- model.copyNode("/root/main/newform", "/root/main/formlist[" + iRow + "]");
-
- var currentdt = getCurrentDateTime();
-
- currentdt = fRemoveBlank(currentdt);
-
- //var tempInterval = getTimeInterval(model.getValue("/root/main/newform/formtodt"), currentdt);
-
- if(parseInt(model.getValue("/root/main/newform/formtodt")) - parseInt(currentdt) > 0)
- {
- model.setValue("/root/temp/valiyn", "Y");
- }
- else
- {
- model.setValue("/root/temp/valiyn", "N");
- model.setValue("/root/temp/match_valiyn", "N");
- }
-
- if(model.getValue("/root/main/newform/formprogflag") == "OCR" || model.getValue("/root/main/newform/formprogflag") == "OCR(CODE)"){;
- //chk_ocrflag.select(0);
- model.setValue("/root/main/ocrflag", "OCR");
- cmb_formbizcls.disabled = false;
- cmb_formtypecls.disabled = false;
- cmb_ocrtagprntyn.disabled = false;
- btn_ocrwindow.attribute("visibility") = "visible";
- }else {
- //chk_ocrflag.deselect(0);
- model.setValue("/root/main/ocrflag", "");
- cmb_formbizcls.disabled = true;
- cmb_formtypecls.disabled = true;
- cmb_ocrtagprntyn.disabled = true;
- btn_ocrwindow.attribute("visibility") = "hidden";
- }
-
- var formcd = model.getValue("/root/main/newform/formcd");
- model.makeNode("/root/send/reqdata/reqdata");
- model.makeNode("/root/send/reqdata/reqflag");
- model.makeNode("/root/send/reqdata/reqfromdt");
- model.makeNode("/root/send/reqdata/reqprogflag");
- model.setValue("/root/send/reqdata/reqdata", formcd);
- model.setValue("/root/send/reqdata/reqflag", "formcd");
-
- /**
- * 수정 : 2009.09.15 안치원 TASK-2897
- * 내용 : 서식관리화면에서 서식조회조건으로 기관코드추가
- */
- model.makeValue("/root/send/reqdata/reqinstcd", model.getValue("/root/send/reqdata/reqinstcd"));
-
- // 2009-04-15
- // 이경희
- // OCR 데이터 조회시 기관별 서식사용일자가 formfromdt 가 되므로, instformfromdt를 formfromdt로 삽입.
- //model.setValue("/root/send/reqdata/reqfromdt", model.getValue("/root/main/newform/formfromdt"));
- model.setValue("/root/send/reqdata/reqfromdt", model.getValue("/root/main/newform/instformfromdt"));
- model.setValue("/root/send/reqdata/reqprogflag", model.getValue("/root/main/newform/formprogflag"));
-
- //model.setValue("/root/main/newform", "/root/send/savedata"); // 테스트
- fSetCtrlDisabled(true, "U");
-
- model.removeNode("/root/send/selectedHist");
- model.makeValue("/root/send/reqdata/selectedHist", "H");
- btn_hist.selected = true;
- submit("TRMRF00702");
-
- /////////////////////////////////////////////
- //2010.04.12, 주희경
- //서식 디자인 수정(공유해제) 중에는 서식 관리에서 서식정보 업데이트 못하도록 블러킹 추가
- model.makeValue("/root/send/req/formcd",formcd);
- submit("TRMRF02006");
- // 읽기전용인지 확인
- var readonlystatdt = model.getValue("/root/temp/forminfo/readonlylist/readonlystatdt");
- var readonlyuserid = model.getValue("/root/temp/forminfo/readonlylist/readonlyuserid");
- var userid = getUserInfo("userid");
- if ( readonlystatdt != "" && readonlystatdt != "-" ) //읽기전용등록일시정보가 있고 동일아이디가 아닌경우
- {
- var blokingdt = readonlystatdt.substr(0,4) + "/";
- blokingdt = blokingdt + readonlystatdt.substr(4,2) + "/";
- blokingdt = blokingdt + readonlystatdt.substr(6,2) + "/ ";
- blokingdt = blokingdt + readonlystatdt.substr(8,2) + ":";
- blokingdt = blokingdt + readonlystatdt.substr(10,2) + ":";
- blokingdt = blokingdt + readonlystatdt.substr(12,2);
- var readonlyusernm = model.getValue("/root/temp/forminfo/readonlylist/readonlyusernm");
- alert("["+readonlyuserid+","+readonlyusernm+"]님이 ["+blokingdt+"]부터 디자인 작업 중이므로 수정 할 수 없습니다.");
-
- btn_updtform.disabled = true;
- btn_saveform.disabled = true;
- }
- else
- {
- btn_updtform.disabled = false;
- btn_saveform.disabled = false;
- }
- /////////////////////////////////////////////
- var formuserid = model.getValue("/root/main/formhist/formuserid");
- if ( formuserid == "DEPT_BASE" && getUserInfo("posinstcd") != "001" && getUserInfo("posdeptcd") != "4130700000" ) //병원최대서식은 의료원에서만 수정 가능하도록, 2010.05.27, 주희경
- {
- btn_updtform.disabled = true;
- btn_saveform.disabled = true;
- }
- //model.refresh();
- }
- /**
- * @group :
- * @ver : 2009-03-03 오후 4:45:27
- * @by : 강지훈
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 기관별 용어 이력 리스트 조회
- * @param : selectedHist (H : 이력조회, I : 기관별 이력조회)
- * @return :
- * @---------------------------------------------------
- */
- function fGetFormHistList(selectedHist){
- var formcd = model.getValue("/root/main/newform/formcd");
- model.setValue("/root/temp/selectedHist", selectedHist);
-
- model.removeNodeset("/root/send");
- model.makeValue("/root/send/reqdata/reqdata", formcd);
- model.makeValue("/root/send/reqdata/reqflag", "formcd");
- model.makeValue("/root/send/reqdata/reqfromdt", model.getValue("/root/main/newform/formfromdt"));
- model.makeValue("/root/send/reqdata/reqprogflag", model.getValue("/root/main/newform/formprogflag"));
- model.makeValue("/root/send/reqdata/selectedHist", model.getValue("/root/temp/selectedHist"));
-
- /**
- * 수정 : 2009.09.15 안치원 TASK-2897
- * 내용 : 서식관리화면에서 서식조회조건으로 기관코드추가
- */
- model.makeValue("/root/send/reqdata/reqinstcd", model.getValue("/root/send/reqdata/reqinstcd"));
-
- // KNUH_20101119_박성호_start
- model.removeNodeset("/root/main/ocrinfo");
- // KNUH_20101119_박성호_end
- submit("TRMRF00702");
-
- // KNUH_20101119_박성호_start
- grd_ocrlist.rebuild();
- // KNUH_20101119_박성호_end
-
- model.refresh();
- }
- function fSelectFormHist()
- {
- if(!isDataCell())
- return;
- iRow = grd_formhist.row;
- if(iRow < 1){
- return;
- }
- model.copyNode("/root/main/newform", "/root/main/formhist[" + iRow + "]");
- if(parseInt(model.getValue("/root/main/newform/formtodt")) - parseInt(model.getValue("/root/main/newform/formfromdt")) > 0)
- model.setValue("/root/temp/valiyn", "Y");
- else
- model.setValue("/root/temp/valiyn", "N");
-
- var formcd = model.getValue("/root/main/newform/formcd");
- model.makeNode("/root/send/reqdata/reqdata");
- model.makeNode("/root/send/reqdata/reqflag");
- model.makeNode("/root/send/reqdata/reqfromdt");
- model.setValue("/root/send/reqdata/reqdata", formcd);
- model.setValue("/root/send/reqdata/reqflag", "formcd");
- model.setValue("/root/send/reqdata/reqfromdt", model.getValue("/root/main/newform/formfromdt"));
- if(model.getValue("/root/main/newform/formprogflag") == "OCR"){
- submit("TRMRF00704");
- }
- model.refresh();
- fSetCtrlDisabled(true, "U");
- }
- /**
- * @desc : 화면초기화
- * @ root/init/today, time에 현재 날짜와 시간 설정
- * @ 초기 화면의 번튼 비활성화
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitialize(){
- model.setFocus("ipt_srchdata");
- //model.setValue("/root/main/newform/formfromdt", getDate());
- model.setValue("/root/main/newform/formfromdt", getCurrentDate() + getCurrentTime());
- fBackupNewFormData();
- fSetFormUsge();
- grd_ocrlist.removeRow();
- grd_ocrlist.colHidden(3) = true;
- grd_ocrlist.colHidden(4) = true;
- grd_formhist.colHidden(25) = true;
- grp_mngtocr.attribute("left") = "820px";
- grp_mngtocr.attribute("top") = "60px";
- btn_ocrwindow.attribute("visibility") = "hidden";
- chk_ocrflag.disabled = true;
- cmb_formbizcls.disabled = true;
- cmb_formtypecls.disabled = true;
- cmb_ocrtagprntyn.disabled = true;
- textarea1.disabled = true;
- cmb_langflag.disabled = true;
- cmb_reclistviewyn.disabled = true;
-
- // 예진서식 추가 (콤보)
- cmb_foctsnwyn.disabled = true;
-
- // 공통기록여부
- cmb_mainyn.disabled = true;
-
- // 대상서식코드
- ipt_srcformcd.disabled = true;
-
- submit("TRMRF00706");
-
- zbcfGetCodeList( new Array("M0534"), new Array("/root/init/M0534list") );
-
- /**
- * 수정 : 2009.09.15 안치원 TASK-2897
- * 내용 : 서식관리화면에서 서식조회조건으로 기관코드추가
- */
- /* 2010.05.28, 주희경 , 기관별 서식 사용이력을 볼 때 기관별로 조회가능하여야 하도록 주석처리
- if (getUserInfo("posinstcd") == "001" && getUserInfo("posdeptcd") == "4130700000") {
- cmb_cond_instcd.attribute("visibility") = "visible";
- } else {
- cmb_cond_instcd.attribute("visibility") = "hidden";
- }
- */
- model.setValue("/root/main/condition/reqinstcd", getUserInfo("dutplceinstcd"));
-
- model.refresh();
- }
- function fBackupNewFormData()
- {
- copyNode(model, model, "/root/temp/newform", "/root/main/newform");
- }
- function fRestoreNewFormData()
- {
- copyNode(model, model, "/root/main/newform", "/root/temp/newform");
- model.refresh();
- }
- /**
- * @desc : 서식분류코드를 main화면에 설정한다
- *
- * @param : 그리드 id (grdID)
- * @return :
- * @---------------------------------------------------
- */
- function fSetFormCls(){
- /*var param = getParameter("pathnm");
- var param2 = getParameter("pathnm", 2);
- var formclsnm = param.split('.');
- var formclscd = param2.split('.');
- model.setValue("/root/main/newform/formclsnm" , formclsnm[0]);
- model.setValue("/root/main/newform/formclsnm2", formclsnm[1]);
- model.setValue("/root/main/newform/formclsnm3", formclsnm[2]);
- model.setValue("/root/main/newform/formclsnm4", formclsnm[3]);
- model.setValue("/root/main/newform/formclscd" , formclscd[0]);
- model.setValue("/root/main/newform/formclscd2", formclscd[1]);
- model.setValue("/root/main/newform/formclscd3", formclscd[2]);
- model.setValue("/root/main/newform/formclscd4", formclscd[3]);
- model.refresh();*/
- }
- /**
- * @desc : Grid 저장 후 화면을 clear
- *
- * @param : 그리드 id (grdID)
- * @return :
- * @---------------------------------------------------
- */
- function fClrGrdStatus(grdID){
- var totRow = grdID.rows;
- for(var i = grdID.fixedRows; i < totRow; i++){
- var statusflag = grdID.rowstatus(i);
- if(statusflag == 1 || statusflag == 2){
- grdID.rowstatus(i) = 0;
- }else if(statusflag == 4){
- grdID.deleteItem(i);
- }
- }
- }
- /**
- * @desc : 서식분류 팝업창 Open
- *
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fOpenFormClsWnd(){
- var xpos = event.screenX + 100;
- var ypos = event.screenY - 500;
- var scnNo;
- if(xpos > 1000){
- scnNo = 2;
- }else{
- scnNo = 1;
- }
- modal("SPMRF00701_서식분류", scnNo, xpos, ypos );
- fSetFormCls();
- }
- function fCreateForm()
- {
- model.resetInstanceNode("/root/main/newform");
- model.removeNodeset("/root/main/formhist");
- model.makeValue("/root/main/newform/formstatus", "0"); // 신규 서식작성
-
- // 2009.04.14
- // 이경희
- // 신규 서식의 경우 시작일자는 무조건 "일자" + "00:00.00" 으로 한다.
- //model.makeValue("/root/main/newform/formfromdt", getCurrentDate() + getCurrentTime());
- model.makeValue("/root/main/newform/formfromdt", getCurrentDate() + "000000");
-
- model.makeValue("/root/main/newform/formtodt", "99991231" + getCurrentTime());
- model.makeValue("/root/main/newform/formchosflag", "C");
- model.makeValue("/root/main/newform/formkind", "C");
- model.makeValue("/root/main/newform/degnappyn", "Y");
- model.makeValue("/root/main/newform/userconfigyn", "N"); // UserConfigYN 컬럼
- model.makeValue("/root/main/newform/recreflockappyn", "N");
- model.makeValue("/root/main/newform/sortno", "0");
- model.makeValue("/root/main/newform/reclistviewyn", "Y");
- model.makeValue("/root/main/newform/langflag", "KO");
-
- // 예진서식 노드 추가
- model.makeValue("/root/main/newform/foctsnwyn", "N");
-
- // mainYN 기록 노드 추가
- model.makeValue("/root/main/newform/mainyn", "N");
-
- // print_only 노드 추가
- model.makeValue("/root/main/newform/print_only", "N");
-
- // 디자인 완료 노드 추가
- model.makeValue("/root/main/newform/degncmpltyn", "-");
-
- // certuseyn 노드 추가
- model.makeValue("/root/main/newform/certuseyn", "N");
-
- fSetCtrlDisabled(false);
-
- model.setFocus("ipt_formnm");
- chk_ocrflag.deselect(0);
- btn_ocrwindow.attribute("visibility") = "hidden";
-
- cmb_formuseflag.select(0);
- cmb_progflag.select(0);
- model.removeNodeset("/root/main/ocrinfo");
- model.removeNodeset("/root/main/ocrreview");
- model.refresh();
- }
- function fModifyForm()
- {
- if(model.getValue("/root/main/newform/formcd") == ""){
- messageBox("수정할 서식이", "I004");
- return;
- }
- model.makeValue("/root/main/newform/oldformfromdt", model.getValue("/root/main/newform/formfromdt"));
- model.makeValue("/root/main/newform/oldformtodt", model.getValue("/root/main/newform/formtodt"));
- // 2009.04.14
- // 이경희
- // 예를 들어 4/1 등록한 서식이 있을 경우 4/4 에 해당 서식을 수정하면 서식의 Fromdt 가 현재일자로 수정되어
- // 기관별 시작일자보다 서식의 시작일자가 뒤에 위치하는 문제가 생김.
- //model.makeValue("/root/main/newform/formfromdt", getCurrentDate() + getCurrentTime());
- model.makeValue("/root/main/newform/formfromdt", model.getValue("/root/main/newform/formfromdt"));
-
- model.makeValue("/root/main/newform/formstatus", "1"); // 수정모드 상태로 변경
- fSetCtrlDisabled(false, "U");
- model.setFocus("ipt_formnm");
- model.refresh();
- }
- function fSaveForm()
- {
- var status = model.getValue("/root/main/newform/formstatus");
-
- var chk_formuseflag = model.getValue("/root/main/newform/formuseflag");
- var chk_formdeptnm = model.getValue("/root/main/newform/formdeptnm");
- var chk_formusernm = model.getValue("/root/main/newform/formusernm");
- var chk_formnm = model.getValue("/root/main/newform/formnm");
- var chk_ipt_srcformcd = model.getValue("/root/main/newform/srcformcd");
-
- if(status ==""){
- messageBox("저장할 서식이", "I004");
- return;
- }
- if ((chk_formuseflag == "D") && (chk_formdeptnm == "")){
- messageBox("서식사용부서를", "C001");
- return;
- } else if((chk_formuseflag == "I") && (chk_formdeptnm == "") && (chk_formusernm == "")){
- messageBox("서식사용부서와 서식사용자를", "C001");
- return;
- }else if((chk_formuseflag == "I") && (chk_formdeptnm != "") && (chk_formusernm == "")){
- messageBox("서식사용자를", "C001");
- return;
- }else if((chk_formuseflag == "I") && (chk_formdeptnm == "") && (chk_formusernm != "")){
- messageBox("서식사용부서를", "C001");
- return;
- }else if(chk_formnm == ""){
- messageBox("서식명칭을", "C001");
- return;
- }else if(chk_ipt_srcformcd == ""){
- if(status == 1)
- {
- messageBox("기본서식코드가 없습니다. 기본서식코드를 ", "C001");
- return;
- }
- }
- var struserid = getUserInfo("userid");
- model.makeValue("/root/main/newform/userid", struserid);
-
- if (model.getValue("/root/main/newform/formprogflag") == "OCR")
- {
- if(model.getValue("/root/main/ocrinfo/ocrfilenm") == ""){
- messageBox("OCR 이미지를", "C001");
- return;
- }
- if(model.getValue("/root/main/newform/formbizcls") == ""){
- messageBox("OCR 업무분류 정보를", "C001");
- return;
- }
- if(model.getValue("/root/main/newform/formtypecls") == ""){
- messageBox("OCR 분류 정보를", "C001");
- return;
- }
- if(model.getValue("/root/main/newform/ocrtagprntyn") == ""){
- messageBox("OCR Tag 출력여부를", "C001");
- return;
- }
- }
-
- if(status == 1)
- {
- var formfromdt = model.getValue("/root/main/newform/formfromdt");
- var currentDateTime = getCurrentDate() + getCurrentTime();
-
- if( (parseInt(formfromdt) - parseInt(currentDateTime)) > 0)
- {
- messageBox("미래서식의 경우는 변경이력없이 저장", "I008");
- }
- }
-
- //2009.03.11 강지훈 수정
- //변경이력을 남기지 않고 Update.
- // formstatus: 1 수정모드
- if(model.getValue("/root/main/newform/formstatus") == "1"){
- var ret = messageBox("변경 이력을 저장", "S001");
-
- // 2009.04.23 이경희
- // OCR 서식이면서 OCR이미지 변경없이 서식내용만 변경하는 경우
- // OCR 이미지 새로 등록없이 서식 내용만 업데이트함
- if (model.getValue("/root/main/newform/formprogflag") == "OCR")
- {
- if(ret == "7")
- model.setValue("/root/main/newform/formstatus", "4");
- }
-
- if(ret == "6"){
- model.removenode("/root/main/newform/histsaveyn");
- model.makeValue("/root/main/newform/histsaveyn", "Y");
- }
- else if(ret == "7"){
- model.removenode("/root/main/newform/histsaveyn");
- model.makeValue("/root/main/newform/histsaveyn", "N");
- }
- else{
- return;
- }
- }
- var strposinstcd = getUserInfo("dutplceinstcd");
- model.makeValue("/root/main/newform/instcd", strposinstcd);
- copyNodeset("/root/main/newform", "/root/main/ocrinfo", "append");
- //model.setValue("/root/main/newform/formfromdt", model.getValue("/root/main/newform/formfromdt") + getCurrentTime());
- //model.setValue("/root/main/newform/formtodt", model.getValue("/root/main/newform/formtodt") + "235959");
- model.removeNodeset("/root/send/savedata");
- copyNode(model, model, "/root/send/savedata", "/root/main/newform");
- copyNodeset("/root/send/savedata", "/root/main/ocrinfo", "append");
- model.removeNodeset("/root/main/formlist");
- model.removeNodeset("/root/main/formhist");
- //grd_formlist.rebuild();
-
- var valiyn = model.getValue("/root/temp/valiyn");
-
- if(valiyn == 'N') // 서식무효화
- {
- model.removeNodeset("/root/send/savedata");
- copyNode(model, model, "/root/send/savedata", "/root/main/newform");
-
- // 서식을 새로 등록하도록 변경
- model.setValue("/root/send/savedata/formstatus", '3');
-
- model.setValue("/root/temp/valiyn", "Y");
- }
-
- submit("TXMRF00701");
- //model.makeValue("/root/main/newform/formstatus", "");
-
- fRestoreNewFormData();
- fSetCtrlDisabled(true, "U");
- }
- function fCallClassesInfo()
- {
- model.removeNodeset("/root/send");
- model.makeValue("/root/send/paramindx","");
- model.setValue("/root/send/paramindx", model.getValue("/root/temp/condition/indxflag"));
-
- setParameter("indxflag","F");
- modal("SPMRF02100", 1,10, 10, "SPMRF02100", "/root/send", "/root/temp/condition/getdata");
- var child = "SPMRF02100";
-
- if(child != null)
- {
- //var valindxnm = getParameter("valindxnm");
-
- var depthnm1 = getParameter("depthnm1");
- var depthnm2 = getParameter("depthnm2");
- var depthnm3 = getParameter("depthnm3");
- var depthnm4 = getParameter("depthnm4");
- var depthnm5 = getParameter("depthnm5");
- var indxcd = getParameter("indexcode");
- var pathcd = getParameter("pathcd");
-
-
- //model.setValue("/root/main/imginfo/imgindxnm", imgindxnm);
- model.makeValue("/root/main/newform/depthnm1", depthnm1);
- model.makeValue("/root/main/newform/depthnm2", depthnm2);
- model.makeValue("/root/main/newform/depthnm3", depthnm3);
- model.makeValue("/root/main/newform/depthnm4", depthnm4);
- model.makeValue("/root/main/newform/depthnm5", depthnm5);
- model.makeValue("/root/main/newform/formclsseq", indxcd);
- model.makeValue("/root/main/newform/formlevlcd", pathcd);
- model.refresh();
-
- if(depthnm1 == "진료서식") // 대분류가 진료서식인 경우
- {
- if(depthnm2 == "공통서식") // 중분류가 공통서식인 경우
- {
- model.setValue("/root/main/newform/mainyn", "Y"); // 공통서식 Y
-
- model.setValue("/root/main/newform/foctsnwyn", "N"); // 예진서식 N
- }
- else if(depthnm2 == "예진기록") // 중분류가 예진기록인 경우
- {
- model.setValue("/root/main/newform/mainyn", "N"); // 공통서식 N
-
- model.setValue("/root/main/newform/foctsnwyn", "Y"); // 예진서식 Y
- }
- else
- {
- model.setValue("/root/main/newform/mainyn", "N"); // 공통서식 N
-
- model.setValue("/root/main/newform/foctsnwyn", "N"); // 예진서식 N
- }
- }
- else if(depthnm1 == "제증명") // 대분류가 제증명인 경우
- {
- model.setValue("/root/main/newform/mainyn", "N"); // 공통서식 N
-
- model.setValue("/root/main/newform/foctsnwyn", "N"); // 예진서식 N
- }
- else // 기타 서식인 경우
- {
- model.setValue("/root/main/newform/mainyn", "N"); // 공통서식 N
-
- model.setValue("/root/main/newform/foctsnwyn", "N"); // 예진서식 N
- }
- }
-
- model.refresh();
- }
- function fCallDeptInfo(){
- var search_condition = "deptcd";
- var search_term = "";
- var receive_deptcd_path = "/root/main/newform/formdeptcd";
- var receive_deptnm_path = "/root/main/newform/formdeptnm";
- var standard_yn = null;
- var ord_deptflag = null;
-
- var dutinstcd = getUserInfo("dutplceinstcd");
-
- //zbcfOpenInstDeptCodeList(search_condition, search_term, receive_deptcd_path, receive_deptnm_path, standard_yn, ord_deptflag, new Array("deptcd", "depthngnm"));
- //zbcfOpenInstDeptCodeList(search_condition, search_term, receive_deptcd_path, receive_deptnm_path, 'orduseyn', ord_deptflag, new Array("deptcd", "depthngnm"));
- //zbcfOpenAssignedInstDeptCodeList("012", search_condition, search_term, receive_deptcd_path, receive_deptnm_path, 'orduseyn', ord_deptflag, new Array("deptcd", "depthngnm"));
- zbcfOpenAssignedInstDeptCodeList(dutinstcd, search_condition, search_term, receive_deptcd_path, receive_deptnm_path, standard_yn, ord_deptflag, new Array("deptcd", "depthngnm"));
- }
- function fSrchForm()
- {
- var formnm = "";
- var reqflag = model.getValue("/root/main/condition/reqflag");
-
- if(reqflag == "formcd"){
-
- var sCode = model.getValue("/root/main/condition/reqdata");
-
- var sTmp = "";
- var iTmp = 0;
-
- // form코드 입력시 자릿수 채워준다
-
- var iCodeLength = sCode.length;
- if(iCodeLength ==0){
- messageBox(ipt_srchdata.label +" 서식코드 조건을", "C001");
- return;
-
- }
- else if(iCodeLength > 10){
- messageBox(ipt_srchdata.label +" 서식코드 자리수를 올바르게 ", "C001");
- return;
- }
-
- var temp = 10 - iCodeLength;
-
- for(var i = 1; i <= temp; i++){
- sTmp += "0";
- }
- sTmp = sTmp + sCode;
- model.setValue("/root/main/condition/reqdata",sTmp);
- }
- formnm = model.getValue("/root/main/condition/reqdata");
- // 유효 및 전체 조회시 검색 값이 없는 경우 검색값 요청을 하도록 수정
- if(formnm == "")
- {
- messageBox(ipt_srchdata.label +" 조회할 서식을 ", "C001");
- return;
- }
- model.setValue("/root/main/condition/reqdata",formnm.toUpperCase());
-
- // 서식관리에서 보낸 쿼리라는것을 명시
- model.makeValue("/root/main/condition/reqsrch", "formmaster");
- model.makeNode("/root/send/reqdata");
- model.copyNode("/root/send/reqdata", "/root/main/condition");
- submit("TRMRF00701");
-
- // 서식디자인 생성안한 것들을 색상으로 표시
- //fClassificationForm();
-
- // "/root/temp/newform"노드를 "/root/main/newform"로 복사해둠
- fRestoreNewFormData();
- }
- function fSetFormUsge()
- {
- var chk_formuseflag = model.getValue("/root/main/newform/formuseflag");
- if (chk_formuseflag == "D"){ // 부서
- btn_srchdept.disabled = "false";
- btn_srchuser.disabled = "true";
- } else if(chk_formuseflag == "I"){ // 개인
- btn_srchdept.disabled = "false";
- btn_srchuser.disabled = "false";
- }else if(chk_formuseflag == "C"){ // 공통
- btn_srchdept.disabled = "true";
- btn_srchuser.disabled = "true";
- model.setValue("/root/main/newform/formdeptcd", "");
- model.setValue("/root/main/newform/formdeptnm", "");
- }
- model.refresh();
- }
- function fClassificationForm()
- {
- // 서식을 생성하지 않은 것들을 색상으로 분류함.
- try
- {
- /*
- // 과별서식, 공통서식
- var srchformlist = model.instances(0).selectNodes("/root/main/formlist[formprogflag != 'OCR' and formprogflag != 'PROF(CODE)' and formprogflag != 'PROF']");
- //var srchformlist = model.instances(0).selectNodes("/root/main/formlist[formprogflag = '-' or (formprogflag = 'PROG' and formcd = srcformcd and formkind = 'C' and formprognm != '-']");
-
- var totalRows = grd_formlist.rows - 1;
-
- if(totalRows < 1){
- return;
- }
- var forminfo = "";
-
- for(var idx = 0 ; idx < totalRows; idx++)
- {
- forminfo = srchformlist.item(idx);
-
- if(forminfo != null)
- {
- var formcd = forminfo.selectSingleNode("formcd").text;
-
- if(forminfo.selectSingleNode("formdegnseq").text == ""
- || forminfo.selectSingleNode("formdegnseq").text == "0")
- {
- grd_formlist.rowstyle(idx + 1, "data", "background-color") = "#FFCCFF";
- }
- }
- }
- grd_formlist.refresh();
- */
- }
- catch(e)
- {
- return;
- }
-
- }
- function fSetFormUse()
- {
- if(fIsFutureForm() == true)
- {
- model.removeNodeset("/root/send/grdsaverslt");
- model.makeValue("/root/send/formuse/reqlist", getGridUpdateData(grd_formlist));
- //model.makeValue("/root/send/formuse", grd_formlist.getUpdateData());
-
- model.makeValue("/root/send/formuse/reqinstcd", model.getValue("/root/send/reqdata/reqinstcd"));
- submit("TXMRF00702");
- model.refresh();
- }
- fSrchForm();
- }
- function fIsFutureForm()
- {
- var totalRows = grd_formlist.rows - 1;
-
- if(totalRows < 1){
- return;
- }
- var srchformlist = model.instances(0).selectNodes("/root/main/formlist");
-
- var forminfo = "";
-
- for(var idx = 0 ; idx < totalRows; idx++)
- {
- forminfo = srchformlist.item(idx);
- if(forminfo != null)
- {
- var formcd = forminfo.selectSingleNode("formcd").text;
- var formfromdt = forminfo.selectSingleNode("formfromdt").text;
- var currentDateTime = getCurrentDate() + getCurrentTime();
-
- if( (parseInt(formfromdt) - parseInt(currentDateTime)) > 0)
- {
- messageBox("미래일자의 서식은 사용여부를 저장", "E001");
- return false;
- }
- }
- }
-
- return true;
- }
- function fPreviewFormdegn()
- {
- var row = grd_formlist.row;
- var formcd = model.getValue("/root/main/formlist["+row+"]/formcd");
- var formprogflag = model.getValue("/root/main/formlist["+row+"]/formprogflag");
- var formxrwyn = model.getValue("/root/main/formlist["+row+"]/formxrwyn");
- var formdegnseq = model.getValue("/root/main/formlist["+row+"]/formdegnseq");
- model.copyNode("/root/main/forminfo/formmast", "/root/main/formlist["+row+"]");
- if(formprogflag == "MAIN" || formprogflag == "PROF" || formprogflag == "-" || formprogflag == "PROG")
- {
- if(formxrwyn == "Y" && formdegnseq != "")
- {
- setParameter("SPMRF05500_formcd", formcd);
-
- modal("SPMRF05500", 1,10, 10, "SPMRF05500", "", "");
- //open("SPMRF05500", "2", 0, 0, "SPMRF05500", "", "");
- }
- else
- messageBox("해당 서식은 저장되지", "E007");
- }
- else
- {
- messageBox("해당 서식은 " + formprogflag + " 유형 서식", "I009");
- return;
- }
- }
- function fOcrLoad(url){
-
- f_View.ViewMode = 0;
- f_View.pageremove(0,0);
- f_View.pageappend(url,0,0);
- f_View.fitmode = 3;
- f_View.pagecurrent = 1;
- f_View.AutoRefresh = true;
- }
- function fOcrLoadFile(filenm){
- var ocrfilenm ="C:\\OCRMngt_ImgeFile\\"+filenm;
-
- f_View.ViewMode = 0;
- f_View.pageremove(0,0);
- f_View.pageappend(ocrfilenm,0,0);
- f_View.fitmode = 3;
- f_View.pagecurrent = 1;
- f_View.AutoRefresh = true;
- }
- function fOcrLoadTotal(fso, filenm, newCtrObj, filepath)
- {
- f_View.pageremove(0,0);
- f_View.pageappend(filenm,0,0);
-
- var basename;
- var extname;
- var arrayFile = "";
-
- basename = fso.getbasename(filenm);
- extname = fso.getextensionname(filenm);
- for(var page = 1; page <= f_View.pagetotal ; page++){
- f_View.pagecurrent = page;
- f_View.filesavecreate(filepath + "/temp/" + basename + "-" + page + "." + extname ,-1);
- Filenm = (filepath + "/temp/" + basename + "-" + page + "." + extname);
-
- grd_ocrlist.addRow(false,false);
- grd_ocrlist.valueMatrix(grd_ocrlist.row, grd_ocrlist.colRef("ocrfilenm")) = basename + "-" + page + "." + extname;
- grd_ocrlist.valueMatrix(grd_ocrlist.row, grd_ocrlist.colRef("ocrdata")) = loadGrd(Filenm);
- grd_ocrlist.valueMatrix(grd_ocrlist.row, grd_ocrlist.colRef("filepath")) = filepath;
-
- setImageRefInstance("/root/main/ocrinfo["+grd_ocrlist.row+"]/ocrdata");
-
- }
- }
- function loadGrd(Filenm){
- img.src = Filenm;
-
- return img.getBase64data()
- }
- function fDelFile(haveFile, fso){
- currFile = new Enumerator(haveFile.Files);
- for( ; !currFile.atEnd(); currFile.moveNext()){
- fso.DeleteFile(currFile.item().path, true);
- }
- }
|