From 3f69b4dfc585c4dfbc3c07a6acf5cdd838033636 Mon Sep 17 00:00:00 2001
From: liuguocan <527956374@qq.com>
Date: 星期二, 28 十一月 2023 14:45:49 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 admin-web/src/views/stock/inventorycount/inventorytask/edit.vue |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/admin-web/src/views/stock/inventorycount/inventorytask/edit.vue b/admin-web/src/views/stock/inventorycount/inventorytask/edit.vue
index 7708d9f..7a661e7 100644
--- a/admin-web/src/views/stock/inventorycount/inventorytask/edit.vue
+++ b/admin-web/src/views/stock/inventorycount/inventorytask/edit.vue
@@ -1,6 +1,6 @@
 <template>
   <win-sm :title="`${setting.title}鐩樼偣`" @close="close" :width="'800px'">
-    <el-form ref="ruleForm" :model="formData" :rules="rules" class="demo-ruleForm" label-width="100px">
+    <el-form v-loading="loading" ref="ruleForm" :model="formData" :rules="rules" class="demo-ruleForm" label-width="100px">
       <el-form-item label="鐩樼偣鍗曞悕" prop="businessFormName">
         <el-input
           v-model="formData.businessFormName"
@@ -62,13 +62,20 @@
   },
   data() {
     return {
-      loading:true,
+      count: 0,
+      loading: true,
       checkAll: false,
       checkedList: [],
       warehouseOptions: [], // 浠撳簱鍒楄〃
       operatorOptions: [],
       operatorOptions2: [],
-      formData: {},
+      formData: {
+        businessFormName: '',
+        warehouseId: '',
+        operatorUserId: '',
+        monitorUserId: '',
+        remark: '',
+      },
       rules: {
         businessFormName: [{ required: true, message: '璇疯緭鍏�', trigger: 'blur' }],
         warehouseId: [{ required: true, message: '璇烽�夋嫨', trigger: 'blur' }],
@@ -97,19 +104,31 @@
     // 鑾峰彇浠撳簱鍒楄〃
     handleSelectTenantWarehouse() {
       selectTenantWarehouse({ agencyId: this.userInfo.tenantId }).then((res) => {
+        this.count++
         this.warehouseOptions = res;
+        if(this.count>1){
+          this.loading = false
+        }
       });
     },
     // 鑾峰彇鐩樼偣浜�
     getPdr() {
       warehouseManagerList({ tenantId: this.userInfo.tenantId }).then((res) => {
+        this.count++
         this.operatorOptions = res;
+        if(this.count>1){
+          this.loading = false
+        }
       });
     },
     // 鑾峰彇鐩戠洏浜�
     getJpr() {
       tenantUserQueryUser({ tenantId: this.userInfo.tenantId }).then((res) => {
+        this.count++
         this.operatorOptions2 = res;
+        if(this.count>1){
+          this.loading = false
+        }
       });
     },
     getEditInfo(id) {},
@@ -120,18 +139,25 @@
       this.$refs.ruleForm.validate((valid) => {
         if (valid) {
           const params = Object.assign({}, this.formData);
+          this.loading = true
           if (this.setting.id) {
             // 缂栬緫鎺ュ彛
             inventoryEdit(params).then((res) => {
+              this.loading = false
               this.$message.success('淇濆瓨鎴愬姛锛�');
               this.close();
               this.$emit('search');
+            }).catch(()=>{
+              this.loading = false
             });
           } else {
             inventoryAdd(params).then((res) => {
+              this.loading = false
               this.$message.success('淇濆瓨鎴愬姛锛�');
               this.close();
               this.$emit('search');
+            }).catch(()=>{
+              this.loading = false
             });
           }
         } else {

--
Gitblit v1.9.1