Commit 98214d11 authored by 黄卓's avatar 黄卓

客户联系人

parent f631b513
......@@ -37,7 +37,7 @@ export function getCustomerContacts(id) {
// 获得客户联系人列表
export function getCustomerContactsList() {
return request({
url: '/ecw/customer-contacts/page',
url: '/ecw/customer-contacts/list',
method: 'get'
})
}
......@@ -60,3 +60,12 @@ export function exportCustomerContactsExcel(query) {
responseType: 'blob'
})
}
// 根据客户ID获得联系人列表
export function getCustomerContactsListByCustomer(query) {
return request({
url: '/ecw/customer-contacts/list-by-customer',
method: 'get',
params: query
})
}
......@@ -124,7 +124,7 @@
<script>
import {createCustomerFollow, getCustomerFollowPage} from "@/api/ecw/customerFollow"
import { DICT_TYPE, getDictDataLabel } from '@/utils/dict'
import {getCustomerContactsList} from "@/api/ecw/customerContacts"
import { getCustomerContactsListByCustomer } from '@/api/ecw/customerContacts'
import {listServiceUser} from "@/api/system/user"
import { parseTime } from '@/utils/ruoyi'
export default {
......@@ -154,9 +154,8 @@ export default {
created() {
this.resetCustomerFollowForm()
getCustomerContactsList().then(r => {
// todo 接口不对,临时用page
this.customerContactsList = r.data.list
if (!!this.customerId) getCustomerContactsListByCustomer({customerId: this.customerId}).then(r => {
this.customerContactsList = r.data
})
listServiceUser().then(r => {
this.serviceUserList = r.data
......
......@@ -380,6 +380,7 @@ import CustomerLineTable from '@/components/CustomerLineTable'
import {getCustomerSelect} from "@/api/ecw/customer"
import {listServiceUser} from "@/api/system/user"
import {getZhongPaoPage} from '@/api/ecw/zhongPao'
import { getCustomerContactsListByCustomer } from '@/api/ecw/customerContacts'
export default {
name: "edit",
......@@ -392,8 +393,13 @@ export default {
},
created() {
this.reset()
if(this.customerId !== '0')
this.getCustomer(this.customerId)
if(this.customerId !== '0') {
this.getCustomer(this.customerId).then(() => {
getCustomerContactsListByCustomer({customerId: this.customerId}).then(r => {
this.form.customerContacts = r.data
})
})
}
getNodeList().then(r => {
this.nodeList = r.data
......@@ -455,6 +461,7 @@ export default {
paoLines: [], // 泡货线路
}
},
methods: {
/** 取消按钮 */
cancel() {
......@@ -528,7 +535,7 @@ export default {
this.resetForm("form");
},
getCustomer(id) {
getCustomer(id).then(response => {
return getCustomer(id).then(response => {
this.form = { ...this.form, ...response.data, id: this.customerId };
this.open = true;
this.title = "修改客户";
......
......@@ -45,7 +45,7 @@
<h3>联系人</h3>
<el-table
:data="customer.customerContacts"
:data="customerContacts"
style="width: 100%"
border
>
......@@ -181,6 +181,7 @@ import CustomerFollow from "@/components/CustomerFollow"
import { parseTime } from '@/utils/ruoyi'
import CustomerComplaint from '@/views/ecw/customerComplaint'
import { listServiceUser } from '@/api/system/user'
import { getCustomerContactsListByCustomer } from '@/api/ecw/customerContacts'
export default {
name: 'query',
......@@ -198,6 +199,10 @@ export default {
})
getCustomer(this.customerId).then(response => {
this.customer = { ...this.customer, ...response.data }
getCustomerContactsListByCustomer({customerId: this.customerId}).then(r => {
this.customerContacts = r.data
})
})
getProductTypeList().then(r => {
this.productTypeList = r.data
......@@ -219,6 +224,7 @@ export default {
productTypeList: [],
customerSelect: [],
serviceUserList: [],
customerContacts: [],
customer: {
id: undefined,
number: undefined,
......@@ -238,7 +244,6 @@ export default {
source: undefined,
picture: undefined,
customerService: undefined,
customerContacts: [],
customerLines: [],
promoter: undefined,
status: undefined,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment