@@ -74,9 +74,10 @@
< / view >
< view slot = "body" class = "list_right " >
< view style = "width: 100%;display: flex; " >
< input : disabled = 'disabled' placeholder = "请输入价格"
< input : disabled = 'disabled || dislpayData.marketPrice ' placeholder = "请输入价格"
@input ="inputFn('marketPrice','marketPrice')" type = "digit"
v-model = "aboutEnterprise.marketPrice" class="list_right_input" / >
v-model = "aboutEnterprise.marketPrice" class="list_right_input"
: style = "{color:dislpayData.marketPrice?'#d5d5d5':' '}" / >
< text class = "yuan" > 元 < / text >
< / view >
< / view >
@@ -95,8 +96,9 @@
< / view >
< view slot = "body" class = "list_right " >
< view style = "width: 100%;display: flex; " >
< input : disabled = 'disabled' placeholder = "请输入价格" @input ="inputFn('sitePrice','sitePrice')"
type = "digit" v-model = "aboutEnterprise.sitePrice" class="list_right_input" / >
< input : disabled = 'disabled || dislpayData.sitePrice ' placeholder = "请输入价格" @input ="inputFn('sitePrice','sitePrice')"
type = "digit" v-model = "aboutEnterprise.sitePrice" class="list_right_input"
: style = "{color:dislpayData.sitePrice?'#d5d5d5':' '}" / >
< text class = "yuan" > 元 < / text >
< / view >
< / view >
@@ -147,9 +149,10 @@
< / view >
< view slot = "body" class = "list_right " >
< view style = "width: 100%;display: flex; " >
< input : disabled = 'disabled' placeholder = "请输入价格"
< input : disabled = 'disabled || dislpayData.enterprisePrice ' placeholder = "请输入价格"
@input ="inputFn('newEnterprisePrice','enterprisePrice')" type = "digit"
v-model = "aboutEnterprise.newEnterprisePrice" class="list_right_input" / >
v-model = "aboutEnterprise.newEnterprisePrice" class="list_right_input"
: style = "{color:dislpayData.enterprisePrice?'#d5d5d5':' '}" / >
< text class = "yuan" > 元 < / text >
< / view >
< / view >
@@ -169,9 +172,10 @@
< / view >
< view slot = "body" class = "list_right " >
< view style = "width: 100%;display: flex; " >
< input : disabled = 'disabled' placeholder = "请输入价格"
< input : disabled = 'disabled || dislpayData.floorPrice ' placeholder = "请输入价格"
@input ="inputFn('newFloorPrice','floorPrice')" type = "digit"
v-model = "aboutEnterprise.newFloorPrice" class="list_right_input" / >
v-model = "aboutEnterprise.newFloorPrice" class="list_right_input"
: style = "{color:dislpayData.floorPrice?'#d5d5d5':' '}" / >
< text class = "yuan" > 元 < / text >
< / view >
< / view >
@@ -182,7 +186,7 @@
结算价
< text v-if = "aboutEnterprise.oilProductCode"
style = "font-size: 22rpx; color:#EE0707;margin-left: 30rpx;" >
{ { Number ( aboutEnterprise . oilSiteOilsPrices [ aboutEnterprise . oloIndex ] . settlementPrice ) . toFixed ( 4 ) } }
{ { Number ( aboutEnterprise . oilSiteOilsPrices [ aboutEnterprise . oloIndex ] . settlementPrice ) . toFixed ( 2 ) } }
< / text >
< uni-icons
v-if = "aboutEnterprise.oilSiteOilsPrices[aboutEnterprise.oloIndex].settlementPricetipIsShow"
@@ -192,9 +196,10 @@
< / view >
< view slot = "body" class = "list_right " >
< view style = "width: 100%;display: flex; " >
< input : disabled = 'disabled' placeholder = "请输入价格"
< input : disabled = 'disabled || dislpayData.settlementPrice ' placeholder = "请输入价格"
@input ="inputFn('newSettlementPrice','settlementPrice')" type = "digit"
v-model = "aboutEnterprise.newSettlementPrice" class="list_right_input" / >
v-model = "aboutEnterprise.newSettlementPrice" class="list_right_input"
: style = "{color:dislpayData.settlementPrice?'#d5d5d5':' '}" / >
< text class = "yuan" > 元 < / text >
< / view >
< / view >
@@ -226,6 +231,61 @@
< / view >
< / uni-list >
< / view >
< view class = "addDiver_card" v-if = "aboutEnterprise.oilProductCode&&JSON.stringify(stationStrategyData) != '{}'" >
< view >
< view style = "line-height: 56rpx;position: relative;" > 策略组 : { { stationStrategyData . strategyName } }
< u-radio-group
style = "position: absolute;top: 0;right: 0;"
v-model = "radioPlice" >
< u-radio : customStyle = "{marginBottom: '8px'}"
v-for = "(item, index) in radiolistPlice" :key="index" :label="item.name" :name="item.value"
@change ="radioPliceChange" >
{{ item.name }}
< / u -radio >
< / u-radio-group >
< / view >
< / view >
< view >
< view v-for = "(item,index) in priceStrategyData" :key='index' :value="item.value" :label="item.label" >
< view class = "strategyPrice" v-if = "item.value == 'marketPrice'" >
发改委价 : {{ stationStrategyData.marketPricePoint = = 1 ? ' 自定义 ' : strategyFormula ( stationStrategyData.marketPricePoint ) }}
{{ stationStrategyData.marketPriceOperator = = null | | stationStrategyData.marketPriceOperator = = undefined ?
' ' : stationStrategyData.marketPriceOperator }}
{{ stationStrategyData.marketPriceStrategy = = null | | stationStrategyData.marketPriceStrategy = = undefined ?
' ' : stationStrategyData.marketPriceStrategy }}
< / view >
< view class = "strategyPrice" v-if = "item.value == 'floorPrice'" >
底价 : {{ stationStrategyData.floorPricePoint = = 1 ? ' 自定义 ' : strategyFormula ( stationStrategyData.floorPricePoint ) }}
{{ stationStrategyData.floorPriceOperator = = null | | stationStrategyData.floorPriceOperator = = undefined ?
' ' : stationStrategyData.floorPriceOperator }}
{{ stationStrategyData.floorPriceStrategy = = null | | stationStrategyData.floorPriceStrategy = = undefined ?
' ' : stationStrategyData.floorPriceStrategy }}
< / view >
< view class = "strategyPrice" v-if = "item.value == 'sitePrice'" >
油站价 : {{ stationStrategyData.sitePricePoint = = 1 ? ' 自定义 ' : strategyFormula ( stationStrategyData.sitePricePoint ) }}
{{ stationStrategyData.sitePriceOperator = = null | | stationStrategyData.sitePriceOperator = = undefined ?
' ' : stationStrategyData.sitePriceOperator }}
{{ stationStrategyData.sitePriceStrategy = = null | | stationStrategyData.sitePriceStrategy = = undefined ?
' ' : stationStrategyData.sitePriceStrategy }}
< / view >
< view class = "strategyPrice" v-if = "item.value == 'settlementPrice'" >
结算价 : {{ stationStrategyData.settlementPricePoint = = 1 ? ' 自定义 ' : strategyFormula ( stationStrategyData.settlementPricePoint ) }}
{{ stationStrategyData.settlementPriceOperator = = null | | stationStrategyData.settlementPriceOperator = = undefined ?
' ' : stationStrategyData.settlementPriceOperator }}
{{ stationStrategyData.settlementPriceStrategy = = null | | stationStrategyData.settlementPriceStrategy = = undefined ?
' ' : stationStrategyData.settlementPriceStrategy }}
< / view >
< view class = "strategyPrice" v-if = "item.value == 'companyPrice'" >
企业价 : {{ stationStrategyData.companyPricePoint = = 1 ? ' 自定义 ' : strategyFormula ( stationStrategyData.companyPricePoint ) }}
{{ stationStrategyData.companyPriceOperator = = null | | stationStrategyData.companyPriceOperator = = undefined ?
' ' : stationStrategyData.companyPriceOperator }}
{{ stationStrategyData.companyPriceStrategy = = null | | stationStrategyData.companyPriceStrategy = = undefined ?
' ' : stationStrategyData.companyPriceStrategy }}
< / view >
< / view >
< / view >
< / view >
< ! - - 底部按钮 - - >
< view class = "list_footer" >
< button @tap ="postFn" class = "list_butten " > 保存 < / button >
@@ -289,12 +349,12 @@
< view v-for = "(item,index) in priceData" class="detailse_content_item" >
< view class = "hui" > { { item . lable } } < / view >
< view >
< text > { { Number ( aboutEnterprise [ item . price ] ) . toFixed ( ( item . lable == '底价' || item . lable == '结算价' ) ?4 : 2 ) } } < / text >
< text > { { Number ( aboutEnterprise [ item . price ] ) . toFixed ( item . lable == '底价' ? 4 : 2 ) } } < / text >
< uni-icons : color = "iconFn(item) " custom -prefix = " iconfont " : type = "icontype(item) "
size = "15" > < / uni-icons >
< text
class = "samlltext hui de" > { { Number ( aboutEnterprise [ item . oldePrice ] || 0 ) . toFixed ( ( item . lable == '底价' || item . lable == '结算价' ) ?4 : 2 ) } } < / text >
class = "samlltext hui de" > { { Number ( aboutEnterprise [ item . oldePrice ] || 0 ) . toFixed ( item . lable == '底价' ? 4 : 2 ) } } < / text >
< / view >
< / view >
< / view >
@@ -432,7 +492,42 @@
value : 1
} ,
] ,
priceArr : [ 'marketPrice' , 'sitePrice' , 'enterprisePrice' , 'floorPrice' , 'settlementPrice' ]
priceArr : [ 'marketPrice' , 'sitePrice' , 'enterprisePrice' , 'floorPrice' , 'settlementPrice' ] ,
radiolistPlice : [ {
name : '启用' ,
value : '0'
} ,
{
name : '临时禁用' ,
value : '1'
} ,
] ,
radioPlice : '0' ,
stationStrategyData : { } ,
priceStrategyData : [ {
lable : '发改委价' ,
value : 'marketPrice' ,
} , {
lable : '油站价' ,
value : 'sitePrice' ,
} , {
lable : '企业价' ,
value : 'companyPrice'
} , {
lable : '底价' ,
value : 'floorPrice'
} , {
lable : '结算价' ,
value : 'settlementPrice'
} ] ,
isApplication : true ,
dislpayData : {
marketPrice : false ,
sitePrice : false ,
enterprisePrice : false ,
settlementPrice : false ,
floorPrice : false
} ,
}
} ,
onLoad ( ) {
@@ -472,7 +567,164 @@
this . disabled = false
}
}
}
} ,
'aboutEnterprise.marketPrice' ( val ) {
// 发改委价
let decimal = 100
if ( val != '' && this . isApplication == true ) {
let applicationStra = this . stationStrategyData
// 油站价
if ( applicationStra . sitePricePoint == 'marketPrice' && applicationStra . sitePriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . sitePriceOperator , applicationStra . sitePriceStrategy )
this . aboutEnterprise . sitePrice =
Math . round ( countPrice * decimal ) / decimal
}
// 底价
if ( applicationStra . floorPricePoint == 'marketPrice' && applicationStra . floorPriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . floorPriceOperator , applicationStra . floorPriceStrategy )
this . aboutEnterprise . newFloorPrice =
Math . round ( countPrice * 10000 ) / 10000
}
// 企业价
if ( applicationStra . companyPricePoint == 'marketPrice' && applicationStra . companyPriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . companyPriceOperator , applicationStra . companyPriceStrategy )
this . aboutEnterprise . newEnterprisePrice =
Math . round ( countPrice * decimal ) / decimal
}
// 结算价
if ( applicationStra . otherPricePoint == 'marketPrice' && applicationStra . settlementPriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . settlementPriceOperator , applicationStra . settlementPriceStrategy )
this . aboutEnterprise . newSettlementPrice =
Math . round ( countPrice * decimal ) / decimal
}
}
} ,
'aboutEnterprise.newFloorPrice' ( val ) {
// 底价
let decimal = 100
if ( val != '' && this . isApplication == true ) {
let applicationStra = this . stationStrategyData
// 企业价
if ( applicationStra . companyPricePoint == 'floorPrice' && applicationStra . companyPriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . companyPriceOperator , applicationStra . companyPriceStrategy )
this . aboutEnterprise . newEnterprisePrice = Math . round ( countPrice * decimal ) / decimal
}
// 结算价
if ( applicationStra . settlementPricePoint == 'floorPrice' && applicationStra . settlementPriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . settlementPriceOperator , applicationStra . settlementPriceStrategy )
this . aboutEnterprise . newSettlementPrice = Math . round ( countPrice * decimal ) / decimal
}
// 油站价
if ( applicationStra . sitePricePoint == 'floorPrice' && applicationStra . sitePriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . sitePriceOperator , applicationStra . sitePriceStrategy )
this . aboutEnterprise . sitePrice = Math . round ( countPrice * decimal ) / decimal
}
// 发改委价
if ( applicationStra . marketPricePoint == 'floorPrice' && applicationStra . marketPriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . marketPriceOperator , applicationStra . marketPriceStrategy )
this . aboutEnterprise . marketPrice = Math . round ( countPrice * decimal ) / decimal
}
}
} ,
'aboutEnterprise.newSettlementPrice' ( val ) {
// 结算价
let decimal = 100
if ( val != '' && this . isApplication == true ) {
let applicationStra = this . stationStrategyData
// 油站价
if ( applicationStra . sitePricePoint == 'settlementPrice' && applicationStra . sitePriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . sitePriceOperator , applicationStra . sitePriceStrategy )
this . aboutEnterprise . sitePrice =
Math . round ( countPrice * decimal ) / decimal
}
// 底价
if ( applicationStra . floorPricePoint == 'settlementPrice' && applicationStra . floorPriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . floorPriceOperator , applicationStra . floorPriceStrategy )
this . aboutEnterprise . newFloorPrice =
Math . round ( countPrice * 10000 ) / 10000
}
// 企业价
if ( applicationStra . companyPricePoint == 'settlementPrice' && applicationStra . companyPriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . companyPriceOperator , applicationStra . companyPriceStrategy )
this . aboutEnterprise . newEnterprisePrice =
Math . round ( countPrice * decimal ) / decimal
}
// 发改委价
if ( applicationStra . marketPricePoint == 'settlementPrice' && applicationStra . marketPriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . marketPriceOperator , applicationStra . marketPriceStrategy )
this . aboutEnterprise . marketPrice =
Math . round ( countPrice * decimal ) / decimal
}
}
} ,
'aboutEnterprise.sitePrice' ( val ) {
// 油站价
let decimal = 100
if ( val != '' && this . isApplication == true ) {
let applicationStra = this . stationStrategyData
// 底价
if ( applicationStra . floorPricePoint == 'sitePrice' && applicationStra . floorPriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . floorPriceOperator , applicationStra . floorPriceStrategy )
this . aboutEnterprise . newFloorPrice =
Math . round ( countPrice * 10000 ) / 10000
}
// 企业价
if ( applicationStra . companyPricePoint == 'sitePrice' && applicationStra . companyPriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . companyPriceOperator , applicationStra . companyPriceStrategy )
this . aboutEnterprise . newEnterprisePrice =
Math . round ( countPrice * decimal ) / decimal
}
// 结算价
if ( applicationStra . settlementPricePoint == 'sitePrice' && applicationStra . settlementPriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . settlementPriceOperator , applicationStra . settlementPriceStrategy )
this . aboutEnterprise . newSettlementPrice =
Math . round ( countPrice * decimal ) / decimal
}
// 发改委价
if ( applicationStra . marketPricePoint == 'sitePrice' && applicationStra . marketPriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . marketPriceOperator , applicationStra . marketPriceStrategy )
this . aboutEnterprise . marketPrice =
Math . round ( countPrice * decimal ) / decimal
}
}
} ,
'aboutEnterprise.newEnterprisePrice' ( val ) {
// 企业价
let decimal = 100
if ( val != '' && this . isApplication == true ) {
let applicationStra = this . stationStrategyData
// 底价
if ( applicationStra . floorPricePoint == 'companyPrice' && applicationStra . floorPriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . floorPriceOperator , applicationStra . floorPriceStrategy )
this . aboutEnterprise . newFloorPrice =
Math . round ( countPrice * 10000 ) / 10000
}
// 结算价
if ( applicationStra . settlementPricePoint == 'companyPrice' && applicationStra . settlementPriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . settlementPriceOperator , applicationStra . settlementPriceStrategy )
this . aboutEnterprise . newSettlementPrice =
Math . round ( countPrice * decimal ) / decimal
}
// 油站价
if ( applicationStra . sitePricePoint == 'companyPrice' && applicationStra . sitePriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . sitePriceOperator , applicationStra . sitePriceStrategy )
this . aboutEnterprise . sitePrice =
Math . round ( countPrice * decimal ) / decimal
}
// 发改委价
if ( applicationStra . marketPricePoint == 'companyPrice' && applicationStra . marketPriceOperator != '' ) {
let countPrice = this . strategyHandle ( val , applicationStra . marketPriceOperator , applicationStra . marketPriceStrategy )
this . aboutEnterprise . marketPrice =
Math . round ( countPrice * decimal ) / decimal
}
}
} ,
} ,
filters : {
state : function ( e ) {
@@ -542,6 +794,90 @@
// this.tipAppear = this.tipAppear()
} ,
methods : {
radioPliceChange ( e ) {
if ( e == '1' ) {
this . isApplication = false
this . displayStrategy ( { } )
} else {
this . isApplication = true
this . displayStrategy ( this . stationStrategyData )
}
} ,
displayStrategy ( val ) {
if ( JSON . stringify ( val ) === '{}' ) {
this . dislpayData . marketPrice = false
this . dislpayData . sitePrice = false
this . dislpayData . enterprisePrice = false
this . dislpayData . settlementPrice = false
this . dislpayData . floorPrice = false
} else {
if ( val . marketPricePoint == '1' || val . marketPricePoint == '' ) {
this . dislpayData . marketPrice = false
} else {
this . dislpayData . marketPrice = true
}
if ( val . sitePricePoint == '1' || val . sitePricePoint == '' ) {
this . dislpayData . sitePrice = false
} else {
this . dislpayData . sitePrice = true
}
if ( val . companyPricePoint == '1' || val . companyPricePoint == '' ) {
this . dislpayData . enterprisePrice = false
} else {
this . dislpayData . enterprisePrice = true
}
if ( val . settlementPricePoint == '1' || val . settlementPricePoint == '' ) {
this . dislpayData . settlementPrice = false
} else {
this . dislpayData . settlementPrice = true
}
if ( val . floorPricePoint == '1' || val . floorPricePoint == '' ) {
this . dislpayData . floorPrice = false
} else {
this . dislpayData . floorPrice = true
}
}
} ,
strategyHandle ( num1 , type , num2 ) {
let obj = {
"+" : ( ) => {
return Number ( num1 ) + Number ( num2 )
} ,
"-" : ( ) => {
return Number ( num1 ) - Number ( num2 )
} ,
"*" : ( ) => {
return Number ( num1 ) * Number ( num2 )
} ,
"/" : ( ) => {
return Number ( num1 ) / Number ( num2 )
}
}
let a = obj [ type ] ( )
return a
} ,
strategyFormula ( formula ) {
let formulaText = ''
if ( ! formula ) {
return '自定义'
}
if ( formula == 'marketPrice' ) {
formulaText = '发改委价'
} else if ( formula == 'sitePrice' ) {
formulaText = '油站价'
} else if ( formula == 'settlementPrice' ) {
formulaText = '结算价'
} else if ( formula == 'floorPrice' ) {
formulaText = '底价'
} else if ( formula == 'companyPrice' ) {
formulaText = '企业价'
} else if ( formula == 'otherPrice' ) {
formulaText = '三方价'
} else {
formulaText = formula
}
return formulaText
} ,
tipAppear ( title , originalPrice , num = 2 ) {
originalPrice = originalPrice . toFixed ( num )
let text =
@@ -674,13 +1010,21 @@
this . aboutEnterprise . newFloorPrice = JSON . parse ( JSON . stringify ( Number ( this . aboutEnterprise
. oilSiteOilsPrices [ this . aboutEnterprise . oloIndex ] . floorPrice || 0 ) ) ) . toFixed ( 4 ) ;
this . aboutEnterprise . newSettlementPrice = JSON . parse ( JSON . stringify ( Number ( this . aboutEnterprise
. oilSiteOilsPrices [ this . aboutEnterprise . oloIndex ] . settlementPrice ) ) ) . toFixed ( 4 ) ;
. oilSiteOilsPrices [ this . aboutEnterprise . oloIndex ] . settlementPrice ) ) ) . toFixed ( 2 ) ;
this . aboutEnterprise . oldfloorRemark = this . aboutEnterprise . oilSiteOilsPrices [ this . aboutEnterprise . oloIndex ]
. floorRemark || '暂无说明'
this . aboutEnterprise = Object . assign ( this . aboutEnterprise , this . aboutEnterprise . oilSiteOilsPrices [ this
. aboutEnterprise . oloIndex ] )
// this.aboutEnterprise.floorRemark = ''
this . aboutEnterprise . siteOilsPriceId = this . aboutEnterprise . id
let id = this . aboutEnterprise . oilSiteOilsPrices [ this . aboutEnterprise . oloIndex ] . id
priceAdjustmentTask . priceAdjustment ( id ) . then ( res => {
this . stationStrategyData = res . data
this . displayStrategy ( this . stationStrategyData )
} ) . catch ( err => {
this . stationStrategyData = err . data == null ? { } : err . data
this . displayStrategy ( this . stationStrategyData )
} )
this . isShow . oliType = false
} ,
seleoli ( ) {
@@ -703,7 +1047,7 @@
console . log ( this . aboutEnterprise [ e ] )
if ( this . aboutEnterprise [ e ] . indexOf ( '.' ) != - 1 ) {
if ( [ 'newFloorPrice' , 'newSettlementPrice' ] . includes ( e ) ) {
if ( e == 'newFloorPrice' ) {
if ( this . aboutEnterprise [ e ] . split ( '.' ) [ 1 ] . length > 4 ) {
uni . showToast ( {
title : '最多保留小数点后4位' ,
@@ -711,6 +1055,7 @@
} )
this . $nextTick ( ( ) => {
this . aboutEnterprise [ e ] = Number ( this . aboutEnterprise [ e ] ) . toFixed ( 4 )
} )
}
} else {
@@ -820,15 +1165,14 @@
return info [ ` ${ item } tipIsShow ` ]
} )
if ( result ) {
if ( result ) {
uni . showModal ( {
title : '部分调整后价格,可能超出合理范围。是否确认' ,
confirmText : '确认' ,
icon : 'none' ,
success : ( res ) => {
if ( res . confirm ) {
if ( + this . aboutEnterprise . newFloorPrice > + this . aboutEnterprise
. newEnterprisePrice ) {
if ( + this . aboutEnterprise . newFloorPrice > + this . aboutEnterprise . newEnterprisePrice ) {
uni . showModal ( {
title : '当前调价后,存在企业价低于底价,超出合理范围,是否确认' ,
confirmText : '确认' ,
@@ -1210,4 +1554,7 @@
border - radius : 20 rpx ;
z - index : 20 ;
}
. strategyPrice {
line - height : 50 rpx ;
}
< / style >