食谱计划生成时更新天数,食谱暂停限制范围,不能添加上月日期

This commit is contained in:
xiezhijun 2021-03-25 18:54:29 +08:00
parent 56bcd16126
commit f937285895
2 changed files with 9 additions and 8 deletions

View File

@ -181,13 +181,12 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
List<Long> delList = new ArrayList<>(); List<Long> delList = new ArrayList<>();
for (SysRecipesPlan plan : oldRecipesPlanList) { for (SysRecipesPlan plan : oldRecipesPlanList) {
if(index < newSize){ if(index < newSize){
if(plan.getStartDate().compareTo(newRecipesPlanList.get(index).getStartDate()) != 0
|| plan.getEndDate().compareTo(newRecipesPlanList.get(index).getEndDate()) != 0){
plan.setStartDate(newRecipesPlanList.get(index).getStartDate()); plan.setStartDate(newRecipesPlanList.get(index).getStartDate());
plan.setEndDate(newRecipesPlanList.get(index).getEndDate()); plan.setEndDate(newRecipesPlanList.get(index).getEndDate());
plan.setPauseDate(newRecipesPlanList.get(index).getPauseDate()); plan.setPauseDate(newRecipesPlanList.get(index).getPauseDate());
plan.setStartNumDay(plan.getStartNumDay());
plan.setEndNumDay(plan.getEndNumDay());
updateList.add(plan); updateList.add(plan);
}
}else{ }else{
delList.add(plan.getId()); delList.add(plan.getId());
} }

View File

@ -137,6 +137,7 @@
end-placeholder="结束日期" end-placeholder="结束日期"
format="yyyy-MM-dd" format="yyyy-MM-dd"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
:picker-options="orderPickerOptions"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -233,7 +234,8 @@ export default {
}, },
orderPickerOptions: { orderPickerOptions: {
disabledDate(time) { disabledDate(time) {
return time.getTime() < Date.now() - 24 * 60 * 60 * 1000; //
return time.getTime() < dayjs().startOf('month').valueOf()
}, },
}, },
}; };