增加货盘新增改名与启停管理,保留历史库存关联
This commit is contained in:
1 parent
337b2a709f
commit
ba15795f0a
29 files changed
+748
-218
No files matched your search
@@ -138,7 +138,7 @@ function multiPriceLockOrderEditHTML(entry){
|
||||
const html=priceLockOrderEditHTML(single),start=html.indexOf('<section class="panel internal price-lock-edit-costs">'),end=html.indexOf('<section class="panel internal"><div class="panel-title"><h2>实际费用');
|
||||
if(start<0||end<0)throw new Error('商品成本编辑内容未完整生成。');
|
||||
const fields=html.slice(start,end).replace(/id="lock-edit-manual-material"/g,'data-lock-edit-part="manual-material"').replace(/id="lock-edit-material-note"/g,'data-lock-edit-part="material-note"');
|
||||
return `<div class="lock-edit-product" data-lock-edit-line data-line-id="${e(line.lineId)}"><div class="panel lock-edit-product-heading"><h2>商品 ${index+1} · ${e(line.name)}</h2><p class="small muted">${grams(entry.order.lines[index].quantity)}g · 原锁销售金价 ¥${yuan(entry.order.lines[index].goldPrice??0)}/克 · 货盘 ${e(entry.order.lines[index].pocket||'未提供')}</p></div>${fields}</div>`;
|
||||
return `<div class="lock-edit-product" data-lock-edit-line data-line-id="${e(line.lineId)}"><div class="panel lock-edit-product-heading"><h2>商品 ${index+1} · ${e(line.name)}</h2><p class="small muted">${grams(entry.order.lines[index].quantity)}g · 原锁销售金价 ¥${yuan(entry.order.lines[index].goldPrice??0)}/克 · 货盘 ${e(pocketLabel(entry.order.lines[index].pocket)||'未提供')}</p></div>${fields}</div>`;
|
||||
}).join('');
|
||||
return `<div class="note" id="order-edit-save-intro">更正交付日期与逐件实际成本,原锁日期、销售金价、克重和收付款保留。</div>${orderEditConflictHTML(entry)}<form id="order-edit-meta-form" data-price-lock-edit="true"><section class="panel"><div class="panel-title"><h2>交付与客户资料</h2><span class="small muted">原单号 ${e(entry.order.paper_number||entry.order.number)}</span></div><div class="grid three">${field('交付日期','date',draft.date,'date',`required min="${e(lock.date)}" max="${e(state.today)}"`)}${field('客户称呼/代号(必填)','customer',draft.customer||'','text','required maxlength="60"')}${field('开单人(必填)','salesperson',draft.salesperson||'','text','required maxlength="30"')}</div><p class="small muted">原锁日期 ${e(lock.date)} · 共 ${draft.lines.length}件 · 成交 ${orderAmount(entry.order.total,entry.order.rounding_mode)}</p><label>客户单备注<textarea name="note" maxlength="240" rows="2">${e(draft.note||'')}</textarea></label>${orderInternalNoteField(draft.internal_note||'')}</section>${cards}${feeHTML(draft,{cardPreview:false})}<section class="panel"><h2>整单更正后成本预览</h2><div id="lock-edit-cost-preview" class="lock-edit-cost-preview" aria-live="polite"></div></section>${orderEditReviewHTML(entry)}</form>`;
|
||||
}
|
||||
@@ -217,7 +217,7 @@ function renderOrderEditForm(){
|
||||
}else if(!entry.financialEditable){
|
||||
$('#main').innerHTML=headingHTML+`<div class="note">${e(entry.message||intro)}</div>`+orderEditConflictHTML(entry)+`<form id="order-edit-meta-form"><section class="panel"><div class="grid two">${field('客户称呼/代号(必填)','customer',draft.customer||'','text','required maxlength="60"')}${field('开单人(必填)','salesperson',draft.salesperson||'','text','required maxlength="30"')}<label>客户单备注<textarea name="note" maxlength="240" rows="3">${e(draft.note||'')}</textarea></label></div>${orderInternalNoteField(draft.internal_note||'')}<p class="small muted">原单号 ${e(order.paper_number||order.number)} · 业务日期 ${e(order.date)} · 成交 ${orderAmount(order.total,order.rounding_mode)}</p></section>${orderEditReviewHTML(entry)}</form>`;
|
||||
}else{
|
||||
$('#main').innerHTML=headingHTML+`<div class="note" role="status" id="order-edit-save-intro">${e(intro)}本次沿用原单号 ${e(order.paper_number||order.number)}。</div>`+orderEditConflictHTML(entry)+`<form id="order-form" data-order-edit="true"><input type="hidden" name="rounding_mode" value="${e(draft.rounding_mode||'cent')}"><input type="hidden" name="orderId" value="${e(entry.id)}"><input type="hidden" name="revision" value="${e(entry.revision)}"><section class="panel"><div class="panel-title"><h2>客户与单据</h2><span class="small muted">修改内容单独暂存,可刷新后继续</span></div><div class="grid four">${dateField('date',draft.date)}${field('原纸单编号','paper_number',order.paper_number||order.number,'text','readonly')}${field('客户称呼/代号(必填)','customer',draft.customer||'','text','required maxlength="60"')}${field('开单人(必填)','salesperson',draft.salesperson||'','text','required maxlength="30"')}${accountFields(draft.payment_account)}</div><p class="small muted">选择客户实际付款的方式与收款人。修改业务日期会重新核算对应日期的订单与库存,原单号保留。</p></section><section class="panel"><div class="panel-title"><h2>商品明细</h2><span class="small muted">金价与工费分开填写</span></div><div id="lines">${draft.lines.map((line,index)=>lineHTML(line,index+1,{materialPool:true})).join('')}</div><div class="form-actions">${button('+ 添加商品','add-line')}<span class="small muted">填写本单最终实际交付的商品、克重与金额。</span></div></section>${feeHTML(draft)}<section class="panel"><div class="grid two">${moneyField('整单优惠/抹零(元)','discount',draft.discount??'0')}<label>客户单备注<textarea name="note" maxlength="240" rows="2">${e(draft.note||'')}</textarea></label></div>${orderInternalNoteField(draft.internal_note||'')}<div class="form-actions"><div><span class="small muted">更正后成交合计/客户实收</span><div id="create-total" class="summary-amount">待填写</div><div id="create-rounding-note" class="small muted order-rounding-note" aria-live="polite"></div></div></div></section>${orderEditReviewHTML(entry)}</form>`;
|
||||
$('#main').innerHTML=headingHTML+`<div class="note" role="status" id="order-edit-save-intro">${e(intro)}本次沿用原单号 ${e(order.paper_number||order.number)}。</div>`+orderEditConflictHTML(entry)+`<form id="order-form" data-order-edit="true"><input type="hidden" name="rounding_mode" value="${e(draft.rounding_mode||'cent')}"><input type="hidden" name="orderId" value="${e(entry.id)}"><input type="hidden" name="revision" value="${e(entry.revision)}"><section class="panel"><div class="panel-title"><h2>客户与单据</h2><span class="small muted">修改内容单独暂存,可刷新后继续</span></div><div class="grid four">${dateField('date',draft.date)}${field('原纸单编号','paper_number',order.paper_number||order.number,'text','readonly')}${field('客户称呼/代号(必填)','customer',draft.customer||'','text','required maxlength="60"')}${field('开单人(必填)','salesperson',draft.salesperson||'','text','required maxlength="30"')}${accountFields(draft.payment_account)}</div><p class="small muted">选择客户实际付款的方式与收款人。修改业务日期会重新核算对应日期的订单与库存,原单号保留。</p></section><section class="panel"><div class="panel-title"><h2>商品明细</h2><span class="small muted">金价与工费分开填写</span></div><div id="lines">${draft.lines.map((line,index)=>lineHTML(line,index+1,{materialPool:true,historicalPocket:!!order.lines[index]&&line.pocket===order.lines[index].pocket})).join('')}</div><div class="form-actions">${button('+ 添加商品','add-line')}<span class="small muted">填写本单最终实际交付的商品、克重与金额。</span></div></section>${feeHTML(draft)}<section class="panel"><div class="grid two">${moneyField('整单优惠/抹零(元)','discount',draft.discount??'0')}<label>客户单备注<textarea name="note" maxlength="240" rows="2">${e(draft.note||'')}</textarea></label></div>${orderInternalNoteField(draft.internal_note||'')}<div class="form-actions"><div><span class="small muted">更正后成交合计/客户实收</span><div id="create-total" class="summary-amount">待填写</div><div id="create-rounding-note" class="small muted order-rounding-note" aria-live="polite"></div></div></div></section>${orderEditReviewHTML(entry)}</form>`;
|
||||
const paymentNote=orderEditPaymentNote(order);if(paymentNote)$('#order-form [name="payment_recipient"]').closest('.grid').insertAdjacentHTML('afterend',paymentNote);
|
||||
updateTotal();loadMaterialPoolChoices(true);if(typeof loadReimbursementFundingOptions==='function')loadReimbursementFundingOptions(true);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user