|
@@ -101,7 +101,7 @@
|
|
|
<input v-if='item1.type==3' class="water-price" v-model="baseInfoForm.waterMax"
|
|
|
:disabled="item1.isWrite?false:true"></input>
|
|
|
<input v-if='item1.type==5' class="water-price" v-model="item1.water"
|
|
|
- :disabled="item1.isWrite?false:true"></input>
|
|
|
+ :disabled="isEdit?false:true"></input>
|
|
|
</div>
|
|
|
<div class="circle" v-if="item1.type!=4"></div>
|
|
|
</div>
|
|
@@ -167,6 +167,9 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ price: 0,
|
|
|
+ left:[],
|
|
|
+ right:[],
|
|
|
selectVal: "",
|
|
|
goodnameList: [],
|
|
|
tableData: [],
|
|
@@ -502,6 +505,15 @@
|
|
|
}
|
|
|
result = Math.round(result * 100) / 100;
|
|
|
return result;
|
|
|
+ },
|
|
|
+ //保留两位小数
|
|
|
+ keepOneDecimal(num) {
|
|
|
+ var result = parseFloat(num);
|
|
|
+ if (isNaN(result)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ result = Math.round(result * 100) / 100;
|
|
|
+ return result;
|
|
|
},
|
|
|
// 添加粮价设置
|
|
|
newSetPrice() {
|
|
@@ -763,7 +775,8 @@
|
|
|
// 提交
|
|
|
submit() {
|
|
|
this.makeTableList()
|
|
|
- // this.makePriceDataList()
|
|
|
+ this.baseInfoForm.details = []
|
|
|
+ this.makePriceDataList()
|
|
|
this.baseInfoForm.goodsName = this.selectVal
|
|
|
let isValidate = false
|
|
|
switch (this.$route.query.type) {
|
|
@@ -789,6 +802,7 @@
|
|
|
}
|
|
|
break;
|
|
|
case "审核中":
|
|
|
+ // this.makePriceDataList()
|
|
|
this.getEditCheckList()
|
|
|
isValidate = this.validate()
|
|
|
if (isValidate) {
|
|
@@ -839,159 +853,333 @@
|
|
|
let _list = []
|
|
|
let _obj = {}
|
|
|
let _waterMin = parseFloat(this.baseInfoForm.waterMin)
|
|
|
- let _waterMax = parseFloat(this.baseInfoForm.waterMax)
|
|
|
- let _count = (_waterMax - _waterMin) / 0.5 + 1
|
|
|
+ let _waterMax = parseFloat(this.baseInfoForm.waterBase)
|
|
|
+ let _count = (_waterMax - _waterMin) / 0.5
|
|
|
for (let i = 0; i < _count; i++) {
|
|
|
if (i == 0) {
|
|
|
- let priceList = this.calculatePrice(_waterMin)
|
|
|
+ _waterMax -= 0.1
|
|
|
+ } else {
|
|
|
+ _waterMax -= 0.5
|
|
|
+ }
|
|
|
+ let priceList = this.calculatePrice(_waterMax)
|
|
|
_obj = {
|
|
|
- waterMin: _waterMin,
|
|
|
- waterMax: _waterMin + 0.4,
|
|
|
- price1: priceList[0],
|
|
|
- price2: priceList[1],
|
|
|
- price3: priceList[2],
|
|
|
- priceOther: priceList[3],
|
|
|
+ waterMin:this.keepOneDecimal(_waterMax -0.4),
|
|
|
+ waterMax:this.keepOneDecimal(_waterMax),
|
|
|
+ price1: this.keepTwoDecimal(priceList[0]),
|
|
|
+ price2: this.keepTwoDecimal(priceList[1]),
|
|
|
+ price3: this.keepTwoDecimal(priceList[2]),
|
|
|
+ priceOther: this.keepTwoDecimal(priceList[3]),
|
|
|
}
|
|
|
+ _list.unshift(_obj)
|
|
|
+ }
|
|
|
+ _obj = {}
|
|
|
+ _waterMin = parseFloat(this.baseInfoForm.waterBase)
|
|
|
+ _waterMax = parseFloat(this.baseInfoForm.waterMax)
|
|
|
+ _count = (_waterMax - _waterMin) / 0.5
|
|
|
+ for (let i = 0; i < _count; i++) {
|
|
|
+ if (i == 0) {
|
|
|
+ _waterMin += 0.4
|
|
|
} else {
|
|
|
_waterMin += 0.5
|
|
|
- let priceList = this.calculatePrice(_waterMin)
|
|
|
+ }
|
|
|
+ let priceList = this.calculatePriceRight(_waterMin)
|
|
|
_obj = {
|
|
|
- waterMin: _waterMin,
|
|
|
- waterMax: _waterMin + 0.4,
|
|
|
- price1: priceList[0],
|
|
|
- price2: priceList[1],
|
|
|
- price3: priceList[2],
|
|
|
- priceOther: priceList[3],
|
|
|
+ waterMin:this.keepOneDecimal(_waterMin - 0.4),
|
|
|
+ waterMax:this.keepOneDecimal(_waterMin),
|
|
|
+ price1: this.keepTwoDecimal(priceList[0]),
|
|
|
+ price2: this.keepTwoDecimal(priceList[1]),
|
|
|
+ price3: this.keepTwoDecimal(priceList[2]),
|
|
|
+ priceOther: this.keepTwoDecimal(priceList[3]),
|
|
|
}
|
|
|
- }
|
|
|
_list.push(_obj)
|
|
|
- this.baseInfoForm.detailPrints.push(_obj)
|
|
|
+ console.log("_list",_list)
|
|
|
+
|
|
|
}
|
|
|
+ this.baseInfoForm.detailPrints = _list
|
|
|
this.tableData = _list
|
|
|
},
|
|
|
// 获取分界价格数据,构造分界价格区间数据
|
|
|
- getSplitPrice() {
|
|
|
- let _priceList = this.priceList
|
|
|
- for (let i = 0; i < _priceList.length; i++) {
|
|
|
- for (let k = 0; k < _priceList[i].checkList.length; k++) {
|
|
|
- let _obj = {}
|
|
|
- _obj.level = _priceList[i].checkList[k]
|
|
|
- _obj.basicUnitPrice = parseFloat(_priceList[i].basicUnitPrice)
|
|
|
- _obj.priceList = []
|
|
|
- _obj.haveSplit = false
|
|
|
- for (let j = 0; j < _priceList[i].detailList.length; j++) {
|
|
|
- if (_priceList[i].detailList[j].type == 5) {
|
|
|
- _obj.haveSplit = true
|
|
|
- }
|
|
|
- if (_priceList[i].detailList[j].type != 4 && _priceList[i].detailList[j].type != 3) {
|
|
|
- _obj.priceList.push({
|
|
|
+ getSplitPrice() {debugger
|
|
|
+ this.left=[]
|
|
|
+ this.right = []
|
|
|
+ // let _priceList = this.priceList
|
|
|
+ // for (let i = 0; i < _priceList.length; i++) {
|
|
|
+ // for (let k = 0; k < _priceList[i].checkList.length; k++) {
|
|
|
+ // let _obj = {}
|
|
|
+ // _obj.level = _priceList[i].checkList[k]
|
|
|
+ // _obj.basicUnitPrice = parseFloat(_priceList[i].basicUnitPrice)
|
|
|
+ // _obj.priceList = []
|
|
|
+ // _obj.haveSplit = false
|
|
|
+ // for (let j = 0; j < _priceList[i].detailList.length; j++) {
|
|
|
+ // if (_priceList[i].detailList[j].type == 5) {
|
|
|
+ // _obj.haveSplit = true
|
|
|
+ // }
|
|
|
+ // if (_priceList[i].detailList[j].type != 4 && _priceList[i].detailList[j].type != 3) {
|
|
|
+ // _obj.priceList.push({
|
|
|
+ // index: j,
|
|
|
+ // type: parseFloat(_priceList[i].detailList[j].type),
|
|
|
+ // priceStart: parseFloat(_priceList[i].detailList[j].water),
|
|
|
+ // priceEnd: parseFloat(_priceList[i].detailList[j + 2].water),
|
|
|
+ // betweenPrice: parseFloat(_priceList[i].detailList[j + 1].jfprice),
|
|
|
+ // totalPrice: (parseFloat(this.baseInfoForm.waterBase) - parseFloat(_priceList[i]
|
|
|
+ // .detailList[j].water)) / 0.5 * parseFloat(_priceList[i].detailList[j + 1].jfprice)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // this.splitPriceList.push(_obj)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ let _priceList = this.priceList;
|
|
|
+ for(let i=0;i<_priceList.length;i++){
|
|
|
+ for (let k = 0; k < _priceList[i].checkList.length; k++) {
|
|
|
+ let _leftObj = {}
|
|
|
+ _leftObj.level = _priceList[i].checkList[k]
|
|
|
+ _leftObj.basicUnitPrice = parseFloat(_priceList[i].basicUnitPrice)
|
|
|
+ _leftObj.priceList = []
|
|
|
+ _leftObj.haveSplit = false
|
|
|
+
|
|
|
+ let _rightObj = {}
|
|
|
+ _rightObj.level = _priceList[i].checkList[k]
|
|
|
+ _rightObj.basicUnitPrice = parseFloat(_priceList[i].basicUnitPrice)
|
|
|
+ _rightObj.priceList = []
|
|
|
+ _rightObj.haveSplit = false
|
|
|
+
|
|
|
+
|
|
|
+ for (let j = (_priceList[i].detailList.length+1)/2-1; j >=0; j--) {
|
|
|
+ if(_priceList[i].detailList[j]&&_priceList[i].detailList[j].type != 4){
|
|
|
+ if(_priceList[i].detailList[j].type != 1){
|
|
|
+ let baseprice = ""
|
|
|
+ if(j == (_priceList[i].detailList.length+1)/2-1){
|
|
|
+ baseprice = parseFloat(_priceList[i].basicUnitPrice)
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ baseprice = parseFloat(_priceList[i].basicUnitPrice + (parseFloat(_priceList[i].detailList[j].water) -parseFloat(_priceList[i].detailList[j-2].water))/0.5*parseFloat(_priceList[i].detailList[j - 1].jfprice))
|
|
|
+ }
|
|
|
+ _leftObj.priceList.push({
|
|
|
index: j,
|
|
|
+ priceStart: parseFloat(_priceList[i].detailList[j].water),
|
|
|
+ priceEnd: parseFloat(_priceList[i].detailList[j-2].water),
|
|
|
type: parseFloat(_priceList[i].detailList[j].type),
|
|
|
+ water:_priceList[i].detailList[j].water,
|
|
|
+ jfprice:parseFloat(_priceList[i].detailList[j - 1].jfprice),
|
|
|
+ baseprice:baseprice,
|
|
|
+ price:(parseFloat(_priceList[i].detailList[j].water) -parseFloat(_priceList[i].detailList[j-2].water))/0.5*parseFloat(_priceList[i].detailList[j - 1].jfprice)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ this.left.push(_leftObj)
|
|
|
+ for (let j = (_priceList[i].detailList.length+1)/2-1; j<=_priceList[i].detailList.length; j++) {
|
|
|
+ if(_priceList[i].detailList[j]&&_priceList[i].detailList[j].type != 4){
|
|
|
+ if(_priceList[i].detailList[j].type != 3){
|
|
|
+ let baseprice = ""
|
|
|
+ if(j == (_priceList[i].detailList.length+1)/2-1){
|
|
|
+ baseprice = parseFloat(_priceList[i].basicUnitPrice)
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ baseprice = parseFloat(_priceList[i].basicUnitPrice - (parseFloat(_priceList[i].detailList[j].water) -parseFloat(_priceList[i].detailList[j-2].water))/0.5*parseFloat(_priceList[i].detailList[j - 1].jfprice))
|
|
|
+ }
|
|
|
+ _rightObj.priceList.push({
|
|
|
+ index: j,
|
|
|
priceStart: parseFloat(_priceList[i].detailList[j].water),
|
|
|
- priceEnd: parseFloat(_priceList[i].detailList[j + 2].water),
|
|
|
- betweenPrice: parseFloat(_priceList[i].detailList[j + 1].jfprice),
|
|
|
- totalPrice: (parseFloat(_priceList[i].detailList[j + 2].water) - parseFloat(_priceList[i]
|
|
|
- .detailList[j].water)) / 0.5 * parseFloat(_priceList[i].detailList[j + 1].jfprice)
|
|
|
+ priceEnd: parseFloat(_priceList[i].detailList[j+2].water),
|
|
|
+ type: parseFloat(_priceList[i].detailList[j].type),
|
|
|
+ water:_priceList[i].detailList[j].water,
|
|
|
+ jfprice:parseFloat(_priceList[i].detailList[j + 1].jfprice),
|
|
|
+ baseprice:baseprice,
|
|
|
+ price:(parseFloat(_priceList[i].detailList[j+2].water) -parseFloat(_priceList[i].detailList[j].water))/0.5*parseFloat(_priceList[i].detailList[j + 1].jfprice)
|
|
|
})
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
- this.splitPriceList.push(_obj)
|
|
|
- }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ this.right.push(_rightObj)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // for (let j = 0; j < _priceList[i].detailList.length; j++) {
|
|
|
+ // if (_priceList[i].detailList[j].type != 4) {
|
|
|
+ // if(_priceList[i].detailList[j].water<this.baseInfoForm.waterBase){
|
|
|
+ // _obj.priceList.push({
|
|
|
+ // index: j,
|
|
|
+ // priceStart: parseFloat(_priceList[i].detailList[j].water),
|
|
|
+ // priceEnd: parseFloat(_priceList[i].detailList[j + 2].water),
|
|
|
+ // type: parseFloat(_priceList[i].detailList[j].type),
|
|
|
+ // water:_priceList[i].detailList[j].water,
|
|
|
+ // price:(parseFloat(this.baseInfoForm.waterBase) -parseFloat(_priceList[i].detailList[j].water))/0.5*parseFloat(_priceList[i].detailList[j + 1].jfprice)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // else if(_priceList[i].detailList[j].water==this.baseInfoForm.waterBase){
|
|
|
+ // _obj.priceList.push({
|
|
|
+ // index: j,
|
|
|
+ // type: parseFloat(_priceList[i].detailList[j].type),
|
|
|
+ // priceStart: _priceList[i].detailList[j].water,
|
|
|
+ // priceEnd: _priceList[i].detailList[j].water,
|
|
|
+ // water:_priceList[i].detailList[j].water,
|
|
|
+ // price:_priceList[i].basicUnitPrice
|
|
|
+ // })
|
|
|
+ // }else{
|
|
|
+
|
|
|
+ // _obj.priceList.push({
|
|
|
+ // index: j,
|
|
|
+ // type: parseFloat(_priceList[i].detailList[j].type),
|
|
|
+ // water:_priceList[i].detailList[j].water,
|
|
|
+ // priceStart: parseFloat(_priceList[i].detailList[j].water),
|
|
|
+ // priceEnd: parseFloat(_priceList[i].detailList[j + 2].water),
|
|
|
+ // price:(parseFloat(_priceList[i].detailList[j].water)-parseFloat(this.baseInfoForm.waterBase))/0.5*parseFloat(_priceList[i].detailList[j - 1].jfprice)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // this.splitPriceList.push(_obj)
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
// 获取当前价格左右价格区间数据
|
|
|
- getOtherPrice(list, nowList, direction) {
|
|
|
+ getOtherPrice(list, water, direction) {
|
|
|
+
|
|
|
+ // let _leftTotalPrice = 0
|
|
|
+ // let _rightTotalPrice = 0
|
|
|
+ // for(let i = 0;i<list.length;i++){
|
|
|
+ // if(water<list[i].priceEnd&&water>=list[i].priceStart){
|
|
|
+ // this.price +=parseFloat(list[i].totalPrice)+parseFloat(list[i].betweenPrice)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
//判断当前价格左右各有几个分界,返回当前除当前分界其他分界价格和
|
|
|
- let _left = []
|
|
|
- let _right = []
|
|
|
- let _leftTotalPrice = 0
|
|
|
- let _rightTotalPrice = 0
|
|
|
- //当前分界左边价格
|
|
|
- if (direction == "leftBasic") {
|
|
|
- for (let i = 0; i < list.length; i++) {
|
|
|
- if (nowList.index <= list[i].index && list[i].priceStart < 30) {
|
|
|
- _right.push(list[i])
|
|
|
- } else if (list[i].priceStart < 30) {
|
|
|
- _left.push(list[i])
|
|
|
- }
|
|
|
- }
|
|
|
- if (_left.length > 0) {
|
|
|
- for (let j = 0; j < _left.length; j++) {
|
|
|
- _leftTotalPrice += _left[j].totalPrice
|
|
|
- }
|
|
|
- }
|
|
|
- if (_right.length > 0) {
|
|
|
- for (let k = 0; k < _right.length; k++) {
|
|
|
- _rightTotalPrice += _right[k].totalPrice
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- for (let m = 0; m < list.length; m++) {
|
|
|
- if (nowList.index <= list[m].index && list[m].priceStart > 30) {
|
|
|
- _left.push(list[m])
|
|
|
- } else if (list[m].priceStart > 30) {
|
|
|
- _right.push(list[m])
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (_left.length > 0) {
|
|
|
- for (let j = 0; j < _left.length; j++) {
|
|
|
- _leftTotalPrice += _left[j].totalPrice
|
|
|
- }
|
|
|
- }
|
|
|
- if (_right.length > 0) {
|
|
|
- for (let k = 0; k < _right.length; k++) {
|
|
|
- _rightTotalPrice += _right[k].totalPrice
|
|
|
- }
|
|
|
+ // for(let i=0;i<list.length;i++){
|
|
|
+
|
|
|
+ // }
|
|
|
+ // let _left = []
|
|
|
+ // let _right = []
|
|
|
+ // let _leftTotalPrice = 0
|
|
|
+ // let _rightTotalPrice = 0
|
|
|
+ // //当前分界左边价格
|
|
|
+ // if (direction == "leftBasic") {
|
|
|
+ // for (let i = 0; i < list.length; i++) {
|
|
|
+ // if (nowList.index <= list[i].index && list[i].priceStart < 30) {
|
|
|
+ // _right.push(list[i])
|
|
|
+ // } else if (list[i].priceStart < 30) {
|
|
|
+ // _left.push(list[i])
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (_left.length > 0) {
|
|
|
+ // for (let j = 0; j < _left.length; j++) {
|
|
|
+ // _leftTotalPrice += _left[j].totalPrice
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (_right.length > 0) {
|
|
|
+ // for (let k = 0; k < _right.length; k++) {
|
|
|
+ // _rightTotalPrice += _right[k].totalPrice
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // for (let m = 0; m < list.length; m++) {
|
|
|
+ // if (nowList.index <= list[m].index && list[m].priceStart > 30) {
|
|
|
+ // _left.push(list[m])
|
|
|
+ // } else if (list[m].priceStart > 30) {
|
|
|
+ // _right.push(list[m])
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (_left.length > 0) {
|
|
|
+ // for (let j = 0; j < _left.length; j++) {
|
|
|
+ // _leftTotalPrice += _left[j].totalPrice
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (_right.length > 0) {
|
|
|
+ // for (let k = 0; k < _right.length; k++) {
|
|
|
+ // _rightTotalPrice += _right[k].totalPrice
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // return _leftTotalPrice + _rightTotalPrice
|
|
|
+ // return _price
|
|
|
+ },
|
|
|
+ calculatePriceRight(_waterMax) {
|
|
|
+ //获取每个分界值
|
|
|
+ let _listResult = []
|
|
|
+ for(let i = 0;i<this.right.length;i++){
|
|
|
+ let _list = this.right[i].priceList
|
|
|
+ let tmp = ""
|
|
|
+ for (let k =0; k <_list.length; k++) {
|
|
|
+ if(_waterMax < _list[k].priceEnd && _waterMax >= _list[k].priceStart){
|
|
|
+ tmp = parseFloat(_list[k].baseprice - _list[k].jfprice*(((_waterMax-0.4) - _list[k].priceStart)*2))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _listResult.push(tmp)
|
|
|
}
|
|
|
- return _leftTotalPrice + _rightTotalPrice
|
|
|
+ return _listResult
|
|
|
},
|
|
|
// 计算价格
|
|
|
- calculatePrice(_waterMin) {
|
|
|
- let prcieList = []
|
|
|
- let totalPrice = []
|
|
|
- let _price = 0
|
|
|
- for (let i = 0; i < this.splitPriceList.length; i++) {
|
|
|
- let _list = this.splitPriceList[i].priceList
|
|
|
- let basePrice = parseFloat(this.splitPriceList[i].basicUnitPrice)
|
|
|
- for (let k = 0; k < _list.length; k++) {
|
|
|
- //基准左边
|
|
|
- if (_waterMin < parseFloat(this.baseInfoForm.waterBase)) {
|
|
|
- // 未设置分界
|
|
|
- if (_waterMin >= _list[k].priceStart && _waterMin < _list[k].priceEnd && !this.splitPriceList[i]
|
|
|
- .haveSplit) {
|
|
|
- _price = basePrice + (parseFloat(this.baseInfoForm.waterBase) - _waterMin) / 0.5 * _list[k]
|
|
|
- .betweenPrice;
|
|
|
- prcieList.push(this.keepTwoDecimal(_price))
|
|
|
- } else if (_waterMin >= _list[k].priceStart && _waterMin < _list[k].priceEnd) {
|
|
|
- // 当前区间段价格+其他区间段价格
|
|
|
- let _otherPice = this.getOtherPrice(_list, _list[k], "leftBasic")
|
|
|
- let _price1 = (_list[k].priceEnd - _waterMin) / 0.5 * _list[k].betweenPrice + _otherPice;
|
|
|
- prcieList.push(basePrice + _price1)
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- //基准值
|
|
|
- else if (_waterMin == parseFloat(this.baseInfoForm.waterBase)) {
|
|
|
- prcieList.push(this.keepTwoDecimal(basePrice))
|
|
|
+ calculatePrice(_waterMax) {debugger
|
|
|
+ let _listResult = []
|
|
|
+ for(let i = 0;i<this.left.length;i++){
|
|
|
+ let _list = this.left[i].priceList
|
|
|
+ let tmp = ""
|
|
|
+ for (let k =0; k <_list.length; k++) {
|
|
|
+ if(_waterMax >= _list[k].priceEnd && _waterMax < _list[k].priceStart){
|
|
|
+ tmp = parseFloat(_list[k].baseprice + _list[k].jfprice*((_list[k].priceStart - (_waterMax+0.1))*2+1))
|
|
|
}
|
|
|
- // 基准右边
|
|
|
- else {
|
|
|
- if (_waterMin > _list[k].priceStart && _waterMin <= _list[k].priceEnd && !this.splitPriceList[i]
|
|
|
- .haveSplit) {
|
|
|
- _price = basePrice - (_waterMin - parseFloat(this.baseInfoForm.waterBase)) / 0.5 * _list[k]
|
|
|
- .betweenPrice;
|
|
|
- prcieList.push(this.keepTwoDecimal(_price))
|
|
|
- } else if (_waterMin > _list[k].priceStart && _waterMin <= _list[k].priceEnd) {
|
|
|
- // 当前段价格+其他段价格
|
|
|
- let _otherPice2 = this.getOtherPrice(_list, _list[k], "rightBasic")
|
|
|
- let _price2 = (_waterMin - _list[k].priceEnd) / 0.5 * _list[k].betweenPrice + _otherPice2;
|
|
|
- prcieList.push(basePrice - _price2)
|
|
|
- }
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
- return prcieList
|
|
|
+ _listResult.push(tmp)
|
|
|
+ }
|
|
|
+ return _listResult
|
|
|
+ // console.log(this.splitPriceList)
|
|
|
+ // 当前水在哪个分界基于哪个分界值做处理
|
|
|
+
|
|
|
+ // let prcieList = []
|
|
|
+ // let totalPrice = []
|
|
|
+ // let _price = 0
|
|
|
+ // this.price = 0
|
|
|
+ // for (let i = 0; i < this.splitPriceList.length; i++) {
|
|
|
+ // let _list = this.splitPriceList[i].priceList
|
|
|
+ // let basePrice = parseFloat(this.splitPriceList[i].basicUnitPrice)
|
|
|
+ // for (let k = 0; k < _list.length; k++) {
|
|
|
+ // //基准左边
|
|
|
+ // if (_waterMin < parseFloat(this.baseInfoForm.waterBase)) {
|
|
|
+ // // 未设置分界
|
|
|
+ // if (_waterMin >= _list[k].priceStart && _waterMin < _list[k].priceEnd && !this.splitPriceList[i]
|
|
|
+ // .haveSplit) {
|
|
|
+ // _price = basePrice + (parseFloat(this.baseInfoForm.waterBase) - _waterMin) / 0.5 * _list[k]
|
|
|
+ // .betweenPrice;
|
|
|
+ // prcieList.push(this.keepTwoDecimal(_price))
|
|
|
+ // } else if (_waterMin >= _list[k].priceStart && _waterMin < _list[k].priceEnd) {
|
|
|
+ // // 当前区间段价格+其他区间段价格
|
|
|
+ // // let _otherPice = this.getOtherPrice(_list, _waterMin, "leftBasic")
|
|
|
+ // // let _price1 = (_list[k].priceEnd - _waterMin) / 0.5 * _list[k].betweenPrice
|
|
|
+ // // prcieList.push(basePrice + _price1)
|
|
|
+ // this.getOtherPrice(_list, _waterMin, "leftBasic")
|
|
|
+ // prcieList.push(this.price)
|
|
|
+
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // //基准值
|
|
|
+ // else if (_waterMin == parseFloat(this.baseInfoForm.waterBase)) {
|
|
|
+ // prcieList.push(this.keepTwoDecimal(basePrice))
|
|
|
+ // }
|
|
|
+ // // 基准右边
|
|
|
+ // else {
|
|
|
+ // if (_waterMin > _list[k].priceStart && _waterMin <= _list[k].priceEnd && !this.splitPriceList[i]
|
|
|
+ // .haveSplit) {
|
|
|
+ // _price = basePrice - (_waterMin - parseFloat(this.baseInfoForm.waterBase)) / 0.5 * _list[k]
|
|
|
+ // .betweenPrice;
|
|
|
+ // prcieList.push(this.keepTwoDecimal(_price))
|
|
|
+ // } else if (_waterMin > _list[k].priceStart && _waterMin <= _list[k].priceEnd) {
|
|
|
+ // // 当前段价格+其他段价格
|
|
|
+ // // let _otherPice2 = this.getOtherPrice(_list, _list[k], "rightBasic")
|
|
|
+ // let _price2 = (_waterMin - _list[k].priceEnd) / 0.5 * _list[k].betweenPrice
|
|
|
+ // prcieList.push(basePrice - _price2)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // return prcieList
|
|
|
},
|
|
|
// 构造查看粮价设置数据
|
|
|
makeLookPriceList() {
|