完善订单成本编辑与多商品置换,修正锁价跨天作废回池

This commit is contained in:
summer committed 2026-11-24 21:11:32 +08:00
1 parent a3262a455d
commit 2e4e7dad55
25 files changed
+430 -109

No files matched your search

+1 -1
View File
@@ -151,7 +151,7 @@ function priceLockDeliveryInventoryHTML(lock,draft={},index=0){
return `<div class="internal lock-line-inventory"><h3>本件金料与库存确认</h3><div data-lock-count-source hidden>${choice('成品来源','count_source',[['stocked','已在货盘'],['receive','本次新入库']],draft.inventory?.countSource||'stocked')}<p class="small muted">只确认本次交付成品的实际对数。选本次新入库时,对数先入库一次再销售出库;原锁及补重金料的克重另行核对。</p></div><div class="grid two">${choice('原锁金料是否已记入本件货盘','original_stock',[['','请选择'],['receive','尚未记入,交付时先入库'],['stocked',pool?'料池已预留,仅出库,不重复入库':'此前已记入,只出库']],pool?'stocked':draft.inventory?.original||'')}<div ${part('material-breakdown')} class="lock-material-breakdown" aria-live="polite"></div></div><div ${part('extra-material')} class="lock-extra-material" hidden><h3>本件超出原锁克重的补重金料</h3><div class="grid three">${moneyField('补重进货料价(元/克)','extra_rate',draft.extraMaterial?.rate??'')}${choice('补重料费付款人','extra_payer',[['','请选择'],...teamMemberOptions()],draft.extraMaterial?.payer||'')}${choice('补重金料是否已记入本件货盘','extra_stock',[['','请选择'],['receive','尚未记入,交付时先入库'],['stocked','此前已记入,只出库']],draft.inventory?.extra||'')}</div><label class="check"><input type="checkbox" name="extra_verified" ${draft.extraMaterial?.verified?'checked':''}>已核实本件补重料费实际付款。</label></div><p ${part('stock-note')} class="note" aria-live="polite"></p></div>`;
}
function priceLockFacts(lock){
const voided=lock.status==='cancelled'?'<div class="note price-lock-voided-note"><strong>这张锁价单已作废</strong><p>客户收款、手填购料和信用卡手续费有效记账已撤销,料池预留已释放。下方原录入克重、售价和成本保留用于追溯,不计当前有效收付。</p></div>':'';
const voided=lock.status==='cancelled'?`<div class="note price-lock-voided-note"><strong>这张锁价单已作废</strong><p>客户收款、手填购料和信用卡手续费有效记账已撤销,料池预留已释放。下方原录入克重、售价和成本保留用于追溯,不计当前有效收付。</p>${(lock.cancellationReturns||[]).map(row=>`<p>商品 ${row.line_index+1} · ${e(row.date)} 按原成本回池:<strong>${grams(row.mg)}g / ¥${yuan(row.amount)}</strong>,参与回池当天加权;原料池日期 ${e(row.origin_pool_id)}。</p>`).join('')}</div>`:'';
const rows=priceLockLines(lock);
if(rows.length>1){
const mg=rows.reduce((sum,row)=>sum+row.locked_mg,0),pending=rows.some(priceLockMaterialPending),amount=rows.reduce((sum,row)=>sum+(row.material_amount??0),0);