diff --git a/src/views/mes/qc/iqc/IqcForm.vue b/src/views/mes/qc/iqc/IqcForm.vue
index 7329a92b2..a77c167c1 100644
--- a/src/views/mes/qc/iqc/IqcForm.vue
+++ b/src/views/mes/qc/iqc/IqcForm.vue
@@ -8,6 +8,7 @@
:rules="formRules"
label-width="120px"
v-loading="formLoading"
+ :disabled="isDetail"
>
@@ -143,43 +144,41 @@
-
- 缺陷情况
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ 缺陷情况
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -196,7 +195,9 @@
- 保 存
+
+ 保 存
+
关 闭
@@ -218,15 +219,21 @@ const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
const dialogVisible = ref(false) // 弹窗的是否展示
-const dialogTitle = ref('') // 弹窗的标题
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
-const formType = ref('') // 表单的类型:create - 新增;update - 修改
+const formType = ref('') // 表单的类型:create - 新增;update - 修改;detail - 详情
const activeTab = ref('line') // 当前激活的标签页
-
-/** 是否来自待检任务(有预填的来源单据信息) */
+const dialogTitle = computed(() => {
+ const titles = {
+ create: '新增来料检验单',
+ update: '修改来料检验单',
+ detail: '查看来料检验单'
+ }
+ return titles[formType.value] || t('action.' + formType.value)
+}) // 弹窗标题,根据 formType 自动显示
+const isDetail = computed(() => formType.value === 'detail') // 表单是否为详情模式(只读)
const isFromPendingTask = computed(
() => formType.value === 'create' && formData.value.sourceDocId != null
-)
+) // 是否来自待检任务(有预填的来源单据信息)
const formData = ref({
id: undefined as number | undefined,
@@ -274,7 +281,6 @@ const generateCode = () => {
/** 打开弹窗 */
const open = async (type: string, id?: number, data?: QcIqcVO) => {
dialogVisible.value = true
- dialogTitle.value = t('action.' + type)
formType.value = type
activeTab.value = 'line'
resetForm()
@@ -305,13 +311,15 @@ const submitForm = async () => {
try {
const data = formData.value as unknown as QcIqcVO
if (formType.value === 'create') {
- await QcIqcApi.createIqc(data)
+ const res = await QcIqcApi.createIqc(data)
message.success(t('common.createSuccess'))
+ // 新增成功后,切换到修改模式,设置 id
+ formData.value.id = res
+ formType.value = 'update'
} else {
await QcIqcApi.updateIqc(data)
message.success(t('common.updateSuccess'))
}
- dialogVisible.value = false
// 发送操作成功的事件
emit('success')
} finally {
diff --git a/src/views/mes/qc/iqc/index.vue b/src/views/mes/qc/iqc/index.vue
index e2438fd97..de11ee875 100644
--- a/src/views/mes/qc/iqc/index.vue
+++ b/src/views/mes/qc/iqc/index.vue
@@ -115,7 +115,13 @@
-
+
+
+
+ {{ scope.row.code }}
+
+
+