|
@@ -79,7 +79,7 @@
|
|
<div class="count">
|
|
<div class="count">
|
|
<div class="left">
|
|
<div class="left">
|
|
<div>水分(%)</div>
|
|
<div>水分(%)</div>
|
|
- <div>降幅(元/0.5%)</div>
|
|
|
|
|
|
+ <div>降幅(元/0.1%)</div>
|
|
</div>
|
|
</div>
|
|
<div class="right">
|
|
<div class="right">
|
|
<div class="line"></div>
|
|
<div class="line"></div>
|
|
@@ -174,38 +174,38 @@
|
|
price: 0,
|
|
price: 0,
|
|
left: [],
|
|
left: [],
|
|
right: [],
|
|
right: [],
|
|
- selectVal: "",
|
|
|
|
|
|
+ selectVal: '',
|
|
goodnameList: [],
|
|
goodnameList: [],
|
|
tableData: [],
|
|
tableData: [],
|
|
- submitName: "提交",
|
|
|
|
|
|
+ submitName: '提交',
|
|
isCountShow: true,
|
|
isCountShow: true,
|
|
priceList: [{
|
|
priceList: [{
|
|
index: 0,
|
|
index: 0,
|
|
checkList: [],
|
|
checkList: [],
|
|
- basicUnitPrice: "",
|
|
|
|
|
|
+ basicUnitPrice: '',
|
|
detailList: [{
|
|
detailList: [{
|
|
type: 1,
|
|
type: 1,
|
|
- name: "干粮",
|
|
|
|
- water: "",
|
|
|
|
|
|
+ name: '干粮',
|
|
|
|
+ water: '',
|
|
isWrite: false
|
|
isWrite: false
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 4,
|
|
type: 4,
|
|
- jfprice: ""
|
|
|
|
|
|
+ jfprice: ''
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 2,
|
|
type: 2,
|
|
- name: "基准",
|
|
|
|
|
|
+ name: '基准',
|
|
water: '',
|
|
water: '',
|
|
isWrite: false
|
|
isWrite: false
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 4,
|
|
type: 4,
|
|
- jfprice: ""
|
|
|
|
|
|
+ jfprice: ''
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 3,
|
|
type: 3,
|
|
- name: "上限",
|
|
|
|
|
|
+ name: '上限',
|
|
water: '',
|
|
water: '',
|
|
isWrite: false
|
|
isWrite: false
|
|
},
|
|
},
|
|
@@ -272,7 +272,6 @@
|
|
this.goodnameList = response
|
|
this.goodnameList = response
|
|
this.selectVal = response[0].constValue
|
|
this.selectVal = response[0].constValue
|
|
} else {
|
|
} else {
|
|
- this.goodnameList = _list
|
|
|
|
this.goodnameList = _list
|
|
this.goodnameList = _list
|
|
if (_list.length != 0) {
|
|
if (_list.length != 0) {
|
|
this.selectVal = _list[0].constValue
|
|
this.selectVal = _list[0].constValue
|
|
@@ -280,9 +279,10 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
this.isCountShow = true
|
|
this.isCountShow = true
|
|
|
|
+
|
|
switch (this.$route.query.type) {
|
|
switch (this.$route.query.type) {
|
|
- case "新增":
|
|
|
|
- this.submitName = "提交"
|
|
|
|
|
|
+ case '新增':
|
|
|
|
+ this.submitName = '提交'
|
|
this.isCountShow = true
|
|
this.isCountShow = true
|
|
this.checkList=[]
|
|
this.checkList=[]
|
|
this.baseInfoForm = {
|
|
this.baseInfoForm = {
|
|
@@ -317,49 +317,49 @@
|
|
this.priceList = [{
|
|
this.priceList = [{
|
|
index: 0,
|
|
index: 0,
|
|
checkList: [],
|
|
checkList: [],
|
|
- basicUnitPrice: "",
|
|
|
|
|
|
+ basicUnitPrice: '',
|
|
detailList: [{
|
|
detailList: [{
|
|
type: 1,
|
|
type: 1,
|
|
- name: "干粮",
|
|
|
|
- water: "",
|
|
|
|
|
|
+ name: '干粮',
|
|
|
|
+ water: '',
|
|
isWrite: false
|
|
isWrite: false
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 4,
|
|
type: 4,
|
|
- jfprice: ""
|
|
|
|
|
|
+ jfprice: ''
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 2,
|
|
type: 2,
|
|
- name: "基准",
|
|
|
|
|
|
+ name: '基准',
|
|
water: '',
|
|
water: '',
|
|
isWrite: false
|
|
isWrite: false
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 4,
|
|
type: 4,
|
|
- jfprice: ""
|
|
|
|
|
|
+ jfprice: ''
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 3,
|
|
type: 3,
|
|
- name: "上限",
|
|
|
|
|
|
+ name: '上限',
|
|
water: '',
|
|
water: '',
|
|
isWrite: false
|
|
isWrite: false
|
|
},
|
|
},
|
|
],
|
|
],
|
|
}]
|
|
}]
|
|
break;
|
|
break;
|
|
- case "编辑":
|
|
|
|
|
|
+ case '编辑':
|
|
this.isEdit = true;
|
|
this.isEdit = true;
|
|
- this.submitName = "提交"
|
|
|
|
|
|
+ this.submitName = '提交'
|
|
this.getData()
|
|
this.getData()
|
|
break;
|
|
break;
|
|
- case "审核中":
|
|
|
|
|
|
+ case '审核中':
|
|
// this.isEdit = false;
|
|
// this.isEdit = false;
|
|
- this.submitName = "通过"
|
|
|
|
|
|
+ this.submitName = '通过'
|
|
this.getData()
|
|
this.getData()
|
|
break;
|
|
break;
|
|
- case "查看":
|
|
|
|
|
|
+ case '查看':
|
|
this.isEdit = false;
|
|
this.isEdit = false;
|
|
- this.submitName = "计算"
|
|
|
|
|
|
+ this.submitName = '计算'
|
|
this.getData()
|
|
this.getData()
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
@@ -379,6 +379,16 @@
|
|
//构造查看priceList数据
|
|
//构造查看priceList数据
|
|
this.priceList = []
|
|
this.priceList = []
|
|
this.makeLookPriceList()
|
|
this.makeLookPriceList()
|
|
|
|
+ if(this.$route.query.type == '编辑'){
|
|
|
|
+ let _data = this.priceList
|
|
|
|
+ for (let i = 0; i < _data.length; i++) {
|
|
|
|
+ if (i == 0) this.checkList1 = _data[i].checkList
|
|
|
|
+ if (i == 1) this.checkList2 = _data[i].checkList
|
|
|
|
+ if (i == 2) this.checkList3 = _data[i].checkList
|
|
|
|
+ if (i == 3) this.checkList4 = _data[i].checkList
|
|
|
|
+ }
|
|
|
|
+ this.checkList = [...new Set([...this.checkList1, ...this.checkList2, ...this.checkList3, ...this.checkList4])]
|
|
|
|
+ }
|
|
})
|
|
})
|
|
},
|
|
},
|
|
goodsChange(e) {
|
|
goodsChange(e) {
|
|
@@ -443,14 +453,14 @@
|
|
} else {
|
|
} else {
|
|
item.index++
|
|
item.index++
|
|
item.detailList.splice(index + 1, 0, {
|
|
item.detailList.splice(index + 1, 0, {
|
|
- name: "分界",
|
|
|
|
|
|
+ name: '分界',
|
|
water: '',
|
|
water: '',
|
|
type: 5,
|
|
type: 5,
|
|
index: 1,
|
|
index: 1,
|
|
isWrite: true
|
|
isWrite: true
|
|
});
|
|
});
|
|
item.detailList.splice(index + 1, 0, {
|
|
item.detailList.splice(index + 1, 0, {
|
|
- jfprice: "",
|
|
|
|
|
|
+ jfprice: '',
|
|
type: 4
|
|
type: 4
|
|
});
|
|
});
|
|
this.makeSpliceIndex(item, item1, index)
|
|
this.makeSpliceIndex(item, item1, index)
|
|
@@ -496,12 +506,12 @@
|
|
s1 = arg1.toString(),
|
|
s1 = arg1.toString(),
|
|
s2 = arg2.toString();
|
|
s2 = arg2.toString();
|
|
try {
|
|
try {
|
|
- m += s1.split(".")[1].length
|
|
|
|
|
|
+ m += s1.split('.')[1].length
|
|
} catch (e) {}
|
|
} catch (e) {}
|
|
try {
|
|
try {
|
|
- m += s2.split(".")[1].length
|
|
|
|
|
|
+ m += s2.split('.')[1].length
|
|
} catch (e) {}
|
|
} catch (e) {}
|
|
- return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
|
|
|
|
|
|
+ return Number(s1.replace('.', '')) * Number(s2.replace('.', '')) / Math.pow(10, m)
|
|
},
|
|
},
|
|
//保留两位小数
|
|
//保留两位小数
|
|
keepTwoDecimal(num) {
|
|
keepTwoDecimal(num) {
|
|
@@ -528,27 +538,27 @@
|
|
checkList: [],
|
|
checkList: [],
|
|
detailList: [{
|
|
detailList: [{
|
|
type: 1,
|
|
type: 1,
|
|
- name: "干粮",
|
|
|
|
|
|
+ name: '干粮',
|
|
water: this.baseInfoForm.waterMin,
|
|
water: this.baseInfoForm.waterMin,
|
|
isWrite: false
|
|
isWrite: false
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 4,
|
|
type: 4,
|
|
- jfprice: ""
|
|
|
|
|
|
+ jfprice: ''
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 2,
|
|
type: 2,
|
|
- name: "基准",
|
|
|
|
|
|
+ name: '基准',
|
|
water: this.baseInfoForm.waterBase,
|
|
water: this.baseInfoForm.waterBase,
|
|
isWrite: false
|
|
isWrite: false
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 4,
|
|
type: 4,
|
|
- jfprice: ""
|
|
|
|
|
|
+ jfprice: ''
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 3,
|
|
type: 3,
|
|
- name: "上限",
|
|
|
|
|
|
+ name: '上限',
|
|
water: this.baseInfoForm.waterMax,
|
|
water: this.baseInfoForm.waterMax,
|
|
isWrite: false
|
|
isWrite: false
|
|
},
|
|
},
|
|
@@ -636,28 +646,28 @@
|
|
//打印
|
|
//打印
|
|
print() {
|
|
print() {
|
|
localStorage.setItem('pricePrintList', JSON.stringify(this.baseInfoForm.detailPrints));
|
|
localStorage.setItem('pricePrintList', JSON.stringify(this.baseInfoForm.detailPrints));
|
|
- window.open("../../../static/print.html?name=" + this.baseInfoForm.goodsName)
|
|
|
|
|
|
+ window.open('../../../static/print.html?name=' + this.baseInfoForm.goodsName)
|
|
},
|
|
},
|
|
validate() {
|
|
validate() {
|
|
let that = this
|
|
let that = this
|
|
|
|
|
|
function _baseWaterValidate(min, max, saveNum, point, type, inputVal) {
|
|
function _baseWaterValidate(min, max, saveNum, point, type, inputVal) {
|
|
let _val1 = inputVal
|
|
let _val1 = inputVal
|
|
- let _pointVal1 = _val1.toString().split(".")[1]
|
|
|
|
|
|
+ let _pointVal1 = _val1.toString().split('.')[1]
|
|
if (_pointVal1 == undefined) _pointVal1 = 0
|
|
if (_pointVal1 == undefined) _pointVal1 = 0
|
|
- if (typeof(_pointVal1) == "string") _pointVal1 = _pointVal1.length
|
|
|
|
|
|
+ if (typeof(_pointVal1) == 'string') _pointVal1 = _pointVal1.length
|
|
let _tobeVal1 = _val1 % point
|
|
let _tobeVal1 = _val1 % point
|
|
- if (type == "waterBase") {
|
|
|
|
|
|
+ if (type == 'waterBase') {
|
|
if (_val1 <= max && _val1 >= min && _pointVal1 <= saveNum && _tobeVal1 == 0) {
|
|
if (_val1 <= max && _val1 >= min && _pointVal1 <= saveNum && _tobeVal1 == 0) {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (type == "deductWeight") {
|
|
|
|
|
|
+ if (type == 'deductWeight') {
|
|
if (_val1 <= max && _val1 >= min && _pointVal1 <= saveNum) {
|
|
if (_val1 <= max && _val1 >= min && _pointVal1 <= saveNum) {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (type == "saleLimit") {
|
|
|
|
|
|
+ if (type == 'saleLimit') {
|
|
if (_val1 <= max && _val1 >= min) {
|
|
if (_val1 <= max && _val1 >= min) {
|
|
// Number.isInteger(that.baseInfoForm.saleLimit)
|
|
// Number.isInteger(that.baseInfoForm.saleLimit)
|
|
return false
|
|
return false
|
|
@@ -665,9 +675,9 @@
|
|
}
|
|
}
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
- if (this.baseInfoForm.waterBase == '' || _baseWaterValidate(1, 100, 1, 0.5, "waterBase", parseFloat(this
|
|
|
|
|
|
+ if (this.baseInfoForm.waterBase == '' || _baseWaterValidate(1, 100, 1, 0.5, 'waterBase', parseFloat(this
|
|
.baseInfoForm.waterBase))) {
|
|
.baseInfoForm.waterBase))) {
|
|
- if (_baseWaterValidate(1, 100, 1, 0.5, "waterBase", parseFloat(this.baseInfoForm.waterBase))) {
|
|
|
|
|
|
+ if (_baseWaterValidate(1, 100, 1, 0.5, 'waterBase', parseFloat(this.baseInfoForm.waterBase))) {
|
|
that.$message.error('水分基准输入错误,最多保留1位小数,基准水分须可被0.5整除!');
|
|
that.$message.error('水分基准输入错误,最多保留1位小数,基准水分须可被0.5整除!');
|
|
} else {
|
|
} else {
|
|
this.$message.error('基准水分不能为空!');
|
|
this.$message.error('基准水分不能为空!');
|
|
@@ -693,12 +703,12 @@
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
|
|
|
|
- if (this.baseInfoForm.waterMin == '' || _baseWaterValidate(1, 100, 1, 0.5, "waterBase", parseFloat(this
|
|
|
|
|
|
+ if (this.baseInfoForm.waterMin == '' || _baseWaterValidate(1, 100, 1, 0.5, 'waterBase', parseFloat(this
|
|
.baseInfoForm.waterMin))) {
|
|
.baseInfoForm.waterMin))) {
|
|
if (this.baseInfoForm.waterMin == '') {
|
|
if (this.baseInfoForm.waterMin == '') {
|
|
this.$message.error('干粮水分不能为空!')
|
|
this.$message.error('干粮水分不能为空!')
|
|
}
|
|
}
|
|
- if (_baseWaterValidate(1, 100, 1, 0.5, "waterBase", parseFloat(this.baseInfoForm.waterMin))) {
|
|
|
|
|
|
+ if (_baseWaterValidate(1, 100, 1, 0.5, 'waterBase', parseFloat(this.baseInfoForm.waterMin))) {
|
|
that.$message.error('干粮水分输入错误,最多保留1位小数,干粮水分须可被0.5整除!')
|
|
that.$message.error('干粮水分输入错误,最多保留1位小数,干粮水分须可被0.5整除!')
|
|
}
|
|
}
|
|
return false
|
|
return false
|
|
@@ -714,18 +724,18 @@
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
|
|
|
|
- if (this.baseInfoForm.waterMax == '' || _baseWaterValidate(1, 100, 1, 0.5, "waterBase", parseFloat(this
|
|
|
|
|
|
+ if (this.baseInfoForm.waterMax == '' || _baseWaterValidate(1, 100, 1, 0.5, 'waterBase', parseFloat(this
|
|
.baseInfoForm.waterMax))) {
|
|
.baseInfoForm.waterMax))) {
|
|
- if (_baseWaterValidate(1, 100, 1, 0.5, "waterBase", parseFloat(this.baseInfoForm.waterMax))) {
|
|
|
|
|
|
+ if (_baseWaterValidate(1, 100, 1, 0.5, 'waterBase', parseFloat(this.baseInfoForm.waterMax))) {
|
|
that.$message.error('水分上限输入错误,最多保留1位小数,干粮水分须可被0.5整除!');
|
|
that.$message.error('水分上限输入错误,最多保留1位小数,干粮水分须可被0.5整除!');
|
|
} else {
|
|
} else {
|
|
this.$message.error('水分上限不能为空!');
|
|
this.$message.error('水分上限不能为空!');
|
|
}
|
|
}
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
- if (this.baseInfoForm.saleLimit == '' || _baseWaterValidate(100, 100000, '', '', "saleLimit", parseFloat(this
|
|
|
|
|
|
+ if (this.baseInfoForm.saleLimit == '' || _baseWaterValidate(100, 100000, '', '', 'saleLimit', parseFloat(this
|
|
.baseInfoForm.saleLimit))) {
|
|
.baseInfoForm.saleLimit))) {
|
|
- 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('销售上限不能为空!');
|
|
this.$message.error('销售上限不能为空!');
|
|
@@ -738,7 +748,7 @@
|
|
}
|
|
}
|
|
for (let i = 0; i < this.priceList.length; i++) {
|
|
for (let i = 0; i < this.priceList.length; i++) {
|
|
let _item = this.priceList[i]
|
|
let _item = this.priceList[i]
|
|
- 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('基准单价不能为空!');
|
|
this.$message.error('基准单价不能为空!');
|
|
@@ -754,9 +764,9 @@
|
|
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('降幅价格不能为空!');
|
|
this.$message.error('降幅价格不能为空!');
|
|
} else {
|
|
} else {
|
|
that.$message.error('降幅输入错误!');
|
|
that.$message.error('降幅输入错误!');
|
|
@@ -764,8 +774,8 @@
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- if (_item1.water == "" || _baseWaterValidate(0, 100, 1, 0.5, "waterBase", parseFloat(_item1.water))) {
|
|
|
|
- if (_item1.water == "") {
|
|
|
|
|
|
+ if (_item1.water == '' || _baseWaterValidate(0, 100, 1, 0.5, 'waterBase', parseFloat(_item1.water))) {
|
|
|
|
+ if (_item1.water == '') {
|
|
this.$message.error('分界水分不能为空!')
|
|
this.$message.error('分界水分不能为空!')
|
|
} else {
|
|
} else {
|
|
that.$message.error('分界值输入错误!');
|
|
that.$message.error('分界值输入错误!');
|
|
@@ -790,6 +800,7 @@
|
|
},
|
|
},
|
|
// 提交
|
|
// 提交
|
|
submit() {
|
|
submit() {
|
|
|
|
+ this.isCountShow = false
|
|
let isValidate = false
|
|
let isValidate = false
|
|
isValidate = this.validate()
|
|
isValidate = this.validate()
|
|
if (isValidate) {
|
|
if (isValidate) {
|
|
@@ -798,10 +809,10 @@
|
|
this.makePriceDataList()
|
|
this.makePriceDataList()
|
|
this.baseInfoForm.goodsName = this.selectVal
|
|
this.baseInfoForm.goodsName = this.selectVal
|
|
switch (this.$route.query.type) {
|
|
switch (this.$route.query.type) {
|
|
- case "查看":
|
|
|
|
|
|
+ case '查看':
|
|
this.isCountShow = false;
|
|
this.isCountShow = false;
|
|
break;
|
|
break;
|
|
- case "新增":
|
|
|
|
|
|
+ case '新增':
|
|
isValidate = this.validate()
|
|
isValidate = this.validate()
|
|
if (isValidate) {
|
|
if (isValidate) {
|
|
purchasePriceAdd(this.baseInfoForm).toPromise().then((response) => {
|
|
purchasePriceAdd(this.baseInfoForm).toPromise().then((response) => {
|
|
@@ -810,7 +821,7 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
- case "编辑":
|
|
|
|
|
|
+ case '编辑':
|
|
this.getEditCheckList()
|
|
this.getEditCheckList()
|
|
isValidate = this.validate()
|
|
isValidate = this.validate()
|
|
if (isValidate) {
|
|
if (isValidate) {
|
|
@@ -819,7 +830,7 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
- case "审核中":
|
|
|
|
|
|
+ case '审核中':
|
|
// this.makePriceDataList()
|
|
// this.makePriceDataList()
|
|
this.getEditCheckList()
|
|
this.getEditCheckList()
|
|
isValidate = this.validate()
|
|
isValidate = this.validate()
|
|
@@ -876,17 +887,20 @@
|
|
let _obj = {}
|
|
let _obj = {}
|
|
let _waterMin = parseFloat(this.baseInfoForm.waterMin)
|
|
let _waterMin = parseFloat(this.baseInfoForm.waterMin)
|
|
let _waterMax = parseFloat(this.baseInfoForm.waterBase)
|
|
let _waterMax = parseFloat(this.baseInfoForm.waterBase)
|
|
- let _count = (_waterMax - _waterMin) / 0.5
|
|
|
|
|
|
+ let _count = (_waterMax - _waterMin) / 0.1
|
|
for (let i = 0; i < _count; i++) {
|
|
for (let i = 0; i < _count; i++) {
|
|
- if (i == 0) {
|
|
|
|
- _waterMax -= 0.1
|
|
|
|
- } else {
|
|
|
|
- _waterMax -= 0.5
|
|
|
|
- }
|
|
|
|
- let priceList = this.calculatePrice(_waterMax)
|
|
|
|
|
|
+ // if (i == 0) {
|
|
|
|
+ // _waterMax -= 0.1
|
|
|
|
+ // }
|
|
|
|
+ // else {
|
|
|
|
+ // _waterMax -= 0.5
|
|
|
|
+ // }
|
|
|
|
+ _waterMax -= 0.1
|
|
|
|
+ let priceList = this.calculatePrice(this.keepOneDecimal(_waterMax ))
|
|
|
|
+
|
|
_obj = {
|
|
_obj = {
|
|
- waterMin: this.keepOneDecimal(_waterMax - 0.4),
|
|
|
|
- waterMax: this.keepOneDecimal(_waterMax),
|
|
|
|
|
|
+ waterMin: this.keepOneDecimal(_waterMax ),
|
|
|
|
+ waterMax: this.keepOneDecimal(_waterMax + 0.09),
|
|
price1: this.keepTwoDecimal(priceList[0]),
|
|
price1: this.keepTwoDecimal(priceList[0]),
|
|
price2: this.keepTwoDecimal(priceList[1]),
|
|
price2: this.keepTwoDecimal(priceList[1]),
|
|
price3: this.keepTwoDecimal(priceList[2]),
|
|
price3: this.keepTwoDecimal(priceList[2]),
|
|
@@ -897,24 +911,28 @@
|
|
_obj = {}
|
|
_obj = {}
|
|
_waterMin = parseFloat(this.baseInfoForm.waterBase)
|
|
_waterMin = parseFloat(this.baseInfoForm.waterBase)
|
|
_waterMax = parseFloat(this.baseInfoForm.waterMax)
|
|
_waterMax = parseFloat(this.baseInfoForm.waterMax)
|
|
- _count = (_waterMax - _waterMin) / 0.5
|
|
|
|
|
|
+ _count = (_waterMax - _waterMin) / 0.1
|
|
for (let i = 0; i < _count; i++) {
|
|
for (let i = 0; i < _count; i++) {
|
|
- if (i == 0) {
|
|
|
|
- _waterMin += 0.4
|
|
|
|
- } else {
|
|
|
|
- _waterMin += 0.5
|
|
|
|
|
|
+ // if (i == 0) {
|
|
|
|
+ // _waterMin += 0.4
|
|
|
|
+ // } else {
|
|
|
|
+ // _waterMin += 0.5
|
|
|
|
+ // }
|
|
|
|
+ if (i != 0) {
|
|
|
|
+ _waterMin += 0.1
|
|
}
|
|
}
|
|
- let priceList = this.calculatePriceRight(_waterMin)
|
|
|
|
|
|
+
|
|
|
|
+ let priceList = this.calculatePriceRight(this.keepOneDecimal(_waterMin ))
|
|
_obj = {
|
|
_obj = {
|
|
- waterMin: this.keepOneDecimal(_waterMin - 0.4),
|
|
|
|
- waterMax: this.keepOneDecimal(_waterMin),
|
|
|
|
|
|
+ waterMin: this.keepOneDecimal(_waterMin ),
|
|
|
|
+ waterMax: this.keepOneDecimal(_waterMin + 0.09),
|
|
price1: this.keepTwoDecimal(priceList[0]),
|
|
price1: this.keepTwoDecimal(priceList[0]),
|
|
price2: this.keepTwoDecimal(priceList[1]),
|
|
price2: this.keepTwoDecimal(priceList[1]),
|
|
price3: this.keepTwoDecimal(priceList[2]),
|
|
price3: this.keepTwoDecimal(priceList[2]),
|
|
priceOther: this.keepTwoDecimal(priceList[3]),
|
|
priceOther: this.keepTwoDecimal(priceList[3]),
|
|
}
|
|
}
|
|
_list.push(_obj)
|
|
_list.push(_obj)
|
|
- console.log("_list", _list)
|
|
|
|
|
|
+ console.log('_list', _list)
|
|
|
|
|
|
}
|
|
}
|
|
this.baseInfoForm.detailPrints = _list
|
|
this.baseInfoForm.detailPrints = _list
|
|
@@ -953,12 +971,12 @@
|
|
for (let j = index(); j > 0; j--) {
|
|
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(_priceList[i].basicUnitPrice + (parseFloat(_priceList[i].detailList[j + 2]
|
|
- .water) - parseFloat(_priceList[i].detailList[j].water)) / 0.5 * parseFloat(_priceList[i]
|
|
|
|
|
|
+ .water) - parseFloat(_priceList[i].detailList[j].water)) / 0.1 * parseFloat(_priceList[i]
|
|
.detailList[j + 1].jfprice))
|
|
.detailList[j + 1].jfprice))
|
|
}
|
|
}
|
|
_leftObj.priceList.push({
|
|
_leftObj.priceList.push({
|
|
@@ -970,7 +988,7 @@
|
|
jfprice: parseFloat(_priceList[i].detailList[j - 1].jfprice),
|
|
jfprice: parseFloat(_priceList[i].detailList[j - 1].jfprice),
|
|
baseprice: baseprice,
|
|
baseprice: baseprice,
|
|
price: (parseFloat(_priceList[i].detailList[j].water) - parseFloat(_priceList[i].detailList[j -
|
|
price: (parseFloat(_priceList[i].detailList[j].water) - parseFloat(_priceList[i].detailList[j -
|
|
- 2].water)) / 0.5 * parseFloat(_priceList[i].detailList[j - 1].jfprice)
|
|
|
|
|
|
+ 2].water)) / 0.1 * parseFloat(_priceList[i].detailList[j - 1].jfprice)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1002,16 +1020,16 @@
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
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(_priceList[i].basicUnitPrice - (parseFloat(_priceList[i].detailList[k]
|
|
- .water) - parseFloat(_priceList[i].detailList[k - 2].water)) / 0.5 * parseFloat(_priceList[i]
|
|
|
|
|
|
+ .water) - parseFloat(_priceList[i].detailList[k - 2].water)) / 0.1 * parseFloat(_priceList[i]
|
|
.detailList[k - 1].jfprice))
|
|
.detailList[k - 1].jfprice))
|
|
}
|
|
}
|
|
_rightObj.priceList.push({
|
|
_rightObj.priceList.push({
|
|
@@ -1023,7 +1041,7 @@
|
|
jfprice: parseFloat(_priceList[i].detailList[k + 1].jfprice),
|
|
jfprice: parseFloat(_priceList[i].detailList[k + 1].jfprice),
|
|
baseprice: baseprice,
|
|
baseprice: baseprice,
|
|
price: (parseFloat(_priceList[i].detailList[k + 2].water) - parseFloat(_priceList[i].detailList[
|
|
price: (parseFloat(_priceList[i].detailList[k + 2].water) - parseFloat(_priceList[i].detailList[
|
|
- k].water)) / 0.5 * parseFloat(_priceList[i].detailList[k + 1].jfprice)
|
|
|
|
|
|
+ k].water)) / 0.1 * parseFloat(_priceList[i].detailList[k + 1].jfprice)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1056,7 +1074,7 @@
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
this.right.push(_rightObj)
|
|
this.right.push(_rightObj)
|
|
- console.log("this.right", this.right)
|
|
|
|
|
|
+ console.log('this.right', this.right)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -1067,10 +1085,10 @@
|
|
let _listResult = []
|
|
let _listResult = []
|
|
for (let i = 0; i < this.right.length; i++) {
|
|
for (let i = 0; i < this.right.length; i++) {
|
|
let _list = this.right[i].priceList
|
|
let _list = this.right[i].priceList
|
|
- 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 * (((_waterMax - 0.4) - _list[k].priceStart) * 2))
|
|
|
|
|
|
+ tmp = parseFloat(_list[k].baseprice - _list[k].jfprice * (((_waterMax) - _list[k].priceStart) / 0.1))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
_listResult.push(tmp)
|
|
_listResult.push(tmp)
|
|
@@ -1082,11 +1100,10 @@
|
|
let _listResult = []
|
|
let _listResult = []
|
|
for (let i = 0; i < this.left.length; i++) {
|
|
for (let i = 0; i < this.left.length; i++) {
|
|
let _list = this.left[i].priceList
|
|
let _list = this.left[i].priceList
|
|
- 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)) * 2 +
|
|
|
|
- 1))
|
|
|
|
|
|
+ tmp = parseFloat(_list[k].baseprice + _list[k].jfprice * ((_list[k].priceStart - (_waterMax )) / 0.1 + 1))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
_listResult.push(tmp)
|
|
_listResult.push(tmp)
|
|
@@ -1111,7 +1128,7 @@
|
|
if (_detailList[k] == this.baseInfoForm.waterMin) {
|
|
if (_detailList[k] == this.baseInfoForm.waterMin) {
|
|
_obj = {
|
|
_obj = {
|
|
type: 1,
|
|
type: 1,
|
|
- name: "干粮",
|
|
|
|
|
|
+ name: '干粮',
|
|
water: _detailList[k],
|
|
water: _detailList[k],
|
|
isWrite: false
|
|
isWrite: false
|
|
}
|
|
}
|
|
@@ -1119,20 +1136,20 @@
|
|
} else if (_detailList[k] == this.baseInfoForm.waterMax) {
|
|
} else if (_detailList[k] == this.baseInfoForm.waterMax) {
|
|
_obj = {
|
|
_obj = {
|
|
type: 3,
|
|
type: 3,
|
|
- name: "上限",
|
|
|
|
|
|
+ name: '上限',
|
|
water: _detailList[k],
|
|
water: _detailList[k],
|
|
isWrite: false
|
|
isWrite: false
|
|
}
|
|
}
|
|
} else if (_detailList[k] == this.baseInfoForm.waterBase) {
|
|
} else if (_detailList[k] == this.baseInfoForm.waterBase) {
|
|
_obj = {
|
|
_obj = {
|
|
type: 2,
|
|
type: 2,
|
|
- name: "基准",
|
|
|
|
|
|
+ name: '基准',
|
|
water: _detailList[k],
|
|
water: _detailList[k],
|
|
isWrite: false
|
|
isWrite: false
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
_obj = {
|
|
_obj = {
|
|
- name: "分界",
|
|
|
|
|
|
+ name: '分界',
|
|
water: _detailList[k],
|
|
water: _detailList[k],
|
|
type: 5,
|
|
type: 5,
|
|
index: k,
|
|
index: k,
|