菜谱优化
This commit is contained in:
parent
bdf353e6b8
commit
35e47bc019
|
|
@ -181,12 +181,12 @@
|
|||
<el-table-column label="菜品类别" align="center" prop="dishesTypeName"></el-table-column>
|
||||
<el-table-column label="当餐售价" align="center" prop="price">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.price" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.price=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/>
|
||||
<el-input v-model="scope.row.price" placeholder="请输入" maxlength="10" clearable @change="patternValue(scope.row)" @input="(v)=>(scope.row.price=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当餐优惠价" align="center" prop="salePrice">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.salePrice" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.salePrice=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/>
|
||||
<el-input v-model="scope.row.salePrice" placeholder="请输入" maxlength="10" clearable @change="patternValue(scope.row)" @input="(v)=>(scope.row.salePrice=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最大供应量" align="center" prop="supplyNum">
|
||||
|
|
@ -1885,6 +1885,17 @@ export default {
|
|||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
//price salePrice
|
||||
patternValue(row){
|
||||
if(row.price&&row.salePrice){
|
||||
console.log(111)
|
||||
setTimeout(()=>{
|
||||
if(Number(row.salePrice)>=(Number(row.price))){
|
||||
row.salePrice = Number(row.price)
|
||||
}
|
||||
},200)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -180,12 +180,12 @@
|
|||
<el-table-column label="菜品类别" align="center" prop="dishesTypeName"></el-table-column>
|
||||
<el-table-column label="当餐售价" align="center" prop="price">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.price" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.price=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/>
|
||||
<el-input v-model="scope.row.price" placeholder="请输入" maxlength="10" clearable @change="patternValue(scope.row)" @input="(v)=>(scope.row.price=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当餐优惠价" align="center" prop="salePrice">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.salePrice" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.salePrice=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/>
|
||||
<el-input v-model="scope.row.salePrice" placeholder="请输入" maxlength="10" clearable @change="patternValue(scope.row)" @input="(v)=>(scope.row.salePrice=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最大供应量" align="center" prop="supplyNum">
|
||||
|
|
@ -2111,6 +2111,17 @@ export default {
|
|||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
//price salePrice
|
||||
patternValue(row){
|
||||
if(row.price&&row.salePrice){
|
||||
console.log(111)
|
||||
setTimeout(()=>{
|
||||
if(Number(row.salePrice)>=(Number(row.price))){
|
||||
row.salePrice = Number(row.price)
|
||||
}
|
||||
},200)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue