From ee71c2a66079c43fbaf9b23d2d2f73427d4dd76c Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期二, 12 三月 2024 14:24:49 +0800
Subject: [PATCH] 采购订单公共组件修改和收货信息状态、收货状态必填、添加产品改为多选

---
 src/views/supplierManage/supplier/index.vue |   37 +++++++++++++++++++++----------------
 1 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/src/views/supplierManage/supplier/index.vue b/src/views/supplierManage/supplier/index.vue
index 8383a57..5a2ed24 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,
@@ -282,7 +284,7 @@
           const list = res.data.list.map((item) => {
             return {
               ...item,
-              id: item.ID,
+              id: item.id,
               status_name: item.status === 0 ? "鏈惎鐢�" : "鍚敤"
             }
           })
@@ -290,7 +292,7 @@
           this.tableList.tableInfomation = list || []
           this.pagerOptions.totalCount = res.data.total
           if (list && list.length > 0) {
-            this.supplierId = this.tableList.tableInfomation[0].ID
+            this.supplierId = this.tableList.tableInfomation[0].id
             this.selectRow = this.tableList.tableInfomation.length > 0 ? this.tableList.tableInfomation[0] : {}
           } else {
             this.supplierId = 0
@@ -321,14 +323,13 @@
         page: this.productPagerOptions.currPage,
         pageSize: this.productPagerOptions.pageSize
       }).then((res) => {
-        console.log(res.data)
-        const list = res.data.data.list.map((item) => {
+        let list = res.data.list.map((item) => {
           return {
             ...item
           }
         })
         this.productTableList.tableInfomation = list || []
-        this.productPagerOptions.totalCount = res.data.data.total
+        this.productPagerOptions.totalCount = res.data.total
       })
     },
     // 鎼滅储渚涘簲鍟�
@@ -346,13 +347,16 @@
     addBtnClick() {
       this.editConfig.visible = true
       this.editConfig.title = "鏂板缓"
-      this.editConfig.infomation = { fileId: 0 }
+      this.editConfig.infomation = {
+        fileId: 0,
+        responsiblePersonName: document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1")
+      }
     },
     // 鍚敤渚涘簲鍟�
     async enableClick(row, value) {
       let status = value === "鍚敤" ? 1 : 0
       await changeSupplierStatus({
-        id: row.ID,
+        id:Number(row.id),
         status: status
       }).then((res) => {
         if (res.code === 200) {
@@ -381,7 +385,6 @@
     },
     // 淇敼浜у搧
     editClick(row) {
-      console.log(row)
       this.newProductConfig.visible = true
       this.newProductConfig.title = "淇敼"
       this.newProductConfig.infomation = { ...row }
@@ -394,7 +397,7 @@
         type: "warning"
       })
         .then(() => {
-          deleteProduct({ id: row.ID }).then((response) => {
+          deleteProduct({ id: row.id }).then((response) => {
             if (response.code === 200) {
               this.$message.success("鍒犻櫎鎴愬姛")
               this.getProductList()
@@ -414,15 +417,16 @@
       this.selValueList = list
     },
     tableRowClick(row) {
-      console.log(row)
       this.productPagerOptions.currPage = 1
       this.selectRow = row
-      this.supplierId = row.ID
+      this.supplierId = row.id
       this.getProductList()
     },
     // 璇︽儏
-    selCommonClick(row) {
-      console.log(row)
+    async selCommonClick(row) {
+      await getPurchaseList({ pageSize: 10, page: 1, supplierId: Number(row.id) }).then((res) => {
+        this.commonDetail.productListInfo = res.data.list
+      })
       this.commonDetail.visible = true
       this.commonDetail.infomation = { ...row }
     },
@@ -439,9 +443,10 @@
     // 鍒涘缓閲囪喘鍗�
     creatPurchase() {
       this.editPurchaseConfig.visible = true
-      this.editPurchaseConfig.title = "鍒涘缓"
+      this.editPurchaseConfig.title = "鏂板缓"
       this.editPurchaseConfig.infomation = {
-        supplierId: this.selectRow.ID,
+        supplierId: this.selectRow.id,
+        purchaseTypeId:"2",
         supplierName: this.selectRow.name
       }
     }

--
Gitblit v1.8.0