Commit d73087b9 authored by youjie's avatar youjie

no message

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