feat: 采购申请新增库管'完结'功能(仿出库审批)

- 后端:approve 接口支持 action=close(已通过→已完结 status 1→4),模型 status_text 支持已完结
- 前端:采购申请状态tab加'已完结',已通过单显示'完结'按钮(库管)
This commit is contained in:
yueli
2026-09-01 16:15:48 +08:00
parent a2d3a2c43a
commit fbb4160787
4 changed files with 48 additions and 7 deletions

View File

@ -206,7 +206,7 @@ def approve_purchase_request(purchase_id):
action = data.get('action', 'approve')
reject_reason = data.get('reject_reason')
if action not in ('approve', 'reject'):
if action not in ('approve', 'reject', 'close'):
return jsonify({'code': 400, 'msg': '无效的审批操作'}), 400
if action == 'reject' and not reject_reason:
@ -219,7 +219,7 @@ def approve_purchase_request(purchase_id):
reject_reason=reject_reason
)
msg = '审批通过' if action == 'approve' else '已驳回'
msg = '审批通过' if action == 'approve' else ('已驳回' if action == 'reject' else '已完结')
# ★ Fail-Closed: 审批响应剥离价格字段
resp = purchase.to_dict()
for k in ('unit_price', 'total_price', 'tax_rate'):