第7项:按路由加载页面并核验登录和开单冷启动预算

This commit is contained in:
黄健铭 committed 2026-12-05 08:15:49 -08:00
1 parent cb705d296e
commit ea891570a9
71 files changed
+1250 -454

No files matched your search

@@ -0,0 +1,4 @@
import{n as e}from"./rolldown-runtime-Dl_DZoUm.js";import{a as t,c as n,n as r,o as i,r as a,s as o,t as s}from"./receipts-DynFWwVr.js";import{s as c,tr as l,v as u}from"./index-D422TGjj.js";import{i as d,n as f,u as p}from"./data-Cu-7m_75.js";import{t as m}from"./printStatus-Cs7T2SIH.js";import{n as h,o as g,t as _}from"./shared-Da74NgmJ.js";import{r as v,t as y}from"./format-u4LYCVYL.js";import{a as b,i as x,n as S,o as C,r as w,s as T,t as E}from"./BusinessControls-B3wlV0Qu.js";import{a as D,o as O,t as k}from"./receipt-BUADJAzs.js";import{n as A,r as j,t as M}from"./materialQuote-B1yI_Tto.js";var N=e(l(),1),P=u(),F=e=>e==null?`待填写`:`¥`+v(e),I=(e,t)=>e.pocketCatalog?.find(e=>e.key===t)?.name||t;function L(e){return e.map(e=>{let[t,n,r]=typeof e==`string`?[e,e]:e;return(0,P.jsx)(`option`,{value:String(t),disabled:!!r,children:n},String(t))})}function ee(e,t,n,r){let i=g.activePocketKeys(e),a=i.map(t=>[t,I(e,t)||t]);return t&&!i.includes(t)&&a.push([t,I(e,t)+(n?`(已停用 · 原货盘)`:`(已停用,请重新选择)`),!n]),r?[[``,r],...a]:a}function te({eye:e,title:t,sub:n,children:r}){return(0,P.jsxs)(`header`,{className:`page-heading`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`eyebrow`,children:e}),(0,P.jsx)(`h1`,{children:t}),(0,P.jsx)(`p`,{children:n})]}),(0,P.jsx)(`div`,{className:`actions`,children:r})]})}function R({id:e,title:t,close:n,action:r,children:i}){return(0,P.jsxs)(w,{id:e,onCancel:e=>{e.preventDefault(),n()},children:[(0,P.jsx)(E,{type:`button`,className:`dialog-close`,"aria-label":`关闭`+t,"data-action":r,onClick:n,children:`×`}),(0,P.jsx)(`h2`,{id:e===`recovery-dialog`?`recovery-detail-title`:`recovery-change-title`,children:t}),i]})}function ne({q:e,draft:t,input:n}){if(!e)return null;let r=n?.mode===`direct`||t?.mode===`direct`||e.mode===`direct`,i=e.defaultPurchaseAmount??e.calculatedPurchaseAmount??e.purchaseAmount;return(0,P.jsxs)(P.Fragment,{children:[e.exchangeItems?.map((e,t)=>(0,P.jsxs)(`section`,{children:[(0,P.jsxs)(`h3`,{children:[`置换商品 `,t+1,`:`,e.newProduct?.name]}),(0,P.jsx)(ne,{q:e,input:{...n?.exchange?.items?.[t],mode:`exchange`}})]},t)),(0,P.jsx)(`div`,{className:`recovery-equations`,children:r?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`p`,{children:[`回收金额:`,y(e.oldMg),`g × `,F(Math.round(Number(n?.buy_rate??t?.buy_rate??0)*100)),`/g = `,(0,P.jsx)(`strong`,{children:F(i)})]}),i!==e.purchaseAmount&&(0,P.jsxs)(`p`,{children:[`核实后实际回收款:`,(0,P.jsx)(`strong`,{children:F(e.purchaseAmount)})]})]}):(0,P.jsxs)(P.Fragment,{children:[e.differenceMg>0?(0,P.jsxs)(`p`,{children:[`补金差价:(`,y(e.newMg),` − `,y(e.oldMg),`)g ×`,` `,F(Math.round(Number(n?.exchange?.gold_price??t?.gold_price??0)*100)),`/g =`,` `,(0,P.jsx)(`strong`,{children:F(e.goldAmount)})]}):(0,P.jsx)(`p`,{children:`无需补金差价。`}),(0,P.jsxs)(`p`,{children:[`新货工费:`,n?.exchange?.products?`各件工费合计`:n?.exchange?.labor_mode===`total`?`按总额`:y(e.newMg)+`g × `+F(Math.round(Number(n?.exchange?.labor_rate||0)*100))+`/g`,` `,`= `,(0,P.jsx)(`strong`,{children:F(e.laborAmount)})]}),(0,P.jsxs)(`p`,{children:[`折旧费:`,y(e.depreciationMg),`g ×`,` `,F(Math.round(Number(n?.exchange?.depreciation_rate??t?.depreciation_rate??10)*100)),`/g = `,(0,P.jsx)(`strong`,{children:F(e.depreciationAmount)})]}),!!e.chargesAmount&&(0,P.jsxs)(`p`,{children:[`其他收费:`,F(e.chargesAmount)]}),!!e.discount&&(0,P.jsxs)(`p`,{children:[`优惠:−`,F(e.discount)]}),!!e.roundingAdjustment&&(0,P.jsxs)(`p`,{children:[`费用取整调整:`,e.roundingAdjustment>0?`+`:`−`,F(Math.abs(e.roundingAdjustment))]}),(0,P.jsxs)(`p`,{children:[`本次置换费用:`,(0,P.jsx)(`strong`,{children:F(e.receivable)})]}),e.depositMg>0?(0,P.jsxs)(`p`,{children:[`余料寄存:`,y(e.depositMg),`g,暂不结算。`]}):e.surplusMg>0?(0,P.jsxs)(`p`,{children:[`余料回收:(`,y(e.oldMg),` − `,y(e.newMg),`)g ×`,` `,F(Math.round(Number(n?.buy_rate||0)*100)),`/g = `,(0,P.jsx)(`strong`,{children:F(e.purchaseAmount)})]}):(0,P.jsx)(`p`,{children:`无需余料回收。`})]})}),(0,P.jsxs)(`div`,{className:`recovery-net`,children:[(0,P.jsx)(`span`,{children:e.netSettlement>0?`客户补款`:e.netSettlement<0?`店里付款`:`无需现金收付`}),(0,P.jsx)(`strong`,{children:F(Math.abs(e.netSettlement))})]}),!r&&(0,P.jsxs)(`p`,{children:[`最终结算 = 置换费用 `,F(e.receivable),` − 余料回收款 `,F(e.purchaseAmount),`。`,!e.netSettlement&&`本次无需现金收付款。`]})]})}function re({value:e}){return e?.requiresLegacyCountVerified?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{children:e.legacyCountNotice||`这笔历史记录未记录对数,当前对数按实际盘点基准保留。`}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(x,{type:`checkbox`,name:`legacyCountVerified`,required:!0}),`已核对当前对数基准,理解本次更正对历史对数的处理`]})]}):null}function ie(e,t){let n=localStLine truncated
`),u=e=>e?.exchange?.fee_items.map(e=>`${e.note}:${e.amount}元 · ${o(e.payer)}付款`).join(`
`)||`无`,d=e=>e?.exchange?.charges.map(e=>`${e.name}:${e.amount}元`).join(`
`)||`无`,p=n.exchange||{},m=r?.exchange||{},h=e=>e?.mode===`pool`?`料池 `+e.poolId:e?`手填 `+e.rate+`元/克`:`无补金差重`,_=e=>e?e.mode===`gram`?e.rate+`元/克`:e.amount+`元总工费`:`未提供`;if(i.push(a(`业务日期`,n.date,r?.date||`取消原记录`),a(`客户`,n.customer,r?.customer),a(`开单人`,n.salesperson,r?.salesperson),a(`归属`,o(n.member),r?o(r.member):`沿用原身份留档`),a(`旧料逐项称重`,l(n),r?l(r):`冲正原库存及关联购料`),a(`旧料入库货盘`,s(n.old_pocket??`回收旧料`),r?s(r.old_pocket??`回收旧料`):`冲回原入库货盘`),a(`旧料入库数量(对)`,f(n.old_stock_count==null?null:Number(n.old_stock_count)),r?f(r.old_stock_count==null?null:Number(r.old_stock_count)):`冲回原入库数量`),a(`回收单价(元/克)`,n.buy_rate,r?.buy_rate),a(`回收结算额(元)`,n.buy_total,r?.buy_total),a(`实际收付款账户`,c(n.payment_account),r?c(r.payment_account):`冲正原收付记录`),a(`付款人`,o(n.payer),r?o(r.payer):`原付款流水保留`),a(`备注`,n.note,r?.note)),(n.surplus_mode===`deposit`||r?.surplus_mode===`deposit`)&&i.push(a(`余料处理`,n.surplus_mode===`deposit`?`寄存,暂不结算`:`按回收价结算`,r?r.surplus_mode===`deposit`?`寄存,暂不结算`:`按回收价结算`:`撤回本单寄存余料`)),(n.old_source===`deposit`||r?.old_source===`deposit`)&&i.push(a(`使用客户寄存料`,n.old_source===`deposit`?n.deposit_id+` · `+n.deposit_weight+`g`:`本次交来旧料`,r?.old_source===`deposit`?r.deposit_id+` · `+r.deposit_weight+`g`:r?`本次交来旧料`:`退回寄存账户`)),n.exchange?.items||r?.exchange?.items){let e=e=>(e?.exchange?.items||[]).map((e,t)=>t+1+` · `+e.exchange.name+(e.old_source===`deposit`?` · 寄存记录 `+e.deposit_id+` 使用 `+e.deposit_weight+`g`:``)+(e.surplus_mode===`deposit`?` · 余料寄存,暂不结算`:``)+` · 旧料 `+e.old_lines.map(e=>e.melted_weight+`g × `+e.purity+`%`).join(`+`)+` 入`+s(e.old_pocket)+` · 新货 `+e.exchange.quantity+`g `+(s(e.exchange.pocket)||`外配`)+` · 补金 `+e.exchange.gold_price+`元/g · 折旧 `+e.exchange.depreciation_weight+`g × `+e.exchange.depreciation_rate+`元/g · 回收 `+e.buy_rate+`元/g,`+e.buy_total+`元 · 料费 `+JSON.stringify(e.exchange.cost_material)+` · 料费付款 `+o(e.exchange.cost_material_payer)+` · 进货工费 `+JSON.stringify(e.exchange.cost_labor)+`,`+o(e.exchange.cost_labor_payer)).join(`;`);i.push(a(`逐件置换完整资料`,e(n),r?e(r):`全部冲回`))}if(n.exchange?.products||r?.exchange?.products){let e=e=>(e?.products??(e?[e]:[])).map((e,t)=>t+1+` · `+e.name+` · `+e.quantity+`g · `+(s(e.pocket)||`外配`)+` · 销售工费 `+e.labor_rate+(e.labor_mode===`total`?`元`:`元/克`)+` · 进货工费 `+(e.cost_labor?.rate??e.cost_labor?.amount??`待补`)+` · `+o(e.cost_labor_payer)+(e.stockCount==null?``:` · `+e.stockCount+`对`)).join(`;`);i.push(a(`逐件置换商品`,e(n.exchange),r?e(r.exchange):`冲回全部新货出库`))}n.mode===`exchange`&&i.push(a(`置换新货`,p.name,m.name),a(`新货克重(g)`,p.quantity,m.quantity),a(`实际货盘`,s(p.pocket)||`外配`,r?s(m.pocket)||`外配`:`冲回原出库货盘`),a(`出库数量(对)`,f(p.stockCount==null?null:Number(p.stockCount)),f(m.stockCount==null?null:Number(m.stockCount))),a(`销售金价(元/克)`,p.gold_price,m.gold_price),a(`销售工费`,p.labor_rate+`元/`+(p.labor_mode===`gram`?`克`:`总额`),r?m.labor_rate+`元/`+(m.labor_mode===`gram`?`克`:`总额`):`取消`),a(`折旧计费克重/单价`,p.depreciation_weight+`g × `+p.depreciation_rate+`元/克`,r?m.depreciation_weight+`g × `+m.depreciation_rate+`元/克`:`取消`),a(`附加收费`,d(n),r?d(r):`取消`),a(`优惠(元)`,p.discount,m.discount),a(`取整方式`,p.rounding_mode===`yuan`?`四舍五入到元`:`保留到分`,r?m.rounding_mode===`yuan`?`四舍五入到元`:`保留到分`:`取消`),a(`补金差重进货来源`,h(p.cost_material),r?h(m.cost_material):`释放原耗用`),a(`料费付款人`,o(p.cost_material_payer),r?o(m.cost_material_payer):`原来源留档`),a(`进货工费`,_(p.cost_labor),r?_(m.cost_labor):`取消`),a(`工费付款人`,o(p.cost_labor_payer),r?o(m.cost_labor_payer):`原来源留档`),a(`实际费用`,u(n),r?u(r):`冲正原费用`));let y=e.summary.before||{},b=e.summary.after||{};return i.push(...[[`实际收客户`,`cashReceipt`],[`实际付客户`,`cashPayment`],[`购料成本`,`purchaseAmount`],[`订单货品成本`,`goodsCost`],[`实际费用`,`directCost`],[`原账利润`,`profit`]].map(([e,t])=>a(e,y[t]==null?`待核实`:`¥`+v(y[t]),r?b[t]==null?`待核实`:`¥`+v(b[t]):`取消后冲正`))),(0,P.jsxs)(P.Fragment,{children:[e.summary.legacyCountNotice&&(0,P.jsxs)(`p`,{children:[e.summary.legacyCountNotice,e.summary.legacyCountVerified&&`(申请人已确认)`]}),(0,P.jsx)(`div`,{className:`table-wrap`,children:(0,P.jsx)(S,{"aria-label":`回收更正原值与申请值`,columns:[{title:`核对项目`,r Line truncated