From 0712b49e5538589dac4859ca8cebf196caa954ab Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期二, 21 十一月 2023 11:28:09 +0800
Subject: [PATCH] fix:供应商管理添加产品,产品列表展示修改及采购管理bug修改

---
 src/views/supplierManage/supplier/index.vue          |    8 ++
 src/views/supplierManage/supplier/DetailSupplier.vue |  102 +++++++++++++++++++++++++++++++--
 src/views/supplierManage/supplier/AddSupplier.vue    |    2 
 src/views/purchaseManage/purchase/index.vue          |   14 ++--
 src/components/makepager/CommonFormTableView.vue     |   10 +-
 src/views/purchaseManage/purchase/DetailSupplier.vue |   38 +++++++++---
 6 files changed, 141 insertions(+), 33 deletions(-)

diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index bb029e1..130b958 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -113,6 +113,7 @@
               :prop="'tableData.' + scope.$index + '.' + item.prop"
               :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]"
             >
+            <!-- 閲囪喘绠$悊 -->
               <template v-if="item.multiply">
                 <el-input-number
                   :disabled="item.disabled"
@@ -227,7 +228,8 @@
         title: "",
         infomation: {}
       },
-      productIndex: 0
+      productIndex: 0,
+      tableProductLists:[],
     }
   },
   created() {
@@ -251,6 +253,7 @@
         if (res.data.code === 200) {
           if (res.data.data.list && res.data.data.list.length > 0) {
             this.productList = res.data.data.list
+            this.tableProductLists = res.data.data.list
           }
         }
       })
@@ -350,8 +353,6 @@
       this.$emit("addProductClick")
     },
     commonInputChange(val, prop, row) {
-      console.log(val, prop)
-      console.log(row)
       this.$emit("inputContent", val, prop, row)
     },
     // 娓呯┖
@@ -360,7 +361,7 @@
     },
     // 閫夋嫨浜у搧鍚嶇О鐩稿叧鏂规硶
     querySearchAsync(queryString, cb) {
-      var restaurants = this.productTableList.tableProductList
+      var restaurants = this.tableProductLists
       var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants
       cb(results)
     },
