增加订单内部备注,支持修改审批并与客户打印内容隔离
This commit is contained in:
1 parent
5e1e4c600c
commit
3ef8a16eca
16 files changed
+176
-39
No files matched your search
@@ -7,7 +7,7 @@ function orderTemplateControls(){
|
||||
}
|
||||
function orderTemplatesPanelHTML(){
|
||||
if(orderTemplateUser!==session.user.id){orderTemplateRows=null;orderTemplateSelection='';orderTemplateUser=session.user.id;}
|
||||
return `<section class="panel order-template-panel" id="order-template-panel"><div class="panel-title"><h2>开单模板</h2><span class="small muted">${teamMode()?'按成员分别保存':'麦麦与助理共用'}</span></div><div id="order-template-controls">${orderTemplateControls()}</div><p class="small muted order-template-hint">用于普通开单,可以保存未填完的表单。套用时客户留空,业务日期和费用日期用今天;每日料价随本次订单日期读取。</p><div class="small" id="order-template-status" aria-live="polite"></div></section>`;
|
||||
return `<section class="panel order-template-panel" id="order-template-panel"><div class="panel-title"><h2>开单模板</h2><span class="small muted">${teamMode()?'按成员分别保存':'麦麦与助理共用'}</span></div><div id="order-template-controls">${orderTemplateControls()}</div><p class="small muted order-template-hint">用于普通开单,可以保存未填完的表单。客户称呼和内部备注不存入模板,套用时留空;业务日期和费用日期用今天;每日料价随本次订单日期读取。</p><div class="small" id="order-template-status" aria-live="polite"></div></section>`;
|
||||
}
|
||||
function orderTemplateStatus(message,error=false){const node=$('#order-template-status');if(node){node.textContent=message;node.className='small'+(error?' danger-text':' muted');}}
|
||||
async function loadOrderTemplates(){
|
||||
@@ -53,7 +53,7 @@ function showOrderTemplateDialog(kind){
|
||||
const form=$('#order-form');if(form?.dataset.orderEdit==='true')throw new Error('订单修改中不能保存开单模板,请先保存或取消修改。');if(!form)throw new Error('请在普通开单页保存模板。');
|
||||
const row=kind==='update'?orderTemplateRows?.find(row=>row.id===orderTemplateSelection):null;if(kind==='update'&&!row)throw new Error('请先选择需要更新的模板。');
|
||||
orderTemplateEntry={kind,id:row?.id,revision:row?.revision,user:session.user.id,form};
|
||||
const dialog=orderTemplateDialog();dialog.innerHTML=`<button class="dialog-close" data-action="close-order-template" aria-label="关闭模板">×</button><h2 id="order-template-title">${row?'更新模板':'保存为新模板'}</h2><p class="small muted">将当前普通开单表单保存为预设,允许金额和克重留空。客户、日期及订单编号不存入模板;本次正在填写的客户和日期会保留。</p><form id="order-template-form">${field('模板名称','template_name',row?.name||'','text','required maxlength="60" placeholder="例如:足金手链常用报价"')}<div class="form-actions"><button class="primary" type="submit">${row?'保存更新':'保存模板'}</button>${button('取消','close-order-template','quiet')}</div><div id="order-template-error" aria-live="polite"></div></form>`;
|
||||
const dialog=orderTemplateDialog();dialog.innerHTML=`<button class="dialog-close" data-action="close-order-template" aria-label="关闭模板">×</button><h2 id="order-template-title">${row?'更新模板':'保存为新模板'}</h2><p class="small muted">将当前普通开单表单保存为预设,允许金额和克重留空。客户、内部备注、日期及订单编号不存入模板;本次正在填写的内容会保留。</p><form id="order-template-form">${field('模板名称','template_name',row?.name||'','text','required maxlength="60" placeholder="例如:足金手链常用报价"')}<div class="form-actions"><button class="primary" type="submit">${row?'保存更新':'保存模板'}</button>${button('取消','close-order-template','quiet')}</div><div id="order-template-error" aria-live="polite"></div></form>`;
|
||||
dialog.showModal();dialog.querySelector('input').focus();
|
||||
}
|
||||
async function finishOrderTemplateSave(url,input,result){
|
||||
|
||||
Reference in new issue
Block a user