123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407 |
- <?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>
- <cond>
- <srchfromdd/>
- <srchtodd/>
- <srchsumdeptcd/>
- <srchprcpexecdeptcd/>
- <srchsumdeptflag/>
- <getusenotyn>N</getusenotyn>
- </cond>
- <sumdeptlist>
- <info/>
- </sumdeptlist>
- <forminfo>
- <info>
- <sumdeptcd/>
- <sumdeptnm/>
- <sumdeptflag/>
- <prcpexecdeptcd/>
- <prcpexecdeptnm/>
- <useyn>Y</useyn>
- <status>I</status>
- </info>
- </forminfo>
- </main>
- <init>
- <tmp/>
- <deptflag/>
- <deptinfo/>
- </init>
- <send>
- <reqdata/>
- <cond/>
- <deptinfo/>
- </send>
- <temp>
- <initsrch/>
- </temp>
- <hidden>
- <data>
- <orddeptcd/>
- <orddeptnm/>
- </data>
- </hidden>
- </root>
- </instance>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- fInitialize();
- ]]>
- </script>
- <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/dateHelper.js"/>
- <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
- <script type="javascript" src="../../../com/departmentcodeweb/js/ZSD001.js"/>
- <script type="javascript">
- <![CDATA[
- var ref = "/root/main/sumdeptlist/info";
- var saveFlag = "";
-
- function fInitialize(){
- //오늘 날짜로 초기화 하는 부분.(조회일자를 default로 오늘 날짜로 선택함)
- var currDate;
- currDate = getCurrentDate();
- var addDy;
- addDy = currDate.toDate().getAddDate(-7,"D");
- addDy = addDy.getDateFormat("YYYYMMDD");
-
- model.setValue("/root/main/cond/srchfromdd", addDy );
- model.setValue("/root/main/cond/srchtodd", getCurrentDate() );
-
- //부서코드 조회
- zbcfGetDeptCodeList(getUserInfo("dutplceinstcd"), "", "", "/root/init/deptinfo"); //부서 콤보조회
-
- //하드코드 중 집계부서구분 조회
- model.makeValue("/root/send/reqdata/hardcd", "S010");
- if( submit("TRADT10339", false) ){
- model.makeNode("/root/init/deptflag/info/cdid");
- model.makeNode("/root/init/deptflag/info/cdnm");
- copyNodeType("/root/init/deptflag", "/root/temp/initsrch", "after", model, model);
- model.refresh();
- }
-
- fGetSumDeptList();
- }
-
- function fGetSumDeptList(){
- /*
- if( !isRequiredControls("ipt_searchfromdd","ipt_searchtodd","cmb_wardcd") ){
- return;
- }
- */
- model.removenode("/root/send/cond");
- model.makeNode("/root/send/cond");
- model.copyNode("/root/send/cond", "/root/main/cond");
-
- submit("TRADT10340", true);
- }
-
- /* 저장한다. */
- function fSaveInfo(flag, qestyn){
-
- var saveDataNodes = instance1.selectNodes(ref + "[status!='']");
- if( saveDataNodes.length <= 0 ){
- messageBox( "저장할 데이터가", "I004"); //없습니다
- return;
- }
-
- model.removeNodeset("root/send/savedata");
- model.makeNode("root/send/savedata");
- copyNodeListType("root/send/savedata", "/root/main/sumdeptlist/info[status!='']", "replace", model, model);
- //model.setValue("root/send/savedata", grd_sumdeptlist.getUpdateData());
-
- if( submit("TXADT10334", false) ){
- grd_sumdeptlist.clearStatus();
- grd_sumdeptlist.refresh();
- return true;
- }else{
- return false;
- }
- }
-
- function fAddRow(){
- grd_sumdeptlist.addRow();
- //copyNodeType("/root/main/sumdeptlist", "/root/main/forminfo/info", "after", model, model);
- var iRows = grd_sumdeptlist.rows-1;
- model.setValue(ref + "[" + iRows + "]/status", "I");
- model.setValue(ref + "[" + iRows + "]/useyn", "Y");
- }
-
- function fDelRow(){
- var iSelectedRows = grd_sumdeptlist.selectedRows - 1;
- var iStatus = "";
- var rowIndx = new Array();
- for (var i=0; i<=iSelectedRows; i++) {
- rowIndx[i] = grd_sumdeptlist.selectedrow(i);
- }
-
- for (var i=rowIndx.length-1; i>=0; i--) {
- iStatus = model.getValue( ref + "[" + rowIndx[i] + "]/status" );
- if( iStatus == "I" ){
- //model.removeNodeset(ref + "[" + grd_sumdeptlist.selectedrow(i) +"]");
- grd_sumdeptlist.deleteRow(rowIndx[i]);
- }else{
- if( iStatus == "D" ){
- model.setValue ( ref + "[" + rowIndx[i] + "]/status", "" );
- grd_sumdeptlist.rowStatus(rowIndx[i]) = 0; //delete status
- }else{
- model.setValue ( ref + "[" +rowIndx[i] + "]/status", "D" );
- grd_sumdeptlist.rowStatus(rowIndx[i]) = 4; //delete status
- }
- }
- }
-
- //grd_sumdeptlist.rebuild();
- }
-
- function fSaveDeptList(){
- }
-
- ]]>
- </script>
- <submission id="TRZSD00109" mediatype="application/x-www-form-urlencoded" method="post" replace="instance" resultref="/root/init/deptinfo"/>
- <submission id="TRADT10339" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/temp/initsrch"/>
- <submission id="TRADT10340" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/sumdeptlist"/>
- <submission id="TXADT10334" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/sumdeptlist"/>
- <script type="javascript" ev:event="xforms-model-construct-done">
- <![CDATA[
- grd_sumdeptlist.explorerbar = "sortshow";
- ]]>
- </script>
- </model>
- </xhtml:head>
- <xhtml:body guideline="1,1195;2,784;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
- <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
- <caption id="cap_title" class="tit_1" style="left:0px; top:0px; width:257px; height:14px; ">약국집계부서관리</caption>
- </group>
- <group id="group5" class="datagrid2" scroll="auto" style="left:0px; top:13px; width:1195px; height:771px; ">
- <group id="grp_sea" style="left:0px; top:10px; width:1195px; height:35px; vertical-align:top; ">
- <shape id="roundrect1" class="roundrect_search" appearance="roundrect" style="left:0px; top:0px; width:1195px; height:35px; "/>
- <button id="button1" class="btn1_letter2" navindex="6" style="left:1041px; top:7px; width:56px; height:22px; ">
- <caption>조회</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fGetSumDeptList();
- ]]>
- </script>
- </button>
- <line id="line13" class="line_4" style="x1:1020px; y1:7px; x2:1020px; y2:29px; "/>
- <button id="button3" class="btn1_letter4" style="left:1102px; top:7px; width:80px; height:22px; ">
- <caption>엑셀저장</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var fileName = window.fileDialog("save", ",", false, "약국집계부서", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
- if (fileName != "") grd_sumdeptlist.saveExcel(fileName, "약국집계부서", false, false, "", "", false);
- ]]>
- </script>
- </button>
- <caption id="cap_wardcd" class="search_name" style="left:15px; top:10px; width:86px; height:17px; ">조회조건 :</caption>
- <select1 id="cmb_deptflag" ref="/root/main/cond/srchsumdeptflag" class="input_s_essential" navindex="3" appearance="minimal" style="left:105px; top:9px; width:500px; height:19px; ">
- <choices>
- <itemset nodeset="/root/init/deptflag/info">
- <label ref="cdnm"/>
- <value ref="cdid"/>
- </itemset>
- </choices>
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- fGetSumDeptList();
- ]]>
- </script>
- </select1>
- </group>
- <line id="line2" class="line_1" style="x1:0px; y1:75px; x2:1195px; y2:75px; "/>
- <line id="line1" class="line_3" style="x1:0px; y1:764px; x2:1195px; y2:764px; "/>
- <button id="btn_app" class="btn2_letter2" style="left:1151px; top:54px; width:42px; height:19px; ">
- <caption>저장</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fSaveInfo();
- ]]>
- </script>
- </button>
- <button id="button2" class="btn2_letter3" style="left:1039px; top:54px; width:53px; height:19px; ">
- <caption>행추가</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fAddRow();
- ]]>
- </script>
- </button>
- <button id="button4" class="btn2_letter3" style="left:1095px; top:54px; width:42px; height:19px; ">
- <caption>행삭제</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fDelRow();
- ]]>
- </script>
- </button>
- <datagrid id="grd_sumdeptlist" nodeset="/root/main/sumdeptlist/info" caption="대표부서코드^대표부서명^집계구분^부서코드^부서명^사용여부^status^orgsumdeptflag^orgsumdeptcd^orgprcpexecdeptcd" colsep="^" colwidth="100, 130, 360, 118, 339, 70, 10, 12, 11, 13" ellipsis="true" rowheader="update" rowsep="|" tooltip="true" style="left:0px; top:80px; width:1195px; height:683px; ">
- <col ref="sumdeptcd" type="inputbutton"/>
- <col ref="sumdeptnm" type="input"/>
- <col ref="sumdeptflag" type="combo">
- <choices>
- <itemset nodeset="/root/init/deptflag/info">
- <label ref="cdnm"/>
- <value ref="cdid"/>
- </itemset>
- </choices>
- </col>
- <col ref="prcpexecdeptcd" type="inputbutton"/>
- <col ref="prcpexecdeptnm" type="output"/>
- <col checkvalue="Y,N" ref="useyn" type="checkbox"/>
- <col ref="status" visibility="hidden"/>
- <col ref="orgsumdeptflag" visibility="hidden"/>
- <col ref="orgsumdeptcd" visibility="hidden"/>
- <col ref="orgprcpexecdeptcd" visibility="hidden"/>
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- var iRow = grd_sumdeptlist.row;
- var iCol = grd_sumdeptlist.col; //12~13 신청, 14~15 수행
- var rowStatus = "";
-
- if( iRow > 0 && iRow <= grd_sumdeptlist.rows ){
- rowStatus = model.getValue( ref + "[" + iRow + "]/status" );
- //rowStatus = grd_sumdeptlist.rowStatus(iRow);
-
- if( rowStatus == "I" ){
- model.setValue( ref + "[" + iRow + "]/status", "I" );
- grd_sumdeptlist.rowStatus(iRow) = 1; //insert status
- }else{
- model.setValue( ref + "[" + iRow + "]/status", "U" );
- grd_sumdeptlist.rowStatus(iRow) = 2; //delete status
- }
- }
- ]]>
- </script>
- <script type="javascript" ev:event="onaftersort">
- <![CDATA[
- grd_sumdeptlist.gridToInstance();
- ]]>
- </script>
- <script type="javascript" ev:event="onendedit">
- <![CDATA[
- var iRow = grd_sumdeptlist.row;
- var iCol = grd_sumdeptlist.col; //12~13 신청, 14~15 수행
- var rowStatus = "";
- var inputSumdeptcd = "";
- var inputPrcpexecdeptcd = "";
- var inpitDeptCd = "";
- var iStatus = "";
-
- if( iRow > 0 && iRow <= grd_sumdeptlist.rows ){
- iStatus = model.getValue( ref + "[" + iRow + "]/status" );
- /*
- if( iCol == grd_sumdeptlist.colRef("sumdeptcd") ){
- inputSumdeptcd = model.getValue( ref + "[" + iRow + "]/sumdeptcd" );
- inpitDeptCd = inputSumdeptcd;
- }else
- */
- if( iCol == grd_sumdeptlist.colRef("prcpexecdeptcd") ){
- inputPrcpexecdeptcd = model.getValue( ref + "[" + iRow + "]/prcpexecdeptcd" );
- inpitDeptCd = inputPrcpexecdeptcd;
- }
-
- if( !isNull(inpitDeptCd) ){
- var deptList = instance1.selectNodes("/root/init/deptinfo/dept");
- var node = null;
- var iDeptNode = null;
- var iDeptCd = "";
- var iDeptNm = "";
- for(var i=0; i<deptList.length; i++ ){
- node = deptList.item(i);
- iDeptNode = node.selectSingleNode("deptcd");
- if( iDeptNode != null ){
- iDeptCd = iDeptNode.text;
- if( iDeptCd == inpitDeptCd ){
- iDeptNm = node.selectSingleNode("depthngnm").text;
- break;
- }
- }
- }
-
- /*
- if( !isNull(inputSumdeptcd) ){
- if( !isNull(iDeptNm) )
- model.setValue(ref + "[" + iRow + "]/sumdeptnm", iDeptNm);
- else
- model.setValue(ref + "[" + iRow + "]/sumdeptnm", "");
- }
- */
- if( !isNull(inputPrcpexecdeptcd) ){
- if( !isNull(iDeptNm) )
- model.setValue(ref + "[" + iRow + "]/prcpexecdeptnm", iDeptNm);
- else
- model.setValue(ref + "[" + iRow + "]/prcpexecdeptnm", "");
- }
- }
-
- //grd_sumdeptlist.refresh();
- }
- ]]>
- </script>
- <script type="javascript" ev:event="onbuttonclick">
- <![CDATA[
- var search_condition = "deptnm";
- var search_term = ""; // model.getValue("/root/main/sample1/deptcd");
- var receive_deptcd_path = "/root/hidden/data/orddeptcd";
- var receive_deptnm_path = "/root/hidden/data/orddeptnm";
- var standard_yn = ""; //orduseyn 이어서 진료사용여부 기준으로 조회해왔음, 모든 부서가 검색되지 않아 null로 변경 (2009.08.26 JJE)
- var ord_deptflag = ""; //D
- model.setValue("/root/hidden/data/orddeptcd","");
- model.setValue("/root/hidden/data/orddeptnm","");
-
- var orgDeptcd = orgDeptcd = model.getValue("/root/hidden/data/orddeptcd");
- var getDeptcd = "";
- var getDeptnm = "";
- var beforeDeptcd = "";
-
- zbcfOpenInstDeptCodeList(search_condition, search_term, receive_deptcd_path, receive_deptnm_path, standard_yn, ord_deptflag);
- if (model.getValue("/root/hidden/data/orddeptcd")!=""){
-
- getDeptcd = model.getValue("/root/hidden/data/orddeptcd"); //선택된 부서코드
- getDeptnm = model.getValue("/root/hidden/data/orddeptnm");
-
- if(grd_sumdeptlist.col == grd_sumdeptlist.colRef("prcpexecdeptcd") ){ //선택한 컬럼이 부서코드
- beforeDeptcd = model.getValue("/root/main/sumdeptlist/info["+grd_sumdeptlist.row+"]/prcpexecdeptcd");
-
- model.setValue( "/root/main/sumdeptlist/info["+grd_sumdeptlist.row+"]/prcpexecdeptcd", getDeptcd);
- model.setValue( "/root/main/sumdeptlist/info["+grd_sumdeptlist.row+"]/prcpexecdeptnm", getDeptnm);
- }else if(grd_sumdeptlist.col == grd_sumdeptlist.colRef("sumdeptcd") ){ //선택한 컬럼이 대표부서코드
- beforeDeptcd = model.getValue("/root/main/sumdeptlist/info["+grd_sumdeptlist.row+"]/sumdeptcd");
-
- model.setValue( "/root/main/sumdeptlist/info["+grd_sumdeptlist.row+"]/sumdeptcd", getDeptcd);
- model.setValue( "/root/main/sumdeptlist/info["+grd_sumdeptlist.row+"]/sumdeptnm", getDeptnm);
- }
-
- if( getDeptcd != beforeDeptcd ){
- rowStatus = model.getValue( ref + "[" + grd_sumdeptlist.row + "]/status" );
- //rowStatus = grd_sumdeptlist.rowStatus(iRow);
- iRow = grd_sumdeptlist.row;
- if( rowStatus == "I" ){
- model.setValue( ref + "[" +iRow + "]/status", "I" );
- grd_sumdeptlist.rowStatus(iRow) = 1; //insert status
- }else{
- model.setValue( ref + "[" + iRow + "]/status", "U" );
- grd_sumdeptlist.rowStatus(iRow) = 2; //delete status
- }
- }
-
- }
- grd_sumdeptlist.refresh();
- ]]>
- </script>
- </datagrid>
- </group>
- </xhtml:body>
- </xhtml:html>
|