feat: 物品规则接单金额可填0并限制零元发布,客服增加发单指派权限
- 物品规则接单金额允许填 0(按数量计价不受影响) - 接单金额为 0 的工单禁止发布:前端发布按钮置灰 + 后端 409 拦截 - 客服(support)获得发布工单与指派打手权限
This commit is contained in:
@@ -247,11 +247,6 @@ export async function saveAdminWorkProductRule(payload: JsonObject = {}) {
|
||||
errorCode: 'work_product_rule_sharing_amount_invalid',
|
||||
})
|
||||
}
|
||||
} else if (rewardAmount <= 0 && unitPriceFen <= 0) {
|
||||
throw createHttpError('接单金额必须大于 0', {
|
||||
statusCode: 400,
|
||||
errorCode: 'work_product_rule_reward_invalid',
|
||||
})
|
||||
}
|
||||
const finalRewardAmount = sharingEnabled ? resolvedSharingTotalAmount : rewardAmount
|
||||
|
||||
@@ -1001,6 +996,12 @@ export async function publishAdminWorkOrder(workOrderId: number | string) {
|
||||
errorCode: 'work_order_publish_status_invalid',
|
||||
})
|
||||
}
|
||||
if (Number(workOrder.reward_amount || 0) <= 0) {
|
||||
throw createHttpError('接单金额为 0,无法发布到大厅', {
|
||||
statusCode: 409,
|
||||
errorCode: 'work_order_publish_reward_invalid',
|
||||
})
|
||||
}
|
||||
const now = nowIso()
|
||||
const updated = await updateWorkOrder(workOrder.id, {
|
||||
status: WORK_ORDER_STATUS.OPEN,
|
||||
|
||||
Reference in New Issue
Block a user