|
@@ -353,7 +353,7 @@
|
|
this.getData()
|
|
this.getData()
|
|
break;
|
|
break;
|
|
case '审核中':
|
|
case '审核中':
|
|
- // this.isEdit = false;
|
|
|
|
|
|
+ this.isEdit = true;
|
|
this.submitName = '通过'
|
|
this.submitName = '通过'
|
|
this.getData()
|
|
this.getData()
|
|
break;
|
|
break;
|
|
@@ -381,6 +381,10 @@
|
|
this.makeLookPriceList()
|
|
this.makeLookPriceList()
|
|
if(this.$route.query.type != '新增'){
|
|
if(this.$route.query.type != '新增'){
|
|
let _data = this.priceList
|
|
let _data = this.priceList
|
|
|
|
+ this.checkList1 = []
|
|
|
|
+ this.checkList2 = []
|
|
|
|
+ this.checkList3 = []
|
|
|
|
+ this.checkList4 = []
|
|
for (let i = 0; i < _data.length; i++) {
|
|
for (let i = 0; i < _data.length; i++) {
|
|
if (i == 0) this.checkList1 = _data[i].checkList
|
|
if (i == 0) this.checkList1 = _data[i].checkList
|
|
if (i == 1) this.checkList2 = _data[i].checkList
|
|
if (i == 1) this.checkList2 = _data[i].checkList
|
|
@@ -484,6 +488,11 @@
|
|
// 复选框变化监听
|
|
// 复选框变化监听
|
|
changeLevel(val, index) {
|
|
changeLevel(val, index) {
|
|
let _data = this.priceList
|
|
let _data = this.priceList
|
|
|
|
+
|
|
|
|
+ this.checkList1 = []
|
|
|
|
+ this.checkList2 = []
|
|
|
|
+ this.checkList3 = []
|
|
|
|
+ this.checkList4 = []
|
|
for (let i = 0; i < _data.length; i++) {
|
|
for (let i = 0; i < _data.length; i++) {
|
|
let _childData = _data[i].checkList
|
|
let _childData = _data[i].checkList
|
|
for (let k = 0; k < _childData.length; k++) {
|
|
for (let k = 0; k < _childData.length; k++) {
|
|
@@ -737,7 +746,7 @@
|
|
if (_baseWaterValidate(100, 100000, '', '', 'saleLimit', parseFloat(this.baseInfoForm.saleLimit))) {
|
|
if (_baseWaterValidate(100, 100000, '', '', 'saleLimit', parseFloat(this.baseInfoForm.saleLimit))) {
|
|
that.$message.error('销售上限输入错误!');
|
|
that.$message.error('销售上限输入错误!');
|
|
} else {
|
|
} else {
|
|
- this.$message.error('销售上限不能为空!');
|
|
|
|
|
|
+ that.$message.error('销售上限不能为空!');
|
|
}
|
|
}
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
@@ -750,7 +759,7 @@
|
|
if (_item.basicUnitPrice == '' || _baseWaterValidate(0, 50, 2, '', 'deductWeight', parseFloat(_item
|
|
if (_item.basicUnitPrice == '' || _baseWaterValidate(0, 50, 2, '', 'deductWeight', parseFloat(_item
|
|
.basicUnitPrice))) {
|
|
.basicUnitPrice))) {
|
|
if (_item.basicUnitPrice == '') {
|
|
if (_item.basicUnitPrice == '') {
|
|
- this.$message.error('基准单价不能为空!');
|
|
|
|
|
|
+ that.$message.error('基准单价不能为空!');
|
|
} else {
|
|
} else {
|
|
that.$message.error('基准单价输入错误,0-50数字最多保留两位小数!');
|
|
that.$message.error('基准单价输入错误,0-50数字最多保留两位小数!');
|
|
}
|
|
}
|
|
@@ -760,13 +769,14 @@
|
|
this.$message.error('等级不能为空!');
|
|
this.$message.error('等级不能为空!');
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
|
|
+ var arr = []
|
|
for (let j = 0; j < _item.detailList.length; j++) {
|
|
for (let j = 0; j < _item.detailList.length; j++) {
|
|
let _item1 = _item.detailList[j]
|
|
let _item1 = _item.detailList[j]
|
|
if (_item1.type == 4) {
|
|
if (_item1.type == 4) {
|
|
if (_item1.jfprice == '' || _baseWaterValidate(0, 100, 3, '', 'deductWeight', parseFloat(_item1
|
|
if (_item1.jfprice == '' || _baseWaterValidate(0, 100, 3, '', 'deductWeight', parseFloat(_item1
|
|
.jfprice))) {
|
|
.jfprice))) {
|
|
if (_item1.jfprice == '') {
|
|
if (_item1.jfprice == '') {
|
|
- this.$message.error('降幅价格不能为空!');
|
|
|
|
|
|
+ that.$message.error('降幅价格不能为空!');
|
|
} else {
|
|
} else {
|
|
that.$message.error('降幅输入错误!');
|
|
that.$message.error('降幅输入错误!');
|
|
}
|
|
}
|
|
@@ -775,14 +785,19 @@
|
|
} else {
|
|
} else {
|
|
if (_item1.water == '' || _baseWaterValidate(0, 100, 1, 0.5, 'waterBase', parseFloat(_item1.water))) {
|
|
if (_item1.water == '' || _baseWaterValidate(0, 100, 1, 0.5, 'waterBase', parseFloat(_item1.water))) {
|
|
if (_item1.water == '') {
|
|
if (_item1.water == '') {
|
|
- this.$message.error('分界水分不能为空!')
|
|
|
|
|
|
+ that.$message.error('分界水分不能为空!')
|
|
} else {
|
|
} else {
|
|
that.$message.error('分界值输入错误!');
|
|
that.$message.error('分界值输入错误!');
|
|
}
|
|
}
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
|
|
+ arr.push(_item1.water)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if(!this.isIncrease(arr,arr.length)){
|
|
|
|
+ that.$message.error('水分大小排序错误!');
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return true
|
|
return true
|
|
},
|
|
},
|
|
@@ -797,6 +812,12 @@
|
|
this.checkList = [...new Set(_list)];
|
|
this.checkList = [...new Set(_list)];
|
|
console.log(this.checkList)
|
|
console.log(this.checkList)
|
|
},
|
|
},
|
|
|
|
+ isIncrease(arr,len){
|
|
|
|
+ if(len == 1){
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
|
|
+ return (arr[len - 2] <= arr[len - 1]) && this.isIncrease(arr,len - 1)
|
|
|
|
+ },
|
|
// 提交
|
|
// 提交
|
|
submit() {
|
|
submit() {
|
|
let isValidate = false
|
|
let isValidate = false
|
|
@@ -960,22 +981,21 @@
|
|
|
|
|
|
//获取基准在x轴索引
|
|
//获取基准在x轴索引
|
|
|
|
|
|
- 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--) {
|
|
|
|
|
|
+ let index = 0
|
|
|
|
+ for(;index<_priceList[i].detailList.length;index++){
|
|
|
|
+ if(_priceList[i].detailList[index].water==that.baseInfoForm.waterBase){
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ 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] && _priceList[i].detailList[j].type != 4) {
|
|
if (_priceList[i].detailList[j].type != 1) {
|
|
if (_priceList[i].detailList[j].type != 1) {
|
|
let baseprice = ''
|
|
let baseprice = ''
|
|
- if (j == index()) {
|
|
|
|
|
|
+ if (j == index) {
|
|
baseprice = parseFloat(_priceList[i].basicUnitPrice)
|
|
baseprice = parseFloat(_priceList[i].basicUnitPrice)
|
|
} else {
|
|
} else {
|
|
- baseprice = parseFloat(_priceList[i].basicUnitPrice + (parseFloat(_priceList[i].detailList[j + 2]
|
|
|
|
|
|
+ baseprice = parseFloat(parseFloat(_priceList[i].basicUnitPrice) + (parseFloat(_priceList[i].detailList[j + 2]
|
|
.water) - parseFloat(_priceList[i].detailList[j].water)) / 0.1 * parseFloat(_priceList[i]
|
|
.water) - parseFloat(_priceList[i].detailList[j].water)) / 0.1 * parseFloat(_priceList[i]
|
|
.detailList[j + 1].jfprice))
|
|
.detailList[j + 1].jfprice))
|
|
}
|
|
}
|
|
@@ -993,7 +1013,6 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
// for (let j = (_priceList[i].detailList.length + 1) / 2 - 1; j > 0; j--) {
|
|
// 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] && _priceList[i].detailList[j].type != 4) {
|
|
// if (_priceList[i].detailList[j].type != 1) {
|
|
// if (_priceList[i].detailList[j].type != 1) {
|
|
@@ -1021,14 +1040,14 @@
|
|
// }
|
|
// }
|
|
this.left.push(_leftObj)
|
|
this.left.push(_leftObj)
|
|
console.log('this.left', this.left)
|
|
console.log('this.left', this.left)
|
|
- for (let k = index(); 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] && _priceList[i].detailList[k].type != 4) {
|
|
if (_priceList[i].detailList[k].type != 3) {
|
|
if (_priceList[i].detailList[k].type != 3) {
|
|
let baseprice = ''
|
|
let baseprice = ''
|
|
- if (k == index()) {
|
|
|
|
|
|
+ if (k == index) {
|
|
baseprice = parseFloat(_priceList[i].basicUnitPrice)
|
|
baseprice = parseFloat(_priceList[i].basicUnitPrice)
|
|
} else {
|
|
} else {
|
|
- baseprice = parseFloat(_priceList[i].basicUnitPrice - (parseFloat(_priceList[i].detailList[k]
|
|
|
|
|
|
+ baseprice = parseFloat(parseFloat(_priceList[i].basicUnitPrice) - (parseFloat(_priceList[i].detailList[k]
|
|
.water) - parseFloat(_priceList[i].detailList[k - 2].water)) / 0.1 * parseFloat(_priceList[i]
|
|
.water) - parseFloat(_priceList[i].detailList[k - 2].water)) / 0.1 * parseFloat(_priceList[i]
|
|
.detailList[k - 1].jfprice))
|
|
.detailList[k - 1].jfprice))
|
|
}
|
|
}
|
|
@@ -1103,7 +1122,7 @@
|
|
let tmp = ''
|
|
let tmp = ''
|
|
for (let k = 0; k < _list.length; k++) {
|
|
for (let k = 0; k < _list.length; k++) {
|
|
if (_waterMax >= _list[k].priceEnd && _waterMax < _list[k].priceStart) {
|
|
if (_waterMax >= _list[k].priceEnd && _waterMax < _list[k].priceStart) {
|
|
- tmp = parseFloat(_list[k].baseprice + _list[k].jfprice * ((_list[k].priceStart - (_waterMax )) / 0.1 + 1))
|
|
|
|
|
|
+ tmp = parseFloat(_list[k].baseprice + _list[k].jfprice * ((_list[k].priceStart - (_waterMax )) / 0.1))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
_listResult.push(tmp)
|
|
_listResult.push(tmp)
|