import { getStockListStock } from '@/api/setting' import { getWarehouseList } from '@/api/supply/engin' import { getCategoryList, getSalesmanList } from '@/api/common' import { getDealerList, getWalletCustomerList } from '@/api/basic_data/dealer' export default { // 仓库下拉数据 STOCK() { return new Promise((r, j) => { getWarehouseList({ pageNum: 1, pageSize: -1 }) .then(res => { r({ data: res.data.records.map(item => ({ dictCode: item.id, dictValue: item.name })) }) }) .catch(j) }) }, // 存货类别 CATEGORY() { return new Promise((r, j) => { getCategoryList({ pageNum: 1, pageSize: -1 }) .then(res => { r({ data: res.data.records.map(item => ({ dictCode: item.id, dictValue: item.name })) }) }) .catch(j) }) }, // 经销商列表 CUSTOMER() { return new Promise((r, j) => { getDealerList({ pageNum: 1, pageSize: -1 }) .then(res => { r({ data: res.data.records.map(item => ({ dictCode: item.id, dictValue: item.name })) }) }) .catch(j) }) }, // 经销商钱包列表 WALLET() { return new Promise((r, j) => { getWalletCustomerList({ pageNum: 1, pageSize: -1 }) .then(res => { r({ data: res.data.map(item => ({ dictCode: item.customerId, dictValue: item.customerWalletName })) }) }) .catch(j) }) }, // 业务员列表 SERVICE() { return new Promise((r, j) => { getSalesmanList({ pageNum: 1, pageSize: -1 }) .then(res => { r({ data: res.data.records.map(item => ({ dictCode: item.adminUserId, dictValue: item.nickName })) }) }) .catch(j) }) }, // 仓库 STOCK_NO() { return new Promise((r, j) => { getStockListStock({ pageNum: 1, pageSize: -1 }) .then(res => { r({ data: res.data.records.map(item => ({ dictCode: item.id, dictValue: item.name })) }) }) .catch(j) }) } }