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/client/client/index.vue |  169 ++++++++++++++++++++++++++++---------------------------
 1 files changed, 86 insertions(+), 83 deletions(-)

diff --git a/src/views/custom/client/index.vue b/src/views/client/client/index.vue
similarity index 65%
rename from src/views/custom/client/index.vue
rename to src/views/client/client/index.vue
index 0f5da51..bb3fb91 100644
--- a/src/views/custom/client/index.vue
+++ b/src/views/client/client/index.vue
@@ -46,8 +46,8 @@
 </template>
 
 <script>
-import AddClientManageDialog from "@/views/custom/client/AddClientManageDialog"
-import { getClientList } from "@/api/custom/client"
+import AddClientManageDialog from "@/views/client/client/AddClientManageDialog.vue"
+import { getClientList } from "@/api/client/client"
 import { dateFormat } from "@/common/config/index"
 export default {
   name: "CustomManage",
@@ -103,14 +103,13 @@
         tableInfomation: [],
         tableColumn: [
           { label: "瀹㈡埛鍚嶇О", prop: "name", min: 100 }, // 瀹㈡埛鍚嶇О
-          { label: "閿�鍞礋璐d汉", prop: "service_member_id" }, // 閿�鍞礋璐d汉
-          { label: "閲嶈绾у埆", prop: "importantLevel" }, // 閲嶈绾у埆
+          { label: "閿�鍞礋璐d汉", prop: "member_id" }, // 閿�鍞礋璐d汉
+          { label: "閲嶈绾у埆", prop: "client_level_id" }, // 閲嶈绾у埆
           { label: "涓嬫鍥炶鏃ユ湡", prop: "next_visit_time", min: 90 }, // 涓嬫鍥炶鏃ユ湡
-          { label: "鎵嬫満鍙风爜", prop: "phoneNumber" }, // 鎵嬫満鍙风爜
           { label: "璇︾粏鍦板潃", prop: "detail_address", min: 200 }, // 璇︾粏鍦板潃
           { label: "瀹㈡埛鐘舵��", prop: "client_status_id" }, // 瀹㈡埛鐘舵��
           { label: "鑱旂郴浜哄鍚�", prop: "contact_name" }, // 鑱旂郴浜哄鍚�
-          { label: "鎵嬫満", prop: "phone" } // 鎵嬫満鍙风爜
+          { label: "鎵嬫満鍙风爜", prop: "contact_phone" } // 鎵嬫満鍙风爜
         ]
       }
       this.searchOptions = []
