From 44266ab0adf7b14aabc28017dec34bdc4fbc96da Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期一, 26 十月 2026 10:53:52 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_新疆_新高电力' into dev_新疆_新高电力

---
 src/views/mes/pro/route/modules/product-bom-list.vue |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/src/views/mes/pro/route/modules/product-bom-list.vue b/src/views/mes/pro/route/modules/product-bom-list.vue
index 78ac672..9d36a56 100644
--- a/src/views/mes/pro/route/modules/product-bom-list.vue
+++ b/src/views/mes/pro/route/modules/product-bom-list.vue
@@ -1,9 +1,10 @@
 <script lang="ts" setup>
+import type { FormType } from '../data';
 import type { VxeTableGridOptions } from '#/adapter/vxe-table';
 import type { MesProRouteProcessApi } from '#/api/mes/pro/route/process';
 import type { MesProRouteProductBomApi } from '#/api/mes/pro/route/productbom';
 
-import { ref, watch } from 'vue';
+import { computed, ref, watch } from 'vue';
 
 import { useVbenModal } from '@vben/common-ui';
 
@@ -21,10 +22,17 @@
 import BomForm from './bom-form.vue';
 
 const props = defineProps<{
+  formType: FormType;
   productId: number;
   productName?: string;
   routeId: number;
 }>();
+
+const emit = defineEmits<{
+  change: [];
+}>();
+
+const isEditable = computed(() => props.formType !== 'detail');
 
 const processList = ref<MesProRouteProcessApi.RouteProcess[]>([]); // 宸ュ簭鍒楄〃锛堢敤浜� Tab锛�
 const activeProcessId = ref<number>(); // 褰撳墠閫変腑鐨勫伐搴� Tab
@@ -112,6 +120,12 @@
   await deleteRouteProductBom(row.id!);
   message.success($t('ui.actionMessage.deleteSuccess', ['BOM 鐗╂枡']));
   await getList();
+  emit('change');
+}
+
+async function handleSaved() {
+  await getList();
+  emit('change');
 }
 
 watch(
@@ -126,7 +140,7 @@
 </script>
 
 <template>
-  <BomFormModal @success="getList" />
+  <BomFormModal @success="handleSaved" />
   <Tabs v-model:active-key="activeProcessId" @change="getList">
     <TabPane
       v-for="item in processList"
@@ -134,11 +148,11 @@
       :tab="item.processName"
     />
   </Tabs>
-  <div class="mb-3 flex items-center justify-start">
+  <div v-if="isEditable" class="mb-3 flex items-center justify-start">
     <TableAction
       :actions="[
         {
-          label: $t('ui.actionTitle.create', ['BOM 鐗╂枡']),
+          label: $t('ui.actionTitle.create', ['鎶曟枡鐗╂枡']),
           type: 'primary',
           disabled: !activeProcessId,
           onClick: handleCreate,
@@ -146,21 +160,23 @@
       ]"
     />
   </div>
-  <Grid class="w-full" table-title="浜у搧 BOM">
+  <Grid class="w-full" table-title="褰撳墠宸ュ簭鎶曟枡">
     <template #actions="{ row }">
       <TableAction
         :actions="[
           {
             label: $t('common.edit'),
             type: 'link',
+            ifShow: () => isEditable,
             onClick: handleEdit.bind(null, row),
           },
           {
             label: $t('common.delete'),
             type: 'link',
             danger: true,
+            ifShow: () => isEditable,
             popConfirm: {
-              title: $t('ui.actionMessage.deleteConfirm', ['BOM 鐗╂枡']),
+              title: $t('ui.actionMessage.deleteConfirm', ['鎶曟枡鐗╂枡']),
               confirm: handleDelete.bind(null, row),
             },
           },

--
Gitblit v1.9.3