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

This commit is contained in:
黄健铭 committed 2026-12-05 08:38:39 -08:00
1 parent 2a4fb47227
commit 37943ecafe
71 files changed
+1250 -454

No files matched your search

@@ -0,0 +1 @@
import{n as e}from"./rolldown-runtime-Dl_DZoUm.js";import{a as t,o as n}from"./receipt-BeV4cQMV.js";import{n as r,r as i,t as a}from"./receipts-DAcC8llT.js";import{c as o,l as s,s as c,tr as l,u,v as d}from"./index-tSTt2xqV.js";import{o as f,t as p}from"./shared-Da74NgmJ.js";import{r as m,t as h}from"./format-BGnBgUgX.js";import{a as g,c as _,d as v,f as y,i as b,l as x,n as S,o as C,p as w,r as T,s as E,t as D,u as O}from"./model-tyEbng9d.js";import{a as k,i as A,n as j,o as M,r as N,s as P,t as F}from"./BusinessControls-CK9S8VuW.js";var I=e(l(),1),L=d();function R({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,L.jsx)(F,{type:`button`,className:`link-button`,"data-action":r[0],"data-id":t,onClick:()=>{t&&o(e,{search:`?`+r[1]+`=`+encodeURIComponent(t)})},children:n})}function ee({pool:e,cutover:t}){let n=Object.hasOwn(e,`personalPools`);return(0,L.jsxs)(`section`,{className:`panel material-rolling-current`,"aria-label":n?`当前公共材料`:`当前统一材料`,children:[(0,L.jsxs)(`div`,{className:`panel-title`,children:[(0,L.jsxs)(`h2`,{children:[e.date,` `,n?`公共材料`:`当前材料`]}),(0,L.jsx)(`span`,{className:`small muted`,children:n?`个人回收料独立在下方展示`:`自 `+t+` 起按日结转`})]}),(0,L.jsxs)(`div`,{className:`material-rolling-totals`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{children:n?`公共料加权料价`:`当前最终加权料价`}),(0,L.jsx)(`strong`,{children:e.averageRate==null?`待补采购`:(0,L.jsxs)(L.Fragment,{children:[`¥`,m(e.averageRate),(0,L.jsx)(`small`,{children:`/克`})]})})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{children:n?`公共剩余克重`:`统一剩余克重`}),(0,L.jsxs)(`strong`,{children:[h(e.remainingMg),(0,L.jsx)(`small`,{children:`g`})]})]})]}),n?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`p`,{className:`small muted`,children:[`公共料共 `,h(e.totalMg),`g,已用/预留 `,h(e.usedMg),`g;余料成本 `,D(e.remainingCost),`。`,e.shortageMg?`公共料还缺 `+h(e.shortageMg)+`g。`:``]}),(0,L.jsx)(`p`,{className:`small muted`,children:`订单先用归属人的个人回收料,不足由公共料补足;两类来源各自加权、各自保留付款人与余料。`})]}):(0,L.jsxs)(L.Fragment,{children:[!!e.shortageMg&&(0,L.jsxs)(`p`,{className:`danger-text`,children:[`还需补足 `,h(e.shortageMg),`g,今日订单料费与利润暂待补。`]}),(0,L.jsxs)(`details`,{className:`material-rolling-composition`,children:[(0,L.jsx)(`summary`,{children:`查看今天的料价组成`}),(0,L.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,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{children:t}),(0,L.jsxs)(`strong`,{children:[h(n.mg),`g`]}),(0,L.jsx)(`span`,{children:D(n.amount)})]},t)})}),(0,L.jsx)(`p`,{className:`small muted`,children:`加权料价=(结转成本+今日采购成本+今日退货回料原金料成本)÷对应克重。退货按原订单金料成本与实际退回克重计入;同日售退净抵销,完整退回记录保留。工费、快递费不加入材料成本。`}),(0,L.jsxs)(`p`,{className:`small muted`,children:[`今天共可计料 `,h(e.totalMg),`g,已耗用 `,h(e.usedMg),`g;剩余材料成本 `,D(e.remainingCost),`。`]})]}),(0,L.jsx)(`p`,{className:`small muted material-rolling-rule`,children:`今日加料只重算今日订单,旧日订单冻结。历史购料录错,提交更正后由店主复核。`})]})]})}function z({pool:e,state:t}){if(!e.personalPools)return null;let n=Object.entries(e.personalPools).filter(([e])=>t.user.role===`owner`||e===f.currentMember(t));return(0,L.jsxs)(`section`,{className:`panel material-personal-pools`,children:[(0,L.jsxs)(`div`,{className:`panel-title`,children:[(0,L.jsxs)(`h2`,{children:[e.date,` 个人回收料`]}),(0,L.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,L.jsxs)(`article`,{className:`material-personal-pool`,children:[(0,L.jsxs)(`div`,{className:`panel-title`,children:[(0,L.jsxs)(`h3`,{children:[f.memberName(t,n),`个人回收料`]}),(0,L.jsxs)(`strong`,{children:[`余 `,h(r.remainingMg),`g`]})]}),(0,L.jsxs)(`div`,{className:`material-personal-totals`,children:[(0,L.jsxs)(`span`,{children:[`加权料价 `,r.averageRate==null?`待核对`:D(r.averageRate)+`/克`]}),(0,L.jsxs)(`span`,{children:[`已用/预留 `,h(r.usedMg),`g`]}),(0,L.jsxs)(`span`,{children:[`余料成本 `,D(r.remainingCost)]})]}),(0,L.jsxs)(`details`,{children:[(0,L.jsx)(`summary`,{children:`查看回收来源与占用`}),(0,L.jsx)(`u Line truncated