修复创建模板问题
This commit is contained in:
@ -2,7 +2,7 @@ import request from "@/utils/request";
|
||||
|
||||
export function addRecipesApi(data) {
|
||||
return request({
|
||||
url: "/custom/recipes/",
|
||||
url: "/custom/recipes",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
|
@ -259,9 +259,7 @@ const actions = {
|
||||
dispatch("getRecipesInfo", { recipesId });
|
||||
payload.callback &&
|
||||
payload.callback({
|
||||
recipesId: result.data,
|
||||
name: state.healthyData.name,
|
||||
cusId: state.cusId,
|
||||
planId: state.planId
|
||||
});
|
||||
}
|
||||
|
@ -72,7 +72,9 @@
|
||||
import BarChart from "./BarChart";
|
||||
import PieChart from "./PieChart";
|
||||
import { createNamespacedHelpers } from "vuex";
|
||||
const { mapActions, mapState } = createNamespacedHelpers("recipes");
|
||||
const { mapActions, mapState, mapMutations } = createNamespacedHelpers(
|
||||
"recipes"
|
||||
);
|
||||
export default {
|
||||
name: "RecipesAspectCom",
|
||||
components: {
|
||||
@ -96,8 +98,10 @@ export default {
|
||||
handleOnSave() {
|
||||
this.saveRecipes({
|
||||
callback: (query) => {
|
||||
console.log(query);
|
||||
this.$router.replace({ path: "/recipes/build", query });
|
||||
// console.log(query);
|
||||
this.$router.replace({
|
||||
path: "/recipes/build/" + query.name + "/" + query.planId,
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
@ -105,9 +109,10 @@ export default {
|
||||
this.updateReviewStatus({ reviewStatus });
|
||||
},
|
||||
handleOnBack() {
|
||||
this.updateReviewStatus({ recipesData: [] });
|
||||
this.updateStateData({ recipesData: [] });
|
||||
},
|
||||
...mapActions(["saveRecipes", "updateReviewStatus"]),
|
||||
...mapMutations(["updateStateData"]),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -430,6 +430,7 @@ export default {
|
||||
submitForm() {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.form.cusId = 0;
|
||||
if (this.form.id != null) {
|
||||
updateRecipesTemplate(this.form).then((response) => {
|
||||
if (response.code === 200) {
|
||||
|
Reference in New Issue
Block a user