菜品增删查改对接
This commit is contained in:
@ -4,6 +4,9 @@
|
||||
:style="`height: ${collapse ? 30 : 200}px`"
|
||||
>
|
||||
<div class="header">
|
||||
<el-button size="mini" type="primary" @click="handleOnSave"
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button size="mini" type="text" @click="handleCollapseClick">{{
|
||||
`${collapse ? "展开分析" : "收起分析"}`
|
||||
}}</el-button>
|
||||
@ -25,6 +28,8 @@
|
||||
<script>
|
||||
import BarChart from "./BarChart";
|
||||
import PieChart from "./PieChart";
|
||||
import { createNamespacedHelpers } from "vuex";
|
||||
const { mapActions } = createNamespacedHelpers("recipes");
|
||||
export default {
|
||||
name: "RecipesAspectCom",
|
||||
components: {
|
||||
@ -43,6 +48,10 @@ export default {
|
||||
handleCollapseClick() {
|
||||
this.$emit("update:collapse", !this.collapse);
|
||||
},
|
||||
handleOnSave() {
|
||||
this.saveRecipes();
|
||||
},
|
||||
...mapActions(["saveRecipes"]),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -18,7 +18,9 @@
|
||||
}}</span>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<span style="font-weight: bold; font-size: 14px">{{ typeFormatter(scope.row) }}</span>
|
||||
<span style="font-weight: bold; font-size: 14px">{{
|
||||
typeFormatter(scope.row)
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="菜品" prop="name" align="center">
|
||||
@ -270,11 +272,11 @@ export default {
|
||||
},
|
||||
handleOnDelete(data) {
|
||||
// console.log(data);
|
||||
this.deleteSomeDayDishes({ num: this.num - 1, dishesId: data.id });
|
||||
this.deleteDishes({ num: this.num - 1, dishesId: data.id });
|
||||
},
|
||||
handleOnWeightChange(data, weight) {
|
||||
// console.log({ data, weight });
|
||||
this.updateRecipesDishesDetail({
|
||||
this.updateDishes({
|
||||
num: this.num - 1,
|
||||
dishesId: data.id,
|
||||
igdId: data.igdId,
|
||||
@ -282,7 +284,7 @@ export default {
|
||||
});
|
||||
},
|
||||
handleOnCustomUnitChange(data, { cusWeight, cusUnit }) {
|
||||
this.updateRecipesDishesDetail({
|
||||
this.updateDishes({
|
||||
num: this.num - 1,
|
||||
dishesId: data.id,
|
||||
igdId: data.igdId,
|
||||
@ -291,17 +293,13 @@ export default {
|
||||
});
|
||||
},
|
||||
handleOnDishesConfirm(data) {
|
||||
this.addRecipesDishes({
|
||||
this.addDishes({
|
||||
num: this.num - 1,
|
||||
data,
|
||||
});
|
||||
},
|
||||
...mapMutations([
|
||||
"setCurrentDay",
|
||||
"deleteSomeDayDishes",
|
||||
"updateRecipesDishesDetail",
|
||||
"addRecipesDishes",
|
||||
]),
|
||||
...mapActions(["updateDishes", "addDishes", "deleteDishes"]),
|
||||
...mapMutations(["setCurrentDay",]),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user