|
|
@@ -7,7 +7,7 @@
|
|
|
<el-form ref="elSearchFormRef" class="demo-form-inline" :rules="searchRule" @keyup.enter="onSubmit">
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="Download" @click="exportToExcel" style="margin: 5px;float: right;">导出到Excel(汇总)</el-button>
|
|
|
- <el-button type="primary" icon="Download" @click="exportToExcel2" style="margin: 5px;float: right;">月度明细</el-button>
|
|
|
+ <!-- <el-button type="primary" icon="Download" @click="exportToExcel2" style="margin: 5px;float: right;">月度明细</el-button> -->
|
|
|
<el-button type="primary" icon="Download" @click="exportToExcel3" style="margin: 5px;float: right;">导出到Excel(明细)</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
@@ -1465,12 +1465,21 @@ const handleNodeClick = async (node) => {
|
|
|
console.log(node)
|
|
|
tabledate2.value=[]
|
|
|
if(node.children !==undefined ){
|
|
|
- // params.value.mouth= node.label
|
|
|
- params.value.mouth= node.parentDate
|
|
|
+ jqtabledata.value = []
|
|
|
+ tabledate2.value = []
|
|
|
+ params.value.sist= ''
|
|
|
+ params.value.mouth= node.label
|
|
|
+ params2.value.mouth= node.label
|
|
|
+ MachineList(params.value)
|
|
|
+ const Machineoutput = await MachineOperationProductDetail (params2.value)
|
|
|
+ jqtabledata.value = Machineoutput.data
|
|
|
}
|
|
|
if (node.children === undefined){
|
|
|
params.value.mouth = node.parentDate
|
|
|
params.value.sist = node.label
|
|
|
+ //清空表格数据
|
|
|
+ jqtabledata.value = []
|
|
|
+ tabledate2.value = []
|
|
|
MachineList(params.value)
|
|
|
}
|
|
|
// console.log();
|
|
|
@@ -1503,28 +1512,28 @@ const exportToExcel = async () => {
|
|
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
|
|
XLSX.writeFile(workbook, '设备数据.xlsx');
|
|
|
}
|
|
|
-//月度明细
|
|
|
-const exportToExcel2 = () => {
|
|
|
- if (jqtabledata.value){
|
|
|
- const el = document.getElementById('tab2');
|
|
|
- console.log(el);
|
|
|
- // 文件名
|
|
|
- const filename = '月度明细.xlsx';
|
|
|
- const wb = XLSX.utils.table_to_book(el, { raw: true });
|
|
|
- const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
|
|
|
- try {
|
|
|
- FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), filename);
|
|
|
- } catch (e) {
|
|
|
- console.log(e);
|
|
|
- }
|
|
|
- return wbout;
|
|
|
-}
|
|
|
- }
|
|
|
+// //月度明细
|
|
|
+// const exportToExcel2 = () => {
|
|
|
+// if (jqtabledata.value){
|
|
|
+// const el = document.getElementById('tab2');
|
|
|
+// console.log(el);
|
|
|
+// // 文件名
|
|
|
+// const filename = '月度明细.xlsx';
|
|
|
+// const wb = XLSX.utils.table_to_book(el, { raw: true });
|
|
|
+// const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
|
|
|
+// try {
|
|
|
+// FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), filename);
|
|
|
+// } catch (e) {
|
|
|
+// console.log(e);
|
|
|
+// }
|
|
|
+// return wbout;
|
|
|
+// }
|
|
|
+// }
|
|
|
//导出到EXCEL(明细)
|
|
|
const exportToExcel3 = ()=>{
|
|
|
- const el = document.getElementById('tab');
|
|
|
+ const el = document.getElementById('tab2');
|
|
|
// 文件名
|
|
|
- const filename = '导出到EXCEL(汇总).xlsx';
|
|
|
+ const filename = '导出到EXCEL(明细).xlsx';
|
|
|
const wb = XLSX.utils.table_to_book(el, { raw: true });
|
|
|
const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
|
|
|
try {
|