|
@@ -91,7 +91,8 @@
|
|
|
</template>
|
|
|
|
|
|
<template slot="goodsNum" slot-scope="{ row }">
|
|
|
- <el-input v-if="!mingxibaocun" size="small" v-model="row.goodsNum" style="width: 100%"></el-input>
|
|
|
+ <el-input v-if="!mingxibaocun" size="small" v-model="row.goodsNum" style="width: 100%"
|
|
|
+ @blur="goodsNumblurfun(row)"></el-input>
|
|
|
<span v-else>{{ row.goodsNum }}</span>
|
|
|
</template>
|
|
|
<template slot="price" slot-scope="{ row }">
|
|
@@ -99,7 +100,8 @@
|
|
|
<span v-else>{{ row.price }}</span>
|
|
|
</template>
|
|
|
<template slot="dot" slot-scope="{ row }">
|
|
|
- <el-select v-if="!mingxibaocun && row.whether=='1'" v-model="row.dot" filterable default-first-option @focus="picihaolistfun(row.goodsId)">
|
|
|
+ <el-select v-if="!mingxibaocun && row.whether=='1'" v-model="row.dot" filterable default-first-option
|
|
|
+ @focus="picihaolistfun(row.goodsId)" @change="dotchangefun($event,row)">
|
|
|
<el-option v-for="(item, index) in picihaolist" :key="index" :label="item.dot"
|
|
|
:value="item.dot"></el-option>
|
|
|
</el-select>
|
|
@@ -225,7 +227,9 @@
|
|
|
<!--本例还使用了default-first-option属性, 在该属性打开的情况下,按下回车就可以选中当前选项列表中的第一个选项,-->
|
|
|
<!--无需使用鼠标或键盘方向键进行定位。-->
|
|
|
<!--allow-create filterable default-first-option-->
|
|
|
- <el-select v-model="row.dot" filterable default-first-option @focus="picihaolistfun(row.id)">
|
|
|
+ <el-select v-model="row.dot" filterable default-first-option
|
|
|
+ @focus="picihaolistfun(row.id)"
|
|
|
+ @change="dotchangefun($event,row)">
|
|
|
<el-option v-for="(item, index) in picihaolist" :key="index" :label="item.dot"
|
|
|
:value="item.dot"></el-option>
|
|
|
</el-select>
|
|
@@ -676,6 +680,13 @@ export default {
|
|
|
disabled: false,
|
|
|
remote: true,
|
|
|
overHidden: true,
|
|
|
+ },{
|
|
|
+ label: '库存',
|
|
|
+ prop: 'inventory',
|
|
|
+ width: 250,
|
|
|
+ disabled: false,
|
|
|
+ remote: true,
|
|
|
+ overHidden: true,
|
|
|
}, {
|
|
|
label: '数量',
|
|
|
prop: 'goodsNum',
|
|
@@ -1408,6 +1419,21 @@ export default {
|
|
|
this.picihaolist = res.data.data
|
|
|
})
|
|
|
},
|
|
|
+ // 批次号切换库存
|
|
|
+ dotchangefun(value,row){
|
|
|
+ for (let item of this.picihaolist) {
|
|
|
+ if (item.dot == value) {
|
|
|
+ this.$set(row,'inventory',item.balanceQuantity)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 数量失焦触发
|
|
|
+ goodsNumblurfun(row){
|
|
|
+ if (Number(row.goodsNum) > Number(row.inventory)) {
|
|
|
+ this.$message.warning("不能大于库存数量");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
|
|
|
editBtn(row, index) {
|