增加客户寄存料登记与置换使用,支持余额恢复

This commit is contained in:
summer committed 2026-11-26 01:01:18 +08:00
1 parent d0809d61a7
commit 1f1e6dd402
11 files changed
+170 -23

No files matched your search

+2
View File
@@ -144,6 +144,7 @@ function createApp(options={}){
if(afterSaleChangeMatch&&!isPost){if(afterSaleChangeMatch[2])fail('地址不存在',404);return send(res,200,actorLedger.afterSaleChange(afterSaleChangeMatch[1],actor));}
const afterSaleMatch=route.match(/^\/api\/after-sales\/([a-f0-9-]{36})(?:\/(update))?$/);
if(afterSaleMatch&&!isPost){if(afterSaleMatch[2])fail('地址不存在',404);return send(res,200,actorLedger.afterSale(afterSaleMatch[1],actor));}
if(route==='/api/customer-materials'&&!isPost)return send(res,200,actorLedger.customerMaterials(Object.fromEntries(url.searchParams),actor));
if(route==='/api/recoveries'&&!isPost)return send(res,200,actorLedger.recoveries(Object.fromEntries(url.searchParams),actor));
const recoveryMatch=route.match(/^\/api\/recoveries\/([a-f0-9-]{36})(?:\/(edit|update|cancel|quote))?$/);
if(recoveryMatch&&!isPost){if(recoveryMatch[2]==='edit')return send(res,200,actorLedger.recoveryEdit(recoveryMatch[1],actor));if(recoveryMatch[2])fail('地址不存在',404);return send(res,200,actorLedger.recovery(recoveryMatch[1],actor));}
@@ -217,6 +218,7 @@ function createApp(options={}){
const result=actorLedger.transact(key,actor,{route,body:b},()=>{
if(route==='/api/pockets')return actorLedger.createPocket(b,actor);
if(pocketMatch)return actorLedger.updatePocket(decodeURIComponent(pocketMatch[1]),b,actor);
if(route==='/api/customer-materials')return actorLedger.createCustomerMaterial(b,actor);
if(route==='/api/recoveries')return actorLedger.createRecovery(b,actor);
if(recoveryMatch?.[2]==='update')return actorLedger.updateRecovery(recoveryMatch[1],b,actor);
if(recoveryMatch?.[2]==='cancel')return actorLedger.cancelRecovery(recoveryMatch[1],b,actor);