维修详情、维修审核详情导出
This commit is contained in:
parent
70052e6716
commit
82276a731c
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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_status的所有选项,并过滤出有效的选项(值为10、11、12)
|
||||
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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue