|
|
|
|
@ -1,15 +1,13 @@
|
|
|
|
|
<template>
|
|
|
|
|
<Dialog v-model="dialogVisible" :title="dialogTitle" width="1100px">
|
|
|
|
|
<el-table
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
:data="list"
|
|
|
|
|
:stripe="true"
|
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
|
:row-key="getRowKey"
|
|
|
|
|
>
|
|
|
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" :row-key="getRowKey">
|
|
|
|
|
<el-table-column type="index" label="序号" align="center" width="70" />
|
|
|
|
|
<el-table-column label="检验项名称" align="center" prop="inspectionItemName" min-width="180" />
|
|
|
|
|
<el-table-column label="检验方式" align="center" prop="inspectionMethod" min-width="140" />
|
|
|
|
|
<el-table-column label="检验方式" align="center" prop="inspectionMethod" min-width="140">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag type="Inspection_method" :value="scope.row.inspectionMethod" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="判定基准" align="center" prop="judgmentCriteria" min-width="160" />
|
|
|
|
|
<el-table-column label="检验结果" align="center" prop="inspectionResult" width="120">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
@ -21,24 +19,20 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="图片" align="center" prop="images" width="160">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<UploadImg
|
|
|
|
|
v-if="String(scope.row.inspectionResult) === '0'" v-model="imageMap[String(scope.row.id)]"
|
|
|
|
|
:drag="false" :show-btn-text="false" width="64px" height="64px" />
|
|
|
|
|
<el-image
|
|
|
|
|
v-if="scope.row.images"
|
|
|
|
|
:src="parseFirstImage(scope.row.images)"
|
|
|
|
|
:preview-src-list="parseImages(scope.row.images)"
|
|
|
|
|
preview-teleported
|
|
|
|
|
fit="cover"
|
|
|
|
|
style="width: 64px; height: 64px"
|
|
|
|
|
/>
|
|
|
|
|
v-else-if="scope.row.images" :src="parseFirstImage(scope.row.images)"
|
|
|
|
|
:preview-src-list="parseImages(scope.row.images)" preview-teleported fit="cover"
|
|
|
|
|
style="width: 64px; height: 64px" />
|
|
|
|
|
<span v-else>-</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" min-width="160" />
|
|
|
|
|
<el-table-column label="操作" align="center" width="200" fixed="right">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-radio-group
|
|
|
|
|
v-if="String(scope.row.inspectionResult) === '0'"
|
|
|
|
|
v-model="decisionMap[String(scope.row.id)]"
|
|
|
|
|
>
|
|
|
|
|
<el-radio-group v-if="String(scope.row.inspectionResult) === '0'" v-model="decisionMap[String(scope.row.id)]">
|
|
|
|
|
<el-radio :label="'1'">通过</el-radio>
|
|
|
|
|
<el-radio :label="'2'">不通过</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
@ -48,18 +42,10 @@
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<el-pagination
|
|
|
|
|
v-show="total > 0"
|
|
|
|
|
v-model:current-page="queryParams.pageNo"
|
|
|
|
|
v-model:page-size="queryParams.pageSize"
|
|
|
|
|
:background="true"
|
|
|
|
|
:page-sizes="[10, 20, 30, 50, 100]"
|
|
|
|
|
:pager-count="7"
|
|
|
|
|
:total="total"
|
|
|
|
|
class="mt-15px mb-15px flex justify-end"
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
@size-change="handleSizeChange"
|
|
|
|
|
@current-change="handleCurrentChange"
|
|
|
|
|
/>
|
|
|
|
|
v-show="total > 0" v-model:current-page="queryParams.pageNo" v-model:page-size="queryParams.pageSize"
|
|
|
|
|
:background="true" :page-sizes="[10, 20, 30, 50, 100]" :pager-count="7" :total="total"
|
|
|
|
|
class="mt-15px mb-15px flex justify-end" layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
@size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
|
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
|
|
@ -84,6 +70,7 @@ const list = ref<TicketResultVO[]>([])
|
|
|
|
|
const total = ref(0)
|
|
|
|
|
const managementId = ref<number | undefined>(undefined)
|
|
|
|
|
const decisionMap = reactive<Record<string, '1' | '2' | undefined>>({})
|
|
|
|
|
const imageMap = reactive<Record<string, string>>({})
|
|
|
|
|
|
|
|
|
|
const queryParams = reactive({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
@ -94,6 +81,8 @@ const open = async (options: { managementId: number; title?: string }) => {
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
|
dialogTitle.value = options.title || '检验结果'
|
|
|
|
|
managementId.value = options.managementId
|
|
|
|
|
for (const key of Object.keys(decisionMap)) delete decisionMap[key]
|
|
|
|
|
for (const key of Object.keys(imageMap)) delete imageMap[key]
|
|
|
|
|
queryParams.pageNo = 1
|
|
|
|
|
await getList()
|
|
|
|
|
}
|
|
|
|
|
@ -111,6 +100,14 @@ const getList = async () => {
|
|
|
|
|
})
|
|
|
|
|
list.value = data.list
|
|
|
|
|
total.value = data.total
|
|
|
|
|
|
|
|
|
|
for (const row of list.value) {
|
|
|
|
|
const id = row?.id
|
|
|
|
|
if (!id) continue
|
|
|
|
|
if (row.images && !imageMap[String(id)]) {
|
|
|
|
|
imageMap[String(id)] = parseFirstImage(row.images)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} finally {
|
|
|
|
|
loading.value = false
|
|
|
|
|
}
|
|
|
|
|
@ -132,7 +129,8 @@ const handleSave = async () => {
|
|
|
|
|
if (String(row.inspectionResult) !== '0') continue
|
|
|
|
|
const decision = decisionMap[String(row.id)]
|
|
|
|
|
if (!decision) continue
|
|
|
|
|
payload.push({ ...(row as any), inspectionResult: decision })
|
|
|
|
|
const img = imageMap[String(row.id)]
|
|
|
|
|
payload.push({ ...(row as any), inspectionResult: decision, images: img || row.images })
|
|
|
|
|
}
|
|
|
|
|
if (!payload.length) {
|
|
|
|
|
message.error('请先为待检测记录选择通过或不通过')
|
|
|
|
|
@ -142,7 +140,7 @@ const handleSave = async () => {
|
|
|
|
|
try {
|
|
|
|
|
await TicketManagementApi.batchUpdateTicketResults(payload)
|
|
|
|
|
message.success('更新成功')
|
|
|
|
|
await getList()
|
|
|
|
|
dialogVisible.value = false
|
|
|
|
|
} catch {
|
|
|
|
|
message.error('更新失败')
|
|
|
|
|
} finally {
|
|
|
|
|
@ -167,3 +165,9 @@ const parseFirstImage = (value: any): string => {
|
|
|
|
|
return parseImages(value)[0] || ''
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
:deep(.el-upload) {
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|