fix: 产品赔偿费用无计算结果 fix #481

This commit is contained in:
lyx 2024-03-25 17:39:48 +08:00
parent aa2542b706
commit 91f273660d
2 changed files with 6 additions and 6 deletions

View File

@ -100,9 +100,9 @@ export const RecordFeeConvertedAmount: CustomFunctionComponent = () => {
} else if (feeRule.conversion_logic_id === ConversionLogics.ProductWeight) {
calcValue = calcValue * productData.weight;
} else {
const weightItem = feeRule.conversion_logic?.weight_items.find((item) => {
item.product_id - 99999 === category.id || item.product_id === productData.id;
});
const weightItem = feeRule.conversion_logic?.weight_items.find(
(item) => item.product_id - 99999 === category.id || item.product_id === productData.id,
);
if (!weightItem) return;
if (weightItem.conversion_logic_id === ConversionLogics.Keep) {
calcValue = calcValue * weightItem.weight;

View File

@ -95,9 +95,9 @@ export const ReadFeeConvertedAmount: CustomFunctionComponent = () => {
} else if (feeRule.conversion_logic_id === ConversionLogics.ProductWeight) {
calcValue = calcValue * productData.weight;
} else {
const weightItem = feeRule.conversion_logic.weight_items.find((item) => {
item.product_id - 99999 === category.id || item.product_id === productData.id;
});
const weightItem = feeRule.conversion_logic.weight_items.find(
(item) => item.product_id - 99999 === category.id || item.product_id === productData.id,
);
if (!weightItem) return;
if (weightItem.conversion_logic_id === ConversionLogics.Keep) {
calcValue = calcValue * weightItem.weight;