selectData.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import { getStockListStock } from '@/api/setting'
  2. import { getWarehouseList } from '@/api/supply/engin'
  3. import { getCategoryList, getSalesmanList } from '@/api/common'
  4. import { getDealerList, getWalletCustomerList } from '@/api/basic_data/dealer'
  5. export default {
  6. // 仓库下拉数据
  7. STOCK() {
  8. return new Promise((r, j) => {
  9. getWarehouseList({
  10. pageNum: 1,
  11. pageSize: -1
  12. })
  13. .then(res => {
  14. r({ data: res.data.records.map(item => ({ dictCode: item.id, dictValue: item.name })) })
  15. })
  16. .catch(j)
  17. })
  18. },
  19. // 存货类别
  20. CATEGORY() {
  21. return new Promise((r, j) => {
  22. getCategoryList({
  23. pageNum: 1,
  24. pageSize: -1
  25. })
  26. .then(res => {
  27. r({ data: res.data.records.map(item => ({ dictCode: item.id, dictValue: item.name })) })
  28. })
  29. .catch(j)
  30. })
  31. },
  32. // 经销商列表
  33. CUSTOMER() {
  34. return new Promise((r, j) => {
  35. getDealerList({
  36. pageNum: 1,
  37. pageSize: -1
  38. })
  39. .then(res => {
  40. r({ data: res.data.records.map(item => ({ dictCode: item.id, dictValue: item.name })) })
  41. })
  42. .catch(j)
  43. })
  44. },
  45. // 经销商钱包列表
  46. WALLET() {
  47. return new Promise((r, j) => {
  48. getWalletCustomerList({
  49. pageNum: 1,
  50. pageSize: -1
  51. })
  52. .then(res => {
  53. r({ data: res.data.map(item => ({ dictCode: item.customerId, dictValue: item.customerWalletName })) })
  54. })
  55. .catch(j)
  56. })
  57. },
  58. // 业务员列表
  59. SERVICE() {
  60. return new Promise((r, j) => {
  61. getSalesmanList({
  62. pageNum: 1,
  63. pageSize: -1
  64. })
  65. .then(res => {
  66. r({ data: res.data.records.map(item => ({ dictCode: item.adminUserId, dictValue: item.nickName })) })
  67. })
  68. .catch(j)
  69. })
  70. },
  71. // 仓库
  72. STOCK_NO() {
  73. return new Promise((r, j) => {
  74. getStockListStock({
  75. pageNum: 1,
  76. pageSize: -1
  77. })
  78. .then(res => {
  79. r({ data: res.data.records.map(item => ({ dictCode: item.id, dictValue: item.name })) })
  80. })
  81. .catch(j)
  82. })
  83. }
  84. }