dict.js
1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import http from './interface'
// 根据字典类型查询字典数据信息
export const getDicts = (dictType) => {
return http.request({
url: '/system/dict/data/type/' + dictType,
method: 'GET'
})
}
// 查询入库类型字典数据信息
export const getReceiptType = () => {
return http.request({
url: '/config/mobile/getReceiptType',
method: 'POST'
})
}
// 查询出库类型字典数据信息
export const getShipmentType = () => {
return http.request({
url: '/config/shipmentType/list',
method: 'GET'
})
}
// 通过用户名获取可以用的仓库列表
export const getWarehouseByUserCode = (username) => {
const data = {
username
}
return http.request({
url: '/system/warehouse/getWarehouseByUserCode',
method: 'GET',
data
})
}
// 获取用户可操作货主
export const getCompaniesByToken = () => {
return http.request({
url: '/system/company/getCompaniesByToken',
method: 'GET',
})
}
// 查询字典数据列表
export const listDict = (data) => {
return http.request({
url: '/system/dict/data/list',
method: 'get',
data
})
}
// 查询字典数据详细
export const getCurrDict = (dictCode) => {
return http.request({
url: '/system/dict/data/' + dictCode,
method: 'GET'
})
}
// 新增字典数据
export const addDict = (data) => {
return http.request({
url: '/system/dict/data',
method: 'post',
data: data
})
}
// 修改字典数据
export const updateDict = (data) => {
return http.request({
url: '/system/dict/data',
method: 'put',
data: data
})
}
// 删除字典数据
export const delDict = (dictCode) => {
return http.request({
url: '/system/dict/data/' + dictCode,
method: 'DELETE'
})
}
export default {
getReceiptType,
getWarehouseByUserCode,
listDict,
addDict,
getDicts,
delDict,
getCurrDict,
updateDict,
getCompaniesByToken,
getShipmentType
}