菜谱优化
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="dishesTypeName"></el-table-column>
|
||||||
<el-table-column label="当餐售价" align="center" prop="price">
|
<el-table-column label="当餐售价" align="center" prop="price">
|
||||||
<template slot-scope="scope">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="当餐优惠价" align="center" prop="salePrice">
|
<el-table-column label="当餐优惠价" align="center" prop="salePrice">
|
||||||
<template slot-scope="scope">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="最大供应量" align="center" prop="supplyNum">
|
<el-table-column label="最大供应量" align="center" prop="supplyNum">
|
||||||
|
|
@ -1885,7 +1885,18 @@ export default {
|
||||||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
|
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
|
||||||
const day = String(date.getDate()).padStart(2, '0');
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
return `${year}-${month}-${day}`;
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -180,12 +180,12 @@
|
||||||
<el-table-column label="菜品类别" align="center" prop="dishesTypeName"></el-table-column>
|
<el-table-column label="菜品类别" align="center" prop="dishesTypeName"></el-table-column>
|
||||||
<el-table-column label="当餐售价" align="center" prop="price">
|
<el-table-column label="当餐售价" align="center" prop="price">
|
||||||
<template slot-scope="scope">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="当餐优惠价" align="center" prop="salePrice">
|
<el-table-column label="当餐优惠价" align="center" prop="salePrice">
|
||||||
<template slot-scope="scope">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="最大供应量" align="center" prop="supplyNum">
|
<el-table-column label="最大供应量" align="center" prop="supplyNum">
|
||||||
|
|
@ -2111,7 +2111,18 @@ export default {
|
||||||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
|
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
|
||||||
const day = String(date.getDate()).padStart(2, '0');
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
return `${year}-${month}-${day}`;
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue