123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472 |
- <!-- 自查隐患 -->
- <template>
- <div class="app-container selfInspectionHazard">
- <div class="page-container selfInspectionHazardPage" v-if="pageType === 1">
- <div class="top-table-button-box">
- <div :class="rectifyStatus === null ? 'tableCheck':''" @click="tableCheck(null)">
- <p>全部</p>
- <p></p>
- </div>
- <div :class="rectifyStatus === 2 ? 'tableCheck':''" @click="tableCheck(2)">
- <p>待整改</p>
- <p></p>
- </div>
- <div :class="rectifyStatus === 1 ? 'tableCheck':''" @click="tableCheck(1)">
- <p>已整改</p>
- <p></p>
- </div>
- <div :class="rectifyStatus === 4 ? 'tableCheck':''" @click="tableCheck(4)">
- <p>暂无法整改</p>
- <p></p>
- </div>
- <div :class="rectifyStatus === 5 ? 'tableCheck':''" @click="tableCheck(5)">
- <p>多次整改未完成</p>
- <p></p>
- </div>
- </div>
- <div class="page-form-title-box" style="border:none;" :class="advancedType?'page-advanced-form-title-box':''">
- <el-form :model="queryParams" class="form-box" ref="queryForm"
- :inline="true" style="width:100%;">
- <el-form-item label="" prop="planTitle">
- <el-input
- maxLength="30"
- v-model="queryParams.planTitle"
- placeholder="计划标题"
- style="width: 150px"
- />
- </el-form-item>
- <el-form-item label="" prop="hazardCheckPro">
- <el-cascader
- style="width: 150px"
- placeholder="检查指标"
- v-model="queryParams.hazardCheckPro"
- filterable
- :show-all-levels="false"
- :options="cascaderData"
- :props="{ value: 'id', label: 'labelName',emitPath:false }"
- ></el-cascader>
- </el-form-item>
- <el-form-item label="" prop="hazardCheckName">
- <el-input
- maxLength="30"
- v-model="queryParams.hazardCheckName"
- placeholder="模糊搜索检查指标项"
- style="width: 160px"
- />
- </el-form-item>
- <el-form-item label="" prop="deptId">
- <el-select v-model="queryParams.deptId" placeholder="学院单位" style="width: 170px">
- <el-option
- v-for="dict in deptOption"
- :key="dict.deptId"
- :label="dict.deptName"
- :value="dict.deptId"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="" prop="levelId">
- <el-select v-model="queryParams.levelId" placeholder="安全分级" style="width: 160px">
- <el-option
- v-for="dict in levelOption"
- :key="dict.levelId"
- :label="dict.levelName"
- :value="dict.levelId"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="" prop="searchValue">
- <el-input
- maxLength="30"
- v-model="queryParams.searchValue"
- placeholder="实验室/房间号"
- style="width: 140px"
- />
- </el-form-item>
- <el-form-item label="" prop="rectifyName">
- <el-input
- maxLength="30"
- v-model="queryParams.rectifyName"
- placeholder="整改人"
- style="width: 140px"
- />
- </el-form-item>
- <el-form-item label="" prop="state">
- <el-date-picker
- :clearable="false"
- v-model="dateRange"
- size="small"
- style="width: 230px"
- value-format="yyyy-MM-dd"
- type="daterange"
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- ></el-date-picker>
- </el-form-item>
- <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
- <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
- </el-form>
- </div>
- <div class="page-content-box" style="padding-top:0;">
- <el-table class="table-box" v-loading="loading" border :data="dataList">
- <el-table-column label="序号" type="index" width="60"/>
- <el-table-column label="计划标题" prop="planTitle" width="250" show-overflow-tooltip/>
- <el-table-column label="检查类型" prop="checkTypeName" width="100" show-overflow-tooltip/>
- <el-table-column label="不符合项" prop="hazardCheckName" width="250" show-overflow-tooltip>
- <template slot-scope="scope">
- <span>{{scope.row.hazardCheckName}} {{scope.row.hazardCheckName}}</span>
- </template>
- </el-table-column>
- <el-table-column label="实验室" prop="subName" width="220" show-overflow-tooltip/>
- <el-table-column label="整改期限" prop="rectifyDeadline" width="130" show-overflow-tooltip/>
- <el-table-column label="整改状态" prop="rectifyStatus" width="130" show-overflow-tooltip>
- <template slot-scope="scope">
- <span>{{scope.row.rectifyStatus == 1?'已完成':(scope.row.rectifyStatus == 2?'待整改':(scope.row.rectifyStatus == 3?'待复核':(scope.row.rectifyStatus == 4?'暂无法整改':'')))}}</span>
- </template>
- </el-table-column>
- <el-table-column label="整改人" prop="rectifyName" width="100" show-overflow-tooltip/>
- <el-table-column label="整改时间" prop="rectifyTime" width="150" show-overflow-tooltip>
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.rectifyTime,"{y}-{m}-{d} {h}:{i}") }}</span>
- </template>
- </el-table-column>
- <el-table-column label="复查结果" prop="reviewStatus" width="130" show-overflow-tooltip>
- <template slot-scope="scope">
- <span>{{ scope.row.reviewStatus ==1 ?'已复查':(scope.row.reviewStatus ==0 ?'未复查':'') }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="100" show-overflow-tooltip >
- <template slot-scope="scope">
- <div class="table-button-box">
- <p class="table-button-null"></p>
- <p class="table-button-p"
- @click="tableButton(2,scope.row)"
- >详情/整改</p>
- <p class="table-button-null"></p>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <pagination :page-sizes="[20, 30, 40, 50]"
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.page"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- </div>
- </div>
- <!--<add-page :propsData="propsData" v-if="pageType === 2"></add-page>-->
- </div>
- </template>
- <script>
- import {
- getDeptDropList,
- laboratoryClassLevelGetList,
- } from '@/api/commonality/permission'
- import {
- securityCheckOptionList,
- securityCheckDangerList,
- } from "@/api/safetyCheck/indexDemoOne";
- //import addPage from "./addPage.vue";
- export default {
- name: 'index',
- //components: {
- // addPage
- //},
- data () {
- return {
- tableButtonType:this.hasPermiDom(['demo:demo:detail','demo:demo:edit','demo:demo:del',]),
- //页面状态
- pageType:1,
- //选项卡状态
- rectifyStatus:null,
- //页面遮罩
- loading:false,
- //学院列表
- deptOption:[],
- //分级下拉列表
- levelOption:[],
- //检查项下拉列表
- cascaderData:[],
- //查询条件
- queryParams:{
- page:1,
- pageSize:20,
- checkCategory:2,
- planTitle:"",
- hazardCheckPro :null,
- hazardCheckName :"",
- deptId :null,
- levelId :null,
- searchValue :"",
- },
- //时间数据
- dateRange:[],
- advancedType:false,
- //列表数据
- dataList:[],
- //数据数量
- total:0,
- //组件传参
- propsData:{},
- }
- },
- created () {
- this.getDeptDropList();
- this.laboratoryClassLevelGetList();
- this.securityCheckOptionList();
- },
- mounted () {
- this.getList();
- },
- methods: {
- //选项卡切换
- tableCheck(type){
- if (this.rectifyStatus !== type){
- this.$set(this,'rectifyStatus',type);
- this.resetQuery();
- }
- },
- //查询按钮
- handleQuery(){
- this.$set(this.queryParams,'page',1);
- this.getList();
- },
- //重置按钮
- resetQuery(){
- this.$set(this,'dateRange',[])
- this.$set(this,'queryParams',{
- page:1,
- pageSize:20,
- checkCategory:2,
- planTitle:"",
- hazardCheckPro :null,
- hazardCheckName :"",
- deptId :null,
- levelId :null,
- searchValue :"",
- });
- this.getList();
- },
- //获取数据列表
- getList(){
- this.$set(this,'loading',true);
- let obj = JSON.parse(JSON.stringify(this.queryParams))
- obj.rectifyStatus = this.rectifyStatus;
- if(this.dateRange[0]){
- obj.startTime = this.dateRange[0]+'T00:00:00'
- obj.endTime = this.dateRange[1]+'T23:59:59'
- }else{
- obj.startTime = "";
- obj.endTime = "";
- }
- securityCheckDangerList(obj).then(response => {
- this.$set(this,'loading',false);
- this.$set(this,'dataList',response.data.records);
- this.$set(this,'total',response.data.total);
- });
- },
- //操作按钮
- tableButton(type,row){
- let self = this;
- if(type == 1){
- //新增
- this.$set(this,'pageType',2);
- this.$set(this,'propsData',{});
- }else if(type == 2){
- //详情
- this.$set(this,'pageType',2);
- let obj = JSON.parse(JSON.stringify(row))
- obj.showType = true;
- this.$set(this,'propsData',obj);
- }else if(type == 3){
- //编辑
- this.$set(this,'pageType',2);
- let obj = JSON.parse(JSON.stringify(row))
- obj.showType = false;
- this.$set(this,'propsData',obj);
- }else if(type == 4){
- //删除
- this.$confirm('是否确认删除?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- }).then(() => {
- deleteFunction({id:row.id}).then(response => {
- self.msgSuccess(response.message)
- self.getList();
- });
- }).catch(() => {});
- }else if(type == 5){
- //启用&停用
- let text = row.state ? "停用" : "启用";
- this.$confirm('是否确认' + text + '?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- }).then(() => {
- stateFunction({id:row.id,state:!row.state,}).then(response => {
- self.msgSuccess(response.message)
- self.getList();
- });
- }).catch(() => {});
- }else if(type == 6){
- //返回并刷新
- this.$set(this,'pageType',1);
- this.getList();
- }
- },
- //学院列表
- getDeptDropList() {
- getDeptDropList({ deptName: '', level: 2, deptType: 1 }).then(response => {
- this.$set(this, 'deptOption', response.data)
- })
- },
- //分级下拉列表
- laboratoryClassLevelGetList(){
- laboratoryClassLevelGetList({}).then(response => {
- this.$set(this,'levelOption',response.data);
- });
- },
- //检查项列表
- securityCheckOptionList() {
- securityCheckOptionList({}).then(response => {
- let list = this.getCascaderData(JSON.parse(JSON.stringify(response.data)),3)
- this.$nextTick(()=>{
- this.$set(this, 'cascaderData', list)
- })
- })
- },
- //检查项格式处理
- getCascaderData(list,type) {
- let self = this
- for (let i = 0; i < list.length; i++) {
- list[i].labelName = list[i].code ? list[i].code + ' ' + list[i].name : list[i].name
- if(list[i].level == type){
- delete list[i].children
- }else if (list[i].children) {
- if (list[i].children[0]) {
- list[i].children = self.getCascaderData(list[i].children,type)
- } else {
- list.splice(i, 1)
- i--
- }
- } else {
- list.splice(i, 1)
- i--
- }
- }
- for (let i = 0; i < list.length; i++) {
- list[i].labelName = list[i].code ? list[i].code + ' ' + list[i].name : list[i].name
- if(list[i].level == type){
- delete list[i].children
- }else if (list[i].children) {
- if (list[i].children[0]) {
- list[i].children = self.getCascaderData(list[i].children,type)
- } else {
- list.splice(i, 1)
- i--
- }
- } else {
- list.splice(i, 1)
- i--
- }
- }
- for (let i = 0; i < list.length; i++) {
- list[i].labelName = list[i].code ? list[i].code + ' ' + list[i].name : list[i].name
- if(list[i].level == type){
- delete list[i].children
- }else if (list[i].children) {
- if (list[i].children[0]) {
- list[i].children = self.getCascaderData(list[i].children,type)
- } else {
- list.splice(i, 1)
- i--
- }
- } else {
- list.splice(i, 1)
- i--
- }
- }
- return list
- },
- },
- }
- </script>
- <style scoped lang="scss">
- .selfInspectionHazard{
- .selfInspectionHazardPage{
- .top-table-button-box{
- display: flex;
- padding:0 40px;
- border-bottom: 1px solid #dedede;
- div{
- cursor: pointer;
- padding:20px 0 20px 0;
- margin-right:30px;
- p:nth-child(1){
- font-size:16px;
- color:#333;
- padding:0 15px;
- line-height:36px;
- height:36px;
- }
- p:nth-child(2){
- height:4px;
- border-radius:4px;
- }
- }
- .tableCheck{
- p:nth-child(1){
- color:#0045AF;
- }
- p:nth-child(2){
- background-color: #0045AF;
- }
- }
- }
- .form-button-max-big-box-me{
- display: inline-block;
- overflow: hidden;
- margin-right:10px;
- .form-button-big-box-me{
- display: flex;
- div{
- position: relative;
- height:40px;
- width:100px;
- line-height: 40px;
- text-align: center;
- color:#999;
- font-size:14px;
- border:1px solid #999;
- border-radius:4px;
- font-weight:500;
- cursor: pointer;
- .icon-p-me{
- 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-me{
- color:#0183FA!important;
- border:1px solid #0183FA!important;
- }
- }
- }
- }
- }
- </style>
|