From d6d4d1342d8f6211e7035d6a562dc9f7dced1bea Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期五, 19 四月 2024 16:41:26 +0800
Subject: [PATCH] 入库,出库,调拨,出入库明细 4个模块增加已经添加过的产品不可以再次选择

---
 src/components/makepager/CommonFormTableView.vue |   28 +++++++++++++++++++++-------
 1 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index 967f971..7dc1284 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -79,13 +79,17 @@
                 <div class="custom-name">
                   <el-autocomplete
                     v-model="scope.row[item.prop]"
-                    :fetch-suggestions="querySearchAsync"
+                    :fetch-suggestions="
+                      (queryString, callback) => {
+                        querySearchAsync(queryString, callback, 'product')
+                      }
+                    "
                     value-key="name"
                     :disabled="!isOperate"
                     size="mini"
                     @select="
                       (val) => {
-                        handleSelectClient(val, item.prop, scope.row)
+                        handleSelectClient(val, item.prop, scope.row,scope)
                       }
                     "
                   ></el-autocomplete>
@@ -156,7 +160,7 @@
                     :controls="false"
                     size="mini"
                     style="width: 100%; margin-right: 5px"
-                    :min="item.prop === 'minInventory' ? 0 : 1"
+                    :min="item.prop === 'minInventory' ? 0 : 0"
                     @change="
                       (val) => {
                         commonInputChange(val, item.prop, scope.row)
@@ -566,10 +570,19 @@
   computed: {},
   watch: {
     productTableList() {
-      this.tableList = this.productTableList
+      // this.showcol = this.productTableList.showcol
+      this.getTableInfo()
     }
   },
   methods: {
+    getTableInfo(){
+      this.tableList = this.productTableList
+      if (this.tableList.tableData.length === 1 && this.tableList.tableData[0].name === "") {
+        this.isRecalculate = false
+      } else {
+        this.isRecalculate = true
+      }
+    },
     // 浜у搧鍚嶇О
     async getProductList() {
       await getProductList({
@@ -584,8 +597,8 @@
       })
     },
     // 涓嬫媺鎼滅储
-    async handleSelectClient(value, item) {
-      this.$emit("selProductClick", value, item)
+    async handleSelectClient(value, item,row,scope) {
+      this.$emit("selProductClick", value, item,row,scope)
       if (value === "product") {
         if (item.categoryId === 0 || item.categoryName === "") {
           this.productTypeNameOptions = []
@@ -617,7 +630,7 @@
       } else if (value === "formLocation") {
         restaurants = this.selLocationOptions
       }
-      var results = queryString ? restaurants.filter(this.createStateFilter(queryString, value)) : restaurants
+      var results = (queryString&&restaurants) ? restaurants.filter(this.createStateFilter(queryString, value)) : restaurants
       cb(results)
       if (results.length === 0) {
         this.productTypeNameOptions = []
@@ -684,6 +697,7 @@
       this.locacionName = ""
       await getLocationList({
         // keyword: "",
+        type:3,
         jointName: this.initialPosition ? this.initialPosition : null,
         productId: this.queryProductId ? this.queryProductId : null,
         productCategoryId: this.categoryId ? this.categoryId : null,

--
Gitblit v1.8.0