@@ -128,16 +127,22 @@
           if (res.code === 200) {
             if (res.data.list && res.data.list.length > 0) {
               const list = res.data.list.map((item) => {
+                let contact_name = ""
+                let contact_phone = ""
+                if (item.contacts.length !== 0) {
+                  for (let i = 0; i < item.contacts.length; i++) {
+                    if (item.contacts[i].is_first) {
+                      contact_name = item.contacts[i].name
+                      contact_phone = item.contacts[i].phone
+                    }
+                  }
+                }
+
                 return {
-                  name: item.name,
-                  service_member_id: item.service_member_id,
-                  importantLevel: "",
-                  next_visit_time: dateFormat("YYYY-mm-dd HH:MM", item.next_visit_time),
-                  phoneNumber: "",
-                  detail_address: item.detail_address,
-                  client_status_id: item.client_status_id,
-                  contact_name: "",
-                  phone: ""
+                  ...item,
+                  next_visit_time: dateFormat("YYYY-mm-dd HH:MM:ss", item.next_visit_time),
+                  contact_name: contact_name,
+                  contact_phone: contact_phone
                 }
               })
               this.tableList.tableInfomation = list || []
@@ -163,40 +168,34 @@
       this.editConfig.visible = true
       this.editConfig.title = "鏂板缓"
       this.editConfig.infomation = {
-        customName: "",
-        customNumber: "AC6521",
-        customStatus: "",
-        salesHead: "5",
-        customType: "",
-        customSource: "",
-        importantLevel: "",
-        serviceAgent: "",
-        nextFollowupDate: "",
-        latestServiceDate: "",
-        contactName: "",
-        phoneNumber: "",
-        duties: "",
-        wechat: "1",
-        contactsEmail: "",
-        industry: "",
-        legalPerson: "",
-        registerTime: "",
-        registerCapital: "",
-        companyNature: "",
-        customerSize: "",
-        operateRange: "",
-        position: "",
-        map: "",
-        country: "1",
-        province: "1",
-        city: "1",
-        region: "1",
-        notes: "",
-        approvalWorkflow: "",
-        approvalSteps: "",
-        approvalPerson: "",
-        approvalUrgent: "",
-        approvalOpinion: ""
+        name: "",
+        number: "",
+        client_status_id: "",
+        member_id: "",
+        client_type_id: "",
+        clientSource: "",
+        client_level_id: "",
+        service_member_id: "",
+        next_visit_time: "",
+        latest_service_time: "",
+        contact_name: "",
+        contact_phone: "",
+        contact_duties: "",
+        contact_wechat: "",
+        contact_email: "",
+        industry_id: "",
+        representative: "",
+        registration_time: "",
+        registered_capital_id: "",
+        enterprise_nature_id: "",
+        enterprise_scale_id: "",
+        business_scope: "",
+        country: "",
+        province: "",
+        city: "",
+        region: "",
+        detail_address: "",
+        remark: ""
       }
     },
     // 缂栬緫
@@ -204,41 +203,45 @@
       console.log(row)
       this.editConfig.visible = true
       this.editConfig.title = "缂栬緫"
+      let contactObj = {}
+      if (row.contacts.length > 0) {
+        row.contacts.forEach((ele) => {
+          if (ele.is_first) {
+            contactObj = { ...ele }
+          }
+        })
+      }
+      console.log(contactObj)
       this.editConfig.infomation = {
-        customName: row.customName,
-        customNumber: "AC6521",
-        customStatus: "",
-        salesHead: row.salesHead,
-        customType: "",
-        customSource: "",
-        importantLevel: "",
-        serviceAgent: "",
-        nextFollowupDate: row.nextFollowupDate,
-        latestServiceDate: "",
-        contactName: row.contactName,
-        phoneNumber: row.phoneNumber,
-        duties: "",
-        wechat: "1",
-        contactsEmail: "",
-        industry: "",
-        legalPerson: "",
-        registerTime: "",
-        registerCapital: "",
-        companyNature: "",
-        customerSize: "",
-        operateRange: "",
-        position: "",
-        map: "",
-        country: "1",
-        province: "1",
-        city: "1",
-        region: "1",
-        notes: "",
-        approvalWorkflow: "",
-        approvalSteps: "",
-        approvalPerson: "",
-        approvalUrgent: "",
-        approvalOpinion: ""
+        id: row.id,
+        name: row.name,
+        number: row.number,
+        client_status_id: row.client_status_id,
+        member_id: row.member_id,
+        client_type_id: row.client_type_id,
+        clientSource: row.clientSource,
+        client_level_id: row.client_level_id,
+        service_member_id: row.service_member_id,
+        next_visit_time: row.next_visit_time,
+        latest_service_time: row.latest_service_time,
+        contact_name: row.contact_name,
+        contact_phone: row.contact_phone,
+        contact_duties: "",
+        contact_wechat: contactObj.length > 0 ? contactObj.wechat : "",
+        contact_email: contactObj.length > 0 ? contactObj.email : "",
+        industry_id: row.industry_id,
+        representative: row.representative,
+        registration_time: row.registration_time,
+        registered_capital_id: row.registered_capital_id,
+        enterprise_nature_id: row.enterprise_nature_id,
+        enterprise_scale_id: row.enterprise_scale_id,
+        business_scope: row.business_scope,
+        country: row.country,
+        province: row.province,
+        city: row.city,
+        region: row.region,
+        detail_address: row.detail_address,
+        remark: row.remark
       }
     }
   }

--
Gitblit v1.8.0