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

客户联系人

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