SMLLS00900_진단검사부서별통계.xrw 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <!--
  3. * 제 목 : SMLLS00900_진단검사부서별통계.xrw
  4. * 설 명 : 진단검사부서별통계
  5. * 설 계 자 : (주)에이씨케이 - 윤재한
  6. * 작 성 자 : (주)에이씨케이 -
  7. * 작 성 일 : 2008.04.21
  8. * 수정이력 :
  9. * 기 타 :
  10. -->
  11. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
  12. <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">
  13. <xhtml:head>
  14. <xhtml:title>진단검사 부서별 통계</xhtml:title>
  15. <model id="model1">
  16. <instance id="instance1">
  17. <root xmlns="">
  18. <main>
  19. <ddstats/>
  20. <yystats/>
  21. </main>
  22. <send/>
  23. <init>
  24. </init>
  25. <hidden>
  26. <ioflag/>
  27. <statshopefromdd/>
  28. <statshopetodd/>
  29. </hidden>
  30. </root>
  31. </instance>
  32. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  33. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  34. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  35. <script type="javascript" src="../../../lis/commonweb/js/LLZ001.js"/>
  36. <script type="javascript" ev:event="xforms-ready">
  37. <![CDATA[
  38. fSetInit(); //초기화 함수 호출
  39. ]]>
  40. </script>
  41. <submission id="TRLLS00901" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/ddstats"/>
  42. <submission id="TRLLS00902" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/hidden/yystats"/>
  43. </model>
  44. <script type="javascript">
  45. <![CDATA[
  46. //화면 open시 초기화
  47. function fSetInit() {
  48. var toDay = getCurrentDate();
  49. model.setValue("/root/hidden/statshopefromdd", toDay); //통계희망시작일 = 현재일자
  50. model.setValue("/root/hidden/statshopetodd", toDay); //통계희망종료일 = 현재일자
  51. //그리드초기화
  52. model.removeNodeset("/root/main/ddstats"); //일별, 월별, 분기별
  53. model.removeNodeset("/root/main/yystats"); //연별
  54. model.toggle("dd"); //초기시 일별그리드 표시
  55. btn_ddstats.selected = true; //일별switch 버튼 선택
  56. model.refresh();
  57. }
  58. //switch 버튼 클릭시 그리드 초기화
  59. function fGridInit() {
  60. var cols = grd_yy.cols-grd_yy.fixedCols;
  61. for( var i = 0; i < cols; i++ ) {
  62. grd_yy.removeColumn(); //그리드 컬럼 다 지우기.. 지우지 않으면 그리드 형태가 유지되어 다른 통계 조회후 연별 통계시 그리드 옆에 이어져 조회됨.
  63. }
  64. model.removeNodeset("/root/main/ddstats"); //일별, 월별, 분기별
  65. model.removeNodeset("/root/main/yystats"); //연별
  66. model.refresh();
  67. }
  68. //통계희망일, 입원/외래구분, 조회구분(일,월,분기,연) 에 따른 조회
  69. function fGetStats() {
  70. if(btn_ddstats.selected == true) {
  71. model.makeValue("/root/send/refflag", "d");
  72. } else if(btn_mmstats.selected == true) {
  73. model.makeValue("/root/send/refflag", "m");
  74. } else if(btn_qurtyystats.selected == true) {
  75. model.makeValue("/root/send/refflag", "q");
  76. } else if(btn_yystats.selected == true) {
  77. fGetYYStats();
  78. return;
  79. }
  80. model.makeValue("/root/send/statshopefromdd", model.getValue("/root/hidden/statshopefromdd")); //통계희망시작일
  81. model.makeValue("/root/send/statshopetodd", model.getValue("/root/hidden/statshopetodd")); //통계희망종료일
  82. submit("TRLLS00901");
  83. model.removeNodeset("/root/send");
  84. model.makeNode("/root/send");
  85. }
  86. //연별 통계 조회
  87. function fGetYYStats() {
  88. var cols = grd_yy.cols-grd_yy.fixedCols;
  89. var rows = grd_yy.rows-grd_yy.fixedRows;
  90. for( var i = 0; i < cols; i++ ) {
  91. grd_yy.removeColumn(false); //그리드 컬럼 다 지우기..지우지 않으면 그리드 형태가 유지되어 그리드 옆에 이어져 조회됨.
  92. }
  93. model.removeNodeset("/root/main/yystats"); //연별그리드 초기화
  94. model.makeNode("/root/main/yystats/row");
  95. model.makeValue("/root/send/statshopefromdd", model.getValue("/root/hidden/statshopefromdd")); //통계희망시작일
  96. model.makeValue("/root/send/statshopetodd", model.getValue("/root/hidden/statshopetodd")); //통계희망종료일
  97. submit("TRLLS00902"); //통계조회
  98. model.removeNodeset("/root/send");
  99. model.makeNode("/root/send");
  100. //caption 정보
  101. var gridCaption = model.getValue("/root/hidden/yystats/header/caption");
  102. if(gridCaption == "") return;
  103. //ref 정보
  104. var gridColRef = model.getValue("/root/hidden/yystats/header/colref");
  105. var gridColRefArray = gridColRef.split("^");
  106. //type 정보
  107. var gridColType = model.getValue("/root/hidden/yystats/header/type");
  108. var gridColTypeArray = gridColType.split("^");
  109. for( var i = 0; i < gridColRefArray.length; i++ ) {
  110. if(i == 0) {
  111. grd_yy.addColumn("ref:" + gridColRefArray[i] + "; type:"+gridColTypeArray[i]+"; style:text-align:left; ", false); //Grid 속성 지정
  112. } else {
  113. grd_yy.addColumn("ref:" + gridColRefArray[i] + "; type:"+gridColTypeArray[i]+"; format:#,###; ", false); //Grid 속성 지정
  114. }
  115. }
  116. grd_yy.colWidth(1) = 80; //부서 Column은 폭이 달라서 따로 지정.
  117. for( i = 2; i < grd_yy.cols; i++ ) {
  118. grd_yy.colWidth(i) = 60; //Column 폭 조정
  119. }
  120. grd_yy.caption = gridCaption; //Caption 지정
  121. var node = instance1.selectSingleNode("/root/main");
  122. node.replaceChild(instance1.root.hidden.yystats, instance1.root.main.yystats); //조회하고 수정한 사항을 main에 보냄
  123. grd_yy.rowheight(0) = 23; //Title 높이 조정
  124. model.refresh();
  125. fGetTotal(); //연도별 Total 계산
  126. }
  127. //연도별 통계 Total계산
  128. function fGetTotal() {
  129. //Column 합계
  130. for(r = 1; r < grd_yy.rows; r++) {
  131. colsum = 0;
  132. for(i = 2; i < grd_yy.cols - 1; i++) {
  133. if(grd_yy.textmatrix(r, i) != "") {
  134. colsum += parseInt(grd_yy.textmatrix(r, i));
  135. }
  136. }
  137. model.setValue("/root/main/yystats/row["+ r +"]/total", colsum);
  138. }
  139. //Row 합계
  140. grd_yy.addRow();
  141. model.refresh();
  142. grd_yy.textmatrix(grd_yy.rows-1, 1) = "Total";
  143. for(i = 2; i < grd_yy.cols; i++) {
  144. rowsum = 0;
  145. for(r = 1; r < grd_yy.rows-1; r++) {
  146. if(grd_yy.textmatrix(r, i) != "") {
  147. rowsum += parseInt(grd_yy.textmatrix(r, i));
  148. }
  149. }
  150. grd_yy.textmatrix(grd_yy.rows-1, i) = rowsum;
  151. }
  152. }
  153. //엑셀저장
  154. function fExeSaveToExcel() {
  155. if(btn_ddstats.selected == true) { //일별
  156. fSaveExcel("grd_dd");
  157. } else if(btn_mmstats.selected == true) { //월별
  158. fSaveExcel("grd_mm");
  159. } else if(btn_qurtyystats.selected == true) { //분기별
  160. fSaveExcel("grd_qurtyy");
  161. } else if(btn_yystats.selected == true) { //연별
  162. fSaveExcel("grd_yy");
  163. }
  164. }
  165. //통계그리드를 출력한다.
  166. function fPrint() {
  167. if(btn_ddstats.selected == true) { //일별
  168. exeReportPreview("RPLLS01800", "XMLSTR");
  169. } else if(btn_mmstats.selected == true) { //월별
  170. exeReportPreview("RPLLS01900", "XMLSTR");
  171. } else if(btn_qurtyystats.selected == true) { //분기별
  172. exeReportPreview("RPLLS02000", "XMLSTR");
  173. } else if(btn_yystats.selected == true) { //연별
  174. exeReportPreview("RPLLS02100", "XMLSTR");
  175. }
  176. }
  177. ]]>
  178. </script>
  179. </xhtml:head>
  180. <xhtml:body style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  181. <group id="group3" scroll="auto" style="left:0px; top:40px; width:1195px; height:744; ">
  182. <group id="group1" style="left:0px; top:10px; width:1195px; height:35px; ">
  183. <shape id="roundrect2" class="roundrect_search" appearance="roundrect" style="left:0px; top:0px; width:1195px; height:35px; "/>
  184. <button id="btn_ref" class="btn1_letter2" style="left:1123px; top:7px; width:56px; height:22px; ">
  185. <caption>조회</caption>
  186. <script type="javascript" ev:event="DOMActivate">
  187. <![CDATA[
  188. fGetStats();
  189. ]]>
  190. </script>
  191. </button>
  192. <line id="line3" class="line_4" style="x1:1108px; y1:6px; x2:1108px; y2:28px; "/>
  193. <input id="ipt_workfromdd" ref="/root/hidden/statshopefromdd" class="input_search" inputtype="date" style="left:128px; top:8px; width:90px; height:19px; "/>
  194. <input id="ipt_worktodd" ref="/root/hidden/statshopetodd" class="input_search" inputtype="date" style="left:233px; top:8px; width:90px; height:19px; "/>
  195. <caption id="caption4" class="search_name" style="left:15px; top:9px; width:110px; height:17px; ">통계 희망일 :</caption>
  196. <caption id="caption9" class="search_no_b" style="left:220px; top:10px; width:13px; height:17px; ">~</caption>
  197. </group>
  198. <switch id="swt_statflag" class="sw_box" style="left:0px; top:75px; width:1195px; height:663px; ">
  199. <case id="dd" selected="true">
  200. <datagrid id="grd_dd" nodeset="/root/main/ddstats" caption="부서^01^02^03^04^05^06^07^08^09^10^11^12^13^14^15^16^17^18^19^20^21^22^23^24^25^26^27^28^29^30^31^Total" colsep="^" colwidth="80, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 60" dataheight="23" explorerbar="sortshow" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="23" style="left:5px; top:5px; width:1180px; height:646px; text-align:right; ">
  201. <col ref="sectscrnnm" style="text-align:left; "/>
  202. <col ref="d01" format="#,###"/>
  203. <col ref="d02" format="#,###"/>
  204. <col ref="d03" format="#,###"/>
  205. <col ref="d04" format="#,###"/>
  206. <col ref="d05" format="#,###"/>
  207. <col ref="d06" format="#,###"/>
  208. <col ref="d07" format="#,###"/>
  209. <col ref="d08" format="#,###"/>
  210. <col ref="d09" format="#,###"/>
  211. <col ref="d10" format="#,###"/>
  212. <col ref="d11" format="#,###"/>
  213. <col ref="d12" format="#,###"/>
  214. <col ref="d13" format="#,###"/>
  215. <col ref="d14" format="#,###"/>
  216. <col ref="d15" format="#,###"/>
  217. <col ref="d16" format="#,###"/>
  218. <col ref="d17" format="#,###"/>
  219. <col ref="d18" format="#,###"/>
  220. <col ref="d19" format="#,###"/>
  221. <col ref="d20" format="#,###"/>
  222. <col ref="d21" format="#,###"/>
  223. <col ref="d22" format="#,###"/>
  224. <col ref="d23" format="#,###"/>
  225. <col ref="d24" format="#,###"/>
  226. <col ref="d25" format="#,###"/>
  227. <col ref="d26" format="#,###"/>
  228. <col ref="d27" format="#,###"/>
  229. <col ref="d28" format="#,###"/>
  230. <col ref="d29" format="#,###"/>
  231. <col ref="d30" format="#,###"/>
  232. <col ref="d31" format="#,###"/>
  233. <col ref="total" format="#,###"/>
  234. <script type="javascript" ev:event="onaftersort">
  235. <![CDATA[
  236. grd_dd.gridToInstance();
  237. ]]>
  238. </script>
  239. </datagrid>
  240. </case>
  241. <case id="mm">
  242. <datagrid id="grd_mm" nodeset="/root/main/ddstats" caption="부서^01^02^03^04^05^06^07^08^09^10^11^12^Total" colsep="^" colwidth="80, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60" dataheight="23" explorerbar="sortshow" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="23" style="left:5px; top:5px; width:1180px; height:646px; text-align:right; ">
  243. <col ref="sectscrnnm" style="text-align:left; "/>
  244. <col ref="d01" format="#,###"/>
  245. <col ref="d02" format="#,###"/>
  246. <col ref="d03" format="#,###"/>
  247. <col ref="d04" format="#,###"/>
  248. <col ref="d05" format="#,###"/>
  249. <col ref="d06" format="#,###"/>
  250. <col ref="d07" format="#,###"/>
  251. <col ref="d08" format="#,###"/>
  252. <col ref="d09" format="#,###"/>
  253. <col ref="d10" format="#,###"/>
  254. <col ref="d11" format="#,###"/>
  255. <col ref="d12" format="#,###"/>
  256. <col ref="total" format="#,###"/>
  257. <script type="javascript" ev:event="onaftersort">
  258. <![CDATA[
  259. grd_mm.gridToInstance();
  260. ]]>
  261. </script>
  262. </datagrid>
  263. </case>
  264. <case id="qurtyy">
  265. <datagrid id="grd_qurtyy" nodeset="/root/main/ddstats" caption="부서^1^2^3^4^Total" colsep="^" colwidth="80, 60, 60, 60, 60, 60" dataheight="23" explorerbar="sortshow" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="23" style="left:5px; top:5px; width:1180px; height:646px; text-align:right; ">
  266. <col ref="sectscrnnm" style="text-align:left; "/>
  267. <col ref="d01" format="#,###"/>
  268. <col ref="d02" format="#,###"/>
  269. <col ref="d03" format="#,###"/>
  270. <col ref="d04" format="#,###"/>
  271. <col ref="total" format="#,###"/>
  272. <script type="javascript" ev:event="onaftersort">
  273. <![CDATA[
  274. grd_qurtyy.gridToInstance();
  275. ]]>
  276. </script>
  277. </datagrid>
  278. </case>
  279. <case id="yy">
  280. <datagrid id="grd_yy" nodeset="/root/main/yystats/row" backcoloralternate="transparent" colsep="^" dataheight="23" explorerbar="sortshow" frozencols="2" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="23" style="left:5px; top:5px; width:1180px; height:646px; text-align:center; ">
  281. <script type="javascript" ev:event="onaftersort">
  282. <![CDATA[
  283. grd_qurtyy.gridToInstance();
  284. ]]>
  285. </script>
  286. </datagrid>
  287. </case>
  288. </switch>
  289. <button id="btn_mmstats" class="btn_sw" group="tab" style="left:75px; top:54px; width:75px; height:22px; ">
  290. <caption>월별 통계</caption>
  291. <toggle case="mm" ev:event="DOMActivate"/>
  292. <script type="javascript" ev:event="DOMActivate">
  293. <![CDATA[
  294. fGridInit();
  295. ]]>
  296. </script>
  297. </button>
  298. <button id="btn_qurtyystats" class="btn_sw" group="tab" style="left:150px; top:54px; width:90px; height:22px; ">
  299. <caption>분기별 통계</caption>
  300. <toggle case="qurtyy" ev:event="DOMActivate"/>
  301. <script type="javascript" ev:event="DOMActivate">
  302. <![CDATA[
  303. fGridInit();
  304. ]]>
  305. </script>
  306. </button>
  307. <button id="btn_ddstats" class="btn_sw" group="tab" style="left:0px; top:54px; width:75px; height:22px; ">
  308. <caption>일별 통계</caption>
  309. <toggle case="dd" ev:event="DOMActivate"/>
  310. <script type="javascript" ev:event="DOMActivate">
  311. <![CDATA[
  312. fGridInit();
  313. ]]>
  314. </script>
  315. </button>
  316. <button id="btn_yystats" class="btn_sw" group="tab" style="left:240px; top:54px; width:75px; height:22px; ">
  317. <caption>연별 통계</caption>
  318. <toggle case="yy" ev:event="DOMActivate"/>
  319. <script type="javascript" ev:event="DOMActivate">
  320. <![CDATA[
  321. fGridInit();
  322. ]]>
  323. </script>
  324. </button>
  325. </group>
  326. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:800px; height:14px; ">진단검사 부서별 통계</caption>
  327. <group id="group4" scroll="auto" style="left:0px; top:13px; width:1195px; height:27px; ">
  328. <line id="line2" class="line_2" style="x1:0px; y1:25px; x2:1195px; y2:25px; "/>
  329. <button id="btn_print" class="btn6_letter2" style="left:0px; top:3px; width:56px; height:22px; ">
  330. <caption>출력</caption>
  331. <script type="javascript" ev:event="DOMActivate">
  332. <![CDATA[
  333. fPrint();
  334. ]]>
  335. </script>
  336. </button>
  337. <button id="btn_excel" class="btn6_letter5" style="left:59px; top:3px; width:92px; height:22px; ">
  338. <caption>EXCEL저장</caption>
  339. <script type="javascript" ev:event="DOMActivate">
  340. <![CDATA[
  341. fExeSaveToExcel();
  342. ]]>
  343. </script>
  344. </button>
  345. </group>
  346. </xhtml:body>
  347. </xhtml:html>