✨ feat(mes/cal-plan): 新增排班计划专用 confirm 接口
- 后端新增 PUT /mes/cal/plan/confirm 接口,仅接收 id 参数 - Service 层新增 confirmPlan(Long id) 方法,含草稿状态校验和班组数量校验 - updatePlan 中强制忽略 status 字段,禁止通过 update 修改状态 - 前端 API 新增 confirmPlan(id: number) 方法 - CalPlanForm handleConfirm 改为调用专用 confirmPlan 接口pull/871/MERGE
parent
d5303a1e7d
commit
2f86852483
|
|
@ -41,6 +41,11 @@ export const CalPlanApi = {
|
||||||
return await request.put({ url: `/mes/cal/plan/update`, data })
|
return await request.put({ url: `/mes/cal/plan/update`, data })
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 确认排班计划
|
||||||
|
confirmPlan: async (id: number) => {
|
||||||
|
return await request.put({ url: `/mes/cal/plan/confirm?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
// 删除排班计划
|
// 删除排班计划
|
||||||
deletePlan: async (id: number) => {
|
deletePlan: async (id: number) => {
|
||||||
return await request.delete({ url: `/mes/cal/plan/delete?id=` + id })
|
return await request.delete({ url: `/mes/cal/plan/delete?id=` + id })
|
||||||
|
|
|
||||||
|
|
@ -223,8 +223,7 @@ const handleConfirm = async () => {
|
||||||
try {
|
try {
|
||||||
await message.confirm('确认该排班计划?确认后将不可修改或删除。')
|
await message.confirm('确认该排班计划?确认后将不可修改或删除。')
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
const data = { ...formData.value, status: MesCalPlanStatusEnum.CONFIRMED } as unknown as CalPlanVO
|
await CalPlanApi.confirmPlan(formData.value.id!)
|
||||||
await CalPlanApi.updatePlan(data)
|
|
||||||
message.success('确认成功')
|
message.success('确认成功')
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
emit('success')
|
emit('success')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue