SPSTP00800_수익예산등록.xrw 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.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>Untitle</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <cond>
  10. <bugtym/>
  11. <copybugtym/>
  12. <centcd/>
  13. <selcentcd/>
  14. <srchflag/>
  15. </cond>
  16. <grddata>
  17. <preearnlist>
  18. <status/>
  19. <bugtym/>
  20. <orddeptcd/>
  21. <grupgb/>
  22. <dispseq/>
  23. <inpgoal/>
  24. <outgoal/>
  25. <centcd/>
  26. </preearnlist>
  27. </grddata>
  28. <init>
  29. <orddeptlist/>
  30. <centlist/>
  31. </init>
  32. <tmp>
  33. <preearnlist>
  34. <centcd/>
  35. <orddeptcd/>
  36. <flag/>
  37. </preearnlist>
  38. </tmp>
  39. <orddept/>
  40. </root>
  41. </instance>
  42. <script type="javascript" ev:event="xforms-ready">
  43. <![CDATA[
  44. fInit();
  45. ]]>
  46. </script>
  47. <submission id="TRSTP01701" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/cond" resultref="/root/init"/>
  48. <submission id="TXSTP00900" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/grddata/preearnlist" resultref="/root/grddata"/>
  49. <submission id="TRSTP01702" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/cond" resultref="/root/grddata"/>
  50. <submission id="TXSTP00901" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/cond"/>
  51. <submission id="TRSTP01703" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/cond" resultref="/root/init"/>
  52. <submission id="TRSTP01704" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/cond" resultref="/root/tmp"/>
  53. </model>
  54. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  55. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  56. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  57. <script type="javascript">
  58. <![CDATA[
  59. function fInit(){
  60. model.setValue("/root/cond/bugtym", getCurrentDate().substr(0, 6));
  61. if(getUserInfo("dutplceinstcd") == "031"){
  62. if(submit("TRSTP01701")){
  63. model.removeNodeset("/root/grddata");
  64. model.refresh();
  65. group2.visible = false;
  66. }
  67. }else if(getUserInfo("dutplceinstcd") == "032"){
  68. if(submit("TRSTP01703")){
  69. model.removeNodeset("/root/grddata");
  70. model.refresh();
  71. //grd_earnpre.colAttribute(grd_earnpre.colRef("orddeptcd"), "disabled") = "true";
  72. group2.visible = false;
  73. }
  74. }
  75. }
  76. ]]>
  77. </script>
  78. </xhtml:head>
  79. <xhtml:body style="background-color:transparent; border-color:transparent; margin-left:8; margin-top:0; margin-right:0; margin-bottom:0; ">
  80. <shape id="roundrect2" class="roundrect_search" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:350px; top:5px; width:445px; height:35px; background-color:#fffbf2; border-color:#ffd799; "/>
  81. <shape id="roundrect1" class="roundrect_search" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:5px; width:330px; height:35px; background-color:#fffbf2; border-color:#ffd799; "/>
  82. <line id="line13" class="line_4" style="x1:235px; y1:12px; x2:235px; y2:34px; border-color:#ffe4bb; border-left-style:solid; "/>
  83. <caption id="caption21" class="search_name" style="left:16px; top:14px; width:125px; height:17px; ">조회년월(from) :</caption>
  84. <input id="ipt_srchdd" ref="/root/cond/bugtym" class="input_search" navindex="1" inputtype="date" format="yyyy-mm" style="left:145px; top:13px; width:70px; height:19px; "/>
  85. <input id="ipt_fromdd" ref="/root/cond/copybugtym" class="input_search" navindex="10" inputtype="date" format="yyyy-mm" style="left:485px; top:13px; width:70px; height:19px; "/>
  86. <button id="btn_search" class="btn1_letter2" navindex="2" style="left:255px; top:12px; width:56px; height:22px; background-image:../../../com/commonweb/images/btn1_letter2.gif; ">
  87. <caption>조회</caption>
  88. <script type="javascript" ev:event="DOMActivate">
  89. <![CDATA[
  90. model.setValue("/root/cond/srchflag", "from");
  91. if(submit("TRSTP01702")){
  92. model.refresh();
  93. for(var rowIdx = 1; rowIdx < grd_earnpre.rows; rowIdx++){
  94. grd_earnpre.cellattribute("disabled", rowIdx, grd_earnpre.colRef("centcd"), rowIdx, grd_earnpre.colRef("orddeptcd")) = "true";
  95. }
  96. }
  97. ]]>
  98. </script>
  99. </button>
  100. <group id="group1" visibility="visible" scroll="auto" style="left:0px; top:45px; width:1195px; height:720px; border-style:none; ">
  101. <caption id="caption1" class="tit_2" style="left:0px; top:5px; width:105px; height:13px; ">
  102. <![CDATA[수익예산등록]]>
  103. </caption>
  104. <button id="button1" class="btn2_letter3" navindex="5" disable.background-image="../../../com/commonweb/images/dis_btn2_letter3.gif" style="left:1087px; top:0px; width:53px; height:19px; background-image:../../../com/commonweb/images/btn2_letter3.gif; ">
  105. <caption>행추가</caption>
  106. <script type="javascript" ev:event="DOMActivate">
  107. <![CDATA[
  108. grd_earnpre.addRow();
  109. model.setValue(grd_earnpre.attribute("nodeset") + "[" + grd_earnpre.row + "]/bugtym", model.getValue("/root/cond/bugtym"));
  110. model.setValue(grd_earnpre.attribute("nodeset") + "[" + grd_earnpre.row + "]/status", "A");
  111. if(getUserInfo("dutplceinstcd") == "032"){
  112. grd_earnpre.cellattribute("disabled", grd_earnpre.row, grd_earnpre.colRef("orddeptcd")) = "false";
  113. grd_earnpre.cellattribute("disabled", grd_earnpre.row, grd_earnpre.colRef("centcd")) = "false";
  114. }
  115. grd_earnpre.refresh();
  116. ]]>
  117. </script>
  118. </button>
  119. <line id="line1" class="line_1" style="x1:0px; y1:20px; x2:1195px; y2:20px; "/>
  120. <datagrid id="grd_earnpre" nodeset="/root/grddata/preearnlist" caption="status^예산년월^구분^센터^진료과^출력순서^입원목표^외래목표" colsep="^" colwidth="0, 60, 60, 120, 140, 60, 120, 120" mergecellsfixedrows="bycolrec" rowheader="update" rowsep="|" selectionmode="listbox" style="left:0px; top:25px; width:1195px; height:665px; ">
  121. <col ref="status" visibility="hidden"/>
  122. <col ref="bugtym" format="yyyy-mm" style="text-align:center; "/>
  123. <col ref="grupgb" type="combo" style="text-align:center; ">
  124. <choices>
  125. <item>
  126. <label>내과계</label>
  127. <value>10</value>
  128. </item>
  129. <item>
  130. <label>외과계</label>
  131. <value>20</value>
  132. </item>
  133. <item>
  134. <label>기타</label>
  135. <value>30</value>
  136. </item>
  137. <item>
  138. <label>치과</label>
  139. <value>40</value>
  140. </item>
  141. </choices>
  142. </col>
  143. <col disabled="false" ref="centcd" type="combo">
  144. <choices>
  145. <itemset nodeset="/root/init/centlist">
  146. <label ref="cdnm"/>
  147. <value ref="cdid"/>
  148. </itemset>
  149. </choices>
  150. </col>
  151. <col ref="orddeptcd" type="combo">
  152. <choices>
  153. <itemset nodeset="/root/init/orddeptlist">
  154. <label ref="cdnm"/>
  155. <value ref="cdid"/>
  156. </itemset>
  157. </choices>
  158. </col>
  159. <col disabled="false" ref="dispseq" type="input" visibility="hidden" maxlength="3"/>
  160. <col disabled="false" ref="inpgoal" type="input" format="(-)#,###" style="text-align:right; padding-right:2; "/>
  161. <col disabled="false" ref="outgoal" type="input" format="(-)#,###" style="text-align:right; padding-right:2; "/>
  162. <script type="javascript" ev:event="xforms-value-changed">
  163. <![CDATA[
  164. var status = model.getValue(grd_earnpre.nodeset + "[" + grd_earnpre.row + "]/status" );
  165. if(status == "A"){
  166. }else if(status == "S"){
  167. model.setValue(grd_earnpre.nodeset + "[" + grd_earnpre.row + "]/status", "U");
  168. }else if(status == "D"){
  169. }
  170. //칠곡병원 센터 하위 부서 코드 조회
  171. if(getUserInfo("dutplceinstcd") == "032"){
  172. if(grd_earnpre.col == grd_earnpre.colRef("centcd")){
  173. model.setValue("/root/cond/centcd", model.getValue(grd_earnpre.nodeset + "[" + grd_earnpre.row + "]/centcd"));
  174. model.setValue(grd_earnpre.nodeset + "[" + grd_earnpre.row + "]/orddeptcd", "");
  175. model.removeNodeset("/root/tmp/orddeptlist");
  176. if(submit("TRSTP01704")){
  177. model.refresh();
  178. // group2.attribute("left") = event.clientX;
  179. // group2.attribute("top") = event.clientY;
  180. group2.visible = true;
  181. // group2.disabled = false;
  182. // group1.disabled = true;
  183. }
  184. }
  185. }
  186. ]]>
  187. </script>
  188. </datagrid>
  189. <button id="button2" class="btn2_letter3" navindex="6" disable.background-image="../../../com/commonweb/images/dis_btn2_letter3.gif" style="left:1142px; top:0px; width:53px; height:19px; background-image:../../../com/commonweb/images/btn2_letter3.gif; ">
  190. <caption>행삭제</caption>
  191. <script type="javascript" ev:event="DOMActivate">
  192. <![CDATA[
  193. var rowNumArr = new Array();
  194. if(grd_earnpre.selectedRows > 0){
  195. for(var rowidx = grd_earnpre.selectedRows; rowidx >=0 ; rowidx--){
  196. var status = model.getValue(grd_earnpre.nodeset + "[" + grd_earnpre.selectedRow(rowidx) + "]/status" );
  197. if(status == "S"){
  198. grd_earnpre.addStatus(grd_earnpre.selectedRow(rowidx), "delete");
  199. model.setValue(grd_earnpre.nodeset + "[" + grd_earnpre.selectedRow(rowidx) + "]/status", "D");
  200. }else if(status == "A"){
  201. rowNumArr[rowNumArr.length] = grd_earnpre.selectedRow(rowidx);
  202. }else if(status == "U"){
  203. grd_earnpre.removeStatus(grd_earnpre.selectedRow(rowidx), "update");
  204. grd_earnpre.addStatus(grd_earnpre.selectedRow(rowidx), "delete");
  205. model.setValue(grd_earnpre.nodeset + "[" + grd_earnpre.selectedRow(rowidx) + "]/status", "D");
  206. }
  207. }
  208. for(var idx=0; idx < rowNumArr.length; idx++){
  209. grd_earnpre.deleteRow(rowNumArr[idx], false);
  210. }
  211. grd_earnpre.refresh();
  212. }
  213. ]]>
  214. </script>
  215. </button>
  216. <button id="button5" class="btn4_letter2" navindex="26" disable.background-image="../../../com/commonweb/images/dis_btn2_letter3.gif" style="left:1139px; top:695px; width:56px; height:22px; background-image:../../../com/commonweb/images/btn2_letter3.gif; ">
  217. <caption>저장</caption>
  218. <script type="javascript" ev:event="DOMActivate">
  219. <![CDATA[
  220. if(submit("TXSTP00900")){
  221. model.refresh();
  222. for (var rowIdx = 1; rowIdx < grd_earnpre.rows; rowIdx++) {
  223. grd_earnpre.cellattribute("disabled", rowIdx, grd_earnpre.colRef("centcd"), rowIdx, grd_earnpre.colRef("orddeptcd")) = "true";
  224. }
  225. }
  226. ]]>
  227. </script>
  228. </button>
  229. <button id="button3" class="btn2_letter4" navindex="20" disable.background-image="../../../com/commonweb/images/dis_btn2_letter3.gif" style="left:1021px; top:0px; width:64px; height:19px; background-image:../../../com/commonweb/images/btn2_letter3.gif; ">
  230. <caption>엑셀저장</caption>
  231. <script type="javascript" ev:event="DOMActivate">
  232. <![CDATA[
  233. var today = model.getValue("/root/cond/bugtym");
  234. var fileName = window.fileDialog("save", ",", false, "수익예산_"+today, "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  235. grd_earnpre.saveExcel(fileName);
  236. ]]>
  237. </script>
  238. </button>
  239. </group>
  240. <button id="button6" class="btn5_letter8" navindex="11" disable.background-image="../../../com/commonweb/images/dis_btn3_letter3.gif" style="left:665px; top:13px; width:108px; height:19px; background-image:../../../com/commonweb/images/btn2_letter3.gif; ">
  241. <caption>월복사(from-to)</caption>
  242. <script type="javascript" ev:event="DOMActivate">
  243. <![CDATA[
  244. if (model.getValue("/root/cond/copybugtym").length < 1) {
  245. messageBox("복사년월을 선택하십시오.", "E999");
  246. return;
  247. }
  248. if(submit("TXSTP00901")){
  249. messageBox("복사가 완료되었습니다.", "I999");
  250. }
  251. model.setValue("/root/cond/srchflag", "to");
  252. if(submit("TRSTP01702")){
  253. model.refresh();
  254. for(var rowIdx = 1; rowIdx < grd_earnpre.rows; rowIdx++){
  255. grd_earnpre.cellattribute("disabled", rowIdx, grd_earnpre.colRef("centcd"), rowIdx, grd_earnpre.colRef("orddeptcd")) = "true";
  256. }
  257. }
  258. ]]>
  259. </script>
  260. </button>
  261. <caption id="caption3" class="search_name" style="left:370px; top:14px; width:110px; height:17px; ">복사년월(to) :</caption>
  262. <group id="group2" visibility="hidden" style="left:380px; top:150px; width:302px; height:200px; border-style:solid; ">
  263. <caption id="caption2" class="tit_2" style="left:0px; top:3px; width:105px; height:13px; ">진료과 조회</caption>
  264. <line id="line4" class="line_1" style="x1:0px; y1:20px; x2:300px; y2:20px; "/>
  265. <button id="btn_cnfm" class="btn2_letter2" disable.background-image="../../../com/commonweb/images/dis_btn2_letter2.gif" style="left:215px; top:175px; width:42px; height:19px; background-image:../../../com/commonweb/images/btn2_letter2.gif; ">
  266. <caption>확인</caption>
  267. <script type="javascript" ev:event="DOMActivate">
  268. <![CDATA[
  269. var rowIdxArr = new Array();
  270. for(var idx=0; idx < grd_orddept.rows; idx++){
  271. var flag = model.getValue(grd_orddept.nodeset + "[" + idx + "]/flag")
  272. if(flag == "true" ){
  273. rowIdxArr[rowIdxArr.length] = idx;
  274. // copyNodeListType("/root/grddata", grd_orddept.nodeset + "[" + idx + "]", "after");
  275. // alert("11");
  276. }
  277. }
  278. for(var idx = 0; idx < rowIdxArr.length; idx++){
  279. if(idx == 0){
  280. model.setValue(grd_earnpre.nodeset + "[" + grd_earnpre.row + "]/orddeptcd", model.getValue(grd_orddept.nodeset + "[" + rowIdxArr[idx] + "]/orddeptcd"));
  281. }else{
  282. grd_earnpre.insertRow(grd_earnpre.rows-1, "below", false, false);
  283. // alert(grd_earnpre.rows);
  284. var insIdx = parseInt(grd_earnpre.rows) -1;
  285. grd_earnpre.refresh();
  286. model.setValue(grd_earnpre.nodeset + "[" + insIdx + "]/status", "A");
  287. model.setValue(grd_earnpre.nodeset + "[" + insIdx + "]/bugtym", model.getValue("/root/cond/bugtym"));
  288. model.setValue(grd_earnpre.nodeset + "[" + insIdx + "]/centcd", model.getValue(grd_orddept.nodeset + "[" + rowIdxArr[idx] + "]/centcd"));
  289. model.setValue(grd_earnpre.nodeset + "[" + insIdx + "]/orddeptcd", model.getValue(grd_orddept.nodeset + "[" + rowIdxArr[idx] + "]/orddeptcd"));
  290. }
  291. }
  292. group2.visible = false;
  293. model.refresh();
  294. ]]>
  295. </script>
  296. </button>
  297. <button id="button4" class="btn2_letter2" disable.background-image="../../../com/commonweb/images/dis_btn2_letter2.gif" style="left:258px; top:175px; width:42px; height:19px; background-image:../../../com/commonweb/images/btn2_letter2.gif; ">
  298. <caption>취소</caption>
  299. <script type="javascript" ev:event="DOMActivate">
  300. <![CDATA[
  301. group2.visible = false;
  302. group1.disabled = false;
  303. ]]>
  304. </script>
  305. </button>
  306. <datagrid id="grd_orddept" nodeset="/root/tmp/preearnlist" caption="^센터^진료과" colsep="^" colwidth="23, 120, 140" extendlastcol="scroll" mergecellsfixedrows="bycolrec" rowsep="|" style="left:0px; top:25px; width:300px; height:148px; ">
  307. <col ref="flag" type="checkbox"/>
  308. <col disabled="true" ref="centcd" type="combo">
  309. <choices>
  310. <itemset nodeset="/root/init/centlist">
  311. <label ref="cdnm"/>
  312. <value ref="cdid"/>
  313. </itemset>
  314. </choices>
  315. </col>
  316. <col disabled="true" ref="orddeptcd" type="combo">
  317. <choices>
  318. <itemset nodeset="/root/init/orddeptlist">
  319. <label ref="cdnm"/>
  320. <value ref="cdid"/>
  321. </itemset>
  322. </choices>
  323. </col>
  324. </datagrid>
  325. </group>
  326. <line id="line2" class="line_4" style="x1:575px; y1:12px; x2:575px; y2:34px; border-color:#ffe4bb; border-left-style:solid; "/>
  327. <button id="button7" class="btn1_letter2" navindex="2" style="left:595px; top:12px; width:56px; height:22px; background-image:../../../com/commonweb/images/btn1_letter2.gif; ">
  328. <caption>조회</caption>
  329. <script type="javascript" ev:event="DOMActivate">
  330. <![CDATA[
  331. if (model.getValue("/root/cond/copybugtym").length < 1) {
  332. messageBox("복사년월을 선택하십시오.", "E999");
  333. return;
  334. }
  335. model.setValue("/root/cond/srchflag", "to");
  336. if(submit("TRSTP01702")){
  337. model.refresh();
  338. for(var rowIdx = 1; rowIdx < grd_earnpre.rows; rowIdx++){
  339. grd_earnpre.cellattribute("disabled", rowIdx, grd_earnpre.colRef("centcd"), rowIdx, grd_earnpre.colRef("orddeptcd")) = "true";
  340. }
  341. }
  342. ]]>
  343. </script>
  344. </button>
  345. </xhtml:body>
  346. </xhtml:html>