123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- 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)
- })
- }
- }
|