|
@@ -109,9 +109,9 @@
|
|
|
<span @click='lookcustomer(scope.row)'>{{scope.row.customer}}</span>
|
|
|
</template>
|
|
|
</el-table-column> -->
|
|
|
- <el-table-column prop="goodsName" label="货名" width="50">
|
|
|
+ <el-table-column prop="goodsName" label="货名" width="120">
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column prop="inWarehouseWeight1" width="110" class="table_td" label="加权水分">
|
|
|
+ <el-table-column prop="inWarehouseWeight1" width="170" class="table_td" label="加权水分">
|
|
|
<template scope="scope">
|
|
|
<span v-if='scope.row.edit==false'>{{scope.row.weightedMoisture}}</span>
|
|
|
<el-input style='width:80%;' v-if='scope.row.edit' v-model='scope.row.weightedMoisture'></el-input>
|
|
@@ -120,7 +120,7 @@
|
|
|
<img v-if="!scope.row.edit" width="17" height="18" style="vertical-align: text-top; position: relative; top: -1px"
|
|
|
src="../../../public/img/edit.png" @click="editMoisture(scope.row)" alt="" />
|
|
|
</template>
|
|
|
- </el-table-column> -->
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="inWarehouseWeight1" width="110" class="table_td" label="入库重量">
|
|
|
<template scope="scope">
|
|
|
<span v-if='scope.row.weightedit==false&&scope.row.warehouseType==2||scope.row.warehouseType==1'>{{scope.row.inWarehouseWeight1}}</span>
|
|
@@ -361,7 +361,7 @@
|
|
|
</el-form-item>
|
|
|
<!-- <el-form-item label="折干前成本(元/吨)">
|
|
|
<el-input disabled placeholder="自动计算,不可编辑" v-model="fieldrationsList.beforeCost"></el-input>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item>-->
|
|
|
<el-form-item label="折干前仓位">
|
|
|
<el-select @focus="warehousefocus" @change="warehousechange" v-model="fieldrationsList.beforeBinNo" filterable placeholder="请选择">
|
|
|
<el-option
|
|
@@ -371,7 +371,7 @@
|
|
|
:value="item.binNumber">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- </el-form-item> -->
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="折干后重量(吨)">
|
|
|
<el-input @input="afterWeightchange" v-model="fieldrationsList.afterWeight"></el-input>
|
|
|
</el-form-item>
|
|
@@ -495,7 +495,8 @@
|
|
|
getposition,
|
|
|
dryout,
|
|
|
getenabledinfo,
|
|
|
- setenabledinfo
|
|
|
+ setenabledinfo,
|
|
|
+ getbyname
|
|
|
} from '@/model/warehouse/index'
|
|
|
import {
|
|
|
selectWarehouseSelf,
|
|
@@ -871,6 +872,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
},
|
|
|
editMoisture(row){
|
|
|
row.edit=true
|
|
|
+ this.$forceUpdate()
|
|
|
},
|
|
|
changeWeight(row){
|
|
|
if(row.inWarehouseWeight1<row.outWarehouseWeight){
|
|
@@ -901,7 +903,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- this.$confirm('确定提交入库重量?', {
|
|
|
+ this.$confirm('确定提交加权水分?', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning',
|
|
@@ -1052,10 +1054,8 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(array.length>0){
|
|
|
- currectData=array
|
|
|
- }
|
|
|
}
|
|
|
+ currectData=arr
|
|
|
if(currectData.length==0){
|
|
|
this.$message({
|
|
|
message: '请选择一条数据!',
|
|
@@ -1065,9 +1065,23 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
}
|
|
|
// console.log(arr1)
|
|
|
|
|
|
+
|
|
|
+ let map = new Map();
|
|
|
+ for (let item of currectData) {
|
|
|
+ map.set(item.goodsName, item);
|
|
|
+ }
|
|
|
+
|
|
|
+ var data = [...map.values()];
|
|
|
+ if(data.length>1){
|
|
|
+ this.$message({
|
|
|
+ message: '请选择同一个货名的数据进行折干!',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
if(arr3.length>1){
|
|
|
this.$message({
|
|
|
- message: '请选择一个仓库的数据进行折干!',
|
|
|
+ message: '请选择同一个仓库的数据进行折干!',
|
|
|
type: 'warning'
|
|
|
});
|
|
|
return
|
|
@@ -1075,6 +1089,13 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
// console.log(currectData)
|
|
|
var arr1=currectData
|
|
|
for (let i = 0; i < arr1.length; i++) {
|
|
|
+ if(arr1[i].warehouseType!=1){
|
|
|
+ this.$message({
|
|
|
+ message: '请选择常用库潮粮进行折干!',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
if(arr1[i].goodsName.indexOf('潮粮')==-1){
|
|
|
this.$message({
|
|
|
message: '只有潮粮可以折干!',
|
|
@@ -1082,21 +1103,41 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+ if(!arr1[i].weightedMoisture||arr1[i].weightedMoisture<14){
|
|
|
+ this.$message({
|
|
|
+ message: '加权水分不可小于干粮水分!',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
// _this.dialogTitle=arr1[i].contractNo
|
|
|
}
|
|
|
var weight=0
|
|
|
- for (let i = 0; i < this.currectdata.length; i++) {
|
|
|
- weight+=this.currectdata[i].surplusWeight
|
|
|
-
|
|
|
+ var weight2=0
|
|
|
+ for (let i = 0; i < arr1.length; i++) {
|
|
|
+ console.log(arr1[i].surplusWeight)
|
|
|
+ weight+=arr1[i].surplusWeight
|
|
|
}
|
|
|
// this.currectdata=item
|
|
|
this.currectdata=arr1
|
|
|
this.fieldrationsList.warehousingOrderList=this.currectdata
|
|
|
this.fieldrationsList.baseId=this.currectdata[0].baseId
|
|
|
this.fieldrationsList.beforeWeight=weight
|
|
|
+ getbyname({warehouseId:this.currectdata[0].baseId,goodsName:this.currectdata[0].goodsName}).toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ if(response){
|
|
|
+ for (let i = 0; i < this.currectdata.length; i++) {
|
|
|
+ var weightedMoisture=(this.currectdata[i].weightedMoisture-14)
|
|
|
+ var deductWeight=100-(weightedMoisture*response.deductWeight)
|
|
|
+ // console.log(deductWeight,111111111)
|
|
|
+ weight2+=((deductWeight/100)*this.currectdata[i].surplusWeight)
|
|
|
+ }
|
|
|
+ this.fieldrationsList.afterWeight=weight2.toFixed(2)
|
|
|
+ this.fieldrationsshow=true
|
|
|
+ }
|
|
|
+ })
|
|
|
// this.fieldrationsList.beforeCost=this.currectdata[0].avgCost
|
|
|
- this.fieldrationsshow=true
|
|
|
+
|
|
|
},
|
|
|
distribution(){
|
|
|
let _this= this
|