From 2e52dcb4fb8766d7d9c0034b7bba3e1d02e24906 Mon Sep 17 00:00:00 2001
From: zhaojiale <631455805@qq.com>
Date: Thu, 04 Aug 2022 10:43:29 +0800
Subject: [PATCH] 事故报告除图片外完成
---
src/views/accidentManagementSystem/workInjuryDeclaration/component/accidentName.vue | 442 +++++++++++++++++++++++++++---------------------------
1 files changed, 219 insertions(+), 223 deletions(-)
diff --git a/src/views/accidentManagementSystem/workInjuryDeclaration/component/accidentName.vue b/src/views/accidentManagementSystem/workInjuryDeclaration/component/accidentName.vue
index b96844b..d349645 100644
--- a/src/views/accidentManagementSystem/workInjuryDeclaration/component/accidentName.vue
+++ b/src/views/accidentManagementSystem/workInjuryDeclaration/component/accidentName.vue
@@ -1,244 +1,240 @@
<template>
- <el-dialog
- v-model="dialogVisible"
- title="选择事故名称"
- width="900px"
- draggable
- :fullscreen="full"
- >
- <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button>
- <el-row>
- <el-col :span="18">
- <el-row>
- <el-form ref="ruleFormRef" :model="ruleForm" :inline="true" status-icon>
- <el-form-item>
- <el-input size="default" v-model="ruleForm.pass" placeholder="id" style="min-width: 215px;"/>
- </el-form-item>
- <el-form-item>
- <el-input size="default" v-model="ruleForm.pass" placeholder="事故名称" style="min-width: 215px;"/>
- </el-form-item>
- <el-form-item>
- <el-input size="default" v-model="ruleForm.pass" placeholder="事故部门" style="min-width: 215px;"/>
- </el-form-item>
- <el-form-item>
- <el-input size="default" v-model="ruleForm.pass" placeholder="发生地点" style="min-width: 215px;"/>
- </el-form-item>
- <el-form-item>
- <el-input size="default" v-model="ruleForm.pass" placeholder="发生时间" style="min-width: 215px;"/>
- </el-form-item>
- <el-form-item>
- <el-button size="default" type="primary" @click="submitForm(ruleFormRef)">查询</el-button>
- <el-button size="default" @click="resetForm(ruleFormRef)">重置</el-button>
- <el-button size="default" :icon="Delete">清除选择</el-button>
- </el-form-item>
- </el-form>
- </el-row>
- <!--<el-table :data="tableData" style="width: 100%;margin-top:20px">-->
- <!--<el-table-column type="selection" width="55" />-->
- <!--<el-table-column align="center" prop="date" label="id" />-->
- <!--<el-table-column align="center" prop="name" label="事故名称"/>-->
- <!--<el-table-column align="center" prop="date" label="事故部门" />-->
- <!--<el-table-column align="center" prop="name" label="发生地点"/>-->
- <!--<el-table-column align="center" prop="name" label="发生时间"/>-->
- <!--</el-table>-->
- <!--<div class="pages">-->
- <!--<el-pagination-->
- <!--v-model:currentPage="currentPage4"-->
- <!--v-model:page-size="pageSize4"-->
- <!--:page-sizes="[100, 200, 300, 400]"-->
- <!--:small="small"-->
- <!--:disabled="disabled"-->
- <!--:background="background"-->
- <!--layout="total, sizes, prev, pager, next, jumper"-->
- <!--:total="400"-->
- <!--@size-change="handleSizeChange"-->
- <!--@current-change="handleCurrentChange"-->
- <!--/>-->
- <!--</div>-->
- <el-table
- :data="tableData"
- style="width: 100%"
- ref="multipleTableRef"
- >
- <el-table-column align="center">
- <template #default="scope">
- <el-radio-group v-model="radio1">
- <el-radio :label="scope.row.id" size="large">{{ null }}</el-radio>
- </el-radio-group>
- </template>
- </el-table-column>
- <el-table-column prop="accidentExpressId" label="事故名称" show-overflow-tooltip></el-table-column>
- <el-table-column prop="accidentDepartmentId" label="事故部门" show-overflow-tooltip></el-table-column>
- <el-table-column prop="accidentType" label="事故类别" show-overflow-tooltip></el-table-column>
- <el-table-column prop="accidentGrade" label="事故等级" show-overflow-tooltip></el-table-column>
- <el-table-column prop="occurrencePlace" label="发生地点" show-overflow-tooltip></el-table-column>
- <el-table-column prop="occurrenceTime" label="发生时间" show-overflow-tooltip></el-table-column>
- </el-table>
- <div class="pages">
- <el-pagination
- v-model:currentPage="pageIndex"
- v-model:page-size="pageSize"
- :page-sizes="[10, 20, 30]"
- :pager-count="5"
- layout="total, sizes, prev, pager, next, jumper"
- :total="40"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- />
- </div>
- </el-col>
- <el-col :span="6">
- <el-tag v-for="tag in dynamicTags" :key="tag" class="mx-1" style="margin:5px" closable :disable-transitions="false" @close="handleClose(tag)">
- {{ tag }}
- </el-tag>
- </el-col>
- </el-row>
- <template #footer>
- <span class="dialog-footer">
- <el-button @click="dialogVisible = false" size="default">关闭</el-button>
- <el-button type="primary" @click="dialogVisible = false" size="default">确定</el-button>
- </span>
- </template>
- </el-dialog>
+ <div>
+ <el-dialog v-model="dialogVisible" title="选择事故名称" width="900px" draggable :fullscreen="full">
+ <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button>
+ <el-row>
+ <el-col :span="18">
+ <el-row>
+ <el-form ref="ruleFormRef" :model="ruleForm" :inline="true" status-icon>
+ <!--<el-form-item>-->
+ <!--<el-input size="default" v-model="listQuery.searchParams.id" placeholder="id" style="min-width: 215px;"/>-->
+ <!--</el-form-item>-->
+ <el-form-item>
+ <el-input size="default" v-model="listQuery.searchParams.accidentName" placeholder="事故名称" style="min-width: 215px" />
+ </el-form-item>
+ <!--<el-form-item>-->
+ <!--<el-input size="default" v-model="listQuery.searchParams.deptName" placeholder="事故部门" style="min-width: 215px;"/>-->
+ <!--</el-form-item>-->
+ <!--<el-form-item>-->
+ <!--<el-input size="default" v-model="listQuery.searchParams.occurrencePlace" placeholder="发生地点" style="min-width: 215px;"/>-->
+ <!--</el-form-item>-->
+ <!--<el-form-item>-->
+ <!--<el-input size="default" v-model="listQuery.searchParams.occurrenceTime" placeholder="发生时间" style="min-width: 215px;"/>-->
+ <!--</el-form-item>-->
+ <el-form-item>
+ <el-button size="default" type="primary" @click="listApi">查询</el-button>
+ <el-button size="default" @click="submitReset">重置</el-button>
+ <el-button size="default" :icon="Delete" @click="handleClose">清除选择</el-button>
+ </el-form-item>
+ </el-form>
+ </el-row>
+ <!--<el-table :data="tableData" style="width: 100%;margin-top:20px">-->
+ <!--<el-table-column type="selection" width="55" />-->
+ <!--<el-table-column align="center" prop="date" label="id" />-->
+ <!--<el-table-column align="center" prop="name" label="事故名称"/>-->
+ <!--<el-table-column align="center" prop="date" label="事故部门" />-->
+ <!--<el-table-column align="center" prop="name" label="发生地点"/>-->
+ <!--<el-table-column align="center" prop="name" label="发生时间"/>-->
+ <!--</el-table>-->
+ <!--<div class="pages">-->
+ <!--<el-pagination-->
+ <!--v-model:currentPage="currentPage4"-->
+ <!--v-model:page-size="pageSize4"-->
+ <!--:page-sizes="[100, 200, 300, 400]"-->
+ <!--:small="small"-->
+ <!--:disabled="disabled"-->
+ <!--:background="background"-->
+ <!--layout="total, sizes, prev, pager, next, jumper"-->
+ <!--:total="400"-->
+ <!--@size-change="handleSizeChange"-->
+ <!--@current-change="handleCurrentChange"-->
+ <!--/>-->
+ <!--</div>-->
+ <el-table :data="tableData" style="width: 100%" ref="multipleTableRef">
+ <el-table-column align="center">
+ <template #default="scope">
+ <el-radio-group v-model="radio1">
+ <el-radio :label="scope.row.id" size="large" @click="checkedItem(scope.row)">{{ null }}</el-radio>
+ </el-radio-group>
+ </template>
+ </el-table-column>
+ <!--<el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column>-->
+ <el-table-column prop="accidentName" label="事故名称" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="deptName" label="事故部门" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="occurrencePlace" label="发生地点" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="occurrenceTime" label="发生时间" show-overflow-tooltip></el-table-column>
+ </el-table>
+ <div class="pages">
+ <el-pagination
+ v-model:currentPage="pageIndex"
+ v-model:page-size="pageSize"
+ :page-sizes="[10, 20, 30]"
+ :pager-count="5"
+ layout="total, sizes, prev, pager, next, jumper"
+ :total="total"
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange"
+ />
+ </div>
+ </el-col>
+ <el-col :span="6">
+ <el-tag v-for="tag in dynamicTags" :key="tag" class="mx-1" style="margin: 5px" closable :disable-transitions="false" @close="handleClose()">
+ {{ tag.accidentName }}
+ </el-tag>
+ </el-col>
+ </el-row>
+ <template #footer>
+ <span class="dialog-footer">
+ <el-button @click="dialogVisible = false" size="default">关闭</el-button>
+ <el-button type="primary" @click="submitForm" size="default">确定</el-button>
+ </span>
+ </template>
+ </el-dialog>
+ </div>
</template>
<script lang="ts">
+import { defineComponent, reactive, ref } from 'vue';
+import { Delete, FullScreen } from '@element-plus/icons-vue';
import {
- defineComponent,
- reactive,
- ref,
- onMounted
-} from 'vue';
-import {
- Delete,
- FullScreen
-} from '@element-plus/icons-vue';
-import {
- // ElTable,
- ElMessage,
+ // ElTable,
+ ElMessage,
} from 'element-plus';
-import {accidentManagementSystemApi} from "/@/api/workInjuryDeclaration";
+import { accidentManagementSystemApi } from '/@/api/workInjuryDeclaration';
export default defineComponent({
- setup() {
- const dialogVisible = ref<boolean>(false);
- const openDailog = () => {
- dialogVisible.value = true;
- };
- // 搜索条件
- const ruleForm = reactive({
- pass: '',
- });
- // 定义表格数据
- const tableData = ref([]);
- // 列表参数
- const listQuery = reactive({
- pageIndex: 1,
- pageSize: 10,
- searchParams: {
- name: '',
- },
- });
- //单选按钮
- const radio1 = ref('');
- // 分页
- const pageIndex = ref();
- const pageSize = ref();
- const total = ref();
- // 分页改变
- const handleSizeChange = (val: number) => {
- listQuery.pageSize = val;
- };
- // 分页未改变
- const handleCurrentChange = (val: number) => {
- listQuery.pageIndex = val;
- };
- //查询list数据
- const listApi = async () => {
- let res = await accidentManagementSystemApi().getAccidentReportList(listQuery);
- if (res.data.code == 200) {
- tableData.value = res.data.data;
- pageIndex.value = res.data.pageIndex;
- pageSize.value = res.data.pageSize;
- total.value = res.data.total;
- } else {
- ElMessage.error(res.data.msg);
- }
- };
- // 页面加载时
- onMounted(() => {
- listApi();
- });
- // 右方点击添加后显示标签
- const dynamicTags = ref(['应急救援组', '工艺抢险组', '后勤保障组']);
- const handleClose = (tag: string) => {
- dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1);
- };
- //全屏
- const full = ref(false);
- const toggleFullscreen = () => {
- if (full.value == false) {
- full.value = true;
- } else {
- full.value = false;
- }
- };
- return {
- dialogVisible,
- openDailog,
- ruleForm,
- tableData,
- handleSizeChange,
- handleCurrentChange,
- dynamicTags,
- handleClose,
- Delete,
- toggleFullscreen,
- FullScreen,
- full,
- pageIndex,
- pageSize,
- total,
- listApi,
- listQuery,
- radio1
- };
- },
+ setup(props, { emit }) {
+ const dialogVisible = ref<boolean>(false);
+ const openDailog = () => {
+ dialogVisible.value = true;
+ listApi();
+ };
+ // 搜索条件
+ const ruleForm = reactive({
+ pass: '',
+ });
+ // 定义表格数据
+ const tableData = ref([]);
+ // 列表参数
+ const listQuery = reactive({
+ pageIndex: 1,
+ pageSize: 10,
+ searchParams: {
+ accidentName: '',
+ },
+ });
+ //单选按钮
+ const radio1 = ref('');
+ // 分页
+ const pageIndex = ref();
+ const pageSize = ref();
+ const total = ref();
+ // 分页改变
+ const handleSizeChange = (val: number) => {
+ listQuery.pageSize = val;
+ };
+ // 分页未改变
+ const handleCurrentChange = (val: number) => {
+ listQuery.pageIndex = val;
+ };
+ const checkedItem = (row: object) => {
+ dynamicTags.value = [row];
+ };
+ // 重置
+ const submitReset = () => {
+ listQuery.searchParams = {};
+ listApi();
+ };
+ const submitForm = () => {
+ emit('selectItem', dynamicTags.value);
+ dialogVisible.value = false;
+ };
+ //查询list数据
+ const listApi = async () => {
+ let res = await accidentManagementSystemApi().accidentList(listQuery);
+ if (res.data.code == 200) {
+ tableData.value = res.data.data;
+ pageIndex.value = res.data.pageIndex;
+ pageSize.value = res.data.pageSize;
+ total.value = res.data.total;
+ } else {
+ ElMessage.error(res.data.msg);
+ }
+ };
+ // 右方点击添加后显示标签
+ const dynamicTags = ref([]);
+ const handleClose = () => {
+ dynamicTags.value = [];
+ radio1.value = '';
+ };
+ //全屏
+ const full = ref(false);
+ const toggleFullscreen = () => {
+ if (full.value == false) {
+ full.value = true;
+ } else {
+ full.value = false;
+ }
+ };
+ return {
+ dialogVisible,
+ openDailog,
+ ruleForm,
+ tableData,
+ handleSizeChange,
+ handleCurrentChange,
+ dynamicTags,
+ handleClose,
+ Delete,
+ toggleFullscreen,
+ FullScreen,
+ full,
+ pageIndex,
+ pageSize,
+ total,
+ listApi,
+ listQuery,
+ radio1,
+ checkedItem,
+ submitReset,
+ submitForm,
+ };
+ },
});
</script>
<style scoped>
-.el-form--inline .el-form-item{
- margin-bottom: 18px!important;
- margin-right: 12px;
+.el-form--inline .el-form-item {
+ margin-bottom: 18px !important;
+ margin-right: 12px;
}
/*分页*/
-.pages{
- margin-top: 15px;
+.pages {
+ margin-top: 15px;
}
::v-deep .el-pagination .el-pager li {
- margin: 0 5px;
- background-color: #f4f4f5;
- color: #606266;
- min-width: 30px;
- border-radius: 2px;
+ margin: 0 5px;
+ background-color: #f4f4f5;
+ color: #606266;
+ min-width: 30px;
+ border-radius: 2px;
}
::v-deep .el-pagination .el-pager li.is-active {
- background-color: #409eff;
- color: #fff;
+ background-color: #409eff;
+ color: #fff;
}
::v-deep .el-pagination .btn-prev {
- margin: 0 5px;
- background-color: #f4f4f5;
- color: #606266;
- min-width: 30px;
- border-radius: 2px;
+ margin: 0 5px;
+ background-color: #f4f4f5;
+ color: #606266;
+ min-width: 30px;
+ border-radius: 2px;
}
-::v-deep .el-pagination button:disabled{
- color: #c0c4cc;
+::v-deep .el-pagination button:disabled {
+ color: #c0c4cc;
}
-::v-deep .el-pagination .btn-next{
- margin: 0 5px;
- background-color: #f4f4f5;
- color: #606266;
- min-width: 30px;
- border-radius: 2px;
+::v-deep .el-pagination .btn-next {
+ margin: 0 5px;
+ background-color: #f4f4f5;
+ color: #606266;
+ min-width: 30px;
+ border-radius: 2px;
}
</style>
--
Gitblit v1.9.2