<el-table-column prop="skuDeliveryNum" align="center" label="本次发货数量" min-width="110">
<template slot-scope="scope">
<el-input maxlength="50" v-model="scope.row.skuDeliveryNum" placeholder="请输入" :max="scope.row.skuLeftNum"
@blur="changeNun(scope.row)"
@input="scope.row.skuDeliveryNum = scope.row.skuDeliveryNum.replace(/[^0-9]/g, ‘‘);">
</el-input>
</template>
</el-table-column>
@input="scope.row.skuDeliveryNum = scope.row.skuDeliveryNum.replace(/[^0-9]/g, ‘‘);"> 不允许输入数字以外的字符
//发货数量判断
changeNun(num) {
if (event.target.value > num.skuLeftNum) {
this.$nextTick(()=>{
num.skuDeliveryNum = num.skuLeftNum
})
this.$message.error(‘发货数量不能大于剩余数量‘);
} else if (event.target.value == ‘‘ || event.target.value == null) {
this.$nextTick(()=>{
num.skuDeliveryNum = 1
})
}
},
this.$nextTick(()=>{ }) //用这个方法去刷新视图和数据