diff --git a/tests/order-rules/huizhou-ui.test.cjs b/tests/order-rules/huizhou-ui.test.cjs new file mode 100644 index 0000000..df24bc3 --- /dev/null +++ b/tests/order-rules/huizhou-ui.test.cjs @@ -0,0 +1,82 @@ +'use strict'; +const test=require('node:test'),assert=require('node:assert/strict'),fs=require('node:fs/promises'),os=require('node:os'),path=require('node:path'); +const {startTestDashboard,login}=require('../fixtures/dashboard-runtime.cjs'); +const {activateReferenceMapping}=require('../fixtures/activate-field-mapping.cjs'); +const {loadPlaywright,browserOptions}=require('../../src/platform/browser.cjs'); +const mixed='订单号:O-100机芯号:CORE-O客户简称:普通客户总数量:10\n业务模式:惠州数字毛利:绿标订单号:H-200机芯号:CORE-H客户简称:惠州创维数字技术有限公司总数量:20'; +async function fixture(t){ + const dir=await fs.mkdtemp(path.join(os.tmpdir(),'hui-ui-')),runtime=await startTestDashboard({stateDir:dir,mailHistory:true}),browser=await loadPlaywright().chromium.launch(browserOptions()); + t.after(async()=>{await browser.close();await runtime.close();await fs.rm(dir,{recursive:true,force:true});}); + const mail=runtime.mail.store,channel=mail.saveChannel({name:'隔离模板邮箱',email:'orders@example.test',senders:['author@example.test'],enabled:false,smtp:{host:'smtp.example.test',port:465,security:'tls',user:'orders',password:'Isolated-test-password'},imap:{host:'imap.example.test',port:993,security:'tls',user:'orders',password:'Isolated-test-password'}});let uid=0; + function pending(subject){const n=++uid,parsed={subject,scope:'',text:'业务访问 https://example.test/business\n{{订单明细}}',html:'',sender:'author@example.test',attachments:[]},raw=Buffer.from('isolated template '+n);return mail.ingest(channel.id,'isolated',n,parsed,raw,channel.version);} + function template(mode,subject){const d=pending(subject);return mail.confirm(d.id,{version:d.version,subject,scope:'',notificationMode:mode,useText:false},'admin');} + const normal=template('normal','普通 {{订单号}}'),hui=template('huizhou','惠州 {{订单号}}');runtime.orderRules.templateResolver=(category,rule,mode='normal')=>require('../../src/modules/mail/rule-template.cjs').ruleTemplate(mail,category,rule,mode); + const page=await browser.newPage({viewport:{width:1440,height:1000}});page.setDefaultTimeout(6000); + const errors=[];page.on('pageerror',e=>errors.push(e.message));t.after(()=>assert.deepEqual(errors,[])); + const base='http://127.0.0.1:'+runtime.server.address().port; + return {runtime,page,browser,base,normal,hui,pending,async open(route='#order-rules'){await page.goto(base+'/'+route);await login(page);},configure(extra={}){const old=runtime.orderRules.get('rules','bs-change').draft;return runtime.orderRules.saveRule({...old,to:['owner@example.test'],cc:['copy@example.test'],archiveDirectory:'\\\\fixture\\orders',filenameDate:'receivedAt',bodyTemplateId:normal.id,huizhouEnabled:true,huizhouTemplateId:hui.id,...extra},'admin');}}; +} + +test('Hui selector filters modes, saves and reloads without extra recipients, retaining failed and unsaved edits',{timeout:90000},async t=>{ + const f=await fixture(t),{page,runtime}=f;await f.open();await page.locator('[data-rule-id="bs-change"]').click(); + const toggle=page.getByRole('switch',{name:'额外发送惠州通知',exact:true}),choice=page.getByLabel('惠州邮件模板',{exact:true}); + assert.equal(await toggle.isChecked(),false);assert.equal(await choice.isVisible(),false); + assert.deepEqual(await page.getByLabel('邮件模板',{exact:true}).locator('option').evaluateAll(options=>options.map(o=>o.value)),['',f.normal.id]); + await toggle.check();assert.equal(await choice.isVisible(),true);assert.equal(await choice.evaluate(e=>e.required),true); + assert.deepEqual(await choice.locator('option').evaluateAll(options=>options.map(o=>o.value)),['',f.hui.id]); + assert.equal(await page.locator('[name=to]').count(),1);assert.equal(await page.locator('[name=cc]').count(),1);assert.equal(await page.locator('[name=attachPdf]').count(),1); + await choice.selectOption(f.hui.id);await page.getByLabel('收件人',{exact:true}).fill('owner@example.test');await page.getByLabel('抄送人',{exact:true}).fill('copy@example.test'); + await page.getByRole('button',{name:'保存草稿',exact:true}).click();await page.getByText('规则草稿已保存。',{exact:true}).waitFor(); + let draft=runtime.orderRules.get('rules','bs-change').draft;assert.equal(draft.huizhouEnabled,true);assert.equal(draft.huizhouTemplateId,f.hui.id);assert.deepEqual(draft.to,['owner@example.test']);assert.deepEqual(draft.cc,['copy@example.test']); + assert.equal(await toggle.isChecked(),true);assert.equal(await choice.inputValue(),f.hui.id); + let requests=0;await page.route('**/api/order-rules/rules',async route=>{requests++;await new Promise(r=>setTimeout(r,100));await route.fulfill({status:503,json:{error:'隔离保存失败'}});}); + await toggle.uncheck();await page.getByRole('button',{name:'保存草稿',exact:true}).dblclick();await page.getByText('隔离保存失败',{exact:true}).waitFor();assert.equal(requests,1); + assert.equal(await toggle.isChecked(),false);assert.equal(await choice.isVisible(),false);assert.equal(await choice.evaluate(e=>e.required),false);assert.equal(await page.evaluate(()=>PageLifecycle.dirty()),true); + await page.locator('[data-rule-id="bs-notice"]').click();await page.getByRole('button',{name:'留在此页',exact:true}).click();assert.equal(await toggle.isChecked(),false); + await page.locator('[data-rule-id="bs-notice"]').click();await page.getByRole('button',{name:'放弃并继续',exact:true}).click();await page.locator('[data-rule-id="bs-change"]').click();assert.equal(await toggle.isChecked(),true); + await page.unroute('**/api/order-rules/rules');await toggle.uncheck();await page.getByRole('button',{name:'保存草稿',exact:true}).click();await page.getByText('规则草稿已保存。',{exact:true}).waitFor();draft=runtime.orderRules.get('rules','bs-change').draft;assert.equal(draft.huizhouEnabled,false);assert.equal(draft.huizhouTemplateId,f.hui.id); + await page.setViewportSize({width:390,height:844});assert.equal(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth),true);assert.equal(runtime.orderRules.settings().enabled,false); +}); + +test('viewers can inspect Hui choices but cannot edit rules or confirm template modes',{timeout:90000},async t=>{ + const f=await fixture(t),{page,runtime}=f;f.configure();runtime.store.addUser({username:'viewer',password:'Test-password-123',role:'viewer'},'admin'); + await page.goto(f.base+'/#order-rules');await page.getByLabel('账号',{exact:true}).fill('viewer');await page.getByLabel('密码',{exact:true}).fill('Test-password-123');await page.getByRole('button',{name:'登录',exact:true}).click();await page.locator('[data-rule-id="bs-change"]').click(); + assert.equal(await page.getByRole('switch',{name:'额外发送惠州通知',exact:true}).isDisabled(),true);assert.equal(await page.getByLabel('惠州邮件模板',{exact:true}).isDisabled(),true);assert.equal(await page.getByRole('button',{name:'保存草稿',exact:true}).count(),0); + const pending=f.pending('只读模板');await page.goto(f.base+'/#templates');await page.locator('[data-template="'+pending.id+'"]').click();assert.equal(await page.getByLabel('通知模式',{exact:true}).isDisabled(),true);assert.equal(await page.getByRole('button',{name:'确认生效',exact:true}).count(),0); +}); + +test('template confirmation sends selected Hui mode and lists mode-specific published usage',{timeout:90000},async t=>{ + const f=await fixture(t),{page,runtime}=f,rule=f.configure(),record=runtime.orderRules.get('rules',rule.id);record.published={...rule,status:'enabled'};runtime.orderRules.put('rules',record); + const pending=f.pending('新惠州模板');await f.open('#templates');await page.locator('[data-template="'+pending.id+'"]').click();await page.getByLabel('通知模式',{exact:true}).selectOption('huizhou');assert.match(await page.locator('#template-review .card-header').innerText(),/惠州通知/);assert.doesNotMatch(await page.locator('#template-review .card-header').innerText(),/普通通知/); + await page.getByRole('button',{name:'关闭',exact:true}).click();await page.getByRole('button',{name:'留在此页',exact:true}).click();assert.equal(await page.getByLabel('通知模式',{exact:true}).inputValue(),'huizhou'); + let failed=true;await page.route('**/api/mail/templates/'+pending.id+'/confirm',r=>failed?r.fulfill({status:503,json:{error:'隔离模板确认失败'}}):r.continue());await page.getByRole('button',{name:'确认生效',exact:true}).click();await page.getByText('隔离模板确认失败',{exact:true}).waitFor();assert.equal(await page.getByLabel('通知模式',{exact:true}).inputValue(),'huizhou');assert.equal(await page.evaluate(()=>PageLifecycle.dirty()),true); + failed=false;await page.getByRole('button',{name:'确认生效',exact:true}).click();await page.getByText('模板已确认生效。',{exact:true}).waitFor();assert.equal(runtime.mail.store.template(pending.id).notificationMode,'huizhou');assert.equal(runtime.mail.store.template(f.normal.id).status,'active'); + await page.getByLabel('模板状态',{exact:true}).selectOption('active');const normalRow=page.locator('tr').filter({has:page.locator('[data-template="'+f.normal.id+'"]')});assert.match(await normalRow.innerText(),/普通通知/); + const huiRow=page.locator('tr').filter({has:page.locator('[data-template="'+pending.id+'"]')});assert.match(await huiRow.innerText(),/惠州通知/); + const usage=page.locator('#category-templates .list-group-item').filter({hasText:'备损订单更改通知书'});assert.match(await usage.innerText(),/普通通知:普通 \{\{订单号\}\}/);assert.match(await usage.innerText(),/惠州通知:惠州 \{\{订单号\}\}/);assert.doesNotMatch(await usage.innerText(),/新惠州模板/); +}); + +test('real trial separates mixed Hui mail and exposes no-match and uncertain selections',{timeout:90000},async t=>{ + const f=await fixture(t),{runtime,page}=f,reference=require('../../src/modules/order-rules/catalog.cjs').adapters.find(a=>a.id==='bs-change');activateReferenceMapping(runtime.orderRules,'bs-change',{title:mixed,fields:{[reference.fields.orderNo]:'O-100'}});f.configure();await f.open();await page.locator('[data-rule-id="bs-change"]').click();await page.getByRole('button',{name:'检查识别结果',exact:true}).click(); + const normal=page.locator('[data-notification-preview="normal"]'),hui=page.locator('[data-notification-preview="huizhou"]');await hui.waitFor(); + assert.match(await normal.locator('pre').textContent(),/O-100/);assert.match(await normal.locator('pre').textContent(),/H-200/);assert.match(await hui.locator('pre').textContent(),/H-200/);assert.doesNotMatch((await hui.locator('dd').first().textContent())+(await hui.locator('pre').textContent()),/O-100|CORE-O/);assert.match(await hui.textContent(),/owner@example.test/);assert.match(await hui.textContent(),/copy@example.test/);assert.equal(await hui.locator('dd').last().textContent(),await normal.locator('dd').last().textContent());assert.match(await hui.locator('dd').last().textContent(),/O-100.*\.pdf/);assert.doesNotMatch(await page.locator('#order-rule-preview-result').textContent(),/额外通知规则尚未确认/); + await fs.mkdir('output/verification',{recursive:true});await page.screenshot({path:'output/verification/huizhou-task3-preview-desktop.png',fullPage:true}); + for(const [title,status] of [['订单号:O-100客户简称:普通客户','empty'],['订单号:HA200客户简称:未知客户','blocked']]){ + // Use the real capture/mapping pipeline for each selection; storage is isolated per test. + const sample={...structuredClone(reference.sample),demo:false,title,taskId:'ui-'+status,fields:{...reference.sample.fields,[reference.fields.orderNo]:status==='empty'?'O-100':'HA200'}}; + const captured=runtime.orderRules.recordCapture({sample,taskId:'ui-'+status,snapshot:{processVersion:sample.processVersion,fields:Object.entries(sample.fields).map(([path,value])=>({path,value}))}}); + await page.getByRole('button',{name:'刷新规则与字段',exact:true}).click();await page.locator('[data-rule-id="bs-change"]').click();await page.locator('#order-rule-sample-source').selectOption('capture:'+captured.id);await page.getByRole('button',{name:'检查识别结果',exact:true}).click();await page.locator('[data-notification-preview="huizhou"][data-notification-status="'+status+'"]').waitFor(); + assert.match(await page.locator('[data-notification-preview="huizhou"]').textContent(),status==='empty'?/未匹配惠州明细/:/需核实|不能|无法|不足|确认/); + } + await page.setViewportSize({width:390,height:844});assert.equal(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth),true);await page.screenshot({path:'output/verification/huizhou-task3-preview-mobile.png',fullPage:true}); +}); + +test('record lists and details show independent results and batch modes without changing recovery targets',{timeout:90000},async t=>{ + const f=await fixture(t),{runtime,page}=f; + runtime.orderRules.put('orders',{id:'dual-order',categoryId:'bs-change',status:'sent',batchId:'normal-batch',event:{connectionId:'c',orderNo:'O-100',receivedAt:'2026-10-21T01:00:00Z'},notifications:{huizhou:{status:'unknown',batchId:'hui-batch',error:'惠州连接结果不明',orderNos:['H-200'],issues:['仅惠州待核实']}},createdAt:'2026-10-21T01:00:00Z'}); + for(const [id,mode,status] of [['normal-batch','normal','sent'],['hui-batch','huizhou','unknown']])runtime.orderRules.put('batches',{id,version:1,notificationMode:mode,status,categoryId:'bs-change',subject:id,orderIds:['dual-order'],orderNos:mode==='huizhou'?['H-200']:['O-100','H-200'],text:'冻结正文',to:['owner@example.test'],cc:[],attachments:[]}); + await f.open('#notification-orders');const row=page.locator('tr').filter({has:page.getByText('O-100',{exact:true})});await row.waitFor();assert.match(await row.innerText(),/普通通知.*已提交邮件服务器/s);assert.match(await row.innerText(),/惠州通知.*待核实/s); + await row.getByRole('button',{name:'查看详情',exact:true}).click();const dialog=page.getByRole('dialog',{name:'业务详情'});await dialog.getByRole('heading',{name:'惠州通知',exact:true}).waitFor();assert.match(await dialog.textContent(),/H-200/);assert.match(await dialog.textContent(),/惠州连接结果不明/);assert.equal(await dialog.getByRole('button',{name:'人工补发原冻结批次',exact:true}).count(),0); + await page.getByRole('button',{name:'关闭详情',exact:true}).click();await page.goto(f.base+'/#notification-batches?scope=all');const batch=page.locator('tr').filter({has:page.getByText('hui-batch',{exact:true})});await batch.waitFor();assert.match(await batch.innerText(),/惠州通知/);await batch.getByRole('button',{name:'查看详情',exact:true}).click();await dialog.getByRole('heading',{name:'保存核验结论',exact:true}).waitFor();assert.match(await dialog.textContent(),/通知模式惠州通知/);assert.equal(await dialog.getByRole('button',{name:'人工补发原冻结批次',exact:true}).count(),0); + await page.setViewportSize({width:390,height:844});assert.equal(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth),true); +}); diff --git a/web/app.js b/web/app.js index e245873..28e3e73 100644 --- a/web/app.js +++ b/web/app.js @@ -58,14 +58,15 @@ async function viewSchedule(container,isActive=()=>true) { } async function viewTemplates(container,isActive=()=>true){ container.innerHTML='
| 时间(北京时间) | 操作人 | 操作 | 详情 |
|---|---|---|---|
| ${formatDate(item.at)} | ${esc(item.actor)} | ${esc(window.WorkspaceViews.activityText(item.action))} | ${esc(item.detail)} |
向托管邮箱发送 [模板][产品线]发信标题,新版本将在这里等待确认。未填写产品线时作为默认模板。
{{产品线}}、{{订单号}}、{{日期}}、{{订单列表}}、{{订单明细}}、{{存放地址}}、{{类别名称}}| 标题 / 范围 | 来源 | |
|---|---|---|
${esc(t.subject)} ${esc(t.scope||'默认模板')} · ${stateBadge(t)} · ${t.attachmentCount} 个附件 | ${esc(data.channels.find(c=>c.id===t.channelId)?.name||'旧模板草稿')} ${esc(t.sender)} ${formatDate(t.createdAt)} |
| 标题 / 范围 | 来源 | |
|---|---|---|
${esc(t.subject)} ${esc(t.scope||'默认模板')} · ${modeBadge(t)} · ${stateBadge(t)} · ${t.attachmentCount} 个附件 | ${esc(data.channels.find(c=>c.id===t.channelId)?.name||'旧模板草稿')} ${esc(t.sender)} ${formatDate(t.createdAt)} |
归档代次 ${esc(d.archiveGeneration)} · ${esc(formatDate(d.archivedAt))}
${d.files.map(f=>`${esc(f.name||'下载归档 PDF')} · ${esc(f.size)} 字节
`).join('')||'尚无可验证归档文件
'}${esc(b.subject||b.id)} · ${esc(statuses[b.status]||b.status)}
`).join('')||'尚未编入批次
'}${t?.exceptionId?`处理关联异常`:''}${t?.revisionEvidence?`| 信息 | 原修订 | 新修订 |
|---|---|---|
| ${esc(key)} | ${esc(t.revisionEvidence.previous[key]||'—')} | ${esc(t.revisionEvidence.incoming[key]||'—')} |
归档代次 ${esc(d.archiveGeneration)} · ${esc(formatDate(d.archivedAt))}
${d.files.map(f=>`${esc(f.name||'下载归档 PDF')} · ${esc(f.size)} 字节
`).join('')||'尚无可验证归档文件
'}${esc(b.subject||b.id)} · ${b.notificationMode==='huizhou'?'惠州通知':'普通通知'} · ${esc(statuses[b.status]||b.status)}
`).join('')||'尚未编入批次
'}${t?.exceptionId?`处理关联异常`:''}${t?.revisionEvidence?`| 信息 | 原修订 | 新修订 |
|---|---|---|
| ${esc(key)} | ${esc(t.revisionEvidence.previous[key]||'—')} | ${esc(t.revisionEvidence.incoming[key]||'—')} |
${esc(d.text||'无正文')}${esc(a.name||a.filename)} · ${esc(a.size||'—')} 字节
`).join('')||'无附件'}SMTP 接受不代表最终送达。结果不明时必须先核验,不会自动补发。
${user.role==='admin'&&d.status==='unknown'?form('resolve','保存核验结论',''):''}${user.role==='admin'&&d.status==='failed'?form('resend','人工补发原冻结批次'):''}`;} + function batchBody(d){return `${esc(d.text||'无正文')}${esc(a.name||a.filename)} · ${esc(a.size||'—')} 字节
`).join('')||'无附件'}SMTP 接受不代表最终送达。结果不明时必须先核验,不会自动补发。
${user.role==='admin'&&d.status==='unknown'?form('resolve','保存核验结论',''):''}${user.role==='admin'&&d.status==='failed'?form('resend','人工补发原冻结批次'):''}`;} async function load(kind,id,trigger){ const request=++revision;controller?.abort();controller=new AbortController();panel.show('正在加载详情…
',trigger); try{const d=await api('/order-rules/'+kind+'/'+encodeURIComponent(id),undefined,{signal:controller.signal});if(!isActive()||request!==revision)return; diff --git a/web/modules/order-notifications/records.js b/web/modules/order-notifications/records.js index 10537cc..906eaeb 100644 --- a/web/modules/order-notifications/records.js +++ b/web/modules/order-notifications/records.js @@ -3,13 +3,13 @@ window.BusinessRecordViews=(()=>{ async function render(container,options,kind){ const {api,esc,formatDate,user,isActive}=options,view=kind==='orders'?'notification-orders':'notification-batches',filters=window.RecordState.read(view); const states=kind==='orders'?['identified','preparing','archived','pending','batched','blocked','failed','unknown','sent','capturing','archiving','ignored']:['prepared','sending','unknown','failed','sent','cancelled']; - const labels={ignored:'历史保留,不自动补发',identified:'已识别',preparing:'准备归档',archived:'已归档',pending:'等待汇总',batched:'已编入批次',blocked:'受阻',failed:'失败',unknown:'待核实',sent:'已提交邮件服务器',capturing:'采集中',archiving:'归档中',prepared:'已冻结待发',sending:'发送中',cancelled:'已取消'}; + const labels={disabled:'未开启',empty:'无匹配惠州明细',not_applicable:'历史订单,不追加通知',ignored:'历史保留,不自动补发',identified:'已识别',preparing:'准备归档',archived:'已归档',pending:'等待汇总',batched:'已编入批次',blocked:'受阻',failed:'失败',unknown:'待核实',sent:'已提交邮件服务器',capturing:'采集中',archiving:'归档中',prepared:'已冻结待发',sending:'发送中',cancelled:'已取消'}; const catalogs={categories:new Map(),connections:new Map()}; const select=(name,label)=>``; const input=(name,label,type='text')=>``; container.innerHTML=`读取授权待办、采集真实字段、生成 PDF 并归档;BPM 节点由人工办理。邮件按独立开关和批次调度发送。
| ${kind==='orders'?'订单 / 类别':'主题 / 类别'} | 状态与原因 | 接收 / 创建时间 | 详情 |
|---|---|---|---|
| ${esc(row.orderNo||row.subject||row.id)} ${esc(catalogs.categories.get(row.categoryId)||row.categoryId||'未分类')} | ${esc(labels[row.status]||row.status)} ${esc(row.error||row.reason||'')} | ${esc(formatDate(row.receivedAt||row.createdAt))} | |
| 暂无匹配记录 | |||
| ${kind==='orders'?'订单 / 类别':'主题 / 类别'} | 状态与原因 | 接收 / 创建时间 | 详情 |
|---|---|---|---|
| ${esc(row.orderNo||row.subject||row.id)} ${esc(catalogs.categories.get(row.categoryId)||row.categoryId||'未分类')} ${kind==='batches'?''+(row.notificationMode==='huizhou'?'惠州通知':'普通通知')+'':''} | ${esc(labels[row.status]||row.status)}${kind==='orders'&&row.notifications?['normal','huizhou'].map(mode=>{const notice=row.notifications[mode];return notice?' '+(mode==='huizhou'?'惠州通知':'普通通知')+':'+esc(labels[notice.status]||notice.status)+' ':'';}).join(''):''}'+esc(notice.error||'')+' '+(notice.issues?.length?''+notice.issues.map(esc).join(';')+' ':'')+'${esc(row.reason||(!row.notifications?row.error:'')||'')} | ${esc(formatDate(row.receivedAt||row.createdAt))} | |
| 暂无匹配记录 | |||
'+esc(describe(rule))+'
检查不会归档、发信或办理 BPM。发送时段在通知配置维护。
')+ (admin?'':'')+''; } - function read(form,rule,adapters=[]){const result={...rule};for(const name of ['name','archiveDirectory','subjectPrefix','intro','signature','filenameDate'])result[name]=form.elements.namedItem(name).value.trim();result.scopes=window.OrderRuleScopes.read(form);result.processNames=[...new Set(result.scopes.map(r=>r.processName).filter(Boolean))];result.nodeNames=[...new Set(result.scopes.map(r=>r.nodeName).filter(Boolean))];result.adapterIds=adaptersFor(result,adapters);const template=form.elements.namedItem('bodyTemplateId').value;if(template==='__legacy__')delete result.bodyTemplateId;else result.bodyTemplateId=template;for(const name of ['to','cc'])result[name]=list(form.elements.namedItem(name).value);result.attachPdf=form.elements.namedItem('attachPdf').checked;return result;} + function read(form,rule,adapters=[]){const result={...rule};for(const name of ['name','archiveDirectory','subjectPrefix','intro','signature','filenameDate'])result[name]=form.elements.namedItem(name).value.trim();result.scopes=window.OrderRuleScopes.read(form);result.processNames=[...new Set(result.scopes.map(r=>r.processName).filter(Boolean))];result.nodeNames=[...new Set(result.scopes.map(r=>r.nodeName).filter(Boolean))];result.adapterIds=adaptersFor(result,adapters);const template=form.elements.namedItem('bodyTemplateId').value;if(template==='__legacy__')delete result.bodyTemplateId;else result.bodyTemplateId=template;result.huizhouEnabled=form.elements.namedItem('huizhouEnabled').checked;result.huizhouTemplateId=form.elements.namedItem('huizhouTemplateId').value;for(const name of ['to','cc'])result[name]=list(form.elements.namedItem(name).value);result.attachPdf=form.elements.namedItem('attachPdf').checked;return result;} window.OrderRuleEditor={render,read,describe,adaptersFor}; })(); diff --git a/web/modules/order-rules/preview.js b/web/modules/order-rules/preview.js index 3b4f345..ed89a4f 100644 --- a/web/modules/order-rules/preview.js +++ b/web/modules/order-rules/preview.js @@ -7,13 +7,18 @@ return `先在订单执行中采集 BPM 待办,再回到这里刷新。Excel 导入的是分类规则,不代替真实订单检查。
${esc(labels[notice.status]||notice.status)}
${mode==='huizhou'&¬ice.orderNos?.length?`入选惠州订单:${esc(notice.orderNos.join(';'))}
`:''}${mail?`${esc(mail.text)}| 订单信息 | 识别内容 |
|---|---|
| ${esc(labels[f.key])} | ${esc(value(f.value))} |
${esc(r.event.brief||'未取得')}${r.event.factoryHints?.length?'${esc(r.event.brief||'未取得')}${esc(plan.mail.text)}仅预览,不生成文件或发信;实际归档时会检查目录权限和文件内容。
${plan.issues?.length?`仅预览,不生成文件或发信;实际归档时会检查目录权限和文件内容。
${plan.issues?.length?`还没有已确认的邮件模板,可先使用标准汇总正文。
':''}还没有已确认的普通通知模板,可先使用标准汇总正文。
':''}尚无已确认的惠州通知模板,请先在邮件模板中按惠州模式确认。
':''}