From 23d80c1b64f23ede237ab8e89ebc2ee2aaf43f26 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期三, 19 七月 2023 19:32:10 +0800
Subject: [PATCH] 销售模块接口联调

---
 src/views/service/serviceContract/index.vue |  141 +++++++++++++++++++++-------------------------
 1 files changed, 65 insertions(+), 76 deletions(-)

diff --git a/src/views/service/serviceContract/index.vue b/src/views/service/serviceContract/index.vue
index 03d7e7c..51767b5 100644
--- a/src/views/service/serviceContract/index.vue
+++ b/src/views/service/serviceContract/index.vue
@@ -1,5 +1,5 @@
 <template>
-  <div class="sales-lead">
+  <div class="service-contract">
     <SearchCommonView ref="searchCommonView" :query-class-options="queryClassOptions" :search-options="searchOptions" />
     <div class="btn-pager">
       <PublicFunctionBtnView :submit-approval="true" :operates-list="operatesList" />
@@ -14,26 +14,19 @@
         </el-table-column>
       </template>
     </TableCommonView>
-    <!-- 鏂板缓/缂栬緫閿�鍞嚎绱� -->
+    <!-- 鏂板缓/缂栬緫 -->
     <AddServiceContractDialog v-if="editConfig.visible" :edit-common-config="editConfig" />
   </div>
 </template>
 
 <script>
-import SearchCommonView from "@/components/makepager/SearchCommonView"
-import PublicFunctionBtnView from "@/components/makepager/PublicFunctionBtnView"
-import PagerView from "@/components/makepager/PagerView"
-import TableCommonView from "@/components/makepager/TableCommonView"
 import AddServiceContractDialog from "@/views/service/serviceContract/AddServiceContractDialog"
