Pārlūkot izejas kodu

产品分类名字展示

yangzm123 10 mēneši atpakaļ
vecāks
revīzija
cdb2c454a5
1 mainītis faili ar 10 papildinājumiem un 8 dzēšanām
  1. 10 8
      src/pages/affairs/transaction.vue

+ 10 - 8
src/pages/affairs/transaction.vue

@@ -1,8 +1,8 @@
 <!--
  * @Author: PoJun
  * @Date: 2023-10-13 10:35:43
- * @LastEditors: XuanJi
- * @LastEditTime: 2024-05-08 21:14:46
+ * @LastEditors: PoJun
+ * @LastEditTime: 2024-05-08 21:24:59
  * @Message: 事务处理中心
 -->
 <template>
@@ -38,7 +38,11 @@
                         <common-card-item label="联系方式" :text="detailItem?.data.phone" :span="24"></common-card-item>
                         <common-card-item label="地址" :text="detailItem?.data.address" :span="24"></common-card-item>
                         <common-card-item label="企业简介" :text="detailItem?.data.intro" :span="24"></common-card-item>
-                        <common-card-item label="产品" :text="productName" :span="24"></common-card-item>
+                        <common-card-item
+                            label="产品分类"
+                            :text="detailItem?.productName"
+                            :span="24"
+                        ></common-card-item>
                         <common-card-item
                             label="优势产品"
                             :text="detailItem?.data.superiorProduct"
@@ -136,7 +140,6 @@ export default {
             showModal: false,
             detailItem: null,
             currentKey: "todo",
-            productName: "",
         };
     },
     created() {},
@@ -176,12 +179,12 @@ export default {
 
         async getProductName(idArray) {
             try {
-                // console.log(idArray);
-                const data = await getProductsInfoFromIds({ ids: idArray.join(",") });
+                const data = await getProductsInfoFromIds({ ids: idArray.join(",") });
                 const productName = data.map(item => {
                     return item.name;
                 });
-                this.productName = productName.join(",");
+
+                this.$set(this.detailItem, "productName", productName.join(","));
             } catch (error) {
                 console.log(error);
             }
@@ -192,7 +195,6 @@ export default {
             handler: function (val) {
                 if (!val) {
                     this.detailItem = null;
-                    this.productName = "";
                 }
             },
         },