提交 5336a257 authored 作者: 350505825@qq.com's avatar 350505825@qq.com

提交代码

上级 805e804c
import request from '@/utils/request' import request from '@/utils/request'
// 查询客餐申请列表 // 查询所有部门
export function allList() {
return request({
url: '/department/allList',
method: 'get',
})
}
// 查询所有就餐统计列表
export function listApply(query) { export function listApply(query) {
return request({ return request({
url: '/formalDishesApply/allList', url: '/personalAnalysis/allList',
method: 'get', method: 'get',
params: query params: query
}) })
......
...@@ -12,7 +12,7 @@ export function listApply(query) { ...@@ -12,7 +12,7 @@ export function listApply(query) {
// 查询客餐申请详细 // 查询客餐申请详细
export function getApply(id) { export function getApply(id) {
return request({ return request({
url: '/formalDishesApply/getApplyById/', url: '/formalDishesApply/getApplyById/' + id,
method: 'get' method: 'get'
}) })
} }
...@@ -29,7 +29,16 @@ export function addApply(data) { ...@@ -29,7 +29,16 @@ export function addApply(data) {
// 修改客餐申请 // 修改客餐申请
export function updateApply(data) { export function updateApply(data) {
return request({ return request({
url: '/formalDishesApply/updateApply', url: '/formalDishesApply/examine',
method: 'put',
data: data
})
}
// 修改客餐申请
export function reject(data) {
return request({
url: '/formalDishesApply/reject',
method: 'put', method: 'put',
data: data data: data
}) })
......
<template> <template>
<div>就餐统计</div> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="部门" prop="status" >
<el-select v-model="queryParams.deptId" placeholder="请选择部门" clearable size="small" style="width: 120px">
<el-option
v-for="dict in departmentOptions"
:key="dict.deptId"
:label="dict.deptName"
:value="dict.deptId"
/>
</el-select>
</el-form-item>
<el-form-item label="日期筛选" prop=" ">
<el-date-picker clearable size="small" style="width: 150px"
v-model="queryParams.createDateStar"
type="date"
value-format="yyyy-MM-dd"
placeholder=" ">
</el-date-picker>
</el-form-item>
<el-form-item label="至" prop=" ">
<el-date-picker clearable size="small" style="width: 150px"
v-model="queryParams.createDateEnd"
type="date"
value-format="yyyy-MM-dd"
placeholder=" ">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:apply:export']"
>导出</el-button>
</el-col>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="applyList" @selection-change="handleSelectionChange">
<el-table-column label="所属部门" align="center" prop="userId" />
<el-table-column label="名称" align="center" prop="department" />
<el-table-column label="账号" align="center" prop="nickName" />
<el-table-column label="早餐就餐份数" align="center" prop="balance" />
<el-table-column label="早餐就餐总费用" align="center" prop="rechargeTotal" />
<el-table-column label="午餐就餐份数" align="center" prop="consumeTotal" />
<el-table-column label="午餐就餐总费用" align="center" prop="deptName" />
<el-table-column label="晚餐就餐份数" align="center" prop="deptName" />
<el-table-column label="晚餐就餐总费用" align="center" prop="deptName" />
<el-table-column label="全天用餐总费用" align="center" prop="deptName" />
<el-table-column label="日期" align="center" prop="deptName" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template> </template>
<script> <script>
import { listApply, addApply, allList, exportApply, updateApply } from '../../../api/analysis/eattingAnalysis/enttingAnalysis'
export default {
name: "Apply",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 总条数
total: 0,
// 客餐申请表格数据
applyList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 状态字典
statusOptions: [],
// 部门列表
departmentOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
nickName: undefined,
createDateStar: undefined,
createDateEnd: undefined,
deptId: undefined
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
this.getallList();
this.getDicts("t_formal_dishes_apply.status").then(response => {
this.statusOptions = response.data;
});
},
methods: {
/** 查询就餐列表 */
getList() {
this.loading = true;
listApply(this.queryParams).then(response => {
this.applyList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 查询所有部门 */
getallList() {
this.loading = true;
allList().then(response => {
this.departmentOptions = response.data;
});
},
// 表单重置
reset() {
this.form = {
id: undefined,
applyUserId: undefined,
applyPeriod: undefined,
applyAmount: undefined,
applyRemark: undefined,
status: "0",
createDate: undefined,
createTime: undefined,
createWeek: undefined,
applyType: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!=1
this.multiple = !selection.length
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != undefined) {
updateApply(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
} else {
this.msgError(response.msg);
}
});
} else {
addApply(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
} else {
this.msgError(response.msg);
}
});
}
}
});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有个人统计数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return exportApply(queryParams);
}).then(response => {
this.download(response.msg);
}).catch(function() {});
}
}
};
</script> </script>
<style scoped>
</style>
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
<el-table-column label="部门总补贴" align="center" prop="status" /> <el-table-column label="部门总补贴" align="center" prop="status" />
<el-table-column label="部门客餐总报餐" align="center" prop="status" /> <el-table-column label="部门客餐总报餐" align="center" prop="status" />
<el-table-column label="客餐消费" align="center" prop="status" /> <el-table-column label="客餐消费" align="center" prop="status" />
<el-table-column label="日期" align="center" prop="status" />
</el-table> </el-table>
<pagination <pagination
......
...@@ -79,6 +79,13 @@ ...@@ -79,6 +79,13 @@
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:apply:edit']" v-hasPermi="['system:apply:edit']"
>审核</el-button> >审核</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="reject(scope.row)"
v-hasPermi="['system:apply:edit']"
>驳回</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -94,7 +101,7 @@ ...@@ -94,7 +101,7 @@
</template> </template>
<script> <script>
import { listApply, getApply, delApply, addApply, updateApply, exportApply } from "@/api/formalRecipe/formalRecipe"; import { listApply, getApply, delApply, addApply, updateApply, exportApply, reject } from "@/api/formalRecipe/formalRecipe";
export default { export default {
name: "Apply", name: "Apply",
...@@ -199,34 +206,38 @@ ...@@ -199,34 +206,38 @@
this.open = true; this.open = true;
this.title = "添加客餐申请"; this.title = "添加客餐申请";
}, },
/** 修改按钮操作 */ /** 审核按钮操作 */
handleUpdate(row) { handleUpdate(row) {
// this.reset();
// const id = row.id || this.ids
// getApply(id).then(response => {
// this.form = response.data;
// this.open = true;
// this.title = "修改客餐申请";
// });
const id = row.id || this.ids const id = row.id || this.ids
this.$confirm('温馨提示:确定修改审核状态吗', { this.$confirm('温馨提示:确定修改审核状态吗', {
confirmButtonText: "审核", confirmButtonText: "确定",
cancelButtonText: "驳回", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(()=> { }).then(()=> {
getApply(id).then(response => { getApply(id).then(response => {
this.form = response.data; updateApply(response.data).then(response1 => {
if( this.form.status == '1'){ if (response1.code === 200) {
this.form.status = '2' this.msgSuccess("审核成功")
this.getList();
} else {
this.msgError(response.msg);
} }
// else if(this.form.clientStatus == '1'){ });
// this.form.state = '0' });
// } })
console.log(this.form,'---') },
updateApply(this.form).then(response1 => { /** 驳回按钮操作 */
reject(row) {
const id = row.id || this.ids
this.$confirm('温馨提示:确定修改成驳回状态吗', {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(()=> {
getApply(id).then(response => {
reject(response.data).then(response1 => {
if (response1.code === 200) { if (response1.code === 200) {
this.msgSuccess("修改成功") this.msgSuccess("驳回成功")
this.getList(); this.getList();
} else { } else {
this.msgError(response.msg); this.msgError(response.msg);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论