第7项:按路由加载页面并核验登录和开单冷启动预算
This commit is contained in:
1 parent
c6ad648d7e
commit
f9cd68c569
71 files changed
+1250
-454
No files matched your search
@@ -0,0 +1 @@
|
||||
import{r as e,t}from"./format-u4LYCVYL.js";var n=e=>typeof e==`object`&&!!e,r=e=>typeof e==`number`&&Number.isSafeInteger(e)&&e>=0,i=e=>e===null||r(e);function a(e){return n(e)&&typeof e.payer==`string`&&r(e.amount)}function o(e){return n(e)&&(e.kind===`personal_recovery`||e.kind===`public`)&&(e.member==null||typeof e.member==`string`)&&r(e.quantity)&&i(e.amount)&&(e.averageRate==null||r(e.averageRate))&&Array.isArray(e.allocations)&&e.allocations.every(a)}function s(e){return n(e)&&r(e.lineIndex)&&typeof e.poolId==`string`&&r(e.mg)&&i(e.amount)&&Array.isArray(e.allocations)&&e.allocations.every(a)&&Array.isArray(e.materialSources)&&e.materialSources.every(o)}function c(e){return n(e)&&r(e.personalRemainingMg)&&r(e.publicRemainingMg)&&r(e.eligibleRemainingMg)}function l(e){return n(e)&&typeof e.poolId==`string`&&typeof e.revision==`string`&&i(e.personalRemainingAmount)&&i(e.publicRemainingAmount)&&(!e.before||c(e.before))&&c(e)}function u(e,t,r){if(!n(e)||e.date!==t.date||e.member!==t.member||!Array.isArray(e.entries)||e.entries.length!==t.entries.length||!Array.isArray(e.pools))throw Error(`分来源料费未完整返回,请刷新料价。`);let i=e.entries;if(!i.every(s))throw Error(`分来源料费与当前商品不一致,请重新核对。`);for(let e of t.entries){let n=i.find(t=>t.lineIndex===e.lineIndex);if(!n||n.poolId!==e.poolId||n.mg!==e.mg||n.materialSources.reduce((e,t)=>e+t.quantity,0)!==n.mg)throw Error(`分来源料费与当前商品不一致,请重新核对。`);for(let e of n.materialSources)if(e.kind===`personal_recovery`&&e.member!==t.member||e.allocations.some(e=>!r.includes(e.payer))||e.amount!==null&&e.allocations.reduce((e,t)=>e+t.amount,0)!==e.amount)throw Error(`个人回收料或付款来源不完整,请重新读取。`);if(n.amount!==null&&(n.materialSources.some(e=>e.amount===null)||n.materialSources.reduce((e,t)=>e+(t.amount??0),0)!==n.amount||n.allocations.reduce((e,t)=>e+t.amount,0)!==n.amount))throw Error(`分来源料费合计不一致,请重新读取。`)}let a=e.pools;if(!a.every(l)||a.length!==new Set(t.entries.map(e=>e.poolId)).size||a.some(e=>!t.entries.some(t=>t.poolId===e.poolId)))throw Error(`个人与公共可用克重未完整返回,请重新读取。`);return{date:t.date,member:t.member,entries:i,pools:a}}function d(n=[],r){return n.map(n=>{let i=n.kind===`personal_recovery`?(n.member?r(n.member):`待补`)+`个人回收料`:`公共料`,a=n.amount==null?`料费待补`:`¥`+e(n.amount),o=n.averageRate==null?``:`(加权约 ¥`+e(n.averageRate)+`/克)`;return i+` `+t(n.quantity)+`g · `+a+o}).join(`;`)}function f(e){return(e.before?`本次前可用:个人 `+t(e.before.personalRemainingMg)+`g,公共 `+t(e.before.publicRemainingMg)+`g;`:``)+`本次后余:个人回收料 `+t(e.personalRemainingMg)+`g,公共料 `+t(e.publicRemainingMg)+`g。`}export{d as n,u as r,f as t};
|
||||
Reference in new issue
Block a user