Commit 14630c97 authored by 刘用法's avatar 刘用法

材料页面防止数据有错的

parent a03ea557
...@@ -100,8 +100,10 @@ ...@@ -100,8 +100,10 @@
money() { // 总额 money() { // 总额
var amount = 0 var amount = 0
for (var item of this.list) { for (var item of this.list) {
if (Number(item.consumption) && Number(item.freeAmount) && Number(item.price)) {
amount += Math.max(Number(item.consumption) - Number(item.freeAmount), 0) * Number(item.price) amount += Math.max(Number(item.consumption) - Number(item.freeAmount), 0) * Number(item.price)
} }
}
for (var item of this.other) { for (var item of this.other) {
if (item.value && Number(item.value)) { if (item.value && Number(item.value)) {
amount += Number(item.value) amount += Number(item.value)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment