This commit is contained in:
bb_pan 2025-11-10 17:37:03 +08:00
parent 7a5e2d085c
commit f135e0a1a4
2 changed files with 38 additions and 22 deletions

View File

@ -93,6 +93,9 @@
<el-col :span="1.5">
<el-button icon="el-icon-download" size="mini" @click="handleExport" >导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button icon="el-icon-download" size="mini" @click="handleExportDetails" >导出退料明细</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" ></right-toolbar>
</el-row>
@ -217,6 +220,8 @@ import {
import dialogFormByCq from '@/views/material/back/component/dialogFormByCq.vue'
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { formatTime } from '@/utils/bonus'
export default {
name: '',
dicts: ['back_task_status'],
@ -506,29 +511,41 @@ export default {
this.rowObj = row
},
/** 导出按钮操作 */
handleExport() {
const formatTime = (date) => {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}${month}${day}_${hours}${minutes}${seconds}`;
};
handleExport() {
// const formatTime = (date) => {
// const year = date.getFullYear();
// const month = String(date.getMonth() + 1).padStart(2, '0');
// const day = String(date.getDate()).padStart(2, '0');
// const hours = String(date.getHours()).padStart(2, '0');
// const minutes = String(date.getMinutes()).padStart(2, '0');
// const seconds = String(date.getSeconds()).padStart(2, '0');
// return `${year}${month}${day}_${hours}${minutes}${seconds}`;
// };
const currentTime = formatTime(new Date());
const currentTime = formatTime(new Date())
this.download(
'material/back_apply_info/export',
{
...this.queryParams,
startTime: this.queryParams.time[0],
endTime: this.queryParams.time[1]
},
`退料申请单_${currentTime}.xlsx`,
)
},
this.download(
'material/back_apply_info/export',
{
...this.queryParams,
startTime: this.queryParams.time[0],
endTime: this.queryParams.time[1]
},
`退料申请单_${currentTime}.xlsx`,
)
},
handleExportDetails() {
const currentTime = formatTime(new Date())
this.download(
'back_apply_info/exportBackDetailsList',
{
...this.queryParams,
startTime: this.queryParams.time[0],
endTime: this.queryParams.time[1]
},
`退料明细_${currentTime}.xlsx`,
)
},
},
}
</script>

View File

@ -1,7 +1,6 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item prop="startTime">
<el-form-item label="领料日期" prop="dateRange">
<el-date-picker
v-model="queryParams.startTime"