From 1051ffa8ae4544a169384552564c10aa96d3c7f1 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期一, 06 一月 2025 14:08:19 +0800
Subject: [PATCH] 修改首页
---
src/views/notCoalMine/nViolationRegistration/index.vue | 184 +++++++++++++++++++++++++++++++++++-----------
1 files changed, 140 insertions(+), 44 deletions(-)
diff --git a/src/views/notCoalMine/nViolationRegistration/index.vue b/src/views/notCoalMine/nViolationRegistration/index.vue
index 5fcd874..594d92c 100644
--- a/src/views/notCoalMine/nViolationRegistration/index.vue
+++ b/src/views/notCoalMine/nViolationRegistration/index.vue
@@ -3,7 +3,7 @@
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="用户姓名" prop="userName">
<el-input
- v-model="queryParams.userName"
+ v-model="queryParams.name"
placeholder="请输入用户姓名"
clearable
@keyup.enter.native="handleQuery"
@@ -17,19 +17,20 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
- <el-form-item label="单位名称" prop="idCard">
+ <el-form-item label="单位名称" prop="dept">
<el-input
- v-model="queryParams.unit"
+ v-model="queryParams.dept"
placeholder="请输入单位名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
- <el-form-item label="作业类型">
+ <el-form-item label="操作类型">
<el-cascader
- v-model="classiFy"
- :options="expertTypes"
- :props="{ expandTrigger: 'hover', value: 'id',label: 'label'}"
+ v-model="queryParams.operateTypeId"
+ :options="typeList"
+ :show-all-levels="false"
+ :props="{ expandTrigger: 'hover', value: 'id',label: 'name',emitPath:false}"
@change="handleChange"></el-cascader>
</el-form-item>
<el-form-item>
@@ -44,30 +45,48 @@
type="primary"
plain
size="mini"
- @click="handleAdd"
+ @click="openViolation({},'add')"
v-hasPermi="['system:experts:add']"
- >新增填报</el-button>
+ >处罚记录填报</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
- <el-table v-loading="loading" :data="expertList">
- <el-table-column label="发生时间" align="center" prop="name" />
+ <el-table v-loading="loading" :data="dataList">
+ <el-table-column label="发生时间" align="center" prop="violationTime" />
<el-table-column label="姓名" align="center" prop="name" />
- <el-table-column label="身份证号" align="center" prop="name" />
- <el-table-column label="IC/电子证编号" align="center" prop="phone"/>
- <el-table-column label="所属单位" align="center" prop="phone"/>
- <el-table-column label="作业种类" align="center" prop="phone"/>
+ <el-table-column label="身份证号" align="center" prop="idCard">
+ <template #default="scope">
+ {{scope.row.idCard | peridcardtm}}
+ </template>
+ </el-table-column>
+ <el-table-column label="IC卡编号" align="center" prop="icNum"/>
+ <el-table-column label="电子证编号" align="center" prop="electNum"/>
+ <el-table-column label="所属单位" align="center" prop="dept"/>
+ <el-table-column label="作业种类" align="center" prop="jobCategory"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button
size="mini"
type="text"
- icon="el-icon-view"
- @click="handleView(scope.row)"
- >查看违规详情</el-button>
+ icon="el-icon-edit"
+ @click="open('核准')"
+ >核准</el-button>
<el-button
size="mini"
type="text"
+ icon="el-icon-edit"
+ @click="open('撤销')"
+ >撤销</el-button>
+ <el-button
+ size="mini"
+ type="text"
+ icon="el-icon-view"
+ @click="openViolation(scope.row,'view')"
+ >查看详情</el-button>
+ <el-button
+ size="mini"
+ type="text"
+ style="color: red;"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:experts:remove']"
@@ -78,62 +97,139 @@
<pagination
v-show="total>0"
:total="total"
- :page.sync="queryParams.pageIndex"
+ :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
- <add-dialog ref="addDialogRef" @getList = "getList"></add-dialog>
+ <violation-dialog ref="violationDialog" @getList="getList" :typeList="typeList"></violation-dialog>
</div>
</template>
<script>
-import addDialog from "@/views/notCoalMine/nViolationRegistration/components/addDialog.vue";
+import violationDialog from "@/views/notCoalMine/nViolationRegistration/components/violationDialog.vue";
+import {delViolation, getViolationPage} from "@/api/coalMine/violation";
+import {getOperatePage} from "@/api/coalMine/operateType";
+import {delPeople} from "@/api/coalMine/people";
export default {
- name: "nViolationRegistration",
+ name: "cViolationRegistration",
dicts: [],
components: {
- addDialog
+ violationDialog
},
data() {
return {
- addDialogRef: '',
+ violationDialog: '',
loading: false,
- single: true,
- multiple: true,
showSearch: true,
- addForm: false,
+ dataList: [],
total: 0,
- expertTypes: [],
- expertList: [],
- queryParams: {},
- classiFy: [],
- form: {},
- rules: {
- classifyName: [
- { required: true, message: "分类名称不能为空", trigger: "blur" }
- ]
- }
+ typeList: [],
+ queryParams: {
+ name: '',
+ idCard:'',
+ dept: '',
+ operateTypeId: null,
+ isCm: 0,
+ pageNum: 1,
+ pageSize: 10
+ },
};
},
created() {
-
+ this.getList()
+ this.getTypeList()
},
methods: {
- getList(){
-
+ open(val) {
+ this.$confirm('确认'+val+'该项处罚?', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(() => {
+ this.$message({
+ type: 'success',
+ message: val+'成功!'
+ });
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '已取消'+val
+ });
+ });
+ },
+ async getList(){
+ const t = this
+ t.loading = true
+ const res = await getViolationPage(t.queryParams)
+ if(res.code == 200){
+ t.dataList = res.rows
+ t.total = res.total
+ }else{
+ t.$message({
+ message: res.msg,
+ type: 'warning'
+ })
+ }
+ t.loading = false
+ },
+ async getTypeList() {
+ this.loading = true;
+ const res = await getOperatePage({name: ''})
+ if(res.code == 200){
+ this.typeList = this.handleTree(res.data, "id");
+ }else{
+ this.$message({
+ type: 'warning',
+ message: res.msg
+ });
+ }
+ this.loading = false;
},
handleChange(){
},
- handleQuery(){
+ handleDelete(row){
+ this.$confirm('此操作将永久删除该条数据, 是否继续?', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(async () => {
+ const res = await delViolation(row.violationId)
+ if(res.code == 200){
+ this.$message({
+ type: 'success',
+ message: '删除成功!'
+ });
+ await this.getList()
+ }else{
+ this.$message({
+ type: 'warning',
+ message: res.msg
+ });
+ }
+ }).catch(() => {
+ });
+ },
+ handleQuery(){
+ this.queryParams.pageNum = 1
+ this.getList()
},
resetQuery(){
-
+ this.queryParams = {
+ name: '',
+ idCard:'',
+ dept: '',
+ operateTypeId: null,
+ isCm: 0,
+ pageNum: 1,
+ pageSize: 10
+ }
+ this.getList()
},
- handleAdd(){
- this.$refs.addDialogRef.openDialog();
+ openViolation(data,type){
+ this.$refs.violationDialog.openDialog(data,type);
}
}
};
--
Gitblit v1.9.2