rpt_index.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="keywords" content="dongke,mes,ibossmes">
  6. <meta name="description" content="制造企业生产过程执行管理系统">
  7. <meta name="author" content="xuwei">
  8. <title>东科软件</title>
  9. <script src="/plugins/xeasyui/xeasyui.min.js"></script>
  10. <link href="/plugins/xeasyui/toolbar.min.css" rel="stylesheet" />
  11. </head>
  12. <body class="easyui-layout">
  13. <!--上部工具条-->
  14. <div id="toolbarLayout" data-options="border:false,region:'north',title:'',iconCls:'icon-grid'">
  15. <!--工具条-->
  16. <div class="i-toolbar">
  17. <a href="javascript:void(0)" id="btnSearch" title="搜索" class="easyui-linkbutton" iconcls="icon-search" plain="true" toggle="true" onclick="tbSearch()">搜索</a>
  18. <a href="javascript:void(0)" id="btnExport" title="导出" class="easyui-linkbutton" iconcls="icon-excel" plain="true" onclick="tbExport()">导出</a>
  19. <a href="javascript:void(0)" id="btnReload" title="刷新" class="easyui-linkbutton" iconcls="icon-reload" plain="true" onclick="tbReload()">刷新</a>
  20. <div id="tbSearchDiv" style="display: block; padding: 10px;">
  21. <form id="ffMaster">
  22. <div>
  23. 日期 &nbsp;&nbsp;
  24. <input class="easyui-datebox" id="datebeginMaster" name="datebeginMaster" data-options="required:true,prompt:'',tipPosition:'top'" style="width: 120px; height: 32px;">&nbsp;&nbsp;
  25. -&nbsp;&nbsp;
  26. <input class="easyui-datebox" id="dateendMaster" name="dateendMaster" data-options="required:true,prompt:'',tipPosition:'top'" style="width: 120px; height: 32px;">&nbsp;&nbsp;&nbsp;&nbsp;
  27. 产品编码<input class="easyui-textbox" id="goodscode" name="goodscode" data-options="required:false,prompt:'',tipPosition:'top'" style="width: 120px; height: 32px;">&nbsp;&nbsp;&nbsp;&nbsp;
  28. 车间号
  29. <input class="easyui-combobox" id="workshopcodeMaster" name="workshopcodeMaster" data-options="required:false,prompt:'',tipPosition:'top',
  30. data:[{'value':'','text':'全部'},{'value':'A','text':'一车间'},{'value':'B','text':'二车间'},{'value':'C','text':'三车间'},{'value':'D','text':'四车间'}],
  31. method:'get',valueField:'value',textField:'text',panelHeight:'300px',editable:'true'" style="width:120px;height:32px;"> &nbsp;
  32. 产品类别<input class="easyui-combotree" id="goodstypecode" name="goodstypecode" data-options="required:false,prompt:'',tipPosition:'top',url:'../rpt.ashx?m=getGoodsType',method:'get',panelHeight:'200px',editable:true" style="width:165px;height:32px;">
  33. 高压标识
  34. <input class="easyui-combobox" id="HIGHPRESSUREFLAG" name="HIGHPRESSUREFLAG" data-options="required:false,prompt:'',tipPosition:'top',
  35. data:[{'value':'','text':'全部'},{'value':'1','text':'高压'},{'value':'0','text':'普通'}],method:'get',valueField:'value',textField:'text',panelHeight:'300px',editable:'true'" style="width:120px;height:32px;"> &nbsp;
  36. <br />成型线号:
  37. <input class="easyui-combobox" id="groutinglineMaster" name="groutinglineMaster" data-options="required:false,prompt:'',tipPosition:'top',url:'../../rpt/rpt.ashx?m=getLine&select=1',method:'get',valueField:'GROUTINGLINEID',textField:'GROUTINGLINECODE',panelHeight:'300px',editable:true" style="width: 246px; height: 32px;">
  38. 产品商标:
  39. <input class="easyui-combobox" id="LOGONAME" name="LOGONAME" data-options="required:false,prompt:'',tipPosition:'top',url:'../../rpt/rpt.ashx?m=getLogoByGoods&select=1',method:'get',valueField:'ID',textField:'TEXT',panelHeight:'300px',multiple:true" style="width:315px;height:30px;">
  40. 成型工号:
  41. <input class="easyui-combobox" id="usercodeMaster" name="usercodeMaster" data-options="required:false,prompt:'',tipPosition:'top',url:'../rpt.ashx?m=getUser&select=1',method:'get',valueField:'USERCODE',textField:'USERCODE',panelHeight:'300px',editable:'true'" style="width:120px;height:32px;">
  42. <a href="javascript:void(0)" id="btnSearchSubmit" title="清空" class="easyui-linkbutton" plain="false" onclick="$('#ffMaster').form('clear')">清空</a>&nbsp;&nbsp;&nbsp;&nbsp;
  43. <a href="javascript:void(0)" id="btnSearchSubmit" title="搜索" class="easyui-linkbutton" plain="false" onclick="tbSearchSubmit()">搜索</a>
  44. </div>
  45. </form>
  46. </div>
  47. </div>
  48. </div>
  49. <!--中部-->
  50. <div id="tableLayout" data-options="border:false,region:'center',split:true,title:'',iconCls:'icon-grid'" title="East" style="width:700px;">
  51. <div id="tableTabs" class="easyui-tabs" data-options="border:false" style="width: 100%; height: 100%">
  52. <!--表格-->
  53. <div title="半成品报废率">
  54. <table class="easyui-datagrid"
  55. id="DataGridMaster"
  56. data-options="toolbar: '#tb',method:'get',border:false,singleSelect:true,fit:true,fitColumns:false">
  57. <thead>
  58. <tr>
  59. <th data-options="field:'产品编码',title:'产品编码',width:100,align:'left',sortable:true"></th>
  60. <th data-options="field:'交坯数',title:'交坯数',width:100,align:'left',sortable:false"></th>
  61. <th data-options="field:'干补数',title:'干补数',width:100,align:'left',sortable:false"></th>
  62. <th data-options="field:'半检不合格数',title:'半检不合格数',width:100,align:'left',sortable:false"></th>
  63. <th data-options="field:'复检不合格数',title:'复检不合格数',width:100,align:'left',sortable:false"></th>
  64. <th data-options="field:'损坯数',title:'损坯数',width:100,align:'left',sortable:false"></th>
  65. <th data-options="field:'报废率',title:'报废率',width:100,align:'left',sortable:false"></th>
  66. <th data-options="field:'合格率',title:'合格率',width:100,align:'left',sortable:false"></th>
  67. </tr>
  68. </thead>
  69. </table>
  70. </div>
  71. <div title="综合优等率">
  72. <table class="easyui-datagrid"
  73. id="DataGridMaster1"
  74. data-options="method:'get',border:false,singleSelect:true,fit:true,fitColumns:false">
  75. <thead>
  76. <tr>
  77. <th data-options="field:'产品编码',title:'产品编码',width:100,align:'left',sortable:true"></th>
  78. <th data-options="field:'本烧出窑数',title:'本烧出窑数',width:100,align:'left',sortable:false"></th>
  79. <th data-options="field:'本烧合格数',title:'本烧合格数',width:100,align:'left',sortable:false"></th>
  80. <th data-options="field:'重烧合格数',title:'重烧合格数',width:100,align:'left',sortable:false"></th>
  81. <th data-options="field:'综合合格率',title:'综合合格率',width:100,align:'left',sortable:false"></th>
  82. </tr>
  83. </thead>
  84. </table>
  85. </div>
  86. </div>
  87. </div>
  88. <script type="text/javascript">
  89. function formatterUA(value, row, index) {
  90. return Math.round(value * 10000) / 100 + '%';
  91. }
  92. $(document).ready(function () {
  93. var ctime = new Date();
  94. var ctime = new Date();
  95. var nowMonth = ctime.getMonth(); //当前月
  96. var nowYear = ctime.getFullYear(); //当前年
  97. //本月的开始时间
  98. var monthStartDate = new Date(nowYear, nowMonth, 1);
  99. //本月的结束时间
  100. var monthEndDate = new Date(nowYear, nowMonth + 1, 0);
  101. var beginDate = ctime.getFullYear() + "-" + (ctime.getMonth() + 1) + "-" + monthStartDate.getDate();
  102. var endDate = ctime.getFullYear() + "-" + (ctime.getMonth() + 1) + "-" + monthEndDate.getDate();
  103. $("#datebeginMaster").datebox("setValue", beginDate);
  104. $("#dateendMaster").datebox("setValue", endDate);
  105. });
  106. //搜索提交
  107. function tbSearchSubmit() {
  108. var index = $('#tableTabs').tabs('getTabIndex', $('#tableTabs').tabs('getSelected'));
  109. if (index == 0) {
  110. if ($('#ffMaster').form("validate")) {
  111. $('#DataGridMaster').datagridLoadRpt({
  112. title: '',//半成品报废率
  113. idField: 'SID',
  114. queryParams: $('#ffMaster').serializeJson(),
  115. url: 'rpt.ashx?m=master&n=' + index + '&id=' + request('id'),
  116. pageSize: 10,
  117. fixWidth: 160,
  118. mergeWidth: 100,
  119. });
  120. }
  121. }
  122. if (index == 1) {
  123. if ($('#ffMaster').form("validate")) {
  124. $('#DataGridMaster1').datagridLoadRpt({
  125. title: '',//综合优等率
  126. idField: 'SID',
  127. queryParams: $('#ffMaster').serializeJson(),
  128. url: 'rpt.ashx?m=master&n=' + index + '&id=' + request('id'),
  129. pageSize: 10,
  130. fixWidth: 160,
  131. mergeWidth: 100,
  132. });
  133. }
  134. }
  135. }
  136. //导出
  137. function tbExport() {
  138. var index = $('#tableTabs').tabs('getTabIndex', $('#tableTabs').tabs('getSelected'));
  139. if (index == 0) {
  140. //加载表头
  141. var fields = $('#DataGridMaster').datagrid('getColumnFields');
  142. var headers = [];
  143. for (var i = 0; i < fields.length; i++) {
  144. headers.push(fields[i]);
  145. }
  146. $('#DataGridMaster').datagridExport({
  147. headers: headers,
  148. fileName: '导出数据(半成品报废率表).xls',
  149. workSheet: '导出数据(半成品报废率表)'
  150. });
  151. }
  152. if (index == 1) {
  153. //加载表头
  154. var fields = $('#DataGridMaster1').datagrid('getColumnFields');
  155. var headers = [];
  156. for (var i = 0; i < fields.length; i++) {
  157. headers.push(fields[i]);
  158. }
  159. $('#DataGridMaster1').datagridExport({
  160. headers: headers,
  161. fileName: '导出数据(综合优等率表).xls',
  162. workSheet: '导出数据(综合优等率表)'
  163. });
  164. }
  165. }
  166. //搜索按钮
  167. function tbSearch() {
  168. $('#tbSearchDiv').toggle();
  169. $('#toolbarLayout').panel('resize', { height: 'auto' });
  170. $('body').layout('resize');
  171. $('#tableTabs').datagrid('resize');
  172. }
  173. //刷新
  174. function tbReload() {
  175. tbSearchSubmit();
  176. }
  177. </script>
  178. </body>
  179. </html>