|  |  |  | 
|---|
|  |  |  | import { getClientList } from "@/api/client/client" // 导入接口 | 
|---|
|  |  |  | import { getSubOrderList } from "@/api/sales/subOrder" | 
|---|
|  |  |  | import { getContactList } from "@/api/client/contacts" | 
|---|
|  |  |  | import { getSaleChanceList } from "@/api/sales/salesOpportunity" | 
|---|
|  |  |  | import { getSalesLeadsList } from "@/api/client/salesLead" | 
|---|
|  |  |  | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | state: { | 
|---|
|  |  |  | clientList: [], // 客户列表 | 
|---|
|  |  |  | subOrderList:[],//销售子单 | 
|---|
|  |  |  | contactNamelist: [], // 联系人 | 
|---|
|  |  |  | saleChancelist: [], // 销售机会 | 
|---|
|  |  |  | saleLeadlist: [], // 销售线索 | 
|---|
|  |  |  | 
|---|
|  |  |  | mutations: { | 
|---|
|  |  |  | clientNameList(state, payload) { | 
|---|
|  |  |  | state.clientList = payload | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | subOrderList(state,payload){ | 
|---|
|  |  |  | state.subOrderList=payload | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | contactNameList(state, payload) { | 
|---|
|  |  |  | state.contactNamelist = payload | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getSubunit(context){ | 
|---|
|  |  |  | getSubOrderList().then((res)=>{ | 
|---|
|  |  |  | if (res.code == 200) { | 
|---|
|  |  |  | context.commit("subOrderList", res.data.list) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | Message.error(res.msg) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getSubunitFliter({commit},newData){ | 
|---|
|  |  |  | commit("subOrderList",newData) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | geContact(context) { | 
|---|
|  |  |  | getContactList().then((res) => { | 
|---|
|  |  |  | if (res.code == 200) { | 
|---|
|  |  |  | 
|---|
|  |  |  | Message.error(res.msg) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getContactFilter({ commit }, newData) { | 
|---|
|  |  |  | commit("contactNameList", newData) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | geChance(context) { | 
|---|
|  |  |  | getSaleChanceList().then((res) => { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getChanceFilter({commit},newData){ | 
|---|
|  |  |  | commit("saleChancelist",newData) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | geLead(context) { | 
|---|
|  |  |  | getSalesLeadsList().then((res) => { | 
|---|
|  |  |  | if (res.code == 200) { | 
|---|
|  |  |  | 
|---|
|  |  |  | Message.error(res.msg) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getLeadFilter({commit},newData){ | 
|---|
|  |  |  | commit("saleLeadlist",newData) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | geMaster(context) { | 
|---|
|  |  |  | getMasterOrderList().then((res) => { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getSalesDetailsFliter({commit},newData){ | 
|---|
|  |  |  | commit("salesDetailsList", newData) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | geQuotation(context) { | 
|---|
|  |  |  | getQuotationList().then((res) => { | 
|---|
|  |  |  | if (res.code == 200) { | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | geProductList(context) { | 
|---|
|  |  |  | getProductList({ productName: "", productNumber: "", page: 1, pageSize: 10 }).then((res) => { | 
|---|
|  |  |  | if (res.data.code == 200) { | 
|---|
|  |  |  | console.log(res.data.data.data) | 
|---|
|  |  |  | context.commit("productList", res.data.data.data) | 
|---|
|  |  |  | if (res.code == 200) { | 
|---|
|  |  |  | console.log(res.data.data) | 
|---|
|  |  |  | context.commit("productList", res.data.data) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | Message.error(res.msg) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | Message.error(res.msg) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getReturnListFliter({commit},newData){ | 
|---|
|  |  |  | commit("salesReturnList",newData) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|