Commit d73087b9 authored by youjie's avatar youjie

no message

parent 78f2e106
......@@ -473,7 +473,7 @@
style="background:#EAEAEA"
>
<template slot-scope="scope">
{{ item.Money?item.toFixed(2):0.00 }}
{{ item.Money?item.Money.toFixed(2):0.00 }}
</template>
</el-table-column>
<template slot="append" v-if="item.CreateRemark">
......@@ -748,7 +748,7 @@
</el-table-column>
<el-table-column prop="UnitPrice" label="价格" min-width="150">
<template slot-scope="scope">
<el-input-number v-if="priceType == 1" v-model="scope.row.UnitPrice" @input="calcPrice()"
<el-input-number v-if="priceType == 1" v-model="scope.row.UnitPrice" @change="calcPrice()"
:min="1" style="width:auto;"></el-input-number>
<span v-if="priceType != 1">
{{ scope.row.UnitPrice }}
......@@ -757,7 +757,7 @@
</el-table-column>
<el-table-column prop="StopBusPrice" label="停车费" min-width="150">
<template slot-scope="scope">
<el-input-number v-if="priceType == 1" v-model="scope.row.StopBusPrice" @input="calcPrice()" :min="0" style="width:auto;"></el-input-number>
<el-input-number v-if="priceType == 1" v-model="scope.row.StopBusPrice" @change="calcPrice()" :min="0" style="width:auto;"></el-input-number>
<span v-if="priceType != 1">
{{ scope.row.StopBusPrice }}
</span>
......@@ -765,7 +765,7 @@
</el-table-column>
<el-table-column prop="RoomPrice" label="司机住宿费" min-width="150">
<template slot-scope="scope">
<el-input-number v-if="priceType == 1" v-model="scope.row.RoomPrice" @input="calcPrice()"
<el-input-number v-if="priceType == 1" v-model="scope.row.RoomPrice" @change="calcPrice()"
:min="0" style="width:auto;"></el-input-number>
<span v-if="priceType != 1">
{{ scope.row.RoomPrice }}
......@@ -839,8 +839,6 @@
props: ["OrderList","pagesTitle"],
data() {
return {
totalMoney: 0,
param:null,
labelPosition: 'right',
priceType: 1,
dialogTitle: '设置报价',
......@@ -981,12 +979,17 @@
],
items: null,
typeState: '',
Title: ''
Title: '',
tempTotalPrice: 0
};
},
watch: {
postMsg(val,oldval){
this.calcPrice()
postMsg:{
handler(newValue, oldValue) {
},
deep: true,
immediate: false
},
pagesTitle(val,oldval){
this.Title = val
......@@ -1224,45 +1227,39 @@
},
//计算价格
calcPrice() {
this.postMsg.details&&this.postMsg.details.forEach(y=>{
y.Money = y.UnitPrice+y.StopBusPrice+y.RoomPrice
})
if(this.param){
this.getSummaries(this.param)
}
var tempUnitPrice = 0;
var tempStopBusPrice = 0;
var tempRoomPrice = 0;
var tempTotalPrice = 0;
if (this.postMsg && this.postMsg.details && this.postMsg.details.length > 0) {
this.postMsg.details.forEach(item => {
if (item.UnitPrice) {
tempUnitPrice += Number(item.UnitPrice);
tempTotalPrice += Number(item.UnitPrice);
}
if (item.StopBusPrice) {
tempStopBusPrice += Number(item.StopBusPrice);
tempTotalPrice += Number(item.StopBusPrice);
}
if (item.RoomPrice) {
tempRoomPrice += Number(item.RoomPrice);
tempTotalPrice += Number(item.RoomPrice);
}
});
}
this.postMsg.details&&this.postMsg.details.forEach(item=>{
if(!item.UnitPrice){
item.UnitPrice = 1
}
item.Money = item.UnitPrice+item.StopBusPrice+item.RoomPrice
if (item.UnitPrice) {
tempUnitPrice += Number(item.UnitPrice);
tempTotalPrice += Number(item.UnitPrice);
}
if (item.StopBusPrice) {
tempStopBusPrice += Number(item.StopBusPrice);
tempTotalPrice += Number(item.StopBusPrice);
}
if (item.RoomPrice) {
tempRoomPrice += Number(item.RoomPrice);
tempTotalPrice += Number(item.RoomPrice);
}
})
this.subUnitPrice = tempUnitPrice.toFixed(2);
this.subStopBusPrice = tempStopBusPrice.toFixed(2);
this.subRoomPrice = tempRoomPrice.toFixed(2);
if (this.postMsg.ShouPeiFee) {
tempTotalPrice += Number(this.postMsg.ShouPeiFee);
}
this.$nextTick(() => {
this.postMsg.TotalPrice = (tempTotalPrice+this.totalMoney).toFixed(2);
})
this.postMsg.TotalPrice = tempTotalPrice.toFixed(2);
this.$forceUpdate()
},
// 合计列
getSummaries(param) {
this.param = param
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
......@@ -1275,7 +1272,6 @@
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)&&index==7) {
this.totalMoney = prev + curr
return prev + curr;
} else {
return '';
......@@ -1294,9 +1290,11 @@
// tripbus_SureSellBusTripOffer
this.apipost('tripbus_ErpSubmitTripBusOffer', this.postMsg, res => {
if (res.data.resultCode == 1) {
this.loading1 = false
this.isShowPrice = false;
this.getList();
} else {
this.loading1 = false
this.Error(res.data.message);
}
}, err => {})
......
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