123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/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>구처방조회</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <main>
- <formdata>
- <item>
- <status/>
- <indxno/>
- <indxnm/>
- <supindxno/>
- <indxrefseq/>
- <depth/>
- <indxhistseq/>
- <image/>
- <ordclass/>
- </item>
- </formdata>
- <indxlist>
- <itemlist>
- <item>
- <status/>
- <indxno/>
- <indxnm/>
- <supindxno/>
- <indxrefseq/>
- <depth/>
- <indxhistseq/>
- <image/>
- </item>
- </itemlist>
- <popupmenu>
- <tree>
- <supmenu>
- <name>새폴더</name>
- <func>fFolderAdd</func>
- </supmenu>
- <supmenu>
- <name>-</name>
- <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>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/>
- </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-model-construct-done">
- <![CDATA[
- fInitialize(); //좌측 CP Tree 조회
- ]]>
- </script>
- <submission id="TRMMB20101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqdata" resultref="/root/main/srcindxinfo/itemlist"/>
- <submission id="TXMMB20101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqdata" resultref="/root/temp/savedfolder"/>
- <bind id="bind1" ref="/root/main/cpglist/cpginfo/cpgorddeptcd" readonly="../status = "S""/>
- </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/stringHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/utilHelper.js"/>
- <script type="javascript" src="../../../com/departmentcodeweb/js/ZSD001.js"/>
- <script type="javascript" src="../../../emr/prcpmngtweb/js/SMMMO00100.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() {
- fGetIndxList("A");
- }
-
- //색인을 조회한다.
- function fGetIndxList(flag) {
- var indxnmSch = model.getValue("/root/main/search_cond/indxnm"); // 조회할 색인명
-
- 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/selectIndxCd", 0 ); //최상위색인번호
-
- if( submit("TRMMB20101") ){
-
- // 조회 결과를 /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() {
- group2.visible = true;
- group2.attribute("left") = 100;
-
- //추가되는 색인의 조회순서는 Default로 선택한 아이템의 가장 마지막 차일드 아이템 조회순서(indxrefseq) + 1 이다.
- var prtIndx = iFocusIndx;
- var treeItemNodeSet = treeview1.itemset.attribute("nodeset");
- var srcLastChildItemIndex = getLastChildItemIndex( prtIndx , treeItemNodeSet );
- 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/ordclass", "");
- 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";
- inpt_srch.refresh();
- ipt_ordclass.refresh();
- inpt_srch.disabled = false;
- model.setFocus("inpt_srch");
- model.setValue("/root/temp/selecedkind/kind", "F");
- }
-
- //색인 추가하는 메뉴그룹을 연다.
- function fIndxAdd() {
- group2.attribute("left") = 100;
-
- model.removeNodeset("/root/main/attfileinfo/attach/file");
-
- //추가되는 색인의 조회순서는 Default로 선택한 아이템의 가장 마지막 차일드 아이템 조회순서(indxrefseq) + 1 이다.
- var prtIndx = iFocusIndx;
- var treeItemNodeSet = treeview1.itemset.attribute("nodeset");
- var srcLastChildItemIndex = getLastChildItemIndex( prtIndx , treeItemNodeSet );
- 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/ordclass", "");
- model.setValue("/root/main/formdata/item/image", fileImg);
-
- cap_menu.attribute("text") = "색인명";
- btn_ok.attribute("visibility") = "visible";
- btn_modify.attribute("visibility") = "hidden";
- inpt_srch.refresh();
- inpt_srch.disabled = false;
- model.setValue("/root/temp/selecedkind/kind", "i");
-
- }
-
- //폴더를 수정하는 동시에, DB에 저장한다.
- function fFolderSet(){
-
- if( model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/supindxno") == "0" ){
- messageBox("최상위 폴더명은 수정", "E001");
- return;
- }
- group2.visible = true;
- group2.attribute("left") = 100;
- 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/ordclass", model.getValue(itemRef + "[" + (iFocusIndx + 1) + "]/ordclass"));
- inpt_srch.refresh();
- ipt_ordclass.refresh();
- cap_menu.attribute("text") = "폴더명";
- btn_ok.attribute("visibility") = "hidden";
- btn_modify.attribute("visibility") = "visible";
- inpt_srch.disabled = false;
- model.setFocus("inpt_srch");
- }
-
- //색인을 수정한다.
- 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/ordclass", model.getValue("/root/main/formdata/item/ordclass") );
-
- if( submit("TXMMB20101", false) ){
- model.setValue("/root/main/formdata/item/ordclass", "");
- return true;
- } 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 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 + "]");
- }
- 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 fNewFolder() {
- group2.visible = true;
- group2.attribute("top") = "30px";
- group2.attribute("left") = 120;
-
- model.setValue("/root/main/formdata/item/supindxno", 0);
- model.setValue("/root/main/formdata/item/indxnm", "");
- model.setValue("/root/main/formdata/item/ordclass", "");
- model.setValue("/root/main/formdata/item/image", folerImg);
-
- cap_menu.attribute("text") = "폴더명";
- btn_ok.attribute("visibility") = "visible";
- btn_modify.attribute("visibility") = "hidden";
- inpt_srch.refresh();
- inpt_srch.disabled = false;
- model.setFocus("inpt_srch");
- 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");
-
- 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.visible = false;
- //treeview1.rebuild();
- //treeview1.expand(roc, true);
- fSaveFolderIndx( parseInt(roc)+1, "i" );
- treeview1.select( parseInt(roc) );
- fGetIndxList("A");
- }
-
- function fSetFolderName(){
- var iRow = parseInt(iFocusIndx) + 1; //선택한 인스턴스의 인덱스
- model.setValue(itemRef + "[" + iRow + "]/indxnm", model.getValue("/root/main/formdata/item/indxnm"));
- model.setValue(itemRef + "[" + iRow + "]/ordclass", model.getValue("/root/main/formdata/item/ordclass"));
- treeview1.rebuild();
-
- fSaveFolderIndx( parseInt(iRow), "u" );
- group2.visible = false;
- }
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body pagewidth="360" pageheight="400" guideline="1,350;" style="margin-left:8; margin-top:0; margin-right:8; 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:25px; width:350px; height:370px; ">
- <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 indx = treeview1.focusIndex
- var treeItem = treeview1.item(treeview1.focusIndex);
- var nItmeCnt = treeItem.haschilditem();
- if (nItmeCnt == -1 ) {
- var ordclass = model.getValue(itemRef + "[" + (parseInt(indx) + 1) + "]/ordclass");
- var indxno = model.getValue(itemRef + "[" + (parseInt(indx) + 1) + "]/indxno");
- var indxnm = model.getValue(itemRef + "[" + (parseInt(indx) + 1) + "]/indxnm");
- var depth = model.getValue(itemRef + "[" + (parseInt(indx) + 1) + "]/depth");
- for(i= (parseInt(indx)+1); i > 0; i--) {
- var bfdepth = model.getValue(itemRef + "[" + i + "]/depth");
- if (depth > bfdepth) {
- var bfindxnm = model.getValue(itemRef + "[" + i + "]/indxnm");
- indxnm = bfindxnm + " >> " + indxnm;
- break;
- }
- }
- try {
- opener.javascript.setParameter("SPMMB20100_ordclass" , ordclass);
- opener.javascript.setParameter("SPMMB20100_indxno" , indxno);
- opener.javascript.setParameter("SPMMB20100_indxnm" , indxnm);
- window.close()
- } catch(E) {
- }
- }
- ]]>
- </script>
- </treeview>
- <line id="line1" class="line_1" style="x1:0px; y1:20px; x2:350px; y2:20px; "/>
- <line id="line4" class="line_3" style="x1:0px; y1:396px; x2:350px; y2:396px; "/>
- <button id="brn_srchtree" class="btn2_letter2" visibility="hidden" style="left:307px; top:0px; width:42px; height:19px; ">
- <caption>신규</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fNewFolder();
- ]]>
- </script>
- </button>
- <script type="javascript" ev:event="onkeydown">
- <![CDATA[
- if(event.keyCode == "27") {
- btn_app.disabled = false;
- btn_app.visible = true;
- btn_app.attribute("left") = "0px";
- }
- ]]>
- </script>
- <group id="group2" visibility="hidden" style="left:10px; top:80px; width:225px; height:80px; 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; "/>
- <input id="input3" ref="/root/main/formdata/item/supindxno" class="input_default" visibility="hidden" style="left:9px; top:52px; width:55px; height:19px; border-style:solid; "/>
- <button id="btn_ok" class="btn2_letter2" style="left:127px; top:53px; 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:53px; 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:53px; width:42px; height:19px; ">
- <caption>취소</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- group2.visible = false
- ]]>
- </script>
- </button>
- <shape id="roundrect2" class="roundrect_btnset" appearance="roundrect" style="left:1px; top:0px; width:219px; height:75px; "/>
- <caption id="caption1" class="cell_1" style="left:5px; top:27px; width:60px; height:20px; font-weight:bold; vertical-align:middle; ">코드분류</caption>
- <input id="ipt_ordclass" ref="/root/main/formdata/item/ordclass" class="input_default" style="left:67px; top:28px; width:147px; height:19px; border-style:solid; "/>
- </group>
- <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:168px; height:14px; ">구 수익분류 조회</caption>
- </xhtml:body>
- </xhtml:html>
|