|
@@ -32,24 +32,24 @@
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="grid-content">
|
|
|
- <el-form-item label="干粮收购价格(元/公斤)">
|
|
|
+ <el-form-item label="干粮收购价格(元/公斤)" label-width="180px">
|
|
|
<el-input v-model="baseInfoForm.dryGrainPrice" :disabled="!isEdit"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="row2">
|
|
|
<div class="grid-content">
|
|
|
- <el-form-item label="干粮水分">
|
|
|
- <el-input v-model="baseInfoForm.waterMin" @input="changeMinWater" :disabled="!isEdit"></el-input>
|
|
|
+ <el-form-item label="干粮水分(%)">
|
|
|
+ <el-input v-model="baseInfoForm.waterMin" @input="changeMinWater" :disabled="!isEdit" id="aaa"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="grid-content">
|
|
|
- <el-form-item label="水分上限">
|
|
|
+ <el-form-item label="水分上限(%)">
|
|
|
<el-input v-model="baseInfoForm.waterMax" @input="changeMaxWater" :disabled="!isEdit"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="grid-content">
|
|
|
- <el-form-item label="销售上限(年/吨)">
|
|
|
+ <el-form-item label="销售上限(吨/年)">
|
|
|
<el-input v-model="baseInfoForm.saleLimit" :disabled="!isEdit"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
@@ -79,7 +79,7 @@
|
|
|
<div class="count">
|
|
|
<div class="left">
|
|
|
<div>水分(%)</div>
|
|
|
- <div>降幅(元/0.5%)</div>
|
|
|
+ <div>降幅(元/0.1%)</div>
|
|
|
</div>
|
|
|
<div class="right">
|
|
|
<div class="line"></div>
|
|
@@ -95,19 +95,19 @@
|
|
|
v-show="item1.type!=1&&item1.type!=2&&item1.type!=3" :disabled="!isEdit">-</el-button>
|
|
|
</div>
|
|
|
<div v-show="item1.type!=4">
|
|
|
- <input v-if='item1.type==1' class="water-price" v-model="baseInfoForm.waterMin"
|
|
|
+ <input v-if='item1.type==1' class="water-price" :class="item1.isWrite?'white-bgc':''" v-model="baseInfoForm.waterMin"
|
|
|
:disabled="item1.isWrite?false:true"></input>
|
|
|
- <input v-if='item1.type==2' class="water-price" v-model="baseInfoForm.waterBase"
|
|
|
+ <input v-if='item1.type==2' class="water-price" :class="item1.isWrite?'white-bgc':''" v-model="baseInfoForm.waterBase"
|
|
|
:disabled="item1.isWrite?false:true"></input>
|
|
|
- <input v-if='item1.type==3' class="water-price" v-model="baseInfoForm.waterMax"
|
|
|
+ <input v-if='item1.type==3' class="water-price" :class="item1.isWrite?'white-bgc':''" v-model="baseInfoForm.waterMax"
|
|
|
:disabled="item1.isWrite?false:true"></input>
|
|
|
- <input v-if='item1.type==5' class="water-price" v-model="item1.water"
|
|
|
+ <input v-if='item1.type==5' class="water-price" :class="item1.isWrite?'white-bgc':''" v-model="item1.water"
|
|
|
:disabled="isEdit?false:true"></input>
|
|
|
</div>
|
|
|
<div class="circle" v-if="item1.type!=4"></div>
|
|
|
</div>
|
|
|
<div class="bottom-price">
|
|
|
- <input v-if="item1.type==4" class="water-price" v-model="item1.jfprice" :disabled="!isEdit"></input>
|
|
|
+ <input v-if="item1.type==4" class="water-price" :class="isEdit?'white-bgc':''" v-model="item1.jfprice" :disabled="!isEdit"></input>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -119,7 +119,7 @@
|
|
|
<el-main v-show="!isCountShow">
|
|
|
<div class="page2-content">
|
|
|
<div class="titel">
|
|
|
- 玉米价格对照表(按水分)
|
|
|
+ {{selectVal}}价格对照表(按水分)
|
|
|
</div>
|
|
|
<el-table :data="tableData" style="width: 100%" :row-class-name="tableRowClassName">
|
|
|
<el-table-column prop="waterMin" label="水分下限(%)">
|
|
@@ -174,38 +174,38 @@
|
|
|
price: 0,
|
|
|
left: [],
|
|
|
right: [],
|
|
|
- selectVal: "",
|
|
|
+ selectVal: '',
|
|
|
goodnameList: [],
|
|
|
tableData: [],
|
|
|
- submitName: "提交",
|
|
|
+ submitName: '提交',
|
|
|
isCountShow: true,
|
|
|
priceList: [{
|
|
|
index: 0,
|
|
|
checkList: [],
|
|
|
- basicUnitPrice: "",
|
|
|
+ basicUnitPrice: '',
|
|
|
detailList: [{
|
|
|
type: 1,
|
|
|
- name: "干粮",
|
|
|
- water: "",
|
|
|
+ name: '干粮',
|
|
|
+ water: '',
|
|
|
isWrite: false
|
|
|
},
|
|
|
{
|
|
|
type: 4,
|
|
|
- jfprice: ""
|
|
|
+ jfprice: ''
|
|
|
},
|
|
|
{
|
|
|
type: 2,
|
|
|
- name: "基准",
|
|
|
+ name: '基准',
|
|
|
water: '',
|
|
|
isWrite: false
|
|
|
},
|
|
|
{
|
|
|
type: 4,
|
|
|
- jfprice: ""
|
|
|
+ jfprice: ''
|
|
|
},
|
|
|
{
|
|
|
type: 3,
|
|
|
- name: "上限",
|
|
|
+ name: '上限',
|
|
|
water: '',
|
|
|
isWrite: false
|
|
|
},
|
|
@@ -272,7 +272,6 @@
|
|
|
this.goodnameList = response
|
|
|
this.selectVal = response[0].constValue
|
|
|
} else {
|
|
|
- this.goodnameList = _list
|
|
|
this.goodnameList = _list
|
|
|
if (_list.length != 0) {
|
|
|
this.selectVal = _list[0].constValue
|
|
@@ -280,10 +279,12 @@
|
|
|
}
|
|
|
})
|
|
|
this.isCountShow = true
|
|
|
+
|
|
|
switch (this.$route.query.type) {
|
|
|
- case "新增":
|
|
|
- this.submitName = "提交"
|
|
|
+ case '新增':
|
|
|
+ this.submitName = '提交'
|
|
|
this.isCountShow = true
|
|
|
+ this.checkList=[]
|
|
|
this.baseInfoForm = {
|
|
|
warehouseId: '',
|
|
|
warehouseName: '',
|
|
@@ -316,49 +317,49 @@
|
|
|
this.priceList = [{
|
|
|
index: 0,
|
|
|
checkList: [],
|
|
|
- basicUnitPrice: "",
|
|
|
+ basicUnitPrice: '',
|
|
|
detailList: [{
|
|
|
type: 1,
|
|
|
- name: "干粮",
|
|
|
- water: "",
|
|
|
+ name: '干粮',
|
|
|
+ water: '',
|
|
|
isWrite: false
|
|
|
},
|
|
|
{
|
|
|
type: 4,
|
|
|
- jfprice: ""
|
|
|
+ jfprice: ''
|
|
|
},
|
|
|
{
|
|
|
type: 2,
|
|
|
- name: "基准",
|
|
|
+ name: '基准',
|
|
|
water: '',
|
|
|
isWrite: false
|
|
|
},
|
|
|
{
|
|
|
type: 4,
|
|
|
- jfprice: ""
|
|
|
+ jfprice: ''
|
|
|
},
|
|
|
{
|
|
|
type: 3,
|
|
|
- name: "上限",
|
|
|
+ name: '上限',
|
|
|
water: '',
|
|
|
isWrite: false
|
|
|
},
|
|
|
],
|
|
|
}]
|
|
|
break;
|
|
|
- case "编辑":
|
|
|
+ case '编辑':
|
|
|
this.isEdit = true;
|
|
|
- this.submitName = "提交"
|
|
|
+ this.submitName = '提交'
|
|
|
this.getData()
|
|
|
break;
|
|
|
- case "审核中":
|
|
|
+ case '审核中':
|
|
|
// this.isEdit = false;
|
|
|
- this.submitName = "通过"
|
|
|
+ this.submitName = '通过'
|
|
|
this.getData()
|
|
|
break;
|
|
|
- case "查看":
|
|
|
+ case '查看':
|
|
|
this.isEdit = false;
|
|
|
- this.submitName = "计算"
|
|
|
+ this.submitName = '计算'
|
|
|
this.getData()
|
|
|
break;
|
|
|
default:
|
|
@@ -378,9 +379,21 @@
|
|
|
//构造查看priceList数据
|
|
|
this.priceList = []
|
|
|
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) {
|
|
|
+
|
|
|
+ },
|
|
|
changeBaseWater(val) {
|
|
|
for (let i = 0; i < this.priceList.length; i++) {
|
|
|
for (let k = 0; k < this.priceList[i].detailList.length; k++) {
|
|
@@ -440,14 +453,14 @@
|
|
|
} else {
|
|
|
item.index++
|
|
|
item.detailList.splice(index + 1, 0, {
|
|
|
- name: "分界",
|
|
|
+ name: '分界',
|
|
|
water: '',
|
|
|
type: 5,
|
|
|
index: 1,
|
|
|
isWrite: true
|
|
|
});
|
|
|
item.detailList.splice(index + 1, 0, {
|
|
|
- jfprice: "",
|
|
|
+ jfprice: '',
|
|
|
type: 4
|
|
|
});
|
|
|
this.makeSpliceIndex(item, item1, index)
|
|
@@ -493,12 +506,12 @@
|
|
|
s1 = arg1.toString(),
|
|
|
s2 = arg2.toString();
|
|
|
try {
|
|
|
- m += s1.split(".")[1].length
|
|
|
+ m += s1.split('.')[1].length
|
|
|
} catch (e) {}
|
|
|
try {
|
|
|
- m += s2.split(".")[1].length
|
|
|
+ m += s2.split('.')[1].length
|
|
|
} 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) {
|
|
@@ -525,27 +538,27 @@
|
|
|
checkList: [],
|
|
|
detailList: [{
|
|
|
type: 1,
|
|
|
- name: "干粮",
|
|
|
+ name: '干粮',
|
|
|
water: this.baseInfoForm.waterMin,
|
|
|
isWrite: false
|
|
|
},
|
|
|
{
|
|
|
type: 4,
|
|
|
- jfprice: ""
|
|
|
+ jfprice: ''
|
|
|
},
|
|
|
{
|
|
|
type: 2,
|
|
|
- name: "基准",
|
|
|
+ name: '基准',
|
|
|
water: this.baseInfoForm.waterBase,
|
|
|
isWrite: false
|
|
|
},
|
|
|
{
|
|
|
type: 4,
|
|
|
- jfprice: ""
|
|
|
+ jfprice: ''
|
|
|
},
|
|
|
{
|
|
|
type: 3,
|
|
|
- name: "上限",
|
|
|
+ name: '上限',
|
|
|
water: this.baseInfoForm.waterMax,
|
|
|
isWrite: false
|
|
|
},
|
|
@@ -555,7 +568,6 @@
|
|
|
},
|
|
|
// 删除价格组
|
|
|
delSetPrice(item, index) {
|
|
|
- // debugger
|
|
|
let that = this
|
|
|
this.checkList1 = []
|
|
|
this.checkList2 = []
|
|
@@ -634,28 +646,28 @@
|
|
|
//打印
|
|
|
print() {
|
|
|
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() {
|
|
|
let that = this
|
|
|
|
|
|
function _baseWaterValidate(min, max, saveNum, point, type, inputVal) {
|
|
|
let _val1 = inputVal
|
|
|
- let _pointVal1 = _val1.toString().split(".")[1]
|
|
|
+ let _pointVal1 = _val1.toString().split('.')[1]
|
|
|
if (_pointVal1 == undefined) _pointVal1 = 0
|
|
|
- if (typeof(_pointVal1) == "string") _pointVal1 = _pointVal1.length
|
|
|
+ if (typeof(_pointVal1) == 'string') _pointVal1 = _pointVal1.length
|
|
|
let _tobeVal1 = _val1 % point
|
|
|
- if (type == "waterBase") {
|
|
|
+ if (type == 'waterBase') {
|
|
|
if (_val1 <= max && _val1 >= min && _pointVal1 <= saveNum && _tobeVal1 == 0) {
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
- if (type == "deductWeight") {
|
|
|
+ if (type == 'deductWeight') {
|
|
|
if (_val1 <= max && _val1 >= min && _pointVal1 <= saveNum) {
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
- if (type == "saleLimit") {
|
|
|
+ if (type == 'saleLimit') {
|
|
|
if (_val1 <= max && _val1 >= min) {
|
|
|
// Number.isInteger(that.baseInfoForm.saleLimit)
|
|
|
return false
|
|
@@ -663,9 +675,9 @@
|
|
|
}
|
|
|
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))) {
|
|
|
- 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整除!');
|
|
|
} else {
|
|
|
this.$message.error('基准水分不能为空!');
|
|
@@ -691,29 +703,39 @@
|
|
|
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))) {
|
|
|
if (this.baseInfoForm.waterMin == '') {
|
|
|
this.$message.error('干粮水分不能为空!')
|
|
|
}
|
|
|
- return false
|
|
|
- if (_baseWaterValidate(1, 100, 1, 0.5, "waterBase", parseFloat(this.baseInfoForm.waterMin))) {
|
|
|
- that.$message.error('干粮水分输入错误!')
|
|
|
+ if (_baseWaterValidate(1, 100, 1, 0.5, 'waterBase', parseFloat(this.baseInfoForm.waterMin))) {
|
|
|
+ that.$message.error('干粮水分输入错误,最多保留1位小数,干粮水分须可被0.5整除!')
|
|
|
}
|
|
|
return false
|
|
|
}
|
|
|
- if (this.baseInfoForm.waterMax == '' || _baseWaterValidate(1, 100, 1, 0.5, "waterBase", parseFloat(this
|
|
|
+
|
|
|
+ if (this.baseInfoForm.waterBase>this.baseInfoForm.waterMax) {
|
|
|
+ this.$message.error('基准水分须小于水分上限!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.baseInfoForm.waterMin>this.baseInfoForm.waterBase) {
|
|
|
+ this.$message.error('干粮水分须小于基准水分!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.baseInfoForm.waterMax == '' || _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('水分上限输入错误!');
|
|
|
+ if (_baseWaterValidate(1, 100, 1, 0.5, 'waterBase', parseFloat(this.baseInfoForm.waterMax))) {
|
|
|
+ that.$message.error('水分上限输入错误,最多保留1位小数,干粮水分须可被0.5整除!');
|
|
|
} else {
|
|
|
this.$message.error('水分上限不能为空!');
|
|
|
}
|
|
|
return false
|
|
|
}
|
|
|
- if (this.baseInfoForm.saleLimit == '' || _baseWaterValidate(100, 100000, '', '', "saleLimit", parseFloat(this
|
|
|
+ if (this.baseInfoForm.saleLimit == '' || _baseWaterValidate(100, 100000, '', '', 'saleLimit', parseFloat(this
|
|
|
.baseInfoForm.saleLimit))) {
|
|
|
- if (_baseWaterValidate(100, 100000, '', '', "saleLimit", parseFloat(this.baseInfoForm.saleLimit))) {
|
|
|
+ if (_baseWaterValidate(100, 100000, '', '', 'saleLimit', parseFloat(this.baseInfoForm.saleLimit))) {
|
|
|
that.$message.error('销售上限输入错误!');
|
|
|
} else {
|
|
|
this.$message.error('销售上限不能为空!');
|
|
@@ -726,12 +748,12 @@
|
|
|
}
|
|
|
for (let i = 0; i < this.priceList.length; 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))) {
|
|
|
if (_item.basicUnitPrice == '') {
|
|
|
this.$message.error('基准单价不能为空!');
|
|
|
} else {
|
|
|
- that.$message.error('基准单价输入错误!');
|
|
|
+ that.$message.error('基准单价输入错误,0-50数字最多保留两位小数!');
|
|
|
}
|
|
|
return false
|
|
|
}
|
|
@@ -742,9 +764,9 @@
|
|
|
for (let j = 0; j < _item.detailList.length; j++) {
|
|
|
let _item1 = _item.detailList[j]
|
|
|
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))) {
|
|
|
- if (_item1.jfprice == "") {
|
|
|
+ if (_item1.jfprice == '') {
|
|
|
this.$message.error('降幅价格不能为空!');
|
|
|
} else {
|
|
|
that.$message.error('降幅输入错误!');
|
|
@@ -752,8 +774,8 @@
|
|
|
return false
|
|
|
}
|
|
|
} 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('分界水分不能为空!')
|
|
|
} else {
|
|
|
that.$message.error('分界值输入错误!');
|
|
@@ -778,16 +800,19 @@
|
|
|
},
|
|
|
// 提交
|
|
|
submit() {
|
|
|
+ this.isCountShow = false
|
|
|
+ let isValidate = false
|
|
|
+ isValidate = this.validate()
|
|
|
+ if (isValidate) {
|
|
|
this.makeTableList()
|
|
|
this.baseInfoForm.details = []
|
|
|
this.makePriceDataList()
|
|
|
this.baseInfoForm.goodsName = this.selectVal
|
|
|
- let isValidate = false
|
|
|
switch (this.$route.query.type) {
|
|
|
- case "查看":
|
|
|
+ case '查看':
|
|
|
this.isCountShow = false;
|
|
|
break;
|
|
|
- case "新增":
|
|
|
+ case '新增':
|
|
|
isValidate = this.validate()
|
|
|
if (isValidate) {
|
|
|
purchasePriceAdd(this.baseInfoForm).toPromise().then((response) => {
|
|
@@ -796,7 +821,7 @@
|
|
|
})
|
|
|
}
|
|
|
break;
|
|
|
- case "编辑":
|
|
|
+ case '编辑':
|
|
|
this.getEditCheckList()
|
|
|
isValidate = this.validate()
|
|
|
if (isValidate) {
|
|
@@ -805,7 +830,7 @@
|
|
|
})
|
|
|
}
|
|
|
break;
|
|
|
- case "审核中":
|
|
|
+ case '审核中':
|
|
|
// this.makePriceDataList()
|
|
|
this.getEditCheckList()
|
|
|
isValidate = this.validate()
|
|
@@ -824,6 +849,8 @@
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
//审核
|
|
|
audit(item, status, status2) {
|
|
@@ -860,17 +887,20 @@
|
|
|
let _obj = {}
|
|
|
let _waterMin = parseFloat(this.baseInfoForm.waterMin)
|
|
|
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++) {
|
|
|
- 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 = {
|
|
|
- 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]),
|
|
|
price2: this.keepTwoDecimal(priceList[1]),
|
|
|
price3: this.keepTwoDecimal(priceList[2]),
|
|
@@ -881,24 +911,28 @@
|
|
|
_obj = {}
|
|
|
_waterMin = parseFloat(this.baseInfoForm.waterBase)
|
|
|
_waterMax = parseFloat(this.baseInfoForm.waterMax)
|
|
|
- _count = (_waterMax - _waterMin) / 0.5
|
|
|
+ _count = (_waterMax - _waterMin) / 0.1
|
|
|
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 = {
|
|
|
- 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]),
|
|
|
price2: this.keepTwoDecimal(priceList[1]),
|
|
|
price3: this.keepTwoDecimal(priceList[2]),
|
|
|
priceOther: this.keepTwoDecimal(priceList[3]),
|
|
|
}
|
|
|
_list.push(_obj)
|
|
|
- console.log("_list", _list)
|
|
|
+ console.log('_list', _list)
|
|
|
|
|
|
}
|
|
|
this.baseInfoForm.detailPrints = _list
|
|
@@ -906,6 +940,7 @@
|
|
|
},
|
|
|
// 获取分界价格数据,构造分界价格区间数据
|
|
|
getSplitPrice() {
|
|
|
+ let that = this;
|
|
|
this.left = []
|
|
|
this.right = []
|
|
|
let _priceList = this.priceList;
|
|
@@ -923,16 +958,25 @@
|
|
|
_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) {
|
|
|
+ let baseprice = ''
|
|
|
+ if (j == index()) {
|
|
|
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]
|
|
|
+ .water) - parseFloat(_priceList[i].detailList[j].water)) / 0.1 * parseFloat(_priceList[i]
|
|
|
.detailList[j + 1].jfprice))
|
|
|
}
|
|
|
_leftObj.priceList.push({
|
|
@@ -944,22 +988,48 @@
|
|
|
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)
|
|
|
+ 2].water)) / 0.1 * parseFloat(_priceList[i].detailList[j - 1].jfprice)
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 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++) {
|
|
|
+ console.log('this.left', this.left)
|
|
|
+ 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) {
|
|
|
+ let baseprice = ''
|
|
|
+ if (k == index()) {
|
|
|
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]
|
|
|
+ .water) - parseFloat(_priceList[i].detailList[k - 2].water)) / 0.1 * parseFloat(_priceList[i]
|
|
|
.detailList[k - 1].jfprice))
|
|
|
}
|
|
|
_rightObj.priceList.push({
|
|
@@ -971,13 +1041,40 @@
|
|
|
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)
|
|
|
+ k].water)) / 0.1 * parseFloat(_priceList[i].detailList[k + 1].jfprice)
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ // 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)
|
|
|
+ console.log('this.right', this.right)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -988,10 +1085,10 @@
|
|
|
let _listResult = []
|
|
|
for (let i = 0; i < this.right.length; i++) {
|
|
|
let _list = this.right[i].priceList
|
|
|
- let tmp = ""
|
|
|
+ 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))
|
|
|
+ tmp = parseFloat(_list[k].baseprice - _list[k].jfprice * (((_waterMax) - _list[k].priceStart) / 0.1))
|
|
|
}
|
|
|
}
|
|
|
_listResult.push(tmp)
|
|
@@ -1003,11 +1100,10 @@
|
|
|
let _listResult = []
|
|
|
for (let i = 0; i < this.left.length; i++) {
|
|
|
let _list = this.left[i].priceList
|
|
|
- let tmp = ""
|
|
|
+ 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))
|
|
|
+ tmp = parseFloat(_list[k].baseprice + _list[k].jfprice * ((_list[k].priceStart - (_waterMax )) / 0.1 + 1))
|
|
|
}
|
|
|
}
|
|
|
_listResult.push(tmp)
|
|
@@ -1032,7 +1128,7 @@
|
|
|
if (_detailList[k] == this.baseInfoForm.waterMin) {
|
|
|
_obj = {
|
|
|
type: 1,
|
|
|
- name: "干粮",
|
|
|
+ name: '干粮',
|
|
|
water: _detailList[k],
|
|
|
isWrite: false
|
|
|
}
|
|
@@ -1040,24 +1136,24 @@
|
|
|
} else if (_detailList[k] == this.baseInfoForm.waterMax) {
|
|
|
_obj = {
|
|
|
type: 3,
|
|
|
- name: "上限",
|
|
|
+ name: '上限',
|
|
|
water: _detailList[k],
|
|
|
isWrite: false
|
|
|
}
|
|
|
} else if (_detailList[k] == this.baseInfoForm.waterBase) {
|
|
|
_obj = {
|
|
|
type: 2,
|
|
|
- name: "基准",
|
|
|
+ name: '基准',
|
|
|
water: _detailList[k],
|
|
|
isWrite: false
|
|
|
}
|
|
|
} else {
|
|
|
_obj = {
|
|
|
- name: "分界",
|
|
|
+ name: '分界',
|
|
|
water: _detailList[k],
|
|
|
type: 5,
|
|
|
index: k,
|
|
|
- isWrite: false
|
|
|
+ isWrite: true
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1372,4 +1468,10 @@
|
|
|
justify-content: space-around;
|
|
|
align-items: center;
|
|
|
}
|
|
|
+ .white-bgc{
|
|
|
+ background: white!important;
|
|
|
+ }
|
|
|
+ #aaa::selection{
|
|
|
+ // background: red;
|
|
|
+ }
|
|
|
</style>
|