panzy
2022-05-21 c1df656dee7e75d109d2bee05f0c129e13e9367a
src/views/careabout/index.vue
@@ -1,6 +1,6 @@
<template>
    <div class="app-container">
       <el-form ref="form" :inline="true" class="inquire" :model="form" label-width="100px">
       <el-form ref="form" :inline="true" class="inquire" :model="listQuery.form" label-width="100px">
            <el-form-item label="编号">
                <el-input v-model="listQuery.form.number" style="width:202px" placeholder="请输入内容"></el-input>
            </el-form-item>
@@ -96,7 +96,7 @@
                </el-select>
            </el-form-item>
            <el-form-item label="深入现场情况">
                <el-select v-model="listQuery.form.DTRisk_bankId" placeholder="请选择">
                <el-select v-model="listQuery.form.class_situation" placeholder="请选择">
                    <el-option
                        v-for="item in reList"
                        :key="item.value"
@@ -135,9 +135,8 @@
            </el-form-item>
            <el-form-item style="text-align:center;padding:0 50px">
                <el-button type="primary" class="btns" size="small" icon="el-icon-search" @click="getPageList()">查询</el-button>
                <el-button type="primary" class="btns" size="small" icon="
el-icon-refresh-right" @click="reset()">重置</el-button>
                <el-button type="primary" class="btns" size="small" icon="el-icon-upload2">导出excel</el-button>
                <el-button type="primary" class="btns" size="small" icon="el-icon-refresh-right" @click="reset()">重置</el-button>
                <el-button type="primary" class="btns" size="small" icon="el-icon-upload2" @click="exportData()">导出excel</el-button>
            </el-form-item>
        </el-form>
     <el-row class="title-center">
@@ -150,19 +149,19 @@
            </el-col>
            <div v-if="table1">
            <el-col :span="14" style="text-align:right;">
                <el-button class="btns" type="primary" size="small" >特别关注</el-button>
                <el-button class="btns" type="primary" size="small" @click="specialFocus()">{{focusDesc}}</el-button>
                <el-button class="btns" type="primary" size="small" @click="sendBath()">管理关注</el-button>
            </el-col>
            </div>
        </el-row>
       <el-table :data="tableData" style="width: 100%"  @selection-change="changeBox">
       <el-table :data="tableData" style="width: 100%"  @selection-change="handleSelectionChange">
            <el-table-column type="selection" width="55" align="center"></el-table-column>
            <el-table-column prop="number" label="编号" align="center" width="120"></el-table-column>
            <el-table-column prop="check_branch" label="检查部门" align="center" width="120"></el-table-column>
            <el-table-column prop="check_man" label="检查人" align="center" width="120"></el-table-column>
            <el-table-column prop="checktype" label="检查类别" align="center"></el-table-column>
            <el-table-column label="隐患项目" align="center">
                <el-table-column prop="check_date" label="检查时间" width="120" align="center"></el-table-column>
                <el-table-column prop="check_date" label="检查时间" :formatter="formatColumnDate" width="120" align="center"></el-table-column>
                <el-table-column prop="address" label="地点" align="center"> </el-table-column>
                <el-table-column prop="ht_content" label="内容" align="center"> </el-table-column>
                <el-table-column prop="ht_typesub" label="类别" align="center"> </el-table-column>
@@ -172,21 +171,21 @@
                <el-table-column prop="measure" label="整改措施" align="center"> </el-table-column>
                <el-table-column prop="ht_branch" label="隐患部门" align="center"> </el-table-column>
                <el-table-column prop="duty_officer" label="责任人" align="center"> </el-table-column>
                <el-table-column prop="alter_time" label="限改时间" width="120" align="center"></el-table-column>
                <el-table-column prop="alter_time" label="限改时间" :formatter="formatColumnDate" width="120" align="center"></el-table-column>
                <el-table-column prop="ht_level" label="级别" align="center"> </el-table-column>
            </el-table-column>
            <el-table-column label="整改情况" align="center">
                <el-table-column prop="ACCOMPLISHTIME" label="完成时间" width="110px" align="center"> </el-table-column>
                <el-table-column prop="ACCOMPLISHTIME" label="完成时间" :formatter="formatColumnDate" width="110px" align="center"> </el-table-column>
                <el-table-column prop="CALLBACKRESULT" label="复查结果" align="center"> </el-table-column>
                <el-table-column prop="CALLBACKPERSON" label="复查人" align="center"> </el-table-column>
                <el-table-column prop="CALLBACKTIME" label="复查时间"  width="120" align="center"></el-table-column>
                <el-table-column prop="CALLBACKTIME" label="复查时间" :formatter="formatColumnDate" width="120" align="center"></el-table-column>
            </el-table-column>
            <el-table-column  label="隐患处理状态" align="center">
                <template slot-scope="scope">
                    <span v-if="scope.row.step =='1'">初始状态</span>
                    <span v-if="scope.row.step =='2'">整改中</span>
                    <span v-if="scope.row.step =='3'">复查中</span>
                    <span v-if="scope.row.step =='end'">处理结束</span>
                    <span v-if="scope.row.step =='END'">处理结束</span>
                </template>
            </el-table-column>
            <el-table-column prop="DTRisk_bankId" label="是否关联" align="center">
