glinereckonprod_index.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  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 id="tb" class="i-toolbar">
  17. <a href="javascript:void(0)" id="btnInsert" title="添加" class="easyui-linkbutton" iconcls="icon-add" plain="true" onclick="tbMasterAdd()">添加</a>
  18. <a href="javascript:void(0)" id="btnSearch" title="搜索" class="easyui-linkbutton" iconcls="icon-search" plain="true" toggle="true" onclick="tbSearch()">搜索</a>
  19. <a href="javascript:void(0)" id="btnExport" title="导出" class="easyui-linkbutton" iconcls="icon-excel" plain="true" onclick="tbExport()">导出</a>
  20. <a href="javascript:void(0)" id="btnReload" title="刷新" class="easyui-linkbutton" iconcls="icon-reload" plain="true" onclick="tbReload()">刷新</a>
  21. <div id="tbSearchDiv" style="display: block; padding: 10px;">
  22. <form id="ffMaster">
  23. <div>
  24. 开始时间:
  25. <input class="easyui-datebox" id="datebeginMasterS" name="datebeginMasterS" data-options="required:false,prompt:'',tipPosition:'top'" style="width:165px; height:32px;">
  26. -
  27. <input class="easyui-datebox" id="datebeginMasterD" name="datebeginMasterD" data-options="required:false,prompt:'',tipPosition:'top'" style="width:165px; height:32px;">
  28. 结束时间:
  29. <input class="easyui-datebox" id="dateendMasterS" name="dateendMasterS" data-options="required:false,prompt:'',tipPosition:'top'" style="width:165px; height:32px;">
  30. -
  31. <input class="easyui-datebox" id="dateendMasterD" name="dateendMasterD" data-options="required:false,prompt:'',tipPosition:'top'" style="width:165px; height:32px;">
  32. </div>
  33. <div style="padding-top:10px;">
  34. 车间:
  35. <input class="easyui-combobox" id="workshopMaster" name="workshopMaster" data-options="required:false,valueField:'value',textField:'text',editable:true,multiple:true,
  36. data:[{'text': '1车间', 'value': '1'},{'text': '2车间', 'value': '2'},{'text': '3车间', 'value': '3'}]"
  37. style=" width: 120px; height: 32px;">
  38. 成型线:
  39. <input class="easyui-textbox" id="groutinglinecode" name="groutinglinecode" data-options="required:false,prompt:'',tipPosition:'top'" style="width: 120px; height: 32px;">
  40. 物料编码:
  41. <input class="easyui-textbox" id="sap_sku" name="sap_sku" data-options="required:false,prompt:'',tipPosition:'top'" style="width: 120px; height: 32px;">
  42. 产品名称:
  43. <input class="easyui-textbox" id="goodsname" name="goodsname" data-options="required:false,prompt:'',tipPosition:'top'" style="width: 120px; height: 32px;">
  44. 工艺类型:
  45. <input class="easyui-combobox" id="goods_line_type" name="goods_line_type" data-options="required:false,valueField:'value',textField:'text',editable:true,multiple:true,
  46. data:[{'text': '高压', 'value': '1'},{'text': '普通', 'value': '0'}]"
  47. style=" width: 120px; height: 32px;">
  48. <a href="javascript:void(0)" id="btnSearchSubmit" title="清空" class="easyui-linkbutton" plain="false" onclick="$('#ffMaster').form('clear')">清空</a>
  49. <a href="javascript:void(0)" id="btnSearchSubmit" title="搜索" class="easyui-linkbutton" plain="false" onclick="tbSearchSubmit()">搜索</a>
  50. </div>
  51. </form>
  52. </div>
  53. </div>
  54. </div>
  55. <div id="tableLayout" data-options="border:false,region:'center',split:true,title:'',iconCls:'icon-grid'" title="East" style="width:700px;">
  56. <div id="tableTabs" class="easyui-tabs" data-options="border:false" style="width: 100%; height: 100%">
  57. <!--表格-->
  58. <div title="成型产能预测单">
  59. <table class="easyui-datagrid"
  60. id="DataGrid0"
  61. data-options="method:'get',border:false,fit:true,fitColumns:true,onDblClickRow: dgDblclickrow">
  62. <thead>
  63. <tr>
  64. <th data-options="field:'SID',title:'SID',align:'center',sortable:false,hidden:true"></th>
  65. <th data-options="field:'RECKON_CODE',title:'预测单号',align:'center',sortable:false"></th>
  66. <th data-options="field:'RECKON_DATEBEGIN',title:'开始时间',align:'center',sortable:false"></th>
  67. <th data-options="field:'RECKON_DATEEND',title:'结束时间',align:'center',sortable:false"></th>
  68. <th data-options="field:'USERNAME',title:'创建人',align:'center',sortable:false"></th>
  69. <th data-options="field:'CREATETIME',title:'创建时间',align:'center',sortable:false"></th>
  70. <th data-options="field:'REMARKS',title:'备注',align:'center',sortable:false"></th>
  71. </tr>
  72. </thead>
  73. </table>
  74. </div>
  75. <div title="产品预测(月)">
  76. <table class="easyui-datagrid"
  77. id="DataGrid1"
  78. data-options="method:'get',border:false,singleSelect:true,fit:true,fitColumns:true,onDblClickCell: dgDblclickcelldetail1">
  79. <thead>
  80. </thead>
  81. </table>
  82. </div>
  83. <div title="车间预测(月)">
  84. <table class="easyui-datagrid"
  85. id="DataGrid2"
  86. data-options="method:'get',border:false,singleSelect:true,fit:true,fitColumns:true,onDblClickCell: dgDblclickcelldetail2">
  87. <thead>
  88. </thead>
  89. </table>
  90. </div>
  91. <div title="成型线预测(月)">
  92. <table class="easyui-datagrid"
  93. id="DataGrid3"
  94. data-options="method:'get',border:false,singleSelect:true,fit:true,fitColumns:true,onDblClickCell: dgDblclickcelldetail3">
  95. <thead>
  96. </thead>
  97. </table>
  98. </div>
  99. <div title="成型线预测(日)">
  100. <table class="easyui-datagrid"
  101. id="DataGrid4"
  102. data-options="method:'get',border:false,singleSelect:true,fit:true,fitColumns:true">
  103. <thead>
  104. <tr>
  105. <th data-options="field:'WORKNAME',title:'工厂',align:'center',sortable:false"></th>
  106. <th data-options="field:'WORKSHOP',title:'车间',align:'center',sortable:false"></th>
  107. <th data-options="field:'GROUTINGLINECODE',title:'成型线',align:'center',sortable:false"></th>
  108. <th data-options="field:'RECKON_DATE',title:'预测日',align:'center',sortable:false"></th>
  109. <th data-options="field:'SAP_SKU',title:'物料编码',align:'center',sortable:false"></th>
  110. <th data-options="field:'FROM_TYPE',title:'分类',align:'center',sortable:false"></th>
  111. <th data-options="field:'RECKON_NUM',title:'计划产出',align:'center',sortable:false"></th>
  112. <th data-options="field:'FROM_CODE',title:'分类单号',align:'center',sortable:false"></th>
  113. <th data-options="field:'GROUTINGMOULDCODE',title:'模具',align:'center',sortable:false,hidden:true"></th>
  114. </tr>
  115. </thead>
  116. </table>
  117. </div>
  118. </div>
  119. </div>
  120. <script type="text/javascript">
  121. var SID = null;//总单id
  122. var datebeginDB = null; //开始时间
  123. var dateendDB = null; // 结束时间
  124. function formatterUA(value, row, index) {
  125. return Math.round(value * 10000) / 100 + '%';
  126. }
  127. $(document).ready(function () {
  128. var ctime = new Date();
  129. var beginDate = ctime.getFullYear() + "-" + (ctime.getMonth() + 1) + "-" + ctime.getDate();
  130. var endDate = ctime.getFullYear() + "-" + (ctime.getMonth() + 1) + "-" + (ctime.getDate());
  131. $("#datebeginMasterS").datebox("setValue", beginDate);
  132. $("#datebeginMasterD").datebox("setValue", endDate);
  133. tbSearchSubmit();
  134. });
  135. //主表双击事件
  136. function dgDblclickrow(index, row) {
  137. SID = row["SID"];
  138. datebeginDB = row["RECKON_DATEBEGIN"];
  139. dateendDB = row["RECKON_DATEEND"];
  140. $("#tableTabs").tabs("select", 1);
  141. LoadDataGridDetail(index, row);
  142. }
  143. //明细表1双击单元格事件
  144. function dgDblclickcelldetail1(index, field, value, row) {
  145. month = new Date().getMonth() + 1;
  146. month = "G" + new Date().getFullYear() + "-" + month
  147. if (field != '产品名称' && field != '工艺类型' && field != '物料编码' && field != month) {
  148. $("#tableTabs").tabs("select", 4);
  149. var row = $('#DataGrid1').datagrid('getRows')[index];
  150. var t1 = row["产品名称"];
  151. var t2 = row["RECKONID"];
  152. var t3 = row["物料编码"];
  153. var t4 = row["GROUTINGMOULDCODE"];
  154. var t5 = row["工艺类型"];
  155. $('#DataGrid4').datagridLoad({
  156. idField: 'SID',
  157. //queryParams: param,
  158. url: 'glinereckonprod.ashx?m=4&goodsname=' + t1 + '&reckonid=' + t2 + '&month=' + field + '&sap_sku=' + t3 + '&groutingmouldcode=' + t4 + '&goods_line_type=' + t5,
  159. fixWidth: 180,
  160. mergeWidth: 180,
  161. pageSize: 10,
  162. splitChar: '_',
  163. pagination: false
  164. });
  165. }
  166. }
  167. //明细表2双击单元格事件
  168. function dgDblclickcelldetail2(index, field, value) {
  169. month = new Date().getMonth() + 1;
  170. month = "G" + new Date().getFullYear() + "-" + month
  171. if (field != '产品名称' && field != '工艺类型' && field != '车间' && field != '物料编码' && field != month) {
  172. $("#tableTabs").tabs("select", 4);
  173. var row2 = $('#DataGrid2').datagrid('getRows')[index];
  174. var t1 = row2["产品名称"];
  175. // var t1 = row2["模具"];
  176. var t2 = row2["RECKONID"];
  177. var t3 = row2["物料编码"];
  178. var t4 = row2["车间"];
  179. var t5 = row2["GROUTINGMOULDCODE"];
  180. var t6 = row2["工艺类型"];
  181. $('#DataGrid4').datagridLoad({
  182. idField: 'SID',
  183. //queryParams: param,
  184. url: 'glinereckonprod.ashx?m=4&goodsname=' + t1 + '&reckonid=' + t2 + '&month=' + field + '&sap_sku=' + t3 + '&workshop=' + t4 + '&groutingmouldcode=' + t5 + '&goods_line_type=' + t6,
  185. fixWidth: 180,
  186. mergeWidth: 180,
  187. pageSize: 10,
  188. splitChar: '_',
  189. pagination: false
  190. });
  191. }
  192. }
  193. //明细表3双击单元格事件
  194. function dgDblclickcelldetail3(index, field, value) {
  195. month = new Date().getMonth() + 1;
  196. month = "G" + new Date().getFullYear() + "-" + month
  197. if (field != '产品名称' && field != '工艺类型' && field != '车间' && field != '物料编码' && field != '成型线' && field != month) {
  198. $("#tableTabs").tabs("select", 4);
  199. var row2 = $('#DataGrid3').datagrid('getRows')[index];
  200. var t1 = row2["产品名称"];
  201. // var t1 = row2["模具"];
  202. var t2 = row2["RECKONID"];
  203. var t3 = row2["物料编码"];
  204. var t4 = row2["成型线"];
  205. var t5 = row2["GROUTINGMOULDCODE"];
  206. var t6 = row2["工艺类型"];
  207. $('#DataGrid4').datagridLoad({
  208. idField: 'SID',
  209. //queryParams: param,
  210. url: 'glinereckonprod.ashx?m=4&goodsname=' + t1 + '&reckonid=' + t2 + '&month=' + field + '&sap_sku=' + t3 + '&groutinglinecode=' + t4 + '&groutingmouldcode=' + t5 + '&goods_line_type=' + t6,
  211. fixWidth: 180,
  212. mergeWidth: 180,
  213. pageSize: 10,
  214. splitChar: '_',
  215. pagination: false
  216. });
  217. }
  218. }
  219. //获取时间区间月份
  220. function getMonthBetween(start, end) {
  221. //初始化数组
  222. var result = [];
  223. //切割起始年月
  224. var s = start.split("-");
  225. //切割结束年月
  226. var e = end.split("-");
  227. //获取时间对象
  228. var min = new Date();
  229. var max = new Date();
  230. //设置起始时间
  231. min.setFullYear(s[0], s[1]);
  232. //设置结束时间
  233. max.setFullYear(e[0], e[1]);
  234. //复制一份起始时间对象
  235. var curr = min;
  236. //定义字符串
  237. var str = "";
  238. //起始时间在结束时间之前
  239. while (curr <= max) {
  240. //获取此时间的月份
  241. var month = curr.getMonth();
  242. //如果月份为0,也就是代表12月份
  243. if (month === 0) {
  244. str = (curr.getFullYear() - 1) + "-" + 12;
  245. } else {//正常月份
  246. str = curr.getFullYear() + "-" + (month < 10 ? (month) : month);
  247. }
  248. //将此年月加入数组
  249. result.push(str);
  250. //更新此时间月份
  251. curr.setMonth(month + 1);
  252. }
  253. return result;
  254. }
  255. //加载子表数据
  256. function LoadDataGridDetail(index, row) {
  257. var pgColumns = [[
  258. { field: 'RECKONID', title: 'RECKONID', width: '180', sortable: false, hidden: true, align: 'center' },
  259. { field: 'GROUTINGMOULDCODE', title: 'GROUTINGMOULDCODE', width: '180', sortable: false, hidden: true, align: 'center' },
  260. { field: '物料编码', title: '物料编码', width: '150px', resizable: true, align: 'center' },
  261. { field: '产品名称', title: '产品名称', width: '150px', resizable: true, align: 'center' },
  262. { field: '工艺类型', title: '工艺类型', width: '150px', resizable: true, align: 'center' },
  263. ]];
  264. //加载子表1
  265. var sid = row["SID"];
  266. var t1 = row["RECKON_DATEBEGIN"];
  267. var t2 = row["RECKON_DATEEND"];
  268. var months = getMonthBetween(t1, t2);
  269. $.each(months, function (i, val) {
  270. month = new Date().getMonth() + 1;
  271. month = new Date().getFullYear() + "-" + month
  272. if (val == month) {
  273. gs = { field: "G" + month, title: month + "(完成)", width: '180', sortable: false, align: 'center' };
  274. pgColumns[0].push(gs);
  275. }
  276. var s = {
  277. field: val, title: val, width: '180',
  278. styler: function (value, row, index) {
  279. return 'color:#00BBFF;text-decoration:underline;';
  280. }, sortable: false, align: 'center'
  281. }
  282. pgColumns[0].push(s);
  283. });
  284. var param = $('#ffMaster').serializeJson();
  285. $('#DataGrid1').datagridLoad({
  286. idField: 'SID',
  287. queryParams: param,
  288. url: 'glinereckonprod.ashx?m=1&datebeginDB=' + t1 + '&dateendDB=' + t2 + '&sid=' + sid,
  289. fixWidth: 180,
  290. mergeWidth: 180,
  291. columns: pgColumns,
  292. pageSize: 10,
  293. splitChar: '_'
  294. });
  295. //加载子表2
  296. var pgColumns1 = [[
  297. { field: 'RECKONID', title: 'RECKONID', width: '180', sortable: false, hidden: true, align: 'center' },
  298. { field: 'GROUTINGMOULDCODE', title: 'GROUTINGMOULDCODE', width: '180', sortable: false, hidden: true, align: 'center' },
  299. { field: '车间', title: '车间', width: '150px', resizable: true, align: 'center' },
  300. { field: '物料编码', title: '物料编码', width: '150px', resizable: true, align: 'center' },
  301. { field: '产品名称', title: '产品名称', width: '150px', resizable: true, align: 'center' },
  302. { field: '工艺类型', title: '工艺类型', width: '150px', resizable: true, align: 'center' },
  303. ]];
  304. $.each(months, function (i, val) {
  305. month = new Date().getMonth() + 1;
  306. month = new Date().getFullYear() + "-" + month
  307. if (val == month) {
  308. gs = { field: "G" + month, title: month + "(完成)", width: '180', sortable: false, align: 'center' };
  309. pgColumns1[0].push(gs);
  310. }
  311. var s = {
  312. field: val, title: val, width: '180', styler: function (value, row, index) {
  313. return 'color:#00BBFF;text-decoration:underline;';
  314. },sortable: false, align: 'center' }
  315. pgColumns1[0].push(s);
  316. });
  317. $('#DataGrid2').datagridLoad({
  318. idField: 'SID',
  319. queryParams: param,
  320. url: 'glinereckonprod.ashx?m=2&datebeginDB=' + t1 + '&dateendDB=' + t2 + '&sid=' + sid,
  321. fixWidth: 180,
  322. mergeWidth: 180,
  323. columns: pgColumns1,
  324. pageSize: 10,
  325. splitChar: '_'
  326. });
  327. //加载子表3
  328. var pgColumns2 = [[
  329. { field: 'RECKONID', title: 'RECKONID', width: '180', sortable: false, hidden: true, align: 'center' },
  330. { field: 'GROUTINGMOULDCODE', title: 'GROUTINGMOULDCODE', width: '180', sortable: false, hidden: true, align: 'center' },
  331. { field: '车间', title: '车间', width: '150px', resizable: true, align: 'center' },
  332. { field: '成型线', title: '成型线', width: '150px', resizable: true, align: 'center' },
  333. { field: '物料编码', title: '物料编码', width: '150px', resizable: true, align: 'center' },
  334. { field: '产品名称', title: '产品名称', width: '150px', resizable: true, align: 'center' },
  335. { field: '工艺类型', title: '工艺类型', width: '150px', resizable: true, align: 'center' },
  336. ]];
  337. $.each(months, function (i, val) {
  338. month = new Date().getMonth() + 1;
  339. month = new Date().getFullYear() + "-" + month
  340. if (val == month) {
  341. gs = { field: "G" + month, title: month + "(完成)", width: '180', sortable: false, align: 'center' };
  342. pgColumns2[0].push(gs);
  343. }
  344. var s = {
  345. field: val, title: val, width: '180', styler: function (value, row, index) {
  346. return 'color:#00BBFF;text-decoration:underline;';
  347. },sortable: false, align: 'center' }
  348. pgColumns2[0].push(s);
  349. });
  350. $('#DataGrid3').datagridLoad({
  351. idField: 'SID',
  352. queryParams: param,
  353. url: 'glinereckonprod.ashx?m=3&datebeginDB=' + t1 + '&dateendDB=' + t2 + '&sid=' + sid,
  354. fixWidth: 180,
  355. mergeWidth: 180,
  356. columns: pgColumns2,
  357. pageSize: 10,
  358. splitChar: '_'
  359. });
  360. }
  361. //搜索提交
  362. function tbSearchSubmit() {
  363. var index = $('#tableTabs').tabs('getTabIndex', $('#tableTabs').tabs('getSelected'));
  364. if (index == 0) {
  365. datebeginDB = null;
  366. dateendDB = null;
  367. SID = null;
  368. if ($('#ffMaster').form("validate")) {
  369. $('#DataGrid0').datagridLoad({
  370. title: '',
  371. idField: 'SID',
  372. queryParams: $('#ffMaster').serializeJson(),
  373. url: 'glinereckonprod.ashx?m=0',
  374. fixWidth: 210,
  375. mergeWidth: 180,
  376. splitChar: '_',
  377. });
  378. }
  379. }
  380. if (index == 1) {
  381. if (datebeginDB != null && dateendDB != null && SID != null) {
  382. if ($('#ffMaster').form("validate")) {
  383. $('#DataGrid1').datagridLoad({
  384. idField: 'SID',
  385. queryParams: $('#ffMaster').serializeJson(),
  386. url: 'glinereckonprod.ashx?m=1&datebeginDB=' + datebeginDB + '&dateendDB=' + dateendDB + '&sid=' + SID,
  387. pageSize: 10,
  388. fixWidth: 210,
  389. mergeWidth: 210,
  390. splitChar: '_'
  391. });
  392. }
  393. }
  394. }
  395. if (index == 2) {
  396. if (datebeginDB != null && dateendDB != null && SID != null) {
  397. if ($('#ffMaster').form("validate")) {
  398. $('#DataGrid2').datagridLoad({
  399. idField: 'SID',
  400. queryParams: $('#ffMaster').serializeJson(),
  401. url: 'glinereckonprod.ashx?m=2&datebeginDB=' + datebeginDB + '&dateendDB=' + dateendDB + '&sid=' + SID,
  402. pageSize: 10,
  403. fixWidth: 210,
  404. mergeWidth: 210,
  405. splitChar: '_'
  406. });
  407. }
  408. }
  409. }
  410. if (index == 3) {
  411. if (datebeginDB != null && dateendDB != null && SID != null) {
  412. if ($('#ffMaster').form("validate")) {
  413. $('#DataGrid3').datagridLoad({
  414. idField: 'SID',
  415. queryParams: $('#ffMaster').serializeJson(),
  416. url: 'glinereckonprod.ashx?m=3&datebeginDB=' + datebeginDB + '&dateendDB=' + dateendDB + '&sid=' + SID,
  417. pageSize: 10,
  418. fixWidth: 210,
  419. mergeWidth: 210,
  420. splitChar: '_'
  421. });
  422. }
  423. }
  424. }
  425. }
  426. //添加按钮
  427. function tbMasterAdd() {
  428. $('#DataGrid0').datagridDialog({
  429. title: '生成成型产能预测数据',
  430. width: 500,
  431. height: 550,
  432. url: 'glinereckonprod_add.html'
  433. });
  434. }
  435. //导出
  436. function tbExport() {
  437. var index = $('#tableTabs').tabs('getTabIndex', $('#tableTabs').tabs('getSelected'));
  438. if (index == 0) {
  439. //加载表头
  440. var fields1 = $('#DataGrid' + index).datagrid('getColumnFields');
  441. var fields2 = $('#DataGrid' + index).datagrid('getColumnFields', true);
  442. var fields = fields2.concat(fields1);
  443. var headers = [];
  444. for (var i = 0; i < fields.length; i++) {
  445. //headers.push($('#DataGridMaster').datagrid('getColumnOption', fields[i])['title']);
  446. headers.push(fields[i]);
  447. }
  448. $('#DataGrid' + index).datagridExport({
  449. headers: headers,
  450. fileName: '导出数据(成型产能预测单).xls',
  451. workSheet: '导出数据(成型产能预测单)'
  452. //,dataType: 'text'
  453. });
  454. }
  455. if (index == 1) {
  456. //加载表头
  457. var fields1 = $('#DataGrid' + index).datagrid('getColumnFields');
  458. var fields2 = $('#DataGrid' + index).datagrid('getColumnFields', true);
  459. var fields = fields2.concat(fields1);
  460. var headers = [];
  461. for (var i = 0; i < fields.length; i++) {
  462. //headers.push($('#DataGridMaster').datagrid('getColumnOption', fields[i])['title']);
  463. headers.push(fields[i]);
  464. }
  465. $('#DataGrid' + index).datagridExport({
  466. headers: headers,
  467. fileName: '导出数据(成型产能预测月.xls',
  468. workSheet: '导出数据(成型产能预测月)',
  469. //dataType: 'text'
  470. });
  471. }
  472. if (index == 2) {
  473. //加载表头
  474. var fields1 = $('#DataGrid' + index).datagrid('getColumnFields');
  475. var fields2 = $('#DataGrid' + index).datagrid('getColumnFields', true);
  476. var fields = fields2.concat(fields1);
  477. var headers = [];
  478. for (var i = 0; i < fields.length; i++) {
  479. //headers.push($('#DataGridMaster').datagrid('getColumnOption', fields[i])['title']);
  480. headers.push(fields[i]);
  481. }
  482. $('#DataGrid' + index).datagridExport({
  483. headers: headers,
  484. fileName: '导出数据(成型产能预测月.xls',
  485. workSheet: '导出数据(成型产能预测月)',
  486. //dataType: 'text'
  487. });
  488. }
  489. if (index == 3) {
  490. //加载表头
  491. var fields1 = $('#DataGrid' + index).datagrid('getColumnFields');
  492. var fields2 = $('#DataGrid' + index).datagrid('getColumnFields', true);
  493. var fields = fields2.concat(fields1);
  494. var headers = [];
  495. for (var i = 0; i < fields.length; i++) {
  496. //headers.push($('#DataGridMaster').datagrid('getColumnOption', fields[i])['title']);
  497. headers.push(fields[i]);
  498. }
  499. $('#DataGrid' + index).datagridExport({
  500. headers: headers,
  501. fileName: '导出数据(成型产能预测日.xls',
  502. workSheet: '导出数据(成型产能预测日)',
  503. //dataType: 'text'
  504. });
  505. }
  506. }
  507. //搜索按钮
  508. function tbSearch() {
  509. $('#tbSearchDiv').toggle();
  510. //$('#DataGridMaster').datagrid('resize');
  511. $('#toolbarLayout').panel('resize', { height: 'auto' });
  512. $('body').layout('resize');
  513. $('#tableTabs').tabs('resize');
  514. }
  515. //刷新
  516. function tbReload() {
  517. tbSearchSubmit();
  518. }
  519. </script>
  520. </body>
  521. </html>