| | |
| | | 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" |
| | |
| | | import { getServiceContractList } from "@/api/serviceManage/serviceContract" |
| | | import { getContractList } from "@/api/sales/contractManage" |
| | | import { getSalesDetailsList } from "@/api/sales/salesDetails" |
| | | import { getQuotationList } from "@/api/sales/quotation" |
| | | import { getServiceOrderList } from "@/api/serviceManage/clientServiceOrder" |
| | | import { getProductList } from "@/api/common/other" |
| | | import { getSalesReturnList } from "@/api/sales/salesReturn" |
| | | import { Message } from "element-ui" |
| | | |
| | | export default { |
| | | state: { |
| | | clientList: [], // 客户列表 |
| | | subOrderList:[],//销售子单 |
| | | contactNamelist: [], // 联系人 |
| | | saleChancelist: [], // 销售机会 |
| | | saleLeadlist: [], // 销售线索 |
| | | masterOrderList: [], // 销售总单 |
| | | serviceContractList: [], // 服务合同 |
| | | getContractList: [], // 合同订单 |
| | | salesDetailsList: [] // 销售明细单 |
| | | salesDetailsList: [], // 销售明细单 |
| | | quotationList: [], // 报价单 |
| | | serviceOrderList: [], // 客户服务单 |
| | | productList: [], // 产品列表 |
| | | salesReturnList: [] // 销售退货单 |
| | | }, |
| | | mutations: { |
| | | clientNameList(state, payload) { |
| | | state.clientList = payload |
| | | }, |
| | | subOrderList(state,payload){ |
| | | state.subOrderList=payload |
| | | }, |
| | | contactNameList(state, payload) { |
| | | state.contactNamelist = payload |
| | |
| | | }, |
| | | salesDetailsList(state, payload) { |
| | | state.salesDetailsList = payload |
| | | }, |
| | | quotationList(state, payload) { |
| | | state.quotationList = payload |
| | | }, |
| | | serviceOrderList(state, payload) { |
| | | state.serviceOrderList = payload |
| | | }, |
| | | productList(state, payload) { |
| | | state.productList = payload |
| | | }, |
| | | salesReturnList(state, payload) { |
| | | state.salesReturnList = payload |
| | | } |
| | | }, |
| | | actions: { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | 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) { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | getContactFilter({ commit }, newData) { |
| | | commit("contactNameList", newData) |
| | | }, |
| | | geChance(context) { |
| | | getSaleChanceList().then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | } else { |
| | | Message.error(res.msg) |
| | | } |
| | | },err=>{ |
| | | console.error(err) |
| | | }) |
| | | }, |
| | | getChanceFilter({commit},newData){ |
| | | commit("saleChancelist",newData) |
| | | }, |
| | | geLead(context) { |
| | | getSalesLeadsList().then((res) => { |
| | |
| | | Message.error(res.msg) |
| | | } |
| | | }) |
| | | }, |
| | | getLeadFilter({commit},newData){ |
| | | commit("saleLeadlist",newData) |
| | | }, |
| | | geMaster(context) { |
| | | getMasterOrderList().then((res) => { |
| | |
| | | Message.error(res.msg) |
| | | } |
| | | }) |
| | | }, |
| | | getSalesDetailsFliter({commit},newData){ |
| | | commit("salesDetailsList", newData) |
| | | }, |
| | | geQuotation(context) { |
| | | getQuotationList().then((res) => { |
| | | if (res.code == 200) { |
| | | context.commit("quotationList", res.data.list) |
| | | } else { |
| | | Message.error(res.msg) |
| | | } |
| | | }) |
| | | }, |
| | | geServiceOrder(context) { |
| | | getServiceOrderList().then((res) => { |
| | | if (res.code == 200) { |
| | | context.commit("serviceOrderList", res.data.data) |
| | | } else { |
| | | Message.error(res.msg) |
| | | } |
| | | }) |
| | | }, |
| | | geProductList(context) { |
| | | getProductList({ productName: "", productNumber: "", page: 1, pageSize: 10 }).then((res) => { |
| | | if (res.code == 200) { |
| | | console.log(res.data.data) |
| | | context.commit("productList", res.data.data) |
| | | } else { |
| | | Message.error(res.msg) |
| | | } |
| | | }) |
| | | }, |
| | | geReturnList(context) { |
| | | getSalesReturnList({ productName: "", productNumber: "", page: 1, pageSize: 10 }).then((res) => { |
| | | if (res.code == 200) { |
| | | console.log(res.data.list) |
| | | context.commit("salesReturnList", res.data.list) |
| | | } else { |
| | | Message.error(res.msg) |
| | | } |
| | | }) |
| | | }, |
| | | getReturnListFliter({commit},newData){ |
| | | commit("salesReturnList",newData) |
| | | } |
| | | } |
| | | } |