feat(todo): 交付确认待办补退回重做按钮(2026-09-17用户报障:bid_delivery_confirm只有确认单按钮无退回通道)——对齐tech_template_confirm双按钮模式:确认交付(human_task_complete)+退回重做(/pipeline-bidding/api/bid_delivery_reject.dspy,意见必填前端拦截);非pending状态渲染'已处理'不再出按钮;TYPE_LABEL/TYPE_COLOR补bid_delivery_confirm与material_supply映射(todo_detail+my_todos_popup两处)

This commit is contained in:
ymq 2026-09-17 22:25:56 +08:00
parent f0c4c10f79
commit 6b326e5563
2 changed files with 46 additions and 18 deletions

View File

@ -17,6 +17,7 @@ TYPE_LABEL = {
'bug_acceptance': 'Bug 验收',
'flow_plan_confirm': '流程裁剪确认',
'tech_template_confirm': '技术方案骨架确认',
'bid_delivery_confirm': '交付确认',
'material_supply': '实体材料缺口',
}
TYPE_COLOR = {
@ -25,6 +26,7 @@ TYPE_COLOR = {
'bug_acceptance': '#f0a040',
'flow_plan_confirm': '#7c3aed',
'tech_template_confirm': '#0891b2',
'bid_delivery_confirm': '#059669',
'material_supply': '#d97706',
}

View File

@ -24,6 +24,8 @@ TYPE_LABEL = {
'kb_ingest_confirm': '知识库入库建议',
'flow_plan_confirm': '流程裁剪确认',
'tech_template_confirm': '技术方案骨架确认',
'material_supply': '实体材料缺口',
'bid_delivery_confirm': '交付确认',
}
TYPE_COLOR = {
'requirement_confirmation': '#2563eb',
@ -32,6 +34,8 @@ TYPE_COLOR = {
'kb_ingest_confirm': '#10b981',
'flow_plan_confirm': '#7c3aed',
'tech_template_confirm': '#0891b2',
'material_supply': '#d97706',
'bid_delivery_confirm': '#059669',
}
@ -560,25 +564,47 @@ async with DBPools().sqlorContext(dbname) as sor:
md.append('')
md.append('未找到该项目的标书文件记录。')
md.append('')
# 确认交付按钮2026-09-16 修复:此分支曾只渲染文件行,忘了 action 按钮,
# 通用兜底分支又被 elif 挡住 → 待办成死卡片无法确认)。
# 通道 = human_task_complete同机构+assignee 校验);置 done 后对账器
# 确认交付/退回按钮2026-09-16 修复:此分支曾只渲染文件行,忘了 action
# 按钮,通用兜底分支又被 elif 挡住 → 待办成死卡片无法确认。
# 2026-09-17 用户报障补退回通道:原来只有「确认」单按钮,复核发现问题
# 无法打回——对齐 tech_template_confirm 的确认/驳回双按钮模式)。
# 确认通道 = human_task_complete同机构+assignee 校验);置 done 后对账器
# G 段自动收尾:标书 delivered + 项目 completed。
action_widgets.append(_input_box(
'bid_confirm_note', '交付备注(可选:用印/密封/份数/递交方式核对说明)', '可选备注'))
_ok_script = (_read_input_js('bid_confirm_note') +
"var rd=JSON.stringify({content:(cv||'确认交付')});" +
_post_js(complete_url, [('human_task_id', _json.dumps(oid)),
('result_data', 'rd')]) + _tail)
action_widgets.append({
"widgettype": "HBox",
"options": {"width": "100%", "gap": "8px", "padding": "12px 14px", "halign": "right"},
"subwidgets": [
_btn('确认交付(项目完成)', 'primary', _ok_script,
conform={"title": "确认交付", "message": "确认标书已复核(用印/密封/份数/递交)?确认后标书置为已交付、项目完成。",
"conform": {"label": "确认交付"}, "discard": {"label": "再看看"}})
]
})
# 退回通道 = /pipeline-bidding/api/bid_delivery_reject.dspy用户专属
# agent 无此工具):待办置 rejected + 标书 rejected + 派评分员按意见
# 打回问题章节 → 既有链路自动重写→重审→重合成→重评分→重发交付确认。
_bd_status = _s(getattr(h, 'status', ''))
if _bd_status != 'pending':
md.append('## 待办状态')
md.append('')
md.append('该确认已处理(当前状态:' + (_bd_status or '-') + '),无需再操作。')
md.append('')
else:
action_widgets.append(_input_box(
'bid_confirm_note', '交付备注(确认可留空;退回重做必须写明哪里要修改)',
'备注/退回意见:如用印密封核对说明,或退回时指明问题章节与修改要求'))
_ok_script = (_read_input_js('bid_confirm_note') +
"var rd=JSON.stringify({content:(cv||'确认交付')});" +
_post_js(complete_url, [('human_task_id', _json.dumps(oid)),
('result_data', 'rd')]) + _tail)
_bdj_url = entire_url("/pipeline-bidding/api/bid_delivery_reject.dspy")
_no_script = (_read_input_js('bid_confirm_note') +
"if(!cv){var mn=new bricks.Message({title:'请填写退回意见',"
"message:'退回前请说明标书哪里需要修改(评分员按意见打回章节重写)'});mn.open();return;}" +
_post_js(_bdj_url, [('human_task_id', _json.dumps(oid)),
('comment', 'cv')]) + _tail)
action_widgets.append({
"widgettype": "HBox",
"options": {"width": "100%", "gap": "8px", "padding": "12px 14px", "halign": "right"},
"subwidgets": [
_btn('确认交付(项目完成)', 'primary', _ok_script,
conform={"title": "确认交付", "message": "确认标书已复核(用印/密封/份数/递交)?确认后标书置为已交付、项目完成。",
"conform": {"label": "确认交付"}, "discard": {"label": "再看看"}}),
_btn('退回重做', 'small', _no_script,
conform={"title": "退回重做", "message": "退回后评分员将按你的意见打回问题章节重写,重新合成、评分后再次请你确认。确认退回?",
"conform": {"label": "退回重做"}, "discard": {"label": "取消"}})
]
})
elif task_type == 'flow_plan_confirm':
# 产线流程裁剪确认正文description已含裁剪方案对照表propose 时渲染),