|
|
|
@ -58,8 +58,8 @@ |
|
|
|
|
<text class="s-rich">市场价¥{{insertResult.oilSitePrice|numberFilter}}/L</text> |
|
|
|
|
</view> |
|
|
|
|
<view class="grid col-5 padding-top justify-start"> |
|
|
|
|
<view class="padding-xs" v-for="(item,index) in siteData.oilSitePriceDetailsVos" @tap="oilNameSel(item)" |
|
|
|
|
:key="item.priceId"> |
|
|
|
|
<view class="padding-xs" v-for="(item,index) in siteData.oilSitePriceDetailsVos" |
|
|
|
|
@tap="oilNameSel(item)" :key="item.priceId"> |
|
|
|
|
<button class="cu-btn" |
|
|
|
|
:class="[insertResult.oilProductCode===item.oilProductCode?'bg-main-oil':'line-gray']">{{item.oilProductCode}}</button> |
|
|
|
|
</view> |
|
|
|
@ -69,8 +69,10 @@ |
|
|
|
|
<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 class="grid col-5 justify-start"> |
|
|
|
|
<view style="width: calc(100% / 4);" class="padding-xs" v-for="(item,index) in ColorList" :key="index"> |
|
|
|
|
<button @tap="gunIdSel(index)" :style="{width: '100%',color:insertResult.bar===index+1?'':'#333333'}" class="cu-btn" |
|
|
|
|
<view style="width: calc(100% / 4);" class="padding-xs" v-for="(item,index) in ColorList" |
|
|
|
|
: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> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -80,12 +82,14 @@ |
|
|
|
|
<view class="shadow-warp bg-white"> |
|
|
|
|
<view class="cu-form-group"> |
|
|
|
|
<view class="title newtitle"> {{siteData.siteType=='2'?'加气升数':'加油金额'}}</view> |
|
|
|
|
<input class="newtitle" :placeholder="`请输入${siteData.siteType=='2'?'加气升数':'加油金额'}`" @input="checkNumber" type="digit" |
|
|
|
|
v-model="insertResult.vol" name="input" /> |
|
|
|
|
<input class="newtitle" :placeholder="`请输入${siteData.siteType=='2'?'加气升数':'加油金额'}`" |
|
|
|
|
@input="checkNumber" type="digit" v-model="insertResult.vol" name="input" /> |
|
|
|
|
<view style="width: 170rpx;text-align: end;" class="textEllipsis"> |
|
|
|
|
<text class=""> |
|
|
|
|
<text v-if="siteData.siteType!='2'">{{vlom?'约' + ( (Math.round(vlom*100)/100).toFixed(2) ) + (siteData.siteType=='2'?'元':'L'):''}}</text> |
|
|
|
|
<text v-if="siteData.siteType=='2'">{{vlom?'约' + ( insertResult.vDoMoney ? insertResult.vDoMoney+insertResult.discountMoney:'') + (siteData.siteType=='2'?'元':'L'):''}}</text> |
|
|
|
|
<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> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -183,7 +187,7 @@ |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
changTypes:0, |
|
|
|
|
changTypes: 0, |
|
|
|
|
vlom: '', |
|
|
|
|
siteData: { |
|
|
|
|
|
|
|
|
@ -235,14 +239,14 @@ |
|
|
|
|
}, |
|
|
|
|
orderKey: '', |
|
|
|
|
payState: '0', |
|
|
|
|
type : '' |
|
|
|
|
type: '' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onLoad(option) { |
|
|
|
|
console.log("option============",option) //接收option.type |
|
|
|
|
if(option.type =='rrs'){ |
|
|
|
|
console.log("option============", option) //接收option.type |
|
|
|
|
if (option.type == 'rrs') { |
|
|
|
|
console.log('这里是日日顺') |
|
|
|
|
this.type = 'rrs' //根据option.type 进行本地赋值 |
|
|
|
|
} |
|
|
|
@ -271,10 +275,11 @@ |
|
|
|
|
}, |
|
|
|
|
deep: true |
|
|
|
|
}, |
|
|
|
|
selected: function(newVal, oldVal){ |
|
|
|
|
selected: function(newVal, oldVal) { |
|
|
|
|
if (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 实际加油价格 |
|
|
|
|
if (this.selected.oilSitePrice) { |
|
|
|
|
this.insertResult.oilSitePrice = this.selected.oilSitePrice |
|
|
|
@ -299,10 +304,16 @@ |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
changeType(){ |
|
|
|
|
numberHandle(num) { |
|
|
|
|
num *= 10000 |
|
|
|
|
num /= 100 |
|
|
|
|
num = Math.ceil(num) / 100 |
|
|
|
|
return num.toFixed(2) |
|
|
|
|
}, |
|
|
|
|
changeType() { |
|
|
|
|
this.changTypes = 1 |
|
|
|
|
}, |
|
|
|
|
backType(){ |
|
|
|
|
backType() { |
|
|
|
|
this.changTypes = 0 |
|
|
|
|
}, |
|
|
|
|
checkNumber(e) { |
|
|
|
@ -320,7 +331,7 @@ |
|
|
|
|
this.activeSitePrice = item.priceId |
|
|
|
|
console.log(this.insertResult.vol) |
|
|
|
|
let e = { |
|
|
|
|
detail:{ |
|
|
|
|
detail: { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -380,7 +391,7 @@ |
|
|
|
|
xoilAmountGun: e.detail.value, |
|
|
|
|
priceId: this.activeSitePrice, |
|
|
|
|
companyId: this.siteData.companyId, |
|
|
|
|
createSource:this.siteData.createSource |
|
|
|
|
createSource: this.siteData.createSource |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.xoilAmountGun = e.detail.value |
|
|
|
@ -388,7 +399,7 @@ |
|
|
|
|
oliSiteApi.getOrderDiscountInfo(number).then(res => { |
|
|
|
|
this.insertResult.vDoMoney = res.data.payRealAmount |
|
|
|
|
this.insertResult.discountMoney = res.data.oilDiscountAmount |
|
|
|
|
_that.vlom = res.data.volume.toFixed(2) |
|
|
|
|
_that.vlom = res.data.volume |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
charge() { |
|
|
|
@ -409,19 +420,20 @@ |
|
|
|
|
|
|
|
|
|
// 支付订单 |
|
|
|
|
saveOrder() { |
|
|
|
|
console.log("加油升数:",this.vlom) |
|
|
|
|
console.log("加油金额:",this.insertResult.vol) |
|
|
|
|
console.log("加油升数:", this.vlom) |
|
|
|
|
console.log("加油金额:", this.insertResult.vol) |
|
|
|
|
const orderParams = { |
|
|
|
|
siteId: this.siteData.siteId, |
|
|
|
|
oilsId: this.insertResult.priceId, |
|
|
|
|
volume: this.siteData.siteType=='2'?this.insertResult.vol:this.vlom, |
|
|
|
|
orderNum:this.siteData.otherSerialNumber, |
|
|
|
|
volume: this.siteData.siteType == '2' ? this.insertResult.vol : this.vlom, |
|
|
|
|
orderNum: this.siteData.otherSerialNumber, |
|
|
|
|
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 必有字段 备注:创建来源 |
|
|
|
|
orderSource: "WECHAT_MINIAPPS", |
|
|
|
|
driverName:this.siteData.customerName, |
|
|
|
|
driverPhone:this.siteData.customerPhone, |
|
|
|
|
driverName: this.siteData.customerName, |
|
|
|
|
driverPhone: this.siteData.customerPhone, |
|
|
|
|
plateNumber: this.carNumber, |
|
|
|
|
customerId: this.siteData.customerId, //类型:String 必有字段 备注:司机id |
|
|
|
|
companyId: this.siteData.companyId, //类型:String 必有字段 备注:企业id |
|
|
|
@ -519,8 +531,9 @@ |
|
|
|
|
oliSiteApi.verifyQrCode(this.zyInfo).then(res => { |
|
|
|
|
if (res.code === 20000) { |
|
|
|
|
this.siteData = res.data |
|
|
|
|
if(res.data.oilSitePriceDetailsVos){ |
|
|
|
|
this.insertResult = Object.assign(this.insertResult,res.data.oilSitePriceDetailsVos[0]) |
|
|
|
|
if (res.data.oilSitePriceDetailsVos) { |
|
|
|
|
this.insertResult = Object.assign(this.insertResult, res.data.oilSitePriceDetailsVos[ |
|
|
|
|
0]) |
|
|
|
|
console.log(this.insertResult) |
|
|
|
|
} |
|
|
|
|
this.carNumber = res.data.plateNumber; |
|
|
|
@ -541,22 +554,24 @@ |
|
|
|
|
tRadio() { |
|
|
|
|
this.radio === 'A' ? this.radio = '' : this.radio = 'A' |
|
|
|
|
}, |
|
|
|
|
changeMoney(){ |
|
|
|
|
changeMoney() { |
|
|
|
|
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 |
|
|
|
|
}, |
|
|
|
|
calcMoney(e) { |
|
|
|
|
// console.log(e) |
|
|
|
|
if(this.changTypes = 1){ |
|
|
|
|
if (this.changTypes = 1) { |
|
|
|
|
let rrs = e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]; // 处理输入油升数 只保留小数点后两位 |
|
|
|
|
this.$nextTick(() => { //重新赋值给input |
|
|
|
|
this.insertResult.vol= rrs |
|
|
|
|
this.insertResult.vol = rrs |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
// oilSitePrice 市场价格 sitePrice 实际加油价格 |
|
|
|
|
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 |
|
|
|
|
}, |
|
|
|
|
queryTimer() { |
|
|
|
|