保存工作区合并前的本地开发现场 ledger-route-sizes-389952f

This commit is contained in:
黄健铭 committed 2026-12-05 18:21:23 -08:00
1 parent 389952f31c
commit 9952128ba4
45 files changed
+356 -321

No files matched your search

@@ -0,0 +1 @@
import{n as e}from"./rolldown-runtime-Dl_DZoUm.js";import{i as t,t as n}from"./react-1o5M9n0k.js";import{a as r,l as i,n as a,o,s,u as c}from"./index-D-ox0wtk.js";import{o as l,t as u}from"./shared-DZLPF0cC.js";import{a as d,c as f,d as p,f as m,i as h,l as g,m as _,n as v,o as y,p as b,r as x,s as S,t as C,u as w}from"./model-BDHsEKmI.js";var T=e(t(),1),E=n();function D({kind:e,id:t,children:n}){let r={orders:[`open-order`,`order`],"price-locks":[`open-price-lock`,`lock`],recoveries:[`recovery-open`,`recovery`]}[e];return(0,E.jsx)(`button`,{type:`button`,className:`link-button`,"data-action":r[0],"data-id":t,onClick:()=>{t&&s(e,{search:`?`+r[1]+`=`+encodeURIComponent(t)})},children:n})}function O({pool:e,cutover:t}){let n=Object.hasOwn(e,`personalPools`);return(0,E.jsxs)(`section`,{className:`panel material-rolling-current`,"aria-label":n?`当前公共材料`:`当前统一材料`,children:[(0,E.jsxs)(`div`,{className:`panel-title`,children:[(0,E.jsxs)(`h2`,{children:[e.date,` `,n?`公共材料`:`当前材料`]}),(0,E.jsx)(`span`,{className:`small muted`,children:n?`个人回收料独立在下方展示`:`自 `+t+` 起按日结转`})]}),(0,E.jsxs)(`div`,{className:`material-rolling-totals`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:n?`公共料加权料价`:`当前最终加权料价`}),(0,E.jsx)(`strong`,{children:e.averageRate==null?`待补采购`:(0,E.jsxs)(E.Fragment,{children:[`¥`,r(e.averageRate),(0,E.jsx)(`small`,{children:`/克`})]})})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:n?`公共剩余克重`:`统一剩余克重`}),(0,E.jsxs)(`strong`,{children:[a(e.remainingMg),(0,E.jsx)(`small`,{children:`g`})]})]})]}),n?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`p`,{className:`small muted`,children:[`公共料共 `,a(e.totalMg),`g,已用/预留 `,a(e.usedMg),`g;余料成本 `,v(e.remainingCost),`。`,e.shortageMg?`公共料还缺 `+a(e.shortageMg)+`g。`:``]}),(0,E.jsx)(`p`,{className:`small muted`,children:`订单先用归属人的个人回收料,不足由公共料补足;两类来源各自加权、各自保留付款人与余料。`})]}):(0,E.jsxs)(E.Fragment,{children:[!!e.shortageMg&&(0,E.jsxs)(`p`,{className:`danger-text`,children:[`还需补足 `,a(e.shortageMg),`g,今日订单料费与利润暂待补。`]}),(0,E.jsxs)(`details`,{className:`material-rolling-composition`,children:[(0,E.jsx)(`summary`,{children:`查看今天的料价组成`}),(0,E.jsx)(`div`,{className:`material-rolling-parts`,children:[[`昨日以前剩余材料`,e.opening],[`今日购料(`+(e.todayPurchases.count||0)+`笔)`,e.todayPurchases],[`今日退货回料(`+(e.todayReturns.count||0)+`笔)`,e.todayReturns]].map(e=>{let[t,n]=e;return(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:t}),(0,E.jsxs)(`strong`,{children:[a(n.mg),`g`]}),(0,E.jsx)(`span`,{children:v(n.amount)})]},t)})}),(0,E.jsx)(`p`,{className:`small muted`,children:`加权料价=(结转成本+今日采购成本+今日退货回料原金料成本)÷对应克重。退货按原订单金料成本与实际退回克重计入;同日售退净抵销,完整退回记录保留。工费、快递费不加入材料成本。`}),(0,E.jsxs)(`p`,{className:`small muted`,children:[`今天共可计料 `,a(e.totalMg),`g,已耗用 `,a(e.usedMg),`g;剩余材料成本 `,v(e.remainingCost),`。`]})]}),(0,E.jsx)(`p`,{className:`small muted material-rolling-rule`,children:`今日加料只重算今日订单,旧日订单冻结。历史购料录错,提交更正后由店主复核。`})]})]})}function k({pool:e,state:t}){if(!e.personalPools)return null;let n=Object.entries(e.personalPools).filter(([e])=>t.user.role===`owner`||e===l.currentMember(t));return(0,E.jsxs)(`section`,{className:`panel material-personal-pools`,children:[(0,E.jsxs)(`div`,{className:`panel-title`,children:[(0,E.jsxs)(`h2`,{children:[e.date,` 个人回收料`]}),(0,E.jsx)(`span`,{className:`small muted`,children:`回收归属与公共购料分别核算`})]}),n.map(([n,r])=>{let i=(e.usages||[]).filter(e=>e.active&&!e.anonymous&&e.materialSources?.some(e=>e.kind===`personal_recovery`&&e.member===n));return(0,E.jsxs)(`article`,{className:`material-personal-pool`,children:[(0,E.jsxs)(`div`,{className:`panel-title`,children:[(0,E.jsxs)(`h3`,{children:[l.memberName(t,n),`个人回收料`]}),(0,E.jsxs)(`strong`,{children:[`余 `,a(r.remainingMg),`g`]})]}),(0,E.jsxs)(`div`,{className:`material-personal-totals`,children:[(0,E.jsxs)(`span`,{children:[`加权料价 `,r.averageRate==null?`待核对`:v(r.averageRate)+`/克`]}),(0,E.jsxs)(`span`,{children:[`已用/预留 `,a(r.usedMg),`g`]}),(0,E.jsxs)(`span`,{children:[`余料成本 `,v(r.remainingCost)]})]}),(0,E.jsxs)(`details`,{children:[(0,E.jsx)(`summary`,{children:`查看回收来源与占用`}),(0,E.jsx)(`ul`,{children:r.purchases?.length?r.purchases.map((e,t)=>(0,E.jsxs)(`li`,{children:[e.sourceKind===`carry`?`以前结转`:e.sourceKind===`return`?`退回原料`:`回收生成`,` ·`,` `,a(e.mg),Line truncated