SMADT10330_약국집계부서관리.xrw 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
  3. <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">
  4. <xhtml:head>
  5. <xhtml:title>약국집계부서관리</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <cond>
  11. <srchfromdd/>
  12. <srchtodd/>
  13. <srchsumdeptcd/>
  14. <srchprcpexecdeptcd/>
  15. <srchsumdeptflag/>
  16. <getusenotyn>N</getusenotyn>
  17. </cond>
  18. <sumdeptlist>
  19. <info/>
  20. </sumdeptlist>
  21. <forminfo>
  22. <info>
  23. <sumdeptcd/>
  24. <sumdeptnm/>
  25. <sumdeptflag/>
  26. <prcpexecdeptcd/>
  27. <prcpexecdeptnm/>
  28. <useyn>Y</useyn>
  29. <status>I</status>
  30. </info>
  31. </forminfo>
  32. </main>
  33. <init>
  34. <tmp/>
  35. <deptflag/>
  36. <deptinfo/>
  37. </init>
  38. <send>
  39. <reqdata/>
  40. <cond/>
  41. <deptinfo/>
  42. </send>
  43. <temp>
  44. <initsrch/>
  45. </temp>
  46. <hidden>
  47. <data>
  48. <orddeptcd/>
  49. <orddeptnm/>
  50. </data>
  51. </hidden>
  52. </root>
  53. </instance>
  54. <script type="javascript" ev:event="xforms-ready">
  55. <![CDATA[
  56. fInitialize();
  57. ]]>
  58. </script>
  59. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  60. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  61. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  62. <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
  63. <script type="javascript" src="../../../com/departmentcodeweb/js/ZSD001.js"/>
  64. <script type="javascript">
  65. <![CDATA[
  66. var ref = "/root/main/sumdeptlist/info";
  67. var saveFlag = "";
  68. function fInitialize(){
  69. //오늘 날짜로 초기화 하는 부분.(조회일자를 default로 오늘 날짜로 선택함)
  70. var currDate;
  71. currDate = getCurrentDate();
  72. var addDy;
  73. addDy = currDate.toDate().getAddDate(-7,"D");
  74. addDy = addDy.getDateFormat("YYYYMMDD");
  75. model.setValue("/root/main/cond/srchfromdd", addDy );
  76. model.setValue("/root/main/cond/srchtodd", getCurrentDate() );
  77. //부서코드 조회
  78. zbcfGetDeptCodeList(getUserInfo("dutplceinstcd"), "", "", "/root/init/deptinfo"); //부서 콤보조회
  79. //하드코드 중 집계부서구분 조회
  80. model.makeValue("/root/send/reqdata/hardcd", "S010");
  81. if( submit("TRADT10339", false) ){
  82. model.makeNode("/root/init/deptflag/info/cdid");
  83. model.makeNode("/root/init/deptflag/info/cdnm");
  84. copyNodeType("/root/init/deptflag", "/root/temp/initsrch", "after", model, model);
  85. model.refresh();
  86. }
  87. fGetSumDeptList();
  88. }
  89. function fGetSumDeptList(){
  90. /*
  91. if( !isRequiredControls("ipt_searchfromdd","ipt_searchtodd","cmb_wardcd") ){
  92. return;
  93. }
  94. */
  95. model.removenode("/root/send/cond");
  96. model.makeNode("/root/send/cond");
  97. model.copyNode("/root/send/cond", "/root/main/cond");
  98. submit("TRADT10340", true);
  99. }
  100. /* 저장한다. */
  101. function fSaveInfo(flag, qestyn){
  102. var saveDataNodes = instance1.selectNodes(ref + "[status!='']");
  103. if( saveDataNodes.length <= 0 ){
  104. messageBox( "저장할 데이터가", "I004"); //없습니다
  105. return;
  106. }
  107. model.removeNodeset("root/send/savedata");
  108. model.makeNode("root/send/savedata");
  109. copyNodeListType("root/send/savedata", "/root/main/sumdeptlist/info[status!='']", "replace", model, model);
  110. //model.setValue("root/send/savedata", grd_sumdeptlist.getUpdateData());
  111. if( submit("TXADT10334", false) ){
  112. grd_sumdeptlist.clearStatus();
  113. grd_sumdeptlist.refresh();
  114. return true;
  115. }else{
  116. return false;
  117. }
  118. }
  119. function fAddRow(){
  120. grd_sumdeptlist.addRow();
  121. //copyNodeType("/root/main/sumdeptlist", "/root/main/forminfo/info", "after", model, model);
  122. var iRows = grd_sumdeptlist.rows-1;
  123. model.setValue(ref + "[" + iRows + "]/status", "I");
  124. model.setValue(ref + "[" + iRows + "]/useyn", "Y");
  125. }
  126. function fDelRow(){
  127. var iSelectedRows = grd_sumdeptlist.selectedRows - 1;
  128. var iStatus = "";
  129. var rowIndx = new Array();
  130. for (var i=0; i<=iSelectedRows; i++) {
  131. rowIndx[i] = grd_sumdeptlist.selectedrow(i);
  132. }
  133. for (var i=rowIndx.length-1; i>=0; i--) {
  134. iStatus = model.getValue( ref + "[" + rowIndx[i] + "]/status" );
  135. if( iStatus == "I" ){
  136. //model.removeNodeset(ref + "[" + grd_sumdeptlist.selectedrow(i) +"]");
  137. grd_sumdeptlist.deleteRow(rowIndx[i]);
  138. }else{
  139. if( iStatus == "D" ){
  140. model.setValue ( ref + "[" + rowIndx[i] + "]/status", "" );
  141. grd_sumdeptlist.rowStatus(rowIndx[i]) = 0; //delete status
  142. }else{
  143. model.setValue ( ref + "[" +rowIndx[i] + "]/status", "D" );
  144. grd_sumdeptlist.rowStatus(rowIndx[i]) = 4; //delete status
  145. }
  146. }
  147. }
  148. //grd_sumdeptlist.rebuild();
  149. }
  150. function fSaveDeptList(){
  151. }
  152. ]]>
  153. </script>
  154. <submission id="TRZSD00109" mediatype="application/x-www-form-urlencoded" method="post" replace="instance" resultref="/root/init/deptinfo"/>
  155. <submission id="TRADT10339" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/temp/initsrch"/>
  156. <submission id="TRADT10340" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/sumdeptlist"/>
  157. <submission id="TXADT10334" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/sumdeptlist"/>
  158. <script type="javascript" ev:event="xforms-model-construct-done">
  159. <![CDATA[
  160. grd_sumdeptlist.explorerbar = "sortshow";
  161. ]]>
  162. </script>
  163. </model>
  164. </xhtml:head>
  165. <xhtml:body guideline="1,1195;2,784;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  166. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  167. <caption id="cap_title" class="tit_1" style="left:0px; top:0px; width:257px; height:14px; ">약국집계부서관리</caption>
  168. </group>
  169. <group id="group5" class="datagrid2" scroll="auto" style="left:0px; top:13px; width:1195px; height:771px; ">
  170. <group id="grp_sea" style="left:0px; top:10px; width:1195px; height:35px; vertical-align:top; ">
  171. <shape id="roundrect1" class="roundrect_search" appearance="roundrect" style="left:0px; top:0px; width:1195px; height:35px; "/>
  172. <button id="button1" class="btn1_letter2" navindex="6" style="left:1041px; top:7px; width:56px; height:22px; ">
  173. <caption>조회</caption>
  174. <script type="javascript" ev:event="DOMActivate">
  175. <![CDATA[
  176. fGetSumDeptList();
  177. ]]>
  178. </script>
  179. </button>
  180. <line id="line13" class="line_4" style="x1:1020px; y1:7px; x2:1020px; y2:29px; "/>
  181. <button id="button3" class="btn1_letter4" style="left:1102px; top:7px; width:80px; height:22px; ">
  182. <caption>엑셀저장</caption>
  183. <script type="javascript" ev:event="DOMActivate">
  184. <![CDATA[
  185. var fileName = window.fileDialog("save", ",", false, "약국집계부서", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  186. if (fileName != "") grd_sumdeptlist.saveExcel(fileName, "약국집계부서", false, false, "", "", false);
  187. ]]>
  188. </script>
  189. </button>
  190. <caption id="cap_wardcd" class="search_name" style="left:15px; top:10px; width:86px; height:17px; ">조회조건 :</caption>
  191. <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; ">
  192. <choices>
  193. <itemset nodeset="/root/init/deptflag/info">
  194. <label ref="cdnm"/>
  195. <value ref="cdid"/>
  196. </itemset>
  197. </choices>
  198. <script type="javascript" ev:event="xforms-value-changed">
  199. <![CDATA[
  200. fGetSumDeptList();
  201. ]]>
  202. </script>
  203. </select1>
  204. </group>
  205. <line id="line2" class="line_1" style="x1:0px; y1:75px; x2:1195px; y2:75px; "/>
  206. <line id="line1" class="line_3" style="x1:0px; y1:764px; x2:1195px; y2:764px; "/>
  207. <button id="btn_app" class="btn2_letter2" style="left:1151px; top:54px; width:42px; height:19px; ">
  208. <caption>저장</caption>
  209. <script type="javascript" ev:event="DOMActivate">
  210. <![CDATA[
  211. fSaveInfo();
  212. ]]>
  213. </script>
  214. </button>
  215. <button id="button2" class="btn2_letter3" style="left:1039px; top:54px; width:53px; height:19px; ">
  216. <caption>행추가</caption>
  217. <script type="javascript" ev:event="DOMActivate">
  218. <![CDATA[
  219. fAddRow();
  220. ]]>
  221. </script>
  222. </button>
  223. <button id="button4" class="btn2_letter3" style="left:1095px; top:54px; width:42px; height:19px; ">
  224. <caption>행삭제</caption>
  225. <script type="javascript" ev:event="DOMActivate">
  226. <![CDATA[
  227. fDelRow();
  228. ]]>
  229. </script>
  230. </button>
  231. <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; ">
  232. <col ref="sumdeptcd" type="inputbutton"/>
  233. <col ref="sumdeptnm" type="input"/>
  234. <col ref="sumdeptflag" type="combo">
  235. <choices>
  236. <itemset nodeset="/root/init/deptflag/info">
  237. <label ref="cdnm"/>
  238. <value ref="cdid"/>
  239. </itemset>
  240. </choices>
  241. </col>
  242. <col ref="prcpexecdeptcd" type="inputbutton"/>
  243. <col ref="prcpexecdeptnm" type="output"/>
  244. <col checkvalue="Y,N" ref="useyn" type="checkbox"/>
  245. <col ref="status" visibility="hidden"/>
  246. <col ref="orgsumdeptflag" visibility="hidden"/>
  247. <col ref="orgsumdeptcd" visibility="hidden"/>
  248. <col ref="orgprcpexecdeptcd" visibility="hidden"/>
  249. <script type="javascript" ev:event="xforms-value-changed">
  250. <![CDATA[
  251. var iRow = grd_sumdeptlist.row;
  252. var iCol = grd_sumdeptlist.col; //12~13 신청, 14~15 수행
  253. var rowStatus = "";
  254. if( iRow > 0 && iRow <= grd_sumdeptlist.rows ){
  255. rowStatus = model.getValue( ref + "[" + iRow + "]/status" );
  256. //rowStatus = grd_sumdeptlist.rowStatus(iRow);
  257. if( rowStatus == "I" ){
  258. model.setValue( ref + "[" + iRow + "]/status", "I" );
  259. grd_sumdeptlist.rowStatus(iRow) = 1; //insert status
  260. }else{
  261. model.setValue( ref + "[" + iRow + "]/status", "U" );
  262. grd_sumdeptlist.rowStatus(iRow) = 2; //delete status
  263. }
  264. }
  265. ]]>
  266. </script>
  267. <script type="javascript" ev:event="onaftersort">
  268. <![CDATA[
  269. grd_sumdeptlist.gridToInstance();
  270. ]]>
  271. </script>
  272. <script type="javascript" ev:event="onendedit">
  273. <![CDATA[
  274. var iRow = grd_sumdeptlist.row;
  275. var iCol = grd_sumdeptlist.col; //12~13 신청, 14~15 수행
  276. var rowStatus = "";
  277. var inputSumdeptcd = "";
  278. var inputPrcpexecdeptcd = "";
  279. var inpitDeptCd = "";
  280. var iStatus = "";
  281. if( iRow > 0 && iRow <= grd_sumdeptlist.rows ){
  282. iStatus = model.getValue( ref + "[" + iRow + "]/status" );
  283. /*
  284. if( iCol == grd_sumdeptlist.colRef("sumdeptcd") ){
  285. inputSumdeptcd = model.getValue( ref + "[" + iRow + "]/sumdeptcd" );
  286. inpitDeptCd = inputSumdeptcd;
  287. }else
  288. */
  289. if( iCol == grd_sumdeptlist.colRef("prcpexecdeptcd") ){
  290. inputPrcpexecdeptcd = model.getValue( ref + "[" + iRow + "]/prcpexecdeptcd" );
  291. inpitDeptCd = inputPrcpexecdeptcd;
  292. }
  293. if( !isNull(inpitDeptCd) ){
  294. var deptList = instance1.selectNodes("/root/init/deptinfo/dept");
  295. var node = null;
  296. var iDeptNode = null;
  297. var iDeptCd = "";
  298. var iDeptNm = "";
  299. for(var i=0; i<deptList.length; i++ ){
  300. node = deptList.item(i);
  301. iDeptNode = node.selectSingleNode("deptcd");
  302. if( iDeptNode != null ){
  303. iDeptCd = iDeptNode.text;
  304. if( iDeptCd == inpitDeptCd ){
  305. iDeptNm = node.selectSingleNode("depthngnm").text;
  306. break;
  307. }
  308. }
  309. }
  310. /*
  311. if( !isNull(inputSumdeptcd) ){
  312. if( !isNull(iDeptNm) )
  313. model.setValue(ref + "[" + iRow + "]/sumdeptnm", iDeptNm);
  314. else
  315. model.setValue(ref + "[" + iRow + "]/sumdeptnm", "");
  316. }
  317. */
  318. if( !isNull(inputPrcpexecdeptcd) ){
  319. if( !isNull(iDeptNm) )
  320. model.setValue(ref + "[" + iRow + "]/prcpexecdeptnm", iDeptNm);
  321. else
  322. model.setValue(ref + "[" + iRow + "]/prcpexecdeptnm", "");
  323. }
  324. }
  325. //grd_sumdeptlist.refresh();
  326. }
  327. ]]>
  328. </script>
  329. <script type="javascript" ev:event="onbuttonclick">
  330. <![CDATA[
  331. var search_condition = "deptnm";
  332. var search_term = ""; // model.getValue("/root/main/sample1/deptcd");
  333. var receive_deptcd_path = "/root/hidden/data/orddeptcd";
  334. var receive_deptnm_path = "/root/hidden/data/orddeptnm";
  335. var standard_yn = ""; //orduseyn 이어서 진료사용여부 기준으로 조회해왔음, 모든 부서가 검색되지 않아 null로 변경 (2009.08.26 JJE)
  336. var ord_deptflag = ""; //D
  337. model.setValue("/root/hidden/data/orddeptcd","");
  338. model.setValue("/root/hidden/data/orddeptnm","");
  339. var orgDeptcd = orgDeptcd = model.getValue("/root/hidden/data/orddeptcd");
  340. var getDeptcd = "";
  341. var getDeptnm = "";
  342. var beforeDeptcd = "";
  343. zbcfOpenInstDeptCodeList(search_condition, search_term, receive_deptcd_path, receive_deptnm_path, standard_yn, ord_deptflag);
  344. if (model.getValue("/root/hidden/data/orddeptcd")!=""){
  345. getDeptcd = model.getValue("/root/hidden/data/orddeptcd"); //선택된 부서코드
  346. getDeptnm = model.getValue("/root/hidden/data/orddeptnm");
  347. if(grd_sumdeptlist.col == grd_sumdeptlist.colRef("prcpexecdeptcd") ){ //선택한 컬럼이 부서코드
  348. beforeDeptcd = model.getValue("/root/main/sumdeptlist/info["+grd_sumdeptlist.row+"]/prcpexecdeptcd");
  349. model.setValue( "/root/main/sumdeptlist/info["+grd_sumdeptlist.row+"]/prcpexecdeptcd", getDeptcd);
  350. model.setValue( "/root/main/sumdeptlist/info["+grd_sumdeptlist.row+"]/prcpexecdeptnm", getDeptnm);
  351. }else if(grd_sumdeptlist.col == grd_sumdeptlist.colRef("sumdeptcd") ){ //선택한 컬럼이 대표부서코드
  352. beforeDeptcd = model.getValue("/root/main/sumdeptlist/info["+grd_sumdeptlist.row+"]/sumdeptcd");
  353. model.setValue( "/root/main/sumdeptlist/info["+grd_sumdeptlist.row+"]/sumdeptcd", getDeptcd);
  354. model.setValue( "/root/main/sumdeptlist/info["+grd_sumdeptlist.row+"]/sumdeptnm", getDeptnm);
  355. }
  356. if( getDeptcd != beforeDeptcd ){
  357. rowStatus = model.getValue( ref + "[" + grd_sumdeptlist.row + "]/status" );
  358. //rowStatus = grd_sumdeptlist.rowStatus(iRow);
  359. iRow = grd_sumdeptlist.row;
  360. if( rowStatus == "I" ){
  361. model.setValue( ref + "[" +iRow + "]/status", "I" );
  362. grd_sumdeptlist.rowStatus(iRow) = 1; //insert status
  363. }else{
  364. model.setValue( ref + "[" + iRow + "]/status", "U" );
  365. grd_sumdeptlist.rowStatus(iRow) = 2; //delete status
  366. }
  367. }
  368. }
  369. grd_sumdeptlist.refresh();
  370. ]]>
  371. </script>
  372. </datagrid>
  373. </group>
  374. </xhtml:body>
  375. </xhtml:html>