diff --git a/tests/order-rules/huizhou-ui.test.cjs b/tests/order-rules/huizhou-ui.test.cjs index df24bc3..099806c 100644 --- a/tests/order-rules/huizhou-ui.test.cjs +++ b/tests/order-rules/huizhou-ui.test.cjs @@ -80,3 +80,16 @@ test('record lists and details show independent results and batch modes without await page.getByRole('button',{name:'关闭详情',exact:true}).click();await page.goto(f.base+'/#notification-batches?scope=all');const batch=page.locator('tr').filter({has:page.getByText('hui-batch',{exact:true})});await batch.waitFor();assert.match(await batch.innerText(),/惠州通知/);await batch.getByRole('button',{name:'查看详情',exact:true}).click();await dialog.getByRole('heading',{name:'保存核验结论',exact:true}).waitFor();assert.match(await dialog.textContent(),/通知模式惠州通知/);assert.equal(await dialog.getByRole('button',{name:'人工补发原冻结批次',exact:true}).count(),0); await page.setViewportSize({width:390,height:844});assert.equal(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth),true); }); + +test('order list retains execution failure and conflict causes beside independent notification results',{timeout:90000},async t=>{ + const f=await fixture(t),{runtime,page}=f; + const cases=[{id:'execution-failed',status:'failed',error:'归档读取校验失败,通知尚待处理'},{id:'execution-conflict',status:'blocked',error:'新来源修订与已归档版本冲突,请核对',conflict:true}]; + for(const item of cases){ + runtime.orderRules.put('orders',{id:item.id,status:'sent',error:'普通路已有结果说明',event:{connectionId:'c',orderNo:item.id,receivedAt:'2026-10-21T01:00:00Z'},notifications:{huizhou:{status:'pending',batchId:null,error:'惠州路独立等待原因',orderNos:['H-200'],issues:[]}}}); + runtime.orderRules.put('execution-tasks',{id:'task-'+item.id,orderId:item.id,connectionId:'c',version:1,status:item.status,error:item.error,conflict:item.conflict||false,row:{orderNo:item.id}}); + } + runtime.orderRules.put('execution-tasks',{id:'bare-execution',connectionId:'c',version:1,status:'failed',error:'尚未生成订单的采集失败',row:{orderNo:'bare-execution'}}); + await f.open('#notification-orders'); + for(const item of cases){const row=page.locator('tr').filter({has:page.getByText(item.id,{exact:true})});await row.waitFor();const text=await row.innerText();assert.ok(text.includes(item.error),text);assert.match(text,/普通通知.*已提交邮件服务器/s);assert.match(text,/惠州通知.*等待汇总/s);assert.match(text,/普通路已有结果说明/);assert.match(text,/惠州路独立等待原因/);} + const bare=page.locator('tr').filter({has:page.getByText('bare-execution',{exact:true})});assert.match(await bare.innerText(),/尚未生成订单的采集失败/);assert.doesNotMatch(await bare.innerText(),/普通通知|惠州通知/); +}); diff --git a/web/modules/order-notifications/records.js b/web/modules/order-notifications/records.js index 906eaeb..cb12581 100644 --- a/web/modules/order-notifications/records.js +++ b/web/modules/order-notifications/records.js @@ -9,7 +9,7 @@ window.BusinessRecordViews=(()=>{ const input=(name,label,type='text')=>``; container.innerHTML=`
读取授权待办、采集真实字段、生成 PDF 并归档;BPM 节点由人工办理。邮件按独立开关和批次调度发送。
| ${kind==='orders'?'订单 / 类别':'主题 / 类别'} | 状态与原因 | 接收 / 创建时间 | 详情 |
|---|---|---|---|
| ${esc(row.orderNo||row.subject||row.id)} ${esc(catalogs.categories.get(row.categoryId)||row.categoryId||'未分类')} ${kind==='batches'?''+(row.notificationMode==='huizhou'?'惠州通知':'普通通知')+'':''} | ${esc(labels[row.status]||row.status)}${kind==='orders'&&row.notifications?['normal','huizhou'].map(mode=>{const notice=row.notifications[mode];return notice?' '+(mode==='huizhou'?'惠州通知':'普通通知')+':'+esc(labels[notice.status]||notice.status)+' ':'';}).join(''):''}'+esc(notice.error||'')+' '+(notice.issues?.length?''+notice.issues.map(esc).join(';')+' ':'')+'${esc(row.reason||(!row.notifications?row.error:'')||'')} | ${esc(formatDate(row.receivedAt||row.createdAt))} | |
| 暂无匹配记录 | |||
| ${kind==='orders'?'订单 / 类别':'主题 / 类别'} | 状态与原因 | 接收 / 创建时间 | 详情 |
|---|---|---|---|
| ${esc(row.orderNo||row.subject||row.id)} ${esc(catalogs.categories.get(row.categoryId)||row.categoryId||'未分类')} ${kind==='batches'?''+(row.notificationMode==='huizhou'?'惠州通知':'普通通知')+'':''} | ${esc(labels[row.status]||row.status)}${kind==='orders'&&row.notifications?['normal','huizhou'].map(mode=>{const notice=row.notifications[mode];return notice?' '+(mode==='huizhou'?'惠州通知':'普通通知')+':'+esc(labels[notice.status]||notice.status)+' ':'';}).join(''):''}'+esc(notice.error||'')+' '+(notice.issues?.length?''+notice.issues.map(esc).join(';')+' ':'')+'${esc(row.error||row.reason||'')} | ${esc(formatDate(row.receivedAt||row.createdAt))} | |
| 暂无匹配记录 | |||