优化
This commit is contained in:
@@ -239,10 +239,10 @@ export default {
|
||||
row.edit = true
|
||||
this.form.tableData.splice(i, 1, row)
|
||||
if (row.is_need_manage === '1') {
|
||||
all = all + parseFloat(row.standard_rate)
|
||||
all = all + parseFloat(row.standard_rate).toFixed(4)
|
||||
}
|
||||
}
|
||||
this.form.total_value = all
|
||||
this.form.total_value = parseFloat(all).toFixed(4)
|
||||
})
|
||||
},
|
||||
handleClose(done) {
|
||||
@@ -281,17 +281,19 @@ export default {
|
||||
row.edit = !row.edit
|
||||
this.form.tableData.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
|
||||
this.form.total_value = 0
|
||||
let total_now = 0
|
||||
this.form.tableData.forEach((item) => {
|
||||
if (item.is_need_manage === '1' && item.edit) {
|
||||
this.form.total_value = this.form.total_value + parseFloat(item.standard_rate)
|
||||
total_now = total_now + parseFloat(item.standard_rate).toFixed(4)
|
||||
}
|
||||
})
|
||||
this.form.total_value = parseFloat(total_now).toFixed(4)
|
||||
},
|
||||
insertdtl() {
|
||||
this.form.tableData.push({ is_need_manage: '1', prior_level: '01', standard_rate: '0', edit: false })
|
||||
},
|
||||
delOne(index, rows) {
|
||||
this.form.total_value = parseFloat(this.form.total_value) - parseFloat(rows[index].standard_rate)
|
||||
this.form.total_value = parseFloat(parseFloat(this.form.total_value).toFixed(4) - parseFloat(rows[index].standard_rate).toFixed(4)).toFixed(4)
|
||||
if (this.form.total_value < 0) {
|
||||
this.form.total_value = 0
|
||||
}
|
||||
|
||||
@@ -98,10 +98,10 @@ export default {
|
||||
row.edit = true
|
||||
this.tableData.splice(i, 1, row)
|
||||
if (row.is_need_manage === '1') {
|
||||
all = all + parseFloat(row.standard_rate)
|
||||
all = all + parseFloat(row.standard_rate).toFixed(4)
|
||||
}
|
||||
}
|
||||
this.form.total_value = all
|
||||
this.form.total_value = parseFloat(all).toFixed(4)
|
||||
})
|
||||
},
|
||||
close() {
|
||||
|
||||
Reference in New Issue
Block a user