pull/7/head
xiaozhiyong 1 year ago
parent 28500d9d0b
commit 3bd60fe2bd
  1. 43
      pages/stationDetail/openStationDetail.vue

@ -58,8 +58,8 @@
<text class="s-rich">市场价{{insertResult.oilSitePrice|numberFilter}}/L</text> <text class="s-rich">市场价{{insertResult.oilSitePrice|numberFilter}}/L</text>
</view> </view>
<view class="grid col-5 padding-top justify-start"> <view class="grid col-5 padding-top justify-start">
<view class="padding-xs" v-for="(item,index) in siteData.oilSitePriceDetailsVos" @tap="oilNameSel(item)" <view class="padding-xs" v-for="(item,index) in siteData.oilSitePriceDetailsVos"
:key="item.priceId"> @tap="oilNameSel(item)" :key="item.priceId">
<button class="cu-btn" <button class="cu-btn"
:class="[insertResult.oilProductCode===item.oilProductCode?'bg-main-oil':'line-gray']">{{item.oilProductCode}}</button> :class="[insertResult.oilProductCode===item.oilProductCode?'bg-main-oil':'line-gray']">{{item.oilProductCode}}</button>
</view> </view>
@ -69,8 +69,10 @@
<view class="padding padding-bottom-0 padding-top-xs bg-white"> <view class="padding padding-bottom-0 padding-top-xs bg-white">
<view style="color: #333333;font-size: 30rpx;" class="padding-bottom-sm text-lg">枪号选择</view> <view style="color: #333333;font-size: 30rpx;" class="padding-bottom-sm text-lg">枪号选择</view>
<view class="grid col-5 justify-start"> <view class="grid col-5 justify-start">
<view style="width: calc(100% / 4);" class="padding-xs" v-for="(item,index) in ColorList" :key="index"> <view style="width: calc(100% / 4);" class="padding-xs" v-for="(item,index) in ColorList"
<button @tap="gunIdSel(index)" :style="{width: '100%',color:insertResult.bar===index+1?'':'#333333'}" class="cu-btn" :key="index">
<button @tap="gunIdSel(index)"
:style="{width: '100%',color:insertResult.bar===index+1?'':'#333333'}" class="cu-btn"
:class="[insertResult.bar===index+1?'bg-main-oil':'line-gray']">{{index+1}}</button> :class="[insertResult.bar===index+1?'bg-main-oil':'line-gray']">{{index+1}}</button>
</view> </view>
</view> </view>
@ -80,12 +82,14 @@
<view class="shadow-warp bg-white"> <view class="shadow-warp bg-white">
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title newtitle"> {{siteData.siteType=='2'?'加气升数':'加油金额'}}</view> <view class="title newtitle"> {{siteData.siteType=='2'?'加气升数':'加油金额'}}</view>
<input class="newtitle" :placeholder="`请输入${siteData.siteType=='2'?'加气升数':'加油金额'}`" @input="checkNumber" type="digit" <input class="newtitle" :placeholder="`请输入${siteData.siteType=='2'?'加气升数':'加油金额'}`"
v-model="insertResult.vol" name="input" /> @input="checkNumber" type="digit" v-model="insertResult.vol" name="input" />
<view style="width: 170rpx;text-align: end;" class="textEllipsis"> <view style="width: 170rpx;text-align: end;" class="textEllipsis">
<text class=""> <text class="">
<text v-if="siteData.siteType!='2'">{{vlom?'' + ( (Math.round(vlom*100)/100).toFixed(2) ) + (siteData.siteType=='2'?'':'L'):''}}</text> <text
<text v-if="siteData.siteType=='2'">{{vlom?'' + ( insertResult.vDoMoney ? insertResult.vDoMoney+insertResult.discountMoney:'') + (siteData.siteType=='2'?'':'L'):''}}</text> v-if="siteData.siteType!='2'">{{vlom?'约' + ( numberHandle(vlom) ) + (siteData.siteType=='2'?'元':'L'):''}}</text>
<text
v-if="siteData.siteType=='2'">{{vlom?'约' + ( insertResult.vDoMoney ? insertResult.vDoMoney+insertResult.discountMoney:'') + (siteData.siteType=='2'?'元':'L'):''}}</text>
</text> </text>
</view> </view>
</view> </view>
@ -274,7 +278,8 @@
selected: function(newVal, oldVal) { selected: function(newVal, oldVal) {
if (newVal) { if (newVal) {
this.selected = newVal this.selected = newVal
console.log('selected发生变化',this.insertResult.oilSitePrice,this.selected.oilSitePrice,this.insertResult.realPrice,this.selected.xkPrice) console.log('selected发生变化', this.insertResult.oilSitePrice, this.selected.oilSitePrice, this
.insertResult.realPrice, this.selected.xkPrice)
// oilSitePrice sitePrice // oilSitePrice sitePrice
if (this.selected.oilSitePrice) { if (this.selected.oilSitePrice) {
this.insertResult.oilSitePrice = this.selected.oilSitePrice this.insertResult.oilSitePrice = this.selected.oilSitePrice
@ -299,6 +304,12 @@
}, },
methods: { methods: {
numberHandle(num) {
num *= 10000
num /= 100
num = Math.ceil(num) / 100
return num.toFixed(2)
},
changeType() { changeType() {
this.changTypes = 1 this.changTypes = 1
}, },
@ -388,7 +399,7 @@
oliSiteApi.getOrderDiscountInfo(number).then(res => { oliSiteApi.getOrderDiscountInfo(number).then(res => {
this.insertResult.vDoMoney = res.data.payRealAmount this.insertResult.vDoMoney = res.data.payRealAmount
this.insertResult.discountMoney = res.data.oilDiscountAmount this.insertResult.discountMoney = res.data.oilDiscountAmount
_that.vlom = res.data.volume.toFixed(2) _that.vlom = res.data.volume
}) })
}, },
charge() { charge() {
@ -417,7 +428,8 @@
volume: this.siteData.siteType == '2' ? this.insertResult.vol : this.vlom, volume: this.siteData.siteType == '2' ? this.insertResult.vol : this.vlom,
orderNum: this.siteData.otherSerialNumber, orderNum: this.siteData.otherSerialNumber,
customerOrderId: this.siteData.customerOrderId, customerOrderId: this.siteData.customerOrderId,
money: this.siteData.siteType=='2'?this.insertResult.vDoMoney+this.insertResult.discountMoney:this.insertResult.vol, money: this.siteData.siteType == '2' ? this.insertResult.vDoMoney + this.insertResult
.discountMoney : this.insertResult.vol,
createSource: "WECHAT_MINIAPPS", //String createSource: "WECHAT_MINIAPPS", //String
orderSource: "WECHAT_MINIAPPS", orderSource: "WECHAT_MINIAPPS",
driverName: this.siteData.customerName, driverName: this.siteData.customerName,
@ -520,7 +532,8 @@
if (res.code === 20000) { if (res.code === 20000) {
this.siteData = res.data this.siteData = res.data
if (res.data.oilSitePriceDetailsVos) { if (res.data.oilSitePriceDetailsVos) {
this.insertResult = Object.assign(this.insertResult,res.data.oilSitePriceDetailsVos[0]) this.insertResult = Object.assign(this.insertResult, res.data.oilSitePriceDetailsVos[
0])
console.log(this.insertResult) console.log(this.insertResult)
} }
this.carNumber = res.data.plateNumber; this.carNumber = res.data.plateNumber;
@ -543,7 +556,8 @@
}, },
changeMoney() { changeMoney() {
this.insertResult.vMoney = this.insertResult.vol * this.selected.oilSitePrice this.insertResult.vMoney = this.insertResult.vol * this.selected.oilSitePrice
this.insertResult.discountMoney = this.insertResult.vol * (this.selected.oilSitePrice - this.insertResult.sitePrice) this.insertResult.discountMoney = this.insertResult.vol * (this.selected.oilSitePrice - this.insertResult
.sitePrice)
this.insertResult.vDoMoney = this.insertResult.vol * this.selected.sitePrice this.insertResult.vDoMoney = this.insertResult.vol * this.selected.sitePrice
}, },
calcMoney(e) { calcMoney(e) {
@ -556,7 +570,8 @@
} }
// oilSitePrice sitePrice // oilSitePrice sitePrice
this.insertResult.vMoney = this.insertResult.vol * this.selected.oilSitePrice this.insertResult.vMoney = this.insertResult.vol * this.selected.oilSitePrice
this.insertResult.discountMoney = this.insertResult.vol * (this.selected.oilSitePrice - this.insertResult.sitePrice) this.insertResult.discountMoney = this.insertResult.vol * (this.selected.oilSitePrice - this.insertResult
.sitePrice)
this.insertResult.vDoMoney = this.insertResult.vol * this.selected.sitePrice this.insertResult.vDoMoney = this.insertResult.vol * this.selected.sitePrice
}, },
queryTimer() { queryTimer() {

Loading…
Cancel
Save