+import { getServiceContractList } from "@/api/serviceManage/serviceContract"
 
 export default {
-  name: "SalesLead",
+  name: "ServiceContract",
   props: {},
   components: {
-    SearchCommonView,
-    PublicFunctionBtnView,
-    PagerView,
-    TableCommonView,
     AddServiceContractDialog
   },
   computed: {
@@ -72,34 +65,22 @@
   },
   created() {
     this.setTable()
+    this.getData()
   },
   methods: {
     setTable() {
       this.tableList = {
-        tableInfomation: [
-          {
-            serviceContractNumber: "FWHT20230703123",
-            customName: "涓婃捣閾冮摏淇℃伅绉戞妧鏈夐檺鍏徃",
-            signDate: "2023-06-26",
-            contractType: "鎸夊勾",
-            contractStatus: "宸插垱寤�",
-            owner: "Boss",
-            productName: "杞欢",
-            startDate: "2023-06-26",
-            endDate: "2024-06-25",
-            priceTax: "楼5,000.00"
-          }
-        ],
+        tableInfomation: [],
         tableColumn: [
-          { label: "鏈嶅姟鍚堝悓缂栧彿", prop: "serviceContractNumber", min: 100 }, // 鏈嶅姟鍚堝悓缂栧彿
-          { label: "瀹㈡埛鍚嶇О", prop: "customName", min: 120 }, // 瀹㈡埛鍚嶇О
-          { label: "绛剧害鏃ユ湡", prop: "signDate" }, // 绛剧害鏃ユ湡
-          { label: "鍚堝悓绫诲瀷", prop: "contractType" }, // 鍚堝悓绫诲瀷
-          { label: "鍚堝悓鐘舵��", prop: "contractStatus" }, // 鍚堝悓鐘舵��
-          { label: "璐熻矗浜�", prop: "owner" }, // 璐熻矗浜�
+          { label: "鏈嶅姟鍚堝悓缂栧彿", prop: "number", min: 100 }, // 鏈嶅姟鍚堝悓缂栧彿
+          { label: "瀹㈡埛鍚嶇О", prop: "clientId", min: 120 }, // 瀹㈡埛鍚嶇О
+          { label: "绛剧害鏃ユ湡", prop: "signTime" }, // 绛剧害鏃ユ湡
+          { label: "鍚堝悓绫诲瀷", prop: "typeId" }, // 鍚堝悓绫诲瀷
+          { label: "鍚堝悓鐘舵��", prop: "statusId" }, // 鍚堝悓鐘舵��
+          { label: "璐熻矗浜�", prop: "memberId" }, // 璐熻矗浜�
           { label: "浜у搧鍚嶇О", prop: "productName" }, // 浜у搧鍚嶇О
-          { label: "鏈嶅姟寮�濮嬫棩", prop: "startDate" }, // 鏈嶅姟寮�濮嬫棩
-          { label: "鏈嶅姟鍒版湡鏃�", prop: "endDate" }, // 鏈嶅姟鍒版湡鏃�
+          { label: "鏈嶅姟寮�濮嬫棩", prop: "startTime" }, // 鏈嶅姟寮�濮嬫棩
+          { label: "鏈嶅姟鍒版湡鏃�", prop: "endTime" }, // 鏈嶅姟鍒版湡鏃�
           { label: "浠风◣鍚堣", prop: "priceTax" } // 浠风◣鍚堣
         ]
       }
@@ -108,6 +89,34 @@
         const label = this.tableList.tableColumn[i].label
         this.searchOptions.push({ value: (i + 1).toString(), label: label })
       }
+    },
+    // 璇锋眰鏁版嵁
+    async getData() {
+      this.loading = true
+      await getServiceContractList()
+        .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() {
@@ -125,37 +134,13 @@
         signDate: "",
         startDate: "",
         endDate: "",
-
-        customType: "",
-        customSource: "",
-        importantLevel: "",
-        serviceAgent: "",
-        nextFollowupDate: "",
-        latestServiceDate: "",
-
-        customStatus: "",
-        phoneNumber: "",
-        duties: "",
-        wechat: "1",
-        contactsEmail: "",
-        industry: "",
-        legalPerson: "",
-        registerTime: "",
-        registerCapital: "",
-        companyNature: "",
-        customerSize: "",
-        operateRange: "",
-        position: "",
-        map: "",
-        country: "1",
-        province: "1",
-        city: "1",
-        region: "1",
+        contractStatus: "",
+        serviceNumber: "",
+        termsTreaty: "",
         notes: "",
         approvalWorkflow: "",
         approvalSteps: "",
         approvalPerson: "",
-        approvalUrgent: "",
         approvalOpinion: ""
       }
     },
@@ -165,21 +150,25 @@
       this.editSalesLeadConfig.visible = true
       this.editSalesLeadConfig.title = "缂栬緫"
       this.editSalesLeadConfig.infomation = {
-        customName: row.customName,
-        saleLeadNumber: row.saleLeadNumber,
-        contactName: row.contactName,
-        contactDuties: row.contactDuties,
-        phoneNumber: row.phoneNumber,
-        businessStatus: "鏂板缓",
-        businessSource: row.businessSource,
-        owner: row.owner,
-        position: "",
-        map: "",
-        country: "1",
-        province: "1",
-        city: "1",
-        region: "1",
-        address: ""
+        customName: "",
+        serviceContractNumber: "AC6521",
+        owner: "5",
+        contactName: "",
+        salesOpportunity: "",
+        contractOrder: "",
+        quotation: "",
+        contractType: "",
+        signDate: "",
+        startDate: "",
+        endDate: "",
+        contractStatus: "",
+        serviceNumber: "",
+        termsTreaty: "",
+        notes: "",
+        approvalWorkflow: "",
+        approvalSteps: "",
+        approvalPerson: "",
+        approvalOpinion: ""
       }
     }
   }
@@ -188,7 +177,7 @@
 
 <!-- Add "scoped" attribute to limit CSS to this component only -->
 <style lang="scss" scoped>
-.sales-lead {
+.service-contract {
   .btn-pager {
     display: flex;
     .page {

--
Gitblit v1.8.0