食品管理添加用餐类型字段
This commit is contained in:
parent
6bd7ea834f
commit
150676a9ad
@ -43,7 +43,8 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['fantang:food:add']"
|
v-hasPermi="['fantang:food:add']"
|
||||||
>新增</el-button>
|
>新增
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -53,7 +54,8 @@
|
|||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
v-hasPermi="['fantang:food:edit']"
|
v-hasPermi="['fantang:food:edit']"
|
||||||
>修改</el-button>
|
>修改
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -63,7 +65,8 @@
|
|||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['fantang:food:remove']"
|
v-hasPermi="['fantang:food:remove']"
|
||||||
>删除</el-button>
|
>删除
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -72,7 +75,8 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['fantang:food:export']"
|
v-hasPermi="['fantang:food:export']"
|
||||||
>导出</el-button>
|
>导出
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -82,6 +86,7 @@
|
|||||||
<el-table-column label="食品id" align="center" prop="foodId" v-if="false"/>
|
<el-table-column label="食品id" align="center" prop="foodId" v-if="false"/>
|
||||||
<el-table-column label="食品名称" align="center" prop="name"/>
|
<el-table-column label="食品名称" align="center" prop="name"/>
|
||||||
<el-table-column label="售价" align="center" prop="price"/>
|
<el-table-column label="售价" align="center" prop="price"/>
|
||||||
|
<el-table-column label="用餐类型" align="center" prop="dinnerType" :formatter="dinnerTypeFormat"/>
|
||||||
<el-table-column label="食品分类" align="center" prop="type" :formatter="typeFormat"/>
|
<el-table-column label="食品分类" align="center" prop="type" :formatter="typeFormat"/>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -91,14 +96,16 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['fantang:food:edit']"
|
v-hasPermi="['fantang:food:edit']"
|
||||||
>修改</el-button>
|
>修改
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['fantang:food:remove']"
|
v-hasPermi="['fantang:food:remove']"
|
||||||
>删除</el-button>
|
>删除
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -123,6 +130,16 @@
|
|||||||
<el-form-item label="售价" prop="price">
|
<el-form-item label="售价" prop="price">
|
||||||
<el-input v-model="form.price" placeholder="请输入售价"/>
|
<el-input v-model="form.price" placeholder="请输入售价"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="用餐类型" prop="dinnerType">
|
||||||
|
<el-select v-model="form.dinnerType" placeholder="请选择用餐类型">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dinnerTypeOptions"
|
||||||
|
:key="dict.dictValue"
|
||||||
|
:label="dict.dictLabel"
|
||||||
|
:value="parseInt(dict.dictValue)"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="食品分类" prop="type">
|
<el-form-item label="食品分类" prop="type">
|
||||||
<el-select v-model="form.type" placeholder="请选择食品分类">
|
<el-select v-model="form.type" placeholder="请选择食品分类">
|
||||||
<el-option
|
<el-option
|
||||||
@ -143,7 +160,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listFood, getFood, delFood, addFood, updateFood, exportFood } from "@/api/fantang/food";
|
import {addFood, delFood, exportFood, getFood, listFood, updateFood} from "@/api/fantang/food";
|
||||||
import UploadImage from '@/components/UploadImage';
|
import UploadImage from '@/components/UploadImage';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -153,6 +170,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
dinnerTypeOptions: [],
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
@ -202,6 +220,9 @@ export default {
|
|||||||
this.getDicts("ft_food_type").then(response => {
|
this.getDicts("ft_food_type").then(response => {
|
||||||
this.typeOptions = response.data;
|
this.typeOptions = response.data;
|
||||||
});
|
});
|
||||||
|
this.getDicts("ft_book_type").then(response => {
|
||||||
|
this.dinnerTypeOptions = response.data;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询食品管理列表 */
|
/** 查询食品管理列表 */
|
||||||
@ -213,6 +234,10 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 用餐类型
|
||||||
|
dinnerTypeFormat(row) {
|
||||||
|
return this.selectDictLabel(this.dinnerTypeOptions, row.dinnerType);
|
||||||
|
},
|
||||||
// 食品分类字典翻译
|
// 食品分类字典翻译
|
||||||
typeFormat(row, column) {
|
typeFormat(row, column) {
|
||||||
return this.selectDictLabel(this.typeOptions, row.type);
|
return this.selectDictLabel(this.typeOptions, row.type);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user