From 4898b385886794bf0663ec2d883ea808b78ae522 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期三, 19 七月 2023 11:37:25 +0800
Subject: [PATCH] 接口联调相关api添加

---
 src/views/sales/salesReturn/index.vue |   44 +++++++++++++++++++++++++++++++-------------
 1 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/src/views/sales/salesReturn/index.vue b/src/views/sales/salesReturn/index.vue
index f0fa6f1..16f1078 100644
--- a/src/views/sales/salesReturn/index.vue
+++ b/src/views/sales/salesReturn/index.vue
@@ -21,6 +21,7 @@
 
 <script>
 import AddSalesReturnDialog from "@/views/sales/salesReturn/AddSalesReturnDialog"
+import { getSalesReturnList } from "@/api/sales/salesReturn"
 
 export default {
   name: "SalesReturn",
@@ -63,23 +64,12 @@
   },
   created() {
     this.setTable()
+    this.getData()
   },
   methods: {
     setTable() {
       this.tableList = {
-        tableInfomation: [
-          {
-            salesReturnOrderNo: "THD20230607-44",
-            customName: "娆у厠绉戞妧鑲′唤鏈夐檺鍏徃",
-            returnDate: "2023-06-07",
-            state: "鏈叆搴�",
-            returnWarehouse: "鎬讳粨",
-            refundabe: "锟�9,499.00",
-            refunded: "锟�1,499.00",
-            salesHead: "绯荤粺绠$悊鍛�",
-            modifyTime: "2023-06-07 11:10:25"
-          }
-        ],
+        tableInfomation: [],
         tableColumn: [
           { label: "閿�鍞��璐у崟缂栧彿", prop: "salesReturnOrderNo", min: 120 },
           { label: "瀹㈡埛鍚嶇О", prop: "customName", min: 90 },
@@ -98,6 +88,34 @@
         this.searchOptions.push({ value: (i + 1).toString(), label: label })
       }
     },
+    // 璇锋眰鏁版嵁
+    async getData() {
+      this.loading = true
+      await getSalesReturnList()
+        .then((res) => {
+          console.log(res)
+          if (res.code === 200) {
+            if (res.data.list && res.data.list.length > 0) {
+              const list = res.data.list.map((item) => {
+                return {
+                  ...item
+                }
+              })
+              this.tableList.tableInfomation = list || []
+            } else {
+              this.tableList.tableInfomation = []
+            }
+          } else {
+            this.tableList.tableInfomation = []
+          }
+          this.loading = false
+        })
+        .catch((err) => {
+          console.log(err)
+          this.tableList.tableInfomation = []
+          this.loading = false
+        })
+    },
     // 鏂板缓
     addBtnClick() {
       this.editConfig.visible = true

--
Gitblit v1.8.0