1、完善每周菜谱功能,用户不能添加和删除
2、列表中增加合并列显示效果 3、增加菜品列表
This commit is contained in:
parent
bac94b2f03
commit
e3c0bc3c5c
@ -7,6 +7,7 @@ import com.ruoyi.common.core.controller.BaseController;
|
|||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.system.fantang.domain.FtWeekMenuDao;
|
import com.ruoyi.system.fantang.domain.FtWeekMenuDao;
|
||||||
import com.ruoyi.system.fantang.service.IFtWeekMenuDaoService;
|
import com.ruoyi.system.fantang.service.IFtWeekMenuDaoService;
|
||||||
@ -38,31 +39,21 @@ public class FtWeekMenuDaoController extends BaseController {
|
|||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(FtWeekMenuDao ftWeekMenuDao) {
|
public TableDataInfo list(FtWeekMenuDao ftWeekMenuDao) {
|
||||||
startPage();
|
startPage();
|
||||||
LambdaQueryWrapper<FtWeekMenuDao> lqw = Wrappers.lambdaQuery(ftWeekMenuDao);
|
List<FtWeekMenuDao> list = iFtWeekMenuDaoService.list(null);
|
||||||
if (ftWeekMenuDao.getDinnerType() != null) {
|
|
||||||
lqw.eq(FtWeekMenuDao::getDinnerType, ftWeekMenuDao.getDinnerType());
|
|
||||||
}
|
|
||||||
if (ftWeekMenuDao.getWeekday() != null) {
|
|
||||||
lqw.eq(FtWeekMenuDao::getWeekday, ftWeekMenuDao.getWeekday());
|
|
||||||
}
|
|
||||||
if (ftWeekMenuDao.getFlag() != null) {
|
|
||||||
lqw.eq(FtWeekMenuDao::getFlag, ftWeekMenuDao.getFlag());
|
|
||||||
}
|
|
||||||
List<FtWeekMenuDao> list = iFtWeekMenuDaoService.list(lqw);
|
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出每周菜单列表
|
* 导出每周菜单列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('fantang:weekMenu:export')")
|
@PreAuthorize("@ss.hasPermi('fantang:weekMenu:export')" )
|
||||||
@Log(title = "每周菜单", businessType = BusinessType.EXPORT)
|
@Log(title = "每周菜单" , businessType = BusinessType.EXPORT)
|
||||||
@GetMapping("/export")
|
@GetMapping("/export" )
|
||||||
public AjaxResult export(FtWeekMenuDao ftWeekMenuDao) {
|
public AjaxResult export(FtWeekMenuDao ftWeekMenuDao) {
|
||||||
LambdaQueryWrapper<FtWeekMenuDao> lqw = new LambdaQueryWrapper<FtWeekMenuDao>(ftWeekMenuDao);
|
LambdaQueryWrapper<FtWeekMenuDao> lqw = new LambdaQueryWrapper<FtWeekMenuDao>(ftWeekMenuDao);
|
||||||
List<FtWeekMenuDao> list = iFtWeekMenuDaoService.list(lqw);
|
List<FtWeekMenuDao> list = iFtWeekMenuDaoService.list(lqw);
|
||||||
ExcelUtil<FtWeekMenuDao> util = new ExcelUtil<FtWeekMenuDao>(FtWeekMenuDao.class);
|
ExcelUtil<FtWeekMenuDao> util = new ExcelUtil<FtWeekMenuDao>(FtWeekMenuDao. class);
|
||||||
return util.exportExcel(list, "weekMenu");
|
return util.exportExcel(list, "weekMenu" );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,5 +54,5 @@ private static final long serialVersionUID=1L;
|
|||||||
|
|
||||||
/** 启用标志 */
|
/** 启用标志 */
|
||||||
@Excel(name = "启用标志")
|
@Excel(name = "启用标志")
|
||||||
private Integer flag;
|
private Boolean flag;
|
||||||
}
|
}
|
||||||
|
@ -1,40 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
||||||
<el-form-item label="用餐类型" prop="dinnerType">
|
|
||||||
<el-select v-model="queryParams.dinnerType" placeholder="请选择用餐类型" clearable size="small">
|
|
||||||
<el-option label="请选择字典生成" value="" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="星期几" prop="weekday">
|
|
||||||
<el-select v-model="queryParams.weekday" placeholder="请选择星期几" clearable size="small">
|
|
||||||
<el-option label="请选择字典生成" value="" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="启用标志" prop="flag">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.flag"
|
|
||||||
placeholder="请输入启用标志"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['fantang:weekMenu:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -44,17 +11,10 @@
|
|||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
v-hasPermi="['fantang:weekMenu:edit']"
|
v-hasPermi="['fantang:weekMenu:edit']"
|
||||||
>修改</el-button>
|
>修改
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['fantang:weekMenu:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@ -63,19 +23,22 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['fantang:weekMenu:export']"
|
v-hasPermi="['fantang:weekMenu: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>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="weekMenuList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="weekMenuList"
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
:span-method="objectSpanMethod"
|
||||||
|
@selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center"/>
|
||||||
<el-table-column label="id" align="center" prop="id" v-if="false"/>
|
<el-table-column label="id" align="center" prop="id" v-if="false"/>
|
||||||
<el-table-column label="用餐类型" align="center" prop="dinnerType" />
|
<el-table-column label="星期几" align="center" prop="weekday"/>
|
||||||
<el-table-column label="星期几" align="center" prop="weekday" />
|
<el-table-column label="用餐类型" align="center" prop="dinnerType"/>
|
||||||
<el-table-column label="菜品列表" align="center" prop="foods" />
|
<el-table-column label="菜品列表" align="center" prop="foods"/>
|
||||||
<el-table-column label="总价格" align="center" prop="price" />
|
<el-table-column label="总价格" align="center" prop="price"/>
|
||||||
<el-table-column label="启用标志" align="center" prop="flag" />
|
<el-table-column label="启用标志" align="center" prop="flag" :formatter="formatStartFlag"/>
|
||||||
<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">
|
||||||
<el-button
|
<el-button
|
||||||
@ -84,18 +47,12 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['fantang:weekMenu:edit']"
|
v-hasPermi="['fantang:weekMenu:edit']"
|
||||||
>修改</el-button>
|
>修改
|
||||||
<el-button
|
</el-button>
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['fantang:weekMenu:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
@ -105,25 +62,44 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改每周菜单对话框 -->
|
<!-- 添加或修改每周菜单对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||||
|
<el-form-item label="星期几" prop="weekday">
|
||||||
|
<el-select v-model="form.weekday" placeholder="请选择星期几">
|
||||||
|
<el-option
|
||||||
|
v-for="item in weekdayOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="用餐类型" prop="dinnerType">
|
<el-form-item label="用餐类型" prop="dinnerType">
|
||||||
<el-select v-model="form.dinnerType" placeholder="请选择用餐类型">
|
<el-select v-model="form.dinnerType" placeholder="请选择用餐类型">
|
||||||
<el-option label="请选择字典生成" value="" />
|
<el-option
|
||||||
</el-select>
|
v-for="item in dinnerTypeOptions"
|
||||||
</el-form-item>
|
:key="item.value"
|
||||||
<el-form-item label="星期几" prop="weekday">
|
:label="item.label"
|
||||||
<el-select v-model="form.weekday" placeholder="请选择星期几">
|
:value="item.value">
|
||||||
<el-option label="请选择字典生成" value="" />
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="菜品列表" prop="foods">
|
<el-form-item label="菜品列表" prop="foods">
|
||||||
<el-select v-model="form.foods" placeholder="请选择菜品列表">
|
<el-select v-model="form.foods" multiple placeholder="请选择菜品列表">
|
||||||
<el-option label="请选择字典生成" value="" />
|
<el-option
|
||||||
|
v-for="item in foodList"
|
||||||
|
:key="item.foodId"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.foodId">
|
||||||
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="启用标志" prop="flag">
|
<el-form-item label="启用标志" prop="flag">
|
||||||
<el-input v-model="form.flag" placeholder="请输入启用标志" />
|
<el-switch
|
||||||
|
v-model="form.flag"
|
||||||
|
active-text="启用"
|
||||||
|
inactive-text="禁用">
|
||||||
|
</el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@ -135,168 +111,220 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listWeekMenu, getWeekMenu, delWeekMenu, addWeekMenu, updateWeekMenu, exportWeekMenu } from "@/api/fantang/weekMenu";
|
import {
|
||||||
|
listWeekMenu,
|
||||||
|
getWeekMenu,
|
||||||
|
updateWeekMenu,
|
||||||
|
exportWeekMenu
|
||||||
|
} from "@/api/fantang/weekMenu";
|
||||||
|
import {listFood} from "../../../api/fantang/food";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "WeekMenu",
|
name: "WeekMenu",
|
||||||
components: {
|
components: {},
|
||||||
},
|
data() {
|
||||||
data() {
|
return {
|
||||||
return {
|
// 遮罩层
|
||||||
// 遮罩层
|
loading: true,
|
||||||
loading: true,
|
// 选中数组
|
||||||
// 选中数组
|
ids: [],
|
||||||
ids: [],
|
// 非单个禁用
|
||||||
// 非单个禁用
|
single: true,
|
||||||
single: true,
|
// 非多个禁用
|
||||||
// 非多个禁用
|
multiple: true,
|
||||||
multiple: true,
|
// 显示搜索条件
|
||||||
// 显示搜索条件
|
showSearch: true,
|
||||||
showSearch: true,
|
// 总条数
|
||||||
// 总条数
|
total: 0,
|
||||||
total: 0,
|
// 每周菜单表格数据
|
||||||
// 每周菜单表格数据
|
weekMenuList: [],
|
||||||
weekMenuList: [],
|
// 弹出层标题
|
||||||
// 弹出层标题
|
title: "",
|
||||||
title: "",
|
// 菜品列表
|
||||||
// 是否显示弹出层
|
foodList: [],
|
||||||
open: false,
|
// queryParams
|
||||||
// 查询参数
|
foodQueryParams:{
|
||||||
queryParams: {
|
pageNum: 1,
|
||||||
pageNum: 1,
|
pageSize: 9,
|
||||||
pageSize: 10,
|
name: null,
|
||||||
dinnerType: null,
|
price: null,
|
||||||
weekday: null,
|
type: null
|
||||||
flag: null
|
},
|
||||||
},
|
|
||||||
// 表单参数
|
// 是否显示弹出层
|
||||||
form: {},
|
open: false,
|
||||||
// 表单校验
|
dinnerTypeOptions: [{
|
||||||
rules: {
|
value: '早餐',
|
||||||
dinnerType: [
|
label: '早餐'
|
||||||
{ required: true, message: "用餐类型不能为空", trigger: "change" }
|
}, {
|
||||||
|
value: '午餐',
|
||||||
|
label: '午餐'
|
||||||
|
}, {
|
||||||
|
value: '晚餐',
|
||||||
|
label: '晚餐'
|
||||||
|
}
|
||||||
],
|
],
|
||||||
weekday: [
|
weekdayOptions : [{
|
||||||
{ required: true, message: "星期几不能为空", trigger: "change" }
|
value: '周一',
|
||||||
],
|
label: '周一'
|
||||||
foods: [
|
}, {
|
||||||
{ required: true, message: "菜品列表不能为空", trigger: "change" }
|
value: '周二',
|
||||||
],
|
label: '周二'
|
||||||
flag: [
|
},{
|
||||||
{ required: true, message: "启用标志不能为空", trigger: "blur" }
|
value: '周三',
|
||||||
]
|
label: '周三'
|
||||||
}
|
},{
|
||||||
};
|
value: '周四',
|
||||||
},
|
label: '周四'
|
||||||
created() {
|
},{
|
||||||
this.getList();
|
value: '周五',
|
||||||
},
|
label: '周五'
|
||||||
methods: {
|
},{
|
||||||
/** 查询每周菜单列表 */
|
value: '周六',
|
||||||
getList() {
|
label: '周六'
|
||||||
this.loading = true;
|
},{
|
||||||
listWeekMenu(this.queryParams).then(response => {
|
value: '周日',
|
||||||
this.weekMenuList = response.rows;
|
label: '周日'
|
||||||
this.total = response.total;
|
}],
|
||||||
this.loading = false;
|
// 查询参数
|
||||||
});
|
queryParams: {
|
||||||
},
|
pageNum: 1,
|
||||||
// 取消按钮
|
pageSize: 9,
|
||||||
cancel() {
|
dinnerType: '',
|
||||||
this.open = false;
|
weekday: '',
|
||||||
this.reset();
|
flag: null
|
||||||
},
|
},
|
||||||
// 表单重置
|
// 表单参数
|
||||||
reset() {
|
form: {},
|
||||||
this.form = {
|
// 表单校验
|
||||||
id: null,
|
rules: {
|
||||||
dinnerType: null,
|
dinnerType: [
|
||||||
weekday: null,
|
{required: true, message: "用餐类型不能为空", trigger: "change"}
|
||||||
foods: null,
|
],
|
||||||
price: null,
|
weekday: [
|
||||||
flag: null
|
{required: true, message: "星期几不能为空", trigger: "change"}
|
||||||
|
],
|
||||||
|
foods: [
|
||||||
|
{required: true, message: "菜品列表不能为空", trigger: "change"}
|
||||||
|
],
|
||||||
|
flag: [
|
||||||
|
{required: true, message: "启用标志不能为空", trigger: "blur"}
|
||||||
|
]
|
||||||
|
}
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
created() {
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
methods: {
|
||||||
resetQuery() {
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||||
this.resetForm("queryForm");
|
if (columnIndex === 1) {
|
||||||
this.handleQuery();
|
if (rowIndex % 3 === 0) {
|
||||||
},
|
return {
|
||||||
// 多选框选中数据
|
rowspan: 3,
|
||||||
handleSelectionChange(selection) {
|
colspan: 1
|
||||||
this.ids = selection.map(item => item.id)
|
};
|
||||||
this.single = selection.length!==1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.title = "添加每周菜单";
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
const id = row.id || this.ids
|
|
||||||
getWeekMenu(id).then(response => {
|
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改每周菜单";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.id != null) {
|
|
||||||
updateWeekMenu(this.form).then(response => {
|
|
||||||
this.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
addWeekMenu(this.form).then(response => {
|
return {
|
||||||
this.msgSuccess("新增成功");
|
rowspan: 0,
|
||||||
this.open = false;
|
colspan: 0
|
||||||
this.getList();
|
};
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
},
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
formatStartFlag(row) {
|
||||||
handleDelete(row) {
|
if(row.flag)
|
||||||
const ids = row.id || this.ids;
|
return "启用";
|
||||||
this.$confirm('是否确认删除每周菜单编号为"' + ids + '"的数据项?', "警告", {
|
else
|
||||||
|
return "禁用";
|
||||||
|
},
|
||||||
|
/** 查询每周菜单列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listWeekMenu(this.queryParams).then(response => {
|
||||||
|
this.weekMenuList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
listFood(this.queryParams).then(response => {
|
||||||
|
this.foodList = response.rows;
|
||||||
|
this.loading = false;
|
||||||
|
console.log("foods", this.foodList);
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
dinnerType: null,
|
||||||
|
weekday: null,
|
||||||
|
foods: null,
|
||||||
|
price: null,
|
||||||
|
flag: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length !== 1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getWeekMenu(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改每周菜单";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateWeekMenu(this.form).then(response => {
|
||||||
|
this.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
const queryParams = this.queryParams;
|
||||||
|
this.$confirm('是否确认导出所有每周菜单数据项?', "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning"
|
||||||
}).then(function() {
|
}).then(function () {
|
||||||
return delWeekMenu(ids);
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.msgSuccess("删除成功");
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
const queryParams = this.queryParams;
|
|
||||||
this.$confirm('是否确认导出所有每周菜单数据项?', "警告", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning"
|
|
||||||
}).then(function() {
|
|
||||||
return exportWeekMenu(queryParams);
|
return exportWeekMenu(queryParams);
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
this.download(response.msg);
|
this.download(response.msg);
|
||||||
})
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user