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