feat(mes): 更新质检缺陷记录权限标识,重构相关校验逻辑,优化缺陷统计计算

pull/871/MERGE
YunaiV 2026-02-21 19:26:47 +08:00
parent 87d10eacb8
commit 31cc9bd31e
3 changed files with 9 additions and 41 deletions

View File

@ -1,6 +1,5 @@
import request from '@/config/axios'
// TODO @AIdefect/record/index.ts
// MES 质检缺陷记录 VO
export interface QcDefectRecordVO {
id: number // 编号

View File

@ -2,15 +2,14 @@
<template>
<div>
<!-- 操作栏 -->
<!-- // TODO @AI使 mes:qc-record:create todo
@芋艿说下这个情况 -->
<!-- TODO @芋艿说下 mes:qc-record 这个权限标识的情况 -->
<el-row class="mb-10px">
<el-button
type="primary"
plain
size="small"
@click="openForm('create')"
v-hasPermi="['mes:qc-defect-record:create']"
v-hasPermi="['mes:qc-record:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增缺陷记录
</el-button>
@ -39,7 +38,7 @@
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['mes:qc-defect-record:update']"
v-hasPermi="['mes:qc-record:update']"
>
编辑
</el-button>
@ -47,7 +46,7 @@
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['mes:qc-defect-record:update']"
v-hasPermi="['mes:qc-record:update']"
>
删除
</el-button>
@ -112,7 +111,7 @@
<script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime'
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
import { QcDefectRecordApi, QcDefectRecordVO } from '@/api/mes/qc/defect-record'
import { QcDefectRecordApi, QcDefectRecordVO } from '@/api/mes/qc/defect/record'
import { QcIqcLineApi, QcIqcLineVO } from '@/api/mes/qc/iqc/line'
defineOptions({ name: 'IqcDefectList' })

View File

@ -209,24 +209,13 @@
</template>
<template #footer>
<!-- TODO @AI不需要 status 判断 -->
<el-button
@click="submitForm"
type="primary"
:disabled="formLoading"
v-if="formData.status === 0"
>
</el-button>
<!-- TODO @AI不需要 完成 操作 -->
<el-button
@click="handleComplete"
type="success"
:disabled="formLoading"
v-if="formType === 'update' && formData.id && formData.status === 0"
>
</el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
@ -272,9 +261,8 @@ const formData = ref({
maxUnqualifiedQuantity: undefined,
receivedQuantity: undefined,
checkQuantity: undefined,
// TODO @AIqualifiedQuantityunqualifiedQuantity 使 undefined
qualifiedQuantity: 0,
unqualifiedQuantity: 0,
qualifiedQuantity: undefined,
unqualifiedQuantity: undefined,
checkResult: undefined,
receiveDate: undefined,
inspectDate: undefined,
@ -343,24 +331,6 @@ const submitForm = async () => {
}
}
/** 完成操作 */
const handleComplete = async () => {
try {
await message.confirm('确认完成该来料检验单?完成后不可修改。')
formLoading.value = true
//
await QcIqcApi.updateIqc(formData.value as unknown as QcIqcVO)
//
await QcIqcApi.completeIqc(formData.value.id!)
message.success('完成成功')
dialogVisible.value = false
emit('success')
} catch {
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
@ -379,8 +349,8 @@ const resetForm = () => {
maxUnqualifiedQuantity: undefined,
receivedQuantity: undefined,
checkQuantity: undefined,
qualifiedQuantity: 0,
unqualifiedQuantity: 0,
qualifiedQuantity: undefined,
unqualifiedQuantity: undefined,
checkResult: undefined,
receiveDate: undefined,
inspectDate: undefined,