From 75aaca3a95314be8c384df18dba23c661dea742c Mon Sep 17 00:00:00 2001
From: 石广澎 <shiguangpeng@163.com>
Date: 星期一, 27 十一月 2023 19:05:38 +0800
Subject: [PATCH] feat:

---
 admin-web/src/views/stock/inventorycount/inventorytask/inventory.vue |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/admin-web/src/views/stock/inventorycount/inventorytask/inventory.vue b/admin-web/src/views/stock/inventorycount/inventorytask/inventory.vue
index fa31464..4fa870b 100644
--- a/admin-web/src/views/stock/inventorycount/inventorytask/inventory.vue
+++ b/admin-web/src/views/stock/inventorycount/inventorytask/inventory.vue
@@ -1,6 +1,6 @@
 <template>
   <win-md :title="setting.title" @close="close" :width="'1200px'">
-    <el-form class="form" ref="ruleForm" :model="formData" :rules="rules">
+    <el-form v-loading="loading" class="form" ref="ruleForm" :model="formData" :rules="rules">
       <el-row :gutter="20" style="margin-bottom: 20px" type="flex" align="middle">
         <el-col :span="6">鐩樼偣鍗曞彿锛歿{ formData.businessFormCode }}</el-col>
         <el-col :span="6">鐩樼偣浠诲姟锛歿{ formData.businessFormName }}</el-col>
@@ -10,7 +10,6 @@
         </el-col>
       </el-row>
       <el-table
-        v-loading="loading"
         :data="formData.formInventoryGoodsList"
         :rules="rules"
         height="500"
@@ -25,6 +24,7 @@
         <el-table-column prop="realNum" label="瀹炵洏鏁伴噺" align="center">
           <template slot-scope="scope">
             <el-form-item
+              style="margin-bottom: 0"
               label-width="0"
               :prop="`formInventoryGoodsList[${scope.$index}].realNum`"
               :rules="rules.realNum"
@@ -57,7 +57,7 @@
   },
   data() {
     return {
-      loading: false,
+      loading: true,
       btnLoading: false,
       formData: {
         businessFormCode: '',
@@ -75,17 +75,22 @@
   },
   created() {
     const info = JSON.parse(this.setting.info);
-    console.log('info', info);
     if (info.states == 1) {
       // 缁х画鐩樼偣
       inventoryDetail({ id: this.setting.id }).then((res) => {
+        this.loading = false
         this.formData = res;
         this.formData.id = this.setting.id;
+      }).catch(()=>{
+        this.loading = false
       });
     } else {
       inventoryQuery({ id: this.setting.id }).then((res) => {
+        this.loading = false
         this.formData = res;
         this.formData.id = this.setting.id;
+      }).catch(()=>{
+        this.loading = false
       });
     }
   },
@@ -98,10 +103,14 @@
         id: this.formData.id,
         inventoryGoodsList: this.formData.formInventoryGoodsList,
       };
+      this.loading = true
       inventoryTemporaryStorage(params).then(() => {
+        this.loading = false
         this.$message.success('鏆傚瓨鎴愬姛锛�');
         this.close();
         this.$emit('search');
+      }).catch(()=>{
+        this.loading = false
       });
     },
     save() {
@@ -111,10 +120,13 @@
             ...this.formData,
             inventoryGoodsList: this.formData.formInventoryGoodsList,
           };
+          this.loading = true
           inventoryFinish(params).then(() => {
             this.$message.success('鏆傚瓨鎴愬姛锛�');
             this.close();
             this.$emit('search');
+          }).catch(()=>{
+            this.loading = false
           });
         }
       });

--
Gitblit v1.9.1