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' import request from '@/config/axios'
// TODO @AIdefect/record/index.ts
// MES 质检缺陷记录 VO // MES 质检缺陷记录 VO
export interface QcDefectRecordVO { export interface QcDefectRecordVO {
id: number // 编号 id: number // 编号

View File

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

View File

@ -209,24 +209,13 @@
</template> </template>
<template #footer> <template #footer>
<!-- TODO @AI不需要 status 判断 -->
<el-button <el-button
@click="submitForm" @click="submitForm"
type="primary" type="primary"
:disabled="formLoading" :disabled="formLoading"
v-if="formData.status === 0"
> >
</el-button> </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> <el-button @click="dialogVisible = false"> </el-button>
</template> </template>
</Dialog> </Dialog>
@ -272,9 +261,8 @@ const formData = ref({
maxUnqualifiedQuantity: undefined, maxUnqualifiedQuantity: undefined,
receivedQuantity: undefined, receivedQuantity: undefined,
checkQuantity: undefined, checkQuantity: undefined,
// TODO @AIqualifiedQuantityunqualifiedQuantity 使 undefined qualifiedQuantity: undefined,
qualifiedQuantity: 0, unqualifiedQuantity: undefined,
unqualifiedQuantity: 0,
checkResult: undefined, checkResult: undefined,
receiveDate: undefined, receiveDate: undefined,
inspectDate: 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 = () => { const resetForm = () => {
formData.value = { formData.value = {
@ -379,8 +349,8 @@ const resetForm = () => {
maxUnqualifiedQuantity: undefined, maxUnqualifiedQuantity: undefined,
receivedQuantity: undefined, receivedQuantity: undefined,
checkQuantity: undefined, checkQuantity: undefined,
qualifiedQuantity: 0, qualifiedQuantity: undefined,
unqualifiedQuantity: 0, unqualifiedQuantity: undefined,
checkResult: undefined, checkResult: undefined,
receiveDate: undefined, receiveDate: undefined,
inspectDate: undefined, inspectDate: undefined,