import { getClientList } from "@/api/client/client" // 导入接口
|
import { getContactList } from "@/api/client/contacts"
|
import { getSaleChanceList } from "@/api/sales/salesOpportunity"
|
import { Message } from "element-ui"
|
|
export default {
|
state: {
|
clientList: [], // 客户列表
|
contactNamelist: [] // 联系人
|
},
|
mutations: {
|
clientNameList(state, payload) {
|
state.clientList = payload
|
},
|
contactNameList(state, payload) {
|
state.contactNamelist = payload
|
},
|
saleChancelist(state, payload) {
|
state.saleChancelist = payload
|
}
|
},
|
actions: {
|
geClient(context) {
|
getClientList().then((res) => {
|
if (res.code == 200) {
|
context.commit("clientNameList", res.data.list)
|
} else {
|
Message.error(res.msg)
|
}
|
})
|
},
|
geContact(context) {
|
getContactList().then((res) => {
|
if (res.code == 200) {
|
context.commit("contactNameList", res.data.list)
|
} else {
|
Message.error(res.msg)
|
}
|
})
|
},
|
geChance(context) {
|
getSaleChanceList().then((res) => {
|
if (res.code == 200) {
|
context.commit("saleChancelist", res.data.list)
|
} else {
|
Message.error(res.msg)
|
}
|
})
|
}
|
}
|
}
|