优化-增加商品添加时数字输入框如果输入值超范围时重置数据的弹窗提醒
This commit is contained in:
@@ -88,7 +88,7 @@
|
||||
<el-table :data="form.skuList" border>
|
||||
<el-table-column label="售价" prop="salePrice">
|
||||
<template v-slot="scope">
|
||||
<el-input-number :min="0" @change="priceFormat(scope.row,'salePrice')" @blur="priceFormat(scope.row,'salePrice')" v-model="scope.row.salePrice" controls-position="right"></el-input-number>
|
||||
<el-input-number @change="priceFormat(scope.row,'salePrice')" @blur="priceFormat(scope.row,'salePrice')" v-model="scope.row.salePrice" controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="会员价" prop="memberPrice">
|
||||
@@ -519,8 +519,23 @@ export default {
|
||||
methods: {
|
||||
|
||||
priceFormat(item,key){
|
||||
const messageheight=48;
|
||||
const offset=window.innerHeight/2-(messageheight/2) -100
|
||||
this.$nextTick(()=>{
|
||||
item[key]=formatPrice(item[key],0,100000000)
|
||||
const min=0;
|
||||
const max=100000000;
|
||||
const newval=formatPrice(item[key],min,max,true)
|
||||
console.log(newval)
|
||||
if(typeof newval!=='number'){
|
||||
item[key]=newval.value
|
||||
this.$message({
|
||||
offset,
|
||||
message: `请输入${min}到${max}范围内的数字`,
|
||||
type: "error"
|
||||
});
|
||||
}else{
|
||||
item[key]=newval
|
||||
}
|
||||
})
|
||||
},
|
||||
// 删除分组商品
|
||||
|
||||
Reference in New Issue
Block a user