|
|
@@ -32,7 +32,9 @@
|
|
|
placeholder="库区"
|
|
|
label="cname"
|
|
|
res="records"
|
|
|
- :url="'/blade-sales-part/reservoirarea/list?current=1&size=5&storageId=' + form.storageId"
|
|
|
+ :url="
|
|
|
+ '/blade-sales-part/reservoirarea/listZero?current=1&size=5&storageId=' + form.storageId + '&goodsId=' + query.goodsId + '&dot=' + (query.dot?query.dot:'')
|
|
|
+ "
|
|
|
:filterable="true"
|
|
|
:remote="true"
|
|
|
dataName="cname"
|
|
|
@@ -41,7 +43,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" />
|
|
|
+ <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>
|
|
|
@@ -93,6 +95,16 @@ export default {
|
|
|
prop: "reservoirAreaName",
|
|
|
overHidden: true
|
|
|
},
|
|
|
+ {
|
|
|
+ label: "库存",
|
|
|
+ prop: "balanceQuantity",
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "盈亏数量",
|
|
|
+ prop: "profitLossNum",
|
|
|
+ overHidden: true
|
|
|
+ },
|
|
|
{
|
|
|
label: "本次数量",
|
|
|
prop: "quantity",
|
|
|
@@ -166,6 +178,9 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ qtyChange(row){
|
|
|
+ row.profitLossNum=Number(row.quantity)-Number(row.balanceQuantity)
|
|
|
+ },
|
|
|
openDialog(form, row, index) {
|
|
|
this.form = {};
|
|
|
this.query = {};
|
|
|
@@ -179,6 +194,7 @@ export default {
|
|
|
},
|
|
|
submit() {
|
|
|
let sum = 0;
|
|
|
+ let profitLossNumSum=0;
|
|
|
for (let item of this.data) {
|
|
|
if (!item.reservoirAreaId) {
|
|
|
return this.$message.error("请选择库区");
|
|
|
@@ -187,10 +203,15 @@ export default {
|
|
|
return this.$message.error("本次数量不能为0");
|
|
|
}
|
|
|
sum += Number(item.quantity);
|
|
|
+ profitLossNumSum+=Number(item.profitLossNum?item.profitLossNum:0);
|
|
|
+ }
|
|
|
+ if(Number(profitLossNumSum)==0){
|
|
|
+ return this.$message.error("盈亏数量的总数不能为零");
|
|
|
}
|
|
|
let obj = {
|
|
|
...this.query,
|
|
|
sendNum: sum,
|
|
|
+ profitLossNum:profitLossNumSum,
|
|
|
historyList: this.data
|
|
|
};
|
|
|
this.$emit("areaData", obj, this.index);
|