支持耳钉货盘克重与对数同步库存及历史盘点基准
This commit is contained in:
1 parent
ba15795f0a
commit
b6a0213a0c
28 files changed
+906
-161
No files matched your search
@@ -60,7 +60,7 @@
|
||||
if(!order||!Array.isArray(order.lines)||!Array.isArray(order.fee_items)||!Array.isArray(order.expenses))throw new Error('订单详情未完整返回,请重新读取后再复制。');
|
||||
const source=inputs(order),chargeIds=new Map(),locked=!!order.price_lock_id||order.lines.some(line=>line.materialAllocations?.length);
|
||||
const lines=source.lines.map(line=>{
|
||||
const result=Object.fromEntries(['name','nameType','customName','unit','quantity','pocket','payer','pricingMode','goldPrice','laborMode','laborRate','pieces','priceNote','sale','baseSale'].filter(key=>Object.hasOwn(line,key)).map(key=>[key,line[key]]));
|
||||
const result=Object.fromEntries(['name','nameType','customName','unit','quantity','pocket','stockCount','payer','pricingMode','goldPrice','laborMode','laborRate','pieces','priceNote','sale','baseSale'].filter(key=>Object.hasOwn(line,key)).map(key=>[key,line[key]]));
|
||||
result.charges=line.charges.map(charge=>{const id=newId();if(charge.id)chargeIds.set(charge.id,id);return {id,name:charge.name,amount:charge.amount};});
|
||||
if(line.costParts){
|
||||
result.costParts={...line.costParts};result.costMaterial={...line.costMaterial};result.costLabor={...line.costLabor};
|
||||
@@ -86,7 +86,7 @@
|
||||
if((draft.fee_items||[]).some(item=>item.key!=='shipping'||item.edited||item.status!=='estimated'||Number(item.amount)!==6||item.payer!=='assistant'))return true;
|
||||
return draft.lines.length!==1||draft.lines.some(line=>{
|
||||
if(line.charges?.length||line.name&&line.name!=='足金999'||line.customName||line.unit&&line.unit!=='g'||line.pocket!=null&&line.pocket!=='现货'||line.payer&&line.payer!=='owner'||line.costMaterial?.mode==='pool')return true;
|
||||
if(['quantity','sale','baseSale','goldPrice','laborRate','priceNote','cost'].some(key=>nonblank(line[key])))return true;
|
||||
if(['quantity','stockCount','sale','baseSale','goldPrice','laborRate','priceNote','cost'].some(key=>nonblank(line[key])))return true;
|
||||
if(['material','labor'].some(key=>nonblank(line.costParts?.[key])||nonblank(line[key==='material'?'costMaterial':'costLabor']?.rate)||line.costPayers?.[key]&&line.costPayers[key]!=='owner'))return true;
|
||||
return ['accessories','other'].some(key=>Number(line.costParts?.[key]));
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user