From 6e84763437df97e194f8c833feca8bdcb90e7103 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期一, 28 八月 2023 14:48:49 +0800
Subject: [PATCH] 产品相关接口联调

---
 src/views/supplierManage/supplier/index.vue |   75 ++++++++++++++++++++++++++-----------
 1 files changed, 52 insertions(+), 23 deletions(-)

diff --git a/src/views/supplierManage/supplier/index.vue b/src/views/supplierManage/supplier/index.vue
index 1d45a91..c192460 100644
--- a/src/views/supplierManage/supplier/index.vue
+++ b/src/views/supplierManage/supplier/index.vue
@@ -13,28 +13,49 @@
         </div>
       </div>
       <template>
-        <TableCommonView
-          ref="tableListRef"
-          :table-list="tableList"
-          @selCommonClick="selCommonClick"
-          @tableRowClick="tableRowClick"
+        <el-table
+          ref="tableSupplier"
+          border
+          :data="tableList.tableInfomation"
+          tooltip-effect="dark"
+          style="width: 100%"
+          :lazy="tableList.lazy"
+          highlight-current-row
+          @row-click="tableRowClick"
+          :header-cell-style="{ background: '#ECF4FF', color: '#666' }"
         >
-          <template slot="tableButton">
-            <el-table-column label="鎿嶄綔" width="120">
-              <template slot-scope="scope">
-                <el-button
-                  v-if="scope.row.status === 0"
-                  @click="enableClick(scope.row, '鍚敤')"
-                  type="text"
-                  size="small"
-                  >鍚敤</el-button
-                >
-                <el-button v-else @click="enableClick(scope.row, '鍋滅敤')" type="text" size="small">鍋滅敤</el-button>
-                <el-button @click="modifyClick(scope.row)" type="text" size="small">淇敼</el-button>
-              </template>
-            </el-table-column>
-          </template>
-        </TableCommonView>
+          <el-table-column type="index" label="搴忓彿" width="50"> </el-table-column>
+          <el-table-column
+            v-for="(item, i) in tableList.tableColumn"
+            :key="i"
+            :prop="item.prop"
+            :label="item.label"
+            :width="item.width"
+            :min-width="item.min"
+            show-overflow-tooltip
+            :sortable="item.sortable"
+          >
+            <template slot-scope="scope">
+              <div v-if="item.status" :class="scope.row.status">{{ scope.row[item.prop] }}</div>
+              <span
+                v-else-if="item.isCommonClick && scope.row[item.prop]"
+                class="sel-name"
+                @click="selCommonClick(scope.row)"
+                >{{ scope.row[item.prop] }}</span
+              >
+              <span v-else>{{ scope.row[item.prop] ? scope.row[item.prop] : "--" }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="鎿嶄綔" width="100">
+            <template slot-scope="scope">
+              <el-button v-if="scope.row.status === 0" @click="enableClick(scope.row, '鍚敤')" type="text" size="small"
+                >鍚敤</el-button
+              >
+              <el-button v-else @click="enableClick(scope.row, '鍋滅敤')" type="text" size="small">鍋滅敤</el-button>
+              <el-button @click="modifyClick(scope.row)" type="text" size="small">淇敼</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
         <div class="btn-pager">
           <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
         </div>
@@ -215,6 +236,9 @@
           } else {
             this.supplierId = 0
           }
+          this.$nextTick(() => {
+            this.$refs.tableSupplier.setCurrentRow(this.tableList.tableInfomation[0])
+          })
           this.getProductList()
         }
       })
@@ -274,7 +298,6 @@
     },
     // 淇敼渚涘簲鍟�
     modifyClick(row) {
-      console.log(row)
       this.editConfig.visible = true
       this.editConfig.title = "淇敼"
       this.editConfig.infomation = { ...row }
@@ -289,12 +312,14 @@
     addNewProductClick() {
       this.newProductConfig.visible = true
       this.newProductConfig.title = "娣诲姞"
+      this.newProductConfig.infomation = { supplierId: this.supplierId }
     },
     // 淇敼浜у搧
     editClick(row) {
       console.log(row)
       this.newProductConfig.visible = true
-      // this.newProductConfig.title = "淇敼"
+      this.newProductConfig.title = "淇敼"
+      this.newProductConfig.infomation = { ...row }
     },
     // 鍒犻櫎
     delClick(row) {
@@ -352,6 +377,10 @@
         margin-right: 20px;
       }
     }
+    .sel-name {
+      color: $color-primary;
+      cursor: pointer;
+    }
     .btn-pager {
       display: flex;
       .page {

--
Gitblit v1.8.0