You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
178 lines
4.1 KiB
178 lines
4.1 KiB
<template>
|
|
<view>
|
|
<view class="username">
|
|
<view class="namecont">国标价</view>
|
|
<input placeholder="请输入国标价" v-model="nationalPrice" disabled="true" type="text"
|
|
placeholder-style="color: #bfbfbf;font-size:14px;padding-top:2px;" />
|
|
</view>
|
|
<view class="username">
|
|
<view class="namecont">油站价</view>
|
|
<input placeholder="请输入油站价" v-model="stationPrice" type="text"
|
|
placeholder-style="color: #bfbfbf;font-size:14px;padding-top:2px;" />
|
|
</view>
|
|
<view class="username">
|
|
<view class="namecont">优惠幅度</view>
|
|
<input placeholder="请输入优惠幅度" v-model="discountPrice" type="text"
|
|
placeholder-style="color: #bfbfbf;font-size:14px;padding-top:2px;" />
|
|
</view>
|
|
<view class="btn mart50" @click="editGasOilPrice()" v-if="positionGunPrice == 1">修 改</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
getOilPriceDetail,
|
|
editGasOilPrice
|
|
} from '../../../Utils/Api.js';
|
|
let app = getApp();
|
|
export default {
|
|
data() {
|
|
return {
|
|
nationalPrice: '', //国标价
|
|
stationPrice: '', //油站价
|
|
discountPrice: '', //优惠价
|
|
oilNo: '', //油品
|
|
oilDetails: '', //油品详情
|
|
userinfo: '' ,//个人信息
|
|
positionGunPrice: app.globalData.positionGunPrice // 角色权限
|
|
}
|
|
},
|
|
onLoad(options) {
|
|
this.oilNo = options.oilno;
|
|
this.userinfo = app.globalData.userInfo;
|
|
this.getOilPriceDetail();
|
|
},
|
|
methods: {
|
|
//查询详情
|
|
getOilPriceDetail() {
|
|
let datas = {
|
|
storeId: this.userinfo.merchantStore.id,
|
|
oilNo: this.oilNo
|
|
}
|
|
getOilPriceDetail(datas).then(res => {
|
|
if (res.return_code == '000000') {
|
|
this.oilDetails = res.return_data;
|
|
this.nationalPrice = res.return_data.priceOfficial;
|
|
this.stationPrice = res.return_data.priceGun;
|
|
this.discountPrice = res.return_data.preferentialMargin;
|
|
}
|
|
});
|
|
},
|
|
//修改价格
|
|
editGasOilPrice() {
|
|
if (this.stationPrice.length == "") {
|
|
uni.showToast({
|
|
icon: 'none',
|
|
duration: 2000,
|
|
title: '请输入油站价格'
|
|
});
|
|
return;
|
|
}
|
|
if (this.discountPrice.length == "") {
|
|
uni.showToast({
|
|
icon: 'none',
|
|
duration: 2000,
|
|
title: '请输入优惠幅度'
|
|
});
|
|
return;
|
|
}
|
|
uni.showLoading({
|
|
title: '提交中'
|
|
})
|
|
let datas = {
|
|
"storeId": app.globalData.userInfo.merchantStore.id,
|
|
"oilNo": this.oilNo,
|
|
"priceGun": this.stationPrice,
|
|
"preferentialMargin": this.discountPrice
|
|
}
|
|
editGasOilPrice(datas).then(res => {
|
|
uni.hideLoading();
|
|
if (res.return_code == '000000') {
|
|
uni.showToast({
|
|
title: '添加成功',
|
|
icon: 'none',
|
|
duration: 2000,
|
|
success() {
|
|
setTimeout(() => {
|
|
uni.navigateBack({})
|
|
}, 1500);
|
|
}
|
|
})
|
|
} else {
|
|
uni.showToast({
|
|
title: res.return_msg,
|
|
duration: 2000,
|
|
icon: 'none'
|
|
})
|
|
}
|
|
});
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.username {
|
|
width: calc(100% - 90upx);
|
|
height: 100upx;
|
|
display: flex;
|
|
align-items: center;
|
|
background-color: rgba($color: #ffffff, $alpha: 0.1);
|
|
border-bottom: 1px solid #f6f6f6;
|
|
padding: 8upx 45upx;
|
|
|
|
input {
|
|
width: 50%;
|
|
height: 50upx;
|
|
font-size: 16px;
|
|
color: #333333;
|
|
font-weight: blod;
|
|
}
|
|
|
|
.get-code {
|
|
position: absolute;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
right: 7px;
|
|
z-index: 3;
|
|
border: 1px solid #bfbfbf;
|
|
width: 25%;
|
|
padding: 3px 5px;
|
|
border-radius: 22px;
|
|
|
|
&:after {
|
|
content: " ";
|
|
width: 1upx;
|
|
height: 50upx;
|
|
position: absolute;
|
|
z-index: 3;
|
|
margin-right: 100%;
|
|
left: 0;
|
|
top: 20upx;
|
|
}
|
|
}
|
|
|
|
.namecont {
|
|
color: #666666;
|
|
width: 28%;
|
|
}
|
|
}
|
|
|
|
.btn {
|
|
bottom: 0px;
|
|
position: absolute;
|
|
color: #FFFFFF;
|
|
background-color: #0083f5;
|
|
width: 90%;
|
|
margin-left: 5%;
|
|
margin-top: 80rpx;
|
|
margin-bottom: 50rpx;
|
|
height: 90rpx;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
border-radius: 45rpx;
|
|
font-size: 40rpx;
|
|
}
|
|
</style>
|
|
|