@@ -227,8 +226,8 @@
    </div>
</template>
<script>
    import { getPageList, analogy_export_do} from "@/api/sgyhpczl/oneFromanotherN"
    import {initJCBM, initYHLX, initJCLB, initYHJB} from "@/api/sgyhpczl/initSelect";
import { getPageList, analogy_export_do, focus_do} from "@/api/sgyhpczl/careabout"
import {initJCBM ,initYHLX, initBC ,initJCLB ,initYHBM ,initYHJB,initLlr} from "@/api/sgyhpczl/initSelect";
    export default{
        data(){
@@ -237,21 +236,26 @@
                    page:1,
                    limit:10,
                    type: 0,
                    form:{},
                    form:{
                        ht_community:'众泰煤焦化'
                    },
                },
                radio1:'待发送',
                table1:true,
                table2:false,
                focusDesc: '特别关注',
                currentPage: 1,
                pageSize: 10,
                recordTotal: 0,
                XFDWList:[],
                YHLBList:[],
                YHJBList:[],
                JCDWList:[{label:"众泰煤焦化",value:0},{label:"上级单位",value:1}],
                JCBMList:[],
                YHLXList:[],
                BCList:[],
                reList:[{label:"值班",value:"值班"},{label:"带班",value:"带班"}],
                JCLBList:[],
                YHBMList:[],
                YHJBList:[],
                tableData:[],
                selectedList:[],
                listLoading: false,
@@ -271,15 +275,17 @@
        },
        mounted() {
            this.getPageList();
            this.initJCLB();
            this.initXFDW();
            this.initYHLX();
            this.initYHJB();
            this.initYHLB();
            this.initBC();
            this.initJCLB();
            this.initLlr();
            this.initYHBM();
        },
        methods:{
            sendBath(){
                this.$router.push({
                    path:'/existN'
                    path:'/managementConcerns'
                })
            },
            handleClick(data,val){
@@ -301,19 +307,10 @@
                    this.table2=false
                }
            },
            initXFDW(){
                initJCBM(1).then(res=>{
                    if (res.data.ok==1){
                        this.XFDWList=res.data.data
                    } else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            },
            initYHLB(){
            initYHLX(){
                initYHLX().then(res=>{
                    if (res.data.ok==1){
                        this.YHLBList=res.data.data
                        this.YHLXList=res.data.data
                    } else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
@@ -328,10 +325,46 @@
                    }
                })
            },
            initBC(){
                initBC().then(res=>{
                    if (res.data.ok==1){
                        this.BCList=res.data.data
                    } else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            },
            initJCLB(){
                initJCLB().then(res=>{
                    if (res.data.ok==1){
                        this.JCLBList=res.data.data
                    } else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            },
            initYHBM(){
                initYHBM().then(res=>{
                    if (res.data.ok==1){
                        this.YHBMList=res.data.data
                    } else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            },
            initLlr(){
                initLlr().then(res=>{
                    if (res.data.ok==1){
                        this.llrList=res.data.data
                    } else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            },
            changeJCDW(val){
                initJCBM(val).then(res=>{
                    if (res.data.ok==1){
                        this.JCBMList=res.data.data
                    } else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
@@ -369,7 +402,7 @@
            },
            //重置
            reset(){
                this.listQuery.form={};
                this.listQuery.form = {ht_community: "众泰煤焦化"}
                this.getPageList()
            },
            handleSizeChange(val){
@@ -393,6 +426,11 @@
            },
            typeChange(val){
                this.listQuery.type = val;
                if (val == 1){
                    this.focusDesc = '取消关注'
                }else {
                    this.focusDesc = '特别关注'
                }
                this.getPageList()
            },
            handleSelectionChange(val){
@@ -411,7 +449,7 @@
                    var downloadElement = document.createElement('a')
                    var href = window.URL.createObjectURL(blob) //创建下载的链接
                    downloadElement.href = href
                    downloadElement.download = '内部举一反三.xlsx' //下载后文件名
                    downloadElement.download = '关注的隐患.xlsx' //下载后文件名
                    document.body.appendChild(downloadElement)
                    downloadElement.click() //点击下载
                    document.body.removeChild(downloadElement) //下载完成移除元素
@@ -420,6 +458,30 @@
                    console.log(err)
                })
            },
            //特别关注/取消关注
            specialFocus(){
                if (this.selectedList == null || this.selectedList.length == 0) {
                    this.$message({type: 'warning', message: '至少选中一条数据', duration: 3000})
                    return
                }
                var ids = this.selectedList.map((obj) => {
                    return obj.id
                }).join(",")
                var type = this.listQuery.type == '1' ? 'del' : 'add'
                let data = {
                    type: type,
                    ids: ids,
                }
                focus_do(data).then(() => {
                    this.getPageList()
                    this.$notify({
                        title: "成功",
                        message: "操作成功",
                        type: "success",
                        duration: 2000,
                    });
                });
            },
            //日期格式转换
            formatColumnDate(row, column) {
                // 获取单元格数据