|
|
|
|
@ -49,7 +49,14 @@ v-show="total > 0" v-model:current-page="queryParams.pageNo" v-model:page-size="
|
|
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="handleSave" :loading="submitLoading">保 存</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleSave"
|
|
|
|
|
:loading="submitLoading"
|
|
|
|
|
:disabled="submitLoading || !isAllPendingSelected()"
|
|
|
|
|
>
|
|
|
|
|
保 存
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</Dialog>
|
|
|
|
|
</template>
|
|
|
|
|
@ -124,6 +131,16 @@ const handleCurrentChange = () => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleSave = async () => {
|
|
|
|
|
const hasUnselected = list.value.some((row) => {
|
|
|
|
|
if (!row?.id) return false
|
|
|
|
|
if (String(row.inspectionResult) !== '0') return false
|
|
|
|
|
const decision = decisionMap[String(row.id)]
|
|
|
|
|
return !decision
|
|
|
|
|
})
|
|
|
|
|
if (hasUnselected) {
|
|
|
|
|
message.error('请先为所有待检测记录选择通过或不通过')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
const payload: TicketResultVO[] = []
|
|
|
|
|
for (const row of list.value) {
|
|
|
|
|
if (!row?.id) continue
|
|
|
|
|
@ -150,6 +167,16 @@ const handleSave = async () => {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const isAllPendingSelected = () => {
|
|
|
|
|
for (const row of list.value) {
|
|
|
|
|
if (!row?.id) continue
|
|
|
|
|
if (String(row.inspectionResult) !== '0') continue
|
|
|
|
|
const decision = decisionMap[String(row.id)]
|
|
|
|
|
if (!decision) return false
|
|
|
|
|
}
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getRowKey = (row: TicketResultVO) => {
|
|
|
|
|
return String(row.id ?? '')
|
|
|
|
|
}
|
|
|
|
|
|