File was renamed from src/views/custom/client/index.vue |
| | |
| | | </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", |
| | |
| | | tableInfomation: [], |
| | | tableColumn: [ |
| | | { label: "客户名称", prop: "name", min: 100 }, // 客户名称 |
| | | { label: "销售负责人", prop: "service_member_id" }, // 销售负责人 |
| | | { label: "重要级别", prop: "importantLevel" }, // 重要级别 |
| | | { label: "销售负责人", prop: "member_id" }, // 销售负责人 |
| | | { 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 = [] |
| | |
| | | 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 || [] |
| | |
| | | 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: "" |
| | | } |
| | | }, |
| | | // 编辑 |
| | |
| | | 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 |
| | | } |
| | | } |
| | | } |