feat(mini): add ETC vehicle recharge apply for drivers and escorts
Add menu SQL, workbench entry, mineVehicles API client, and list/form pages styled like fuel register. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
48aef9f233
commit
c70b17f8ca
8 files changed
+1149
-2
No files matched your search
+47
-1
@@ -20,7 +20,13 @@ function unwrapList(data) {
|
||||
|
||||
function unwrapEntity(data) {
|
||||
if (!data || typeof data !== 'object') return data
|
||||
if (data.data && typeof data.data === 'object' && data.id == null && data.registerNo == null) {
|
||||
if (
|
||||
data.data &&
|
||||
typeof data.data === 'object' &&
|
||||
data.id == null &&
|
||||
data.registerNo == null &&
|
||||
data.applyNo == null
|
||||
) {
|
||||
return data.data
|
||||
}
|
||||
return data
|
||||
@@ -81,6 +87,46 @@ export const sitePlanApi = {
|
||||
db.post(`/transport/site-plan/${planId}/feedback`, payload)
|
||||
}
|
||||
|
||||
export const vehicleRechargeApplyApi = {
|
||||
list: async (params = {}) => {
|
||||
const data = await db.get('/transport/vehicle-recharge-apply/', {
|
||||
mineVehicles: true,
|
||||
...params
|
||||
})
|
||||
return unwrapList(data)
|
||||
},
|
||||
get: async (id) =>
|
||||
unwrapEntity(
|
||||
await db.get(`/transport/vehicle-recharge-apply/${id}`, {
|
||||
mineVehicles: true
|
||||
})
|
||||
),
|
||||
create: async (payload) =>
|
||||
unwrapEntity(
|
||||
await db.post('/transport/vehicle-recharge-apply/', payload, {
|
||||
params: { mineVehicles: true }
|
||||
})
|
||||
),
|
||||
update: async (id, payload) =>
|
||||
unwrapEntity(
|
||||
await db.put(`/transport/vehicle-recharge-apply/${id}`, payload, {
|
||||
params: { mineVehicles: true }
|
||||
})
|
||||
),
|
||||
submit: (id) =>
|
||||
db.post(
|
||||
`/transport/vehicle-recharge-apply/${id}/submit`,
|
||||
{},
|
||||
{ params: { mineVehicles: true } }
|
||||
),
|
||||
cancel: (id) =>
|
||||
db.post(
|
||||
`/transport/vehicle-recharge-apply/${id}/cancel`,
|
||||
{},
|
||||
{ params: { mineVehicles: true } }
|
||||
)
|
||||
}
|
||||
|
||||
export const driverPlanApi = {
|
||||
history: async (params = {}) => {
|
||||
const data = unwrapData(await db.get('/transport/driver-plan/history', params))
|
||||
|
||||
Reference in new issue
Block a user