SMANS01000_식수통계.xfdl 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SMANS01000" position="absolute 0 0 1199 716" titletext="식수통계" oninit="SMANS01000_oninit" onload="SMANS01000_onload">
  5. <Layouts>
  6. <Layout>
  7. <Static text="월별 소속 구분별 식수 리스트" position="absolute 2 64 202 80" id="caption1" class="tit_2"/>
  8. <Shape position="absolute 0 81 1183 87" linetype="horizontal" id="line1" class="line_10"/>
  9. <Div position="absolute 0 25 1195 55" align="align:center top;" id="grp_sea" class="div_SA">
  10. <Layouts>
  11. <Layout>
  12. <Static text="조회기간 :" position="absolute 15 7 101 24" id="caption2" class="search_name"/>
  13. <Shape position="absolute 1107 4 1113 26" linetype="vertical" id="line13" class="line_4"/>
  14. <Button position="absolute 1120 4 1176 26" id="btn_sea" class="btn1" taborder="4" text="조회" onclick="grp_sea_btn_sea_onclick"/>
  15. <Calendar position="absolute 207 6 292 25" id="ipt_todd" class="input_default" taborder="2" mask="yyyy-mm" dateformat="yyyy-MM" value="null" editformat="yyyy-MM" onchanged="grp_sea_ipt_todd_onchanged"/>
  16. <Static text="~" position="absolute 192 7 204 24" id="caption5" class="search_no_b"/>
  17. <Calendar position="absolute 106 6 191 25" id="ipt_fromdd" class="input_default" taborder="1" mask="yyyy-mm" dateformat="yyyy-MM" value="null" editformat="yyyy-MM" onchanged="grp_sea_ipt_fromdd_onchanged"/>
  18. </Layout>
  19. </Layouts>
  20. </Div>
  21. <Button position="absolute 1120 60 1184 79" id="btn_excsave" class="btn2" text="엑셀저장" onclick="btn_excsave_onclick"/>
  22. <Grid position="absolute 0 86 1183 710" id="grd_sicksulist" class="datagrid2" binddataset="ds_main_list_item">
  23. <Formats>
  24. <Format id="default">
  25. <Columns>
  26. <Column size="24"/>
  27. <Column size="100"/>
  28. <Column size="70"/>
  29. <Column size="100"/>
  30. <Column size="300"/>
  31. <Column size="300"/>
  32. <Column size="100"/>
  33. <Column size="100"/>
  34. </Columns>
  35. <Rows>
  36. <Row size="24" band="head"/>
  37. <Row size="24"/>
  38. <Row size="24" band="summ"/>
  39. </Rows>
  40. <Band id="head">
  41. <Cell/>
  42. <Cell col="1" text="소속"/>
  43. <Cell col="2" text="사번"/>
  44. <Cell col="3" text="성명"/>
  45. <Cell col="4" text="본원부서"/>
  46. <Cell col="5" text="칠곡부서"/>
  47. <Cell col="6" text="사용수"/>
  48. <Cell col="7" text="총금액"/>
  49. </Band>
  50. <Band id="body">
  51. <Cell celltype="head" expr="currow + 1"/>
  52. <Cell col="1" style="background:expr:utlf_isNull(instnm) ? '#ccffff' : '';background2:expr:utlf_isNull(instnm) ? '#ccffff' : '';font:expr:utlf_isNull(instnm) ? 'arial,9,bold' : '';" text="bind:instnm" expr="expr:utlf_isNull(instnm) ? '소계' : instnm" suppress="1" suppressalign="middle,over" enable="false"/>
  53. <Cell col="2" style="background:expr:utlf_isNull(instnm) ? '#ccffff' : '';background2:expr:utlf_isNull(instnm) ? '#ccffff' : '';" text="bind:emplno" enable="false"/>
  54. <Cell col="3" style="background:expr:utlf_isNull(instnm) ? '#ccffff' : '';background2:expr:utlf_isNull(instnm) ? '#ccffff' : '';" text="bind:name" enable="false"/>
  55. <Cell col="4" style="align:left top;padding:5 2 1 2;background:expr:utlf_isNull(instnm) ? '#ccffff' : '';background2:expr:utlf_isNull(instnm) ? '#ccffff' : '';" text="bind:dutplcedeptnm" wordwrap="word" enable="false"/>
  56. <Cell col="5" style="align:left top;padding:5 2 1 2;background:expr:utlf_isNull(instnm) ? '#ccffff' : '';background2:expr:utlf_isNull(instnm) ? '#ccffff' : '';" text="bind:deptnm" wordwrap="word" enable="false"/>
  57. <Cell col="6" displaytype="number" style="background:expr:utlf_isNull(instnm) ? '#ccffff' : '';background2:expr:utlf_isNull(instnm) ? '#ccffff' : '';font:expr:utlf_isNull(instnm) ? 'arial,9,bold' : '';" text="bind:count" enable="false"/>
  58. <Cell col="7" displaytype="number" style="background:expr:utlf_isNull(instnm) ? '#ccffff' : '';background2:expr:utlf_isNull(instnm) ? '#ccffff' : '';font:expr:utlf_isNull(instnm) ? 'arial,9,bold' : '';" text="bind:amount" enable="false"/>
  59. </Band>
  60. <Band id="summary">
  61. <Cell/>
  62. <Cell col="1" style="font:arial,9,bold;" text="총계"/>
  63. <Cell col="2"/>
  64. <Cell col="3"/>
  65. <Cell col="4"/>
  66. <Cell col="5"/>
  67. <Cell col="6" displaytype="number" style="font:arial,9,bold;" text="expr:getSum(&quot;count&quot;)"/>
  68. <Cell col="7" displaytype="number" style="font:arial,9,bold;" text="expr:getSum(&quot;amount&quot;)"/>
  69. </Band>
  70. </Format>
  71. </Formats>
  72. </Grid>
  73. <Button position="absolute 1027 29 1104 51" id="btn_prt" class="btn2" text="PDF 저장" onclick="btn_prt_onclick"/>
  74. <Static id="caption6" text="본원,칠곡 소속 구분별 식수 통계" class="tit_1" position="absolute 0 0 219 25"/>
  75. </Layout>
  76. </Layouts>
  77. <Objects>
  78. <Dataset id="ds_main_list_item" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  79. <ColumnInfo>
  80. <Column id="emplno" type="STRING" size="256"/>
  81. <Column id="name" type="STRING" size="256"/>
  82. <Column id="dutplcedeptnm" type="STRING" size="256"/>
  83. <Column id="deptnm" type="STRING" size="256"/>
  84. <Column id="instnm" type="STRING" size="256"/>
  85. <Column id="count" type="STRING" size="256"/>
  86. <Column id="amount" type="STRING" size="256"/>
  87. </ColumnInfo>
  88. <Rows>
  89. <Row>
  90. <Col id="emplno"/>
  91. <Col id="name"/>
  92. <Col id="dutplcedeptnm"/>
  93. <Col id="deptnm"/>
  94. <Col id="instnm"/>
  95. <Col id="count"/>
  96. <Col id="amount"/>
  97. </Row>
  98. </Rows>
  99. </Dataset>
  100. <Dataset id="ds_send" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  101. <ColumnInfo>
  102. <Column id="fromdd" type="STRING" size="256"/>
  103. <Column id="todd" type="STRING" size="256"/>
  104. </ColumnInfo>
  105. <Rows>
  106. <Row>
  107. <Col id="fromdd"/>
  108. <Col id="todd"/>
  109. </Row>
  110. </Rows>
  111. </Dataset>
  112. <Dataset id="ds_main_export" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  113. </Objects>
  114. <Bind>
  115. <BindItem id="item0" compid="grp_sea.ipt_fromdd" propid="value" datasetid="ds_send" columnid="fromdd"/>
  116. <BindItem id="item1" compid="grp_sea.ipt_todd" propid="value" datasetid="ds_send" columnid="todd"/>
  117. </Bind>
  118. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  119. * System Name :
  120. * Job Name :
  121. * Creator :
  122. * Make Date : 2015-11-13
  123. * Description :
  124. *---------------------------------------------------------------------------------------
  125. * Modify Date Modifier Modify Description
  126. *---------------------------------------------------------------------------------------
  127. * 2015-11-13 Live Converter TF->XP
  128. *
  129. *---------------------------------------------------------------------------------------
  130. ****************************************************************************************/
  131. include "com_commonxp::comm_main.xjs";
  132. var arErrorCode = new HashArray();
  133. function SMANS01000_oninit(obj:Form, e:InitEventInfo)
  134. {
  135. frmf_initForm(obj); //폼 초기화
  136. grdf_initGrid(grd_sicksulist);
  137. }
  138. function SMANS01000_onload(obj:Form, e:LoadEventInfo)
  139. {
  140. var fromdd = utlf_getCurrentDate().substring(0, 6) + '00'; // 적용일자 현재일자 셋팅
  141. var todd = utlf_getCurrentDate().substring(0, 6) + '99'; // 적용일자 현재일자 셋팅
  142. ds_main_list_item.clearData();
  143. ds_send.setColumn(0, "fromdd", fromdd);
  144. ds_send.setColumn(0, "todd", todd);
  145. }
  146. /*
  147. * 소속에 따른 소계 및 총계를 생성한다.
  148. */
  149. function fSetSicksuSum() {
  150. // 그리드 merge 및 합계 초기화
  151. // grd_sicksulist.autoMerge = false;
  152. // grd_sicksulist.mergeCells = "bycolrec";
  153. //
  154. // grd_sicksulist.subtotalPosition = "below";
  155. // grd_sicksulist.multiTotals = true;
  156. //
  157. // grd_sicksulist.subtotal("clear", 0, 0);
  158. // for(var i =0; i < grd_sicksulist.cols ; i++) {
  159. //
  160. // // 소계
  161. // if(i >= grd_sicksulist.colRef("count") && i <= grd_sicksulist.colRef("amount")) {
  162. // grd_sicksulist.subtotal("sum", grd_sicksulist.colRef("instnm") , i ,"format:(-,+)#,###; roundmode:round; roundpostion:2", "background-color:#ccffff; font-weight:bold", grd_sicksulist.colRef("instnm"), "소계" );
  163. // grd_sicksulist.subtotal("sum", -1 , i ,"format:(-,+)#,###; roundmode:round; roundpostion:2", "background-color:#33cccc; font-weight:bold", grd_sicksulist.colRef("instnm") , "총계" );
  164. // }
  165. // // 화면 merge
  166. // if( i == grd_sicksulist.colRef("instnm")) {
  167. // grd_sicksulist.mergeCol(i) = true;
  168. // }else{
  169. // grd_sicksulist.mergeCol(i) = false;
  170. // }
  171. // }
  172. // grd_sicksulist.merge();
  173. ds_main_list_item.keystring = "G:+instnm";
  174. }
  175. function grp_sea_btn_sea_onclick(obj:Button, e:ClickEventInfo)
  176. {
  177. if (utlf_isNull(ds_send.getColumn(0, "fromdd"))){
  178. sysf_messageBox("조회시작일자는", "I003");
  179. grp_sea.ipt_fromdd.setFocus();
  180. return;
  181. }
  182. if (utlf_isNull(ds_send.getColumn(0, "todd"))){
  183. sysf_messageBox("조회종료일자는", "I003");
  184. grp_sea.ipt_todd.setFocus();
  185. return;
  186. }
  187. if (ds_send.getColumn(0, "fromdd") > ds_send.getColumn(0, "todd")){
  188. sysf_messageBox("조회 시작일자는 종료일자 보다 클 수", "I004");
  189. grp_sea.ipt_fromdd.setFocus();
  190. return;
  191. }
  192. var fromdd = ds_send.getColumn(0, "fromdd")+ '00'; // 적용일자 현재일자 셋팅
  193. var todd = ds_send.getColumn(0, "todd") + '99'; // 적용일자 현재일자 셋팅
  194. ds_send.setColumn(0, "fromdd", fromdd);
  195. ds_send.setColumn(0, "todd", todd);
  196. var oParam = {};
  197. oParam.id = "TRANS01001";
  198. oParam.service = "dietstatsapp.DietStats";
  199. oParam.method = "reqGetSicsuList";
  200. oParam.inds = "req=ds_send";
  201. oParam.outds = "ds_main_list_item=ret";
  202. oParam.async = false;
  203. oParam.callback = "cf_TRANS01001";
  204. tranf_submit(oParam);
  205. if(arErrorCode.pop("TRANS01001") > -1) {
  206. fSetSicksuSum();
  207. }
  208. }
  209. function cf_TRANS01001(sSvcId, nErrorCode, sErrorMsg) {
  210. arErrorCode.push(sSvcId, nErrorCode);
  211. }
  212. function btn_excsave_onclick(obj:Button, e:ClickEventInfo)
  213. {
  214. grdf_exportExcel(grd_sicksulist, "식수통계" + utlf_getCurrentDate(), "sheetname1" , true, "" , "" , true);
  215. }
  216. function btn_prt_onclick(obj:Button, e:ClickEventInfo)
  217. {
  218. //인쇄 화면이 없음 -> 주석처리
  219. dsf_makeValue(ds_main_export, "weeknm", "string", utlf_transNullToEmpty(ds_send.getColumn(0, "srchdd")).toDate("YYYYMMDD").getDayOfWeek("k"));
  220. dsf_makeValue(ds_main_export, "srchdd", "string", utlf_transNullToEmpty(ds_send.getColumn(0, "srchdd")).toDate("YYYYMMDD").getDateFormat("YYYY/MM/DD"));
  221. ds_main_list_item.keystring = "S:+instnm";
  222. // exeReportPreview("RPANS01001", "XMLSTR" , "" , "" , "" , "" , "pdf" , "식수통계" , "true" , "true" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" );
  223. var objDOM = rptf_createDOM();
  224. rptf_setNodeListToDOM(objDOM, "root/send" , ds_send); // 데이터셋 2
  225. rptf_setNodeListToDOM(objDOM, "root/main/list/item", ds_main_list_item); // 데이터셋 1
  226. var objParam = new Object();
  227. objParam.xml_data_XML1 = objDOM.documentElement.source; // 최상의노드 XML 스트링 추출
  228. var userHomeDir = system.convertRealPath("%MYDOCUMENT%");
  229. tmpFileName = userHomeDir + "식수통계" + ".pdf";
  230. var option = "open=1;save=1;directprint=0;print=1;zoom=0;export=1;exportdialog=1;exportfilename="+tmpFileName+";";
  231. rptf_exeReportPreview30(["RPANS01001"],[objParam], option);
  232. ds_main_list_item.keystring = "G:+instnm";
  233. }
  234. function grp_sea_ipt_fromdd_onchanged(obj:Calendar, e:ChangeEventInfo)
  235. {
  236. ds_send.setColumn(0, "fromdd", utlf_transNullToEmpty(e.postvalue+"").substr(0, 6));
  237. }
  238. function grp_sea_ipt_todd_onchanged(obj:Calendar, e:ChangeEventInfo)
  239. {
  240. ds_send.setColumn(0, "todd", utlf_transNullToEmpty(e.postvalue+"").substr(0, 6));
  241. }
  242. ]]></Script>
  243. </Form>
  244. </FDL>