2025-07-25 15:09:08 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="app-container">
|
2025-07-25 17:10:33 +08:00
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
2025-07-25 15:09:08 +08:00
|
|
|
|
<el-form-item label="任务名称" prop="taskName">
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="queryParams.taskName"
|
|
|
|
|
|
placeholder="请输入任务名称"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
type="warning"
|
|
|
|
|
|
plain
|
|
|
|
|
|
icon="el-icon-download"
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
@click="handleExport"
|
|
|
|
|
|
>导出</el-button>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="checkTaskList" @selection-change="handleSelectionChange">
|
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
|
<el-table-column label="主键" align="center" prop="taskId" v-if="true"/>
|
|
|
|
|
|
<el-table-column label="任务名称" align="center" prop="taskName" />
|
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
icon="el-icon-edit"
|
2025-07-25 17:10:33 +08:00
|
|
|
|
@click="handleDetail(scope.row)"
|
|
|
|
|
|
>详情</el-button>
|
2025-07-25 15:09:08 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
|
|
<pagination
|
2025-07-25 17:10:33 +08:00
|
|
|
|
v-show="total>0"
|
2025-07-25 15:09:08 +08:00
|
|
|
|
:total="total"
|
|
|
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
2025-07-25 17:10:33 +08:00
|
|
|
|
<!-- 检查任务详情弹窗(可复用task页面的实现) -->
|
|
|
|
|
|
<!-- ...如需详情弹窗可参考task/index.vue... -->
|
|
|
|
|
|
<el-dialog :title="'检查任务详情'" :visible.sync="detailOpen" width="600px" append-to-body>
|
|
|
|
|
|
<el-descriptions :column="1" border>
|
|
|
|
|
|
<el-descriptions-item label="任务名称">{{ detailData.taskName }}</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="备注">{{ detailData.remark }}</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="检查项">
|
|
|
|
|
|
<div v-for="item in detailData.itemList" :key="item.itemId" style="margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between;">
|
|
|
|
|
|
<div style="display: flex; align-items: center;">
|
|
|
|
|
|
<el-tag type="info" style="margin-right: 12px;">{{ item.itemName }}</el-tag>
|
|
|
|
|
|
<el-tag
|
|
|
|
|
|
:type="item.status == 1 ? 'success' : (item.status == 2 ? 'danger' : 'info')"
|
|
|
|
|
|
style="margin-right: 16px; min-width: 60px; text-align: center;"
|
|
|
|
|
|
>
|
|
|
|
|
|
<span v-if="item.status == 0">未检测</span>
|
|
|
|
|
|
<span v-else-if="item.status == 1">通过</span>
|
|
|
|
|
|
<span v-else-if="item.status == 2">不通过</span>
|
|
|
|
|
|
<span v-else>未知</span>
|
|
|
|
|
|
</el-tag>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
</el-descriptions>
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
|
<el-button @click="handleDetailClose">关 闭</el-button>
|
|
|
|
|
|
</span>
|
2025-07-25 15:09:08 +08:00
|
|
|
|
</el-dialog>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2025-07-25 17:10:33 +08:00
|
|
|
|
import { listHistoryCheckTask, getCheckTask } from '@/api/mes/qc/checkTask'
|
2025-07-25 15:09:08 +08:00
|
|
|
|
|
|
|
|
|
|
export default {
|
2025-07-25 17:10:33 +08:00
|
|
|
|
name: 'CheckTaskHistory',
|
2025-07-25 15:09:08 +08:00
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
loading: true,
|
|
|
|
|
|
ids: [],
|
|
|
|
|
|
single: true,
|
|
|
|
|
|
multiple: true,
|
|
|
|
|
|
showSearch: true,
|
|
|
|
|
|
total: 0,
|
|
|
|
|
|
checkTaskList: [],
|
|
|
|
|
|
queryParams: {
|
|
|
|
|
|
pageNum: 1,
|
2025-08-25 09:13:45 +08:00
|
|
|
|
pageSize: 20,
|
2025-07-25 15:09:08 +08:00
|
|
|
|
taskName: undefined,
|
|
|
|
|
|
},
|
2025-07-25 17:10:33 +08:00
|
|
|
|
detailOpen: false,
|
|
|
|
|
|
detailData: {},
|
|
|
|
|
|
}
|
2025-07-25 15:09:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
created() {
|
2025-07-25 17:10:33 +08:00
|
|
|
|
this.getList()
|
2025-07-25 15:09:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
getList() {
|
2025-07-25 17:10:33 +08:00
|
|
|
|
this.loading = true
|
|
|
|
|
|
listHistoryCheckTask(this.queryParams).then(response => {
|
|
|
|
|
|
this.checkTaskList = response.rows
|
|
|
|
|
|
this.total = response.total
|
|
|
|
|
|
this.loading = false
|
|
|
|
|
|
})
|
2025-07-25 15:09:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
handleQuery() {
|
2025-07-25 17:10:33 +08:00
|
|
|
|
this.queryParams.pageNum = 1
|
|
|
|
|
|
this.getList()
|
2025-07-25 15:09:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
resetQuery() {
|
2025-07-25 17:10:33 +08:00
|
|
|
|
this.resetForm('queryForm')
|
|
|
|
|
|
this.handleQuery()
|
2025-07-25 15:09:08 +08:00
|
|
|
|
},
|
|
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
|
|
this.ids = selection.map(item => item.taskId)
|
|
|
|
|
|
this.single = selection.length!==1
|
|
|
|
|
|
this.multiple = !selection.length
|
|
|
|
|
|
},
|
|
|
|
|
|
handleExport() {
|
|
|
|
|
|
this.download('qc/checkTask/export', {
|
|
|
|
|
|
...this.queryParams
|
|
|
|
|
|
}, `checkTask_${new Date().getTime()}.xlsx`)
|
2025-07-25 17:10:33 +08:00
|
|
|
|
},
|
|
|
|
|
|
handleDetail(row) {
|
|
|
|
|
|
this.loading = true
|
|
|
|
|
|
getCheckTask(row.taskId).then(response => {
|
|
|
|
|
|
this.detailData = response.data
|
|
|
|
|
|
this.detailOpen = true
|
|
|
|
|
|
}).finally(() => {
|
|
|
|
|
|
this.loading = false
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
handleDetailClose() {
|
|
|
|
|
|
this.detailOpen = false
|
|
|
|
|
|
this.getList()
|
2025-07-25 15:09:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-07-25 17:10:33 +08:00
|
|
|
|
}
|
2025-07-25 15:09:08 +08:00
|
|
|
|
</script>
|