|
@@ -156,7 +156,7 @@
|
|
|
fixed="right"
|
|
|
width="100">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input v-model="scope.row.price" size="mini" placeholder="请输入单价" @change="onChangePrice(scope.row.price,scope.row,scope.$index)"></el-input>
|
|
|
+ <el-input v-model="scope.row.price" size="mini" type="number" placeholder="请输入单价" @change="onChangePrice(scope.row.price,scope.row,scope.$index)"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -258,11 +258,14 @@ export default {
|
|
|
this.list = res.data
|
|
|
this.total = res.total
|
|
|
this.totalPrice = 0
|
|
|
- for (var i=0 ;i<this.list.length;i++){
|
|
|
- this.list[i].discountrate = this.list[i].discountrate * 100
|
|
|
- this.list[i].mindiscountrate = this.list[i].mindiscountrate * 100
|
|
|
- this.totalPrice = this.totalPrice + this.list[i].qty * this.list[i].price
|
|
|
+ for (var i=0 ;i<res.data.length;i++){
|
|
|
+ this.list[i].discountrate = res.data[i].discountrate * 100
|
|
|
+ this.list[i].mindiscountrate = res.data[i].mindiscountrate * 100
|
|
|
+ this.list[i].price = res.data[i].price.toFixed(2)
|
|
|
+ this.list[i].discountDifferenceAmount = res.data[i].discountDifferenceAmount.toFixed(2)
|
|
|
+ this.totalPrice = this.totalPrice + res.data[i].qty * res.data[i].price
|
|
|
}
|
|
|
+ this.totalPrice = this.totalPrice.toFixed(2)
|
|
|
this.$emit('productData',this.list)
|
|
|
},
|
|
|
handleSizeChange(val) {
|
|
@@ -345,7 +348,7 @@ export default {
|
|
|
val = data.marketprice * 0.1
|
|
|
}
|
|
|
data.discountrate = ((val / data.marketprice) * 100).toFixed(2)
|
|
|
- data.amount = data.qty * data.price
|
|
|
+ data.amount = (data.qty * data.price).toFixed(2)
|
|
|
this.$set(this.list,index,data)
|
|
|
this.totalPrice = 0
|
|
|
for (var i=0 ;i<this.list.length;i++){
|