diff --git a/mobile-app/src/core/assistant-display.ts b/mobile-app/src/core/assistant-display.ts index 3b0f402..0b1a0de 100644 --- a/mobile-app/src/core/assistant-display.ts +++ b/mobile-app/src/core/assistant-display.ts @@ -21,7 +21,10 @@ export function draftOutcome(draft:Row) { } export function draftReviewCount(draft:Row) { - return (draft.rows||[]).reduce((total:number,row:Row)=>total+Math.max(1,row._referencePricePreview?.length||0),0); + return (draft.rows||[]).reduce((total:number,row:Row)=>total+Math.max(1,row._referencePricePreview?.length||0,draft.action==='notification.send'?Math.max(Number(row._notificationPreview?.recipientCount)||0,row._notificationPreview?.recipients?.length||0):0),0); +} +export function draftNeedsRichNoticeReview(draft:Row) { + return ['notice.create','notice.update'].includes(draft.action)&&(draft.rows||[]).some((row:Row)=>/>(null),lock=useRef(false),alive=useRef(true),followLatest=useRef(true); @@ -77,11 +77,13 @@ function DraftCard({draft,currentId,busy,onAction,onInspect}:{draft:Row;currentI {(draft.errors||[]).map((e:string,j:number)=>{e})} {(draft.rows||[]).slice(0,20).map((row:Row,j:number)=>第 {j+1} 行{(draft.fields||[]).filter((f:Row)=>!f.hidden).map((f:Row)=>{f.label}:{draftFieldText(row,f)})}{draft.action==='purchase.correctPrice'&&(row._quotePreview||[]).map((q:Row,k:number)=>{q.name} · 数量 {q.quantity}报价:{q.previousPrice??'未报价'} → {q.unitPrice};金额:{q.oldAmount??'未计价'} → {q.newAmount}{q.notice})})} {(draft.rows||[]).flatMap((row:Row)=>row._referencePricePreview||[]).slice(0,20).map((row:Row,index:number)=>{row.name} · {row.spec} · 数量 {row.quantity}实际单价:{row.oldActualPrice??'未填写'} → {row.newActualPrice??'未填写'};实际金额:{row.oldActualAmount??'未填写'} → {row.newActualAmount??'未填写'}{row.clearQuote&&报价单价:{row.quotePrice??'未报价'} → {row.newQuotePrice??(row.changed?'清空(未报价)':'未报价')};报价金额:{row.oldQuoteAmount??'未报价'} → {row.newQuoteAmount??(row.changed?'清空(未报价)':'未报价')}}{row.notice};{row.clearQuote?'整批提交并同步金额与成本,清空不是0元':'不修改报价或成本'})} + {draft.action==='notification.send'&&(draft.rows||[]).slice(0,20).map((row:Row,index:number)=>row._notificationPreview&&{row._notificationPreview.scope} · 实际接收 {row._notificationPreview.recipientCount} 人{(row._notificationPreview.recipients||[]).slice(0,20).map((person:Row)=>{person.name||'未填写姓名'}({person.account}){row._notificationPreview.emailRequired?` · ${person.email}`:''})}{row._notificationPreview.notice})} {(draft.rows||[]).filter((row:Row)=>row._historyPreview).slice(0,20).map((row:Row,index:number)=>{const h=row._historyPreview;return {h.name} · {h.spec}{(h.changes||[]).map((change:Row)=>{change.label} · 更正前:{change.beforeText??change.before??'未填写'}更正后:{change.afterText??change.after??'未填写'})}实际金额:{h.oldActualAmount??'未填写'} → {h.newActualAmount??'未填写'};报价金额:{h.oldAmount??'未计价'} → {h.newAmount??'未计价'}关联入库 {h.receiptCount||0} 条,成本来源 {h.costSourceCount||0} 条;实际收货数量不变。{h.createItem&&确认后匹配或新建物品档案。}{h.categoryUpdatesArchive&&类别更正会同步物品档案及其引用页面。}{h.priceImpact?.notice&&{h.priceImpact.notice}}{h.oldStatus!==h.newStatus&&采购状态将随需求数量重新核算,请在电脑端核对完整状态。}})} {reviewCount>20&&此确认单超过 20 项,请在电脑端完整核对后办理;App 暂不开放截断确认。} } {active&&<>需要更正时可继续在下方描述,原草稿由后端保留并重新核对。 -