bonus-ui/src/views/kitchen/staffManage/violation/index.vue

133 lines
4.8 KiB
Vue

<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="关键字" prop="searchValue">
<el-input v-model="queryParams.searchValue" placeholder="请输入员工姓名,编号,手机号" maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<el-form-item label="违规内容" prop="alarmType">
<el-select v-model="queryParams.alarmType" style="width: 240px" clearable>
<el-option label="未戴口罩" value="1"></el-option>
<el-option label="垃圾桶未盖报警 " value="2"></el-option>
<el-option label="发现老鼠" value="3"></el-option>
<el-option label="未穿厨师服" value="4"></el-option>
<el-option label="未戴厨师帽" value="5"></el-option>
<el-option label="未戴手套" value="6"></el-option>
<el-option label="抽烟" value="7"></el-option>
<el-option label="打电话" value="8"></el-option>
<el-option label="地面巡检" value="9"></el-option>
<el-option label="设备归位 " value="10"></el-option>
<el-option label="未授权人员进入 " value="11"></el-option>
<el-option label="动火离人" value="13"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" 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">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" height="800">
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="违规人员" align="center" prop="nickName" :show-overflow-tooltip="true"/>
<el-table-column label="违规内容" align="center" prop="recordDesc" :show-overflow-tooltip="true"/>
<el-table-column label="违规图片" align="center" prop="imgUrl" :show-overflow-tooltip="true">
<template slot-scope="scope">
<img :src="scope.row.imgUrl" v-if="scope.row.imgUrl" alt="" style="width: 80px;height: 40px;" @click="openImg(scope.row)">
<span v-else>无</span>
</template>
</el-table-column>
<el-table-column label="违规时间" align="center" prop="recordTime" :show-overflow-tooltip="true"/>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-dialog :visible.sync="dialogVisible" width="700px">
<img style="width: 100%;height: 100%;" :src="dialogImageUrl" alt="">
</el-dialog>
</div>
</template>
<script>
import { getStaffIllegalListApi } from "@/api/kitchen/staff";
export default {
name: "",
dicts: [],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
//表格数据
tableListData: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
canteenName: undefined,
areaNameStr: undefined,
},
dialogVisible:false,//图片弹窗
dialogImageUrl:"",//图片弹窗
};
},
created() {
this.getList();
},
methods: {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
"pageNum": this.queryParams.pageNum,
"pageSize": this.queryParams.pageSize,
"searchValue": this.queryParams.searchValue,
"alarmType": this.queryParams.alarmType,
}
getStaffIllegalListApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
},
openImg(row) {
this.dialogImageUrl = row.imgUrl;
this.dialogVisible = true;
}
}
};
</script>