|
@@ -555,7 +555,6 @@
|
|
|
},
|
|
|
// 删除价格组
|
|
|
delSetPrice(item, index) {
|
|
|
- // debugger
|
|
|
let that = this
|
|
|
this.checkList1 = []
|
|
|
this.checkList2 = []
|
|
@@ -906,6 +905,7 @@
|
|
|
},
|
|
|
// 获取分界价格数据,构造分界价格区间数据
|
|
|
getSplitPrice() {
|
|
|
+ let that = this;
|
|
|
this.left = []
|
|
|
this.right = []
|
|
|
let _priceList = this.priceList;
|
|
@@ -923,12 +923,21 @@
|
|
|
_rightObj.priceList = []
|
|
|
_rightObj.haveSplit = false
|
|
|
|
|
|
+ //获取基准在x轴索引
|
|
|
|
|
|
- for (let j = (_priceList[i].detailList.length + 1) / 2 - 1; j > 0; j--) {
|
|
|
+ let index = function(){
|
|
|
+ for(let index=0;index<_priceList[i].detailList.length;index++){
|
|
|
+ if(_priceList[i].detailList[index].water==that.baseInfoForm.waterBase){
|
|
|
+ return index
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(index())
|
|
|
+ for (let j = index(); 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) {
|
|
|
+ if (j == index()) {
|
|
|
baseprice = parseFloat(_priceList[i].basicUnitPrice)
|
|
|
} else {
|
|
|
baseprice = parseFloat(_priceList[i].basicUnitPrice + (parseFloat(_priceList[i].detailList[j + 2]
|
|
@@ -949,13 +958,39 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 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 + 2]
|
|
|
+ // .water) - parseFloat(_priceList[i].detailList[j].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)
|
|
|
console.log("this.left", this.left)
|
|
|
- for (let k = (_priceList[i].detailList.length + 1) / 2 - 1; k <= _priceList[i].detailList.length; k++) {
|
|
|
+ for (let k = index(); k <= _priceList[i].detailList.length; k++) {
|
|
|
if (_priceList[i].detailList[k] && _priceList[i].detailList[k].type != 4) {
|
|
|
if (_priceList[i].detailList[k].type != 3) {
|
|
|
let baseprice = ""
|
|
|
- if (k == (_priceList[i].detailList.length + 1) / 2 - 1) {
|
|
|
+ if (k == index()) {
|
|
|
baseprice = parseFloat(_priceList[i].basicUnitPrice)
|
|
|
} else {
|
|
|
baseprice = parseFloat(_priceList[i].basicUnitPrice - (parseFloat(_priceList[i].detailList[k]
|
|
@@ -976,6 +1011,33 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ // for (let k = (_priceList[i].detailList.length + 1) / 2 - 1; k <= _priceList[i].detailList.length; k++) {
|
|
|
+ // if (_priceList[i].detailList[k] && _priceList[i].detailList[k].type != 4) {
|
|
|
+ // if (_priceList[i].detailList[k].type != 3) {
|
|
|
+ // let baseprice = ""
|
|
|
+ // if (k == (_priceList[i].detailList.length + 1) / 2 - 1) {
|
|
|
+ // baseprice = parseFloat(_priceList[i].basicUnitPrice)
|
|
|
+ // } else {
|
|
|
+ // baseprice = parseFloat(_priceList[i].basicUnitPrice - (parseFloat(_priceList[i].detailList[k]
|
|
|
+ // .water) - parseFloat(_priceList[i].detailList[k - 2].water)) / 0.5 * parseFloat(_priceList[i]
|
|
|
+ // .detailList[k - 1].jfprice))
|
|
|
+ // }
|
|
|
+ // _rightObj.priceList.push({
|
|
|
+ // index: k,
|
|
|
+ // priceStart: parseFloat(_priceList[i].detailList[k].water),
|
|
|
+ // priceEnd: parseFloat(_priceList[i].detailList[k + 2].water),
|
|
|
+ // type: parseFloat(_priceList[i].detailList[k].type),
|
|
|
+ // water: _priceList[i].detailList[k].water,
|
|
|
+ // jfprice: parseFloat(_priceList[i].detailList[k + 1].jfprice),
|
|
|
+ // baseprice: baseprice,
|
|
|
+ // price: (parseFloat(_priceList[i].detailList[k + 2].water) - parseFloat(_priceList[i].detailList[
|
|
|
+ // k].water)) / 0.5 * parseFloat(_priceList[i].detailList[k + 1].jfprice)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
this.right.push(_rightObj)
|
|
|
console.log("this.right", this.right)
|
|
|
}
|