diff --git a/web/delivery-platform-ui/src/api/platform.js b/web/delivery-platform-ui/src/api/platform.js index 988ef5c..fe7152a 100644 --- a/web/delivery-platform-ui/src/api/platform.js +++ b/web/delivery-platform-ui/src/api/platform.js @@ -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} 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} body + */ +export function updateContract(id, body) { + return axios.put(`/api/v1/contracts/${id}`, body); +} + +/** + * @param {string | number} contractId + * @param {Record} 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} 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 }); +} diff --git a/web/delivery-platform-ui/src/layout/MainLayout.vue b/web/delivery-platform-ui/src/layout/MainLayout.vue index f8a2ba4..9da433d 100644 --- a/web/delivery-platform-ui/src/layout/MainLayout.vue +++ b/web/delivery-platform-ui/src/layout/MainLayout.vue @@ -12,6 +12,9 @@ 项目管理 + + 合同管理 + diff --git a/web/delivery-platform-ui/src/router/index.js b/web/delivery-platform-ui/src/router/index.js index cf462cb..4e74c64 100644 --- a/web/delivery-platform-ui/src/router/index.js +++ b/web/delivery-platform-ui/src/router/index.js @@ -26,6 +26,24 @@ const routes = [ component: () => import("../views/ProjectsView.vue"), meta: { roles: ["SYS_ADMIN", "DEVELOPER"] }, }, + { + path: "contracts/new", + name: "contract-new", + component: () => import("../views/ContractWizardView.vue"), + meta: { roles: ["SYS_ADMIN", "DEVELOPER"], title: "新建合同" }, + }, + { + path: "contracts/:id", + name: "contract-detail", + component: () => import("../views/ContractDetailView.vue"), + meta: { roles: ["SYS_ADMIN", "DEVELOPER"], title: "合同详情" }, + }, + { + path: "contracts", + name: "contracts", + component: () => import("../views/ContractsView.vue"), + meta: { roles: ["SYS_ADMIN", "DEVELOPER"], title: "合同管理" }, + }, ], }, { path: "/403", name: "forbidden", component: () => import("../views/ForbiddenView.vue") }, diff --git a/web/delivery-platform-ui/src/views/ContractDetailView.vue b/web/delivery-platform-ui/src/views/ContractDetailView.vue new file mode 100644 index 0000000..71d05de --- /dev/null +++ b/web/delivery-platform-ui/src/views/ContractDetailView.vue @@ -0,0 +1,504 @@ + + + + + diff --git a/web/delivery-platform-ui/src/views/ContractWizardView.vue b/web/delivery-platform-ui/src/views/ContractWizardView.vue new file mode 100644 index 0000000..5bea097 --- /dev/null +++ b/web/delivery-platform-ui/src/views/ContractWizardView.vue @@ -0,0 +1,288 @@ + + + + + diff --git a/web/delivery-platform-ui/src/views/ContractsView.vue b/web/delivery-platform-ui/src/views/ContractsView.vue new file mode 100644 index 0000000..4ab9b71 --- /dev/null +++ b/web/delivery-platform-ui/src/views/ContractsView.vue @@ -0,0 +1,219 @@ + + + + +