SMLQS00100_정도관리통계.xrw 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <!--
  3. * 제 목 : SMLQS00100_정도관리통계.xrw
  4. * 설 명 : 정도관리 통계
  5. * 설 계 자 : PHis
  6. * 작 성 자 : PHis
  7. * 작 성 일 : 2009.07.02
  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. <stslist/>
  20. </main>
  21. <send>
  22. <year/>
  23. <yyyy/>
  24. <mm/>
  25. <codeflag/>
  26. <basecdid/>
  27. </send>
  28. <init>
  29. </init>
  30. <hidden>
  31. <stsflag>1</stsflag>
  32. <stsfromdd/>
  33. <ststodd/>
  34. <stskind>00</stskind>
  35. <stskind2>1</stskind2>
  36. <stsdept>00</stsdept>
  37. <stsflag2>1</stsflag2>
  38. <stseqmt>00</stseqmt>
  39. </hidden>
  40. </root>
  41. </instance>
  42. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  43. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  44. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  45. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  46. <script type="javascript" src="../../../lis/commonweb/js/LLZ001.js"/>
  47. <script type="javascript" ev:event="xforms-ready">
  48. <![CDATA[
  49. fSetInit(); //초기화 함수 호출
  50. //initCalendar();
  51. ]]>
  52. </script>
  53. <submission id="TRLZZ00101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/LB0000"/>
  54. <submission id="TRLQS00101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/stslist"/>
  55. </model>
  56. <script type="javascript">
  57. <![CDATA[
  58. //화면 open시 초기화
  59. function fSetInit() {
  60. var toDay = getCurrentDate();
  61. model.setValue("/root/hidden/stsfromdd", toDay);
  62. model.setValue("/root/hidden/ststodd" , toDay);
  63. model.setValue("/root/send/codeflag","0000|0111|0701|"); //0000:사용자부서코드, 0111:시행부서계 0707: 장비코드
  64. submit("TRLZZ00101");
  65. model.setValue("/root/send/codeflag","0704|"); //0704: 접수구분
  66. model.setValue("/root/send/basecdid", model.getValue("/root/init/LB0000/nm"));
  67. submit("TRLZZ00101"); //부서에 따른 접수구분 조회
  68. model.setValue("/root/init/LB0704[cd = '00']/nm", "- 전 체 -");
  69. //해당일에 대한 마지막 일자 가져와서 그리드 컬럼 숨기기
  70. var lastDay = getLastDay(toDay) + 4;
  71. for(i = lastDay; i > (grd_stsList.cols-1); i--){
  72. grd_stsList.colHidden(i) = true;
  73. }
  74. model.refresh();
  75. }
  76. //통계 희망 월 선택 시 그리드 셋팅 위해 해당월의 마지막 날짜 구함
  77. function getLastDay(Day){
  78. var year = Day.substr(0,4); //년
  79. var month = Day.substr(4,2); //월
  80. with(new Date(year, month, 1, 12)) { //MM = 1 .. 12
  81. setDate(0);
  82. return getDate();
  83. }
  84. }
  85. //조회하고자 하는 월별 그리드 셋팅하기
  86. function fGrdSet(stsflag){
  87. if(stsflag == 1){ //일별의 경우
  88. var day = model.getValue("/root/hidden/stsfromdd");
  89. var lastCol = getLastDay(day) + 3; //선택된 월의 마지막날 + 3(부서명,구분,Total 컬럼)
  90. for(i = 2; i <= grd_stsList.cols; i++){ //부서명때문에 2부터 시작(부서명은 아침채혈일때만 보임)
  91. if(i <= lastCol){
  92. grd_stsList.colHidden(i) = false;
  93. if(i >3){
  94. grd_stsList.colWidth(i) = 40;
  95. }
  96. }else{
  97. grd_stsList.colHidden(i) = true;
  98. }
  99. }
  100. grd_stsList.caption = "구분^검사명^Total^1^2^3^4^5^6^7^8^9^10^11^12^13^14^15^16^17^18^19^20^21^22^23^24^25^26^27^28^29^30^31";
  101. }else if(stsflag == 3){ //연별의 경우
  102. var fromdd = parseInt(model.getValue("/root/hidden/stsfromdd").substr(0,4));
  103. var todd = parseInt(model.getValue("/root/hidden/ststodd").substr(0,4));
  104. var year = fromdd+"^";
  105. var yearlength;
  106. for(i = fromdd+1; i <= todd; i++){
  107. year += i +"^" ;
  108. }
  109. model.setValue("/root/send/year", year);
  110. yearlength = year.split("^").length;
  111. for(i = 4; i<=grd_stsList.cols; i++){
  112. if(i <yearlength+3){
  113. grd_stsList.colHidden(i) = false;
  114. grd_stsList.colWidth(i) = 80;
  115. }else{
  116. grd_stsList.colHidden(i) = true;
  117. }
  118. }
  119. grd_stsList.caption = "구분^검사명^Total^"+ year;
  120. }
  121. model.refresh();
  122. }
  123. //조회구분 선택시 통계희망월 포멧 지정 및 그리드 컬럼 지정하기
  124. function fShowHopeddnGridSet(){
  125. model.removeNodeset("/root/main/stslist");
  126. if(radio1.value == 3){ //연별
  127. model.setValue("/root/hidden/stsfromdd", getCurrentDate().substr(0, 4));
  128. model.setValue("/root/hidden/ststodd", getCurrentDate().substr(0, 4));
  129. grd_stsList.colWidth(4) = 80;
  130. for(i = 5; i<= grd_stsList.cols;i++){
  131. grd_stsList.colHidden(i) = true;
  132. }
  133. ipt_stsfromdd.attribute("format") = "yyyy";
  134. ipt_ststodd.visible = true; //todd날짜
  135. caption9.visible = true;
  136. grd_stsList.caption = "구분^검사명^Total^"+ model.getValue("/root/hidden/stsfromdd");
  137. model.setValue("/root/send/year", getCurrentDate().substr(0, 4));
  138. }else{
  139. ipt_ststodd.visible = false;
  140. caption9.visible = false;
  141. if(radio1.value == 1){ //일별
  142. ipt_stsfromdd.attribute("format") = "yyyy-mm";
  143. model.setValue("/root/hidden/stsfromdd", getCurrentDate().substr(0, 6));
  144. fGrdSet(1);
  145. }else{ //월별
  146. model.setValue("/root/hidden/stsfromdd", getCurrentDate().substr(0, 4));
  147. ipt_stsfromdd.attribute("format") = "yyyy";
  148. for(i = 2; i <= grd_stsList.cols; i++){ //부서명때문에 2부터 시작(부서명은 아침채혈일때만 보임)
  149. if(i <= 15){
  150. grd_stsList.colHidden(i) = false;
  151. if(i >3){
  152. grd_stsList.colWidth(i) = 75;
  153. }
  154. }else{
  155. grd_stsList.colHidden(i) = true;
  156. }
  157. }
  158. grd_stsList.caption = "구분^검사명^Total^1^2^3^4^5^6^7^8^9^10^11^12^13^14^15^16^17^18^19^20^21^22^23^24^25^26^27^28^29^30^31";
  159. }
  160. }
  161. model.refresh();
  162. }
  163. //조회
  164. function fGetStats(){
  165. var fromdd = model.getValue("/root/hidden/stsfromdd");
  166. var lastday = getLastDay(fromdd);
  167. model.makeValue("/root/send/stsflag" , model.getValue("/root/hidden/stsflag")); //조회구분 1: 일별, 2: 월별, 3: 연별
  168. model.makeValue("/root/send/stsfromdd" , fromdd); //조회시작
  169. model.makeValue("/root/send/ststodd" , model.getValue("/root/hidden/ststodd")); //조회끝
  170. model.makeValue("/root/send/stskind" , model.getValue("/root/hidden/stskind")); //통계구분 1: 시행부서, 2: 진료과, 3: 진료의, 4: 채혈자, 5: 시간대별 (단, 병동 및 아침채혈의 경우 1: 병동별)
  171. model.makeValue("/root/send/stskind2" , model.getValue("/root/hidden/stskind2")); //결과상태 1: 전체, 2: 완료, 3: 제외
  172. model.makeValue("/root/send/stsflag2" , model.getValue("/root/hidden/stsflag2")); //통계구분 1: 시행부서별, 2: 장비별
  173. model.makeValue("/root/send/stsdept" , model.getValue("/root/hidden/stsdept")); //시행부서
  174. model.makeValue("/root/send/stseqmt" , model.getValue("/root/hidden/stseqmt")); //시행부서
  175. model.makeValue("/root/send/lastday" , lastday); //연별조회시 사용
  176. model.makeValue("/root/send/deptflag" , model.getValue("/root/init/LB0000/nm"));
  177. submit("TRLQS00101");
  178. grd_stsList.colStyle(3, "data", "background-color") = "#ffe79d"; //total col 색 변경
  179. for(i = 1; i < grd_stsList.rows; i++){
  180. if(model.getValue("/root/main/stslist[" + i + "]/stsflag1") == "0"){ //합계 row 색 변경
  181. grd_stsList.rowStyle(i, "data", "background-color") = "#7BE6B7";
  182. }
  183. }
  184. }
  185. ]]>
  186. </script>
  187. </xhtml:head>
  188. <xhtml:body style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  189. <group id="group3" scroll="auto" style="left:0px; top:40px; width:1193px; height:719px; ">
  190. <group id="group1" style="left:0px; top:0px; width:1192px; height:55px; vertical-align:middle; ">
  191. <shape id="roundrect2" class="roundrect_search" appearance="roundrect" style="left:0px; top:0px; width:1192px; height:55px; "/>
  192. <button id="btn_ref" class="btn1_letter2" style="left:1116px; top:17px; width:56px; height:22px; ">
  193. <caption>조회</caption>
  194. <script type="javascript" ev:event="DOMActivate">
  195. <![CDATA[
  196. if(model.getValue("/root/hidden/stsflag") == 3){
  197. var fromdd = parseInt(model.getValue("/root/hidden/stsfromdd").substr(0,4));
  198. var todd = parseInt(model.getValue("/root/hidden/ststodd").substr(0,4));
  199. if(todd - fromdd >9 ){
  200. alert("10년 이내로 조회 가능합니다\n조회기간을 다시 선택하세요");
  201. return;
  202. }
  203. }
  204. fGetStats();
  205. ]]>
  206. </script>
  207. </button>
  208. <line id="line3" class="line_4" style="x1:1093px; y1:7px; x2:1093px; y2:49px; "/>
  209. <input id="ipt_stsfromdd" ref="/root/hidden/stsfromdd" class="input_search" inputtype="date" format="yyyy-mm" style="left:463px; top:9px; width:95px; height:19px; ">
  210. <script type="javascript" ev:event="xforms-value-changed">
  211. <![CDATA[
  212. var stsflag = model.getValue("/root/hidden/stsflag");
  213. model.removeNodeset("/root/main/stslist");
  214. fGrdSet(stsflag);
  215. ]]>
  216. </script>
  217. </input>
  218. <input id="ipt_ststodd" ref="/root/hidden/ststodd" class="input_search" visibility="hidden" inputtype="date" format="yyyy" style="left:573px; top:9px; width:95px; height:19px; ">
  219. <script type="javascript" ev:event="xforms-value-changed">
  220. <![CDATA[
  221. var stsflag = model.getValue("/root/hidden/stsflag");
  222. model.removeNodeset("/root/main/stslist");
  223. fGrdSet(stsflag);
  224. ]]>
  225. </script>
  226. </input>
  227. <caption id="caption4" class="search_name" style="left:365px; top:9px; width:115px; height:17px; ">조회기간 :</caption>
  228. <caption id="caption9" class="search_no_b" visibility="hidden" style="left:560px; top:9px; width:23px; height:17px; ">~</caption>
  229. <caption id="cap_eqmt" class="search_name" visibility="hidden" style="left:729px; top:31px; width:94px; height:17px; ">장 비 :</caption>
  230. <select1 id="cbo_eqmt" ref="/root/hidden/stseqmt" visibility="hidden" appearance="minimal" style="left:825px; top:31px; width:110px; height:19px; ">
  231. <choices>
  232. <itemset nodeset="/root/init/LB0701">
  233. <label ref="nm"/>
  234. <value ref="cd"/>
  235. </itemset>
  236. </choices>
  237. </select1>
  238. <caption id="cap_dept" class="search_name" visibility="visible" style="left:729px; top:31px; width:94px; height:17px; ">시행 부서 :</caption>
  239. <select1 id="cbo_dept" ref="/root/hidden/stsdept" visibility="visible" appearance="minimal" style="left:825px; top:31px; width:110px; height:19px; ">
  240. <choices>
  241. <itemset nodeset="/root/init/LB0111">
  242. <label ref="nm"/>
  243. <value ref="cd"/>
  244. </itemset>
  245. </choices>
  246. </select1>
  247. <select1 id="radio2" ref="/root/hidden/stskind2" visibility="hidden" appearance="full" cellspacing="10" cols="3" overflow="visible" style="left:103px; top:30px; width:202px; height:20px; border-style:none; ">
  248. <choices>
  249. <item>
  250. <label>전 체</label>
  251. <value>1</value>
  252. </item>
  253. <item>
  254. <label>완 료</label>
  255. <value>2</value>
  256. </item>
  257. <item>
  258. <label>제 외</label>
  259. <value>3</value>
  260. </item>
  261. </choices>
  262. <script type="javascript" ev:event="xforms-select">
  263. <![CDATA[
  264. model.removeNodeset("/root/main/stslist");
  265. model.refresh();
  266. ]]>
  267. </script>
  268. </select1>
  269. <caption id="caption1" class="search_name" style="left:5px; top:9px; width:96px; height:17px; ">조회구분 :</caption>
  270. <select1 id="radio1" ref="/root/hidden/stsflag" appearance="full" cellspacing="20" cols="3" overflow="visible" style="left:95px; top:9px; width:210px; height:20px; border-style:none; ">
  271. <choices>
  272. <item>
  273. <label>일별</label>
  274. <value>1</value>
  275. </item>
  276. <item>
  277. <label>월별</label>
  278. <value>2</value>
  279. </item>
  280. <item>
  281. <label>연별</label>
  282. <value>3</value>
  283. </item>
  284. </choices>
  285. <script type="javascript" ev:event="xforms-select">
  286. <![CDATA[
  287. fShowHopeddnGridSet();
  288. ]]>
  289. </script>
  290. </select1>
  291. <caption id="caption2" class="search_name" visibility="hidden" style="left:5px; top:31px; width:95px; height:17px; ">결과구분 :</caption>
  292. <select1 id="cbo_1" ref="/root/hidden/stskind" visibility="visible" appearance="minimal" style="left:462px; top:30px; width:122px; height:19px; ">
  293. <choices>
  294. <itemset nodeset="/root/init/LB0704">
  295. <label ref="nm"/>
  296. <value ref="cd"/>
  297. </itemset>
  298. </choices>
  299. </select1>
  300. <caption id="caption3" class="search_name" visibility="visible" style="left:365px; top:31px; width:94px; height:17px; ">접수구분 :</caption>
  301. <select1 id="cbo_if" ref="/root/hidden/stsflag2" visibility="visible" appearance="minimal" style="left:825px; top:10px; width:111px; height:19px; ">
  302. <choices>
  303. <item>
  304. <label>시행부서별</label>
  305. <value>1</value>
  306. </item>
  307. <item>
  308. <label>검사장비별</label>
  309. <value>2</value>
  310. </item>
  311. </choices>
  312. <script type="javascript" ev:event="xforms-select">
  313. <![CDATA[
  314. if(cbo_if.value == "2"){
  315. cap_dept.visible = false;
  316. cbo_dept.visible = false;
  317. cap_eqmt.visible = true;
  318. cbo_eqmt.visible = true;
  319. }else{
  320. cap_dept.visible = true;
  321. cbo_dept.visible = true;
  322. cap_eqmt.visible = false;
  323. cbo_eqmt.visible = false;
  324. }
  325. ]]>
  326. </script>
  327. </select1>
  328. <caption id="caption16" class="search_name" visibility="visible" style="left:729px; top:11px; width:94px; height:17px; ">통계 구분 :</caption>
  329. </group>
  330. <line id="line1" class="line_1" style="x1:0px; y1:71px; x2:1193px; y2:71px; "/>
  331. <caption id="caption6" class="tit_2" style="left:5px; top:57px; width:134px; height:13px; ">통계 리스트</caption>
  332. <datagrid id="grd_stsList" nodeset="/root/main/stslist" caption="구분^검사명^Total^1^2^3^4^5^6^7^8^9^10^11^12^13^14^15^16^17^18^19^20^21^22^23^24^25^26^27^28^29^30^31" colsep="^" colwidth="90,120, 60, 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" dataheight="23" frozencols="2" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="23" style="left:0px; top:76px; width:1193px; height:639px; text-align:center; ">
  333. <col ref="itemnm1" style="text-align:left; "/>
  334. <col ref="itemnm2" style="text-align:left; "/>
  335. <col ref="total" format="#,###.#" style="text-align:right; "/>
  336. <col ref="d01" format="#,###.#" style="text-align:right; "/>
  337. <col ref="d02" format="#,###.#" style="text-align:right; "/>
  338. <col ref="d03" format="#,###.#" style="text-align:right; "/>
  339. <col ref="d04" format="#,###.#" style="text-align:right; "/>
  340. <col ref="d05" format="#,###.#" style="text-align:right; "/>
  341. <col ref="d06" format="#,###.#" style="text-align:right; "/>
  342. <col ref="d07" format="#,###.#" style="text-align:right; "/>
  343. <col ref="d08" format="#,###.#" style="text-align:right; "/>
  344. <col ref="d09" format="#,###.#" style="text-align:right; "/>
  345. <col ref="d10" format="#,###.#" style="text-align:right; "/>
  346. <col ref="d11" format="#,###.#" style="text-align:right; "/>
  347. <col ref="d12" format="#,###.#" style="text-align:right; "/>
  348. <col ref="d13" format="#,###.#" style="text-align:right; "/>
  349. <col ref="d14" format="#,###.#" style="text-align:right; "/>
  350. <col ref="d15" format="#,###.#" style="text-align:right; "/>
  351. <col ref="d16" format="#,###.#" style="text-align:right; "/>
  352. <col ref="d17" format="#,###.#" style="text-align:right; "/>
  353. <col ref="d18" format="#,###.#" style="text-align:right; "/>
  354. <col ref="d19" format="#,###.#" style="text-align:right; "/>
  355. <col ref="d20" format="#,###.#" style="text-align:right; "/>
  356. <col ref="d21" format="#,###.#" style="text-align:right; "/>
  357. <col ref="d22" format="#,###.#" style="text-align:right; "/>
  358. <col ref="d23" format="#,###.#" style="text-align:right; "/>
  359. <col ref="d24" format="#,###.#" style="text-align:right; "/>
  360. <col ref="d25" format="#,###.#" style="text-align:right; "/>
  361. <col ref="d26" format="#,###.#" style="text-align:right; "/>
  362. <col ref="d27" format="#,###.#" style="text-align:right; "/>
  363. <col ref="d28" format="#,###.#" style="text-align:right; "/>
  364. <col ref="d29" format="#,###.#" style="text-align:right; "/>
  365. <col ref="d30" format="#,###.#" style="text-align:right; "/>
  366. <col ref="d31" format="#,###.#" style="text-align:right; "/>
  367. <script type="javascript" ev:event="onaftersort">
  368. <![CDATA[
  369. grd_stsList.gridToInstance();
  370. ]]>
  371. </script>
  372. </datagrid>
  373. </group>
  374. <caption id="caption10" class="tit_1" style="left:0px; top:0px; width:800px; height:14px; ">정도 관리 통계</caption>
  375. <group id="group5" scroll="auto" style="left:0px; top:13px; width:1195px; height:27px; ">
  376. <line id="line2" class="line_2" style="x1:0px; y1:25px; x2:1195px; y2:25px; "/>
  377. <button id="btn_print" class="btn6_letter2" visibility="hidden" style="left:0px; top:3px; width:56px; height:22px; ">
  378. <caption>출력</caption>
  379. <script type="javascript" ev:event="DOMActivate">
  380. <![CDATA[
  381. //fPrint();
  382. ]]>
  383. </script>
  384. </button>
  385. <button id="btn_excel" class="btn6_letter5" style="left:0px; top:3px; width:92px; height:22px; ">
  386. <caption>EXCEL저장</caption>
  387. <script type="javascript" ev:event="DOMActivate">
  388. <![CDATA[
  389. /*var flagnm;
  390. var flag = model.getValue("/root/hidden/bcollflag");
  391. if(flag == 0){
  392. flagnm = "";
  393. }else if(flag == 1){
  394. flagnm = "통계_";
  395. }else if(flag == 2){
  396. flagnm = "통계_";
  397. }else if(flag == 3){
  398. flagnm = "통계_";
  399. }*/
  400. var fileName = window.fileDialog("save", ",", false, "정도관리_" +getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  401. if (fileName != ""){
  402. grd_stsList.saveExcel(fileName);
  403. }
  404. ]]>
  405. </script>
  406. </button>
  407. </group>
  408. </xhtml:body>
  409. </xhtml:html>