lqInventory.js
3.71 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
import request from '@/utils/request'
// ========== 库存管理接口 ==========
// 创建库存
export function createInventory(data) {
return request({
url: '/api/Extend/LqInventory/Create',
method: 'post',
data
})
}
// 更新库存
export function updateInventory(data) {
return request({
url: '/api/Extend/LqInventory/Update',
method: 'put',
data
})
}
// 获取库存列表
export function getInventoryList(params) {
return request({
url: '/api/Extend/LqInventory/GetList',
method: 'get',
data: params
})
}
// 获取库存详情
export function getInventoryInfo(id) {
return request({
url: '/api/Extend/LqInventory/GetInfo',
method: 'get',
data: { id }
})
}
// ========== 库存使用记录接口 ==========
// 添加库存使用记录
export function createInventoryUsage(data) {
return request({
url: '/api/Extend/LqInventoryUsage/Create',
method: 'post',
data
})
}
// 作废库存使用记录
export function cancelInventoryUsage(id, remarks) {
return request({
url: '/api/Extend/LqInventoryUsage/Cancel?id=' + id + '&remarks=' + remarks,
method: 'put',
})
}
// 获取使用记录列表
export function getInventoryUsageList(params) {
return request({
url: '/api/Extend/LqInventoryUsage/GetList',
method: 'get',
data: params
})
}
// 获取产品使用统计
export function getProductUsageStatistics(data) {
return request({
url: '/api/Extend/LqInventoryUsage/GetProductUsageStatistics',
method: 'post',
data
})
}
// 获取门店使用统计
export function getStoreUsageStatistics(data) {
return request({
url: '/api/Extend/LqInventoryUsage/GetStoreUsageStatistics',
method: 'post',
data
})
}
// 获取使用趋势统计
export function getUsageTrendStatistics(data) {
return request({
url: '/api/Extend/LqInventoryUsage/GetUsageTrendStatistics',
method: 'post',
data
})
}
// 获取产品使用排行榜
export function getProductUsageRanking(data) {
return request({
url: '/api/Extend/LqInventoryUsage/GetProductUsageRanking',
method: 'post',
data
})
}
// ========== 库存使用审批流程接口 ==========
// 批量创建使用记录并提交审批
export function batchCreateInventoryUsage(data) {
return request({
url: '/api/Extend/LqInventoryUsage/BatchCreate',
method: 'post',
data
})
}
// 根据批次ID查询申请记录
export function getApplicationByBatchId(batchId) {
return request({
url: '/api/Extend/LqInventoryUsage/GetApplicationByBatchId',
method: 'get',
data: { batchId }
})
}
// 审批申请
export function approveApplication(applicationId, result, opinion) {
const params = new URLSearchParams()
params.append('result', result)
if (opinion) {
params.append('opinion', opinion)
}
const queryString = params.toString()
return request({
url: `/api/Extend/LqInventoryUsage/Approve/${applicationId}${queryString ? '?' + queryString : ''}`,
method: 'post'
})
}
// 标记已领取
export function markReceived(applicationId) {
return request({
url: `/api/Extend/LqInventoryUsage/MarkReceived/${applicationId}`,
method: 'put'
})
}
// 查询批次信息
export function getBatchInfo(batchId) {
return request({
url: '/api/Extend/LqInventoryUsage/GetBatchInfo',
method: 'get',
data: { batchId }
})
}
// 门店领取统计
export function getStoreReceiveStatistics(data) {
return request({
url: '/api/Extend/LqInventoryUsage/GetStoreReceiveStatistics',
method: 'post',
data
})
}
// 仓库待领取统计
export function getWarehousePendingDelivery(data) {
return request({
url: '/api/Extend/LqInventoryUsage/GetWarehousePendingDelivery',
method: 'post',
data
})
}