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/salesOpportunity/index.vue |   45 +++++++++++++++++++++++++++++++--------------
 1 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/src/views/sales/salesOpportunity/index.vue b/src/views/sales/salesOpportunity/index.vue
index 27e9f19..eba3e09 100644
--- a/src/views/sales/salesOpportunity/index.vue
+++ b/src/views/sales/salesOpportunity/index.vue
@@ -27,6 +27,7 @@
 
 <script>
 import AddSalesOpportunityDialog from "@/views/sales/salesOpportunity/AddSalesOpportunityDialog"
+import { getSaleChanceList } from "@/api/sales/salesOpportunity"
 
 export default {
   name: "SalesOpportunity",
@@ -77,24 +78,12 @@
   },
   created() {
     this.setTable()
+    this.getData()
   },
   methods: {
     setTable() {
       this.tableList = {
-        tableInfomation: [
-          {
-            opportunityName: "123123",
-            customName: "涓婃捣閾冮摏",
-            salesOpportunityNo: "POT205",
-            contactName: "鍒樻��",
-            saleStage: "鍒濇湡娌熼��",
-            possible: "A绫诲鎴�",
-            expectDealDate: "50",
-            expectContractAmount: "2023-05-28",
-            budgetAbsoluteValue: "锟�200,000.00",
-            salesHead: "绯荤粺绠$悊鍛�"
-          }
-        ],
+        tableInfomation: [],
         tableColumn: [
           { label: "鏈轰細鍚嶇О", prop: "opportunityName", min: 120 }, // 鏈轰細鍚嶇О
           { label: "瀹㈡埛鍚嶇О", prop: "customName", min: 90 }, // 瀹㈡埛鍚嶇О
@@ -114,6 +103,34 @@
         this.searchOptions.push({ value: (i + 1).toString(), label: label })
       }
     },
+    // 璇锋眰鏁版嵁
+    async getData() {
+      this.loading = true
+      await getSaleChanceList()
+        .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