@@ -371,7 +372,6 @@
     },
     handleSelectClient(item, prop, row) {
       // this.clientId = item.id
-      console.log(item, prop, row)
       this.tableList.tableData.map((ite) => {
         if (ite.name === item.name) {
           ite.ID = row.ID
diff --git a/src/views/purchaseManage/purchase/DetailSupplier.vue b/src/views/purchaseManage/purchase/DetailSupplier.vue
index b13839c..9c9fa16 100644
--- a/src/views/purchaseManage/purchase/DetailSupplier.vue
+++ b/src/views/purchaseManage/purchase/DetailSupplier.vue
@@ -121,6 +121,7 @@
                 ref="tableListRef"
                 :showSummary="showSummary"
                 :table-list="tableList"
+                @selTableCol="selTableCol"
               >
               </TableCommonView>
               <div class="table-bottom">
@@ -189,7 +190,18 @@
         mergeNumber: 5,
         totalName:'灏忚'
       },
+      showCol: ['浜у搧鍚嶇О', '浜у搧缂栫爜', '璁¢噺鍗曚綅', '瑙勬牸鍨嬪彿', '鏁伴噺', '閿�鍞崟浠�','浠风◣鍚堣','鎻忚堪'],
       purchaseStatusList:getDataByType('purchaseStatus'),
+      tableColumn: [
+        { label: "浜у搧鍚嶇О", prop: "name", min: 160,  },
+        { label: "浜у搧缂栫爜", prop: "number", min: 130, },
+        { label: "璁¢噺鍗曚綅", prop: "unit", min: 130 },
+        { label: "瑙勬牸鍨嬪彿", prop: "specifications", min: 130 },
+        { label: "鏁伴噺", prop: "amount", min: 130 },
+        { label: "閿�鍞崟浠�", prop: "price", min: 130 },
+        { label: "浠风◣鍚堣", prop: "total", min: 130 },
+        { label: "鎻忚堪", prop: "remark", min: 130 },
+      ],
     };
   },
   created() {
@@ -326,17 +338,23 @@
       this.tableList = {
         tableInfomation: item.productList?item.productList:[],
         selectIndex: true,
-        tableColumn: [
-          { label: "浜у搧鍚嶇О", prop: "name", min: 160,  },
-          { label: "浜у搧缂栫爜", prop: "number", min: 130, },
-          { label: "璁¢噺鍗曚綅", prop: "unit", min: 130 },
-          { label: "瑙勬牸鍨嬪彿", prop: "specifications", min: 130 },
-          { label: "鏁伴噺", prop: "amount", min: 130 },
-          { label: "閿�鍞崟浠�", prop: "price", min: 130 },
-          { label: "浠风◣鍚堣", prop: "total", min: 130 },
-          { label: "鎻忚堪", prop: "remark", min: 130 },
-        ],
+        showcol: this.showCol,
+        allcol:[],
+        tableColumn:this.setColumnVisible(this.showCol)
       };
+      this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label);
+    },
+    selTableCol(val) {
+      this.showcol = val;
+      this.tableList.tableColumn = this.setColumnVisible(val);
+    },
+    setColumnVisible(showCol){
+      return  this.tableColumn.map(ele=>{
+        return {
+          ...ele,
+          isShowColumn:showCol.includes(ele.label)
+        }
+      })
     },
     handleClose() {
       this.detailConfig.visible = false;
diff --git a/src/views/purchaseManage/purchase/index.vue b/src/views/purchaseManage/purchase/index.vue
index 7fda0cf..aab8d10 100644
--- a/src/views/purchaseManage/purchase/index.vue
+++ b/src/views/purchaseManage/purchase/index.vue
@@ -32,19 +32,19 @@
               </el-table-column>
               <el-table-column label="鎿嶄綔" width="220" fixed="right">
                 <template slot-scope="scope">
-                  <el-button type="text" size="small" @click="btnConfirm(scope.row)" style="margin-right: 5px"
+                  <el-button v-if="scope.row.status===1" type="text" size="small" @click="btnConfirm(scope.row)" style="margin-right: 5px"
                   >纭</el-button
                   >
-                  <el-button type="text" size="small" @click="btnEdit(scope.row)" style="margin-right: 5px"
+                  <el-button v-if="scope.row.status===1" type="text" size="small" @click="btnEdit(scope.row)" style="margin-right: 5px"
                   >缂栬緫</el-button
                   >
                   <el-button type="text" size="small" @click="btnLook(scope.row)" style="margin-right: 5px"
                   >鏌ョ湅</el-button
                   >
-                  <el-button type="text" size="small" @click="btnCancel(scope.row)" style="margin-right: 5px"
+                  <el-button v-if="scope.row.status===1" type="text" size="small" @click="btnCancel(scope.row)" style="margin-right: 5px"
                   >鍙栨秷</el-button
                   >
-                  <el-button type="text" size="small" @click="btnDelete(scope.row)" style="margin-right: 5px"
+                  <el-button v-if="scope.row.status===1" type="text" size="small" @click="btnDelete(scope.row)" style="margin-right: 5px"
                   >鍒犻櫎</el-button
                   >
                   <!-- <el-button v-if="scope.row.status< 4" @click="submitClick(scope.row)" type="text" size="small">鎻愪氦</el-button> -->
@@ -101,16 +101,16 @@
         }
       },
       tableColumn: [
+        { label: "鍗曟嵁绫诲瀷", prop: "orderType", min: 130 },
         { label: "閲囪喘鍗曞彿", prop: "number", min: 150, isCommonClick: true ,default:true},
         { label: "閲囪喘鍗曞悕绉�", prop: "name", min: 130, isCommonClick: true },
-        { label: "鍗曟嵁绫诲瀷", prop: "orderType", min: 130 },
         { label: "渚涘簲鍟嗗悕绉�", prop: "supplierName", min: 130 },
         { label: "閲囪喘鏁伴噺", prop: "quantity", min: 130 },
         { label: "鏀惰揣浠撳簱", prop: "warehouse", min: 130 },
         { label: "缁忓姙浜�", prop: "handledBy", min: 130 },
         { label: "鍒跺崟浜�", prop: "creator", min: 130 }
       ],
