|
@@ -0,0 +1,481 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container snapshotManagement">
|
|
|
+ <div class="snapshotManagement-page" v-if="pageType == 1">
|
|
|
+ <div class="title-box">
|
|
|
+ <el-form :model="queryParams" class="form-box" ref="queryForm" :inline="true" label-width="80px">
|
|
|
+ <div class="form-button-max-big-box">
|
|
|
+ <div class="form-button-big-box" style="margin-left:10px;">
|
|
|
+ <div :class="queryParams.buttonType==1?'checkDiv':''" @click="topLeftClickType(1)">
|
|
|
+ <p class="text-p">全部</p>
|
|
|
+ <p class="el-icon-check icon-p" v-if="queryParams.buttonType==1"></p>
|
|
|
+ </div>
|
|
|
+ <div :class="queryParams.buttonType==2?'checkDiv':''" @click="topLeftClickType(2)">
|
|
|
+ <p class="text-p">待整改</p>
|
|
|
+ <p class="el-icon-check icon-p" v-if="queryParams.buttonType==2"></p>
|
|
|
+ </div>
|
|
|
+ <div :class="queryParams.buttonType==3?'checkDiv':''" @click="topLeftClickType(3)">
|
|
|
+ <p class="text-p">已整改</p>
|
|
|
+ <p class="el-icon-check icon-p" v-if="queryParams.buttonType==3"></p>
|
|
|
+ </div>
|
|
|
+ <div :class="queryParams.buttonType==4?'checkDiv':''" @click="topLeftClickType(4)">
|
|
|
+ <p class="text-p">暂无法整改</p>
|
|
|
+ <p class="el-icon-check icon-p" v-if="queryParams.buttonType==4"></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-form-item label="关键字" prop="searchValue">
|
|
|
+ <el-input
|
|
|
+ maxLength="30"
|
|
|
+ v-model="queryParams.searchValue"
|
|
|
+ placeholder="实验室/房间号/上报人"
|
|
|
+ clearable
|
|
|
+ style="width: 180px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="学院" prop="deptId" label-width="50px">
|
|
|
+ <el-select v-model="queryParams.deptId" clearable placeholder="学院" style="width: 150px">
|
|
|
+ <el-option
|
|
|
+ v-for="item in deptSelectList"
|
|
|
+ :key="item.key"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.key">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="上报时间" prop="dateRange" style="margin-left:10px;" label-width="70px">
|
|
|
+ <el-date-picker
|
|
|
+ :clearable="false"
|
|
|
+ v-model="dateRange"
|
|
|
+ size="small"
|
|
|
+ style="width: 220px"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="-"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ ></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <p class="inquire-button-one" @click="handleQuery" style="margin-right:10px;">查询</p>
|
|
|
+ <p class="reset-button-one" @click="resetQuery">重置</p>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item style="float: right;">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <p class="inquire-button-one"
|
|
|
+ style="width:100px;"
|
|
|
+ @click="addButton"
|
|
|
+ ><i class="el-icon-plus"></i> 随手拍</p>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item style="float: right;">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <p class="add-button-one-90"
|
|
|
+ style="width:100px;"
|
|
|
+ @click="goPage(2)"
|
|
|
+ >上报记录</p>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div class="content-box">
|
|
|
+ <el-table border :data="tableList" ref="multipleTable" @sort-change="sortChange">
|
|
|
+ <el-table-column label="序号" align="center" type="index" width="60" />
|
|
|
+ <el-table-column label="学院" align="center" prop="deptName" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="实验室" align="center" prop="deptName" show-overflow-tooltip width="220"/>
|
|
|
+ <el-table-column label="安全责任人" align="center" prop="deptName" show-overflow-tooltip width="120"/>
|
|
|
+ <el-table-column label="上报人" align="center" prop="deptName" show-overflow-tooltip width="90"/>
|
|
|
+ <el-table-column label="上报时间" sortable align="center" prop="deptName" show-overflow-tooltip width="157"/>
|
|
|
+ <el-table-column label="隐患描述" align="center" prop="deptName" show-overflow-tooltip width="280"/>
|
|
|
+ <el-table-column label="整改人" align="center" prop="deptName" show-overflow-tooltip width="100"/>
|
|
|
+ <el-table-column label="整改时间" sortable align="center" prop="deptName" show-overflow-tooltip width="157"/>
|
|
|
+ <el-table-column label="整改状态" align="center" prop="deptName" show-overflow-tooltip width="120"/>
|
|
|
+ <el-table-column label="操作" align="center" prop="deptName" width="70">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="table-button-box">
|
|
|
+ <p class="table-button-p" @click="goPage(3,scope.row)">详情</p>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <pagination :page-sizes="[20, 30, 40, 50]"
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <listPage v-if="pageType == 2"></listPage>
|
|
|
+ <infoPage v-if="pageType == 3"></infoPage>
|
|
|
+ <el-dialog class="safetyHazard-info-dialog-box" @close="outDialog"
|
|
|
+ title="随手拍上报" :visible.sync="addDialogType" v-if="addDialogType"
|
|
|
+ width="787px" append-to-body>
|
|
|
+ <div>
|
|
|
+ <el-form :model="addDialogForm" :rules="rules" label-width="140px">
|
|
|
+ <el-form-item label="学院:" prop="deptId">
|
|
|
+ <el-select v-model="addDialogForm.deptId" placeholder="请选择学院" style="width:548px;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in dialogDeptOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="实验室:" prop="subId">
|
|
|
+ <el-select
|
|
|
+ style="width:548px;"
|
|
|
+ v-model="addDialogForm.subjectId"
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ clearable
|
|
|
+ @focus="selectFocus"
|
|
|
+ reserve-keyword
|
|
|
+ @clear="clearClick"
|
|
|
+ placeholder="搜索选择实验室"
|
|
|
+ :remote-method="getSelectList"
|
|
|
+ :loading="dialogLoading">
|
|
|
+ <el-option
|
|
|
+ v-for="item in dialogSubList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="隐患描述:" prop="text">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 4, maxRows: 4}"
|
|
|
+ placeholder="请输入隐患描述"
|
|
|
+ v-model="addDialogForm.text"
|
|
|
+ maxlength="100"
|
|
|
+ resize="none"
|
|
|
+ show-word-limit
|
|
|
+ style="width:548px;">
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="隐患照片:" prop="imgList">
|
|
|
+ <div class="snapshotManagement-for-img-box" v-for="(img,imgIndex) in addDialogForm.imgList" :key="imgIndex">
|
|
|
+ <img class="for-img" :src="img.url">
|
|
|
+ <p class="for-del-button el-icon-circle-close" @click="delImg(imgIndex)"></p>
|
|
|
+ </div>
|
|
|
+ <el-upload
|
|
|
+ style="display: inline-block;overflow: hidden"
|
|
|
+ class="avatar-uploader"
|
|
|
+ :action="uploadImgUrl"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-success="(res)=>handleAvatarSuccess(res)"
|
|
|
+ :headers="headers"
|
|
|
+ :before-upload="(res)=>beforeAvatarUpload(res)">
|
|
|
+ <p class="el-icon-plus up-img-p" style="display: inline-block"></p>
|
|
|
+ </el-upload>
|
|
|
+ <p class="dialog-material-text">支持jpg/png/bmp/gif格式,最多上传5张</p>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer dialog-footer-box" style="display: flex">
|
|
|
+ <p class="dialog-footer-button-null"></p>
|
|
|
+ <p class="dialog-footer-button-info" @click="outDialog">取消</p>
|
|
|
+ <p class="dialog-footer-button-primary">确定</p>
|
|
|
+ <p class="dialog-footer-button-null"></p>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import listPage from './listPage.vue'
|
|
|
+ import infoPage from './infoPage.vue'
|
|
|
+ import { getToken } from "@/utils/auth";
|
|
|
+ export default {
|
|
|
+ name: 'index',
|
|
|
+ components: {
|
|
|
+ listPage,
|
|
|
+ infoPage
|
|
|
+ },
|
|
|
+ data(){
|
|
|
+ return{
|
|
|
+ uploadImgUrl: this.uploadUrl(), // 上传的图片服务器地址
|
|
|
+ headers: {
|
|
|
+ Authorization: "Bearer " + getToken(),
|
|
|
+ },
|
|
|
+ pageType:1,
|
|
|
+ deptSelectList:[],
|
|
|
+ queryParams:{
|
|
|
+ pageNum:1,
|
|
|
+ pageSize:20,
|
|
|
+ buttonType:1,
|
|
|
+ timeType:0,
|
|
|
+ searchValue:"",
|
|
|
+ data1:""
|
|
|
+ },
|
|
|
+ dateRange:[],
|
|
|
+ tableList:[{}],
|
|
|
+ total:0,
|
|
|
+ //新增窗口
|
|
|
+ addDialogType:false,
|
|
|
+ addDialogForm:{
|
|
|
+ deptId:"",
|
|
|
+ subId:"",
|
|
|
+ text:"",
|
|
|
+ imgList:[],
|
|
|
+ },
|
|
|
+ rules:{
|
|
|
+ deptId: [
|
|
|
+ { required: true, message: "请选择学院", trigger: "change" },
|
|
|
+ ],
|
|
|
+ subId: [
|
|
|
+ { required: true, message: "请选择实验室", trigger: "change" },
|
|
|
+ ],
|
|
|
+ imgList: [
|
|
|
+ { required: true, message: "请上传隐患照片", trigger: "change" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ dialogDeptOptions:[],
|
|
|
+ dialogLoading:false,
|
|
|
+ dialogSubList:[],
|
|
|
+ dialogSubListData:[],
|
|
|
+ suffixName:"",
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created(){
|
|
|
+
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
+
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ goPage(type,data){
|
|
|
+ if(this.pageType != type){
|
|
|
+ if (type==1){
|
|
|
+ this.$set(this,'pageType',type);
|
|
|
+ } else if(type==2){
|
|
|
+ this.$set(this,'pageType',type);
|
|
|
+ } else if(type==3){
|
|
|
+ this.$set(this,'pageType',type);
|
|
|
+ } else if(type==4){
|
|
|
+ this.$set(this,'pageType',type);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //范围选择
|
|
|
+ topLeftClickType(type){
|
|
|
+ if(this.queryParams.buttonType != type){
|
|
|
+ this.$set(this.queryParams,'buttonType',type);
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //时间排序方法
|
|
|
+ sortChange(val){
|
|
|
+ //ascending 上 descending 下 null 无
|
|
|
+ console.log('val',val.order)
|
|
|
+ this.$set(this.queryParams,'timeType',val.order=='ascending'?1:(val.order=='descending'?2:''));
|
|
|
+ },
|
|
|
+ //获取数据列表
|
|
|
+ getList(){
|
|
|
+ // this.queryParamsData = JSON.parse(JSON.stringify(this.queryParams));
|
|
|
+ // this.queryParamsData.type = 'RFID_RECOGNIZER';
|
|
|
+ // listHardware(this.queryParamsData).then(response => {
|
|
|
+ // this.total = response.total;
|
|
|
+ // this.tableList = response.rows;
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.$set(this.queryParams,'pageNum',1);
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.$set(this,'dateRange',[]);
|
|
|
+ this.$set(this,'queryParams',{
|
|
|
+ pageNum:1,
|
|
|
+ pageSize:20,
|
|
|
+ buttonType:1,
|
|
|
+ timeType:0,
|
|
|
+ searchValue:"",
|
|
|
+ data1:""
|
|
|
+ });
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ /*==========上传相关==========*/
|
|
|
+ handleAvatarSuccess(res) {
|
|
|
+ if(this.addDialogForm.imgList.length>4){
|
|
|
+ this.msgError('最多只可上传5张')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let suffixName= this.upDataName.split('.')[this.upDataName.split('.').length - 2]
|
|
|
+ //判断文件名中是否有逗号和分号
|
|
|
+ if(suffixName.indexOf(',')==-1 && suffixName.indexOf(';')==-1){
|
|
|
+ }else{
|
|
|
+ this.msgError('文件名里包含逗号或分号,请修改后重新上传!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let obj ={
|
|
|
+ name:this.upDataName,
|
|
|
+ url:res.data.url,
|
|
|
+ };
|
|
|
+ this.addDialogForm.imgList.push(obj);
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ beforeAvatarUpload(file) {
|
|
|
+ if(this.addDialogForm.imgList.length>4){
|
|
|
+ this.msgError('最多只可上传5张')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let type = false;
|
|
|
+ if (file.type == 'image/png' || file.type == 'image/jpeg' || file.type == 'image/gif' || file.type == 'image/bmp') {
|
|
|
+ if(file.size> 5000000){
|
|
|
+ this.msgError('上传图片大小不能超过5M')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.upDataName = file.name;
|
|
|
+ type = true;
|
|
|
+ }else{
|
|
|
+ this.msgError('png/jpeg/gif格式')
|
|
|
+ type = false;
|
|
|
+ }
|
|
|
+ return type;
|
|
|
+ },
|
|
|
+ //删除照片
|
|
|
+ delImg(imgIndex){
|
|
|
+ this.addDialogForm.imgList.splice(imgIndex,1);
|
|
|
+ },
|
|
|
+ /**************** 新增窗口 ******************/
|
|
|
+ addButton(){
|
|
|
+ this.$set(this,'addDialogForm',{
|
|
|
+ deptId:"",
|
|
|
+ subId:"",
|
|
|
+ text:"",
|
|
|
+ imgList:[],
|
|
|
+ });
|
|
|
+ this.$set(this,'addDialogType',true);
|
|
|
+ },
|
|
|
+ outDialog(){
|
|
|
+ this.$set(this,'addDialogType',false);
|
|
|
+ },
|
|
|
+ //搜索实验室相关
|
|
|
+ selectFocus(){
|
|
|
+ if(!this.dialogSubList[0]){
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //实验室选中清除
|
|
|
+ clearClick(){
|
|
|
+ this.dialogSubList = JSON.parse(JSON.stringify(this.dialogSubListData))
|
|
|
+ },
|
|
|
+ /** 实验室-本地懒加载 */
|
|
|
+ getSelectList(val) {
|
|
|
+ let self = this;
|
|
|
+ let list = [];
|
|
|
+ for(let i=0;i<self.dialogSubListData.length;i++){
|
|
|
+ if(self.dialogSubListData[i].name.indexOf(val) != -1){
|
|
|
+ list.push(self.dialogSubListData[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.dialogSubList = JSON.parse(JSON.stringify(list))
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+ .snapshotManagement{
|
|
|
+ flex: 1;
|
|
|
+ display: flex !important;
|
|
|
+ flex-direction: column;
|
|
|
+ overflow: hidden;
|
|
|
+ .snapshotManagement-page{
|
|
|
+ flex: 1;
|
|
|
+ display: flex !important;
|
|
|
+ flex-direction: column;
|
|
|
+ overflow: hidden;
|
|
|
+ .title-box{
|
|
|
+ padding-top:20px;
|
|
|
+ border-bottom:1px solid #dedede;
|
|
|
+ .form-button-max-big-box{
|
|
|
+ display: inline-block;
|
|
|
+ .form-button-big-box{
|
|
|
+ display: flex;
|
|
|
+ div{
|
|
|
+ position: relative;
|
|
|
+ height:40px;
|
|
|
+ width:80px;
|
|
|
+ line-height: 40px;
|
|
|
+ text-align: center;
|
|
|
+ color:#999;
|
|
|
+ font-size:14px;
|
|
|
+ border:1px solid #999;
|
|
|
+ border-radius:4px;
|
|
|
+ margin-left:10px;
|
|
|
+ font-weight:500;
|
|
|
+ cursor: pointer;
|
|
|
+ .icon-p{
|
|
|
+ width:15px;
|
|
|
+ height:15px;
|
|
|
+ line-height:15px;
|
|
|
+ text-align: center;
|
|
|
+ position: absolute;
|
|
|
+ right:0;
|
|
|
+ bottom:0;
|
|
|
+ color:#fff;
|
|
|
+ background: #0183fa;
|
|
|
+ border-top-left-radius:4px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .checkDiv{
|
|
|
+ color:#0183FA;
|
|
|
+ border:1px solid #0183FA;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .content-box{
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ padding:20px;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ::v-deep .snapshotManagement-for-img-box{
|
|
|
+ width:80px;
|
|
|
+ height:80px;
|
|
|
+ border-radius:4px;
|
|
|
+ display: inline-block;
|
|
|
+ overflow: hidden;
|
|
|
+ margin-right:20px;
|
|
|
+ position: relative;
|
|
|
+ .for-img{
|
|
|
+ width:80px;
|
|
|
+ height:80px;
|
|
|
+ display: inline-block;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ .for-del-button{
|
|
|
+ background: rgba(0,0,0,0.7);
|
|
|
+ width:20px;
|
|
|
+ height:20px;
|
|
|
+ line-height: 20px;
|
|
|
+ text-align: center;
|
|
|
+ color:#fff;
|
|
|
+ border-bottom-left-radius:4px;
|
|
|
+ cursor: pointer;
|
|
|
+ position: absolute;
|
|
|
+ top:0;
|
|
|
+ right:0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ::v-deep .up-img-p{
|
|
|
+ height:80px;
|
|
|
+ width:80px;
|
|
|
+ line-height:80px;
|
|
|
+ text-align: center;
|
|
|
+ font-size:16px;
|
|
|
+ border-radius:4px;
|
|
|
+ border:1px dashed #E0E0E0;
|
|
|
+ }
|
|
|
+</style>
|