feat(mes): 更新质检缺陷记录权限标识,重构相关校验逻辑,优化缺陷统计计算
parent
87d10eacb8
commit
31cc9bd31e
|
|
@ -1,6 +1,5 @@
|
|||
import request from '@/config/axios'
|
||||
|
||||
// TODO @AI:defect/record/index.ts
|
||||
// MES 质检缺陷记录 VO
|
||||
export interface QcDefectRecordVO {
|
||||
id: number // 编号
|
||||
|
|
@ -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' })
|
||||
|
|
|
|||
|
|
@ -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 @AI:qualifiedQuantity、unqualifiedQuantity 使用 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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue