From 03cfba0f636b42417070fc8caef44bcdd792a085 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期二, 07 五月 2024 17:34:37 +0800
Subject: [PATCH] 概述 出库模块 编辑的时候循环处理对应产品调用接口获取在库数量的逻辑处理

---
 src/views/operate/scrap/AddScrapDialog.vue |   44 ++++++++++++++++++++++++++++++--------------
 1 files changed, 30 insertions(+), 14 deletions(-)

diff --git a/src/views/operate/scrap/AddScrapDialog.vue b/src/views/operate/scrap/AddScrapDialog.vue
index 3393fb9..626fb4a 100644
--- a/src/views/operate/scrap/AddScrapDialog.vue
+++ b/src/views/operate/scrap/AddScrapDialog.vue
@@ -113,7 +113,7 @@
                     style="width: 90%"
                     :disabled="!showFooter"
                   >
-                    <el-option v-for="item in toLocationOptions" :key="item.id" :label="item.name" :value="item.id">
+                    <el-option v-for="item in toLocationOptions1" :key="item.id" :label="item.name" :value="item.id">
                     </el-option>
                   </el-select>
                 </el-form-item>
@@ -174,11 +174,13 @@
         amount: [{ required: true, message: "璇疯緭鍏ユ暟閲�", trigger: "blur" }],
         fromLocationId: [{ required: true, message: "璇烽�夋嫨婧愪綅缃�", trigger: "change" }],
         toLocationId: [{ required: true, message: "璇烽�夋嫨鎶ュ簾浣嶇疆", trigger: "change" }],
-        sourceNumber: [{ required: true, message: "璇疯緭鍏ユ潵婧愬崟鎹�", trigger: "blur" }]
+        sourceNumber: [{ required: true, message: "璇疯緭鍏ユ潵婧愬崟鎹�", trigger: "blur" }],
+        number: [{ required: true, validator: this.validateCheckCode, trigger: ["change", "blur"] }]
       },
       memberOptions: [],
       productOptions: [],
       toLocationOptions: [],
+      toLocationOptions1: [],
       list: [
         { label: "鑽夌", status: "todo", value: 1 },
         { label: "灏辩华", status: "todo", value: 3 },
@@ -195,7 +197,16 @@
   created() {
     this.setBottonView()
     this.getProductList()
-    this.getLocationList()
+    this.getLocationList({
+      isScrapLocation: true,
+      page: 0,
+      pageSize: 0
+    })
+    this.getLocationList({
+      // isScrapLocation: true,
+      page: 0,
+      pageSize: 0
+    })
     this.unit = this.editConfig.infomation.unit || ""
     this.formInfo()
   },
@@ -223,17 +234,22 @@
       })
     },
     // 鑾峰彇浠撳簱浣嶇疆鍒楄〃
-    async getLocationList() {
-      await getLocationList({
-        isScrapLocation: true,
-        page: 0,
-        pageSize: 0
-      }).then((res) => {
-        console.log(res)
-        if (res.code === 200) {
-          this.toLocationOptions = res.data
-        }
-      })
+    async getLocationList(params) {
+      if(params.isScrapLocation){
+        await getLocationList(params).then((res) => {
+          console.log(res)
+          if (res.code === 200) {
+            this.toLocationOptions1 = res.data
+          }
+        })
+      }else{
+        await getLocationList(params).then((res) => {
+          console.log(res)
+          if (res.code === 200) {
+            this.toLocationOptions = res.data
+          }
+        })
+      }
     },
     // 璁剧疆鍒犻櫎/鎵撳嵃/缂栬緫鏄惁鏄剧ず
     setBottonView() {

--
Gitblit v1.8.0