Commit 74fa3923 by zhangxw

非空判断报错bug修复

1 parent c22f5fa6
...@@ -110,7 +110,7 @@ export const handleGradeData = (dataFromApi, salePeriodList = []) => { ...@@ -110,7 +110,7 @@ export const handleGradeData = (dataFromApi, salePeriodList = []) => {
_gradeObj.gradeConfigList.push({ _gradeObj.gradeConfigList.push({
maxPrice: NP.divide(maxPrice || 0, 1000000), maxPrice: NP.divide(maxPrice || 0, 1000000),
minPrice: NP.divide(minPrice || 0, 1000000), minPrice: NP.divide(minPrice || 0, 1000000),
priceCoefficient: priceCoefficient.toFixed(16).replace(/\.?0+$/, ''), priceCoefficient: priceCoefficient?.toFixed(16).replace(/\.?0+$/, ''),
computeFlag, computeFlag,
id id
}) })
...@@ -126,7 +126,7 @@ export const handleGradeData = (dataFromApi, salePeriodList = []) => { ...@@ -126,7 +126,7 @@ export const handleGradeData = (dataFromApi, salePeriodList = []) => {
let arr = [] let arr = []
salePeriodList?.forEach(it => { salePeriodList?.forEach(it => {
let _obj = gradeConfigList.find(o => o.servicePeriod == it && NP.divide(o.minPrice || 0, 1000000) == item.minPrice && NP.divide(o.maxPrice || 0, 1000000) == item.maxPrice) let _obj = gradeConfigList.find(o => o.servicePeriod == it && NP.divide(o.minPrice || 0, 1000000) == item.minPrice && NP.divide(o.maxPrice || 0, 1000000) == item.maxPrice)
arr.push({ id: _obj?.id, servicePeriod: it, shelfCost: _obj?.shelfCost.toFixed(16).replace(/\.?0+$/, ''), salesCost: _obj?.salesCost.toFixed(16).replace(/\.?0+$/, '') }) arr.push({ id: _obj?.id, servicePeriod: it, shelfCost: _obj?.shelfCost?.toFixed(16).replace(/\.?0+$/, ''), salesCost: _obj?.salesCost?.toFixed(16).replace(/\.?0+$/, '') })
}) })
item.childSalePeriodData = arr item.childSalePeriodData = arr
}) })
......
...@@ -171,7 +171,7 @@ export default { ...@@ -171,7 +171,7 @@ export default {
calcPrice(price1, price2) { calcPrice(price1, price2) {
price1 = price1 || 0 price1 = price1 || 0
price2 = price2 || 0 price2 = price2 || 0
return Number((price1 * price2).toFixed(2)) return Number((price1 * price2)?.toFixed(2))
}, },
HandleCustomMatcher(node, Delta) { HandleCustomMatcher(node, Delta) {
// 文字、图片等,从别处复制而来,清除自带样式,转为纯文本 // 文字、图片等,从别处复制而来,清除自带样式,转为纯文本
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!