Commit 816ba099 authored by kaitly205422@163.com's avatar kaitly205422@163.com

缺少文件

parent 8a9e2d81
...@@ -2,13 +2,8 @@ ...@@ -2,13 +2,8 @@
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item label="项目名称" prop="projectName"> <el-form-item label="项目名称" prop="projectName">
<el-input <el-input v-model="queryParams.projectName" placeholder="请输入项目名称1" clearable style="width: 240px"
v-model="queryParams.projectName" @keyup.enter.native="handleQuery" />
placeholder="请输入项目名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
...@@ -17,75 +12,70 @@ ...@@ -17,75 +12,70 @@
</el-form> </el-form>
<div v-for="(item, index) in projectList" :key="index" class="projectItem" @click="projectDetail(item)"> <div v-for="(item, index) in projectList" :key="index" class="projectItem" @click="projectDetail(item)">
<div class="left"> <div class="left">
<p>{{item.projectName}}</p> <p>{{ item.projectName }}</p>
<p>项目类型:{{item.projectType}} | 项目地址:{{item.projectAddress}}</p> <p>项目类型:{{ item.projectType }} | 项目地址:{{ item.projectAddress }}</p>
</div> </div>
<img src="../../../assets/images/work.svg" alt=""> <img src="../../../assets/images/work.svg" alt="">
</div> </div>
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
v-show="total > 0" @pagination="getList" />
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div> </div>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import { listCurrentProject } from '@/api/risk/currentProject' import { listCurrentProject } from '@/api/risk/currentProject'
export default { export default {
name: 'currentProject', name: 'currentProject',
data() { data() {
return { return {
// 遮罩层 // 遮罩层
loading: true, loading: true,
projectList:[], projectList: [],
// 总条数 // 总条数
total: 0, total: 0,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectName: null, projectName: null,
}, },
} }
},
created() {
this.getList();
},
mounted() {
},
methods: {
/** 查询基础数据-项目列表 */
getList() {
this.loading = true;
this.queryParams.userId = this.$store.getters.userId
listCurrentProject(this.queryParams).then((response) => {
this.projectList = response.rows;
this.total = response.total;
this.loading = false;
});
}, },
created(){ /** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
mounted() { /** 重置按钮操作 */
}, resetQuery() {
methods: { this.resetForm("queryForm");
/** 查询基础数据-项目列表 */ this.handleQuery();
getList() {
this.loading = true;
this.queryParams.userId = this.$store.getters.userId
listCurrentProject(this.queryParams).then((response) => {
this.projectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
projectDetail(val){
this.$router.push("/risk/currentProject/projectPost/index/" + val.projectId)
}
}, },
projectDetail(val) {
this.$router.push("/risk/currentProject/projectPost/index/" + val.projectId)
}
},
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.projectItem{ .projectItem {
width: 100%; width: 100%;
padding: 25px 120px 25px 30px; padding: 25px 120px 25px 30px;
margin-bottom: 25px; margin-bottom: 25px;
...@@ -96,13 +86,15 @@ import { listCurrentProject } from '@/api/risk/currentProject' ...@@ -96,13 +86,15 @@ import { listCurrentProject } from '@/api/risk/currentProject'
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.left{
.left {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
justify-content: space-between; justify-content: space-between;
:first-child{
color: #3277f5 ; :first-child {
color: #3277f5;
font-size: 18px; font-size: 18px;
} }
} }
......
...@@ -2,12 +2,7 @@ ...@@ -2,12 +2,7 @@
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="岗位名称" prop="riskPostName"> <el-form-item label="岗位名称" prop="riskPostName">
<el-input <el-input v-model="queryParams.riskPostName" placeholder="请输入岗位名称1" clearable @keyup.enter.native="handleQuery" />
v-model="queryParams.riskPostName"
placeholder="请输入岗位名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
...@@ -17,59 +12,59 @@ ...@@ -17,59 +12,59 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
type="primary" v-hasPermi="['system:currentRiskPost:add']">添加岗位</el-button>
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:currentRiskPost:add']"
>添加岗位</el-button>
</el-col> </el-col>
</el-row> </el-row>
<div id="xrdcard" v-if="currentRiskPostList.length"> <div id="xrdcard" v-if="currentRiskPostList.length">
<el-col :span="5" class="ssss" v-for="(item, index) in currentRiskPostList" :key="index" > <el-col :span="5" class="ssss" v-for="(item, index) in currentRiskPostList" :key="index">
<!--内容--> <!--内容-->
<div class="box-wrap"> <div class="box-wrap">
<!-- 上部 --> <!-- 上部 -->
<div class="box-top"> <div class="box-top">
<!-- 头像 --> <!-- 头像 -->
<div class="top-avator"> <div class="top-avator">
<img src="../../../assets/images/u8518.png"> <img src="../../../assets/images/u8518.png">
</div> </div>
<!-- 锁 --> <!-- 锁 -->
<div class="top-lock"> <div class="top-lock">
<!-- <img src="${ctx}img/patrol/lock.svg">--> <!-- <img src="${ctx}img/patrol/lock.svg">-->
</div>
</div> </div>
<!-- 下部 --> </div>
<div class="box-bottom"> <!-- 下部 -->
<div class="row"> <div class="box-bottom">
<!-- 职位和数据 --> <div class="row">
<el-col :span="16"> <!-- 职位和数据 -->
<div class="con-role"><span class="span-title" :data-myTitle="item.riskPostName">{{item.riskPostName?(item.riskPostName.length>15?item.riskPostName.substring(0,15)+'...':item.riskPostName):'暂无数据'}}</span></div> <el-col :span="16">
</el-col> <div class="con-role"><span class="span-title"
<el-col :span="8"> :data-myTitle="item.riskPostName">{{ item.riskPostName ? (item.riskPostName.length > 15 ? item.riskPostName.substring(0, 15) + '...' : item.riskPostName) : '暂无数据' }}</span>
<!-- <div class="con-record">{{item.finalTypeCount}}类/{{item.finalCount}}</div> --> </div>
</el-col> </el-col>
<!-- 说明 --> <el-col :span="8">
<el-col :span="24" > <!-- <div class="con-record">{{item.finalTypeCount}}类/{{item.finalCount}}</div> -->
<div class="con-explain"><span class="span-title" :data-myTitle="item.riskPostDesc">{{item.riskPostDesc?(item.riskPostDesc.length>15?item.riskPostDesc.substring(0,15)+'...':item.riskPostDesc):'暂无数据'}}</span> </div> </el-col>
</el-col> <!-- 说明 -->
<!-- 姓名 --> <el-col :span="24">
<el-col :span="24" > <div class="con-explain"><span class="span-title"
<div class="con-user"><span class="span-title" :data-myTitle="item.nickName">{{item.nickName?(item.nickName.length>15?item.nickName.substring(0,15)+'...':item.nickName):'暂无数据'}}</span></div> :data-myTitle="item.riskPostDesc">{{ item.riskPostDesc ? (item.riskPostDesc.length > 15 ? item.riskPostDesc.substring(0, 15) + '...' : item.riskPostDesc) : '暂无数据' }}</span>
</el-col>
<!-- 操作 -->
<el-col :span="24" >
<div class="con-operation">
<img class="edit-hover" src="../../../assets/images/edit.svg" @click="handleUpdate(item)">
<img class="delete-hover" src="../../../assets/images/delete.svg" @click="handleDelete(item)">
</div>
</el-col>
</div> </div>
</el-col>
<!-- 姓名 -->
<el-col :span="24">
<div class="con-user"><span class="span-title"
:data-myTitle="item.nickName">{{ item.nickName ? (item.nickName.length > 15 ? item.nickName.substring(0, 15) + '...' : item.nickName) : '暂无数据' }}</span>
</div>
</el-col>
<!-- 操作 -->
<el-col :span="24">
<div class="con-operation">
<img class="edit-hover" src="../../../assets/images/edit.svg" @click="handleUpdate(item)">
<img class="delete-hover" src="../../../assets/images/delete.svg" @click="handleDelete(item)">
</div>
</el-col>
</div> </div>
</div> </div>
</div>
</el-col> </el-col>
</div> </div>
<div v-else class="noData"> <div v-else class="noData">
...@@ -81,10 +76,10 @@ ...@@ -81,10 +76,10 @@
<el-tabs v-model="activeName" @tab-click="tabChange"> <el-tabs v-model="activeName" @tab-click="tabChange">
<el-tab-pane label="基础信息" name="first"> <el-tab-pane label="基础信息" name="first">
<el-form ref="form" :model="form" :rules="rules" label-width="84px"> <el-form ref="form" :model="form" :rules="rules" label-width="84px">
<el-form-item label="岗位名称" prop="riskPostName"> <el-form-item label="岗位名称" prop="riskPostName">
<el-input v-model="form.riskPostName" placeholder="请输入岗位名称" /> <el-input v-model="form.riskPostName" placeholder="请输入岗位名称" />
</el-form-item> </el-form-item>
<!-- <el-form-item label="岗位类型" prop="patrolType"> <!-- <el-form-item label="岗位类型" prop="patrolType">
<el-select v-model="form.patrolType" placeholder="请选择岗位类型" style="width:100%"> <el-select v-model="form.patrolType" placeholder="请选择岗位类型" style="width:100%">
<el-option <el-option
v-for="dict in patrolTypeList" v-for="dict in patrolTypeList"
...@@ -94,64 +89,62 @@ ...@@ -94,64 +89,62 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> --> </el-form-item> -->
<el-form-item label="岗位描述" prop="riskPostDesc"> <el-form-item label="岗位描述" prop="riskPostDesc">
<el-input type="textarea" v-model="form.riskPostDesc" placeholder="请输入岗位描述" /> <el-input type="textarea" v-model="form.riskPostDesc" placeholder="请输入岗位描述" />
</el-form-item> </el-form-item>
<el-form-item label="岗位成员" prop="userId"> <el-form-item label="岗位成员" prop="userId">
<el-select v-model="form.userId" placeholder="请输入岗位成员" style="width:100%" multiple> <el-select v-model="form.userId" placeholder="请输入岗位成员" style="width:100%" multiple>
<el-option <el-option v-for="dict in userList" :key="dict.userId" :label="dict.nickName"
v-for="dict in userList" :value="dict.userId"></el-option>
:key="dict.userId" </el-select>
:label="dict.nickName" </el-form-item>
:value="dict.userId" </el-form>
></el-option>
</el-select>
</el-form-item>
</el-form>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="清单匹配" name="second"> <el-tab-pane label="清单匹配" name="second">
<el-form ref="listForm" :model="listForm" :rules="listRules" label-width="120px" label-position="top"> <el-form ref="listForm" :model="listForm" :rules="listRules" label-width="120px" label-position="top">
<el-form-item label="匹配模式" prop="postState"> <el-form-item label="匹配模式" prop="postState">
<el-radio-group v-model="listForm.postState" @input="radioChange"> <el-radio-group v-model="listForm.postState" @input="radioChange">
<el-radio label="0">一岗一人巡查模式</el-radio> <el-radio label="0">一岗一人巡查模式</el-radio>
<el-radio label="1">一岗多人巡查模式</el-radio> <el-radio label="1">一岗多人巡查模式</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="岗位清单配置" prop="currentRiskTypeList" v-if="listForm.postState == '0'" id="currentRiskTypeList"> <el-form-item label="岗位清单配置" prop="currentRiskTypeList" v-if="listForm.postState == '0'"
<!-- <el-input v-model="listForm.currentRiskTypeList" style="width:80%;margin-right:20px"></el-input> --> id="currentRiskTypeList">
<div style="display:inline-block;width:80%;margin-right:20px;border:1px solid #eee;padding:5px 10px;min-height:40px"> <!-- <el-input v-model="listForm.currentRiskTypeList" style="width:80%;margin-right:20px"></el-input> -->
<span style="display:inline-block;margin-right:10px;line-height:15px;background-color:#1890FF;padding:5px 10px;color:#fff;" v-for="(item, index) in listForm.currentRiskTypeList" :key="index" >{{item.type || item.currentRiskType}}</span> <div
</div> style="display:inline-block;width:80%;margin-right:20px;border:1px solid #eee;padding:5px 10px;min-height:40px">
<el-button type="primary" @click="getPatrolLibrary" style="height:35px">隐患清单库</el-button> <span
</el-form-item> style="display:inline-block;margin-right:10px;line-height:15px;background-color:#1890FF;padding:5px 10px;color:#fff;"
<el-form-item label="岗位清单配置" prop="hdType" v-if="listForm.postState == '1'"> v-for="(item, index) in listForm.currentRiskTypeList" :key="index">{{ item.type ||
<el-table :data="listUserTabel" empty-text="暂无数据,请先在‘基础信息’中选择岗位成员!"> item.currentRiskType }}</span>
<el-table-column type="index" label="序号" width="50"/> </div>
<el-table-column label="姓名" align="center" prop="userName" width="140" :show-overflow-tooltip="true"/> <el-button type="primary" @click="getPatrolLibrary" style="height:35px">隐患清单库</el-button>
<el-table-column label="状态" align="center" prop="status" width="140"> </el-form-item>
<template slot-scope="scope"> <el-form-item label="岗位清单配置" prop="hdType" v-if="listForm.postState == '1'">
<el-switch v-model="scope.row.status" @change="statusChange(scope.$index, $event)"> <el-table :data="listUserTabel" empty-text="暂无数据,请先在‘基础信息’中选择岗位成员!">
</el-switch> <el-table-column type="index" label="序号" width="50" />
</template> <el-table-column label="姓名" align="center" prop="userName" width="140" :show-overflow-tooltip="true" />
</el-table-column> <el-table-column label="状态" align="center" prop="status" width="140">
<el-table-column label="巡查清单" align="center" prop="postNameShow" :show-overflow-tooltip="true"> <template slot-scope="scope">
<template slot-scope="scope"> <el-switch v-model="scope.row.status" @change="statusChange(scope.$index, $event)">
<el-button size="mini" type="text" v-for="(item, index) in scope.row.postNameShow" :key="index" >{{item.type || item.currentRiskType}}</el-button> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="140"> <el-table-column label="巡查清单" align="center" prop="postNameShow" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button size="mini" type="text" v-for="(item, index) in scope.row.postNameShow"
size="mini" :key="index">{{ item.type || item.currentRiskType }}</el-button>
type="text" </template>
icon="el-icon-edit" </el-table-column>
@click="selectList(scope.row, scope.$index)" <el-table-column label="操作" align="center" width="140">
>清单库选择</el-button> <template slot-scope="scope">
</template> <el-button size="mini" type="text" icon="el-icon-edit"
</el-table-column> @click="selectList(scope.row, scope.$index)">清单库选择</el-button>
</el-table> </template>
</el-form-item> </el-table-column>
<p> <span style="color: red;">系统提示:可根据实际情况任意增加或减少巡查类型及巡查内容。</span></p> </el-table>
</el-form-item>
<p> <span style="color: red;">系统提示:可根据实际情况任意增加或减少巡查类型及巡查内容。</span></p>
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -160,83 +153,46 @@ ...@@ -160,83 +153,46 @@
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="选择隐患清单库" :visible.sync="patrolLibraryOpen" width="60%" append-to-body> <el-dialog title="选择隐患清单库" :visible.sync="patrolLibraryOpen" width="60%" append-to-body>
<el-table :data="libraryList" @selection-change="handleSelectionChange" ref="libraryListTabel" :key="isUpdate" row-key="id"> <el-table :data="libraryList" @selection-change="handleSelectionChange" ref="libraryListTabel" :key="isUpdate"
<el-table-column row-key="id">
type="selection" <el-table-column type="selection" width="55" :reserve-selection="true">
width="55" </el-table-column>
:reserve-selection="true"> <el-table-column label="场所位置" width="200" show-overflow-tooltip align="center">
</el-table-column> <template slot-scope="scope">{{ scope.row.buildingName }}{{ scope.row.floorName }}{{ scope.row.roomName
<el-table-column }}</template>
label="场所位置" </el-table-column>
width="200" <el-table-column label="风险源" width="120" align="center">
show-overflow-tooltip <template slot-scope="scope">{{ scope.row.name }}</template>
align="center" </el-table-column>
> <el-table-column label="辨识标准" width="120" show-overflow-tooltip align="center">
<template slot-scope="scope">{{ scope.row.buildingName }}{{ scope.row.floorName }}{{ scope.row.roomName }}</template> <template slot-scope="scope">{{ scope.row.referenceBasis }}</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="存在部位" width="120" align="center">
label="风险源" <template slot-scope="scope">{{ scope.row.presenceLocation }}</template>
width="120" </el-table-column>
align="center" <el-table-column label="风险类型(GB6441)" width="120" show-overflow-tooltip align="center">
> <template slot-scope="scope">{{ scope.row.type }}</template>
<template slot-scope="scope">{{ scope.row.name }}</template> </el-table-column>
</el-table-column> <el-table-column label="风险等级" width="120" align="center">
<el-table-column <template slot-scope="scope">{{ scope.row.level }}</template>
label="辨识标准" </el-table-column>
width="120" <el-table-column label="周期" width="120" align="center" prop="cycle">
show-overflow-tooltip <template slot-scope="scope">
align="center"> <el-select v-model="scope.row.cycle" placeholder="请选择" @change="cycleSelChange">
<template slot-scope="scope">{{ scope.row.referenceBasis }}</template> <el-option v-for="(item, index) in cycleList" :key="index" :label="item.name" :value="item.cycle">
</el-table-column> </el-option>
<el-table-column </el-select>
label="存在部位" </template>
width="120" </el-table-column>
align="center"> </el-table>
<template slot-scope="scope">{{ scope.row.presenceLocation }}</template> <pagination v-show="libraryTotal > 0" :total="libraryTotal" :page.sync="libraryParams.pageNum"
</el-table-column> :limit.sync="libraryParams.pageSize" @pagination="getlibraryList" />
<el-table-column
label="风险类型(GB6441)"
width="120"
show-overflow-tooltip
align="center">
<template slot-scope="scope">{{ scope.row.type }}</template>
</el-table-column>
<el-table-column
label="风险等级"
width="120"
align="center">
<template slot-scope="scope">{{ scope.row.level }}</template>
</el-table-column>
<el-table-column
label="周期"
width="120"
align="center"
prop="cycle">
<template slot-scope="scope">
<el-select v-model="scope.row.cycle" placeholder="请选择" @change="cycleSelChange">
<el-option
v-for="(item, index) in cycleList"
:key="index"
:label="item.name"
:value="item.cycle">
</el-option>
</el-select>
</template>
</el-table-column>
</el-table>
<pagination
v-show="libraryTotal > 0"
:total="libraryTotal"
:page.sync="libraryParams.pageNum"
:limit.sync="libraryParams.pageSize"
@pagination="getlibraryList"
/>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="patrolLibrarySubmit">确 定</el-button> <el-button type="primary" @click="patrolLibrarySubmit">确 定</el-button>
<el-button @click="patrolLibraryOpen = false">取 消</el-button> <el-button @click="patrolLibraryOpen = false">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -265,7 +221,7 @@ export default { ...@@ -265,7 +221,7 @@ export default {
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
patrolLibraryOpen:false, patrolLibraryOpen: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
...@@ -276,51 +232,51 @@ export default { ...@@ -276,51 +232,51 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
}, },
form:{}, form: {},
patrolTypeList:[],// 岗位类型 patrolTypeList: [],// 岗位类型
userList:[], userList: [],
rules:{ rules: {
riskPostName:[{ required: true, message: '请输入岗位名称', trigger: 'blur' }] riskPostName: [{ required: true, message: '请输入岗位名称', trigger: 'blur' }]
}, },
activeName:'first', activeName: 'first',
listRules:{ listRules: {
postState:[{ required: true, message: '请选择匹配模式', trigger: 'change' }] postState: [{ required: true, message: '请选择匹配模式', trigger: 'change' }]
}, },
listForm:{//清单匹配 listForm: {//清单匹配
postState:'0', postState: '0',
currentRiskTypeList:[] currentRiskTypeList: []
} , },
listUserTabel:[], listUserTabel: [],
libraryList:[], libraryList: [],
libraryTotal:0, libraryTotal: 0,
currentRiskList:[], currentRiskList: [],
multipleSelection:[], multipleSelection: [],
cycleList:[ cycleList: [
{ {
name:'日查', name: '日查',
cycle:'0' cycle: '0'
}, },
{ {
name:'周查', name: '周查',
cycle:'1' cycle: '1'
}, },
{ {
name:'月查', name: '月查',
cycle:'2' cycle: '2'
}, },
{ {
name:'季查', name: '季查',
cycle:'3' cycle: '3'
}, },
{ {
name:'年查', name: '年查',
cycle:'4' cycle: '4'
}, },
], ],
isUpdate:false, isUpdate: false,
postList:[], postList: [],
userId:'', userId: '',
userIndex:'' userIndex: ''
}; };
}, },
created() { created() {
...@@ -358,9 +314,9 @@ export default { ...@@ -358,9 +314,9 @@ export default {
this.form = {} this.form = {}
this.activeName = 'first' this.activeName = 'first'
this.listForm = {//清单匹配 this.listForm = {//清单匹配
postState:'0', postState: '0',
currentRiskTypeList:[] currentRiskTypeList: []
} }
this.listUserTabel = [] this.listUserTabel = []
this.libraryParams = { this.libraryParams = {
pageNum: 1, pageNum: 1,
...@@ -407,24 +363,24 @@ export default { ...@@ -407,24 +363,24 @@ export default {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
let params = { let params = {
"projectId":this.$route.params.id, "projectId": this.$route.params.id,
"riskPostCode":this.form.riskPostCode, "riskPostCode": this.form.riskPostCode,
"riskPostName":this.form.riskPostName, "riskPostName": this.form.riskPostName,
"riskPostDesc":this.form.riskPostDesc, "riskPostDesc": this.form.riskPostDesc,
"userId":this.form.userId.join(), "userId": this.form.userId.join(),
"patrolType":this.listForm.postState, "patrolType": this.listForm.postState,
"list":this.postList "list": this.postList
} }
if (this.listForm.postState == '0') { // 一岗一人巡查模式 if (this.listForm.postState == '0') { // 一岗一人巡查模式
params.list = this.postList params.list = this.postList
}else{ } else {
let arr = [] let arr = []
this.listUserTabel.forEach((item) => { this.listUserTabel.forEach((item) => {
arr = [...item.postName, ...arr] arr = [...item.postName, ...arr]
}) })
params.list = arr params.list = arr
} }
// console.log('params==>>',params) // console.log('params==>>',params)
if (this.form.id != null) { if (this.form.id != null) {
params.id = this.form.id params.id = this.form.id
saveCurrentPost(params).then(response => { saveCurrentPost(params).then(response => {
...@@ -444,44 +400,44 @@ export default { ...@@ -444,44 +400,44 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
this.$modal.confirm('是否确认删除?').then(function() { this.$modal.confirm('是否确认删除?').then(function () {
return delCurrentRiskPost(row.id); return delCurrentRiskPost(row.id);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => { });
}, },
// 匹配模式radio // 匹配模式radio
radioChange(e){ radioChange(e) {
if (e == '1') { if (e == '1') {
this.listUserTabel = [] this.listUserTabel = []
let arr = this.form.userId let arr = this.form.userId
arr.forEach((item, index) => { arr.forEach((item, index) => {
let data = { let data = {
userName: this.userList.find( i => i.userId == item).nickName, userName: this.userList.find(i => i.userId == item).nickName,
postName:[], postName: [],
postNameShow:[], postNameShow: [],
userId:item, userId: item,
status:true status: true
} }
this.listUserTabel.push(data) this.listUserTabel.push(data)
}) })
// console.log('this.listUserTabel==>>',this.listUserTabel) // console.log('this.listUserTabel==>>',this.listUserTabel)
} }
}, },
// 一岗一人巡查模式 清单库 // 一岗一人巡查模式 清单库
getPatrolLibrary(){ getPatrolLibrary() {
this.patrolLibraryOpen = true this.patrolLibraryOpen = true
this.getlibraryList() this.getlibraryList()
}, },
getlibraryList(){ getlibraryList() {
getlibraryListFun(this.libraryParams).then(response => { getlibraryListFun(this.libraryParams).then(response => {
this.libraryList = response.rows; this.libraryList = response.rows;
this.libraryList.forEach((item) => { this.libraryList.forEach((item) => {
item.cycle = '0' item.cycle = '0'
}) })
this.libraryTotal = response.total; this.libraryTotal = response.total;
// if (this.listForm.postState == '0') { // if (this.listForm.postState == '0') {
// console.log('翻页postList==>>',this.postList) // console.log('翻页postList==>>',this.postList)
// this.$nextTick(()=>{ // this.$nextTick(()=>{
...@@ -511,15 +467,15 @@ export default { ...@@ -511,15 +467,15 @@ export default {
}); });
}, },
// 选择清单库确定 // 选择清单库确定
patrolLibrarySubmit(){ patrolLibrarySubmit() {
if (this.listForm.postState == '0') { if (this.listForm.postState == '0') {
this.postList = [] this.postList = []
this.listForm.currentRiskTypeList = [] this.listForm.currentRiskTypeList = []
}else{ } else {
this.listUserTabel[this.userIndex].postName = [] this.listUserTabel[this.userIndex].postName = []
this.listUserTabel[this.userIndex].postNameShow = [] this.listUserTabel[this.userIndex].postNameShow = []
} }
console.log('this.multipleSelection==>>',this.multipleSelection) console.log('this.multipleSelection==>>', this.multipleSelection)
this.multipleSelection.forEach((item) => { this.multipleSelection.forEach((item) => {
if (this.listForm.postState == '0') { // 一岗一人巡查模式 if (this.listForm.postState == '0') { // 一岗一人巡查模式
let data = { let data = {
...@@ -527,42 +483,42 @@ export default { ...@@ -527,42 +483,42 @@ export default {
patrolType: item.cycle, patrolType: item.cycle,
} }
this.postList.push(data) this.postList.push(data)
if(!this.listForm.currentRiskTypeList.some( items => items.type === item.type)){ if (!this.listForm.currentRiskTypeList.some(items => items.type === item.type)) {
this.listForm.currentRiskTypeList.push(item) this.listForm.currentRiskTypeList.push(item)
} }
// console.log('清单库确定postList==>>',this.postList) // console.log('清单库确定postList==>>',this.postList)
}else{ // 一岗多人巡查模式 } else { // 一岗多人巡查模式
let data = { let data = {
id: item.id, id: item.id,
patrolType: item.cycle, patrolType: item.cycle,
userId:this.userId, userId: this.userId,
status:this.userStatus ? '0' : '1' status: this.userStatus ? '0' : '1'
} }
this.listUserTabel[this.userIndex].postName.push(data) this.listUserTabel[this.userIndex].postName.push(data)
if(!this.listUserTabel[this.userIndex].postNameShow.some( items => items.type === item.type)){ if (!this.listUserTabel[this.userIndex].postNameShow.some(items => items.type === item.type)) {
this.listUserTabel[this.userIndex].postNameShow.push(item) this.listUserTabel[this.userIndex].postNameShow.push(item)
} }
// console.log('清单库确定listUserTabel==>>',this.listUserTabel) // console.log('清单库确定listUserTabel==>>',this.listUserTabel)
} }
}) })
this.$refs.libraryListTabel.clearSelection() this.$refs.libraryListTabel.clearSelection()
this.patrolLibraryOpen = false this.patrolLibraryOpen = false
}, },
// 状态切换 // 状态切换
statusChange(num, e){ statusChange(num, e) {
// console.log('num==>>', num) // console.log('num==>>', num)
this.listUserTabel.forEach((item, index) => { this.listUserTabel.forEach((item, index) => {
if (index == num) { if (index == num) {
item.postName.forEach((items) => { item.postName.forEach((items) => {
items.status = e ? '0' : '1' items.status = e ? '0' : '1'
}) })
} }
}) })
console.log(',this.listUserTabel==>>',this.listUserTabel) console.log(',this.listUserTabel==>>', this.listUserTabel)
}, },
// 一岗多人巡查模式 清单库 // 一岗多人巡查模式 清单库
selectList(row, index){ selectList(row, index) {
// console.log('row==>>',row) // console.log('row==>>',row)
this.patrolLibraryOpen = true this.patrolLibraryOpen = true
this.userId = row.userId this.userId = row.userId
...@@ -576,177 +532,192 @@ export default { ...@@ -576,177 +532,192 @@ export default {
this.getlibraryList() this.getlibraryList()
}, },
// tabs切换 // tabs切换
tabChange(tab, event){ tabChange(tab, event) {
// console.log('tab==>>',tab.name) // console.log('tab==>>',tab.name)
if (tab.name == 'second' && this.title =='修改现状风险岗位' ) { //清单匹配 if (tab.name == 'second' && this.title == '修改现状风险岗位') { //清单匹配
// 岗位用户巡查清单列表 // 岗位用户巡查清单列表
this.listUserTabel = [] this.listUserTabel = []
this.getCurrentRiskPatrol() this.getCurrentRiskPatrol()
}else{ } else {
this.listForm.postState = '0' this.listForm.postState = '0'
} }
}, },
getCurrentRiskPatrol(){ getCurrentRiskPatrol() {
this.listForm.currentRiskTypeList = [] this.listForm.currentRiskTypeList = []
let params = { let params = {
postId: this.form.id, postId: this.form.id,
pageNum: 1, pageNum: 1,
pageSize: 9999, pageSize: 9999,
} }
getCurrentRiskPatrol(params).then(response => { getCurrentRiskPatrol(params).then(response => {
if (this.listForm.postState == '0') { // 一岗一人巡查模式 if (this.listForm.postState == '0') { // 一岗一人巡查模式
this.postList = [] this.postList = []
this.listForm.currentRiskTypeList = [] this.listForm.currentRiskTypeList = []
response.rows.forEach((item) => { response.rows.forEach((item) => {
let data = { let data = {
id: item.currentRiskId, id: item.currentRiskId,
patrolType: item.patrolType, patrolType: item.patrolType,
} }
this.postList.push(data) this.postList.push(data)
if(!this.listForm.currentRiskTypeList.some( items => items.currentRiskType === item.currentRiskType)){ if (!this.listForm.currentRiskTypeList.some(items => items.currentRiskType === item.currentRiskType)) {
this.listForm.currentRiskTypeList.push(item) this.listForm.currentRiskTypeList.push(item)
} }
}) })
// console.log('postList==>>',this.postList) // console.log('postList==>>',this.postList)
}else{ // 一岗多人巡查模式 } else { // 一岗多人巡查模式
this.listUserTabel = [] this.listUserTabel = []
// this.listUserTabel[this.userIndex].postNameShow = []s // this.listUserTabel[this.userIndex].postNameShow = []s
let arr = this.form.nickName.split(',') let arr = this.form.nickName.split(',')
arr.forEach((item, index) => { arr.forEach((item, index) => {
let data = { let data = {
userName: item, userName: item,
postName:[], postName: [],
postNameShow:[], postNameShow: [],
userId:this.userList.find( i => i.nickName == item).userId, userId: this.userList.find(i => i.nickName == item).userId,
status:'' status: ''
} }
this.listUserTabel.push(data) this.listUserTabel.push(data)
}) })
for (const val of response.rows) { for (const val of response.rows) {
this.listUserTabel.forEach((item) => { this.listUserTabel.forEach((item) => {
if (item.userId == val.userId) { if (item.userId == val.userId) {
item.status = val.status == '0' ? true : false item.status = val.status == '0' ? true : false
if (!item.postNameShow.some( items => items.currentRiskType === val.currentRiskType)) { if (!item.postNameShow.some(items => items.currentRiskType === val.currentRiskType)) {
item.postNameShow.push(val) item.postNameShow.push(val)
} }
let data = { let data = {
id: val.currentRiskId, id: val.currentRiskId,
patrolType: val.patrolType, patrolType: val.patrolType,
userId:val.userId, userId: val.userId,
status: val.status status: val.status
} }
item.postName.push(data) item.postName.push(data)
} }
}) })
} }
// console.log('this.listUserTabel==>>',this.listUserTabel) // console.log('this.listUserTabel==>>',this.listUserTabel)
} }
}) })
}, },
handleSelectionChange(val){ handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
cycleSelChange(){ cycleSelChange() {
this.isUpdate = !this.isUpdate this.isUpdate = !this.isUpdate
} }
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
#xrdcard{ #xrdcard {
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
flex-wrap: wrap; flex-wrap: wrap;
} }
.noData{
display: flex; .noData {
align-items: center; display: flex;
justify-content: center; align-items: center;
flex-direction: column; justify-content: center;
} flex-direction: column;
.ssss{ }
margin-right: 30px;
// display: flex; .ssss {
// justify-content: space-between; margin-right: 30px;
// padding-left: 0 !important; // display: flex;
// padding-right: 0 !important; // justify-content: space-between;
} // padding-left: 0 !important;
.top-avator img{ // padding-right: 0 !important;
width: 90px; }
height: 90px;
} .top-avator img {
.box-wrap { width: 90px;
padding: 20px 0px 20px 0px; height: 90px;
} }
.box-top{
height: 150px; .box-wrap {
display: flex; padding: 20px 0px 20px 0px;
align-items: center; }
justify-content: center;
position: relative; .box-top {
background-color: #3f9f9f; height: 150px;
border: 1px solid #e1e1e1; display: flex;
border-top-left-radius: 10px; align-items: center;
border-top-right-radius: 10px; justify-content: center;
} position: relative;
.top-lock{ background-color: #3f9f9f;
position: absolute; border: 1px solid #e1e1e1;
top: 10px; border-top-left-radius: 10px;
right: 10px; border-top-right-radius: 10px;
} }
.box-bottom{
padding: 15px 10px 10px; .top-lock {
background-color: #ffffff; position: absolute;
border-bottom-left-radius: 10px; top: 10px;
border-bottom-right-radius: 10px; right: 10px;
border: 1px solid #e1e1e1; }
border-top: none;
} .box-bottom {
.row{ padding: 15px 10px 10px;
height: 100%; background-color: #ffffff;
overflow: hidden; border-bottom-left-radius: 10px;
} border-bottom-right-radius: 10px;
border: 1px solid #e1e1e1;
.con-role{ border-top: none;
color: #8c8c8c; }
font-size: 16px;
font-weight: bold; .row {
line-height: 35px; height: 100%;
} overflow: hidden;
.con-record{ }
font-size: 12px;
color: #b3becd; .con-role {
text-align: right; color: #8c8c8c;
} font-size: 16px;
.con-explain{ font-weight: bold;
color: #b3becd; line-height: 35px;
font-size: 12px; }
margin-top: 10px;
cursor:default; .con-record {
} font-size: 12px;
.con-user{ color: #b3becd;
margin-top: 25px; text-align: right;
color: #1d9bd5; }
cursor:default;
} .con-explain {
.con-operation{ color: #b3becd;
margin-top: 20px; font-size: 12px;
text-align: right; margin-top: 10px;
} cursor: default;
.con-operation img{ }
width: 18px;
height: 19px; .con-user {
margin-left: 10px; margin-top: 25px;
cursor: pointer; color: #1d9bd5;
} cursor: default;
::v-deep .el-form-item--medium .el-form-item__content{ }
margin-left: 20px;
} .con-operation {
#currentRiskTypeList ::v-deep .el-form-item__content { margin-top: 20px;
display: flex; text-align: right;
align-items: center; }
justify-content: space-between;
} .con-operation img {
width: 18px;
height: 19px;
margin-left: 10px;
cursor: pointer;
}
::v-deep .el-form-item--medium .el-form-item__content {
margin-left: 20px;
}
#currentRiskTypeList ::v-deep .el-form-item__content {
display: flex;
align-items: center;
justify-content: space-between;
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment