SMLLS00800_장비별검사건수.xrw 16 KB

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