From 8653c57c42dafdebae457a3eb7183511121922db Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期一, 11 八月 2025 16:53:53 +0800
Subject: [PATCH] 提交

---
 north-glass-erp/northglass-erp/src/views/mm/ingredientStock/MaterialAddition.vue |   45 ++++++++++++++++++++++++---------------------
 1 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/mm/ingredientStock/MaterialAddition.vue b/north-glass-erp/northglass-erp/src/views/mm/ingredientStock/MaterialAddition.vue
index bd46537..178ff8a 100644
--- a/north-glass-erp/northglass-erp/src/views/mm/ingredientStock/MaterialAddition.vue
+++ b/north-glass-erp/northglass-erp/src/views/mm/ingredientStock/MaterialAddition.vue
@@ -176,6 +176,27 @@
   })
 }
 
+const update = () => {
+  let flowData = ref({
+    title: titleUploadData.value,
+    materialInventoryId: props.data.id,
+    userName:userStore.user.userName,
+    userId:userStore.user.userId
+
+  })
+
+  request.post("/materialInventory/updateMaterialInventory", flowData.value).then((res) => {
+    if(res.code==200 && res.data==="true"){
+      ElMessage.success(t('basicData.msg.saveSuccess'))
+      router.push({path: '/main/ingredientsStock/SelectIngredientsStock', query:{random:Math.random()}})
+    }else if(res.data==="false1") {
+      ElMessage.warning("搴撳瓨瀛樺湪澶氭潯")
+    }else {
+      ElMessage.warning(t('basicData.msg.ServerConnectionError'))
+    }
+  })
+}
+
 
 const gridEvent = {
   async toolbarButtonClick({code}) {
@@ -242,25 +263,6 @@
               if(res.code==200 && res.data==="true"){
                 ElMessage.success(t('basicData.msg.saveSuccess'))
                 router.push({path: '/main/ingredientsStock/SelectIngredientsStock', query:{random:Math.random()}})
-              }else {
-                ElMessage.warning(t('basicData.msg.ServerConnectionError'))
-              }
-            })
-          }else{
-            let flowData = ref({
-              title: titleUploadData.value,
-              materialInventoryId: props.data.id,
-              userName:userStore.user.userName,
-              userId:userStore.user.userId
-
-            })
-
-            request.post("/materialInventory/updateMaterialInventory", flowData.value).then((res) => {
-              if(res.code==200 && res.data==="true"){
-                ElMessage.success(t('basicData.msg.saveSuccess'))
-                router.push({path: '/main/ingredientsStock/SelectIngredientsStock', query:{random:Math.random()}})
-              }else if(res.data==="false1") {
-                ElMessage.warning("搴撳瓨瀛樺湪澶氭潯")
               }else {
                 ElMessage.warning(t('basicData.msg.ServerConnectionError'))
               }
@@ -360,14 +362,15 @@
         </el-select>
       </el-row>
     </div>
-    <div class="main-div-customers" style="height: 350px">
+    <div class="main-div-customers"  style="height: 350px">
+      <el-button v-if="props.type===2" @click="update">{{$t('basicData.save')}}</el-button>
       <vxe-grid
           height="100%"
           class="mytable-scrollbar"
           ref="xGrids"
           v-bind="gridOption"
           v-on="gridEvent"
-
+          v-if="props.type===1"
       >
         <template #num1_filter="{ column, $panel }">
           <div>

--
Gitblit v1.8.0