|
|
@@ -33,7 +33,12 @@
|
|
|
label="cname"
|
|
|
res="records"
|
|
|
:url="
|
|
|
- '/blade-sales-part/reservoirarea/listZero?current=1&size=5&storageId=' + form.storageId + '&goodsId=' + query.goodsId + '&dot=' + (query.dot?query.dot:'')
|
|
|
+ '/blade-sales-part/reservoirarea/listZero?current=1&size=5&storageId=' +
|
|
|
+ form.storageId +
|
|
|
+ '&goodsId=' +
|
|
|
+ query.goodsId +
|
|
|
+ '&dot=' +
|
|
|
+ (query.dot ? query.dot : '')
|
|
|
"
|
|
|
:filterable="true"
|
|
|
:remote="true"
|
|
|
@@ -43,7 +48,7 @@
|
|
|
></dic-select>
|
|
|
</template>
|
|
|
<template slot="quantity" slot-scope="{ row }">
|
|
|
- <el-input-number v-model="row.quantity" size="small" :controls="false" style="width: 100%" :disabled="disabled" @change="qtyChange(row)"/>
|
|
|
+ <el-input-number v-model="row.quantity" size="small" :controls="false" style="width: 100%" :disabled="disabled" @change="qtyChange(row)" />
|
|
|
</template>
|
|
|
<template slot-scope="{ row, index }" slot="menu">
|
|
|
<el-button icon="el-icon-delete" :disabled="disabled" size="small" type="text" @click="rowDel(row, index)">删除 </el-button>
|
|
|
@@ -95,12 +100,12 @@ export default {
|
|
|
prop: "reservoirAreaName",
|
|
|
overHidden: true
|
|
|
},
|
|
|
- {
|
|
|
+ {
|
|
|
label: "库存",
|
|
|
prop: "balanceQuantity",
|
|
|
overHidden: true
|
|
|
},
|
|
|
- {
|
|
|
+ {
|
|
|
label: "盈亏数量",
|
|
|
prop: "profitLossNum",
|
|
|
overHidden: true
|
|
|
@@ -129,12 +134,15 @@ export default {
|
|
|
itemRemove({ ids: row.id }).then(res => {
|
|
|
this.data.splice(index, 1);
|
|
|
let sum = 0;
|
|
|
+ let profitLossNumSum = 0;
|
|
|
for (let item of this.data) {
|
|
|
sum += Number(item.quantity);
|
|
|
+ profitLossNumSum += Number(item.profitLossNum ? item.profitLossNum : 0);
|
|
|
}
|
|
|
let obj = {
|
|
|
...this.query,
|
|
|
sendNum: sum,
|
|
|
+ profitLossNum: profitLossNumSum,
|
|
|
historyList: this.data
|
|
|
};
|
|
|
this.$emit("areaData", obj, this.index);
|
|
|
@@ -144,12 +152,15 @@ export default {
|
|
|
this.data.splice(index, 1);
|
|
|
if (this.query.historyList.length) {
|
|
|
let sum = 0;
|
|
|
+ let profitLossNumSum = 0;
|
|
|
for (let item of this.data) {
|
|
|
sum += Number(item.quantity);
|
|
|
+ profitLossNumSum += Number(item.profitLossNum ? item.profitLossNum : 0);
|
|
|
}
|
|
|
let obj = {
|
|
|
...this.query,
|
|
|
sendNum: sum,
|
|
|
+ profitLossNum: profitLossNumSum,
|
|
|
historyList: this.data
|
|
|
};
|
|
|
this.$emit("areaData", obj, this.index);
|
|
|
@@ -178,8 +189,8 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- qtyChange(row){
|
|
|
- row.profitLossNum=Number(row.quantity)-Number(row.balanceQuantity)
|
|
|
+ qtyChange(row) {
|
|
|
+ row.profitLossNum = Number(row.quantity) - Number(row.balanceQuantity);
|
|
|
},
|
|
|
openDialog(form, row, index) {
|
|
|
this.form = {};
|
|
|
@@ -194,7 +205,7 @@ export default {
|
|
|
},
|
|
|
submit() {
|
|
|
let sum = 0;
|
|
|
- let profitLossNumSum=0;
|
|
|
+ let profitLossNumSum = 0;
|
|
|
for (let item of this.data) {
|
|
|
if (!item.reservoirAreaId) {
|
|
|
return this.$message.error("请选择库区");
|
|
|
@@ -203,15 +214,15 @@ export default {
|
|
|
return this.$message.error("本次数量不能为0");
|
|
|
}
|
|
|
sum += Number(item.quantity);
|
|
|
- profitLossNumSum+=Number(item.profitLossNum?item.profitLossNum:0);
|
|
|
+ profitLossNumSum += Number(item.profitLossNum ? item.profitLossNum : 0);
|
|
|
}
|
|
|
- if(Number(profitLossNumSum)==0){
|
|
|
+ if (Number(profitLossNumSum) == 0) {
|
|
|
return this.$message.error("盈亏数量的总数不能为零");
|
|
|
}
|
|
|
let obj = {
|
|
|
...this.query,
|
|
|
sendNum: sum,
|
|
|
- profitLossNum:profitLossNumSum,
|
|
|
+ profitLossNum: profitLossNumSum,
|
|
|
historyList: this.data
|
|
|
};
|
|
|
this.$emit("areaData", obj, this.index);
|