开单成本改为勾选并支持按账号配置默认开单人
This commit is contained in:
1 parent
8cac61deb3
commit
6047cc360b
17 files changed
+278
-40
No files matched your search
@@ -110,7 +110,7 @@ function collectPriceLockCreate(){
|
||||
function renderPriceLockCreate(){
|
||||
const editing=typeof priceLockEditEntry!=='undefined'&&priceLockEditEntry?.user===session.user.id,edit=editing?priceLockEditEntry:null;
|
||||
const d=editing?edit.inputs:priceLockReadDraft(priceLockDraftKey())||{},lines=Array.isArray(d.lines)&&d.lines.length?d.lines:[{...d.line,material:d.material||{}}],payment=d.payment||{};
|
||||
$('#main').innerHTML=heading('GOLD PRICE LOCK',editing?'修改待交付锁价单':'黄金锁价',editing?'原单号 '+e(edit.lock.number)+';按核实后的整单资料更正,尚未交付。':'同一客户可添加多件按克黄金,每件分别锁定售价与原料来源;整单收款、整单交付。保存后暂不出入库、不计利润。',editing?button('退出修改','leave-lock-edit','quiet'):priceLockCreateControls())+`<form id="price-lock-create-form"${editing?` data-price-lock-edit-id="${e(edit.id)}"`: ''}><section class="panel"><h2>客户与锁价日期</h2><div class="grid four">${field('锁价日期','date',d.date||state.today,'date',`required max="${e(state.today)}"`)}${field('客户称呼/代号(必填)','customer',d.customer||'','text','required maxlength="60"')}${field('开单人(必填)','salesperson',d.salesperson||session.user.name,'text','required maxlength="30"')}${orderMemberField(d.member||currentMember(),editing)}</div></section><div id="lock-create-lines">${lines.map(priceLockCreateLineHTML).join('')}</div><div class="lock-add-product">${button('+ 添加商品','add-lock-line')}<span class="small muted">每件商品可自定义名称、克重、售价、工费和原锁成本。</span></div><section class="panel"><h2>客户实际已付款</h2><p class="small muted">填写整单已经收到的金额,可与预计报价不同;尚未收款填0。</p><div class="grid three">${moneyField('实际收款(元)','received_amount',payment.amount??'')}${accountFields(payment.account)}</div><label class="check"><input type="checkbox" name="payment_verified" ${payment.verified?'checked':''} required>已核实实际收款金额与账户。</label>${creditCardPreviewHTML('lock-create-card-fee',payment.credit_card_fee_payer)}</section>${editing?priceLockPendingEditReviewHTML(edit):''}<section class="panel"><div class="grid two">${moneyField('整单优惠(元)','discount',d.discount??'0')}<label>客户可见备注<textarea name="note" maxlength="170" rows="2">${e(d.note||'')}</textarea></label></div><p id="lock-sale-estimate" class="calculation small" aria-live="polite"></p><div class="form-actions"><div><span class="small muted">整单预计成交额 · 四舍五入到元</span><div id="lock-create-total" class="summary-amount">待填写</div><div class="small muted">待交付,不计利润</div></div><button class="primary" type="submit" data-lock-create-submit>${editing?(priceLockPendingNeedsApproval(edit)?'提交修改申请':'保存锁价修改'):'保存锁价待交付'}</button></div><div id="price-lock-error" aria-live="polite"></div></section></form>`;
|
||||
$('#main').innerHTML=heading('GOLD PRICE LOCK',editing?'修改待交付锁价单':'黄金锁价',editing?'原单号 '+e(edit.lock.number)+';按核实后的整单资料更正,尚未交付。':'同一客户可添加多件按克黄金,每件分别锁定售价与原料来源;整单收款、整单交付。保存后暂不出入库、不计利润。',editing?button('退出修改','leave-lock-edit','quiet'):priceLockCreateControls())+`<form id="price-lock-create-form"${editing?` data-price-lock-edit-id="${e(edit.id)}"`: ''}><section class="panel"><h2>客户与锁价日期</h2><div class="grid four">${field('锁价日期','date',d.date||state.today,'date',`required max="${e(state.today)}"`)}${field('客户称呼/代号(必填)','customer',d.customer||'','text','required maxlength="60"')}${field('开单人(必填)','salesperson',d.salesperson||(editing?session.user.name:defaultSalesperson()),'text','required maxlength="30"')}${orderMemberField(d.member||currentMember(),editing)}</div></section><div id="lock-create-lines">${lines.map(priceLockCreateLineHTML).join('')}</div><div class="lock-add-product">${button('+ 添加商品','add-lock-line')}<span class="small muted">每件商品可自定义名称、克重、售价、工费和原锁成本。</span></div><section class="panel"><h2>客户实际已付款</h2><p class="small muted">填写整单已经收到的金额,可与预计报价不同;尚未收款填0。</p><div class="grid three">${moneyField('实际收款(元)','received_amount',payment.amount??'')}${accountFields(payment.account)}</div><label class="check"><input type="checkbox" name="payment_verified" ${payment.verified?'checked':''} required>已核实实际收款金额与账户。</label>${creditCardPreviewHTML('lock-create-card-fee',payment.credit_card_fee_payer)}</section>${editing?priceLockPendingEditReviewHTML(edit):''}<section class="panel"><div class="grid two">${moneyField('整单优惠(元)','discount',d.discount??'0')}<label>客户可见备注<textarea name="note" maxlength="170" rows="2">${e(d.note||'')}</textarea></label></div><p id="lock-sale-estimate" class="calculation small" aria-live="polite"></p><div class="form-actions"><div><span class="small muted">整单预计成交额 · 四舍五入到元</span><div id="lock-create-total" class="summary-amount">待填写</div><div class="small muted">待交付,不计利润</div></div><button class="primary" type="submit" data-lock-create-submit>${editing?(priceLockPendingNeedsApproval(edit)?'提交修改申请':'保存锁价修改'):'保存锁价待交付'}</button></div><div id="price-lock-error" aria-live="polite"></div></section></form>`;
|
||||
syncPriceLockForm();loadPriceLockPoolChoices(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user