更新
This commit is contained in:
@@ -65,10 +65,17 @@
|
||||
style="font-size: 22rpx; color:#EE0707;margin-left: 30rpx;">
|
||||
原价:{{ Number(aboutEnterprise.oilSiteOilsPrices[aboutEnterprise.oloIndex].marketPrice).toFixed(2)}}
|
||||
</text>
|
||||
<uni-icons
|
||||
v-if="aboutEnterprise.oilSiteOilsPrices[aboutEnterprise.oloIndex].marketPricetipIsShow"
|
||||
id="oilProductCode" style="margin-left: 15rpx;margin-top: 2rpx;" type="info-filled"
|
||||
size="20"
|
||||
@tap="tipAppear('发改委价格',aboutEnterprise.oilSiteOilsPrices[aboutEnterprise.oloIndex].marketPrice)">
|
||||
</uni-icons>
|
||||
</view>
|
||||
<view slot="body" class="list_right ">
|
||||
<view style="width: 100%;display: flex; ">
|
||||
<input :disabled='disabled' placeholder="请输入价格" @input="inputFn('marketPrice')" type="digit"
|
||||
<input :disabled='disabled' placeholder="请输入价格"
|
||||
@input="inputFn('marketPrice','marketPrice')" type="digit"
|
||||
v-model="aboutEnterprise.marketPrice" class="list_right_input" />
|
||||
<text class="yuan">元</text>
|
||||
</view>
|
||||
@@ -81,11 +88,15 @@
|
||||
style="font-size: 22rpx; color:#EE0707;margin-left: 30rpx;">
|
||||
原价:{{Number(aboutEnterprise.oilSiteOilsPrices[aboutEnterprise.oloIndex].sitePrice).toFixed(2)}}
|
||||
</text>
|
||||
<uni-icons v-if="aboutEnterprise.oilSiteOilsPrices[aboutEnterprise.oloIndex].sitePricetipIsShow"
|
||||
style="margin-left: 15rpx;margin-top: 2rpx;" type="info-filled" size="15"
|
||||
@tap="tipAppear('油站价格',aboutEnterprise.oilSiteOilsPrices[aboutEnterprise.oloIndex].sitePrice)">
|
||||
</uni-icons>
|
||||
</view>
|
||||
<view slot="body" class="list_right ">
|
||||
<view style="width: 100%;display: flex; ">
|
||||
<input :disabled='disabled' placeholder="请输入价格" @input="inputFn('sitePrice')" type="digit"
|
||||
v-model="aboutEnterprise.sitePrice" class="list_right_input" />
|
||||
<input :disabled='disabled' placeholder="请输入价格" @input="inputFn('sitePrice','sitePrice')"
|
||||
type="digit" v-model="aboutEnterprise.sitePrice" class="list_right_input" />
|
||||
<text class="yuan">元</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -128,11 +139,17 @@
|
||||
style="font-size: 22rpx; color:#EE0707;margin-left: 30rpx;">
|
||||
{{Number(aboutEnterprise.oilSiteOilsPrices[aboutEnterprise.oloIndex].enterprisePrice).toFixed(2)}}
|
||||
</text>
|
||||
<uni-icons
|
||||
v-if="aboutEnterprise.oilSiteOilsPrices[aboutEnterprise.oloIndex].enterprisePricetipIsShow"
|
||||
style="margin-left: 15rpx;margin-top: 2rpx;" type="info-filled" size="15"
|
||||
@tap="tipAppear('企业价',aboutEnterprise.oilSiteOilsPrices[aboutEnterprise.oloIndex].enterprisePrice)">
|
||||
</uni-icons>
|
||||
</view>
|
||||
<view slot="body" class="list_right ">
|
||||
<view style="width: 100%;display: flex; ">
|
||||
<input :disabled='disabled' placeholder="请输入价格" @input="inputFn('newEnterprisePrice')"
|
||||
type="digit" v-model="aboutEnterprise.newEnterprisePrice" class="list_right_input" />
|
||||
<input :disabled='disabled' placeholder="请输入价格"
|
||||
@input="inputFn('newEnterprisePrice','enterprisePrice')" type="digit"
|
||||
v-model="aboutEnterprise.newEnterprisePrice" class="list_right_input" />
|
||||
<text class="yuan">元</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -144,11 +161,17 @@
|
||||
style="font-size: 22rpx; color:#EE0707;margin-left: 30rpx;">
|
||||
{{Number(aboutEnterprise.oilSiteOilsPrices[aboutEnterprise.oloIndex].floorPrice||0).toFixed(4)}}
|
||||
</text>
|
||||
<uni-icons
|
||||
v-if="aboutEnterprise.oilSiteOilsPrices[aboutEnterprise.oloIndex].floorPricetipIsShow"
|
||||
style="margin-left: 15rpx;margin-top: 2rpx;" type="info-filled" size="15"
|
||||
@tap="tipAppear('底价',aboutEnterprise.oilSiteOilsPrices[aboutEnterprise.oloIndex].floorPrice || 0, 4)">
|
||||
</uni-icons>
|
||||
</view>
|
||||
<view slot="body" class="list_right ">
|
||||
<view style="width: 100%;display: flex; ">
|
||||
<input :disabled='disabled' placeholder="请输入价格" @input="inputFn('newFloorPrice')"
|
||||
type="digit" v-model="aboutEnterprise.newFloorPrice" class="list_right_input" />
|
||||
<input :disabled='disabled' placeholder="请输入价格"
|
||||
@input="inputFn('newFloorPrice','floorPrice')" type="digit"
|
||||
v-model="aboutEnterprise.newFloorPrice" class="list_right_input" />
|
||||
<text class="yuan">元</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -161,11 +184,17 @@
|
||||
style="font-size: 22rpx; color:#EE0707;margin-left: 30rpx;">
|
||||
{{Number(aboutEnterprise.oilSiteOilsPrices[aboutEnterprise.oloIndex].settlementPrice).toFixed(2)}}
|
||||
</text>
|
||||
<uni-icons
|
||||
v-if="aboutEnterprise.oilSiteOilsPrices[aboutEnterprise.oloIndex].settlementPricetipIsShow"
|
||||
style="margin-left: 15rpx;margin-top: 2rpx;" type="info-filled" size="15"
|
||||
@tap="tipAppear('结算价',aboutEnterprise.oilSiteOilsPrices[aboutEnterprise.oloIndex].settlementPrice)">
|
||||
</uni-icons>
|
||||
</view>
|
||||
<view slot="body" class="list_right ">
|
||||
<view style="width: 100%;display: flex; ">
|
||||
<input :disabled='disabled' placeholder="请输入价格" @input="inputFn('newSettlementPrice')"
|
||||
type="digit" v-model="aboutEnterprise.newSettlementPrice" class="list_right_input" />
|
||||
<input :disabled='disabled' placeholder="请输入价格"
|
||||
@input="inputFn('newSettlementPrice','settlementPrice')" type="digit"
|
||||
v-model="aboutEnterprise.newSettlementPrice" class="list_right_input" />
|
||||
<text class="yuan">元</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -201,6 +230,17 @@
|
||||
<view class="list_footer">
|
||||
<button @tap="postFn" class="list_butten ">保存</button>
|
||||
</view>
|
||||
|
||||
<!-- <view v-show="windowInfo.show" :style="{top:windowInfo.x,left:windowInfo.y}" class="tip-container">
|
||||
{{windowInfo.text}}
|
||||
</view> -->
|
||||
|
||||
<uni-popup ref="popup" type="top" background-color="#fff">
|
||||
<view style="padding: 20rpx 50rpx; text-align: center;">
|
||||
{{windowInfo.text}}
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<popup @confirmFn='confirmFn' @closeFn='closeFn' :styles="{width:'610rpx'}" v-model="isShow.oliType">
|
||||
<view slot="coment">
|
||||
<view class="olipopup">
|
||||
@@ -275,6 +315,12 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
windowInfo: {
|
||||
show: false,
|
||||
x: 0,
|
||||
y: 0,
|
||||
text: ''
|
||||
},
|
||||
immediate: null,
|
||||
time: null,
|
||||
timing: 0,
|
||||
@@ -386,13 +432,22 @@
|
||||
value: 1
|
||||
},
|
||||
],
|
||||
priceArr: ['marketPrice', 'sitePrice', 'enterprisePrice', 'floorPrice', 'settlementPrice']
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
let that = this
|
||||
|
||||
uni.$on('serviceStation', function(e) {
|
||||
console.log('%c 油站参数更新↓', 'font-size:50px;color:red')
|
||||
that.aboutEnterprise = Object.assign(that.aboutEnterprise, e)
|
||||
console.log('that.aboutEnterprise', that.aboutEnterprise)
|
||||
that.aboutEnterprise.oilSiteOilsPrices.map(item => {
|
||||
that.priceArr.forEach(key => {
|
||||
item[`${key}tipIsShow`] = false
|
||||
})
|
||||
return item
|
||||
})
|
||||
that.aboutEnterprise.siteId = that.aboutEnterprise.id
|
||||
that.clearFn();
|
||||
uni.removeStorage({
|
||||
@@ -407,7 +462,7 @@
|
||||
`${start.getFullYear()}-${start.getMonth()+1}-${start.getDate()} ${start.getHours()}:${start.getMinutes()}:00`
|
||||
console.log(this.start, '---')
|
||||
},
|
||||
created() {},
|
||||
|
||||
watch: {
|
||||
'isShow.oliType': {
|
||||
handler(n, o) {
|
||||
@@ -483,7 +538,33 @@
|
||||
});
|
||||
|
||||
},
|
||||
created() {
|
||||
// this.tipAppear = this.tipAppear()
|
||||
},
|
||||
methods: {
|
||||
tipAppear(title, originalPrice, num = 2) {
|
||||
originalPrice = originalPrice.toFixed(num)
|
||||
let text =
|
||||
`调整后${title}建议控制在${((originalPrice * 1000) / 1000 - 0.6).toFixed(num)}~${((originalPrice * 1000) / 1000 + 0.6).toFixed(num)}之间`
|
||||
this.windowInfo.text = text
|
||||
this.$refs.popup.open()
|
||||
return
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
return (pos, item) => {
|
||||
console.log(1)
|
||||
setTimeout(() => {
|
||||
query.select(pos).boundingClientRect(data => {
|
||||
this.windowInfo = {
|
||||
x: `${data.left}rpx`,
|
||||
y: `${data.top}rpx`,
|
||||
text: '发改委价格',
|
||||
show: true
|
||||
}
|
||||
}).exec();
|
||||
}, 0)
|
||||
}
|
||||
// this.$refs.popup.open()
|
||||
},
|
||||
icontype(item) {
|
||||
'use strict'
|
||||
return Number(this.aboutEnterprise[item.price]) > Number(this.aboutEnterprise[item.oldePrice]) ?
|
||||
@@ -618,8 +699,9 @@
|
||||
this.aboutEnterprise.subEntryTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:00`
|
||||
console.log(e)
|
||||
},
|
||||
inputFn(e) {
|
||||
inputFn(e, originE) {
|
||||
console.log(this.aboutEnterprise[e])
|
||||
|
||||
if (this.aboutEnterprise[e].indexOf('.') != -1) {
|
||||
if (e == 'newFloorPrice') {
|
||||
if (this.aboutEnterprise[e].split('.')[1].length > 4) {
|
||||
@@ -627,8 +709,9 @@
|
||||
title: '最多保留小数点后4位',
|
||||
icon: 'none'
|
||||
})
|
||||
this.$nextTick(function() {
|
||||
this.$nextTick(() => {
|
||||
this.aboutEnterprise[e] = Number(this.aboutEnterprise[e]).toFixed(4)
|
||||
|
||||
})
|
||||
}
|
||||
} else {
|
||||
@@ -637,13 +720,25 @@
|
||||
title: '最多保留小数点后两位',
|
||||
icon: 'none'
|
||||
})
|
||||
this.$nextTick(function() {
|
||||
this.$nextTick(() => {
|
||||
this.aboutEnterprise[e] = Number(this.aboutEnterprise[e]).toFixed(2)
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
this.isMeetWithTip(e, originE)
|
||||
},
|
||||
isMeetWithTip(e, originE) {
|
||||
let originalInfo = this.aboutEnterprise.oilSiteOilsPrices[this.aboutEnterprise.oloIndex]
|
||||
if (!originalInfo) {
|
||||
return
|
||||
}
|
||||
let originalPrice = originalInfo[originE]
|
||||
let newPrice = this.aboutEnterprise[e]
|
||||
originalInfo[`${originE}tipIsShow`] = +newPrice > +originalPrice + 0.6 || +newPrice < +originalPrice - 0.6
|
||||
},
|
||||
postFn() {
|
||||
let checkPage = {
|
||||
@@ -721,6 +816,37 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
let info = this.aboutEnterprise.oilSiteOilsPrices[this.aboutEnterprise.oloIndex]
|
||||
let result = this.priceArr.some(item => {
|
||||
return info[`${item}tipIsShow`]
|
||||
})
|
||||
|
||||
if(result) {
|
||||
uni.showModal({
|
||||
title: '部分调整后价格,可能超出合理范围。是否确认',
|
||||
confirmText: '确认',
|
||||
icon: 'none',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
if (+this.aboutEnterprise.newFloorPrice > +this.aboutEnterprise.newEnterprisePrice) {
|
||||
uni.showModal({
|
||||
title: '当前调价后,存在企业价低于底价,超出合理范围,是否确认',
|
||||
confirmText: '确认',
|
||||
icon: 'none',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this.countdownInit()
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
this.countdownInit()
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
if (+this.aboutEnterprise.newFloorPrice > +this.aboutEnterprise.newEnterprisePrice) {
|
||||
uni.showModal({
|
||||
title: '当前调价后,存在企业价低于底价,超出合理范围,是否确认',
|
||||
@@ -1072,4 +1198,16 @@
|
||||
padding: 19rpx 20rpx 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.tip-container {
|
||||
position: absolute;
|
||||
padding: 15rpx 25rpx;
|
||||
display: block;
|
||||
width: 300rpx;
|
||||
color: #fff;
|
||||
// height: 200rpx;
|
||||
background: #33333390;
|
||||
border-radius: 20rpx;
|
||||
z-index: 20;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user