feat(defect): 支持缺陷记录弹窗的编辑和详情模式

pull/871/MERGE
YunaiV 2026-04-05 00:00:57 +08:00
parent 4e964e2eea
commit 342b5d08c0
9 changed files with 38 additions and 19 deletions

View File

@ -3,7 +3,7 @@
<Dialog title="缺陷记录" v-model="dialogVisible" width="900px">
<div class="overflow-hidden">
<!-- 新增按钮 -->
<el-row class="mb-10px">
<el-row v-if="!isDetail" class="mb-10px">
<el-button type="primary" plain @click="handleAdd" v-hasPermi="['mes:qc-defect:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新增缺陷
</el-button>
@ -16,6 +16,8 @@
<el-input
v-if="scope.row.editing"
v-model="scope.row.name"
type="textarea"
:autosize="{ minRows: 1, maxRows: 4 }"
placeholder="请输入缺陷描述"
/>
<span v-else>{{ scope.row.name }}</span>
@ -56,7 +58,7 @@
<span v-else>{{ scope.row.remark || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="130" fixed="right">
<el-table-column v-if="!isDetail" label="操作" align="center" width="130" fixed="right">
<template #default="scope">
<template v-if="scope.row.editing">
<el-button link type="success" @click="handleSave(scope.row)"></el-button>
@ -103,11 +105,16 @@ import { QcDefectRecordApi, QcDefectRecordVO } from '@/api/mes/qc/defectrecord'
/** 缺陷记录内联编辑弹窗(通用组件,供 IQC/IPQC/OQC/RQC 各模块复用) */
defineOptions({ name: 'DefectRecordInlineList' })
const props = defineProps<{
formType?: string // update - detail -
}>()
const emit = defineEmits(['refresh']) //
const message = useMessage()
const { t } = useI18n()
const isDetail = computed(() => props.formType === 'detail') //
const dialogVisible = ref(false)
const loading = ref(false)
const list = ref<any[]>([])

View File

@ -257,11 +257,11 @@
</el-form>
<!-- 子表标签页编辑/详情模式下显示 -->
<template v-if="formType === 'update' && formData.id">
<template v-if="formData.id">
<el-divider />
<el-tabs v-model="activeTab">
<el-tab-pane label="检验项" name="line">
<IpqcLineList :ipqc-id="formData.id" />
<IpqcLineList :ipqc-id="formData.id" :form-type="formType" />
</el-tab-pane>
<el-tab-pane label="检测结果" name="result">
<QcIndicatorResultList :qc-id="formData.id!" :qc-type="MesQcTypeEnum.IPQC" />

View File

@ -33,7 +33,7 @@
/>
<!-- 缺陷记录弹窗内联编辑 -->
<DefectRecordInlineList ref="defectListRef" @refresh="getList" />
<DefectRecordInlineList ref="defectListRef" :form-type="formType" @refresh="getList" />
</div>
</template>
@ -45,7 +45,10 @@ import { MesQcTypeEnum } from '@/views/mes/utils/constants'
defineOptions({ name: 'IpqcLineList' })
const props = defineProps<{ ipqcId: number }>()
const props = defineProps<{
ipqcId: number
formType?: string //
}>()
const loading = ref(false) //
const list = ref<QcIpqcLineVO[]>([]) //

View File

@ -207,12 +207,12 @@
</el-row>
</el-form>
<!-- 子表标签页编辑模式下显示 -->
<template v-if="formType === 'update' && formData.id">
<!-- 子表标签页编辑/详情模式下显示 -->
<template v-if="formData.id">
<el-divider />
<el-tabs v-model="activeTab">
<el-tab-pane label="检验项" name="line">
<IqcLineList :iqc-id="formData.id" />
<IqcLineList :iqc-id="formData.id" :form-type="formType" />
</el-tab-pane>
<el-tab-pane label="检测结果" name="result">
<QcIndicatorResultList :qc-id="formData.id!" :qc-type="MesQcTypeEnum.IQC" />

View File

@ -34,7 +34,7 @@
/>
<!-- 缺陷记录弹窗内联编辑 -->
<DefectRecordInlineList ref="defectListRef" @refresh="getList" />
<DefectRecordInlineList ref="defectListRef" :form-type="formType" @refresh="getList" />
</div>
</template>
@ -46,7 +46,10 @@ import { MesQcTypeEnum } from '@/views/mes/utils/constants'
defineOptions({ name: 'IqcLineList' })
const props = defineProps<{ iqcId: number }>()
const props = defineProps<{
iqcId: number
formType?: string //
}>()
const loading = ref(false) //
const list = ref<QcIqcLineVO[]>([]) //

View File

@ -218,11 +218,11 @@
</el-form>
<!-- 子表标签页编辑模式下显示 -->
<template v-if="(formType === 'update' || isDetail) && formData.id">
<template v-if="formData.id">
<el-divider />
<el-tabs v-model="activeTab">
<el-tab-pane label="检验项" name="line">
<OqcLineList :oqc-id="formData.id" />
<OqcLineList :oqc-id="formData.id" :form-type="formType" />
</el-tab-pane>
<el-tab-pane label="检测结果" name="result">
<QcIndicatorResultList :qc-id="formData.id!" :qc-type="MesQcTypeEnum.OQC" />

View File

@ -33,7 +33,7 @@
/>
<!-- 缺陷记录弹窗内联编辑 -->
<DefectRecordInlineList ref="defectListRef" @refresh="getList" />
<DefectRecordInlineList ref="defectListRef" :form-type="formType" @refresh="getList" />
</div>
</template>
@ -45,7 +45,10 @@ import { MesQcTypeEnum } from '@/views/mes/utils/constants'
defineOptions({ name: 'OqcLineList' })
const props = defineProps<{ oqcId: number }>()
const props = defineProps<{
oqcId: number
formType?: string //
}>()
const loading = ref(false) //
const list = ref<QcOqcLineVO[]>([]) //

View File

@ -205,11 +205,11 @@
</el-form>
<!-- 子表标签页编辑/详情模式下显示 -->
<template v-if="(formType === 'update' || formType === 'detail') && formData.id">
<template v-if="formData.id">
<el-divider />
<el-tabs v-model="activeTab">
<el-tab-pane label="检验项" name="line">
<RqcLineList :rqc-id="formData.id" />
<RqcLineList :rqc-id="formData.id" :form-type="formType" />
</el-tab-pane>
<el-tab-pane label="检测结果" name="result">
<QcIndicatorResultList :qc-id="formData.id!" :qc-type="MesQcTypeEnum.RQC" />

View File

@ -33,7 +33,7 @@
/>
<!-- 缺陷记录弹窗内联编辑 -->
<DefectRecordInlineList ref="defectListRef" @refresh="getList" />
<DefectRecordInlineList ref="defectListRef" :form-type="formType" @refresh="getList" />
</div>
</template>
@ -45,7 +45,10 @@ import { MesQcTypeEnum } from '@/views/mes/utils/constants'
defineOptions({ name: 'RqcLineList' })
const props = defineProps<{ rqcId: number }>()
const props = defineProps<{
rqcId: number
formType?: string //
}>()
const loading = ref(false) //
const list = ref<QcRqcLineVO[]>([]) //