chore(mobile-h5): add existing H5 app sources to the monorepo
Track the weighbridge mobile-h5 codebase (excluding node_modules, dist, and local .env) so subsequent adaptation tasks can evolve it in-repo. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
f8f9c0ceff
commit
a4b13fa2bc
91 files changed
+15791
No files matched your search
@@ -0,0 +1,149 @@
|
||||
import api from '@/utils/http'
|
||||
|
||||
// ==================== 公司(往来单位)API ====================
|
||||
|
||||
export interface Company {
|
||||
id: number
|
||||
name: string
|
||||
remarks?: string | null
|
||||
}
|
||||
|
||||
export interface CompanyCreate {
|
||||
name: string
|
||||
remarks?: string | null
|
||||
}
|
||||
|
||||
export interface CompanyUpdate {
|
||||
name?: string
|
||||
remarks?: string | null
|
||||
}
|
||||
|
||||
export const companyApi = {
|
||||
list: async (q?: string): Promise<Company[]> => {
|
||||
return api.get<Company[]>({
|
||||
url: '/master-data/companies',
|
||||
params: q ? { q } : undefined
|
||||
})
|
||||
},
|
||||
get: async (id: number): Promise<Company> => {
|
||||
return api.get<Company>({
|
||||
url: `/master-data/companies/${id}`
|
||||
})
|
||||
},
|
||||
create: async (payload: CompanyCreate): Promise<Company> => {
|
||||
return api.post<Company>({
|
||||
url: '/master-data/companies',
|
||||
data: payload
|
||||
})
|
||||
},
|
||||
update: async (id: number, payload: CompanyUpdate): Promise<Company> => {
|
||||
return api.put<Company>({
|
||||
url: `/master-data/companies/${id}`,
|
||||
data: payload
|
||||
})
|
||||
},
|
||||
delete: async (id: number): Promise<void> => {
|
||||
return api.del({
|
||||
url: `/master-data/companies/${id}`
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== 货物(产品)API ====================
|
||||
|
||||
export interface Cargo {
|
||||
id: number
|
||||
name: string
|
||||
remarks?: string | null
|
||||
}
|
||||
|
||||
export interface CargoCreate {
|
||||
name: string
|
||||
remarks?: string | null
|
||||
}
|
||||
|
||||
export interface CargoUpdate {
|
||||
name?: string
|
||||
remarks?: string | null
|
||||
}
|
||||
|
||||
export const cargoApi = {
|
||||
list: async (q?: string): Promise<Cargo[]> => {
|
||||
return api.get<Cargo[]>({
|
||||
url: '/master-data/cargos',
|
||||
params: q ? { q } : undefined
|
||||
})
|
||||
},
|
||||
get: async (id: number): Promise<Cargo> => {
|
||||
return api.get<Cargo>({
|
||||
url: `/master-data/cargos/${id}`
|
||||
})
|
||||
},
|
||||
create: async (payload: CargoCreate): Promise<Cargo> => {
|
||||
return api.post<Cargo>({
|
||||
url: '/master-data/cargos',
|
||||
data: payload
|
||||
})
|
||||
},
|
||||
update: async (id: number, payload: CargoUpdate): Promise<Cargo> => {
|
||||
return api.put<Cargo>({
|
||||
url: `/master-data/cargos/${id}`,
|
||||
data: payload
|
||||
})
|
||||
},
|
||||
delete: async (id: number): Promise<void> => {
|
||||
return api.del({
|
||||
url: `/master-data/cargos/${id}`
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== 车牌号 API ====================
|
||||
|
||||
export interface Vehicle {
|
||||
id: number
|
||||
vehicleNo: string
|
||||
remarks?: string | null
|
||||
}
|
||||
|
||||
export interface VehicleCreate {
|
||||
vehicleNo: string
|
||||
remarks?: string | null
|
||||
}
|
||||
|
||||
export interface VehicleUpdate {
|
||||
vehicleNo?: string
|
||||
remarks?: string | null
|
||||
}
|
||||
|
||||
export const vehicleApi = {
|
||||
list: async (q?: string): Promise<Vehicle[]> => {
|
||||
return api.get<Vehicle[]>({
|
||||
url: '/master-data/vehicles',
|
||||
params: q ? { q } : undefined
|
||||
})
|
||||
},
|
||||
get: async (id: number): Promise<Vehicle> => {
|
||||
return api.get<Vehicle>({
|
||||
url: `/master-data/vehicles/${id}`
|
||||
})
|
||||
},
|
||||
create: async (payload: VehicleCreate): Promise<Vehicle> => {
|
||||
return api.post<Vehicle>({
|
||||
url: '/master-data/vehicles',
|
||||
data: payload
|
||||
})
|
||||
},
|
||||
update: async (id: number, payload: VehicleUpdate): Promise<Vehicle> => {
|
||||
return api.put<Vehicle>({
|
||||
url: `/master-data/vehicles/${id}`,
|
||||
data: payload
|
||||
})
|
||||
},
|
||||
delete: async (id: number): Promise<void> => {
|
||||
return api.del({
|
||||
url: `/master-data/vehicles/${id}`
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user