刷新食谱计划

This commit is contained in:
xiezhijun
2021-07-03 17:27:39 +08:00
parent a9b69cd1a5
commit 6be196d27f
3 changed files with 50 additions and 0 deletions

View File

@ -49,3 +49,11 @@ export function listRecipesPlanByCusId(id) {
method: "get"
});
}
export function refreshRecipesPlan(cusId){
return request({
url: "/recipes/recipesPlan/refreshRecipesPlan",
method: "get",
params: {"cusId": cusId}
});
}

View File

@ -46,6 +46,14 @@
>
生成7天体验计划
</el-button>
<el-button
size="mini"
type="primary"
v-hasPermi="['recipes:plan:refresh']"
@click="refreshRecipesPlan()"
>
刷新食谱计划
</el-button>
</section>
<section>
<el-button
@ -154,6 +162,7 @@ import {
listRecipesPlanByCusId,
addRecipesPlan,
updateRecipesPlan,
refreshRecipesPlan
} from "@/api/custom/recipesPlan";
import PlanPauseDrawer from "./PlanPauseDrawer";
import VueQr from "vue-qr";
@ -188,6 +197,7 @@ export default {
return time.getTime() < Date.now() - 24 * 60 * 60 * 1000;
},
},
refreshFlag: false
};
},
methods: {
@ -223,6 +233,25 @@ export default {
this.planLoading = false;
});
},
refreshRecipesPlan(){
if(this.refreshFlag){
//请勿重复刷新
this.$message.error("请勿重复刷新,十秒后重试");
return;
}else{
this.refreshFlag = true;
}
refreshRecipesPlan(this.data.id).then((response) => {
//十秒之后刷新页面
this.$message.success("正在刷新,大概需要十秒");
});
var self = this;
let t = setTimeout(function(){
self.getList();
self.$message.success("食谱计划刷新成功");
self.refreshFlag = false;
}, 10000);
},
reset() {
this.form = {
startDate: null,