From 22d4441a8c669185c13d2b6856c51ad550c50ae2 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期五, 14 七月 2023 18:26:47 +0800
Subject: [PATCH] 编辑下拉框&网络请求封装优化

---
 src/views/custom/salesLead/index.vue |   55 ++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 36 insertions(+), 19 deletions(-)

diff --git a/src/views/custom/salesLead/index.vue b/src/views/custom/salesLead/index.vue
index 55d909a..4046807 100644
--- a/src/views/custom/salesLead/index.vue
+++ b/src/views/custom/salesLead/index.vue
@@ -18,18 +18,23 @@
     </TableCommonView>
     <!-- 鏂板缓/缂栬緫閿�鍞嚎绱� -->
     <AddSalesLeadDialog v-if="editSalesLeadConfig.visible" :edit-sales-lead-config="editSalesLeadConfig" />
+    <!-- 瀵煎叆鏂囦欢 -->
+    <ImportFileDialog v-if="importConfig.visible" :import-file-config="importConfig" />
   </div>
 </template>
 
 <script>
 import AddSalesLeadDialog from "@/views/custom/salesLead/AddSalesLeadDialog"
 import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
+import ImportFileDialog from "@/views/other/commonDialog/ImportFileDialog"
+import { getSalesLeadsList } from "@/api/custom/salesLead"
 
 export default {
   name: "SalesLead",
   props: {},
   components: {
-    AddSalesLeadDialog
+    AddSalesLeadDialog,
+    ImportFileDialog
   },
   mixins: [pageMixin],
   computed: {},
@@ -57,6 +62,11 @@
         visible: false,
         title: "鏂板缓",
         infomation: {}
+      },
+      importConfig: {
+        visible: false,
+        title: "鏂板缓",
+        infomation: {}
       }
     }
   },
@@ -67,24 +77,13 @@
   methods: {
     setTable() {
       this.tableList = {
-        tableInfomation: [
-          {
-            customName: "涓婃捣閫氱敤鏈烘鏈夐檺鍏徃",
-            saleLeadNumber: "LEA110",
-            contactName: "钁e浼�",
-            phoneNumber: "15988887777",
-            businessSource: "鏈嬪弸浠嬬粛",
-            province: "姹熻嫃鐪�",
-            city: "杩炰簯娓競",
-            owner: "閿�鍞�荤洃"
-          }
-        ],
+        tableInfomation: [],
         tableColumn: [
-          { label: "瀹㈡埛鍚嶇О", prop: "customName", min: 190 }, // 瀹㈡埛鍚嶇О
-          { label: "閿�鍞嚎绱㈢紪鍙�", prop: "saleLeadNumber", min: 190 }, // 閿�鍞嚎绱㈢紪鍙�
-          { label: "鑱旂郴浜哄鍚�", prop: "contactName", min: 190 }, // 鑱旂郴浜哄鍚�
-          { label: "鎵嬫満鍙风爜", prop: "phoneNumber", min: 190 }, // 鎵嬫満鍙风爜
-          { label: "鍟嗘満鏉ユ簮", prop: "businessSource", min: 190 }, // 鍟嗘満鏉ユ簮
+          { label: "瀹㈡埛鍚嶇О", prop: "name", min: 190 }, // 瀹㈡埛鍚嶇О
+          { label: "閿�鍞嚎绱㈢紪鍙�", prop: "number", min: 190 }, // 閿�鍞嚎绱㈢紪鍙�
+          { label: "鑱旂郴浜哄鍚�", prop: "contact_name", min: 190 }, // 鑱旂郴浜哄鍚�
+          { label: "鎵嬫満鍙风爜", prop: "contact_phone", min: 190 }, // 鎵嬫満鍙风爜
+          { label: "鍟嗘満鏉ユ簮", prop: "sales_sources_id", min: 190 }, // 鍟嗘満鏉ユ簮
           { label: "鐪佷唤", prop: "province", min: 190 }, // 鐪佷唤
           { label: "鍩庡競", prop: "city", min: 190 }, // 鍩庡競
           { label: "璐熻矗浜�", prop: "owner", min: 190 } // 璐熻矗浜�
@@ -97,7 +96,20 @@
       }
     },
     // 璇锋眰鏁版嵁
-    async getData() {},
+    async getData() {
+      await getSalesLeadsList()
+        .then((res) => {
+          console.log(res)
+          this.tableList.tableInfomation = res.data.tableList.map((item) => {
+            item.province = item.Province.name
+            item.city = item.City.name
+            return item
+          })
+        })
+        .catch((err) => {
+          console.log(err)
+        })
+    },
     // 鏂板缓
     addBtnClick() {
       this.editSalesLeadConfig.visible = true
@@ -142,6 +154,11 @@
         region: "1",
         address: ""
       }
+    },
+    // 瀵煎叆
+    importClitk() {
+      this.importConfig.visible = true
+      this.importConfig.title = "閿�鍞嚎绱�"
     }
   }
 }

--
Gitblit v1.8.0