新增回收置换记账及打印,完善订单标志和购料单价

This commit is contained in:
summer committed 2026-10-26 14:44:07 +08:00
1 parent 844a1fa860
commit 505110ab0e
26 files changed
+1201 -64

No files matched your search

@@ -172,3 +172,15 @@ test('保存后等待重读期间关闭、切页、换账号或改日期搜索
wait.resolve(h.context.__state);await loading;assert.equal(h.calls.filter(call=>call.url==='/api/orders/C').length,1,kind);if(kind==='close'){assert.equal(h.dialog.open,false);assert.equal(h.run('currentOrder'),null);}if(kind==='state')assert.equal(h.run('state.user.id'),'other');
}
});
test('回收在客户旁醒目标记且只读展示,置换销售单标记一次,普通订单导航不混入回收',async()=>{
const h=harness(),b=h.context.__book,recovery={id:'recovery-only',kind:'recovery',recovery_id:'recovery-only',recovery_mode:'direct',status:'recovery',number:'HS202610230001',date:D,customer:'合成回收客户',types:['黄金回收'],mg:9900,pieces:0,cashPayment:899991,note:'合成回收备注'};
b.rows.find(row=>row.id==='A').recovery_mode='exchange';b.rows.find(row=>row.id==='A').recovery_id='swap-A';
b.displayRows=[b.rows[0],recovery,...b.rows.slice(1)];b.recoveryCount=1;
await h.load();const html=h.nodes.get('#order-list').innerHTML,match=html.match(/<tr class="order-recovery">([\s\S]*?)<\/tr>/);assert.ok(match);
assert.match(match[1],/order-book-customer-name">合成回收客户<\/strong><span class="order-book-recovery-badge">回收/);
assert.match(match[1],/data-action="recovery-open" data-id="recovery-only"/);assert.match(match[1],/data-action="recovery-print"/);assert.doesNotMatch(match[1],/data-action="open-order"|data-action="copy-order"|order-review-status/);
assert.match(match[1],/回收付款 ¥8,999.91/);assert.match(match[1],/9.900g.*折后克重/);assert.equal((match[1].match(/<span class="muted">—<\/span>/g)||[]).length,5);
assert.equal((html.match(/order-book-recovery-badge is-exchange">置换/g)||[]).length,1);assert.match(h.nodes.get('#order-book-count').textContent,/汇总 3 单 · 回收 1 笔/);assert.match(h.nodes.get('#order-book-summary').innerHTML,/另有回收 1 笔/);
assert.deepEqual(h.json('orderBookDetailList.ids'),['C','A','B']);await h.open('A');assert.match(h.html(),/>2 \/ 3</);
});