mirror of
https://github.com/hpd840321/craftlabs-authorization-sdk.git
synced 2026-06-09 10:00:30 +08:00
feat(web): I3 contract list, wizard, and detail
Add routes and menu, platform API helpers (patch status, audit-events), and Vue views aligned to platform contract DTOs and state transitions. Made-with: Cursor
This commit is contained in:
@@ -41,3 +41,68 @@ export function deleteProject(id) {
|
||||
export function getProjectPhaseDictionary() {
|
||||
return axios.get("/api/v1/dictionaries/PROJECT_PHASE");
|
||||
}
|
||||
|
||||
/**
|
||||
* 合同列表(分页)。后端就绪后路径以 OpenAPI 为准。
|
||||
* @param {{ page?: number, size?: number, customerId?: string | number, projectId?: string | number, keyword?: string }} params
|
||||
*/
|
||||
export function listContracts(params) {
|
||||
return axios.get("/api/v1/contracts", { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Record<string, unknown>} body
|
||||
*/
|
||||
export function createContract(body) {
|
||||
return axios.post("/api/v1/contracts", body);
|
||||
}
|
||||
|
||||
export function getContract(id) {
|
||||
return axios.get(`/api/v1/contracts/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string | number} id
|
||||
* @param {Record<string, unknown>} body
|
||||
*/
|
||||
export function updateContract(id, body) {
|
||||
return axios.put(`/api/v1/contracts/${id}`, body);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string | number} contractId
|
||||
* @param {Record<string, unknown>} body
|
||||
*/
|
||||
export function addLine(contractId, body) {
|
||||
return axios.post(`/api/v1/contracts/${contractId}/lines`, body);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string | number} contractId
|
||||
* @param {string | number} lineId
|
||||
* @param {Record<string, unknown>} body
|
||||
*/
|
||||
export function updateLine(contractId, lineId, body) {
|
||||
return axios.put(`/api/v1/contracts/${contractId}/lines/${lineId}`, body);
|
||||
}
|
||||
|
||||
export function deleteLine(contractId, lineId) {
|
||||
return axios.delete(`/api/v1/contracts/${contractId}/lines/${lineId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态迁移:后端 `PATCH /api/v1/contracts/{id}/status`,body `{ status: "PENDING_EFFECTIVE" }` 等。
|
||||
* @param {string | number} id
|
||||
* @param {{ status: string }} body
|
||||
*/
|
||||
export function patchContractStatus(id, body) {
|
||||
return axios.patch(`/api/v1/contracts/${id}/status`, body);
|
||||
}
|
||||
|
||||
/**
|
||||
* M10-F01 审计分页:`GET /api/v1/audit-events`。
|
||||
* @param {{ entityType: string, entityId: string | number, page?: number, size?: number }} params
|
||||
*/
|
||||
export function listAuditEvents(params) {
|
||||
return axios.get("/api/v1/audit-events", { params });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user