123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
- <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
- <xhtml:head>
- <xhtml:title>Medical Reference 색인관리</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <main>
- <formdata>
- <item>
- <status/>
- <indxno/>
- <indxnm/>
- <supindxno/>
- <indxrefseq/>
- <depth/>
- <indxhistseq/>
- <image/>
- <orddeptcd/>
- </item>
- <cpinfo>
- <appdd/>
- <cpgno/>
- <cpghistseq/>
- </cpinfo>
- </formdata>
- <indxlist>
- <itemlist>
- <item>
- <status/>
- <indxno/>
- <indxnm/>
- <supindxno/>
- <indxrefseq/>
- <depth/>
- <indxhistseq/>
- <image/>
- <orddeptcd/>
- </item>
- </itemlist>
- <popupmenu>
- <tree>
- <supmenu>
- <name>새폴더</name>
- <func>fFolderAdd</func>
- </supmenu>
- <supmenu>
- <name>이름바꾸기</name>
- <func>fFolderSet</func>
- </supmenu>
- <supmenu>
- <name>삭제</name>
- <func>fFolderDel</func>
- </supmenu>
- <supmenu>
- <name>-</name>
- <func/>
- </supmenu>
- <supmenu>
- <name>폴더순서변경</name>
- <func>fFolderOrderSet</func>
- </supmenu>
- <supmenu>
- <name>색인 추가</name>
- <func>fIndxAdd</func>
- </supmenu>
- <submenu>
- <name>새폴더</name>
- <func>fFolderAdd</func>
- </submenu>
- <submenu>
- <name>이름바꾸기</name>
- <func>fFolderSet</func>
- </submenu>
- <submenu>
- <name>삭제</name>
- <func>fFolderDel</func>
- </submenu>
- <submenu>
- <name>-</name>
- <func/>
- </submenu>
- <submenu>
- <name>폴더순서변경</name>
- <func>fFolderOrderSet</func>
- </submenu>
- <submenu>
- <name>색인 추가</name>
- <func>fIndxAdd</func>
- </submenu>
- <indxmenu>
- <name>파일다운로드</name>
- <func>fFileDown</func>
- </indxmenu>
- <indxmenu>
- <name>-</name>
- <func/>
- </indxmenu>
- <indxmenu>
- <name>삭제</name>
- <!--func>fIndxDel</func-->
- <func>fFolderDel</func>
- </indxmenu>
- </tree>
- </popupmenu>
- </indxlist>
- <indexinfo>
- <item/>
- </indexinfo>
- <srcindxinfo>
- <itemlist/>
- </srcindxinfo>
- <attfileinfo/>
- <drugdeptlist/>
- </main>
- <hidden>
- </hidden>
- <send>
- </send>
- <init>
- </init>
- <temp>
- <copysset>
- <copy>
- <item/>
- </copy>
- </copysset>
- <supindx>
- <supindxno/>
- </supindx>
- <reqdata>
- <selectIndxCd/>
- <selectIndxNm/>
- </reqdata>
- <selecedkind>
- <kind/>
- <newfolder/>
- </selecedkind>
- <savedfolder>
- <item>
- <indxno/>
- <indxhistseq/>
- <supindxno/>
- <indxrefseq/>
- <indxnm/>
- </item>
- </savedfolder>
- <openeruid/>
- </temp>
- </root>
- </instance>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- // 각 기관별 약제팀 조회
- submit("TRMMD05201");
- fInitialize() ;
- ]]>
- </script>
- <submission id="TRMMD05001" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqdata" resultref="/root/main/srcindxinfo/itemlist"/>
- <submission id="TXMMD05001" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqdata" resultref="/root/temp/savedfolder"/>
- <!--submission id="TXMMD05002" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/main/attfileinfo" resultref="/root/main/attfileinfo"/-->
- <submission id="TXMMD05002" mediatype="multipart/form-data" method="form-data-post" ref="/root/main/attfileinfo" resultref="/root/temp/savedfolder"/>
- <submission id="TXMQP00601" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/temp/masterinfo"/>
- <submission id="TRMMD05201" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqdata" resultref="/root/main/drugdeptlist"/>
- </model>
- <script type="javascript" src="../../../com/commonweb/js/common.js"/>
- <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/utilHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
- <script type="javascript">
- <![CDATA[
- var folerImg = "../../../com/commonweb/images/icon_folder_close.gif";
- var fileImg = "../../../com/commonweb/images/icon_list.gif";
- var selectIndxCd = model.getValue("/root/temp/reqdata/selectIndxCd");
- var flagcd = "";
- var itemRef = "/root/main/indxlist/itemlist/item";
- var iFocusIndx;
- var preItem;
- var preindx;
- var sIndxNo = "";
- var tIndxNo = "";
- var appCpYN = "N";
-
- //초기화 및 색인을 조회한다.
- function fInitialize() {
- opener.browser1.Navigate("about:blank");
- fGetIndxList("A");
- }
-
- //색인을 조회한다.
- function fGetIndxList(flag) {
- var indxnmSch = opener.model.getValue("/root/main/search_cond/indxnm"); // 조회할 색인명
- var orddeptcd = opener.model.getValue("/root/main/search_cond/orddeptcd"); // 조회할 부서코드
-
- // 전체 조회할수 없다. 부서코드 없으면 실행 중단
- if ( orddeptcd == "" ) return;
-
- model.removeNodeset("/root/send/reqdata");
- model.makeNode("/root/send/reqdata");
-
- model.resetInstanceNode("/root/main/indxlist/itemlist");
- model.copyNode("/root/send/reqdata", "/root/temp/reqdata");
-
- model.makeValue("/root/send/reqdata/mode", "A" ); //all index list
- model.makeValue("/root/send/reqdata/indxnm", indxnmSch ); //all index list
- model.makeValue("/root/send/reqdata/orddeptcd", orddeptcd ); //all index list
- //model.makeValue("/root/send/reqdata/selectIndxCd", 0 ); //최상위색인번호
-
- if( submit("TRMMD05001") ){
-
- // 조회 결과를 /root/main/indxlist/itemlist 로 복사
- model.copyNode("/root/main/indxlist/itemlist", "/root/main/srcindxinfo/itemlist");
- treeview1.rebuild();
- fImageMapping();
-
- }
- }
-
- //아이템에 이미지를 매핑시킨다.
- function fImageMapping() {
- var indxCnt = treeview1.length;
- for(var i = 1; i <= indxCnt; i++){
- //말단 아이템이 아니라면 폴더 이미지를 설정한다.
- if( model.getValue(itemRef + "[" + i + "]/fileno") == 0 ){
- model.setValue(itemRef + "[" + i + "]/image", folerImg);
- }else {
- model.setValue(itemRef + "[" + i + "]/image", fileImg);
- }
- }
- treeview1.rebuild();
- }
- //폴더를 추가하는 메뉴그룹을 연다. ( '확인' 이벤트를 실행하면 DB에 저장한다.)
- function fFolderAdd() {
-
- // 진료부서 권한 체크 로직
- if ( !fchkFolderAuth("new") ) return;
-
- if(parseInt(event.clientY) > 590 ){
- group2.attribute("top") = "590px";
- } else{
- group2.attribute("top") = event.clientY;
- }
- group2.attribute("left") = 100;
- group2.attribute("height") = 55;
-
- //추가되는 색인의 조회순서는 Default로 선택한 아이템의 가장 마지막 차일드 아이템 조회순서(indxrefseq) + 1 이다.
- var prtIndx = iFocusIndx;
- var treeItemNodeSet = treeview1.itemset.attribute("nodeset");
- var srcLastChildItemIndex = getLastChildItemIndex( prtIndx , treeItemNodeSet );
- var lastNodeSeq = model.getValue(itemRef + "[" + (srcLastChildItemIndex+1) + "]/indxrefseq");
- model.setValue("/root/main/formdata/item/indxrefseq", (parseInt(lastNodeSeq) + 1) ); //마지막 노드의 조회순서+1
- model.setValue("/root/main/formdata/item/supindxno", model.getValue(itemRef + "[" + (prtIndx + 1) + "]/indxno"));
- model.setValue("/root/main/formdata/item/indxnm", "");
- model.setValue("/root/main/formdata/item/image", folerImg);
-
- //iFocusIndx = prtIndx; //전역변수 iFocusIndx에 포커스인덱스를 넣는다.
- cap_menu.attribute("text") = "폴더명";
- btn_ok.attribute("visibility") = "visible";
- btn_modify.attribute("visibility") = "hidden";
- btn_find.attribute("visibility") = "hidden";
- input2.attribute("visibility") = "hidden";
- inpt_srch.refresh();
- inpt_srch.disabled = false;
- model.setFocus("inpt_srch");
- model.setValue("/root/temp/selecedkind/kind", "F");
-
- }
-
- //색인 추가하는 메뉴그룹을 연다.
- function fIndxAdd() {
-
- if ( !fchkFolderAuth("indxnew") ) return;
-
- if(parseInt(event.clientY) > 590 ){
- group2.attribute("top") = "590px";
- } else{
- group2.attribute("top") = event.clientY;
- }
- group2.attribute("left") = 100;
- group2.attribute("height") = 55;
-
- model.removeNodeset("/root/main/attfileinfo/attach/file");
-
- //추가되는 색인의 조회순서는 Default로 선택한 아이템의 가장 마지막 차일드 아이템 조회순서(indxrefseq) + 1 이다.
- var prtIndx = iFocusIndx;
- var treeItemNodeSet = treeview1.itemset.attribute("nodeset");
- var srcLastChildItemIndex = getLastChildItemIndex( prtIndx , treeItemNodeSet );
- var lastNodeSeq = model.getValue(itemRef + "[" + (srcLastChildItemIndex+1) + "]/indxrefseq");
- model.setValue("/root/main/formdata/item/indxrefseq", (parseInt(lastNodeSeq) + 1) ); //마지막 노드의 조회순서+1
- model.setValue("/root/main/formdata/item/supindxno", model.getValue(itemRef + "[" + (prtIndx + 1) + "]/indxno"));
- model.setValue("/root/main/formdata/item/indxnm", "");
- //model.setValue("/root/main/formdata/item/cpgflagcd", model.getValue("/root/temp/reqdata/cpgflagcd"));
- model.setValue("/root/main/formdata/item/image", fileImg);
-
- //cpg 검색 그리드에서 cpg를 선택했다면, 그 cpgno를 셋팅
- /*
- if(opener.model.getValue("/root/main/search_cond/no") != ""){
- model.setValue("/root/temp/reqdata/cpgno", opener.model.getValue("/root/temp/selected/cpgno"));
- model.setValue("/root/main/formdata/item/cpghistseq", opener.window.javascript.fModifyCpgHistSeq(opener.model.getValue("/root/temp/selected/cpghistseq"))); //임시->9999
- model.setValue("/root/main/formdata/item/indxnm", opener.model.getValue("/root/temp/selected/cpgnm"));
-
- model.setValue("/root/main/formdata/cpinfo/cpgno", model.getValue("/root/temp/reqdata/cpgno"));
- model.setValue("/root/main/formdata/cpinfo/cpghistseq", model.getValue("/root/main/formdata/item/cpghistseq"));
- }
- */
-
- //if( !isNull(model.getValue("/root/temp/reqdata/cpgno")) ){
- //model.setValue("/root/main/formdata/item/cpgno", model.getValue("/root/temp/reqdata/cpgno"));
- cap_menu.attribute("text") = "색인명";
- btn_ok.attribute("visibility") = "visible";
- btn_modify.attribute("visibility") = "hidden";
- btn_find.attribute("visibility") = "visible";
- inpt_srch.refresh();
- inpt_srch.disabled = false;
- model.setValue("/root/temp/selecedkind/kind", "i");
-
- /*}else{
- messageBox("CP를 ", "C002");
- group2.attribute("height") = 0;
- return;
- }
- */
- }
-
- //폴더를 수정하는 동시에, DB에 저장한다.
- function fFolderSet(){
-
- // 폴더 수정권한 체크
- if ( !fchkFolderAuth("set") ) return;
-
- if( model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/supindxno") == "0" ){
- messageBox("최상위 폴더명은 수정", "E001");
- return;
- }
-
- if(parseInt(event.clientY) > 590 ){
- group2.attribute("top") = "590px";
- } else{
- group2.attribute("top") = event.clientY;
- }
- group2.attribute("left") = 100;
- group2.attribute("height") = 55;
- model.setValue("/root/main/formdata/item/indxnm", model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/indxnm"));
- model.setValue("/root/main/formdata/item/indxno", model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/indxno"));
- model.setValue("/root/main/formdata/item/indxhistseq", model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/indxhistseq"));
- model.setValue("/root/main/formdata/item/indxrefseq", model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/indxrefseq"));
- inpt_srch.refresh();
- cap_menu.attribute("text") = "폴더명";
- btn_ok.attribute("visibility") = "hidden";
- btn_modify.attribute("visibility") = "visible";
- btn_find.attribute("visibility") = "hidden";
- inpt_srch.disabled = false;
- model.setFocus("inpt_srch");
- model.setValue("/root/temp/selecedkind/kind", "F");
- }
-
- //색인을 수정한다.
- function fIndxSet(){
- /*
- //COPY SET을 뒤져서 해당 노드가 있다면 COPY SET 인스턴스 데이터 바로 수정, 없다면 Y일때는 'U'라는 플래그로 등록, 'N'이라면 트리에서만 수정
- //상태가 'I / U' 이면 COPY SET의 해당 인스턴스 데이터를 수정, 상태가 ' Y'이면 'U'라는 status로 COPY 셋에 등록
- if(parseInt(event.clientY) > 590 ){
- group2.attribute("top") = "590px";
- } else{
- group2.attribute("top") = event.clientY;
- }
- group2.attribute("left") = 100;
- group2.attribute("height") = 55;
- model.setValue("/root/main/formdata/item/indxnm", model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/indxnm"));
- inpt_srch.refresh();
- cap_menu.attribute("text") = "색인명";
- btn_ok.attribute("visibility") = "hidden";
- btn_modify.attribute("visibility") = "visible";
- inpt_srch.disabled = false;
- model.setFocus("inpt_srch");
- model.setValue("/root/temp/selecedkind/kind", "i");
- */
- }
- //현재 아이템 인덱스의 자식 아이템중 마지막 아이템 인덱스를 반환 한다
- function getLastChildItemIndex(itemIndex, treeItemNodeSet) {
-
- var curDepthValue = model.getValue(treeItemNodeSet + "[" + (itemIndex + 1) + "]/depth");
- var childDepthValue = model.getValue(treeItemNodeSet + "[" + (itemIndex + 2) + "]/depth");
- while(curDepthValue < childDepthValue) {
- itemIndex++;
- childDepthValue = model.getValue(treeItemNodeSet + "[" + (itemIndex + 2) + "]/depth");
- }
- return itemIndex;
- }
- //폴더 색인을 추가/수정/삭제한 경우 바로 저장한다
- function fSaveFolderIndx( indx, status ){
- model.removeNodeset("/root/send");
- model.resetInstanceNode("/root/temp/savedfolder/item");
- model.makeNode("/root/send/reqdata");
- model.copyNode("/root/send/reqdata", itemRef + "[" + parseInt(indx) +"]");
- model.makeValue("/root/send/reqdata/status", status );
- model.makeValue("/root/send/reqdata/filenm", model.getValue(itemRef + "[" + (iFocusIndx+1) + "]/filenm") );
- //model.makeValue("/root/send/reqdata/indxhistseq", model.getValue(itemRef + "[" + (iFocusIndx+1) + "]/indxhistseq") );
- model.makeValue("/root/send/reqdata/indxrefseq", model.getValue(itemRef + "[" + (iFocusIndx+1) + "]/indxrefseq") );
-
- // 차후 결정후 수정될 사항 (권한에 따른 처리를 할지 아직 미결정)
- model.makeValue("/root/send/reqdata/indxtypecd", "D" ); // 인텍스 타입 - 의사, 부서 등등 구분(미결정사항)
- model.makeValue("/root/send/reqdata/drid", getUserInfo("userid")); // 타입 구분에 따른 ID - 의사, 부서 등등 구분(미결정사항)
-
- model.makeValue("/root/send/reqdata/kind", model.getValue("/root/temp/selecedkind/kind"));
-
- if(model.getValue("/root/main/attfileinfo/attach/file") == "" && status == "i" && model.getValue("/root/send/reqdata/kind") != "F" ){
- messageBox("첨부할 파일을 선택하지", "E007");
- return;
- }
-
- if( submit("TXMMD05001", false) ){
- if(status == "i" && model.getValue("/root/send/reqdata/kind") != "F" ){
- if( submit("TXMMD05002", false) ){
- return true;
- } else {
- return false;
- }
- }
- } else {
- return false;
- }
- model.setValue(itemRef + "[" + parseInt(indx) +"]/indxno", model.getValue("/root/temp/savedfolder/item/indxno"));
- if( status == "u" || status == "i" ){
- model.setValue(itemRef + "[" + parseInt(indx) +"]/status", "");
- }
-
-
- }
-
- //폴더를 삭제한다.
- function fFolderDel() {
-
- var fileno = model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/fileno");
- var msg = "";
- if ( fileno == "0" ) {
- // 폴더삭제 권한을 체크
- if ( !fchkFolderAuth("del") ) return;
- msg = "선택하신 폴더를";
- } else {
- // 색인삭제 권한을 체크
- if ( !fchkFolderAuth("indxdel") ) return;
- msg = "선택하신 색인을";
- }
-
- // 삭제 확인
- var msgRtn = messageBox(msg, "Q001");
- if ( msgRtn != "6" ) return; // 삭제승인 버튼을 클릭하지않으면 중단한다.
-
- var focusIndex = iFocusIndx;
- var iRow = parseInt(focusIndex) + 1; //선택한 인스턴스의 인덱스
- //바로 데이터를 삭제하는 서브밋을 실행한다.
- fSaveFolderIndx( iRow , "d" );
-
-
- //화면에서 직접삭제
- var treeItemNodeSet = treeview1.itemset.attribute("nodeset");
- var srcLastChildItemIndex = getLastChildItemIndex( focusIndex , treeItemNodeSet );
- for(var i=focusIndex; i<= srcLastChildItemIndex ; i++){
- model.removenode(itemRef + "[" + iRow + "]");
- }
-
- var falg = opener.model.getValue("/root/main/search_cond/cpgflagcd");
- fGetIndxList(falg);
-
- treeview1.select(iRow-2);
- treeview1.expand(iRow-2, false);
- treeview1.rebuild();
- }
- function getParentItemIndex(itemIndex, treeItemNodeSet) {
- var curDepthValue = model.getValue(treeItemNodeSet + "[" + (itemIndex + 1) + "]/depth");
- var parentDepthValue = curDepthValue - 1;
-
- do {
- itemIndex--;
- curDepthValue = model.getValue(treeItemNodeSet + "[" + (itemIndex + 1) + "]/depth");
- } while(curDepthValue != parentDepthValue)
-
- return itemIndex;
- }
- function fFileDown(){
- model.makeNode("/root/temp/attachfile/filedata");
- var filepath = model.getValue("/root/main/srcindxinfo/itemlist/item"+"[" + (iFocusIndx+1) + "]/filepath");
- var filenm = model.getValue("/root/main/srcindxinfo/itemlist/item"+"[" + (iFocusIndx+1) + "]/filenm");
- var localfile = window.fileDialog("save","|",false,filenm,"","All Files(*.*)|*.*");
- if (localfile != "") {
- model.download(getActionURL("TRMMD05003")+"&filepath="+filepath,localfile, false);
- var rtn = messageBox("파일을", "Q004");
- if( rtn == 6 ) {
- window.exec(localfile);
- }
- }
- }
-
- function fNewFolder() {
-
- var indx = treeview1.focusIndex;
- var row = treeview1.mouseRow;
- if(indx == -1 && indx != row ){
- treeview1.select(row);
- indx = row;
- }
- iFocusIndx = indx;
-
- // 파일을 선택시 폴더를 선택하라고 alert 처리
- var fileno = model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/fileno");
- if ( fileno > 0 ) {
- messageBox("색인에는 폴더를 생성할 수", "I004");
- return;
- }
-
- // 해당부서 찾기(소속 부서코드가 없을 경우 일반부서 사용자는 폴더를 생성할 수 없다)
- if ( !fchkFolderAuth("new") ) return;
-
- group2.attribute("top") = "10px";
- group2.attribute("left") = 100;
- group2.attribute("height") = 55;
-
- var prtIndx = iFocusIndx;
- model.setValue("/root/main/formdata/item/supindxno", model.getValue(itemRef + "[" + (prtIndx + 1) + "]/indxno"));
-
- //iFocusIndx = prtIndx; //전역변수 iFocusIndx에 포커스인덱스를 넣는다.
- cap_menu.attribute("text") = "폴더명";
- btn_ok.attribute("visibility") = "visible";
- btn_modify.attribute("visibility") = "hidden";
- btn_find.attribute("visibility") = "hidden";
- model.setValue("/root/main/formdata/item/indxnm", "");
- inpt_srch.refresh();
- inpt_srch.disabled = false;
- model.setFocus("inpt_srch");
- model.setValue("/root/temp/selecedkind/kind", "F");
- model.setValue("/root/temp/selecedkind/newfolder", "Y");
- }
-
- // 확인버튼(색인추가) 클릭
- function fConfirm(){
- var iRow = iFocusIndx;
- var roc;
- var treeItemNodeSet = treeview1.itemset.attribute("nodeset");
-
- model.setValue("/root/main/formdata/item/status", "i");
- model.setValue("/root/main/formdata/item/orddeptcd", getUserInfo("dutplcecd"));
-
- if(model.getValue("/root/temp/selecedkind/newfolder") == "Y"){ // 새폴더
- roc = 1;// treeview1.length;
- if(treeview1.length == 0 ){ // 최초 신규일때
- model.makeValue("/root/main/indxlist/itemlist/item/indxno", "1");
- }
- } else {
- var srcLastChildItemIndex = getLastChildItemIndex( iFocusIndx , treeItemNodeSet );
- roc = parseInt(srcLastChildItemIndex) + 1;
- }
- //새로운 아이템을 추가한다
- var pDesNode = instance1.selectSingleNode("/root/main/indxlist/itemlist");
- var desNode = instance1.selectSingleNode(itemRef + "[" + parseInt(roc) +"]");
- var srcNode = instance1.selectSingleNode("/root/main/formdata/item");
- var cSrcNode = srcNode.cloneNode(true);
- pDesNode.insertAfter(cSrcNode, desNode);
- group2.attribute("height") = 0;
- //treeview1.rebuild();
- //treeview1.expand(roc, true);
- fSaveFolderIndx( parseInt(roc)+1, "i" );
- var falg = opener.model.getValue("/root/main/search_cond/cpgflagcd");
- fGetIndxList(falg);
-
- treeview1.select( parseInt(roc));
- treeview1.expand(parseInt(roc), false);
- treeview1.rebuild();
-
- }
-
- function fSetFolderName(){
- var iRow = parseInt(iFocusIndx) + 1; //선택한 인스턴스의 인덱스
- model.setValue(itemRef + "[" + iRow + "]/indxnm", model.getValue("/root/main/formdata/item/indxnm"));
- model.setValue(itemRef + "[" + iRow + "]/indxrefseq", model.getValue("/root/main/formdata/item/indxrefseq"));
-
- input2.attribute("visibility") = "hidden";
- inpt_srch.attribute("visibility") = "visible";
- group2.attribute("height") = 0;
- treeview1.rebuild();
-
- fSaveFolderIndx( parseInt(iRow), "u" );
- fGetIndxList("A");
- treeview1.rebuild();
- }
-
- function fchkFolderAuth(mode) {
-
- // 폴더아래로 신규폴더 생성시 폴더의 부서코드와 사용자 세션 부서 코드가 일치 해야 한다.
- var orddeptcd = model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/orddeptcd");
- var depth = model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/depth");
- var deptnm = "";
- var msg = "";
- var indxnm = "";
- var duplcecd = getUserInfo("dutplcecd");
-
- // 약제팀 부서 코드에 해당되는지 조사
- var drugdeptYn = "N";
- var drugdeptcd = "";
- var deptcnt = grd_drugdept.rows;
- for ( var i = 1 ; i<deptcnt ; i++ ) {
- drugdeptcd = model.getValue("/root/main/drugdeptlist/drugdept[" + i + "]/deptcd");
- if ( drugdeptcd == duplcecd ) {
- drugdeptYn = "Y";
- break;
- }
- }
-
- if ( drugdeptYn == "N" ) { // 일반 부서인 경우 권한 체크 로직
-
- if ( orddeptcd != duplcecd ) {
- var deptCnt = opener.cmb_orddept.length;
- for ( var i=1 ; i<deptCnt+1 ; i++ ) {
- if ( orddeptcd == opener.model.getValue("/root/init/orddept/dept[" + i + "]/deptcd") ) {
- if ( orddeptcd == "DRUGDEPT" ) {
- deptnm = "약제 공통";
- }
- else {
- deptnm = opener.model.getValue("/root/init/orddept/dept[" + i + "]/depthngnm");
- }
- break;
- }
- }
-
- if ( deptnm == "" ) {
- for ( var i = 1 ; i<deptcnt ; i++ ) {
- drugdeptcd = model.getValue("/root/main/drugdeptlist/drugdept[" + i + "]/deptcd");
- if ( drugdeptcd == orddeptcd || orddeptcd == "DRUGDEPT" ) {
- deptnm = "약제 공통";
- break;
- }
- }
- }
- indxnm = model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/indxnm");
-
- if ( mode == "new" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더 생성";
- }else if ( mode == "set" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더 수정";
- }else if ( mode == "del" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더 삭제";
- }else if ( mode == "del" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더 삭제";
- }else if ( mode == "indxdel" ) {
- msg = indxnm + " 색인은 [" + deptnm + "] 부서의 색인입니다. 색인 삭제";
- }else if ( mode == "indxnew" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 색인 추가";
- }else if ( mode == "folderorder" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더순서정렬";
- }
-
- messageBox(msg, "E002");
- return false;
- }
- }
- else { // 소속부서가 약제팀 부서에 해당하는 경우
- drugdeptYn = "N";
- orddeptcd = model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/orddeptcd");
-
- for ( var i = 1 ; i<deptcnt ; i++ ) {
- drugdeptcd = model.getValue("/root/main/drugdeptlist/drugdept[" + i + "]/deptcd");
- if ( drugdeptcd == orddeptcd || orddeptcd == "DRUGDEPT" ) {
- drugdeptYn = "Y";
- break;
- }
- }
- //if ( orddeptcd == "DRUGDEPT" ) drugdeptYn = "Y";
-
- if ( drugdeptYn == "N" ) { // 선택한 폴더가 약제팀 폴더가 아닌 경우
-
- var deptCnt = opener.cmb_orddept.length;
- for ( var i=1 ; i<deptCnt+1 ; i++ ) {
- if ( orddeptcd == opener.model.getValue("/root/init/orddept/dept[" + i + "]/deptcd") ) {
- if ( orddeptcd == "DRUGDEPT" ) {
- deptnm = "약제 공통";
- }
- else {
- deptnm = opener.model.getValue("/root/init/orddept/dept[" + i + "]/depthngnm");
- }
- break;
- }
- }
- indxnm = model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/indxnm");
-
- if ( mode == "new" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더 생성";
- }else if ( mode == "set" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더 수정";
- }else if ( mode == "del" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더 삭제";
- }else if ( mode == "del" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더 삭제";
- }else if ( mode == "indxdel" ) {
- msg = indxnm + " 색인은 [" + deptnm + "] 부서의 색인입니다. 색인 삭제";
- }else if ( mode == "indxnew" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 색인 추가";
- }else if ( mode == "folderorder" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더순서정렬";
- }
-
- messageBox(msg, "E002");
- return false;
-
- }
-
- }
-
- return true;
-
- }
-
- //폴더의 정렬순서를 수정하는 동시에, DB에 저장한다.
- function fFolderOrderSet() {
-
- if ( !fchkFolderAuth("folderorder") ) return;
-
- var param = "";
- param += "A" + "▦"; // 폴더, 색인 모두 조회
- param += opener.model.getValue("/root/main/search_cond/orddeptcd") + "▦";
- param += iFocusIndx + "▦";
-
- setParameter("SPMMD08300_param", param);
- modal("SPMMD08300");
-
- var rtnindx = getParameter("SPMMD08300_rtnparam");
- fGetIndxList("A");
- //fReqSetTreeView(setkindcd, setclscd, settypecd, procflag, deptcd, deptnm);
-
- if(rtnindx != ""){
- treeview1.select(rtnindx);
- treeview1.expand(rtnindx, false);
- }
- treeview1.rebuild();
- }
-
- // 정렬순서를 직접입력해서 수정하는 구버전 스크립트 함수
- function fFolderOrderSet_Old(){
-
- // 폴더 수정권한 체크
- if ( !fchkFolderAuth("set") ) return;
-
- if( model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/supindxno") == "0" ){
- messageBox("최상위 폴더명은 수정", "E001");
- return;
- }
-
- if(parseInt(event.clientY) > 590 ){
- group2.attribute("top") = "590px";
- } else{
- group2.attribute("top") = event.clientY - 50;
- }
- group2.attribute("left") = 100;
- group2.attribute("height") = 55;
-
- model.setValue("/root/main/formdata/item/indxnm", model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/indxnm"));
- model.setValue("/root/main/formdata/item/indxno", model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/indxno"));
- model.setValue("/root/main/formdata/item/indxhistseq", model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/indxhistseq"));
- model.setValue("/root/main/formdata/item/indxrefseq", model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/indxrefseq"));
-
- input2.refresh();
- input2.attribute("visibility") = "visible";
- cap_menu.attribute("text") = "폴더순서";
- cap_menu.attribute("width") = "60px";
- btn_ok.attribute("visibility") = "hidden";
- btn_modify.attribute("visibility") = "visible";
- btn_find.attribute("visibility") = "hidden";
- inpt_srch.attribute("visibility") = "hidden";
- input2.disabled = false;
-
-
- model.setFocus("input2");
- model.setValue("/root/temp/selecedkind/kind", "F");
- }
-
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body guideline="2,590;" style="margin-left:0; margin-top:0; margin-right:0; margin-bottom:0; ">
- <treeview id="treeview1" ref="/root/temp/reqdata/selectIndxCd" dragmode="true" dropmode="true" expanddepth="0" hasimages="true" itemsettype="depth" style="left:0px; top:0px; width:345px; height:662px; ">
- <itemset nodeset="/root/main/indxlist/itemlist/item">
- <label ref="indxnm"/>
- <value ref="indxno"/>
- <depth ref="depth"/>
- <image ref="image"/>
- <selectedimage/>
- <expandedimage/>
- </itemset>
- <script type="javascript" ev:event="onmousedown">
- <![CDATA[
- if(treeview1.isCell(event.target)) {
- var indx = treeview1.focusIndex;
- var row = treeview1.mouseRow;
- if(indx == -1 || indx != row ){
- treeview1.select(row);
- indx = row;
- }
- iFocusIndx = indx;
-
- //if( opener.model.getValue("/root/main/search_cond/authflag") == "M" ){ // 부서 권한 체크
- if(event.button == 3){ // 마우스 우클릭시
- //DB에 저장되어 있는 인덱스의 삭제는 체크버튼으로 control한다. 트리상에서 추가된 아이템은 바로 삭제 가능하다.
- if(model.getValue(itemRef + "[" + (indx + 1) + "]/image") == fileImg) {
- model.resetInstanceNode("/root/main/formdata/item");
- setPopupMenu("treeview1", false, "/root/main/indxlist/popupmenu/tree/indxmenu", "name", "func", false);
-
- } else {
- if(model.getValue(itemRef + "[" + (indx + 1) + "]/supindxno") == "0" ) {
- setPopupMenu("treeview1", false, "/root/main/indxlist/popupmenu/tree/supmenu", "name", "func", false);
-
- } else {
- setPopupMenu("treeview1", false, "/root/main/indxlist/popupmenu/tree/submenu", "name", "func", false);
- }
- }
- var itemNode = instance1.selectSingleNode(itemRef + "[" + (indx + 1) + "]");
- var itemNodeDepth = itemNode.depth.text;
- model.resetInstanceNode("/root/main/formdata/item");
-
- model.setValue("/root/main/formdata/item/depth", parseInt(itemNodeDepth) + 1);
- }
- //}
- }else{
- window.setPopupMenu(false);
- }
- ]]>
- </script>
- <script type="javascript" ev:event="ondblclick">
- <![CDATA[
- var iRow = parseInt(iFocusIndx) + 1
- var filepath = model.getValue("/root/main/srcindxinfo/itemlist/item"+"[" + iRow + "]/filepath");
- var filenm = model.getValue("/root/main/srcindxinfo/itemlist/item"+"[" + iRow + "]/filenm");
- var fileno = model.getValue("/root/main/srcindxinfo/itemlist/item"+"[" + iRow + "]/fileno");
-
- if ( fileno == "0" ) {
- treeview1.dispatch("onmousedown");
- return;
- }
-
- //var localfile = window.fileDialog("save","|",false,filenm,"","All Files(*.*)|*.*");
- //var localfile = "C:/Temp/"+ filenm;
- //localfile = getLocalFile(); // 공통에서 로컬 파일저장 위치를 가저옴.
-
- //fs = new ActiveXObject("Scripting.FileSystemObject");
-
- if(filepath != ""){
- opener.browser1.Navigate(getActionURL("TRMMD05002")+"&filepath="+filepath);
- } else {
- messageBox("파일이 ", "I004");
- }
- /*
- if (localfile != "") {
- if( !fs.FileExists(localfile)){ // 로컬에 기존파일이 없을때 다운로드
- model.download(getActionURL("TRMMD05002")+"&filepath="+filepath,localfile, false);
- }
- opener.browser1.Navigate(localfile);
- } else {
- opener.browser1.Navigate("about:blank");
- }
- */
- ]]>
- </script>
- </treeview>
- <group id="group2" style="left:105px; top:30px; width:220px; height:0px; background-color:#ffffff; border-color:#000000; ">
- <input id="inpt_srch" ref="/root/main/formdata/item/indxnm" class="input_default" style="left:67px; top:5px; width:147px; height:19px; border-style:solid; ">
- <script type="javascript" ev:event="onkeyup">
- <![CDATA[
- /*
- if( event.keyCode == 13 ) {
- if(btn_modify.attribute("visibility") == "hidden"){
- fConfirm();
- } else {
- fSetFolderName();
- }
- }
- */
- ]]>
- </script>
- </input>
- <input id="input2" ref="/root/main/formdata/item/indxrefseq" class="input_default" visibility="hidden" style="left:67px; top:5px; width:147px; height:19px; border-style:solid; "/>
- <input id="input3" ref="/root/main/formdata/item/supindxno" class="input_default" visibility="hidden" style="left:9px; top:27px; width:55px; height:19px; border-style:solid; "/>
- <button id="btn_ok" class="btn2_letter2" style="left:127px; top:28px; width:42px; height:19px; ">
- <caption>확인</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fConfirm();
- ]]>
- </script>
- </button>
- <button id="btn_modify" class="btn2_letter2" style="left:127px; top:28px; width:42px; height:19px; ">
- <caption>확인</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- //폴더명을 수정한다.
- fSetFolderName();
- ]]>
- </script>
- </button>
- <caption id="cap_menu" class="cell_1" style="left:5px; top:5px; width:60px; height:20px; font-weight:bold; vertical-align:middle; ">색인명</caption>
- <button id="btn_cancle" class="btn2_letter2" style="left:172px; top:28px; width:42px; height:19px; ">
- <caption>취소</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- group2.attribute("height") = 0;
- ]]>
- </script>
- </button>
- <shape id="roundrect2" class="roundrect_btnset" appearance="roundrect" style="left:1px; top:0px; width:219px; height:53px; "/>
- <button id="btn_find" class="btn2_letter2" navindex="18" style="left:82px; top:28px; width:42px; height:19px; ">
- <caption>찾기</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var iRow = parseInt(iFocusIndx) + 1; //선택한 인스턴스의 인덱스
-
- var maxsize = upload1.attribute("filesize");
- //var files = window.fileDialog("open", "|", true);
- var files = window.fileDialog("open","|","true","","pdf","Adobe PDF 파일(*.pdf)|*.pdf");
- var filelist = files.split("|");
- if(isNull(filelist)){
- return;
- } else{
- for(var i = 0 ; i < filelist.length ; i++ ) {
- //파일 경로에서 이름을 자른다.
- var fileNM = filelist[i].split("\\");
- inpt_srch.value = fileNM[fileNM.length-1];
-
- model.makeValue("/root/main/attfileinfo/attach/attfilenm", fileNM[fileNM.length-1]);
- model.makeValue("/root/main/attfileinfo/attach/file", filelist[i]);
- //model.makeValue("/root/main/attfileinfo/attach/detlinfoseq", 0);
- //model.makeValue("/root/main/attfileinfo/attach/check", "false");
- //model.makeValue("/root/main/attfileinfo/attach/path", "");
-
- if (!checkFileSize(upload1)){
- //grd_attfile.removeItem();
- messageBox("파일 크기가 최대치("+maxsize+"Byte)를", "E003");
- }
- }
- }
- //model.setFocus("inpt_srch");
- ]]>
- </script>
- </button>
- <upload id="upload1" nodeset="/root/main/attfileinfo/attach/file" ext="zip" filecount="5" filesize="5242880" style="left:8px; top:28px; width:20px; height:20px; "/>
- </group>
- <datagrid id="grd_drugdept" nodeset="/root/main/drugdeptlist/drugdept" visibility="hidden" caption="부서코드^부서명" colsep="^" mergecellsfixedrows="bycolrec" rowsep="|" style="left:125px; top:150px; width:210px; height:55px; ">
- <col ref="deptcd"/>
- <col ref="depthngnm"/>
- </datagrid>
- </xhtml:body>
- </xhtml:html>
|