|
@@ -26,7 +26,7 @@
|
|
|
<el-input type="number" @mousewheel.native.prevent v-model="baseInfoForm.waterBase" @input="changeBaseWater" :disabled="!isEdit"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
- <div class="grid-content">
|
|
|
+ <div v-if="baseInfoForm.paramType != '1'" class="grid-content">
|
|
|
<el-form-item label="扣重比">
|
|
|
<el-input type="number" @mousewheel.native.prevent v-model="baseInfoForm.deductWeight" :disabled="!isEdit"></el-input>
|
|
|
</el-form-item>
|
|
@@ -53,6 +53,19 @@
|
|
|
<el-input type="number" @mousewheel.native.prevent v-model="baseInfoForm.saleLimit" :disabled="!isEdit"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
+ <div class="grid-content">
|
|
|
+ <el-form-item label="参数类型">
|
|
|
+ <el-radio-group
|
|
|
+ @change="paramTypeChange"
|
|
|
+ v-model="baseInfoForm.paramType"
|
|
|
+ :disabled="!isEdit"
|
|
|
+ >
|
|
|
+ <el-radio label="1" >扣重比</el-radio>
|
|
|
+ <el-radio label="2">降幅</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
</el-form>
|
|
|
<el-row class="row3">
|
|
@@ -79,7 +92,8 @@
|
|
|
<div class="count">
|
|
|
<div class="left">
|
|
|
<div>水分(%)</div>
|
|
|
- <div>降幅(元/0.1%)</div>
|
|
|
+ <div v-if="baseInfoForm.paramType == '2'">降幅(元/0.1%)</div>
|
|
|
+ <div v-else>扣重比</div>
|
|
|
</div>
|
|
|
<div class="right">
|
|
|
<div class="line"></div>
|
|
@@ -303,7 +317,8 @@
|
|
|
passDate: '',
|
|
|
dryGrainPrice: '',
|
|
|
details: [],
|
|
|
- detailPrints: []
|
|
|
+ detailPrints: [],
|
|
|
+ paramType:'1'
|
|
|
}
|
|
|
this.baseInfoForm.warehouseId = this.$route.query.warehouseId
|
|
|
this.baseInfoForm.warehouseName = this.$route.query.warehouseName
|
|
@@ -368,6 +383,9 @@
|
|
|
},
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
+ paramTypeChange(){
|
|
|
+ // this.makeTableList()
|
|
|
+ },
|
|
|
// 查看/编辑获取数据
|
|
|
getData() {
|
|
|
this.type = this.$route.query.type
|
|
@@ -693,14 +711,16 @@
|
|
|
}
|
|
|
return false
|
|
|
}
|
|
|
- if (this.baseInfoForm.deductWeight == '' || _baseWaterValidate(0, 3, 2, '', 'deductWeight', parseFloat(this
|
|
|
- .baseInfoForm.deductWeight))) {
|
|
|
- if (_baseWaterValidate(0, 3, 2, '', 'deductWeight', parseFloat(this.baseInfoForm.deductWeight))) {
|
|
|
- that.$message.error('扣重比输入错误!');
|
|
|
- } else {
|
|
|
- this.$message.error('扣重比不能为空!');
|
|
|
+ if(this.baseInfoForm.paramType == '2'){
|
|
|
+ if (this.baseInfoForm.deductWeight == '' || _baseWaterValidate(0, 3, 2, '', 'deductWeight', parseFloat(this
|
|
|
+ .baseInfoForm.deductWeight))) {
|
|
|
+ if (_baseWaterValidate(0, 3, 2, '', 'deductWeight', parseFloat(this.baseInfoForm.deductWeight))) {
|
|
|
+ that.$message.error('扣重比输入错误!');
|
|
|
+ } else {
|
|
|
+ this.$message.error('扣重比不能为空!');
|
|
|
+ }
|
|
|
+ return false
|
|
|
}
|
|
|
- return false
|
|
|
}
|
|
|
if (this.baseInfoForm.dryGrainPrice == '' || _baseWaterValidate(0, 1000, 4, '', 'deductWeight', parseFloat(this
|
|
|
.baseInfoForm.dryGrainPrice))) {
|
|
@@ -756,7 +776,7 @@
|
|
|
}
|
|
|
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, 8, '', 'deductWeight', parseFloat(_item
|
|
|
.basicUnitPrice))) {
|
|
|
if (_item.basicUnitPrice == '') {
|
|
|
that.$message.error('基准单价不能为空!');
|
|
@@ -773,12 +793,22 @@
|
|
|
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, 8, '', 'deductWeight', parseFloat(_item1
|
|
|
.jfprice))) {
|
|
|
if (_item1.jfprice == '') {
|
|
|
- that.$message.error('降幅价格不能为空!');
|
|
|
+ if(this.baseInfoForm.paramType == '1'){
|
|
|
+ that.$message.error('扣重比不能为空!');
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ that.$message.error('降幅价格不能为空!');
|
|
|
+ }
|
|
|
} else {
|
|
|
- that.$message.error('降幅输入错误!');
|
|
|
+ if(this.baseInfoForm.paramType == '1'){
|
|
|
+ that.$message.error('扣重比输入错误!');
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ that.$message.error('降幅输入错误!');
|
|
|
+ }
|
|
|
}
|
|
|
return false
|
|
|
}
|
|
@@ -824,7 +854,6 @@
|
|
|
isValidate = this.validate()
|
|
|
|
|
|
if (isValidate) {
|
|
|
- this.isCountShow = false
|
|
|
this.makeTableList()
|
|
|
this.baseInfoForm.details = []
|
|
|
this.makePriceDataList()
|
|
@@ -856,17 +885,18 @@
|
|
|
this.getEditCheckList()
|
|
|
isValidate = this.validate()
|
|
|
if (isValidate) {
|
|
|
- purchasePriceEdit(this.baseInfoForm).toPromise().then((response) => {
|
|
|
- let that = this
|
|
|
- this.$confirm(`是否确定通过?`, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- }).then(() => {
|
|
|
+ let that = this
|
|
|
+ this.$confirm(`是否确定通过?`, {
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'warning',
|
|
|
+ }).then(() => {
|
|
|
+ purchasePriceEdit(this.baseInfoForm).toPromise().then((response) => {
|
|
|
//审核
|
|
|
that.audit(this.baseInfoForm, true, 2)
|
|
|
})
|
|
|
})
|
|
|
+
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
@@ -992,24 +1022,50 @@
|
|
|
if (_priceList[i].detailList[j] && _priceList[i].detailList[j].type != 4) {
|
|
|
if (_priceList[i].detailList[j].type != 1) {
|
|
|
let baseprice = ''
|
|
|
- if (j == index) {
|
|
|
- baseprice = parseFloat(_priceList[i].basicUnitPrice)
|
|
|
- } else {
|
|
|
- baseprice = parseFloat(parseFloat(_priceList[i].basicUnitPrice) + (parseFloat(_priceList[i].detailList[j + 2]
|
|
|
- .water) - parseFloat(_priceList[i].detailList[j].water)) / 0.1 * parseFloat(_priceList[i]
|
|
|
- .detailList[j + 1].jfprice))
|
|
|
+ if(this.baseInfoForm.paramType == '1'){
|
|
|
+ if (j == index) {
|
|
|
+ baseprice = parseFloat(_priceList[i].basicUnitPrice)
|
|
|
+ } else {
|
|
|
+ baseprice = parseFloat(parseFloat(_priceList[i].basicUnitPrice) + (parseFloat(_priceList[i].detailList[j + 2]
|
|
|
+ .water) - parseFloat(_priceList[i].detailList[j].water)) / 0.1 * (this.baseInfoForm.dryGrainPrice * (parseFloat(_priceList[i].detailList[j].water)
|
|
|
+ - parseFloat(_priceList[i].detailList[j - 2].water))*parseFloat(_priceList[i].detailList[j - 1].jfprice)/100/((parseFloat(_priceList[i].detailList[j].water)
|
|
|
+ - parseFloat(_priceList[i].detailList[j - 2].water))/0.1)))
|
|
|
+ }
|
|
|
+ _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(this.baseInfoForm.dryGrainPrice * (parseFloat(_priceList[i].detailList[j].water)
|
|
|
+ - parseFloat(_priceList[i].detailList[j - 2].water))*parseFloat(_priceList[i].detailList[j - 1].jfprice)/100/((parseFloat(_priceList[i].detailList[j].water)
|
|
|
+ - parseFloat(_priceList[i].detailList[j - 2].water))/0.1)),
|
|
|
+ baseprice: baseprice,
|
|
|
+ price: (parseFloat(_priceList[i].detailList[j].water) - parseFloat(_priceList[i].detailList[j -
|
|
|
+ 2].water)) / 0.1 * 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.1 * parseFloat(_priceList[i].detailList[j - 1].jfprice)
|
|
|
- })
|
|
|
+ else{
|
|
|
+ if (j == index) {
|
|
|
+ baseprice = parseFloat(_priceList[i].basicUnitPrice)
|
|
|
+ } else {
|
|
|
+ baseprice = parseFloat(parseFloat(_priceList[i].basicUnitPrice) + (parseFloat(_priceList[i].detailList[j + 2]
|
|
|
+ .water) - parseFloat(_priceList[i].detailList[j].water)) / 0.1 * 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.1 * parseFloat(_priceList[i].detailList[j - 1].jfprice)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1044,24 +1100,50 @@
|
|
|
if (_priceList[i].detailList[k] && _priceList[i].detailList[k].type != 4) {
|
|
|
if (_priceList[i].detailList[k].type != 3) {
|
|
|
let baseprice = ''
|
|
|
- if (k == index) {
|
|
|
- baseprice = parseFloat(_priceList[i].basicUnitPrice)
|
|
|
- } else {
|
|
|
- baseprice = parseFloat(parseFloat(_priceList[i].basicUnitPrice) - (parseFloat(_priceList[i].detailList[k]
|
|
|
- .water) - parseFloat(_priceList[i].detailList[k - 2].water)) / 0.1 * parseFloat(_priceList[i]
|
|
|
- .detailList[k - 1].jfprice))
|
|
|
+ if(this.baseInfoForm.paramType == '1'){
|
|
|
+ if (k == index) {
|
|
|
+ baseprice = parseFloat(_priceList[i].basicUnitPrice)
|
|
|
+ } else {
|
|
|
+ baseprice = parseFloat(parseFloat(_priceList[i].basicUnitPrice) - (parseFloat(_priceList[i].detailList[k]
|
|
|
+ .water) - parseFloat(_priceList[i].detailList[k - 2].water)) / 0.1 * (this.baseInfoForm.dryGrainPrice * (parseFloat(_priceList[i].detailList[k + 2].water) - parseFloat(_priceList[i].detailList[
|
|
|
+ k].water))*parseFloat(_priceList[i].detailList[k + 1].jfprice)/100/((parseFloat(_priceList[i].detailList[k + 2].water) - parseFloat(_priceList[i].detailList[
|
|
|
+ k].water))/0.1)))
|
|
|
+ }
|
|
|
+ _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(this.baseInfoForm.dryGrainPrice * (parseFloat(_priceList[i].detailList[k + 2].water) - parseFloat(_priceList[i].detailList[
|
|
|
+ k].water))*parseFloat(_priceList[i].detailList[k + 1].jfprice)/100/((parseFloat(_priceList[i].detailList[k + 2].water) - parseFloat(_priceList[i].detailList[
|
|
|
+ k].water))/0.1)),
|
|
|
+ baseprice: baseprice,
|
|
|
+ price: (parseFloat(_priceList[i].detailList[k + 2].water) - parseFloat(_priceList[i].detailList[
|
|
|
+ k].water)) / 0.1 * 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.1 * parseFloat(_priceList[i].detailList[k + 1].jfprice)
|
|
|
- })
|
|
|
+ else{
|
|
|
+ if (k == index) {
|
|
|
+ baseprice = parseFloat(_priceList[i].basicUnitPrice)
|
|
|
+ } else {
|
|
|
+ baseprice = parseFloat(parseFloat(_priceList[i].basicUnitPrice) - (parseFloat(_priceList[i].detailList[k]
|
|
|
+ .water) - parseFloat(_priceList[i].detailList[k - 2].water)) / 0.1 * 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.1 * parseFloat(_priceList[i].detailList[k + 1].jfprice)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|