From efe51c2947c76ee863593c2ecfe3a2e65b3e742f Mon Sep 17 00:00:00 2001
From: Mr.Zhang <710666463@qq.com>
Date: 星期二, 24 十月 2023 09:11:02 +0800
Subject: [PATCH] 企业端

---
 company_admin/src/components/business/selectProductItem.vue |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/company_admin/src/components/business/selectProductItem.vue b/company_admin/src/components/business/selectProductItem.vue
index 88d80be..3aa2a57 100644
--- a/company_admin/src/components/business/selectProductItem.vue
+++ b/company_admin/src/components/business/selectProductItem.vue
@@ -135,8 +135,11 @@
         handleSelectionChange(e) {
             let arr = []
             e.forEach(item => {
-                arr.push({ goodsId: item.id, price: item.purchasePrice })
+                arr.push({ id: item.id })
             })
+            // e.forEach(item => {
+            //     arr.push({ goodsId: item.id, price: item.purchasePrice })
+            // })
             this.form.goodsParamList = arr
             console.log(arr)
         },
@@ -145,16 +148,24 @@
                 this.$message.warning({ message: '璇峰厛鍕鹃�夊晢鍝�' })
                 return
             }
+            let goodsParamList = []
+            this.form.goodsParamList.forEach(item => {
+                this.tableData.forEach(child => {
+                    if (item.id === child.id) {
+                        goodsParamList.push({ goodsId: child.id, price: child.purchasePrice })
+                    }
+                })
+            })
             // 璋冪敤鏂板缓鎺ュ彛
             this.isWorking = true
             createPlat({
                 categoryId: this.form.categoryId1,
-                goodsParamList: this.form.goodsParamList,
+                goodsParamList,
                 rate: this.form.rate,
                 type: this.form.type
             }).then(res => {
                 this.visible = false
-                this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
+                this.$tip.apiSuccess(res)
                 // this.$emit('success')
                 this.$emit('result')
             })
@@ -173,6 +184,7 @@
         open(title, target) {
             this.title = title
             this.visible = true
+            this.form.name = ''
             this.form.categoryId = Number(target.categoryId.split(',')[0])
             this.form.categoryId1 = Number(target.categoryId.split(',')[1])
             this.form.rate = Number(target.rate)

--
Gitblit v1.9.3