From 29b5ffe318b8ab32865ebebedd865ea2aa3f6c7e Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期三, 06 九月 2023 17:45:31 +0800
Subject: [PATCH] 供应商列表相关bug修复及样式调整

---
 src/views/supplierManage/supplier/AddNewProduct.vue |   69 ++++++++++++++++++----------------
 1 files changed, 37 insertions(+), 32 deletions(-)

diff --git a/src/views/supplierManage/supplier/AddNewProduct.vue b/src/views/supplierManage/supplier/AddNewProduct.vue
index 0478e65..d5e590c 100644
--- a/src/views/supplierManage/supplier/AddNewProduct.vue
+++ b/src/views/supplierManage/supplier/AddNewProduct.vue
@@ -14,6 +14,7 @@
         <div class="basic-info-title">浜у搧淇℃伅</div>
         <div class="basic-info-view">
           <CommonFormTableView
+            ref="productTable"
             :product-table-list="productTableList"
             :detail-enter="detailEnter"
             @inputContent="inputContent"
@@ -78,41 +79,45 @@
     },
     // 淇濆瓨
     saveClick() {
-      console.log(this.editConfig.infomation)
-      for (let i = 0; i < this.tableData.length; i++) {
-        if (this.tableData[i].name.length === 0) {
-          this.isNoProduct = true
-          break
-        } else {
-          this.isNoProduct = false
-        }
-      }
-      if (this.isNoProduct) {
-        this.$message.error("浜у搧鍚嶇О涓嶈兘涓虹┖")
-      } else {
-        if (this.editConfig.title === "娣诲姞") {
-          createProduct({
-            list: this.tableData
-          }).then((res) => {
-            console.log(res)
-            this.editConfig.visible = false
-            if (res.code === 200) {
-              this.$message.success("娣诲姞鎴愬姛")
-              this.$parent.getProductList()
+      this.$refs.productTable.$refs.form.validate((valid) => {
+        if (valid) {
+          console.log(this.editConfig.infomation)
+          for (let i = 0; i < this.tableData.length; i++) {
+            if (this.tableData[i].name.length === 0) {
+              this.isNoProduct = true
+              break
+            } else {
+              this.isNoProduct = false
             }
-          })
-        } else {
-          const params = this.saveParams()
-          updateProduct(params).then((res) => {
-            console.log(res)
-            this.editConfig.visible = false
-            if (res.code === 200) {
-              this.$message.success("缂栬緫鎴愬姛")
-              this.$parent.getProductList()
+          }
+          if (this.isNoProduct) {
+            this.$message.error("浜у搧鍚嶇О涓嶈兘涓虹┖")
+          } else {
+            if (this.editConfig.title === "娣诲姞") {
+              createProduct({
+                list: this.tableData
+              }).then((res) => {
+                console.log(res)
+                this.editConfig.visible = false
+                if (res.code === 200) {
+                  this.$message.success("娣诲姞鎴愬姛")
+                  this.$parent.getProductList()
+                }
+              })
+            } else {
+              const params = this.saveParams()
+              updateProduct(params).then((res) => {
+                console.log(res)
+                this.editConfig.visible = false
+                if (res.code === 200) {
+                  this.$message.success("缂栬緫鎴愬姛")
+                  this.$parent.getProductList()
+                }
+              })
             }
-          })
+          }
         }
-      }
+      })
     },
     saveParams() {
       let data = this.editConfig.infomation

--
Gitblit v1.8.0