-      showCol: ['閲囪喘鍗曞彿', '閲囪喘鍗曞悕绉�', '鍗曟嵁绫诲瀷', '渚涘簲鍟嗗悕绉�', '閲囪喘鏁伴噺', '鏀惰揣浠撳簱']
+      showCol: ['閲囪喘鍗曞彿', '閲囪喘鍗曞悕绉�', '鍗曟嵁绫诲瀷', '渚涘簲鍟嗗悕绉�', '閲囪喘鏁伴噺', '鏀惰揣浠撳簱','缁忓姙浜�','鍒跺崟浜�']
     }
   },
   created() {
@@ -336,10 +336,10 @@
     },
     // 璇︽儏
     selCommonClick(row) {
-      console.log(row)
       this.tableLoading = true
       getPurchaseInfo({ id: row.ID }).then((res) => {
         if (res.code == 200) {
+          console.log(res,"浜у搧璇︽儏")
           this.tableLoading = false
           this.commonDetail.visible = true
           this.commonDetail.infomation = {
diff --git a/src/views/supplierManage/supplier/AddSupplier.vue b/src/views/supplierManage/supplier/AddSupplier.vue
index 24608fe..9e9b3a4 100644
--- a/src/views/supplierManage/supplier/AddSupplier.vue
+++ b/src/views/supplierManage/supplier/AddSupplier.vue
@@ -363,7 +363,7 @@
         name: data.name || "",
         number: data.number || "",
         phone: data.phone || "",
-        responsiblePersonName: data.responsiblePersonName || "",
+        responsiblePersonName: data.responsiblePersonName || "admin",
         status: data.status || 0,
         supplierType: data.supplierType || "",
         url: data.url || ""
diff --git a/src/views/supplierManage/supplier/DetailSupplier.vue b/src/views/supplierManage/supplier/DetailSupplier.vue
index 509d4ca..c2765a1 100644
--- a/src/views/supplierManage/supplier/DetailSupplier.vue
+++ b/src/views/supplierManage/supplier/DetailSupplier.vue
@@ -72,12 +72,26 @@
             </div>
           </div>
         </div>
-        <div v-if="activeName === 'second'" class="second">
-          <!-- <FollowupRecords
-            :isDetail="true"
-            :follow-record="detailConfig.infomation.FollowRecord"
-            :add-config="addConfig"
-          /> -->
+        <div v-if="activeName === 'second'" class="detail">
+          <!-- 閲囪喘璁㈠崟-鍩烘湰淇℃伅 -->
+          <!-- 浜у搧淇℃伅 -->
+          <div class="basic-info">
+            <div class="basic-info-label" @click="expandClick('basic')">
+              <i v-if="isBasicExpand" class="el-icon-arrow-down"></i>
+              <i v-else class="el-icon-arrow-up"></i>
+              <span style="margin-left: 10px">浜у搧淇℃伅</span>
+            </div>
+            <div v-show="isBasicExpand" class="basic-info-content">
+              <TableCommonView
+                style="margin-top: 2px"
+                class="content-table"
+                ref="tableListRef"
+                :table-list="tableList"
+                @selTableCol="selTableCol"
+              >
+              </TableCommonView>
+            </div>
+          </div>
         </div>
       </div>
     </el-drawer>
@@ -93,7 +107,8 @@
       default: () => {
         return {
           visible: false,
-          infomation: {}
+          infomation: {},
+          productListInfo:[]
         }
       }
     }
@@ -111,10 +126,23 @@
       addConfig: {},
       record: "", // 鏈�鏂拌繘灞�
       noContactDays: 0,
-      newContactDays: ""
+      newContactDays: "",
+      tableList:{},
+      showCol: ['浜у搧鍚嶇О', '浜у搧缂栫爜', '璁¢噺鍗曚綅', '瑙勬牸鍨嬪彿', '鏁伴噺', '閿�鍞崟浠�','浠风◣鍚堣','鎻忚堪'],
+      tableColumn: [
+        { label: "浜у搧鍚嶇О", prop: "name", min: 160,  },
+        { label: "浜у搧缂栫爜", prop: "number", min: 130, },
+        { label: "璁¢噺鍗曚綅", prop: "unit", min: 130 },
+        { label: "瑙勬牸鍨嬪彿", prop: "specifications", min: 130 },
+        { label: "鏁伴噺", prop: "amount", min: 130 },
+        { label: "閿�鍞崟浠�", prop: "price", min: 130 },
+        { label: "浠风◣鍚堣", prop: "total", min: 130 },
+        { label: "鎻忚堪", prop: "remark", min: 130 },
+      ],
     }
   },
   created() {
+    console.log(this.detailConfig,"鎶藉眽缁勪欢")
     this.setData(this.detailConfig.infomation)
     this.addConfig = {
       id_name: "sales_leads_id",
@@ -166,6 +194,44 @@
           rightValue: ""
         }
       ]
+      this.purchaseList = [
+        {
+          leftStr: "閲囪喘鍗曞彿",
+          leftValue: item.number,
+          rightStr: "閲囪喘鍗曞悕绉�",
+          rightValue: item.name
+        },
+        {
+          leftStr: "渚涘簲鍟嗙被鍨�",
+          leftValue: item.supplierType,
+          rightStr: "鎵�灞炶涓�",
+          rightValue: item.industry
+        },
+        {
+          leftStr: "鍗曟嵁绫诲瀷",
+          leftValue: item.contact,
+          rightStr: "渚涘簲鍟嗗悕绉�",
+          rightValue: item.phone
+        },
+        {
+          leftStr: "閲囪喘鏁伴噺",
+          leftValue: item.responsiblePersonName,
+          rightStr: "鏀惰揣浠撳簱",
+          rightValue: item.url
+        },
+        {
+          leftStr: "缁忓姙浜�",
+          leftValue: item.email,
+          rightStr: "鍒跺崟浜�",
+          rightValue: ""
+        },
+        {
+          leftStr: "鐘舵��",
+          leftValue: item.email,
+          rightStr: "",
+          rightValue: ""
+        },
+      ]
       this.dynamicInfoList = [
         {
           leftStr: "鎴峰悕",
@@ -180,6 +246,26 @@
           rightValue: ""
         }
       ]
+      this.tableList = {
+        tableInfomation: this.detailConfig.productListInfo?this.detailConfig.productListInfo:[],
+        selectIndex: true,
+        showcol: this.showCol,
+        allcol:[],
+        tableColumn:this.setColumnVisible(this.showCol),
+      };
+      this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label);
+    },
+    selTableCol(val) {
+      this.showcol = val;
+      this.tableList.tableColumn = this.setColumnVisible(val);
+    },
+    setColumnVisible(showCol){
+      return  this.tableColumn.map(ele=>{
+        return {
+          ...ele,
+          isShowColumn:showCol.includes(ele.label)
+        }
+      })
     },
     handleClose() {
       this.detailConfig.visible = false
diff --git a/src/views/supplierManage/supplier/index.vue b/src/views/supplierManage/supplier/index.vue
index 8383a57..43ed6f4 100644
--- a/src/views/supplierManage/supplier/index.vue
+++ b/src/views/supplierManage/supplier/index.vue
@@ -119,6 +119,7 @@
 <script>
 import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
 import { getSupplierList, changeSupplierStatus } from "@/api/supplierManage/supplier"
+import {getPurchaseList} from "@/api/purchaseManage/purchase"
 import DetailSupplier from "@/views/supplierManage/supplier/DetailSupplier"
 import AddSupplier from "@/views/supplierManage/supplier/AddSupplier"
 import RaleteSupplierList from "@/views/supplierManage/supplier/RaleteSupplierList"
@@ -142,7 +143,8 @@
       searchProductOptions: [], // 浜у搧鏌ヨ
       commonDetail: {
         visible: false,
-        infomation: {}
+        infomation: {},
+        productListInfo:[]
       },
       editConfig: {
         visible: false,
@@ -422,7 +424,9 @@
     },
     // 璇︽儏
     selCommonClick(row) {
-      console.log(row)
+      getPurchaseList({pageSize:10,page:1,supplierId:row.ID}).then((res)=>{
+        this.commonDetail.productListInfo=res.data.data.list
+      })
       this.commonDetail.visible = true
       this.commonDetail.infomation = { ...row }
     },

--
Gitblit v1.8.0