提交审批检验时效

This commit is contained in:
ChenXinXin committed 2024-05-20 11:33:15 +08:00
1 parent 42ecacdac6
commit 6123323572
1 file changed
+14
+14
View File
@@ -580,6 +580,20 @@ class TaskService extends Service {
})
return result
}
async checkTimeliness() {
const { jianghuKnex } = this.app;
const { actionData } = this.ctx.request.body.appData;
const { updateItem } = actionData;
const { taskId, operationAt } = updateItem
const curTask = await jianghuKnex('task').where({ taskId }).select().first();
const { operationAt: curOperationAt } = curTask
if (!dayjs(operationAt).isSame(dayjs(curOperationAt))) {
throw new Error("审批信息已更新,请重新刷新页面!")
}
}
}
module.exports = TaskService;