完善订单成本编辑与多商品置换,修正锁价跨天作废回池
This commit is contained in:
1 parent
a3262a455d
commit
2e4e7dad55
25 files changed
+430
-109
No files matched your search
@@ -37,7 +37,7 @@ function 旧料表(单据,{回收=false}={}){
|
||||
return `<section class="transaction-section"><h2>旧料(Au 黄金)</h2><table class="old-material"><colgroup><col style="width:6%"><col style="width:${回收?'24':'29'}%">${Array.from({length:回收?5:4},()=>`<col style="width:${回收?'14':'16.25'}%">`).join('')}</colgroup><thead><tr>${标题.map(值=>`<th>${值}</th>`).join('')}</tr></thead><tbody>${行||`<tr><td colspan="${标题.length}">未登记旧料明细</td></tr>`}</tbody></table><div class="weight-summary">旧料折后合计:<strong>${克重(单据.oldMg)} 克</strong></div></section>`;
|
||||
}
|
||||
function 新货表(单据){
|
||||
// 当前后端一件新货;兼容后续由同一白名单提供多行,仍只读取名称和完整克重。
|
||||
// 按客户白名单逐件输出新货,历史单件记录继续使用原字段。
|
||||
const 新货=Array.isArray(单据.new_lines)?单据.new_lines:单据.newProduct?[单据.newProduct]:[];
|
||||
return `<section class="transaction-section"><h2>换走新货</h2><table class="new-products"><thead><tr><th style="width:8%">序号</th><th>新货名称</th><th style="width:28%">全克重(克)</th></tr></thead><tbody>${新货.map((商品,序号)=>`<tr><td>${序号+1}</td><td>${escape(商品.name||'黄金新货')}</td><td>${克重(商品.quantity)}</td></tr>`).join('')||'<tr><td colspan="3">未登记新货明细</td></tr>'}</tbody></table><div class="weight-summary">换走新货全克重合计:<strong>${克重(单据.newMg)} 克</strong></div></section>`;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ function 回收正文(单据){
|
||||
function 置换正文(单据){
|
||||
const 差额=整数(单据.netSettlement,'结算金额',true),余料款=整数(单据.purchaseAmount,'余料回收款');
|
||||
const 调整=回收调整(单据,单据.surplusMg),余料说明=调整.已调整?`${克重(单据.surplusMg)} 克;回收单价 ${单价(单据.buyRate)};按单价计算 ¥${金额(调整.计算额)},核实后调整为 ¥${金额(余料款)}`:`${克重(单据.surplusMg)} 克 × ${单价(单据.buyRate)}`;
|
||||
const 附加=附加项目(单据),工费说明=单据.laborMode==='total'?`整单工费 ¥${金额(整数(单据.laborRate,'工费金额'))}`:单据.laborMode==='piece'?`¥${金额(整数(单据.laborRate,'工费单价'))}/件`:`${克重(单据.newMg)} 克 × ${单价(单据.laborRate)}`;
|
||||
const 附加=附加项目(单据),工费说明=单据.new_lines?.every(商品=>Number.isSafeInteger(商品.laborAmount)&&Number.isSafeInteger(商品.laborRate))?单据.new_lines.map(商品=>escape(商品.name)+':'+(商品.laborMode==='total'?'总额':克重(商品.quantity)+'克 × '+单价(商品.laborRate))+' = ¥'+金额(商品.laborAmount)).join('<br>'):单据.laborMode==='total'?`整单工费 ¥${金额(整数(单据.laborRate,'工费金额'))}`:单据.laborMode==='piece'?`¥${金额(整数(单据.laborRate,'工费单价'))}/件`:`${克重(单据.newMg)} 克 × ${单价(单据.laborRate)}`;
|
||||
const 费用=[
|
||||
['补金差价',`${克重(单据.differenceMg)} 克 × ${单价(单据.goldRate)}`,整数(单据.goldAmount,'补金差价'),'+'],
|
||||
['新货工费',工费说明,整数(单据.laborAmount,'新货工费'),'+'],
|
||||
|
||||
Reference in new issue
Block a user