维修详情、维修审核详情导出

This commit is contained in:
hayu 2025-11-12 12:24:33 +08:00
parent 70052e6716
commit 82276a731c
2 changed files with 50 additions and 3 deletions

View File

@ -49,6 +49,9 @@
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleDetailsExport">导出明细</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -681,6 +684,18 @@ export default {
`维修任务单_${currentTime}.xlsx`,
)
},
handleDetailsExport() {
const currentTime = formatTime(new Date());
this.download(
'material/repair/exportDetails',
{
...this.queryParams,
// startTime:this.queryParams.time[0],
// endTime:this.queryParams.time[1]
},
`维修任务详情单_${currentTime}.xlsx`,
)
},
//
async handlePrint(row) {
const res = await getRepairDocumentInfo(row.taskId);

View File

@ -102,6 +102,16 @@
>导出
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleDetailsExport"
>导出明细
</el-button>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
@ -317,15 +327,15 @@ export default {
onDictReady(dict) {
// repair_task_status101112
const allOptions = dict.type.repair_task_status || []
const validOptions = allOptions.filter(item =>
const validOptions = allOptions.filter(item =>
item.value == 10 || item.value == 11 || item.value == 12
)
//
if (validOptions.length > 0) {
this.queryParams.taskStatus = validOptions[0].value
}
//
this.getList()
},
@ -543,6 +553,28 @@ export default {
`修试审核_${currentTime}.xlsx`
);
},
handleDetailsExport() {
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());
this.download(
"/material/repair/exportAuditDetails",
{
...this.queryParams,
// startTime: this.queryParams.time && this.queryParams.time[0],
// endTime: this.queryParams.time && this.queryParams.time[1],
},
`修试审核详情_${currentTime}.xlsx`
);
},
//
handleSend(row) {