From bc9e5adf1032cb4ffeaefe98b324ec134137c29d Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期四, 28 九月 2023 15:13:01 +0800
Subject: [PATCH] feat: 收款单列表样式调整; 修复销售明细单列表高度不断增长的问题

---
 src/views/other/commonDialog/SelectCommonDialog.vue |   65 ++++++++++++++++++++++++++------
 1 files changed, 53 insertions(+), 12 deletions(-)

diff --git a/src/views/other/commonDialog/SelectCommonDialog.vue b/src/views/other/commonDialog/SelectCommonDialog.vue
index 27111a5..1225670 100644
--- a/src/views/other/commonDialog/SelectCommonDialog.vue
+++ b/src/views/other/commonDialog/SelectCommonDialog.vue
@@ -45,6 +45,7 @@
 import { getServiceContractList } from "@/api/serviceManage/serviceContract"
 import { getServiceOrderList } from "@/api/serviceManage/clientServiceOrder"
 import { getProductList } from "@/api/common/other"
+import { getSalesReturnList } from "@/api/sales/salesReturn"
 export default {
   name: "EditSelCommonDialog",
   props: {
@@ -134,9 +135,9 @@
             { label: "鏈嶅姟鍗曠紪鍙�", prop: "serviceNumber", isClick: true }, // 鏈嶅姟鍗曠紪鍙�
             { label: "涓婚", prop: "subject" }, // 涓婚
             { label: "鏈嶅姟鏂瑰紡", prop: "serviceType_name" }, // 鏈嶅姟鏂瑰紡
-            { label: "鏈嶅姟浜哄憳", prop: "serviceManId" }, // 鏈嶅姟浜哄憳
-            { label: "浼樺厛绾у埆", prop: "priorityLevelId" }, // 浼樺厛绾у埆
-            { label: "澶勭悊鐘舵��", prop: "status" }, // 澶勭悊鐘舵��
+            { label: "鏈嶅姟浜哄憳", prop: "serviceMan_name" }, // 鏈嶅姟浜哄憳
+            { label: "浼樺厛绾у埆", prop: "priorityLevel_name" }, // 浼樺厛绾у埆
+            { label: "澶勭悊鐘舵��", prop: "serviceOrderStatus_name" }, // 澶勭悊鐘舵��
             { label: "瀹㈡埛绛惧悕", prop: "qianming" } // 瀹㈡埛绛惧悕
           ]
         }
@@ -145,12 +146,22 @@
         this.tableList = {
           tableInfomation: [],
           tableColumn: [
-            { label: "浜у搧鍚嶇О", prop: "Name", isClick: true },
-            { label: "浜у搧缂栧彿", prop: "Number" },
-            { label: "瑙勬牸鍨嬪彿", prop: "MaterialMode" }
+            { label: "浜у搧鍚嶇О", prop: "name", isClick: true },
+            { label: "浜у搧缂栧彿", prop: "number" }
           ]
         }
-        this.searchSel = { value: "Name", label: "浜у搧鍚嶇О" }
+        this.searchSel = { value: "name", label: "浜у搧鍚嶇О" }
+      } else if (this.editConfig.title === "閿�鍞��璐у崟") {
+        this.tableList = {
+          tableInfomation: [],
+          tableColumn: [
+            { label: "閫�璐у崟缂栧彿", prop: "number", isClick: true },
+            { label: "閫�璐ф棩鏈�", prop: "returnDate" },
+            { label: "鐘舵��", prop: "salesReturnStatus_name" },
+            { label: "閫�鍏ヤ粨搴�", prop: "repository" }
+          ]
+        }
+        this.searchSel = { value: "number", label: "閿�鍞��璐у崟缂栧彿" }
       }
       this.searchOptions = []
       for (let i = 0; i < this.tableList.tableColumn.length; i++) {
@@ -174,6 +185,8 @@
         this.getServiceOrderList()
       } else if (this.editConfig.title === "浜у搧鍚嶇О") {
         this.getProductList()
+      } else if (this.editConfig.title === "閿�鍞��璐у崟") {
+        this.getSalesReturnList()
       }
     },
     // 閿�鍞�诲崟
@@ -282,14 +295,17 @@
         pageSize: 0
       }).then((res) => {
         if (res.code === 200) {
-          if (res.data.list && res.data.list.length > 0) {
-            const list = res.data.list.map((item) => {
+          if (res.data.data && res.data.data.length > 0) {
+            const list = res.data.data.map((item) => {
               return {
                 ...item,
                 client_name: item.Client.name,
                 serviceType_name: item.ServiceType.name,
                 faultType_name: item.FaultType.name,
-                serviceContract_Number: item.ServiceContract.number
+                serviceContract_Number: item.ServiceContract.number,
+                serviceMan_name: item.serviceMan.username,
+                priorityLevel_name: item.PriorityLevel.name,
+                serviceOrderStatus_name: item.ServiceOrderStatus_name
               }
             })
             this.tableList.tableInfomation = list.slice(0, 5) || []
@@ -303,8 +319,8 @@
     // 浜у搧鍚嶇О
     async getProductList() {
       await getProductList({
-        productName: "",
-        productNumber: "",
+        productName: this.keywordType === "浜у搧鍚嶇О" ? this.keyword : "",
+        productNumber: this.keywordType === "浜у搧缂栧彿" ? this.keyword : "",
         page: 1,
         pageSize: 5
       }).then((res) => {
@@ -314,6 +330,29 @@
             const list = res.data.data.data.map((item) => {
               return {
                 ...item
+              }
+            })
+            this.tableList.tableInfomation = list.slice(0, 5) || []
+          } else {
+            this.tableList.tableInfomation = []
+          }
+        }
+        this.loading = false
+      })
+    },
+    async getSalesReturnList() {
+      await getSalesReturnList({
+        keyword: this.keyword,
+        keywordType: this.keywordType,
+        page: 0,
+        pageSize: 0
+      }).then((res) => {
+        if (res.code === 200) {
+          if (res.data.list && res.data.list.length > 0) {
+            const list = res.data.list.map((item) => {
+              return {
+                ...item,
+                salesReturnStatus_name: item.SalesReturnStatus.name
               }
             })
             this.tableList.tableInfomation = list.slice(0, 5) || []
@@ -341,6 +380,8 @@
         this.$emit("selClient", row, "customService")
       } else if (this.editConfig.title === "浜у搧鍚嶇О") {
         this.$emit("selClient", row, "productName")
+      } else if (this.editConfig.title === "閿�鍞��璐у崟") {
+        this.$emit("selClient", row, "salesReturn")
       }
     },
     // 鎼滅储

--
Gitblit v1.8.0