lyfO_o
2022-06-09 44d7a737dc0d63ad1dd7c52d45fc2233d1950173
Merge remote-tracking branch 'remotes/origin/shf' into master

# Conflicts:
# src/permission.js
# src/router/index.js
已修改30个文件
已添加25个文件
已删除1个文件
13726 ■■■■■ 文件已修改
package.json 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/Issuedbysuperiors.js 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/careabout.js 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/chartAnalysis.js 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/delayHiddenDangerRectification.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/fileUtils.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/hiddenDangerManagement.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/hiddenDangerRegistration.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/hiddenDangerTroubleshootingList.js 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/initSelect.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/majorHidden.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/oneFromanother.js 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/oneFromanotherN.js 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/recheckCancellationNumber.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/safetyHazardAccount.js 123 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/summaryPotentialSafetyHzards.js 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/troubleshooting.js 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/permission.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 542 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Issuedbysuperiors/index.vue 476 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Issuedbysuperiors/superiorsSend.vue 565 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/careabout/index.vue 577 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/careabout/managementConcerns.vue 240 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/chartAnalysis/index.vue 916 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/common/jdSelect.vue 394 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dangerDetails/dnagerDetails.vue 142 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/delayHiddenDangerRectification/index.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/delayHiddenDangerRectification/rectificationDelayHiddenDanger.vue 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hiddenDangerManagement/fillRectificationAdd.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hiddenDangerManagement/index.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hiddenDangerRectification/index.vue 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hiddenDangerRectification/sendHiddenDangerList.vue 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hiddenDangerRegistration/hiddenDangerAdd.vue 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hiddenDangerReview/recheckCancellationNumber.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hiddenDangerReview/recheckHiddenDangerList.vue 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hiddenDangerTroubleshootingList/index.vue 143 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hiddenDangerTroubleshootingList/preview.vue 178 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/oneFromanother/exist.vue 270 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/oneFromanother/index.vue 350 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/oneFromanotherN/addDanger.vue 359 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/oneFromanotherN/existN.vue 1181 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/oneFromanotherN/index.vue 721 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safetyHazardAccount/Dualbase.vue 760 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safetyHazardAccount/DualbaseLost.vue 554 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safetyHazardAccount/accountSend.vue 382 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safetyHazardAccount/hazardSource.vue 276 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safetyHazardAccount/index.vue 766 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safetyHazardAccount/inferOtherThings.vue 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safetyHazardAccount/safetyedit.vue 653 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safetyHazardAccount/superiorsSend.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safetyHazardAccount/supervision.vue 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/summaryPotentialSafetyHzards/index.vue 487 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/summaryPotentialSafetyHzards/summaryForm.vue 386 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/summaryPotentialSafetyHzards/summaryList.vue 377 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/troubleshooting/index.vue 655 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json
@@ -45,6 +45,8 @@
    "ezuikit-js": "^0.2.3",
    "file-saver": "^1.3.8",
    "fuse.js": "3.4.2",
    "highcharts": "^10.1.0",
    "highcharts-vue": "^1.4.0",
    "jquery": "^3.6.0",
    "js-cookie": "2.2.0",
    "jsbarcode": "^3.11.4",
src/api/sgyhpczl/Issuedbysuperiors.js
对比新文件
@@ -0,0 +1,103 @@
import request from '@/utils/request';
import {getTokenAndVerify} from "@/api/sgyhpczl/auth";
export function getPageList(data) {
    var arr=[]
    /*编号*/
    if(data.form.number!=null && data.form.number!=''){
        arr.push({field:"number",value:data.form.number,type:'TXT'})
    }
    /*编号*/
    if(data.form.step!=null && data.form.step!=''){
        arr.push({field:"step",value:data.form.step,type:'TXT'})
    }
    /*检查单位*/
    if(data.form.check_main_branch!=null && data.form.check_main_branch!=''){
        arr.push({field:"check_main_branch",value:data.form.check_main_branch,type:'OPT'})
    }
    /*检查部门*/
    if(data.form.check_branch!=null && data.form.check_branch!=''){
        arr.push({field:"check_branch",value:data.form.check_branch,type:'OPT'})
    }
    /*检查人*/
    if(data.form.check_man!=null && data.form.check_man!=''){
        arr.push({field:"check_man",value:data.form.check_man,type:'TXT'})
    }
    /*隐患单位*/
    if(data.form.ht_community!=null && data.form.ht_community!=''){
        arr.push({field:"ht_community",value:data.form.ht_community,type:'TXT'})
    }
    /*隐患部门*/
    if(data.form.ht_branch!=null && data.form.ht_branch!=''){
        arr.push({field:"ht_branch",value:data.form.ht_branch,type:'OPT'})
    }
    /*隐患类别*/
    if(data.form.ht_typesub!=null && data.form.ht_typesub!=''){
        arr.push({field:"ht_typesub",value:data.form.ht_typesub,type:'OPT'})
    }
    /*隐患级别*/
    if(data.form.ht_level!=null && data.form.ht_level!=''){
        arr.push({field:"ht_level",value:data.form.ht_level,type:'OPT'})
    }
    /*检查类型*/
    if(data.form.checktype!=null && data.form.checktype!=''){
        arr.push({field:"checktype",value:data.form.checktype,type:'OPT'})
    }
    /*隐患地点*/
    if(data.form.address!=null && data.form.address!=''){
        arr.push({field:"address",value:data.form.address,type:'TXT'})
    }
    /*隐患内容*/
    if(data.form.ht_content!=null && data.form.ht_content!=''){
        arr.push({field:"ht_content",value:data.form.ht_content,type:'TXT'})
    }
    /*班次*/
    if(data.form.check_class!=null && data.form.check_class!=''){
        arr.push({field:"check_class",value:data.form.check_class,type:'OPT'})
    }
    /*是否关联*/
    if(data.form.DTRisk_bankId!=null){
        arr.push({field:"DTRisk_bankId",value:data.form.DTRisk_bankId,type:'OPT'})
    }
    /*录入人*/
    if(data.form.createBy!=null && data.form.createBy!=''){
        arr.push({field:"Created_by",value:data.form.createBy,type:'OPT'})
    }
    /*检查时间*/
    if(data.form.check_dateStart!=null && data.form.check_dateStart!='' && data.form.check_dateEnd!=null && data.form.check_dateEnd!=''){
        arr.push({field:"check_date",value:data.form.check_dateStart+"至"+data.form.check_dateEnd,type:'DAT'})
    }
    /*限改时间*/
    if(data.form.alter_timeStart!=null && data.form.alter_timeStart!='' && data.form.alter_timeEnd!=null && data.form.alter_timeEnd!=''){
        arr.push({field:"alter_time",value:data.form.alter_timeStart+"至"+data.form.alter_timeEnd,type:'DAT'})
    }
    data.query_condition=arr
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/danger/company_list",
        contentType: "application/json",
        method: 'POST',
        data
    });
}
//保存延期申请
export function company_next_step_do(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/danger/company_next_step_do",
        contentType: "application/json",
        method: 'POST',
        data,
    });
}
src/api/sgyhpczl/careabout.js
对比新文件
@@ -0,0 +1,119 @@
import request from '@/utils/request';
import {getTokenAndVerify} from "@/api/sgyhpczl/auth";
export function getPageList(data) {
    var arr=[]
    /*编号*/
    if(data.form.number!=null && data.form.number!=''){
        arr.push({field:"number",value:data.form.number,type:'TXT'})
    }
    /*检查单位*/
    if(data.form.check_main_branch!=null && data.form.check_main_branch!=''){
        arr.push({field:"check_main_branch",value:data.form.check_main_branch,type:'OPT'})
    }
    /*检查部门*/
    if(data.form.check_branch!=null && data.form.check_branch!=''){
        arr.push({field:"check_branch",value:data.form.check_branch,type:'OPT'})
    }
    /*检查人*/
    if(data.form.check_man!=null && data.form.check_man!=''){
        arr.push({field:"check_man",value:data.form.check_man,type:'TXT'})
    }
    /*隐患单位*/
    if(data.form.ht_community!=null && data.form.ht_community!=''){
        arr.push({field:"ht_community",value:data.form.ht_community,type:'OPT'})
    }
    /*隐患部门*/
    if(data.form.ht_branch!=null && data.form.ht_branch!=''){
        arr.push({field:"ht_branch",value:data.form.ht_branch,type:'OPT'})
    }
    /*隐患类别*/
    if(data.form.ht_typesub!=null && data.form.ht_typesub!=''){
        arr.push({field:"ht_typesub",value:data.form.ht_typesub,type:'OPT'})
    }
    /*隐患级别*/
    if(data.form.ht_level!=null && data.form.ht_level!=''){
        arr.push({field:"ht_level",value:data.form.ht_level,type:'OPT'})
    }
    /*检查类别*/
    if(data.form.checktype!=null && data.form.checktype!=''){
        arr.push({field:"checktype",value:data.form.checktype,type:'OPT'})
    }
    /*隐患地点*/
    if(data.form.address!=null && data.form.address!=''){
        arr.push({field:"address",value:data.form.address,type:'TXT'})
    }
    /*隐患内容*/
    if(data.form.ht_content!=null && data.form.ht_content!=''){
        arr.push({field:"ht_content",value:data.form.ht_content,type:'TXT'})
    }
    /*班次*/
    if(data.form.check_class!=null && data.form.check_class!=''){
        arr.push({field:"check_class",value:data.form.check_class,type:'OPT'})
    }
    /*深入现场情况*/
    if(data.form.class_situation!=null && data.form.class_situation!=''){
        arr.push({field:"class_situation",value:data.form.class_situation,type:'OPT'})
    }
    /*检查时间*/
    if(data.form.check_dateStart!=null && data.form.check_dateStart!='' && data.form.check_dateEnd!=null && data.form.check_dateEnd!=''){
        arr.push({field:"check_date",value:data.form.check_dateStart+"至"+data.form.check_dateEnd,type:'DAT'})
    }
    /*限改时间*/
    if(data.form.alter_timeStart!=null && data.form.alter_timeStart!='' && data.form.alter_timeEnd!=null && data.form.alter_timeEnd!=''){
        arr.push({field:"alter_time",value:data.form.alter_timeStart+"至"+data.form.alter_timeEnd,type:'DAT'})
    }
    data.query_condition=arr
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/danger/focus_list",
        contentType: "application/json",
        method: 'POST',
        data
    });
}
//标签
export function danger_focus_tag() {
    return request({
        headers: {
            'token': getTokenAndVerify().token,
            'verify': getTokenAndVerify().verify
        },
        url: '/taboi/user/danger_focus_tag',
        method: 'GET',
        contentType: "multipart/form-data",
    });
}
//导出
export function analogy_export_do(data) {
    return request({
        headers: {
            'token': getTokenAndVerify().token,
            'verify': getTokenAndVerify().verify
        },
        url: '/taboi/excel/danger_export_do',
        method: 'POST',
        responseType: 'arraybuffer',
        data
    });
}
//添加/取消关注
export function focus_do(data) {
    return request({
        headers: {
            'token': getTokenAndVerify().token,
            'verify': getTokenAndVerify().verify
        },
        url: '/taboi/danger/focus_do',
        method: 'POST',
        contentType: "application/json",
        data
    });
}
src/api/sgyhpczl/chartAnalysis.js
对比新文件
@@ -0,0 +1,31 @@
import request from '@/utils/request';
import {getTokenAndVerify} from "@/api/sgyhpczl/auth";
export function chart_analysis(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/danger/chart_analysis",
        contentType: "application/json",
        method: 'POST',
        data
    });
}
export function chart_compare(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/danger/chart_compare",
        contentType: "application/json",
        method: 'POST',
        data
    });
}
src/api/sgyhpczl/delayHiddenDangerRectification.js
@@ -55,7 +55,7 @@
        arr.push({field:"check_class",value:data.form.check_class,type:'OPT'})
    }
    /*是否关联*/
    if(data.form.DTRisk_bankId!=null && data.form.DTRisk_bankId!=''){
    if(data.form.DTRisk_bankId!=null){
        arr.push({field:"DTRisk_bankId",value:data.form.DTRisk_bankId,type:'OPT'})
    }
    /*录入人*/
src/api/sgyhpczl/fileUtils.js
对比新文件
@@ -0,0 +1,17 @@
import request from '@/utils/request';
import {getTokenAndVerify} from "@/api/sgyhpczl/auth";
//下载文件
export function downloadFile(params) {
    return request({
        headers: {
            'token': getTokenAndVerify().token,
            'verify': getTokenAndVerify().verify
        },
        url: '/taboi/file/dowloand_do',
        method: 'GET',
        contentType: "multipart/form-data",
        responseType:'blob',
        params:params?params:{}
    });
}
src/api/sgyhpczl/hiddenDangerManagement.js
@@ -46,7 +46,7 @@
        arr.push({field: "alter_status", value: data.form.alter_status, type: 'OPT'})
    }
    /*是否关联*/
    if (data.form.DTRisk_bankId != null && data.form.DTRisk_bankId != '') {
    if(data.form.DTRisk_bankId!=null){
        arr.push({field: "DTRisk_bankId", value: data.form.DTRisk_bankId, type: 'OPT'})
    }
    /*检查时间*/
@@ -170,3 +170,17 @@
    })
}
export function self_info(data) {
    return request({
        headers: {
            'token': getTokenAndVerify().token,
            'verify': getTokenAndVerify().verify
        },
        url: '/taboi/danger/self_info?id=' + data,
        method: 'post',
        data
    })
}
src/api/sgyhpczl/hiddenDangerRegistration.js
@@ -3,6 +3,10 @@
export function getPageList(data) {
    var arr=[]
    /*举一反三ID*/
    if(data.form.jyfsId!=null && data.form.jyfsId!=''){
        arr.push({field:"jyfsId",value:data.form.jyfsId,type:'OPT'})
    }
    /*编号*/
    if(data.form.number!=null && data.form.number!=''){
        arr.push({field:"number",value:data.form.number,type:'TXT'})
@@ -52,7 +56,7 @@
        arr.push({field:"check_class",value:data.form.check_class,type:'OPT'})
    }
    /*是否关联*/
    if(data.form.DTRisk_bankId!=null && data.form.DTRisk_bankId!=''){
    if(data.form.DTRisk_bankId!=null){
        arr.push({field:"DTRisk_bankId",value:data.form.DTRisk_bankId,type:'OPT'})
    }
    /*录入人*/
src/api/sgyhpczl/hiddenDangerTroubleshootingList.js
对比新文件
@@ -0,0 +1,37 @@
import request from '@/utils/request';
import {getTokenAndVerify} from "@/api/sgyhpczl/auth";
export function standard_template() {
    return request({
        headers: {
            'token': getTokenAndVerify().token,
            'verify': getTokenAndVerify().verify
        },
        url: '/taboi/download/standard_template',
        method: 'get',
        responseType: 'arraybuffer',
    });
}
export function standard_import_do(data) {
    return request({
        headers: {
            'token': getTokenAndVerify().token,
            'verify': getTokenAndVerify().verify
        },
        url: '/taboi/excel/standard_import_do',
        method: 'post',
        data
    })
}
export function stand_list(data) {
    return request({
        headers: {
            'token': getTokenAndVerify().token,
            'verify': getTokenAndVerify().verify
        },
        url: '/taboi/danger/stand_list?standardType=' + data,
        method: 'GET',
    })
}
src/api/sgyhpczl/initSelect.js
@@ -133,3 +133,19 @@
        data
    });
}
//深入现场情况(带班值班)
export function initSrxcqk() {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        contentType: "multipart/form-data",
        url: "/taboi/user/situation_do",
        method: 'GET',
    });
}
src/api/sgyhpczl/majorHidden.js
@@ -57,7 +57,7 @@
        arr.push({field:"check_class",value:data.form.check_class,type:'OPT'})
    }
    /*是否关联*/
    if(data.form.DTRisk_bankId!=null && data.form.DTRisk_bankId!=''){
    if(data.form.DTRisk_bankId!=null){
        arr.push({field:"DTRisk_bankId",value:data.form.DTRisk_bankId,type:'OPT'})
    }
    /*录入人*/
src/api/sgyhpczl/oneFromanother.js
对比新文件
@@ -0,0 +1,104 @@
import request from '@/utils/request';
import {getTokenAndVerify} from "@/api/sgyhpczl/auth";
export function getPageList(data) {
    var arr=[]
    /*下发单位*/
    if(data.form.push_branch!=null && data.form.push_branch!=''){
        arr.push({field:"push_branch",value:data.form.push_branch,type:'OPT'})
    }
    /*隐患单位*/
    if(data.form.ht_community!=null && data.form.ht_community!=''){
        arr.push({field:"ht_community",value:data.form.ht_community,type:'TXT'})
    }
    /*隐患类别*/
    if(data.form.ht_typesub!=null && data.form.ht_typesub!=''){
        arr.push({field:"ht_typesub",value:data.form.ht_typesub,type:'OPT'})
    }
    /*隐患级别*/
    if(data.form.ht_level!=null && data.form.ht_level!=''){
        arr.push({field:"ht_level",value:data.form.ht_level,type:'OPT'})
    }
    /*隐患地点*/
    if(data.form.address!=null && data.form.address!=''){
        arr.push({field:"address",value:data.form.address,type:'TXT'})
    }
    /*检查类别*/
    if(data.form.checktype!=null && data.form.checktype!=''){
        arr.push({field:"checktype",value:data.form.checktype,type:'OPT'})
    }
    /*隐患内容*/
    if(data.form.ht_content!=null && data.form.ht_content!=''){
        arr.push({field:"ht_content",value:data.form.ht_content,type:'TXT'})
    }
    /*检查时间*/
    if(data.form.check_dateStart!=null && data.form.check_dateStart!='' && data.form.check_dateEnd!=null && data.form.check_dateEnd!=''){
        arr.push({field:"check_date",value:data.form.check_dateStart+"至"+data.form.check_dateEnd,type:'DAT'})
    }
    data.query_condition=arr
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/analogy/danger_list",
        contentType: "application/json",
        method: 'POST',
        data
    });
}
//不存在保存
export function noExistSave(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/analogy/no_exist_save",
        contentType: "application/json",
        method: 'POST',
        data
    });
}
//不存在结果详情
export function selfCheckNotInfo(params) {
    return request({
        headers: {
            'token': getTokenAndVerify().token,
            'verify': getTokenAndVerify().verify
        },
        url: '/taboi/danger/self_check_not_info',
            // '?id=24871&type=0',
        contentType: "multipart/form-data",
        method: 'GET',
        params:params?params:{}
    });
}
//撤销
export function revoke(id) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        contentType: "multipart/form-data",
        url: "/taboi/analogy/revoke_do?id="+id,
        method: 'GET',
    });
}
//导出
export function analogy_export_do(data) {
    return request({
        headers: {
            'token': getTokenAndVerify().token,
            'verify': getTokenAndVerify().verify
        },
        url: '/taboi/excel/analogy_export_do',
        method: 'POST',
        responseType: 'arraybuffer',
        data
    });
}
src/api/sgyhpczl/oneFromanotherN.js
对比新文件
@@ -0,0 +1,119 @@
import request from '@/utils/request';
import {getTokenAndVerify} from "@/api/sgyhpczl/auth";
export function getPageList(data) {
    var arr=[]
    /*隐患单位*/
    if(data.form.check_main_branch!=null && data.form.check_main_branch!=''){
        arr.push({field:"check_main_branch",value:data.form.check_main_branch,type:'TXT'})
    }
    /*检查类别*/
    if(data.form.checktype!=null && data.form.checktype!=''){
        arr.push({field:"checktype",value:data.form.checktype,type:'OPT'})
    }
    /*被检单位*/
    if(data.form.ht_community!=null && data.form.ht_community!=''){
        arr.push({field:"ht_community",value:data.form.ht_community,type:'TXT'})
    }
    /*隐患级别*/
    if(data.form.ht_level!=null && data.form.ht_level!=''){
        arr.push({field:"ht_level",value:data.form.ht_level,type:'OPT'})
    }
    /*隐患类别*/
    if(data.form.ht_typesub!=null && data.form.ht_typesub!=''){
        arr.push({field:"ht_typesub",value:data.form.ht_typesub,type:'OPT'})
    }
    /*隐患地点*/
    if(data.form.address!=null && data.form.address!=''){
        arr.push({field:"address",value:data.form.address,type:'TXT'})
    }
    /*隐患内容*/
    if(data.form.ht_content!=null && data.form.ht_content!=''){
        arr.push({field:"ht_content",value:data.form.ht_content,type:'TXT'})
    }
    /*发送单位*/
    if(data.form.workGroupName!=null && data.form.workGroupName!=''){
        arr.push({field:"workGroupName",value:data.form.workGroupName,type:'TXT'})
    }
    /*检查时间*/
    if(data.form.check_dateStart!=null && data.form.check_dateStart!='' && data.form.check_dateEnd!=null && data.form.check_dateEnd!=''){
        arr.push({field:"check_date",value:data.form.check_dateStart+"至"+data.form.check_dateEnd,type:'DAT'})
    }
    data.query_condition=arr
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/analogy/danger_inner_list",
        contentType: "application/json",
        method: 'POST',
        data
    });
}
//新增
export function save(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/analogy/save_do",
        contentType: "application/json",
        method: 'POST',
        data
    });
}
//编辑
export function edit(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/analogy/edit_do",
        contentType: "application/json",
        method: 'POST',
        data
    });
}
//删除
export function del(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/analogy/del_do?id=" + data,
        contentType: "multipart/form-data",
        method: 'POST'
    });
}
//发送
export function send(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/analogy/inner_send_do",
        contentType: "application/x-www-form-urlencoded",
        method: 'POST',
        data
    });
}
//回收
export function revoke(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/analogy/inner_revoke_do",
        contentType: "application/x-www-form-urlencoded",
        method: 'POST',
        data
    });
}
src/api/sgyhpczl/recheckCancellationNumber.js
@@ -54,7 +54,7 @@
        arr.push({field:"check_class",value:data.form.check_class,type:'OPT'})
    }
    /*是否关联*/
    if(data.form.DTRisk_bankId!=null && data.form.DTRisk_bankId!=''){
    if(data.form.DTRisk_bankId!=null){
        arr.push({field:"DTRisk_bankId",value:data.form.DTRisk_bankId,type:'OPT'})
    }
    /*录入人*/
src/api/sgyhpczl/safetyHazardAccount.js
对比新文件
@@ -0,0 +1,123 @@
import request from '@/utils/request';
import {getTokenAndVerify} from "@/api/sgyhpczl/auth";
export function getPageList(data) {
    var arr=[]
    /*编号*/
    if(data.form.number!=null && data.form.number!=''){
        arr.push({field:"number",value:data.form.number,type:'TXT'})
    }
    /*检查单位*/
    if(data.form.check_main_branch!=null && data.form.check_main_branch!=''){
        arr.push({field:"check_main_branch",value:data.form.check_main_branch,type:'OPT'})
    }
    /*检查部门*/
    if(data.form.check_branch!=null && data.form.check_branch!=''){
        arr.push({field:"check_branch",value:data.form.check_branch,type:'OPT'})
    }
    /*检查人*/
    if(data.form.check_man!=null && data.form.check_man!=''){
        arr.push({field:"check_man",value:data.form.check_man,type:'TXT'})
    }
    /*隐患单位*/
    if(data.form.ht_community!=null && data.form.ht_community!=''){
        arr.push({field:"ht_community",value:data.form.ht_community,type:'TXT'})
    }
    /*隐患部门*/
    if(data.form.ht_branch!=null && data.form.ht_branch!=''){
        arr.push({field:"ht_branch",value:data.form.ht_branch,type:'OPT'})
    }
    /*隐患类别*/
    if(data.form.ht_typesub!=null && data.form.ht_typesub!=''){
        arr.push({field:"ht_typesub",value:data.form.ht_typesub,type:'OPT'})
    }
    /*隐患级别*/
    if(data.form.ht_level!=null && data.form.ht_level!=''){
        arr.push({field:"ht_level",value:data.form.ht_level,type:'OPT'})
    }
    /*检查类型*/
    if(data.form.checktype!=null && data.form.checktype!=''){
        arr.push({field:"checktype",value:data.form.checktype,type:'OPT'})
    }
    /*隐患地点*/
    if(data.form.address!=null && data.form.address!=''){
        arr.push({field:"address",value:data.form.address,type:'TXT'})
    }
    /*隐患内容*/
    if(data.form.ht_content!=null && data.form.ht_content!=''){
        arr.push({field:"ht_content",value:data.form.ht_content,type:'TXT'})
    }
    /*复查单位*/
    if(data.form.callback_branch!=null && data.form.callback_branch!=''){
        arr.push({field:"callback_branch",value:data.form.callback_branch,type:'TXT'})
    }
    /*班次*/
    if(data.form.check_class!=null && data.form.check_class!=''){
        arr.push({field:"check_class",value:data.form.check_class,type:'OPT'})
    }
    /*风险等级*/
    if(data.form.DTRisk_level!=null && data.form.DTRisk_level!=''){
        arr.push({field:"DTRisk_level",value:data.form.DTRisk_level,type:'OPT'})
    }
    /*是否关联*/
    if(data.form.DTRisk_bankId!=null){
        arr.push({field:"DTRisk_bankId",value:data.form.DTRisk_bankId,type:'OPT'})
    }
    /*录入人*/
    if(data.form.createBy!=null && data.form.createBy!=''){
        arr.push({field:"Created_by",value:data.form.createBy,type:'OPT'})
    }
    /*检查时间*/
    if(data.form.check_dateStart!=null && data.form.check_dateStart!='' && data.form.check_dateEnd!=null && data.form.check_dateEnd!=''){
        arr.push({field:"check_date",value:data.form.check_dateStart+"至"+data.form.check_dateEnd,type:'DAT'})
    }
    /*限改时间*/
    if(data.form.alter_timeStart!=null && data.form.alter_timeStart!='' && data.form.alter_timeEnd!=null && data.form.alter_timeEnd!=''){
        arr.push({field:"alter_time",value:data.form.alter_timeStart+"至"+data.form.alter_timeEnd,type:'DAT'})
    }
    data.query_condition=arr
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/danger/danger_all_list",
        contentType: "application/json",
        method: 'POST',
        data
    });
}
//督察督办
export function inspect_do(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/danger/inspect_do",
        contentType: "application/json",
        method: 'POST',
        data,
    });
}
//举一反三
export function draw_inferences_do(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/danger/draw_inferences_do",
        contentType: "application/json",
        method: 'POST',
        data,
    });
}
src/api/sgyhpczl/summaryPotentialSafetyHzards.js
对比新文件
@@ -0,0 +1,34 @@
import request from '@/utils/request';
import {getTokenAndVerify} from "@/api/sgyhpczl/auth";
//汇总查询
export function danger_summary(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/danger/danger_summary",
        contentType: "application/json",
        method: 'POST',
        data,
    });
}
//汇总查询
export function getPageList(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/danger/danger_summary_info",
        contentType: "application/json",
        method: 'POST',
        data
    });
}
src/api/sgyhpczl/troubleshooting.js
对比新文件
@@ -0,0 +1,85 @@
import request from '@/utils/request';
import {getTokenAndVerify} from "@/api/sgyhpczl/auth";
export function getPageList(data) {
    var arr=[]
    /*地点*/
    if(data.form.ADDRESS!=null && data.form.ADDRESS!=''){
        arr.push({field:"ADDRESS",value:data.form.ADDRESS,type:'TXT'})
    }
    /*主持人*/
    if(data.form.HOST!=null && data.form.HOST!=''){
        arr.push({field:"HOST",value:data.form.HOST,type:'TXT'})
    }
    /*会议专业*/
    if(data.form.CONFERENCE_PROFESSIONAL!=null && data.form.CONFERENCE_PROFESSIONAL!='' && data.form.CONFERENCE_PROFESSIONAL!='0'){
        arr.push({field:"CONFERENCE_PROFESSIONAL",value:data.form.CONFERENCE_PROFESSIONAL,type:'OPT'})
    }
    /*召开时间*/
    if(data.form.Conference_TimeStart!=null && data.form.Conference_TimeStart!='' && data.form.Conference_TimeEnd!=null && data.form.Conference_TimeEnd!=''){
        arr.push({field:"Conference_Time",value:data.form.Conference_TimeStart+"至"+data.form.Conference_TimeEnd,type:'DAT'})
    }
    data.query_condition=arr
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/conference/conference_list",
        contentType: "application/json",
        method: 'POST',
        data
    });
}
//新增/编辑
export function addOrEdit(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/conference/save_do",
        contentType: "application/json",
        method: 'POST',
        data
    });
}
//删除
export function del(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/conference/del_do?id=" + data,
        contentType: "multipart/form-data",
        method: 'POST'
    });
}
//上报
export function upload_do(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/conference/upload_do",
        contentType: "multipart/form-data",
        method: 'POST',
        data
    });
}
//撤销
export function revoke(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        contentType: "multipart/form-data",
        url: "/taboi/conference/revoke_do",
        method: 'POST',
        data
    });
}
src/main.js
@@ -36,6 +36,15 @@
  size: Cookies.get('size') || 'medium' // set element-ui default size
})
//highcharts
import HighchartsVue from 'highcharts-vue'
//接下来,您可以将其注册为 Vue 对象中的插件:
Vue.use(HighchartsVue)
// register global utility filters.
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
src/permission.js
@@ -17,7 +17,7 @@
  return roles.some(role => permissionRoles.indexOf(role) >= 0)
}
const whiteList = ['/login','/pwdChange', '/auth-redirect','/agreement','/register','/productionEquipment','/instrumentData','/equipmentAlarm'] // no redirect whitelist
const whiteList = ['/login','/pwdChange', '/auth-redirect','/agreement','/register','/productionEquipment','/instrumentData','/equipmentAlarm','/oneFromanother','/hiddenDangerTroubleshootingList','/preview','/inspectionNotExist','/send','/Issuedbysuperiors','/oneFromanotherN','/summaryPotentialSafetyHzards','/safetyHazardAccount','/superiorsSend','/accountSend','/existN','/exist','/hazardSource','/safetyedit','/Dualbase','/supervision','/inferOtherThings','/DualbaseLost','/summaryList','/summaryForm','/chartAnalysis','/careabout','/troubleshooting','/managementConcerns'] // no redirect whitelist
router.beforeEach((to, from, next) => {
  NProgress.start() // start progress bar
src/router/index.js
@@ -34,7 +34,6 @@
        component: () => import('@/views/login/index'),
        hidden: true
    },
    {
        path: '/auth-redirect',
        component: () => import('@/views/login/authredirect'),
@@ -129,187 +128,400 @@
        meta: { title: '安全生产标准化', icon: 'el-icon-security' },
        hidden: true,
        children: [
            {
                path: '/new',
                // name: '自查清单_新增|修改',
                component: () => import('@/views/safetyproduction/new'),
                meta: { title: '自查清单', icon: 'el-icon-dash', noCache: true, affix: true },
                hidden: true
            },
            {
                //自查清单-去评审
                path: '/gojudging',
                component: () => import('@/views/safetyproduction/gojudging'),
                hidden: true
            },
            {
                //自查清单_评审
                path: '/review',
                component: () => import('@/views/safetyproduction/review'),
                hidden: true
            },
            {
                //自查清单_修改检查项
                path: '/reviewXG',
                component: () => import('@/views/safetyproduction/reviewXG'),
                hidden: true
            },
        ]
    },
    {
        id: 124,
        parentId: 0,
        path: '/sgyhpczl',
        component: Layout,
        name: '事故隐患排查治理',
        meta: { title: '事故隐患排查治理', icon: 'el-icon-facilities' },
        hidden: true,
        children: [
            {
                path: '/fillProgress',
                // name: '重大隐患整改进度-填写进度',
                component: () => import('@/views/accidentHidden/fillProgress'),
                // meta: { title: '重大隐患整改进度-填写进度', icon: '' }
                hidden: true
            },
            {
          {
            path: '/new',
            // name: '自查清单_新增|修改',
            component: () => import('@/views/safetyproduction/new'),
              meta: { title: '自查清单', icon: 'el-icon-dash', noCache: true, affix: true },
            hidden: true
          },
        {
            //自查清单-去评审
            path: '/gojudging',
            component: () => import('@/views/safetyproduction/gojudging'),
            hidden: true
        },
        {
            //自查清单_评审
            path: '/review',
            component: () => import('@/views/safetyproduction/review'),
            hidden: true
        },
        {
            //自查清单_修改检查项
            path: '/reviewXG',
            component: () => import('@/views/safetyproduction/reviewXG'),
            hidden: true
        },
       ]
      },
     /*   {
            id: 2,
            parentId: 0,
            path: '/majorHazardSourceMonitoring',
            component: Layout,
            name: '重大危险源监测',
            meta: { title: '重大危险源监测', icon: 'el-icon-facilities' },
            children: [
                {
                    id: 1,
                    parentId: 0,
                    path: '/productionEquipment',
                    name: '生产设备',
                    component: () => import('@/views/majorHazardSourceMonitoring/productionEquipment'),
                    meta: { title: '生产设备', icon: '' }
                },
                {
                    id: 2,
                    parentId: 0,
                    path: '/equipmentAlarm',
                    name: '设备报警信息',
                    component: () => import('@/views/majorHazardSourceMonitoring/equipmentAlarm'),
                    meta: { title: '设备报警信息', icon: '' }
                },
                {
                    id: 3,
                    parentId: 0,
                    path: '/instrumentData',
                    name: '仪表实时数据',
                    component: () => import('@/views/majorHazardSourceMonitoring/instrumentData'),
                    meta: { title: '仪表实时数据', icon: '' }
                },
            ]
        },*/
        {
          id: 2,
          parentId: 0,
          path: '/accidentHidden',
          component: Layout,
          name: '事故隐患排查治理',
          meta: { title: '事故隐患排查治理', icon: 'el-icon-facilities' },
          children: [
              {
                  id: 1,
                  parentId: 0,
                  path: '/majorHidden',
                  name: '重大隐患整改进度',
                  component: () => import('@/views/accidentHidden/majorHidden'),
                  meta: { title: '重大隐患整改进度', icon: '' }
              },
              {
                  path: '/fillProgress',
                  // name: '重大隐患整改进度-填写进度',
                  component: () => import('@/views/accidentHidden/fillProgress'),
                  // meta: { title: '重大隐患整改进度-填写进度', icon: '' }
                  hidden: true
              },
              {
                  id: 2,
                  parentId: 0,
                  path: '/hiddenDangerRegistration',
                  name: '隐患登记下达',
                  component: () => import('@/views/hiddenDangerRegistration'),
                  meta: { title: '隐患登记下达', icon: '' }
              },
              {
                path: '/hiddenDangerAdd',
                // name: '新增',
                component: () => import('@/views/hiddenDangerRegistration/hiddenDangerAdd'),
                // meta: { title: '隐患登记下达-发送隐患单', icon: '' }
                hidden: true
            },
            {
                path: '/hiddenDangerList',
                // name: '隐患登记下达-发送隐患单',
                component: () => import('@/views/hiddenDangerRegistration/hiddenDangerList'),
                // meta: { title: '隐患登记下达-发送隐患单', icon: '' }
                hidden: true
            },
            {
                path: '/listAssociatedHazards',
                // name: '隐患登记下达-关联危险源-列表页面',
                component: () => import('@/views/hiddenDangerRegistration/listAssociatedHazards'),
                // meta: { title: '隐患登记下达-关联危险源-列表页面', icon: '' }
                hidden: true
            },
            {
                path: '/reboundHiddenDanger',
                // name: '风险预控-重复反弹隐患-列表页面',
                component: () => import('@/views/hiddenDangerRegistration/reboundHiddenDanger'),
                // meta: { title: '风险预控-重复反弹隐患-列表页面', icon: '' }
                hidden: true
            },
            {
                path: '/sendHiddenDangerList',
                // name: '隐患整改治理-发送隐患单',
                component: () => import('@/views/hiddenDangerRectification/sendHiddenDangerList'),
                // meta: { title: '隐患整改治理-发送隐患单', icon: '' }
                hidden: true
            },
            {
                path: '/applicationForExtension',
                // name: '隐患整改治理-申请延期',
                component: () => import('@/views/hiddenDangerRectification/applicationForExtension'),
                // meta: { title: '隐患整改治理-申请延期', icon: '' }
                hidden: true
            },
            {
                path: '/recheckHiddenDangerList',
                // name: '隐患复查销号-发送隐患单',
                component: () => import('@/views/hiddenDangerReview/recheckHiddenDangerList'),
                // meta: { title: '隐患复查销号-发送隐患单', icon: '' }
                hidden: true
            },
            {
                path: '/rectificationDelayHiddenDanger',
                // name: '隐患整改延期-发送隐患单',
                component: () => import('@/views/delayHiddenDangerRectification/rectificationDelayHiddenDanger'),
                // meta: { title: '隐患整改延期-发送隐患单', icon: '' }
                hidden: true
            },
            {
             },
              {
                  path: '/hiddenDangerList',
                  // name: '隐患登记下达-发送隐患单',
                  component: () => import('@/views/hiddenDangerRegistration/hiddenDangerList'),
                  // meta: { title: '隐患登记下达-发送隐患单', icon: '' }
                  hidden: true
              },
              {
                  path: '/listAssociatedHazards',
                  // name: '隐患登记下达-关联危险源-列表页面',
                  component: () => import('@/views/hiddenDangerRegistration/listAssociatedHazards'),
                  // meta: { title: '隐患登记下达-关联危险源-列表页面', icon: '' }
                  hidden: true
              },
              {
                  path: '/reboundHiddenDanger',
                  // name: '风险预控-重复反弹隐患-列表页面',
                  component: () => import('@/views/hiddenDangerRegistration/reboundHiddenDanger'),
                  // meta: { title: '风险预控-重复反弹隐患-列表页面', icon: '' }
                  hidden: true
              },
              {
                  id: 3,
                  parentId: 0,
                  path: '/hiddenDangerRectification',
                  name: '隐患整改治理',
                  component: () => import('@/views/hiddenDangerRectification'),
                  meta: { title: '隐患整改治理', icon: '' }
              },
              {
                  path: '/sendHiddenDangerList',
                  // name: '隐患整改治理-发送隐患单',
                  component: () => import('@/views/hiddenDangerRectification/sendHiddenDangerList'),
                  // meta: { title: '隐患整改治理-发送隐患单', icon: '' }
                  hidden: true
              },
              {
                  path: '/applicationForExtension',
                  // name: '隐患整改治理-申请延期',
                  component: () => import('@/views/hiddenDangerRectification/applicationForExtension'),
                  // meta: { title: '隐患整改治理-申请延期', icon: '' }
                  hidden: true
              },
              {
                  id: 4,
                  parentId: 0,
                  path: '/recheckCancellationNumber',
                  name: '隐患复查销号',
                  component: () => import('@/views/hiddenDangerReview/recheckCancellationNumber'),
                  meta: { title: '隐患复查销号', icon: '' }
              },
              {
                  path: '/recheckHiddenDangerList',
                  // name: '隐患复查销号-发送隐患单',
                  component: () => import('@/views/hiddenDangerReview/recheckHiddenDangerList'),
                  // meta: { title: '隐患复查销号-发送隐患单', icon: '' }
                  hidden: true
              },
              {
                  id: 5,
                  parentId: 0,
                  path: '/delayHiddenDangerRectification',
                  name: '隐患整改延期',
                  component: () => import('@/views/delayHiddenDangerRectification'),
                  meta: { title: '隐患整改延期', icon: '' }
              },
              {
                  path: '/rectificationDelayHiddenDanger',
                  // name: '隐患整改延期-发送隐患单',
                  component: () => import('@/views/delayHiddenDangerRectification/rectificationDelayHiddenDanger'),
                  // meta: { title: '隐患整改延期-发送隐患单', icon: '' }
                  hidden: true
              },
              {
                  id: 6,
                  parentId: 0,
                  path: '/hiddenDangerManagement',
                  name: '自查隐患管理',
                  component: () => import('@/views/hiddenDangerManagement'),
                  meta: { title: '自查隐患管理', icon: '' }
              },
              {
                path: '/fillRectificationAdd',
                // name: '自查隐患管理-填写整改',
                component: () => import('@/views/hiddenDangerManagement/fillRectificationAdd'),
                // meta: { title: '自查隐患管理-填写整改', icon: '' }
                hidden: true
            },
              {
                  path: '/fillRectification',
                  // name: '自查隐患管理-填写整改',
                  component: () => import('@/views/hiddenDangerManagement/fillRectification'),
                  // meta: { title: '自查隐患管理-填写整改', icon: '' }
                  hidden: true
              },
              {
                  path: '/fillInspector',
                  // name: '自查隐患管理-填写督察',
                  component: () => import('@/views/hiddenDangerManagement/fillInspector'),
                  // meta: { title: '自查隐患管理-填写督察', icon: '' }
                  hidden: true
              },
              {
                id: 7,
                parentId: 0,
                path: '/oneFromanother',
                name: '举一反三隐患',
                component: () => import('@/views/oneFromanother'),
                meta: { title: '举一反三隐患', icon: '' }
            },
            {
                path: '/fillRectification',
                // name: '自查隐患管理-填写整改',
                component: () => import('@/views/hiddenDangerManagement/fillRectification'),
                // meta: { title: '自查隐患管理-填写整改', icon: '' }
                path: '/manage',
                component: () => import('@/views/oneFromanother/manage'),
                hidden: true
            },
            {
                path: '/fillInspector',
                // name: '自查隐患管理-填写督察',
                component: () => import('@/views/hiddenDangerManagement/fillInspector'),
                // meta: { title: '自查隐患管理-填写督察', icon: '' }
                path: '/exist',
                component: () => import('@/views/oneFromanother/exist'),
                hidden: true
            },
        ]
    },
    //     {
    //         id: 2,
    //         parentId: 0,
    //         path: '/majorHazardSourceMonitoring',
    //         component: Layout,
    //         name: '重大危险源监测',
    //         meta: { title: '重大危险源监测', icon: 'el-icon-facilities' },
    //         children: [
    //             {
    //                 id: 1,
    //                 parentId: 0,
    //                 path: '/productionEquipment',
    //                 name: '生产设备',
    //                 component: () => import('@/views/majorHazardSourceMonitoring/productionEquipment'),
    //                 meta: { title: '生产设备', icon: '' }
    //             },
    //             {
    //                 id: 2,
    //                 parentId: 0,
    //                 path: '/equipmentAlarm',
    //                 name: '设备报警信息',
    //                 component: () => import('@/views/majorHazardSourceMonitoring/equipmentAlarm'),
    //                 meta: { title: '设备报警信息', icon: '' }
    //             },
    //             {
    //                 id: 3,
    //                 parentId: 0,
    //                 path: '/instrumentData',
    //                 name: '仪表实时数据',
    //                 component: () => import('@/views/majorHazardSourceMonitoring/instrumentData'),
    //                 meta: { title: '仪表实时数据', icon: '' }
    //             },
    //         ]
    //     },
    //     {
    //       id: 2,
    //       parentId: 0,
    //       path: '/accidentHidden',
    //       component: Layout,
    //       name: '事故隐患排查治理',
    //       meta: { title: '事故隐患排查治理', icon: 'el-icon-facilities' },
    //       children: [
    //           {
    //               id: 1,
    //               parentId: 0,
    //               path: '/majorHidden',
    //               name: '重大隐患整改进度',
    //               component: () => import('@/views/accidentHidden/majorHidden'),
    //               meta: { title: '重大隐患整改进度', icon: '' }
    //           },
    //           {
    //               path: '/hiddenDangerList',
    //               // name: '重大隐患整改进度-发送隐患单',
    //               component: () => import('@/views/accidentHidden/hiddenDangerList'),
    //               // meta: { title: '重大隐患整改进度-发送隐患单', icon: '' }
    //               hidden: true
    //           },
    //       ]
    //   }
              {
                  path: '/inspectionNotExist',
                  // name: '举一反三-待自查-不存在',
                  component: () => import('@/views/oneFromanother/inspectionNotExist'),
                  // meta: { title: '举一反三-待自查-不存在', icon: '' }
                  hidden: true
              },
              {
                  path: '/send',
                  // name: '内部举一反三-发送弹窗',
                  component: () => import('@/views/oneFromanother/send'),
                  // meta: { title: '内部举一反三-发送弹窗', icon: '' }
                  hidden: true
              },
              {
                  id: 8,
                  parentId: 0,
                  path: '/hiddenDangerTroubleshootingList',
                  name: '隐患排查清单',
                  component: () => import('@/views/hiddenDangerTroubleshootingList'),
                  meta: { title: '隐患排查清单', icon: '' }
              },
              {
                  path: '/preview',
                  // name: '隐患排查清单-预览',
                  component: () => import('@/views/hiddenDangerTroubleshootingList/preview'),
                  // meta: { title: '隐患排查清单-预览', icon: '' }
                  hidden: true
              },
              {
                id: 9,
                parentId: 0,
                path: '/Issuedbysuperiors',
                name: '上级下达隐患',
                component: () => import('@/views/Issuedbysuperiors'),
                meta: { title: '上级下达隐患', icon: '' }
            },
            {
                id: 10,
                parentId: 0,
                path: '/oneFromanotherN',
                name: '内部举一反三',
                component: () => import('@/views/oneFromanotherN'),
                meta: { title: '内部举一反三', icon: '' }
            },
            {
              path: '/addDanger',
              component: () => import('@/views/oneFromanotherN/addDanger'),
              hidden: true
            },
            {
                path: '/existN',
                component: () => import('@/views/oneFromanotherN/existN'),
                hidden: true
            },
              {
                  path: '/superiorsSend',
                  // name: '上级下达隐患-点击发送',
                  component: () => import('@/views/Issuedbysuperiors/superiorsSend'),
                  // meta: { title: '上级下达隐患-点击发送', icon: '' }
                  hidden: true
              },
              {
                  id: 10,
                  parentId: 0,
                  path: '/summaryPotentialSafetyHzards',
                  name: '安全隐患汇总',
                  component: () => import('@/views/summaryPotentialSafetyHzards'),
                  meta: { title: '安全隐患汇总', icon: '' }
              },
              {
                  id: 11,
                  parentId: 0,
                  path: '/safetyHazardAccount',
                  name: '安全隐患台账',
                  component: () => import('@/views/safetyHazardAccount'),
                  meta: { title: '安全隐患台账', icon: '' }
              },
              {
                  path: '/accountSend',
                  // name: '安全隐患台账-查看隐患单',
                  component: () => import('@/views/safetyHazardAccount/accountSend'),
                  // meta: { title: '安全隐患台账-查看隐患单', icon: '' }
                  hidden: true
              },
              {
                  path: '/hazardSource',
                  // name: '安全隐患台账-关联危险源',
                  component: () => import('@/views/safetyHazardAccount/hazardSource'),
                  // meta: { title: '安全隐患台账-关联危险源', icon: '' }
                  hidden: true
              },
              {
                path: '/safetyedit',
                // name: '安全隐患台账-编辑',
                component: () => import('@/views/safetyHazardAccount/safetyedit'),
                // meta: { title: '安全隐患台账-编辑', icon: '' }
                hidden: true
            },
            {
                path: '/Dualbase',
                // name: '安全隐患台账-双基考核',
                component: () => import('@/views/safetyHazardAccount/Dualbase'),
                // meta: { title: '安全隐患台账-编辑', icon: '' }
                hidden: true
            },
            {
                path: '/DualbaseLost',
                // name: '安全隐患台账-双基考核',
                component: () => import('@/views/safetyHazardAccount/DualbaseLost'),
                // meta: { title: '安全隐患台账-编辑', icon: '' }
                hidden: true
            },
              {
                  path: '/supervision',
                  // name: '安全隐患台账-督查督办',
                  component: () => import('@/views/safetyHazardAccount/supervision'),
                  // meta: { title: '安全隐患台账-督查督办', icon: '' }
                  hidden: true
              },
              {
                  path: '/inferOtherThings',
                  // name: '安全隐患台账-举一反三',
                  component: () => import('@/views/safetyHazardAccount/inferOtherThings'),
                  // meta: { title: '安全隐患台账-举一反三', icon: '' }
                  hidden: true
              },
              {
                  path: '/summaryList',
                  // name: '安全隐患台账-举一反三',
                  component: () => import('@/views/summaryPotentialSafetyHzards/summaryList'),
                  // meta: { title: '安全隐患台账-举一反三', icon: '' }
                  hidden: true
              },
              {
                  path: '/summaryForm',
                  // name: '安全隐患汇总-发送隐患单',
                  component: () => import('@/views/summaryPotentialSafetyHzards/summaryForm'),
                  // meta: { title: '安全隐患汇总-发送隐患单', icon: '' }
                  hidden: true
              },
              {
                  path: '/dangerDetails',
                  // name: '安全隐患汇总-发送隐患单',
                  component: () => import('@/views/dangerDetails/dnagerDetails'),
                  // meta: { title: '安全隐患汇总-发送隐患单', icon: '' }
                  hidden: true
              },
              {
                  id: 12,
                  parentId: 0,
                  path: '/chartAnalysis',
                  name: '隐患图表分析',
                  component: () => import('@/views/chartAnalysis'),
                  meta: { title: '隐患图表分析', icon: '' }
              },
              {
                id: 13,
                parentId: 0,
                path: '/careabout',
                name: '您关注的隐患',
                component: () => import('@/views/careabout'),
                meta: { title: '您关注的隐患', icon: '' }
            },
            {
                id: 14,
                parentId: 0,
                path: '/troubleshooting',
                name: '隐患排查会议',
                component: () => import('@/views/troubleshooting'),
                meta: { title: '隐患排查会议', icon: '' }
            },
          ]
      }
]
export default new Router({
src/views/Issuedbysuperiors/index.vue
@@ -5,7 +5,7 @@
                <el-input v-model="listQuery.form.number" style="width:202px" placeholder="请输入内容"></el-input>
            </el-form-item>
            <el-form-item label="检查单位">
                <el-select v-model="listQuery.form.check_main_branch" placeholder="请选择"  @change="changeJCDW">
                <el-select v-model="listQuery.form.check_main_branch" placeholder="请选择" @change="changeJCDW">
                    <el-option
                        v-for="item in JCDWList"
                        :key="item.value"
@@ -45,7 +45,7 @@
                        v-for="item in YHBMList"
                        :key="item.branch_id"
                        :label="item.branch_name"
                        :value="item.branch_id">
                        :value="item.branch_name">
                    </el-option>
                </el-select>
            </el-form-item>
@@ -117,67 +117,115 @@
            </el-form-item>
            <el-form-item label="检查时间">
                <el-col :span="11">
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.check_dateStart" style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker>
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.check_dateStart"
                                    style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker>
                </el-col>
                <el-col style="text-align:center" :span="2">-</el-col>
                <el-col :span="11">
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.check_dateEnd" style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker>
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.check_dateEnd"
                                    style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker>
                </el-col>
            </el-form-item>
            <el-form-item label="限改时间">
                <el-col :span="11">
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.alter_timeStart" value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker>
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.alter_timeStart"
                                    value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker>
                </el-col>
                <el-col style="text-align:center" :span="2">-</el-col>
                <el-col :span="11">
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.alter_timeEnd" value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker>
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.alter_timeEnd"
                                    value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker>
                </el-col>
            </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-search" @click="getPageList()">查询
                </el-button>
                <el-button type="primary" class="btns" size="small" @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-upload2" @click="exportData">导出excel
                </el-button>
            </el-form-item>
        </el-form>
           <el-row class="title-center">
        <el-row class="title-center">
            <el-col :span="10">
              <el-radio-group v-model="radio1">
            <el-radio-button label="待发送">待发送</el-radio-button>
            <el-radio-button label="整改中">整改中</el-radio-button>
            <el-radio-button label="待复查">待复查</el-radio-button>
            <el-radio-button label="整改完成">整改完成</el-radio-button>
          </el-radio-group>
                <el-radio-group v-model="YHType">
                    <el-radio-button label="1">待发送</el-radio-button>
                    <el-radio-button label="2">整改中</el-radio-button>
                    <el-radio-button label="3">待复查</el-radio-button>
                    <el-radio-button label="end">整改完成</el-radio-button>
                </el-radio-group>
            </el-col>
        </el-row>
        <el-table :data="tableData" style="width: 100%"  @selection-change="changeBox">
        <el-table :data="tableData" style="width: 100%" @selection-change="changeBox" v-loading="loading">
            <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="number" label="编号" align="center" width="120">
                <template slot-scope="scope">
                    <div class="blue-font-color" @click="showDetails(scope.row)">{{ scope.row.number }}</div>
                </template>
            </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="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>
                <el-table-column prop="ht_level" label="级别" align="center"> </el-table-column>
                <el-table-column prop="check_date" label="检查时间" width="120" align="center">
                    <template slot-scope="scope">
                        <label>{{ formatDate(scope.row.check_date) }}</label><br/>
                        <label>{{ scope.row.check_class }}</label>
                    </template>
                </el-table-column>
                <el-table-column prop="address" label="地点" align="center">
                    <template slot-scope="scope">
                        <el-popover trigger="hover" placement="top">
                            <p>{{ scope.row.address }}</p>
                            <div slot="reference" class="name-wrapper">{{
                                    scope.row.address != null && scope.row.address.length > 10 ? scope.row.address.substring(0, 8) + "...." : scope.row.address
                                }}
                            </div>
                        </el-popover>
                    </template>
                </el-table-column>
                <el-table-column prop="ht_content" label="内容" align="center">
                    <template slot-scope="scope">
                        <el-popover trigger="hover" placement="top">
                            <p>{{ scope.row.ht_content }}</p>
                            <div slot="reference" class="name-wrapper">{{
                                    scope.row.ht_content != null && scope.row.ht_content.length > 10 ? scope.row.ht_content.substring(0, 8) + "...." : scope.row.ht_content
                                }}
                            </div>
                        </el-popover>
                    </template>
                </el-table-column>
                <el-table-column prop="ht_typesub" label="类别" 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="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="ht_level" label="级别" align="center"> </el-table-column>
                <el-table-column prop="measure" label="整改措施" align="center">
                    <template slot-scope="scope">
                        <el-popover trigger="hover" placement="top">
                            <p>{{ scope.row.measure }}</p>
                            <div slot="reference" class="name-wrapper">{{
                                    scope.row.measure != null && scope.row.measure.length > 10 ? scope.row.measure.substring(0, 8) + "...." : scope.row.measure
                                }}
                            </div>
                        </el-popover>
                    </template>
                </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="限改时间" :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="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="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="复查时间" :formatter="formatColumnDate" width="120"
                                 align="center"></el-table-column>
            </el-table-column>
            <el-table-column  label="隐患处理状态" align="center">
            <el-table-column label="隐患处理状态" align="center">
                <template slot-scope="scope">
                    <span v-if="scope.row.step =='1'">初始状态</span>
                    <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>
@@ -185,14 +233,15 @@
            </el-table-column>
            <el-table-column prop="DTRisk_bankId" label="是否关联" align="center">
                <template slot-scope="scope">
                    <span v-if="scope.row.DTRisk_bankId==0 || scope.row.DTRisk_bankId=='' || scope.row.DTRisk_bankId==null">未关联</span>
                    <span style="color: red"
                          v-if="scope.row.DTRisk_bankId==0 || scope.row.DTRisk_bankId=='' || scope.row.DTRisk_bankId==null">未关联</span>
                    <span v-else>已关联</span>
                </template>
            </el-table-column>
            <el-table-column prop="DTRisk_level" label="风险等级" align="center"> </el-table-column>
            <el-table-column prop="warningLevel" label="初始警情" align="center"> </el-table-column>
            <el-table-column prop="curWarningLevel" label="当前警情" align="center"> </el-table-column>
            <el-table-column prop="date" label="流程操作" v-if="radio1=='待发送'" align="center"  fixed="right">
            <el-table-column prop="DTRisk_level" label="风险等级" align="center"></el-table-column>
            <el-table-column prop="warningLevel" label="初始警情" align="center"></el-table-column>
            <el-table-column prop="curWarningLevel" label="当前警情" align="center"></el-table-column>
            <el-table-column prop="date" label="流程操作" v-if="YHType==1" align="center" fixed="right">
                <template slot-scope="scope">
                    <el-button @click="handleClick(scope.row)" type="text" size="small">点击发送</el-button>
                </template>
@@ -220,31 +269,43 @@
    </div>
</template>
<script>
import {getPageList,delDanger} from "@/api/sgyhpczl/hiddenDangerRegistration";
import {initJCBM ,initYHLX, initBC ,initJCLB ,initYHBM ,initYHJB,initLlr} from "@/api/sgyhpczl/initSelect";
import {getPageList} from "@/api/sgyhpczl/Issuedbysuperiors";
import {danger_export_do} from "@/api/sgyhpczl/hiddenDangerRectification";
import {
    initJCBM,
    initYHLX,
    initBC,
    initJCLB,
    initYHBM,
    initYHJB,
    initLlr,
    initReformStatus
} from "@/api/sgyhpczl/initSelect";
export default {
    data() {
        return {
            radio1:'待发送',
            selectedList:[],
            reList:[{label:"未关联",value:0}],
            llrList:[],
            YHType: '1',
            selectedList: [],
            reList: [{label: "未关联", value: 0}],
            llrList: [],
            options: [],
            form:{},
            JCDWList:[{label:"众泰煤焦化",value:0},{label:"上级单位",value:1}],
            JCBMList:[],
            YHLXList:[],
            BCList:[],
            JCLBList:[],
            YHBMList:[],
            YHJBList:[],
            form: {},
            JCDWList: [{label: "众泰煤焦化", value: 0}, {label: "上级单位", value: 1}],
            JCBMList: [],
            YHLXList: [],
            BCList: [],
            JCLBList: [],
            YHBMList: [],
            YHJBList: [],
            YHZTList: [],
            loading:false,
            tableData: [],
            listQuery:{
                page:1,
                limit:10,
                form:{
                    ht_community:"众泰煤焦化"
            listQuery: {
                page: 1,
                limit: 10,
                form: {
                    ht_community: "众泰煤焦化"
                },
            },
            currentPage: 1,
@@ -252,7 +313,7 @@
            recordTotal: 0,
        };
    },
    mounted(){
    mounted() {
        this.getPageList()
        this.initYHLX()
        this.initYHJB()
@@ -260,22 +321,28 @@
        this.initJCLB()
        this.initLlr()
        this.initYHBM()
        this.initYHZT()
    },
    methods:{
        deleteBatch(){
            if(this.selectedList==null ||this.selectedList.length==0 ){
                this.$message({type:'warning', message:'至少选中一条数据', duration:3000})
    watch: {
        "YHType": function (newVal, oldVal) {
            this.getPageList()
        }
    },
    methods: {
        deleteBatch() {
            if (this.selectedList == null || this.selectedList.length == 0) {
                this.$message({type: 'warning', message: '至少选中一条数据', duration: 3000})
                return
            }
            var ids=this.selectedList.map((obj) => {
            var ids = this.selectedList.map((obj) => {
                return obj.id
            }).join(",")
            this.$confirm('确认删除吗','提示', {
            this.$confirm('确认删除吗', '提示', {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                type: 'warning'
            })
                .then(()=>{
                .then(() => {
                    delDanger(ids).then(() => {
                        this.getPageList()
                        this.$notify({
@@ -286,168 +353,181 @@
                        });
                    });
                })
                .catch(error =>{
                .catch(error => {
                });
        },
        changeBox(val){
        changeBox(val) {
            this.selectedList = []
            val.forEach((item) => {
                this.selectedList.push(item)
            })
        },
        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})
        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})
                }
            })
        },
        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})
        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})
                }
            })
        },
        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})
        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})
                }
            })
        },
        checkTime(){
            if(this.listQuery.form.check_dateStart!=null && this.listQuery.form.check_dateStart!=''){
                if(this.listQuery.form.check_dateEnd!=null && this.listQuery.form.check_dateEnd!=''){
                }else {
                    this.$message({type:'error', message:"请选择检查结束时间", duration:3000})
        checkTime() {
            if (this.listQuery.form.check_dateStart != null && this.listQuery.form.check_dateStart != '') {
                if (this.listQuery.form.check_dateEnd != null && this.listQuery.form.check_dateEnd != '') {
                } else {
                    this.$message({type: 'error', message: "请选择检查结束时间", duration: 3000})
                    return
                }
            }
            if(this.listQuery.form.check_dateEnd!=null && this.listQuery.form.check_dateEnd!=''){
                if(this.listQuery.form.check_dateStart!=null && this.listQuery.form.check_dateStart!=''){
                }else {
                    this.$message({type:'error', message:"请选择检查开始时间", duration:3000})
            if (this.listQuery.form.check_dateEnd != null && this.listQuery.form.check_dateEnd != '') {
                if (this.listQuery.form.check_dateStart != null && this.listQuery.form.check_dateStart != '') {
                } else {
                    this.$message({type: 'error', message: "请选择检查开始时间", duration: 3000})
                    return
                }
            }
            if(this.listQuery.form.alter_timeStart!=null && this.listQuery.form.alter_timeStart!=''){
                if(this.listQuery.form.alter_timeEnd!=null && this.listQuery.form.alter_timeEnd!=''){
                }else {
                    this.$message({type:'error', message:"请选择限改结束时间", duration:3000})
            if (this.listQuery.form.alter_timeStart != null && this.listQuery.form.alter_timeStart != '') {
                if (this.listQuery.form.alter_timeEnd != null && this.listQuery.form.alter_timeEnd != '') {
                } else {
                    this.$message({type: 'error', message: "请选择限改结束时间", duration: 3000})
                    return
                }
            }
            if(this.listQuery.form.alter_timeEnd!=null && this.listQuery.form.alter_timeEnd!=''){
                if(this.listQuery.form.alter_timeStart!=null && this.listQuery.form.alter_timeStart!=''){
                }else {
                    this.$message({type:'error', message:"请选择改开始时间", duration:3000})
            if (this.listQuery.form.alter_timeEnd != null && this.listQuery.form.alter_timeEnd != '') {
                if (this.listQuery.form.alter_timeStart != null && this.listQuery.form.alter_timeStart != '') {
                } else {
                    this.$message({type: 'error', message: "请选择改开始时间", duration: 3000})
                    return
                }
            }
        },
        getPageList(){
            this.listQuery.page=1
        getPageList() {
            this.listQuery.page = 1
            this.listQuery.form.step = this.YHType;
            this.checkTime()
            getPageList(this.listQuery).then(res=>{
                if (res.data.ok==1) {
            this.loading =true;
            getPageList(this.listQuery).then(res => {
                this.loading =false;
                if (res.data.ok == 1) {
                    this.tableData = res.data.data.items
                     this.recordTotal=res.data.data.total
                }else{
                    this.$message({type:'error', message:res.data.msg, duration:3000})
                    this.recordTotal = res.data.data.total
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        reset(){
            this.listQuery.form={ht_community:"众泰煤焦化"}
        reset() {
            this.listQuery.form = {ht_community: "众泰煤焦化"}
            this.getPageList()
        },
        handleSizeChange(val){
        handleSizeChange(val) {
            this.listQuery.limit = val
            this.getPageListForPagination();
        },
        handleCurrentChange(val){
        handleCurrentChange(val) {
            this.listQuery.page = val
            this.getPageListForPagination();
        },
        getPageListForPagination(){
        getPageListForPagination() {
            this.checkTime()
            getPageList(this.listQuery).then(res=>{
                if (res.data.ok==1) {
            getPageList(this.listQuery).then(res => {
                if (res.data.ok == 1) {
                    this.tableData = res.data.data.items
                    this.recordTotal=res.data.data.total
                }else{
                    this.$message({type:'error', message:res.data.msg, duration:3000})
                    this.recordTotal = res.data.data.total
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        initYHLX(){
            initYHLX().then(res=>{
                if (res.data.ok==1){
                    this.YHLXList=res.data.data
                } else{
                    this.$message({type:'error', message:res.data.msg, duration:3000})
        initYHLX() {
            initYHLX().then(res => {
                if (res.data.ok == 1) {
                    this.YHLXList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        initYHJB(){
            initYHJB().then(res=>{
                if (res.data.ok==1){
                    this.YHJBList=res.data.data
                } else{
                    this.$message({type:'error', message:res.data.msg, duration:3000})
        initYHJB() {
            initYHJB().then(res => {
                if (res.data.ok == 1) {
                    this.YHJBList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        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})
        initYHZT() {
            initReformStatus().then(res => {
                if (res.data.ok == 1) {
                    this.YHZTList = res.data.data
                    console.log(this.YHZTList)
                } 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})
        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})
                }
            })
        },
        updateClick(row){
        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})
                }
            })
        },
        updateClick(row) {
            this.$router.push({
                path:"/hiddenDangerAdd?id="+row.id
                path: "/hiddenDangerAdd?id=" + row.id
            })
        },
        jump(){
        jump() {
            this.$router.push({
                path:"/hiddenDangerAdd"
                path: "/hiddenDangerAdd"
            })
        },
        // 发送隐患单跳转
        handleClick(row){
        handleClick(row) {
            this.$router.push({
                path:"/hiddenDangerList?id="+row.id,
                path: "/superiorsSend?id=" + row.id,
            })
        },
        deleteClick(row){
            this.$confirm('确认删除吗','提示', {
        deleteClick(row) {
            this.$confirm('确认删除吗', '提示', {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                type: 'warning'
            })
                .then(()=>{
                .then(() => {
                    delDanger(row.id).then(() => {
                        this.getPageList()
                        this.$notify({
@@ -458,29 +538,80 @@
                        });
                    });
                })
                .catch(error =>{
                .catch(error => {
                });
        },
        //方法区
        formatDate(data) {
            // 获取单元格数据
            if (data == null) {
                return null
            }
            let dt = new Date(data)
            return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate()
        },
        //方法区
        formatColumnDate(row, column) {
            // 获取单元格数据
            let data = row[column.property]
            if (data == null) {
                return null
            }
            let dt = new Date(data)
            return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + ' '
        },
        exportData() {
            this.listLoading = true
            var requestData = JSON.parse(JSON.stringify(this.listQuery));
            requestData.export_type = 5;
            //删除分页参数
            this.$delete(requestData, 'page')
            this.$delete(requestData, 'limit')
            danger_export_do(requestData).then(res => {
                this.listLoading = false
                var blob = new Blob([res.data])
                var downloadElement = document.createElement('a')
                var href = window.URL.createObjectURL(blob) //创建下载的链接
                downloadElement.href = href
                downloadElement.download = '上级下达隐患.xlsx' //下载后文件名
                document.body.appendChild(downloadElement)
                downloadElement.click() //点击下载
                document.body.removeChild(downloadElement) //下载完成移除元素
                window.URL.revokeObjectURL(href) //释放掉blob对象
            }).catch(err => {
                console.log(err)
            })
        },
        showDetails(row) {
            this.$router.push({
                path: "/dangerDetails",
                query: {"id": row.id, "route": "/Issuedbysuperiors"}
            })
        }
    }
};
</script>
<style scoped>
 .inquire {
        display: flex;
        justify-content: left;
        flex-wrap: wrap;
    }
    .inquire .el-form-item {
        padding: 0 46px;
    }
    .title-center {
        padding: 20px 0;
    }
    .btns {
        background-color: #034ea2;
        border: 1px solid #034ea2;
    }
    .title-center /deep/ .el-radio-button:first-child .el-radio-button__inner {
.inquire {
    display: flex;
    justify-content: left;
    flex-wrap: wrap;
}
.inquire .el-form-item {
    padding: 0 46px;
}
.title-center {
    padding: 20px 0;
}
.btns {
    background-color: #034ea2;
    border: 1px solid #034ea2;
}
.title-center /deep/ .el-radio-button:first-child .el-radio-button__inner {
    border: none;
}
@@ -489,6 +620,11 @@
    border-radius: 0px;
}
.blue-font-color:hover {
    cursor: pointer;
    color: blue;
}
.title-center /deep/ .el-radio-button__orig-radio:checked + .el-radio-button__inner {
    background-color: #034ea2;
    background-color: #034ea2;
src/views/Issuedbysuperiors/superiorsSend.vue
@@ -1,13 +1,576 @@
<template>
    <div class="app-container">
        <div style="">
            <Titlename title="发送隐患单"></Titlename>
            <div class="whole-form">
                <el-form :model="ruleForm" ref="ruleForm" label-width="150px" class="demo-ruleForm"
                         style="margin: 0 14% 0 16%;">
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="隐患编号" prop="name">
                                <el-input v-model="ruleForm.number" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="检查单位" prop="elementAName">
                                <el-select
                                    v-model="ruleForm.check_main_branch"
                                    :disabled="true"
                                    style="width: 100%"
                                >
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="检查人" prop="region">
                                <el-input v-model="ruleForm.check_man" :disabled="true"></el-input>
                                <!--                                <el-select-->
                                <!--                                    v-model="ruleForm.elementAName"-->
                                <!--                                    :disabled="true"-->
                                <!--                                    style="width: 100%"-->
                                <!--                                >-->
                                <!--                                </el-select>-->
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="陪检人员" prop="name">
                                <el-input v-model="ruleForm.acc_man" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="检查时间" prop="name">
                                <el-date-picker
                                    v-model="ruleForm.check_date"
                                    type="date"
                                    :disabled="true"
                                    placeholder="选择日期"
                                    style="width: 100%">
                                </el-date-picker>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <!--                            <el-form-item label="班次" prop="name">-->
                            <!--                                <el-input v-model="ruleForm.name"></el-input>-->
                            <!--                            </el-form-item>-->
                            <el-form-item label="班次" prop="elementAName">
                                <el-select
                                    v-model="ruleForm.check_class"
                                    :disabled="true"
                                    style="width: 100%"
                                >
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="跟班、带班情况" prop="name">
                                <el-input v-model="ruleForm.class_situation" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="跟班、带班人员" prop="name">
                                <el-input v-model="ruleForm.class_man" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="行走路线" prop="name">
                                <el-input type="textarea" v-model="ruleForm.route" class="multiline"
                                          :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="隐患单位" prop="name">
                                <!--<el-input v-model="ruleForm.name"></el-input>-->
                                <el-select
                                    v-model="ruleForm.ht_community"
                                    :disabled="true"
                                    style="width: 100%"
                                >
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="隐患部门" prop="name">
                                <!--                                <el-input v-model="ruleForm.name"></el-input>-->
                                <el-select
                                    v-model="ruleForm.ht_branch"
                                    :disabled="true"
                                    style="width: 100%"
                                >
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="隐患地点" prop="name">
                                <el-input type="textarea" v-model="ruleForm.address" class="multiline"
                                          :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="隐患内容" prop="name">
                                <el-input type="textarea" v-model="ruleForm.ht_content" class="multiline"
                                          :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="隐患类别" prop="name">
                                <!--<el-input v-model="ruleForm.name"></el-input>-->
                                <el-select
                                    v-model="ruleForm.ht_typesub"
                                    :disabled="true"
                                    style="width: 100%"
                                >
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="隐患级别" prop="name">
                                <!--<el-input v-model="ruleForm.name"></el-input>-->
                                <el-select
                                    v-model="ruleForm.ht_level"
                                    :disabled="true"
                                    style="width: 100%"
                                >
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="整改措施" prop="name">
                                <el-input v-model="ruleForm.measure" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="所需资金" prop="name">
                                <el-input v-model="ruleForm.name" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="限改时间" prop="name">
                                <!--<el-input v-model="ruleForm.name"></el-input>-->
                                <el-date-picker
                                    v-model="ruleForm.alter_time"
                                    type="date"
                                    :disabled="true"
                                    placeholder="选择日期"
                                    style="width: 100%">
                                </el-date-picker>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="责任人" prop="name">
                                <el-input v-model="ruleForm.duty_officer" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="完成时间" prop="name">
                                <!--<el-input v-model="ruleForm.name"></el-input>-->
                                <el-date-picker
                                    v-model="ruleForm.ACCOMPLISHTIME"
                                    type="date"
                                    :disabled="true"
                                    placeholder="选择日期"
                                    style="width: 100%">
                                </el-date-picker>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="整改完成情况" prop="name">
                                <el-input v-model="ruleForm.name" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="复查时间" prop="name">
                                <!--<el-input v-model="ruleForm.name"></el-input>-->
                                <el-date-picker
                                    v-model="ruleForm.CALLBACKTIME"
                                    type="date"
                                    :disabled="true"
                                    placeholder="选择日期"
                                    style="width: 100%">
                                </el-date-picker>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="复查人" prop="name">
                                <el-input v-model="ruleForm.CALLBACKPERSON" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="复查结果" prop="name">
                                <el-input v-model="ruleForm.CALLBACKRESULT" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="整改次数" prop="name">
                                <el-input v-model="ruleForm.amendnum" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="危险源" prop="name">
                                <el-input type="textarea" v-model="ruleForm.dangerousSource" class="multiline"
                                          :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="风险等级" prop="name">
                                <!--                                <el-input v-model="ruleForm.name" :disabled="true"></el-input>-->
                                <el-select
                                    v-model="ruleForm.DTRisk_level"
                                    :disabled="true"
                                    style="width: 100%"
                                >
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="业务科室" prop="name">
                                <!--                                <el-input v-model="ruleForm.name" :disabled="true"></el-input>-->
                                <el-select
                                    v-model="ruleForm.Review"
                                    :disabled="true"
                                    style="width: 100%"
                                >
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="流程信息" prop="name">
                                <!--                                <el-input v-model="ruleForm.name" class="multiline" :disabled="true"></el-input>-->
                                <el-table
                                    :data="tableData"
                                    border
                                    style="width: 100%">
                                    <el-table-column
                                        type="index"
                                        label="步骤"
                                        align="center"
                                        >
                                    </el-table-column>
                                    <el-table-column
                                        prop="realname"
                                        label="操作人"
                                        align="center"
                                       >
                                    </el-table-column>
                                    <el-table-column
                                        prop="create_time"
                                        label="处理时间"
                                        align="center"
                                       >
                                    </el-table-column>
                                    <el-table-column
                                        prop="content"
                                        label="审批意见"
                                        align="center"
                                        >
                                        <template slot-scope="scope">
                                            <span size="medium">{{ scope.row.content }}</span>
                                            <span v-for="item in scope.row.realFileName">
                                                <el-link  type="primary" @click="downloadFile(subFile(item))">
                                                    {{subFile(item)}}
                                                </el-link>
                                            </span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
                                        prop="ispass"
                                        label="流程信息"
                                        align="center"
                                        width="170">
                                    </el-table-column>
                                </el-table>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="发送流程:" prop="name">
                                <!--                                <el-input type="textarea" v-model="ruleForm.name" class="multiline"-->
                                <!--                                          :disabled="true"></el-input>-->
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="下一步:" prop="name">
                                <span>隐患下达责任部门</span>
                                <!--                                <el-input type="textarea" v-model="ruleForm.name" class="multiline"-->
                                <!--                                          :disabled="true"></el-input>-->
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-form>
                <el-form :model="sendDataForm" :rules="rules" ref="sendDataForm" label-width="150px"
                         class="demo-ruleForm"
                         style="margin: 0 14% 0 16%;">
                    <div>
                        <el-row>
                            <el-col :span="9">
                                <el-form-item label="隐患部门" prop="ht_branch">
                                    <el-input v-model="sendDataForm.ht_branch" clearable></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="9">
                                <el-form-item label="责任人" prop="duty_officer">
                                    <el-input v-model="sendDataForm.duty_officer" clearable></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="9">
                                <el-form-item label="业务科室" prop="Review">
                                    <el-input v-model="sendDataForm.Review" clearable></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="22">
                                <el-form-item label="备注" prop="dealContent">
                                    <el-input class="textarea" type="textarea"
                                              v-model="sendDataForm.dealContent"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </div>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item style="text-align: center;">
                                <el-button class="btn" size="small" type="primary" @click="submitForm('sendDataForm')">
                                    保存
                                </el-button>
                                <el-button size="small" @click="close()">关闭</el-button>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-form>
            </div>
        </div>
    </div>
</template>
<script>
import Titlename from "../../components/Titlename/index.vue";
import {getDangerDetails, getWfRecordList} from "@/api/sgyhpczl/recheckCancellationNumber";
import {company_next_step_do} from "@/api/sgyhpczl/Issuedbysuperiors";
import {getUserInfo} from "@/api/sgyhpczl/hiddenDangerManagement";
import {downloadFile} from "@/api/sgyhpczl/fileUtils";
export default {
    name: "superiorsSend"
    components: {Titlename},
    name: "recheckHiddenDangerList",
    data() {
        return {
            ruleForm: {
                id: "",
                step: "3",
                ispass: "",
                CALLBACKTIME: "",
                CALLBACKPERSON: "",
                CALLBACKRESULT: "",
                dealContent: "",
            },
            sendDataForm: {
                id: "",
                duty_officer: "",
                ht_branch: "",
                Review: "",
                dealContent: "",
            },
            rules: {
                // duty_officer: {required: true, message: '请填写复查时间', trigger: 'blur'},
                ht_branch: {required: true, message: '隐患部门不能为空', trigger: 'blur'},
                Review: {required: true, message: '业务科室不能为空', trigger: 'blur'},
            },
            tableData: [],
            fileList: [],
            // safetyInspectionItemResult:'0',
        };
    },
    mounted() {
        this.getDangerDetails();
        this.getWfRecordList();
    },
    methods: {
        getUserInfo() {
            getUserInfo().then(res => {
                if (res.data.code == 200) {
                    this.sendDataForm.Review = res.data.result.department;
                } else {
                    this.$message({type: 'error', message: "用户信息获取失败!请重试", duration: 3000})
                }
            })
        },
        getDangerDetails() {
            getDangerDetails(this.$route.query.id).then(res => {
                var data = res.data;
                if (data.ok) {
                    this.ruleForm = data.data;
                    this.ruleForm.url = process.env.BASE_API;
                    this.sendDataForm.id = this.ruleForm.id
                } else {
                    this.$message({type: 'error', message: "数据查询失败,请重试!", duration: 3000})
                }
            })
        },
        getWfRecordList() {
            getWfRecordList(this.$route.query.id).then(res => {
                var data = res.data;
                if (data.ok) {
                    this.tableData = data.data;
                } else {
                    this.$message({type: 'error', message: "数据查询失败,请重试!", duration: 3000})
                }
            })
        },
        submitForm(formName) {
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    company_next_step_do(this.sendDataForm).then(res => {
                        var msg = res.data.msg;
                        if (res.data.ok) {
                            this.$router.push({
                                path: "/recheckCancellationNumber",
                            })
                            this.$message({type: 'success', message: msg, duration: 3000})
                        } else {
                            this.$message({type: 'error', message: msg, duration: 3000})
                        }
                    })
                    // alert('submit!');
                } else {
                    console.log('error submit!!');
                    return false;
                }
            });
        },
        handleRemove(file, fileList) {
            console.log(file, fileList);
        },
        handlePreview(file) {
            console.log(file);
        },
        beforeUpload(file) {
            var FileExt = file.name.replace(/.+\./, "");
            if (['jpg', 'png', 'bmp', 'gif', 'jpeg'].indexOf(FileExt.toLowerCase()) === -1) {
                this.$message({
                    type: 'warning',
                    message: '请上传后缀名为jpg、png、bmp、gif、jpeg的图片!'
                });
                return false;
            }
        },
        close() {
            this.$router.push({
                path: "/recheckCancellationNumber"
            })
        },
        subFile(fileName){
            return  fileName.substring(fileName.indexOf("fileName=")+9)
        },
        downloadFile(path){
            let params = {
                type: 0,
                fileName: path,
            };
            downloadFile(params).then((res) => {
                if(res.data.type=='text/json'){
                    const reader  = new FileReader();
                    reader.readAsText(res.data, 'utf-8');
                    reader.onload = e => {
                        this.$message({
                            type: "error",
                            message: JSON.parse(reader.result).msg,
                            duration: 3000,
                        });
                    }
                } else {
                    let blob = new Blob([res.data], {type: 'application/octet-stream'})
                    console.log(blob)
                    let blobUrl = window.URL.createObjectURL(blob)
                    let downloadElement = document.createElement('a')
                    downloadElement.href = blobUrl
                    downloadElement.download = path
                    document.body.appendChild(downloadElement)
                    downloadElement.click()
                    document.body.removeChild(downloadElement)
                    window.URL.revokeObjectURL(blobUrl)
                }
            });
        },
    }
}
</script>
<style scoped>
.app-container {
    padding: 20px;
    height: 850px;
    overflow-y: auto;
}
/deep/ .box {
    padding-top: 0;
}
/deep/ .multiline .el-input__inner {
    height: 62px;
}
/deep/ .textarea .el-textarea__inner {
    height: 80px;
    max-height: 80px;
    overflow-y: auto
}
/deep/ .textarea2 .el-textarea__inner {
    height: 100px;
    max-height: 100px;
    overflow-y: auto
}
.btn {
    background-color: #034ea2;
    border: 1px solid #034ea2;
}
/*.el-button:hover {*/
/*    background: #66b1ff;*/
/*    border-color: #66b1ff;*/
/*    color: #FFF;*/
/*}*/
</style>
src/views/careabout/index.vue
对比新文件
@@ -0,0 +1,577 @@
<template>
    <div class="app-container">
       <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>
            <el-form-item label="检查单位">
                <el-select v-model="listQuery.form.check_main_branch" placeholder="请选择"  @change="changeJCDW">
                    <el-option
                        v-for="item in JCDWList"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                    >
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="检查部门">
                <el-select v-model="listQuery.form.check_branch" placeholder="请选择">
                    <el-option
                        v-for="item in JCBMList"
                        :key="item.value"
                        :label="item.value"
                        :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="检查人">
                <el-input v-model="listQuery.form.check_man" style="width:202px" placeholder="请输入内容"></el-input>
            </el-form-item>
            <el-form-item label="隐患单位">
                <el-input v-model="listQuery.form.ht_community" style="width:202px" :disabled="true"></el-input>
                <!--<el-select v-model="listQuery.form.ht_community" placeholder="请选择" @change="changeYHDW">
             <el-option
               v-for="item in JCDWList"
               :key="item.value"
               :label="item.label"
               :value="item.value">
             </el-option>
           </el-select>-->
            </el-form-item>
            <el-form-item label="隐患部门">
                <el-select v-model="listQuery.form.ht_branch" placeholder="请选择">
                    <el-option
                        v-for="item in YHBMList"
                        :key="item.branch_id"
                        :label="item.branch_name"
                        :value="item.branch_name">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="隐患类别">
                <el-select v-model="listQuery.form.ht_typesub" placeholder="请选择">
                    <el-option
                        v-for="item in YHLXList"
                        :key="item.value"
                        :label="item.value"
                        :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="隐患级别">
                <el-select v-model="listQuery.form.ht_level" placeholder="请选择">
                    <el-option
                        v-for="item in YHJBList"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="检查类别">
                <el-select v-model="listQuery.form.checktype" placeholder="请选择">
                    <el-option
                        v-for="item in JCLBList"
                        :key="item.value"
                        :label="item.value"
                        :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="隐患地点">
                <el-input v-model="listQuery.form.address" style="width:202px" placeholder="请输入内容"></el-input>
            </el-form-item>
            <el-form-item label="隐患内容">
                <el-input v-model="listQuery.form.ht_content" style="width:202px" placeholder="请输入内容"></el-input>
            </el-form-item>
            <el-form-item label="班次">
                <el-select v-model="listQuery.form.check_class" placeholder="请选择">
                    <el-option
                        v-for="item in BCList"
                        :key="item.value"
                        :label="item.value"
                        :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="深入现场情况">
                <el-select v-model="listQuery.form.class_situation" placeholder="请选择">
                    <el-option
                        v-for="item in reList"
                        :key="item.value"
                        :label="item.value"
                        :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <!-- <el-form-item label="录入人">
                <el-select v-model="listQuery.form.createBy" placeholder="请选择">
                    <el-option
                        v-for="item in llrList"
                        :key="item.id"
                        :label="item.realName"
                        :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item> -->
            <el-form-item label="检查时间">
                <el-col :span="11">
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.check_dateStart" style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker>
                </el-col>
                <el-col style="text-align:center" :span="2">-</el-col>
                <el-col :span="11">
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.check_dateEnd" style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker>
                </el-col>
            </el-form-item>
            <el-form-item label="限改时间">
                <el-col :span="11">
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.alter_timeStart" value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker>
                </el-col>
                <el-col style="text-align:center" :span="2">-</el-col>
                <el-col :span="11">
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.alter_timeEnd" value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker>
                </el-col>
            </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" @click="exportData">导出excel</el-button>
            </el-form-item>
        </el-form>
     <el-row class="title-center">
            <el-col :span="10">
                <el-radio-group  v-model="listQuery.tag" @change="typeChange">
                    <el-radio-button label="0"
                                     v-for="item in tagList"
                                     :label="item.value"
                                     :key="item.value">
                        {{item.value}}
                    </el-radio-button>
<!--                    <el-radio-button label="1">特别关注</el-radio-button>-->
<!--                    <el-radio-button label="2">全部</el-radio-button>-->
                </el-radio-group>
            </el-col>
            <div v-if="table1">
            <el-col :span="14" style="text-align:right;">
                <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="handleSelectionChange" v-loading="listLoading">
            <el-table-column type="selection" width="55" align="center"></el-table-column>
            <el-table-column prop="number" label="编号" align="center" width="120">
                <template slot-scope="scope">
                    <div class="blue-font-color" @click="showDetails(scope.row)">{{ scope.row.number }}</div>
                </template>
            </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="检查时间" :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">
                    <template slot-scope="scope">
                        <el-popover trigger="hover" placement="top">
                            <p>{{ scope.row.ht_content }}</p>
                            <div slot="reference" class="name-wrapper">{{
                                    scope.row.ht_content != null && scope.row.ht_content.length > 10 ? scope.row.ht_content.substring(0, 8) + "...." : scope.row.ht_content
                                }}
                            </div>
                        </el-popover>
                    </template>
                </el-table-column>
                <el-table-column prop="ht_typesub" label="类别" 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="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="限改时间" :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="完成时间" :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="复查时间" :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>
                </template>
            </el-table-column>
            <el-table-column prop="DTRisk_bankId" label="是否关联" align="center">
                <template slot-scope="scope">
                    <span v-if="scope.row.DTRisk_bankId==0 || scope.row.DTRisk_bankId=='' || scope.row.DTRisk_bankId==null">未关联</span>
                    <span v-else>已关联</span>
                </template>
            </el-table-column>
            <el-table-column prop="DTRisk_level" label="风险等级" align="center"> </el-table-column>
            <el-table-column prop="warningLevel" label="初始警情" align="center"> </el-table-column>
            <el-table-column prop="curWarningLevel" label="当前警情" align="center"> </el-table-column>
            <!-- <el-table-column prop="date" label="流程操作" align="center"  fixed="right">
                <template slot-scope="scope">
                    <el-button @click="handleClick(scope.row)" type="text" size="small">点击发送</el-button>
                </template>
            </el-table-column>
            <el-table-column prop="date" label="基本操作" align="center"  fixed="right">
                <template slot-scope="scope">
                    <el-button @click="updateClick(scope.row)" type="text" size="small">编辑</el-button>
                    <el-button @click="deleteClick(scope.row)" type="text" size="small">删除</el-button>
                </template>
            </el-table-column> -->
        </el-table>
        <div style="text-align: right">
            <el-pagination
                v-show="recordTotal > 0"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-sizes="[10, 20, 30, 50]"
                :page-size="pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="recordTotal"
            >
            </el-pagination>
        </div>
    </div>
</template>
<script>
import { getPageList, danger_focus_tag, analogy_export_do, focus_do} from "@/api/sgyhpczl/careabout"
import {initJCBM ,initYHLX, initBC ,initJCLB ,initYHBM ,initYHJB,initLlr,initSrxcqk} from "@/api/sgyhpczl/initSelect";
    export default{
        data(){
            return{
                listQuery:{
                    page:1,
                    limit:10,
                    tag: '全部',
                    form:{
                        ht_community:'众泰煤焦化'
                    },
                },
                radio1:'待发送',
                table1:true,
                table2:false,
                focusDesc: '特别关注',
                currentPage: 1,
                pageSize: 10,
                recordTotal: 0,
                JCDWList:[{label:"众泰煤焦化",value:0},{label:"上级单位",value:1}],
                JCBMList:[],
                YHLXList:[],
                BCList:[],
                reList:[],
                JCLBList:[],
                YHBMList:[],
                YHJBList:[],
                tagList:[],
                tableData:[],
                selectedList:[],
                listLoading: false,
                selfInspectVisible: false,
                selfInspectForm:{
                    id: '',
                    markUserName:'',
                    markDate:'',
                    remark:'',
                },
                selfInspectFormRules:{
                    markUserName: [{ required: true, message: '自查人不能为空', trigger: 'blur' }],
                    markDate: [{ required: true, message: '自查时间不能为空', trigger: 'blur' }]
                },
            }
        },
        mounted() {
            this.initYHLX();
            this.initYHJB();
            this.initBC();
            this.initJCLB();
            this.initLlr();
            this.initYHBM();
            this.initSrxcqk();
            this.initTags();
            this.getPageList();
        },
        methods:{
            sendBath(){
                this.$router.push({
                    path:'/managementConcerns'
                })
            },
            handleClick(data,val){
                if(val=='存在'){
                    this.$router.push({
                        path:'/exist'
                    })
                }
            },
            initYHLX(){
                initYHLX().then(res=>{
                    if (res.data.ok==1){
                        this.YHLXList=res.data.data
                    } else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            },
            initYHJB(){
                initYHJB().then(res=>{
                    if (res.data.ok==1){
                        this.YHJBList=res.data.data
                    } else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            },
            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})
                    }
                })
            },
            initSrxcqk(){
                initSrxcqk().then(res=>{
                    if (res.data.ok==1){
                        this.reList=res.data.data
                    } else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            },
            initTags(){
                danger_focus_tag().then(res=>{
                    if (res.data.ok==1){
                        this.tagList=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})
                    }
                })
            },
            checkTime(){
                if(this.listQuery.form.check_dateStart!=null && this.listQuery.form.check_dateStart!=''){
                    if(this.listQuery.form.check_dateEnd!=null && this.listQuery.form.check_dateEnd!=''){
                    }else {
                        this.$message({type:'error', message:"请选择检查结束时间", duration:3000})
                        return
                    }
                }
                if(this.listQuery.form.check_dateEnd!=null && this.listQuery.form.check_dateEnd!=''){
                    if(this.listQuery.form.check_dateStart!=null && this.listQuery.form.check_dateStart!=''){
                    }else {
                        this.$message({type:'error', message:"请选择检查开始时间", duration:3000})
                        return
                    }
                }
            },
            //搜索
            getPageList(){
                this.listQuery.page=1
                // this.listQuery.limit=10
                this.checkTime()
                this.listLoading = true
                getPageList(this.listQuery).then(res=>{
                    this.listLoading = false
                    if (res.data.ok==1) {
                        this.tableData = res.data.data.items
                        this.recordTotal=res.data.data.total
                    }else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            },
            //重置
            reset(){
                this.listQuery.form = {ht_community: "众泰煤焦化"}
                this.getPageList()
            },
            handleSizeChange(val){
                this.listQuery.limit = val
                this.getPageListForPagination();
            },
            handleCurrentChange(val){
                this.listQuery.page = val
                this.getPageListForPagination();
            },
            getPageListForPagination(){
                this.checkTime()
                getPageList(this.listQuery).then(res=>{
                    if (res.data.ok==1) {
                        this.tableData = res.data.data.items
                        this.recordTotal=res.data.data.total
                    }else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            },
            showDetails(row){
                this.$router.push({
                    path: "/dangerDetails",
                    query:{"id":row.id}
                })
            },
            typeChange(val){
                this.listQuery.tag = val;
                if (val == '特别关注'){
                    this.focusDesc = '取消关注'
                }else {
                    this.focusDesc = '特别关注'
                }
                this.getPageList()
            },
            handleSelectionChange(val){
                this.selectedList = []
                val.forEach((item) => {
                    this.selectedList.push(item)
                })
            },
            exportData() {
                this.listLoading = true
                var requestData = JSON.parse(JSON.stringify(this.listQuery));
                requestData.export_type = 7;
                //删除分页参数
                this.$delete(requestData, 'page')
                this.$delete(requestData, 'limit')
                analogy_export_do(requestData).then(res => {
                    this.listLoading = false
                    var blob = new Blob([res.data])
                    var downloadElement = document.createElement('a')
                    var href = window.URL.createObjectURL(blob) //创建下载的链接
                    downloadElement.href = href
                    downloadElement.download = '隐患信息一览.xlsx' //下载后文件名
                    document.body.appendChild(downloadElement)
                    downloadElement.click() //点击下载
                    document.body.removeChild(downloadElement) //下载完成移除元素
                    window.URL.revokeObjectURL(href) //释放掉blob对象
                }).catch(err => {
                    console.log(err)
                })
            },
            //特别关注/取消关注
            specialFocus(){
                if (this.selectedList == null || this.selectedList.length == 0) {
                    this.$message({type: 'warning', message: '至少选中一条数据', duration: 3000})
                    return
                }
                var type = this.listQuery.tag == '特别关注' ? 'del' : 'add'
                var desc = this.listQuery.tag == '特别关注' ? '确认取消吗' : '确认关注吗'
                this.$confirm(desc, '提示', {
                    confirmButtonText: '确认',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    var ids = this.selectedList.map((obj) => {
                        return obj.id
                    }).join(",")
                    let data = {
                        type: type,
                        ids: ids,
                    }
                    focus_do(data).then(() => {
                        this.getPageList()
                        this.$notify({
                            title: "成功",
                            message: "操作成功",
                            type: "success",
                            duration: 2000,
                        });
                    });
                }).catch(error => {
                });
            },
            //日期格式转换
            formatColumnDate(row, column) {
                // 获取单元格数据
                let data = row[column.property]
                if (data == null) {
                    return null
                }
                let dt = new Date(data)
                return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + ' '
            },
        }
    }
</script>
<style scoped>
.inquire {
    display: flex;
    justify-content: left;
    flex-wrap: wrap;
}
.inquire .el-form-item {
    padding: 0 40px;
}
.title-center {
    padding: 20px 0;
}
.btns {
    background-color: #034ea2;
    border: 1px solid #034ea2;
}
.title-center /deep/ .el-radio-button:first-child .el-radio-button__inner {
    border: none;
}
.title-center /deep/ .el-radio-button__inner {
    border: none;
    border-radius: 0px;
}
.title-center /deep/ .el-radio-button__orig-radio:checked + .el-radio-button__inner {
    background-color: #034ea2;
    background-color: #034ea2;
}
</style>
src/views/careabout/managementConcerns.vue
对比新文件
@@ -0,0 +1,240 @@
<template>
    <div class="app-container">
        <div>
            <Titlename title="设置页面"></Titlename>
            <div class="whole-form">
                <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" class="demo-ruleForm"
                         style="margin: 0 5% 0 5%;">
                    <el-row>
                        <el-col :span="6">
                            <el-form-item label="名称" prop="number">
                                <el-input v-model="ruleForm.number" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-checkbox-group v-model="checkList">
                        <el-checkbox label="复选框 A">
                            <el-form-item label="检查时间" prop="check_man">
                                <el-radio-group v-model="ruleForm.radio">
                                    <el-radio :label="1">一个月</el-radio>
                                    <el-radio :label="2">两个月</el-radio>
                                    <el-radio :label="3">三个月</el-radio>
                                </el-radio-group>
                            </el-form-item>
                        </el-checkbox>
                        <el-checkbox>
                            <el-form-item class="select" label="检查单位" prop="acc_man">
                                <el-select v-model="ruleForm.region" placeholder="请选择">
                                    <el-option label="众泰煤焦化" value="shanghai"></el-option>
                                    <el-option label="上级单位" value="beijing"></el-option>
                                </el-select>
                                <el-select v-model="ruleForm.region" placeholder="请选择">
                                    <el-option label="安全环保部" value="shanghai"></el-option>
                                    <el-option label="机电部" value="beijing"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-checkbox>
                        <el-checkbox>
                            <el-form-item label="检查人" prop="number">
                                <el-input v-model="ruleForm.number" :disabled="true"></el-input>
                            </el-form-item>
                        </el-checkbox>
                        <el-checkbox>
                            <el-form-item label="隐患类别" prop="acc_man">
                                <el-select v-model="ruleForm.region" placeholder="请选择">
                                    <el-option label="生产" value="shanghai"></el-option>
                                    <el-option label="设备" value="beijing"></el-option>
                                    <el-option label="电气" value="shanghai"></el-option>
                                    <el-option label="仪表" value="beijing"></el-option>
                                    <el-option label="安全管理" value="shanghai"></el-option>
                                    <el-option label="其他" value="beijing"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-checkbox>
                        <el-checkbox label="复选框 A">
                            <el-form-item label="隐患级别" prop="acc_man">
                                <el-select v-model="ruleForm.region" placeholder="请选择">
                                    <el-option label="一般隐患D" value="shanghai"></el-option>
                                    <el-option label="一般隐患C" value="beijing"></el-option>
                                    <el-option label="重大隐患B" value="shanghai"></el-option>
                                    <el-option label="重大隐患A" value="beijing"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-checkbox>
                        <el-checkbox>
                            <el-form-item class="select" label="检查类别" prop="acc_man">
                                <el-select v-model="ruleForm.region" placeholder="请选择">
                                    <el-option label="众泰煤焦化" value="shanghai"></el-option>
                                    <el-option label="上级单位" value="beijing"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-checkbox>
                        <el-checkbox label="重复隐患" class="checkbox">
                        </el-checkbox>
                    </el-checkbox-group>
                    <el-checkbox-group v-model="checkList1">
                        <el-checkbox>
                            <el-form-item label="限改时间" prop="check_man">
                                <el-radio-group v-model="ruleForm.radio">
                                    <el-radio :label="4">即将到期</el-radio>
                                    <el-radio :label="5">到期未整改</el-radio>
                                    <el-radio :label="6">超期整改</el-radio>
                                </el-radio-group>
                            </el-form-item>
                        </el-checkbox>
                    </el-checkbox-group>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="备注" prop="address">
                                <el-input type="textarea" v-model="ruleForm.address" class="multiline" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item style="text-align: center;">
                                <el-button  class="btn" size="small" type="primary" @click="close()"
                                >保存</el-button>
                                <el-button  class="btn" size="small" type="primary" @click="close()"
                                >关闭</el-button>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-form>
            </div>
        </div>
    </div>
</template>
<script>
import Titlename from "../../components/Titlename/index.vue";
import {getDangerInfo,next_step_do} from '@/api/sgyhpczl/hiddenDangerRegistration'
import {deepClone} from '@/utils'
export default {
    name: "managementConcerns",
    components: {Titlename},
    data() {
        return {
            id:'',
            ruleForm: {
                radio:3
            },
            rules: {
                reviewTime: { required: true, message: '请填写复查时间', trigger: 'blur' },
                rechecker: { required: true, message: '请填写复查人', trigger: 'blur' },
                reviewResults: { required: true, message: '请填写复查结果', trigger: 'blur' },
                desc1: { required: true, message: '复查不通过时请在备注说明原因!', trigger: 'blur' },
            },
            fileList: [],
            checkList: [],
            checkList1:[]
        };
    },
    mounted(){
        this.id = this.$route.query.id;
        if( this.id!=null &&  this.id!=''){
            this.initInfo();
        }
    },
    methods: {
        async initInfo(){
            var res=await getDangerInfo(this.id)
            if (res.data.ok==1){
                this.ruleForm=res.data.data
                this.ruleForm.next='发送到'+res.data.data.ht_community+res.data.data.ht_branch
            }
        },
        handleRemove(file, fileList) {
            console.log(file, fileList);
        },
        handlePreview(file) {
            console.log(file);
        },
        beforeUpload(file) {
            var FileExt = file.name.replace(/.+\./, "");
            if (['jpg','png','bmp','gif','jpeg'].indexOf(FileExt.toLowerCase()) === -1){
                this.$message({
                    type: 'warning',
                    message: '请上传后缀名为jpg、png、bmp、gif、jpeg的图片!'
                });
                return false;
            }
        },
        close(){
            this.$router.push({
                path:"/hiddenDangerRegistration"
            })
        }
    }
}
</script>
<style scoped>
.app-container {
    padding: 20px;
    height: 850px;
    overflow-y: auto;
}
/deep/ .box {
    padding-top: 0;
}
/deep/ .multiline .el-input__inner {
    height: 62px;
}
/deep/ .textarea .el-textarea__inner{
    height: 80px;
    max-height: 80px;
    overflow-y: auto
}
/deep/ .textarea2 .el-textarea__inner{
    height: 100px;
    max-height: 100px;
    overflow-y: auto
}
/deep/ .el-checkbox-group{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}
/deep/ .el-checkbox{
    width: 25%;
    margin-right: 0;
    padding-right: 10px;
}
/deep/ .el-checkbox__label{
    padding-left: 0;
}
/deep/ .el-checkbox__input{
    top: 11px;
    left: -5px;
    position: absolute;
}
.checkbox{
    margin-bottom: 22px;
}
.checkbox /deep/ .el-checkbox__input{
    top: 2px;
    left: -5px;
    position: absolute;
}
.checkbox /deep/ .el-checkbox__label{
    padding-left: 25px;
}
 /deep/ .el-input__inner{
    width: 130px;
}
/deep/.el-radio{
    margin-right: 20px;
}
.btn{
    background-color: #034ea2;
    border: 1px solid #034ea2;
}
</style>
src/views/chartAnalysis/index.vue
对比新文件
@@ -0,0 +1,916 @@
<template>
    <div>
        <div class="whole_top">
            <el-form ref="form" :inline="true" :model="formData">
                <div class="top">
                    <el-form-item label="类别:">
                        <el-checkbox-group v-model="formData.ht_typesub">
                            <el-checkbox v-for="item in YHLXList" :key="item.value" :value="item.value"
                                         :label="item.value"></el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="级别:">
                        <el-checkbox-group v-model="formData.level">
                            <el-checkbox v-for="item in YHJBList" :key="item.value" :value="item.value"
                                         :label="item.value"></el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="上级单位:">
                        <el-checkbox-group v-model="formData.superior">
                            <!--                            <el-checkbox v-for="item in JCBMList" :label="item.value"></el-checkbox>-->
                            <el-checkbox v-for="item in JCBMList" :key="item.value" :value="item.value"
                                         :label="item.value"></el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="检查类别:" class="checkbox">
                        <el-checkbox-group v-model="formData.checktype">
                            <el-checkbox v-for="item in JCLBList" :key="item.value" :value="item.value"
                                         :label="item.value"></el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item label="当前警情:">
                        <el-checkbox-group v-model="formData.curWarningLevel">
                            <el-checkbox label="轻警"></el-checkbox>
                            <el-checkbox label="低警"></el-checkbox>
                            <el-checkbox label="中警"></el-checkbox>
                            <el-checkbox label="重警"></el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <el-form-item style="margin-left: 30px;">
                        <el-radio-group v-model="formData.model">
                            <el-radio label="0">按隐患单位</el-radio>
                            <el-radio label="1">按类别</el-radio>
                            <el-radio label="2">按级别</el-radio>
                            <el-radio label="3">按检查单位</el-radio>
                            <el-radio label="4">按录入单位</el-radio>
                            <el-radio label="5">按检查类别</el-radio>
                            <el-radio label="6">按当前警情</el-radio>
                        </el-radio-group>
                        <el-radio-group v-model="chartType" v-if="!THDB" style="margin-left: 50px;">
                            <el-radio label="line">曲线图</el-radio>
                            <el-radio label="pie">饼状图</el-radio>
                            <el-radio label="column">柱形图</el-radio>
                        </el-radio-group>
                        <el-radio-group v-model="timeDes" v-if="THDB" @change="initTHDBTime" style="margin-left: 50px;">
                            <el-radio label="month">月度</el-radio>
                            <el-radio label="quarter">季度</el-radio>
                            <el-radio label="year">年度</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </div>
                <div class="center">
                    <el-form-item label="已选单位:">
                        <el-input autosize v-model="form.name"></el-input>
                    </el-form-item>
                    <el-form-item autosize label="已选类别:">
                        <el-input v-model="formData.ht_typesub.join(',')"></el-input>
                    </el-form-item>
                    <el-form-item label="已选级别:">
                        <el-input v-model="formData.level.join(',')"></el-input>
                    </el-form-item>
                    <el-form-item label="已选上级单位:">
                        <el-input v-model="formData.superior.join(',')"></el-input>
                    </el-form-item>
                    <el-form-item label="已选检查类别:">
                        <el-input v-model="formData.checktype.join(',')"></el-input>
                    </el-form-item>
                    <el-form-item label="已选当前警情:">
                        <el-input v-model="formData.curWarningLevel.join(',')"></el-input>
                    </el-form-item>
                    <el-form-item label="检查时间:" v-if="!THDB" class="time" style="width: 300px">
                        <el-date-picker
                            style="width: 218px"
                            v-model="time"
                            type="daterange"
                            range-separator="至"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="对比时间:" v-if="THDB" class="time" style="width: 340px">
                        <div v-if="timeDes!='quarter'">
                            <el-date-picker
                                v-model="THDBBegin"
                                :type="timeDes"
                                style="width: 40%;float: left"
                                :value-format="timeDes=='month'?'yyyy年MM月':'yyyy年'"
                                :placeholder="timeDes=='month'?'请选择月':'请选择年'">
                            </el-date-picker>
                            <span style="width: 20px">-</span>
                            <el-date-picker
                                v-model="THDBEnd"
                                :type="timeDes"
                                :value-format="timeDes=='month'?'yyyy年MM月':'yyyy年'"
                                style="width: 40%"
                                :placeholder="timeDes=='month'?'请选择月':'请选择年'">
                            </el-date-picker>
                        </div>
                        <div v-if="timeDes=='quarter'">
                            <el-quarter-picker v-model="THDBBegin" style="width: 45%" placeholder="选择季度"/>
                            <span style="width: 20px">-</span>
                            <el-quarter-picker v-model="THDBEnd" style="width: 45%" placeholder="选择季度"/>
                        </div>
                    </el-form-item>
                    <el-form-item>
                        <el-button class="btn" size="small" type="primary" @click="getData()"
                        >汇总
                        </el-button>
                        <el-button v-if="!THDB" class="btn" size="small" type="primary" @click="THDB=true"
                        >同比环比
                        </el-button>
                    </el-form-item>
                </div>
            </el-form>
        </div>
        <div class="whole_bottom" style="position: relative;z-index: 1">
            <div id="heigcharts" style="width: 100%;height: 550px;"></div>
            <!--<div v-if="chartType == 'line'" id="line" style="width: 100%;height: 550px;"></div>-->
            <!--<div v-if="chartType == 'column'" id="column" style="width: 100%;height: 550px;"></div>-->
            <div v-if="chartType == 'column'" class="legend">
                <div class="legend-body">
                    <div v-for="(item,index) in this.columnChartData.xList" class="legend-item">
                        <div :class="'legendItemBack'+index"></div>
                        {{ item }}
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import {echarts} from "../../global";
import {chart_analysis,chart_compare} from "@/api/sgyhpczl/chartAnalysis";
import {
    initJCBM,
    initYHLX,
    initBC,
    initJCLB,
    initYHBM,
    initYHJB,
    initLlr,
    initReformStatus
} from "@/api/sgyhpczl/initSelect";
// 导入chart组件
import Highcharts from "highcharts/highstock";
import loadExporting from "highcharts/modules/exporting";
import exportExcel from "highcharts/modules/export-data.src";
import highcharts3d from 'highcharts/highcharts-3d'
import ElQuarterPicker from "../common/jdSelect";
loadExporting(Highcharts);
exportExcel(Highcharts);
highcharts3d(Highcharts)
export default {
    name: "index",
    components: {ElQuarterPicker},
    data() {
        return {
            value: '',
            form: {
                name: '众泰煤焦化',
                time: '',
                category: '生产',
                level: '一般隐患D',
                superiorUnit: '新疆能源',
                inspectionCategory: '日常检查',
                policeSituation: '轻警',
                chart: null,
            },
            formData: {
                "echart_type": "line", //line:折线图;column:柱状图;pie :饼状图
                "model": "0", //0:
                "beginTime": "", //开始时间
                "endTime": "", //结束时间
                "ht_typesub": [], //隐患类别
                "level": [], //隐患级别
                "superior": [], //上级单位
                "checktype": [], //检查类别
                "curWarningLevel": [] //警情
            },
            categoryList: ['生产'],
            levelList: ['一般隐患D'],
            superiorUnitList: ['新疆能源'],
            inspectionCategoryList: ['日常检查'],
            policeSituationList: ['轻警'],
            radio: 1,
            chartType: "line",
            columnChartData: {},
            lineChartData: {},
            time: [],
            pieChartData: [],
            JCBMList: [],
            YHLXList: [],
            BCList: [],
            JCLBList: [],
            YHBMList: [],
            YHJBList: [],
            THDB: false,
            THDBBegin: "",
            THDBEnd: "",
            timeDes: "month",
            YHZTList: [],
            columnXData: []
        }
    },
    mounted() {
        this.time.push(this.getCurrentMonthFirst(), this.getCurrentMonthLast());
        this.initYHLX()
        this.initYHJB()
        this.initBC()
        this.initJCLB()
        this.initLlr()
        this.initYHBM()
        this.initYHZT()
        this.changeJCDW(1)
        this.getData()
        this.initTHDBTime()
    },
    watch: {
        "chartType": function (newVal, oldVal) {
            this.formData.echart_type = newVal;
            this.getData();
        },
        "formData.model": function (newVal, oldVal) {
            this.formData.model = newVal;
            this.getData();
        },
        // "timeDes": function (newVal, oldVal) {
        //     this.initTHDBTime();
        // }
    },
    methods: {
        initTHDBTime() {
            var dayStr = this.getCurrentMonthFirst();
            if (this.timeDes == "month") {
                this.THDBBegin = dayStr.split("-")[0] + "年" + (parseInt(dayStr.split("-")[1]) - 1) + "月";
                this.THDBEnd = dayStr.split("-")[0] + "年" + (dayStr.split("-")[1]) + "月";
            } else if (this.timeDes == "year") {
                this.THDBBegin = (parseInt(dayStr.split("-")[0]) - 1) + "年";
                this.THDBEnd = dayStr.split("-")[0] + "年";
            } else {
                this.THDBBegin = dayStr.split("-")[0] + "年第1季度";
                this.THDBEnd = dayStr.split("-")[0] + "年第2季度";
            }
        },
        initYHLX() {
            initYHLX().then(res => {
                if (res.data.ok == 1) {
                    this.YHLXList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        initYHJB() {
            initYHJB().then(res => {
                if (res.data.ok == 1) {
                    this.YHJBList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        initYHZT() {
            initReformStatus().then(res => {
                if (res.data.ok == 1) {
                    this.YHZTList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        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})
                }
            })
        },
        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})
                }
            })
        },
        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})
                }
            })
        },
        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})
                }
            })
        },
        // 饼图
        initEacharts3() {
            var option = {
                chart: {
                    type: 'pie',
                    options3d: {
                        enabled: true,
                        alpha: 45,
                        beta: 0
                    }
                },
                tooltip: {
                    pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
                },
                plotOptions: {
                    pie: {
                        allowPointSelect: true,
                        cursor: 'pointer',
                        depth: 35,
                        dataLabels: {
                            enabled: true,
                            format: '{point.name}:' + ' {point.y}%'
                        }
                    }
                },
                exporting: {
                    enabled: false //去掉右上角
                },
                credits: {
                    enabled: false //不显示LOGO
                },
                series: [{
                    type: 'pie',
                    name: '浏览器占比',
                    data: this.pieChartData
                }]
            }
            Highcharts.chart("heigcharts", option);
        },
        getData() {
            this.formData.beginTime = this.time[0]
            this.formData.endTime = this.time[1]
            if(this.THDB) {
                this.formData.beginTime = this.THDBBegin
                this.formData.endTime = this.THDBEnd
                this.formData.compare_type = this.timeDes;
            }
            let requestData = JSON.parse(JSON.stringify(this.formData));
            requestData.ht_typesub = requestData.ht_typesub.join(",")
            requestData.level = requestData.level.join(",")
            requestData.superior = requestData.superior.join(",")
            requestData.checktype = requestData.checktype.join(",")
            requestData.curWarningLevel = requestData.curWarningLevel.join(",")
            if(this.THDB){
                chart_compare(requestData).then(res=>{
                    let data = res.data;
                    if (data.ok) {
                        this.lineChartData = {}
                        let dataList = [];
                        let timeList = [];
                        if (data.data != null && data.data.length > 0) {
                            data.data[0].forEach(n => {
                                if (timeList.indexOf(n.graph) == -1) {
                                    timeList.push(n.graph)
                                }
                                let obj = dataList.find(v => v.name == n.xAxes);
                                if (obj == null) {
                                    // obj.data.push(n.counts);
                                    obj = {
                                        name: n.xAxes,
                                        data: [],
                                        // type: 'line',
                                        // areaStyle: {}
                                    }
                                    dataList.push(obj)
                                }
                            })
                            timeList.forEach(time => {
                                let singileData = data.data[0].filter(n => n.graph == time)
                                dataList.forEach(n => {
                                    let searchData = singileData.find(v => v.xAxes == n.name);
                                    if (searchData != null) {
                                        n.data.push(parseInt(searchData.yAxes))
                                    } else {
                                        n.data.push(0)
                                    }
                                })
                            })
                        }
                        this.lineChartData.timeList = timeList;
                        this.lineChartData.dataList = dataList;
                        this.initLineChart()
                    }
                })
                return;
            }
            chart_analysis(requestData).then(res => {
                let data = res.data;
                if (data.ok) {
                    if (this.formData.echart_type == "column") {
                        this.columnChartData = {};
                        let xList = [];
                        let dataList = [];
                        if (data.data != null && data.data.length > 0) {
                            data.data[0].forEach(n => {
                                xList.push(n.graph);
                                let singleData = {
                                    "name": n.graph,
                                    // "type": 'bar',
                                    // "label": "labelOption",
                                    // "emphasis": {
                                    //     focus: 'series'
                                    // },
                                    "data": [parseInt(n.yAxes)]
                                }
                                dataList.push(parseInt(n.yAxes));
                            })
                        }
                        this.columnChartData.xList = xList;
                        this.columnChartData.dataList = []
                        this.columnChartData.dataList.push(
                            {
                                data: dataList,
                                colorByPoint: true
                            }
                        );
                        this.initCloumnChart()
                    } else if (this.formData.echart_type == "line") {
                        this.lineChartData = {}
                        let dataList = [];
                        let timeList = [];
                        if (data.data != null && data.data.length > 0) {
                            data.data[0].forEach(n => {
                                if (timeList.indexOf(n.days) == -1) {
                                    timeList.push(n.days)
                                }
                                let obj = dataList.find(v => v.name == n.catalogy);
                                if (obj == null) {
                                    // obj.data.push(n.counts);
                                    obj = {
                                        name: n.catalogy,
                                        data: [],
                                        // type: 'line',
                                        // areaStyle: {}
                                    }
                                    dataList.push(obj)
                                }
                            })
                            timeList.forEach(time => {
                                let singileData = data.data[0].filter(n => n.days == time)
                                dataList.forEach(n => {
                                    let searchData = singileData.find(v => v.catalogy == n.name);
                                    if (searchData != null) {
                                        n.data.push(parseInt(searchData.counts))
                                    } else {
                                        n.data.push(0)
                                    }
                                })
                            })
                        }
                        this.lineChartData.timeList = timeList;
                        this.lineChartData.dataList = dataList;
                        this.initLineChart()
                    } else {
                        this.pieChartData = []
                        data.data[0].forEach(n => {
                            var datas = {
                                name: n.chartName,
                                y: parseInt(n.chartValue),
                                sliced: true,
                                selected: false
                            };
                            this.pieChartData.push(datas);
                        })
                        this.initEacharts3();
                    }
                }
            })
        },
        initChart() {
            // 柱形图
            var chartDom = document.getElementById('column');
            // var chartDom = document.getElementById('myChart');
            var myChart = echarts.init(chartDom);
            var option = {
                title: {
                    text: '众泰煤焦化各隐患单位隐患走势分析',
                    left: 'center'
                },
                legend: {
                    bottom: 0,
                    // textStyle: {
                    //     color: '#ffffff'
                    // },
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '5%',
                    containLabel: true
                },
                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: this.lineChartData.timeList
                },
                yAxis: {
                    type: 'value'
                },
                color: ['#9a0202', '#02cccc', '#0202ff', '#ff9a02', '#02ff02', '#CC02CCFF', '#35FF02FF', '#CCFF67FF', '#35CC67FF', '#9A0202FF'],
                series: this.lineChartData.dataList
            }
            // 使用刚指定的配置项和数据显示图表。
            myChart.setOption(option)
        },
        initLineChart() {
            // 折线图
            var chartDom = document.getElementById('line');
            // var chartDom = document.getElementById('myChart');
            // var myChart = echarts.init(chartDom);
            // var option = {
            //     title: {
            //         text: '众泰煤焦化各隐患单位隐患走势分析',
            //         left: 'center'
            //     },
            //     legend: {
            //         bottom: 0,
            //         // textStyle: {
            //         //     color: '#ffffff'
            //         // },
            //     },
            //     grid: {
            //         left: '3%',
            //         right: '4%',
            //         bottom: '5%',
            //         containLabel: true
            //     },
            //     xAxis: {
            //         type: 'category',
            //         boundaryGap: false,
            //         data: this.lineChartData.timeList
            //         // data: ['2022-05-01', '', '2022-05-03', '', '2022-05-05', '', '2022-05-07', '', '2022-05-09', '', '2022-05-11']
            //     },
            //     yAxis: {
            //         type: 'value'
            //     },
            //     color: ['#9a0202', '#02cccc', '#0202ff', '#ff9a02', '#02ff02', '#CC02CCFF', '#35FF02FF', '#CCFF67FF', '#35CC67FF', '#9A0202FF'],
            //     series: this.lineChartData.dataList
            //     // series: [
            //     //     {
            //     //         name: '电仪车间',
            //     //         data: [50, 35, 63, 64, 79, 95, 104, 50, 35, 63, 64],
            //     //         type: 'line',
            //     //         areaStyle: {}
            //     //     }
            //     // ]
            // }
            // // 使用刚指定的配置项和数据显示图表。
            // myChart.setOption(option)
            var option = {
                chart: {
                    type: 'area'
                },
                title: {
                    text: '众泰煤焦化各隐患单位隐患走势分析'
                },
                yAxis: {
                    title: {
                        enabled: false
                    }
                },
                colors: ['#9a0202', '#02cccc', '#0202ff', '#ff9a02', '#02ff02', '#CC02CCFF', '#35FF02FF', '#CCFF67FF', '#35CC67FF', '#9A0202FF'],
                legend: {
                    align: "center", //程度标的目标地位
                    verticalAlign: "bottom",//垂直标的目标地位
                    x: 0, //间隔x轴的间隔
                    y: 0 //间隔Y轴的间隔
                },
                xAxis: {
                    // type: 'category',
                    // boundaryGap: false,
                    categories: this.lineChartData.timeList,
                    // data: ['2022-05-01', '', '2022-05-03', '', '2022-05-05', '', '2022-05-07', '', '2022-05-09', '', '2022-05-11']
                },
                series: this.lineChartData.dataList,
                exporting: {
                    enabled: false //去掉右上角
                },
                credits: {
                    enabled: false //不显示LOGO
                },
            }
            Highcharts.chart("heigcharts", option);
        },
        initCloumnChart() {
            var option = {
                chart: {
                    type: 'column',
                    marginBottom: 70
                },
                title: {
                    text: null
                },
                yAxis: {
                    title: {
                        enabled: false
                    }
                },
                tooltip: {
                    formatter: function () {
                        return this.x + " : " + this.y
                    }
                },
                colors: ['#ff6600', '#fcd202', '#b0de09', '#0289cc', '#2001cd', '#cd0d74', '#cc0000', '#00cc00', '#0000cc', '#dddddd', '#999999', '#333333', '#990000', '#92e3d4', '#f09aea'],
                legend: {
                    enabled: false,
                },
                xAxis: {
                    // type: 'category',
                    // boundaryGap: false,
                    categories: this.columnChartData.xList,
                    max: this.columnChartData.xList.length - 1
                    // data: ['2022-05-01', '', '2022-05-03', '', '2022-05-05', '', '2022-05-07', '', '2022-05-09', '', '2022-05-11']
                },
                series: this.columnChartData.dataList,
                exporting: {
                    enabled: false //去掉右上角
                },
                credits: {
                    enabled: false //不显示LOGO
                },
            }
            Highcharts.chart("heigcharts", option);
        },
        getCurrentMonthFirst() {
            var date = new Date();
            date.setDate(1);
            var month = parseInt(date.getMonth() + 1);
            var day = date.getDate();
            if (month < 10) {
                month = '0' + month
            }
            if (day < 10) {
                day = '0' + day
            }
            return date.getFullYear() + '-' + month + '-' + day;
        },
        getCurrentMonthLast() {
            var date = new Date();
            var currentMonth = date.getMonth();
            var nextMonth = ++currentMonth;
            var nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1);
            var oneDay = 1000 * 60 * 60 * 24;
            var lastTime = new Date(nextMonthFirstDay - oneDay);
            var month = parseInt(lastTime.getMonth() + 1);
            var day = lastTime.getDate();
            if (month < 10) {
                month = '0' + month
            }
            if (day < 10) {
                day = '0' + day
            }
            return date.getFullYear() + '-' + month + '-' + day;
        },
    },
}
</script>
<style scoped>
.legend {
    position: absolute;
    bottom: 10px;
    z-index: 2;
    width: 100%;
}
.legend-body {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 12px;
    height: 100%;
}
.legend-item {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-left: 20px;
    line-height: 1.5;
}
.legend-item div {
    width: 20px;
    height: 15px;
    margin-right: 10px;
}
.legendItemBack0 {
    background-color: #ff6600;
}
.legendItemBack1 {
    background-color: #fcd202;
}
.legendItemBack2 {
    background-color: #b0de09;
}
.legendItemBack3 {
    background-color: #0289cc;
}
.legendItemBack4 {
    background-color: #2001cd;
}
.legendItemBack5 {
    background-color: #cd0d74;
}
.legendItemBack6 {
    background-color: #cc0000;
}
.legendItemBack7 {
    background-color: #00cc00;
}
.legendItemBack8 {
    background-color: #0000cc;
}
.legendItemBack9 {
    background-color: #dddddd;
}
.legendItemBack10 {
    background-color: #999999;
}
.legendItemBack11 {
    background-color: #333333;
}
.legendItemBack12 {
    background-color: #990000;
}
.legendItemBack13 {
    background-color: #92e3d4;
}
.legendItemBack14 {
    background-color: #f09aea;
}
.top {
    padding: 10px 5px;
    background: #e4edf4;
    display: flex;
    flex-direction: column;
}
.top /deep/ .el-form-item__label {
    width: 110px;
}
.top /deep/ .el-form-item {
    margin-bottom: 5px;
}
/*多选框间距*/
.checkbox /deep/ .el-checkbox-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
}
.center {
    text-align: center;
    padding: 10px;
    background: #ffffff;
    margin: 10px 0;
}
.center /deep/ .el-form-item__label {
    width: auto;
    padding-right: 0;
}
.checkbox {
    display: flex;
}
/deep/ .el-checkbox {
    margin-right: 7px;
}
.checkbox /deep/ .el-checkbox {
    margin-right: 0px;
}
/deep/ .el-checkbox__label {
    padding-left: 3px;
}
.checkbox /deep/ .el-checkbox__label {
    padding-left: 3px;
}
/deep/ .el-radio {
    margin-right: 7px;
}
.center {
    display: flex;
    align-items: center;
    justify-content: start;
}
.center /deep/ .el-form-item--medium {
    margin-bottom: 0px;
    display: flex;
}
.center /deep/ .el-input__inner {
    border: transparent;
    width: 85px;
    padding: 0 5px;
}
.center .time /deep/ .el-form-item__content {
    width: 70%;
}
.center .time /deep/ .el-input__inner {
    width: 218px;
}
.center .time /deep/ .el-range-input {
    width: 90px;
    border: 1px solid #DCDFE6;
    border-radius: 4px;
    padding: 0 5px;
}
/deep/ .el-icon-date {
    display: none;
}
/*日期*/
/deep/ .el-date-editor .el-range-separator {
    width: auto;
    line-height: 36px;
}
.btn {
    background-color: #034ea2;
    border: 1px solid #034ea2;
}
>>> .center .time[data-v-21f55eb3] .el-input__inner {
    width: 100px;
}
</style>
src/views/common/jdSelect.vue
对比新文件
@@ -0,0 +1,394 @@
<template>
    <div class="el-quarter-picker">
        <el-popover
            v-model="visible"
            :disabled="!canPopover"
            :tabindex="null"
            placement="bottom-start"
            transition="el-zoom-in-top"
            trigger="click">
            <div class="el-date-picker">
                <div class="el-picker-panel__body">
                    <div class="el-date-picker__header el-date-picker__header--bordered" style="margin:0px; line-height:30px">
                        <button
                            type="button"
                            @click="clickLast"
                            aria-label="前一年"
                            class="el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-d-arrow-left"></button>
                        <span role="button" class="el-date-picker__header-label" @click="clickYear">{{ title }}</span>
                        <button
                            type="button"
                            @click="clickNext"
                            aria-label="后一年"
                            class="el-picker-panel__icon-btn el-date-picker__next-btn el-icon-d-arrow-right"></button>
                    </div>
                    <div class="el-picker-panel__content" style="margin:0px; width:100%">
                        <table class="el-month-table" style="">
                            <tbody>
                            <tr v-for="line in lineCount" :key="line">
                                <td v-for="index in (line * 4 <= viewList.length ? 4 : viewList.length - (line - 1) * 4)" :key="index" :class="{ today: viewList[(line - 1) * 4 + index - 1].current, current: viewList[(line - 1) * 4 + index - 1].active }">
                                    <div><a class="cell" @click="clickItem(viewList[(line - 1) * 4 + index - 1])">{{ viewList[(line - 1) * 4 + index - 1].label }}</a></div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <el-input
                slot="reference"
                @change="changeText"
                @mouseenter.native="mouseEnter"
                @mouseleave.native="mouseLeave"
                :placeholder="placeholder"
                v-model="text"
                :size="size"
                :readonly="!canEdit"
                :disabled="disabled">
                <i slot="prefix" class="el-input__icon el-icon-date"></i>
                <i slot="suffix" class="el-input__icon el-icon-circle-close" v-show="showClear" style="cursor:pointer" @click.stop="clear"></i>
            </el-input>
        </el-popover>
    </div>
</template>
<script>
export default {
    name: 'ElQuarterPicker',
    props: {
        placeholder: {
            type: String,
            default: ''
        },
        size: {
            type: String,
            default: ''
        },
        readonly: {
            type: Boolean,
            default: false
        },
        clearable: {
            type: Boolean,
            default: true
        },
        editable: {
            type: Boolean,
            default: true
        },
        disabled: {
            type: Boolean,
            default: false
        },
        format: {
            type: String,
            default: 'yyyy年第Q季度'
        },
        valueFormat: {
            type: String,
            default: 'yyyy年第q季度'
        },
        value: {
            type: String,
            default: ''
        }
    },
    model: {
        prop: 'value',
        event: 'change'
    },
    watch: {
        value(val) {
            // console.log('change-------', val)
            this.changeValue(val)
        },
        readonly(val) {
            this.canEdit = !val && this.editable
            this.canPopover = !this.disabled && !val
        },
        editable(val) {
            this.canEdit = !this.readonly && val
        },
        disabled(val) {
            this.canPopover = !val && !this.readonly
        }
    },
    data() {
        return {
            visible: false,
            showClear: false, // 控制清空按钮展示
            canEdit: true, // 是否可编辑
            canPopover: true, // 选择器弹出是否可用
            text: '', // 文本框值
            viewType: 1, // 视图类型,1季度,2年度
            viewYear: 0, // 当前年份
            viewList: [], // 数据列表
            lineCount: 0, // 数据行数
            title: '', // 选择器标题
            data: [0, 0] // 当前选择年度-季度
        }
    },
    mounted() {
        // console.log('mounted--------', this.value)
        this.changeValue(this.value)
        // 设置文本框是否可编辑
        this.canEdit = !this.readonly && this.editable
        this.canPopover = !this.disabled && !this.readonly
        // 监听按键(上下左右键可以切换季度)
        document.onkeydown = (event) => {
            if (this.visible) {
                const data = [this.data[0], this.data[1]]
                if (data[0] < 1 || data[1] < 1) {
                    // 以当前季度为标准
                    const curDate = new Date()
                    data[0] = curDate.getFullYear()
                    data[1] = parseInt(curDate.getMonth() / 3) + 1
                }
                if (event.code === 'ArrowLeft') {
                    // 上一个季度
                    if (data[1] === 1) {
                        data[0] = data[0] - 1
                        data[1] = 4
                    } else {
                        data[1] = data[1] - 1
                    }
                } else if (event.code === 'ArrowRight') {
                    // 下一个季度
                    if (data[1] === 4) {
                        data[0] = data[0] + 1
                        data[1] = 1
                    } else {
                        data[1] = data[1] + 1
                    }
                } else if (event.code === 'ArrowUp') {
                    // 上一年季度
                    data[0] = data[0] - 1
                } else if (event.code === 'ArrowDown') {
                    // 下一年季度
                    data[0] = data[0] + 1
                } else {
                    return
                }
                // 超过年限的不处理
                if (data[0] < 1000 || data[0] > 9999) {
                    return
                }
                this.data = data
                this.viewType = 1
                this.viewYear = data[0]
                this.$emit('change', this.formatTo(data, this.valueFormat))
            }
        }
    },
    destroyed() {
        document.onkeydown = null
    },
    methods: {
        // 季度文本变更
        changeText() {
            if (this.checkFormat(this.format, this.text)) {
                // 设置值
                this.formatFrom(this.text, this.format)
                this.$emit('change', this.formatTo(this.data, this.valueFormat))
            } else {
                // 输入了无效的格式,还原回原来的值
                if (this.data[0] < 1 || this.data[1] < 1) {
                    this.text = ''
                } else {
                    this.text = this.formatTo(this.data, this.format)
                }
            }
            this.visible = false
        },
        // 鼠标进入
        mouseEnter() {
            if (!this.disabled && !this.readonly && this.clearable && this.text !== '') {
                this.showClear = true
            }
        },
        // 鼠标离开
        mouseLeave() {
            if (!this.disabled && this.clearable) {
                this.showClear = false
            }
        },
        // 清除季度
        clear() {
            this.showClear = false
            this.visible = false
            this.$emit('change', '')
        },
        // 季度值变更
        changeValue(val) {
            this.viewType = 1
            if (val) {
                // 反向格式化
                this.formatFrom(val, this.valueFormat)
                this.text = this.formatTo(this.data, this.format)
                this.viewYear = this.data[0]
            } else {
                this.text = ''
                this.data = [0, 0]
                this.viewYear = new Date().getFullYear()
            }
            this.initView()
        },
        // 初始化视图数据
        initView() {
            const list = []
            const curDate = new Date()
            const curYear = curDate.getFullYear()
            const curQuarter = parseInt(curDate.getMonth() / 3) + 1
            if (this.viewType === 1) {
                let index = 0
                for (const i of '一二三四') {
                    index++
                    const item = { label: '第' + i + '季度', year: this.viewYear, quarter: index, current: false, active: false }
                    if (this.viewYear === curYear && index === curQuarter) {
                        item.current = true
                    } else if (this.viewYear === this.data[0] && index === this.data[1]) {
                        item.active = true
                    }
                    list.push(item)
                }
                this.title = this.viewYear + ' 年'
            } else {
                const start = parseInt(this.viewYear / 10) * 10
                this.viewYear = start
                for (let i = 0; i < 10; i++) {
                    const year = start + i
                    const item = { label: year + '', year: year, current: false, active: false }
                    if (year === curYear) {
                        item.current = true
                    } else if (year === this.data[0]) {
                        item.active = true
                    }
                    list.push(item)
                }
                this.title = start + ' 年 - ' + (start + 9) + ' 年'
            }
            this.viewList = list
            this.lineCount = parseInt(list.length / 4)
            if (list.length % 4 > 0) {
                this.lineCount++
            }
        },
        // 校验季度格式是否正确
        checkFormat(pattern, val) {
            // 格式转成正则表达式
            let text = ''
            for (const char of pattern) {
                const dict = '\\^$.+?*[]{}!'
                if (dict.indexOf(char) === -1) {
                    text += char
                } else {
                    text += '\\' + char
                }
            }
            text = text.replace('yyyy', '[1-9]\\d{3}')
            text = text.replace('qq', '0[1-4]')
            text = text.replace('q', '[1-4]')
            text = text.replace('Q', '[一二三四]')
            text = '^' + text + '$'
            const patt = new RegExp(text)
            return patt.test(val)
        },
        // 格式化季度到指定格式
        formatTo(data, pattern) {
            let text = pattern.replace('yyyy', '' + data[0])
            text = text.replace('qq', '0' + data[1])
            text = text.replace('q', '' + data[1])
            text = text.replace('Q', '一二三四'.substr(data[1] - 1, 1))
            return text
        },
        // 以指定格式解析季度
        formatFrom(str, pattern) {
            const year = this.findText(str, pattern, 'yyyy')
            const quarter = this.findText(str, pattern, ['qq', 'q', 'Q'])
            this.data = [year, quarter]
        },
        // 查找文本数值
        findText(str, pattern, find) {
            if (find instanceof Array) {
                for (const f of find) {
                    const val = this.findText(str, pattern, f)
                    if (val !== -1) {
                        return val
                    }
                }
                return -1
            }
            const index = pattern.indexOf(find)
            if (index === -1) {
                return index
            }
            const val = str.substr(index, find.length)
            if (find === 'Q') {
                return '一二三四'.indexOf(val) + 1
            } else {
                return parseInt(val)
            }
        },
        // 年份点击
        clickYear() {
            if (this.viewType !== 1) {
                return
            }
            // 切换年度选择器
            this.viewType = 2
            this.initView()
        },
        // 季度选择
        clickItem(item) {
            // console.log('select--------', item)
            if (this.viewType === 1) {
                // 选择季度
                this.$emit('change', this.formatTo([item.year, item.quarter], this.valueFormat))
                this.visible = false
            } else {
                // 选择年度
                this.viewType = 1
                this.viewYear = item.year
                this.initView()
            }
        },
        // 上一年
        clickLast() {
            if (this.viewYear > 1000) {
                if (this.viewType === 1) {
                    this.viewYear--
                    this.initView()
                } else {
                    this.viewYear = this.viewYear - 10
                    this.initView()
                }
            }
        },
        // 下一年
        clickNext() {
            if (this.viewYear < 9999) {
                if (this.viewType === 1) {
                    this.viewYear++
                    this.initView()
                } else {
                    this.viewYear = this.viewYear + 10
                    this.initView()
                }
            }
        }
    }
}
</script>
<style>
.el-quarter-picker {
    width: 220px;
    display: inline-block;
}
</style>
src/views/dangerDetails/dnagerDetails.vue
@@ -260,6 +260,59 @@
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="流程信息" prop="name">
                                <!--                                <el-input v-model="ruleForm.name" class="multiline" :disabled="true"></el-input>-->
                                <el-table
                                    :data="tableData"
                                    border
                                    style="width: 100%">
                                    <el-table-column
                                        prop="date"
                                        label="步骤"
                                        type="index"
                                        align="center"
                                        >
                                    </el-table-column>
                                    <el-table-column
                                        prop="realname"
                                        label="操作人"
                                        align="center"
                                        >
                                    </el-table-column>
                                    <el-table-column
                                        prop="create_time"
                                        label="处理时间"
                                        align="center"
                                        >
                                    </el-table-column>
                                    <el-table-column
                                        prop="city"
                                        label="审批意见"
                                        align="center"
                                        >
                                        <template slot-scope="scope">
                                            <span size="medium">{{ scope.row.content }}</span>
                                            <span v-for="item in scope.row.realFileName">
                                                <el-link  type="primary" @click="downloadFile(subFile(item))">
                                                    {{subFile(item)}}
                                                </el-link>
                                            </span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
                                        prop="ispass"
                                        label="流程信息"
                                        align="center"
                                        width="170">
                                    </el-table-column>
                                </el-table>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
@@ -279,6 +332,8 @@
<script>
    import Titlename from "../../components/Titlename/index.vue";
    import {sendDangerNext, getDangerDetails, getWfRecordList} from "@/api/sgyhpczl/recheckCancellationNumber";
    import {downloadFile} from "@/api/sgyhpczl/fileUtils";
    import {self_info} from "../../api/sgyhpczl/hiddenDangerManagement";
    export default {
        components: {Titlename},
@@ -328,18 +383,34 @@
        },
        methods: {
            getDangerDetails() {
                getDangerDetails(this.$route.query.id).then(res => {
                    var data = res.data;
                    if (data.ok) {
                        this.ruleForm = data.data;
                        this.ruleForm.url = process.env.BASE_API;
                        this.ruleForm.callback_branch= data.data.check_main_branch
                        //this.ruleForm.ispass=0
                        this.sendDataForm.id = this.ruleForm.id
                    } else {
                        this.$message({type: 'error', message: "数据查询失败,请重试!", duration: 3000})
                    }
                })
                if(this.$route.query.route!=null && this.$route.query.route == '/hiddenDangerManagement'){
                    self_info(this.$route.query.id).then(res => {
                        var data = res.data;
                        if (data.ok) {
                            this.ruleForm = data.data;
                            this.ruleForm.url = process.env.BASE_API;
                            this.ruleForm.callback_branch= data.data.check_main_branch
                            //this.ruleForm.ispass=0
                            this.sendDataForm.id = this.ruleForm.id
                        } else {
                            this.$message({type: 'error', message: "数据查询失败,请重试!", duration: 3000})
                        }
                    })
                }else{
                    getDangerDetails(this.$route.query.id).then(res => {
                        var data = res.data;
                        if (data.ok) {
                            this.ruleForm = data.data;
                            this.ruleForm.url = process.env.BASE_API;
                            this.ruleForm.callback_branch= data.data.check_main_branch
                            //this.ruleForm.ispass=0
                            this.sendDataForm.id = this.ruleForm.id
                        } else {
                            this.$message({type: 'error', message: "数据查询失败,请重试!", duration: 3000})
                        }
                    })
                }
            },
            getWfRecordList() {
                getWfRecordList(this.$route.query.id).then(res => {
@@ -404,10 +475,49 @@
                }
            },
            close(){
                this.$router.push({
                    path:"/hiddenDangerRectification"
                })
            }
                if(this.$route.query.route!=null && this.$route.query.route!=''){
                    this.$router.push({
                        path: this.$route.query.route
                    })
                }else{
                    this.$router.push({
                        path:"/hiddenDangerRectification"
                    })
                }
            },
            subFile(fileName){
                return  fileName.substring(fileName.indexOf("fileName=")+9)
            },
            downloadFile(path){
                let params = {
                    type: 0,
                    fileName: path,
                };
                downloadFile(params).then((res) => {
                    if(res.data.type=='text/json'){
                        const reader  = new FileReader();
                        reader.readAsText(res.data, 'utf-8');
                        reader.onload = e => {
                            this.$message({
                                type: "error",
                                message: JSON.parse(reader.result).msg,
                                duration: 3000,
                            });
                        }
                    } else {
                        let blob = new Blob([res.data], {type: 'application/octet-stream'})
                        console.log(blob)
                        let blobUrl = window.URL.createObjectURL(blob)
                        let downloadElement = document.createElement('a')
                        downloadElement.href = blobUrl
                        downloadElement.download = path
                        document.body.appendChild(downloadElement)
                        downloadElement.click()
                        document.body.removeChild(downloadElement)
                        window.URL.revokeObjectURL(blobUrl)
                    }
                });
            },
        }
    }
</script>
src/views/delayHiddenDangerRectification/index.vue
@@ -45,7 +45,7 @@
                        v-for="item in YHBMList"
                        :key="item.branch_id"
                        :label="item.branch_name"
                        :value="item.branch_id">
                        :value="item.branch_name">
                    </el-option>
                </el-select>
            </el-form-item>
@@ -157,7 +157,7 @@
                <el-button class="btns" type="primary" size="small" @click="sendBath()">批量发送</el-button>
            </el-col>
        </el-row>
        <el-table ref="dataTable" :data="tableData" style="width: 100%" @selection-change="handleSelectionChange">
        <el-table ref="dataTable" :data="tableData" style="width: 100%" @selection-change="handleSelectionChange" v-loading="loading">
            <el-table-column type="selection" width="55" align="center"></el-table-column>
            <el-table-column prop="number" label="编号" align="center" width="120">
                <template slot-scope="scope">
@@ -223,7 +223,7 @@
            <el-table-column prop="DTRisk_level" label="风险等级" align="center"></el-table-column>
            <el-table-column prop="warningLevel" label="初始警情" align="center"></el-table-column>
            <el-table-column prop="curWarningLevel" label="当前警情" align="center"></el-table-column>
            <el-table-column prop="date" label="流程操作" align="center">
            <el-table-column prop="date" label="流程操作" align="center" fixed="right">
                <template slot-scope="scope">
                    <el-button @click="handleClick(scope.row)" type="text" size="small">点击发送</el-button>
                </template>
@@ -265,6 +265,7 @@
            YHBMList: [],
            YHJBList: [],
            tableData: [],
            loading:false,
            listQuery: {
                page: 1,
                limit: 10,
@@ -349,7 +350,9 @@
        getPageList() {
            this.listQuery.page = 1
            this.checkTime()
            this.loading = true
            getPageList(this.listQuery).then(res => {
                this.loading = false
                if (res.data.ok == 1) {
                    this.tableData = res.data.data.items
                    this.recordTotal = res.data.data.total
@@ -464,12 +467,14 @@
            })
        },
        exportData() {
            var requestData = this.listQuery;
            this.listLoading = true
            var requestData = JSON.parse(JSON.stringify(this.listQuery));
            requestData.export_type = 4;
            //删除分页参数
            this.$delete(requestData, 'page')
            this.$delete(requestData, 'limit')
            danger_export_do(requestData).then(res => {
                this.listLoading = false
                var blob = new Blob([res.data])
                var downloadElement = document.createElement('a')
                var href = window.URL.createObjectURL(blob) //创建下载的链接
src/views/delayHiddenDangerRectification/rectificationDelayHiddenDanger.vue
@@ -274,32 +274,38 @@
                                    <el-table-column
                                        prop="date"
                                        label="步骤"
                                        type="index"
                                        align="center"
                                        width="60">
                                       >
                                    </el-table-column>
                                    <el-table-column
                                        prop="realname"
                                        label="操作人"
                                        align="center"
                                        width="138">
                                        >
                                    </el-table-column>
                                    <el-table-column
                                        prop="create_time"
                                        label="处理时间"
                                        align="center"
                                        width="200">
                                        >
                                    </el-table-column>
                                    <el-table-column
                                        prop="city"
                                        label="审批意见"
                                        align="center"
                                        width="260">
                                        >
                                        <template slot-scope="scope">
                                            <span size="medium">{{ scope.row.content }}</span>
                                            <a v-for="item in scope.row.realFileName"
                                               :href="scope.row.url+'/'+item">
                                                {{ item.split("fileName=")[1] }}
                                            </a>
                                            <span v-for="item in scope.row.realFileName">
                                                <el-link  type="primary" @click="downloadFile(subFile(item))">
                                                    {{subFile(item)}}
                                                </el-link>
                                            </span>
<!--                                            <a v-for="item in scope.row.realFileName"-->
<!--                                               :href="scope.row.url+'/'+item">-->
<!--                                                {{ item.split("fileName=")[1] }}-->
<!--                                            </a>-->
                                        </template>
                                    </el-table-column>
                                    <el-table-column
@@ -315,7 +321,7 @@
                </el-form>
                <el-form :model="sendData" :rules="rules" ref="sendData" label-width="150px" class="demo-ruleForm"
                         style="margin: 0 14% 0 16%;">
                    >
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="发送流程" prop="name">
@@ -396,6 +402,7 @@
<script>
import Titlename from "../../components/Titlename/index.vue";
import {sendDangerNext, getDangerDetails, getWfRecordList} from "@/api/sgyhpczl/recheckCancellationNumber";
import {downloadFile} from "@/api/sgyhpczl/fileUtils";
export default {
    components: {Titlename},
@@ -516,7 +523,40 @@
            this.$router.push({
                path: "/delayHiddenDangerRectification"
            })
        }
        },
        subFile(fileName){
            return  fileName.substring(fileName.indexOf("fileName=")+9)
        },
        downloadFile(path){
            let params = {
                type: 0,
                fileName: path,
            };
            downloadFile(params).then((res) => {
                if(res.data.type=='text/json'){
                    const reader  = new FileReader();
                    reader.readAsText(res.data, 'utf-8');
                    reader.onload = e => {
                        this.$message({
                            type: "error",
                            message: JSON.parse(reader.result).msg,
                            duration: 3000,
                        });
                    }
                } else {
                    let blob = new Blob([res.data], {type: 'application/octet-stream'})
                    console.log(blob)
                    let blobUrl = window.URL.createObjectURL(blob)
                    let downloadElement = document.createElement('a')
                    downloadElement.href = blobUrl
                    downloadElement.download = path
                    document.body.appendChild(downloadElement)
                    downloadElement.click()
                    document.body.removeChild(downloadElement)
                    window.URL.revokeObjectURL(blobUrl)
                }
            });
        },
    }
}
</script>
src/views/hiddenDangerManagement/fillRectificationAdd.vue
@@ -298,6 +298,7 @@
            dangerList: [],
            dangerForm: {},
            dangerRules: {
                measure:[{required: true, message: '不能为空', trigger: 'blur'},],
                ht_branch: [{required: true, message: '不能为空', trigger: 'blur'},],
                address: [{required: true, message: '不能为空', trigger: 'blur'},],
                ht_content: [{required: true, message: '不能为空', trigger: 'blur'},],
src/views/hiddenDangerManagement/index.vue
@@ -181,7 +181,7 @@
            </el-col>
        </el-row>
        <el-table :data="tableData" ref="dataTable" style="width: 100%">
        <el-table :data="tableData" ref="dataTable" style="width: 100%" v-loading="loading">
            <el-table-column type="selection" width="55" align="center"></el-table-column>
            <el-table-column prop="number" label="编号" align="center" width="120">
                <template slot-scope="scope">
@@ -251,7 +251,7 @@
            <el-table-column label="初始警情" align="center" prop="warningLevel"></el-table-column>
            <el-table-column label="当前警情" align="center" prop="curWarningLevel"></el-table-column>
            <!-- <el-table-column label="流程操作" align="center"> </el-table-column> -->
            <el-table-column label="基本操作" align="center">
            <el-table-column label="基本操作" align="center" fixed="right">
                <template slot-scope="scope">
                    <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
                    <el-button type="text" @click="handleDelete(scope.row)" size="small">删除</el-button>
@@ -304,6 +304,7 @@
            YHBMList: [],
            YHJBList: [],
            tableData: [],
            loading:false,
            listQuery: {
                page: 1,
                limit: 10,
@@ -396,7 +397,9 @@
        getPageList() {
            this.listQuery.page = 1
            this.checkTime()
            this.loading = true
            getPageList(this.listQuery).then(res => {
                this.loading = false
                if (res.data.ok == 1) {
                    this.tableData = res.data.data.items
                    this.recordTotal = res.data.data.total
@@ -499,11 +502,13 @@
            window.open(href, '_blank');
        },
        exportData() {
            var requestData = this.listQuery;
            this.listLoading = true
            var requestData = JSON.parse(JSON.stringify(this.listQuery));
            //删除分页参数
            this.$delete(requestData, 'page')
            this.$delete(requestData, 'limit')
            self_export_do(requestData).then(res => {
                this.listLoading = false
                var blob = new Blob([res.data])
                var downloadElement = document.createElement('a')
                var href = window.URL.createObjectURL(blob) //创建下载的链接
@@ -660,9 +665,10 @@
            })
        },
        showDetails(row){
            //hiddenDangerManagement
            this.$router.push({
                path: "/dangerDetails",
                query:{"id":row.id}
                query: {"id": row.id, "route": "/hiddenDangerManagement"}
            })
        }
    }
src/views/hiddenDangerRectification/index.vue
@@ -45,7 +45,7 @@
                        v-for="item in YHBMList"
                        :key="item.branch_id"
                        :label="item.branch_name"
                        :value="item.branch_id">
                        :value="item.branch_name">
                    </el-option>
                </el-select>
            </el-form-item>
@@ -141,7 +141,8 @@
                <el-button type="primary" class="btns" size="small" icon="el-icon-search" @click="getPageList()">查询
                </el-button>
                <el-button type="primary" class="btns" size="small" @click="reset()">重置</el-button>
                <el-button type="primary" class="btns" size="small" icon="el-icon-upload2" @click="exportData">导出excel</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">
@@ -149,7 +150,7 @@
                <el-button class="btns" type="primary" size="small" @click="applyDelay()">申请延期</el-button>
            </el-col>
        </el-row>
        <el-table :data="tableData" ref="dangerRectificationTable" style="width: 100%">
        <el-table :data="tableData" ref="dangerRectificationTable" style="width: 100%" v-loading="loading">
            <el-table-column type="selection" width="55" align="center"></el-table-column>
            <el-table-column prop="number" label="编号" align="center" width="120">
                <template slot-scope="scope">
@@ -162,11 +163,11 @@
            <el-table-column label="隐患项目" align="center">
                <el-table-column prop="check_date" label="检查时间" width="120" align="center">
                    <template slot-scope="scope">
                        <label>{{ formatDate(scope.row.check_date)}}</label><br/>
                        <label>{{ scope.row.check_class}}</label>
                        <label>{{ formatDate(scope.row.check_date) }}</label><br/>
                        <label>{{ scope.row.check_class }}</label>
                    </template>
                </el-table-column>
                <el-table-column prop="address" label="地点"   align="center"></el-table-column>
                <el-table-column prop="address" label="地点" align="center"></el-table-column>
                <el-table-column prop="ht_content" label="内容" width="150" align="center">
                    <template slot-scope="scope">
                        <el-popover trigger="hover" placement="top">
@@ -195,13 +196,16 @@
                </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" :formatter="formatColumnDate" align="center"></el-table-column>
                <el-table-column prop="alter_time" label="限改时间" width="120" :formatter="formatColumnDate"
                                 align="center"></el-table-column>
            </el-table-column>
            <el-table-column label="整改情况" align="center">
                <el-table-column prop="ACCOMPLISHTIME" label="完成时间" :formatter="formatColumnDate" width="120" align="center"></el-table-column>
                <el-table-column prop="ACCOMPLISHTIME" label="完成时间" :formatter="formatColumnDate" width="120"
                                 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">
@@ -215,7 +219,7 @@
            <el-table-column prop="DTRisk_level" label="风险等级" align="center"></el-table-column>
            <el-table-column prop="warningLevel" label="初始警情" align="center"></el-table-column>
            <el-table-column prop="curWarningLevel" label="当前警情" align="center"></el-table-column>
            <el-table-column prop="date" label="流程操作" align="center">
            <el-table-column prop="date" label="流程操作" align="center" fixed="right">
                <template slot-scope="scope">
                    <el-button @click="handleClick(scope.row)" type="text" size="small">点击发送</el-button>
                </template>
@@ -223,7 +227,7 @@
        </el-table>
        <!--申请延期弹窗-->
        <el-dialog
            title="提示"
            title="申请延期"
            :visible.sync="dialogVisible"
            :close-on-click-modal="false"
            width="30%"
@@ -249,6 +253,7 @@
                        <el-form-item label="附件上传" prop="desc">
                            <el-upload
                                class="upload-demo"
                                action="https://jsonplaceholder.typicode.com/posts/"
                                ref="upload"
                                :http-request="uploadSectionFile"
                                :on-preview="handlePreview"
@@ -258,7 +263,7 @@
                                :auto-upload="true"
                            >
                                <el-button slot="trigger" size="small" type="primary" class="btns">选择文件</el-button>
                                <div slot="tip" class="el-upload__tip">只能上传.jpg,.gif,.bmp,.png,.jpeg格式的图片</div>
                                <div slot="tip" class="el-upload__tip">只能上传.jpg,.gif,.bmp,.png,.doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx,.rar,.zip格式的图片</div>
                            </el-upload>
                        </el-form-item>
                    </el-col>
@@ -293,7 +298,7 @@
    </div>
</template>
<script>
import {getPageList, uploadFile, saveDelayApply,danger_export_do} from "@/api/sgyhpczl/hiddenDangerRectification";
import {getPageList, uploadFile, saveDelayApply, danger_export_do} from "@/api/sgyhpczl/hiddenDangerRectification";
import {initJCBM, initYHLX, initBC, initJCLB, initYHBM, initYHJB, initLlr} from "@/api/sgyhpczl/initSelect";
export default {
@@ -312,6 +317,8 @@
            YHBMList: [],
            YHJBList: [],
            tableData: [],
            fileNameList: [],
            loading: false,
            listQuery: {
                page: 1,
                limit: 10,
@@ -429,7 +436,9 @@
        getPageList() {
            this.listQuery.page = 1
            this.checkTime()
            this.loading = true;
            getPageList(this.listQuery).then(res => {
                this.loading = false;
                if (res.data.ok == 1) {
                    this.tableData = res.data.data.items
                    this.recordTotal = res.data.data.total
@@ -505,7 +514,7 @@
        handleClick(row) {
            this.$router.push({
                path: "/sendHiddenDangerList",
                query:{"id":row.id}
                query: {"id": row.id}
            })
        },
        handleClose(done) {
@@ -517,17 +526,22 @@
                });
        },
        handleRemove(file, fileList) {
            console.log(file, fileList)
            var fileUidList = [];
            fileList.forEach(file => {
                fileUidList.push(file.uid);
            })
            this.fileNameList = this.fileNameList.filter(n => fileUidList.indexOf(n.uid) != -1);
        },
        handlePreview(file) {
            console.log(file)
        },
        beforeUpload(file) {
            var FileExt = file.name.replace(/.+\./, "");
            if (['jpg', 'png', 'bmp', 'gif', 'jpeg'].indexOf(FileExt.toLowerCase()) === -1) {
            //.jpg,.gif,.bmp,.png,.doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx,.rar,.zip
            if (['jpg', 'png', 'bmp', 'gif', 'jpeg','doc','docx','pdf','ppt','xls','pptx','xls','xlsx','rar','zip'].indexOf(FileExt.toLowerCase()) === -1) {
                this.$message({
                    type: 'warning',
                    message: '请上传后缀名为jpg、png、bmp、gif、jpeg的图片!'
                    message: '请上传后缀名为jpg,gif,bmp,png,doc,docx,pdf,ppt,pptx,xls,xlsx,rar,zip的图片!'
                });
                return false;
            }
@@ -549,6 +563,11 @@
        applyDelaySave() {
            this.$refs["ruleForm"].validate((valid) => {
                if (valid) {
                    this.ruleForm.realFileName = "";
                    this.fileNameList.forEach(n => {
                        this.ruleForm.realFileName += n.fileName + ",";
                    })
                    this.ruleForm.realFileName.substring(0, this.ruleForm.realFileName.length - 1);
                    saveDelayApply(this.ruleForm).then(res => {
                        this.dialogVisible = false;
                        this.$message({
@@ -571,21 +590,27 @@
                if (data.ok) {
                    var fileName = data.data.fileName[0];
                    if (!fileName.endsWith("a62b")) {
                        fileName = fileName + param.file.realFileName;
                        fileName = fileName + "a62b";
                    }
                    that.ruleForm.realFileName = that.ruleForm.realFileName + "," + fileName;
                    var fileObj = {
                        "fileName": fileName,
                        "uid": param.file.uid
                    }
                    this.fileNameList.push(fileObj);
                    // that.ruleForm.realFileName = that.ruleForm.realFileName + "," + fileName;
                }
            }).error(res => {
                this.$message({
                    type: 'error',
                    message: '附件上传失败,请重试!'
                });
            })
            //     .error(res => {
            //     this.$message({
            //         type: 'error',
            //         message: '附件上传失败,请重试!'
            //     });
            // })
        },
        //方法区
        formatDate(data) {
            // 获取单元格数据
            if(data == null) {
            if (data == null) {
                return null
            }
            let dt = new Date(data)
@@ -596,19 +621,21 @@
        formatColumnDate(row, column) {
            // 获取单元格数据
            let data = row[column.property]
            if(data == null) {
            if (data == null) {
                return null
            }
            let dt = new Date(data)
            return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + ' '
        },
        exportData(){
            var requestData = this.listQuery;
        exportData() {
            this.listLoading = true
            var requestData = JSON.parse(JSON.stringify(this.listQuery));
            requestData.export_type = 2;
            //删除分页参数
            this.$delete(requestData, 'page')
            this.$delete(requestData, 'limit')
            danger_export_do(requestData).then(res => {
                this.listLoading = false
                var blob = new Blob([res.data])
                var downloadElement = document.createElement('a')
                var href = window.URL.createObjectURL(blob) //创建下载的链接
@@ -622,10 +649,10 @@
                console.log(err)
            })
        },
        showDetails(row){
        showDetails(row) {
            this.$router.push({
                path: "/dangerDetails",
                query:{"id":row.id}
                query: {"id": row.id}
            })
        }
    }
@@ -656,10 +683,12 @@
    max-height: 80px;
    overflow-y: auto
}
.blue-font-color:hover{
.blue-font-color:hover {
    cursor: pointer;
    color: blue;
}
/deep/ .el-dialog .button .el-form-item__content {
    margin-left: 0;
}
src/views/hiddenDangerRectification/sendHiddenDangerList.vue
@@ -292,10 +292,11 @@
                                        width="260">
                                        <template slot-scope="scope">
                                            <span size="medium">{{ scope.row.content }}</span>
                                            <a v-for="item in scope.row.realFileName"
                                               :href="scope.row.url+'/'+item">
                                                {{ item.split("fileName=")[1] }}
                                            </a>
                                            <span v-for="item in scope.row.realFileName">
                                                <el-link  type="primary" @click="downloadFile(subFile(item))">
                                                    {{subFile(item)}}
                                                </el-link>
                                            </span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
@@ -391,6 +392,7 @@
<script>
    import Titlename from "../../components/Titlename/index.vue";
    import {sendDangerNext, getDangerDetails, getWfRecordList} from "@/api/sgyhpczl/recheckCancellationNumber";
    import {downloadFile} from "@/api/sgyhpczl/fileUtils";
    export default {
        components: {Titlename},
@@ -518,7 +520,40 @@
                this.$router.push({
                    path:"/hiddenDangerRectification"
                })
            }
            },
            subFile(fileName){
                return  fileName.substring(fileName.indexOf("fileName=")+9)
            },
            downloadFile(path){
                let params = {
                    type: 0,
                    fileName: path,
                };
                downloadFile(params).then((res) => {
                    if(res.data.type=='text/json'){
                        const reader  = new FileReader();
                        reader.readAsText(res.data, 'utf-8');
                        reader.onload = e => {
                            this.$message({
                                type: "error",
                                message: JSON.parse(reader.result).msg,
                                duration: 3000,
                            });
                        }
                    } else {
                        let blob = new Blob([res.data], {type: 'application/octet-stream'})
                        console.log(blob)
                        let blobUrl = window.URL.createObjectURL(blob)
                        let downloadElement = document.createElement('a')
                        downloadElement.href = blobUrl
                        downloadElement.download = path
                        document.body.appendChild(downloadElement)
                        downloadElement.click()
                        document.body.removeChild(downloadElement)
                        window.URL.revokeObjectURL(blobUrl)
                    }
                });
            },
        }
    }
</script>
src/views/hiddenDangerRegistration/hiddenDangerAdd.vue
@@ -385,6 +385,7 @@
        this.initWXY()
        this.initDangerRebound()
        this.id = this.$route.query.id;
        this.route = this.$route.query.route;
        if( this.id!=null &&  this.id!=''){
            this.initInfo();
            this.addShow=false
@@ -571,9 +572,15 @@
      returnIndex(){
          this.$router.push({
              path:"/hiddenDangerRegistration"
          })
          if(this.route!=null){
              this.$router.push({
                  path:"/"+this.route
              })
          }else{
              this.$router.push({
                  path:"/hiddenDangerRegistration"
              })
          }
      },
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
@@ -613,9 +620,15 @@
                editDanger(param).then(res=>{
                    if (res.data.ok==1){
                        this.$message({type:'success', message:"编辑成功", duration:3000})
                        this.$router.push({
                            path:"/hiddenDangerRegistration"
                        })
                        if(this.route!=null){
                            this.$router.push({
                                path:"/"+this.route
                            })
                        }else{
                            this.$router.push({
                                path:"/hiddenDangerRegistration"
                            })
                        }
                    }else {
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
src/views/hiddenDangerReview/recheckCancellationNumber.vue
@@ -45,7 +45,7 @@
                        v-for="item in YHBMList"
                        :key="item.branch_id"
                        :label="item.branch_name"
                        :value="item.branch_id">
                        :value="item.branch_name">
                    </el-option>
                </el-select>
            </el-form-item>
@@ -151,7 +151,7 @@
                <el-button class="btns" type="primary" size="small">批量发送</el-button>
            </el-col>
        </el-row>
        <el-table :data="tableData" ref="dangerRectificationTable" style="width: 100%">
        <el-table :data="tableData" ref="dangerRectificationTable" style="width: 100%" v-loading="loading">
            <el-table-column type="selection" width="55" align="center"></el-table-column>
            <el-table-column prop="number" label="编号" align="center" width="120">
                <template slot-scope="scope">
@@ -194,7 +194,7 @@
                <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="measure" label="整改措施" align="center">
                <el-table-column prop="measure" label="整改措施" width="150" align="center">
                    <template slot-scope="scope">
                        <el-popover trigger="hover" placement="top">
                            <p>{{ scope.row.measure }}</p>
@@ -233,7 +233,7 @@
            <el-table-column prop="DTRisk_level" label="风险等级" align="center"></el-table-column>
            <el-table-column prop="warningLevel" label="初始警情" align="center"></el-table-column>
            <el-table-column prop="curWarningLevel" label="当前警情" align="center"></el-table-column>
            <el-table-column prop="date" label="流程操作" align="center">
            <el-table-column prop="date" label="流程操作" align="center" fixed="right">
                <template slot-scope="scope">
                    <el-button @click="handleClick(scope.row)" type="text" size="small">点击发送</el-button>
                </template>
@@ -241,7 +241,7 @@
        </el-table>
        <!--批量复查弹窗-->
        <el-dialog
            title="提示"
            title="发送隐患单"
            :visible.sync="dialogVisible"
            :close-on-click-modal="false"
            width="30%"
@@ -358,6 +358,7 @@
            YHBMList: [],
            YHJBList: [],
            tableData: [],
            loading:false,
            ruleForm: {
                id: "",
                step: "3",
@@ -471,7 +472,9 @@
        getPageList() {
            this.listQuery.page = 1
            this.checkTime()
            this.loading = true
            getPageList(this.listQuery).then(res => {
                this.loading =false
                if (res.data.ok == 1) {
                    this.tableData = res.data.data.items
                    this.recordTotal = res.data.data.total
@@ -566,12 +569,14 @@
            }
        },
        exportData() {
            var requestData = this.listQuery;
            this.listLoading = true
            var requestData = JSON.parse(JSON.stringify(this.listQuery));
            requestData.export_type = 3;
            //删除分页参数
            this.$delete(requestData, 'page')
            this.$delete(requestData, 'limit')
            danger_export_do(requestData).then(res => {
                this.listLoading = false
                var blob = new Blob([res.data])
                var downloadElement = document.createElement('a')
                var href = window.URL.createObjectURL(blob) //创建下载的链接
src/views/hiddenDangerReview/recheckHiddenDangerList.vue
@@ -296,10 +296,11 @@
                                        width="260">
                                        <template slot-scope="scope">
                                            <span size="medium">{{ scope.row.content }}</span>
                                            <a v-for="item in scope.row.realFileName"
                                               :href="scope.row.url+'/'+item">
                                                {{ item.split("fileName=")[1] }}
                                            </a>
                                            <span v-for="item in scope.row.realFileName">
                                                <el-link  type="primary" @click="downloadFile(subFile(item))">
                                                    {{subFile(item)}}
                                                </el-link>
                                            </span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
@@ -317,6 +318,13 @@
                            <el-form-item label="发送流程:" prop="name">
<!--                                <el-input type="textarea" v-model="ruleForm.name" class="multiline"-->
<!--                                          :disabled="true"></el-input>-->
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="下一步:" prop="name">
                                <span> 流程结束,不通过则返回隐患部门</span>
                            </el-form-item>
                        </el-col>
                    </el-row>
@@ -431,6 +439,7 @@
<script>
import Titlename from "../../components/Titlename/index.vue";
import {sendDangerNext, getDangerDetails, getWfRecordList} from "@/api/sgyhpczl/recheckCancellationNumber";
import {downloadFile} from "@/api/sgyhpczl/fileUtils";
export default {
    components: {Titlename},
@@ -533,7 +542,40 @@
            this.$router.push({
                path: "/recheckCancellationNumber"
            })
        }
        },
        subFile(fileName){
            return  fileName.substring(fileName.indexOf("fileName=")+9)
        },
        downloadFile(path){
            let params = {
                type: 0,
                fileName: path,
            };
            downloadFile(params).then((res) => {
                if(res.data.type=='text/json'){
                    const reader  = new FileReader();
                    reader.readAsText(res.data, 'utf-8');
                    reader.onload = e => {
                        this.$message({
                            type: "error",
                            message: JSON.parse(reader.result).msg,
                            duration: 3000,
                        });
                    }
                } else {
                    let blob = new Blob([res.data], {type: 'application/octet-stream'})
                    console.log(blob)
                    let blobUrl = window.URL.createObjectURL(blob)
                    let downloadElement = document.createElement('a')
                    downloadElement.href = blobUrl
                    downloadElement.download = path
                    document.body.appendChild(downloadElement)
                    downloadElement.click()
                    document.body.removeChild(downloadElement)
                    window.URL.revokeObjectURL(blobUrl)
                }
            });
        },
    }
}
</script>
src/views/hiddenDangerTroubleshootingList/index.vue
@@ -1,10 +1,11 @@
<template xmlns="http://www.w3.org/1999/html">
    <div class="whole">
    <div class="whole"  v-loading="fullscreenLoading">
        <div class="left-tree">
            <el-tree
                :data="data"
                node-key="id"
                default-expand-all
                @node-click="clickType"
                @node-drag-start="handleDragStart"
                @node-drag-enter="handleDragEnter"
                @node-drag-leave="handleDragLeave"
@@ -24,31 +25,34 @@
                  }"
                    style="color: #409eff;"
                />
                <i v-else class="el-icon-folder-add" style="color: #EC933A;" />
                <i v-else class="el-icon-folder-add" style="color: #EC933A;"/>
                <span>{{ node.label }}</span>
              </template>
            </span>
            </el-tree>
        </div>
        <div class="right-table">
        <div class="right-table" v-show="templateName!=null && templateName !=''">
            <table border="1" style="background: #FFFFFF;width: 100%;">
                <tr>
                    <td class="table_td" style="text-align: right;">模板名称:</td>
                    <td>
                        <input class="input" style="line-height: 24px;height: 24px;">
                        <input class="input" style="line-height: 24px;height: 24px;"
                               v-model="templateName">
                    </td>
                </tr>
                <tr>
                    <td class="table_td" style="text-align: right;">模板导入:</td>
                    <td style="line-height: 24px;height: 24px;">
                        <input class="input" type="file" style="color: red;">
                        <button class="btn" style="margin-left: 120px;">导入</button>
                        <button class="btn">下载模板</button>
                        <input class="input" type="file" @change="changeFile" accept=".xlsx,.xls" style="color: red;">
                        <button class="btn" style="margin-left: 120px;" @click="importData"
                                >导入
                        </button>
                        <button class="btn" @click="downTemplate">下载模板</button>
                    </td>
                </tr>
                <tr class="table_tr">
                    <td colspan="4" align="center">
                        <button class="btn">预览</button>
                        <button class="btn" @click="preview">预览</button>
                    </td>
                </tr>
            </table>
@@ -57,32 +61,43 @@
</template>
<script>
import {standard_template, standard_import_do,stand_list} from "@/api/sgyhpczl/hiddenDangerTroubleshootingList";
export default {
    name: "index" ,
    name: "index",
    data() {
        return {
            data: [{
                id: 1,
                label: '隐患排查清单',
                icon:'el-icon-folder',
                icon: 'el-icon-folder',
                click: true,
                children: [{
                    id: 4,
                    label: '现场管理清单',
                    icon:'el-icon-folder',
                    icon: 'el-icon-folder',
                    click: true
                },
                {
                    id: 5,
                    label: '基础管理清单',
                    icon:'el-icon-success',
                }]
                    {
                        id: 5,
                        label: '基础管理清单',
                        icon: 'el-icon-success',
                        click: true
                    }]
            }],
            defaultProps: {
                children: 'children',
                label: 'label'
            },
            templateName: "",
            file: null,
            fullscreenLoading:false
        };
    },
    mounted(){
    mounted() {
        this.getAllColumns()
    },
    methods: {
@@ -120,59 +135,127 @@
        },
        handleChange(file, fileList) {
            this.fileList = fileList.slice(-3);
        },
        clickType(item) {
            if (item.click) {
                this.templateName = item.label;
            }
        },
        downTemplate() {
            //删除分页参数
            standard_template().then(res => {
                var blob = new Blob([res.data])
                var downloadElement = document.createElement('a')
                var href = window.URL.createObjectURL(blob) //创建下载的链接
                downloadElement.href = href
                downloadElement.download = '隐患排查标准清单模板.xlsx' //下载后文件名
                document.body.appendChild(downloadElement)
                downloadElement.click() //点击下载
                document.body.removeChild(downloadElement) //下载完成移除元素
                window.URL.revokeObjectURL(href) //释放掉blob对象
            }).catch(err => {
                console.log(err)
            })
        },
        importData() {
            if (this.file == null) {
                this.$message({type: 'warning', message: "请添加Excel附件", duration: 3000})
                return;
            }
            console.log(this.file)
            this.fullscreenLoading = true;
            this.uploadByJsqd(this.file);
        },
        changeFile(file) {
            this.file = event.target.files[0]
        },
        //文件发生改变就会触发的事件 导入
        uploadByJsqd(file) {
            //判断是否符合beforeAvatarUpload方法中的条件
            var formdata = new FormData()
            formdata.append('file', file)
            formdata.append('standardType', this.templateName);
            //importDevice:请求接口 formdata:传递参数
            standard_import_do(formdata).then((res) => {
                this.fullscreenLoading = false;
                if (res.data.ok) {
                    this.$message({type: 'success', message: res.data.msg, duration: 3000})
                    this.getPageList()//调用表格方法,刷新页面
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        preview(){
            this.$router.push({
                path: "/preview",
                query:{"templateName":this.templateName}
            })
        }
    }
}
</script>
<style scoped>
.whole{
.whole {
    display: flex;
}
.left-tree{
.left-tree {
    width: 15%;
}
.left-tree .el-tree{
.left-tree .el-tree {
    background: #f0f6e4;
    height: 400px;
    overflow-y: scroll;
    border: 1px solid #000;
}
/deep/ .is-leaf{
/deep/ .is-leaf {
    background: transparent !important;
    width: 5px;
    height: 5px;
    background-size: 100%;
    margin-right: 5px;
}
/deep/ .el-icon-caret-right:before{
/deep/ .el-icon-caret-right:before {
    content: '';
}
.right-table{
.right-table {
    width: 85%;
}
table,table tr th, table tr td {
    border:1px solid #ccc;
table, table tr th, table tr td {
    border: 1px solid #ccc;
}
.table_td{
.table_td {
    background: #e4edf4;
}
.table_tr{
.table_tr {
    background: #e4edf4;
    line-height: 40px;
    height: 40px;
}
table{
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.input{
.input {
    background: #f9f9f9;
    border-width: 1px;
    margin: 5px 0;
}
.btn{
.btn {
    background: url(../../assets/btn.gif) no-repeat;
    width: 76px;
    height: 26px;
src/views/hiddenDangerTroubleshootingList/preview.vue
@@ -1,122 +1,90 @@
<template>
<div class="whole">
    <h3 style="text-align: center">隐患排查标准清单(基础管理清单)</h3>
    <el-table
        :data="tableData"
        style="width: 100%">
        <el-table-column label="排查内容" align="center">
            <el-table-column
                prop="province"
                label="Ⅰ级要素"
                width="120">
    <div class="whole">
        <h3 style="text-align: center">隐患排查标准清单(基础管理清单)</h3>
        <el-table
            :data="tableData"
            style="width: 100%">
            <el-table-column label="排查内容" align="center">
                <el-table-column
                    prop="factor_1"
                    label="Ⅰ级要素"
                    width="120">
                </el-table-column>
                <el-table-column
                    prop="factor_2"
                    label="Ⅱ级要素"
                    width="120">
                </el-table-column>
                <el-table-column
                    prop="factor_3"
                    label="Ⅲ级要素"
                    width="120">
                </el-table-column>
                <el-table-column
                    prop="factor_4"
                    label="Ⅳ级要素"
                    width="120">
                </el-table-column>
            </el-table-column>
            <el-table-column label="排查标准" align="center">
                <el-table-column
                    prop="Standard"
                    label="标准项具体描述"
                    width="300">
                </el-table-column>
                <el-table-column
                    prop="reference"
                    width="200"
                    label="参考依据">
                </el-table-column>
            </el-table-column>
            <el-table-column
                prop="city"
                label="Ⅱ级要素"
                width="120">
                prop="method"
                label="排查方法"
                width="150">
            </el-table-column>
            <el-table-column
                prop="address"
                label="Ⅲ级要素"
                width="120">
                prop="period"
                label="排查周期"
                width="150">
            </el-table-column>
            <el-table-column
                prop="zip"
                label="Ⅳ级要素"
                width="120">
            <el-table-column label="排查责任" align="center">
                <el-table-column
                    prop="level"
                    label="排查级别">
                </el-table-column>
                <el-table-column
                    prop="branch"
                    label="责任单位">
                </el-table-column>
            </el-table-column>
        </el-table-column>
        <el-table-column label="排查标准" align="center">
            <el-table-column
                prop="province"
                label="标准项具体描述"
                width="300">
            </el-table-column>
            <el-table-column
                prop="city"
                width="200"
                label="参考依据">
            </el-table-column>
        </el-table-column>
        <el-table-column
            prop="date"
            label="排查方法"
            width="150">
        </el-table-column>
        <el-table-column
            prop="date"
            label="排查周期"
            width="150">
        </el-table-column>
        <el-table-column label="排查责任" align="center">
            <el-table-column
                prop="province"
                label="排查级别">
            </el-table-column>
            <el-table-column
                prop="city"
                label="责任单位">
            </el-table-column>
        </el-table-column>
    </el-table>
</div>
        </el-table>
    </div>
</template>
<script>
import {stand_list} from "@/api/sgyhpczl/hiddenDangerTroubleshootingList";
export default {
    name: "preview",
    data() {
        return {
            tableData: [{
                date: '2016-05-03',
                name: '王小虎',
                province: '上海',
                city: '普陀区',
                address: '上海市普陀区金沙江路 1518 弄',
                zip: 200333
            }, {
                date: '2016-05-02',
                name: '王小虎',
                province: '上海',
                city: '普陀区',
                address: '上海市普陀区金沙江路 1518 弄',
                zip: 200333
            }, {
                date: '2016-05-04',
                name: '王小虎',
                province: '上海',
                city: '普陀区',
                address: '上海市普陀区金沙江路 1518 弄',
                zip: 200333
            }, {
                date: '2016-05-01',
                name: '王小虎',
                province: '上海',
                city: '普陀区',
                address: '上海市普陀区金沙江路 1518 弄',
                zip: 200333
            }, {
                date: '2016-05-08',
                name: '王小虎',
                province: '上海',
                city: '普陀区',
                address: '上海市普陀区金沙江路 1518 弄',
                zip: 200333
            }, {
                date: '2016-05-06',
                name: '王小虎',
                province: '上海',
                city: '普陀区',
                address: '上海市普陀区金沙江路 1518 弄',
                zip: 200333
            }, {
                date: '2016-05-07',
                name: '王小虎',
                province: '上海',
                city: '普陀区',
                address: '上海市普陀区金沙江路 1518 弄',
                zip: 200333
            }]
            tableData: []
        }
    },
    mounted() {
        this.getTableData()
    },
    methods: {
        getTableData() {
            stand_list(this.$route.query.templateName).then((res) => {
                if (res.data.ok) {
                    console.log(res);
                    this.tableData = res.data.data;
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        }
    }
}
src/views/oneFromanother/exist.vue
@@ -1,6 +1,6 @@
<template>
  <div class="app-container">
    <div style="">
  <div class="app-container" >
    <div v-if="type=='0'" style="">
      <Titlename title="录入隐患单页面"></Titlename>
      <div class="whole-form">
        <el-form
@@ -64,6 +64,23 @@
              </el-form-item>
            </el-col>
          </el-row>
            <el-row>
                <el-col :span="9">
                    <el-form-item label="检查部门" prop="check_branch">
                        <el-select v-model="ruleForm.check_branch" placeholder="请选择" style="width: 100%">
                            <el-option
                                v-for="item in JCBMList"
                                :key="item.value"
                                :label="item.value"
                                :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="9" :offset="4">
                </el-col>
            </el-row>
          <el-row>
            <el-col :span="9">
              <el-form-item label="检查人员" prop="check_man">
@@ -76,8 +93,6 @@
              </el-form-item>
            </el-col>
          </el-row>
            <el-row>
                <el-col :span="22">
                    <el-form-item label="行走路线">
@@ -86,17 +101,27 @@
                </el-col>
            </el-row>
            <!-- <el-row style="margin-bottom: 20px" v-if="addShow">
            <el-row style="margin-bottom: 20px">
                <el-col :span="9">
                    <el-button type="primary" class="btns" @click="addDanger">新增隐患</el-button>
                </el-col>
            </el-row> -->
            </el-row>
                <el-table :data="tableData" style="width: 100%">
                    <el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
                    <el-table-column prop="ht_branch"  align="center" label="隐患部门"></el-table-column>
                    <el-table-column prop="address"  align="center" label="地点"></el-table-column>
                    <el-table-column prop="ht_content"  align="center" label="隐患内容"></el-table-column>
                    <el-table-column prop="ht_content" align="center" label="隐患内容">
                        <template slot-scope="scope">
                            <el-popover trigger="hover" placement="top">
                                <p>{{ scope.row.ht_content }}</p>
                                <div slot="reference" class="name-wrapper">{{
                                        scope.row.ht_content != null && scope.row.ht_content.length > 10 ? scope.row.ht_content.substring(0, 8) + "...." : scope.row.ht_content
                                    }}
                                </div>
                            </el-popover>
                        </template>
                    </el-table-column>
                    <el-table-column prop="measure"  align="center" label="整改措施"></el-table-column>
                    <el-table-column prop="ht_typesub"  align="center" label="隐患类别"></el-table-column>
                    <el-table-column prop="dangerousSource"  align="center" label="关联危险源"></el-table-column>
@@ -112,11 +137,10 @@
                                <el-button
                                    size="mini"
                                    @click="editDanger(scope.row, scope.$index)"
                                >添加
                                >编辑
                                </el-button>
                                <el-button
                                    size="mini"
                                    v-if="addShow"
                                    @click="deleteDanger(scope.row, scope.$index)"
                                >删除
                                </el-button>
@@ -139,7 +163,54 @@
        </el-form>
      </div>
    </div>
      <div v-else>
          <el-table :data="detailTableData" style="width: 100%" >
              <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="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>
                  <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="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="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="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>
              <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>
                  </template>
              </el-table-column>
              <el-table-column prop="DTRisk_bankId" label="是否关联" align="center">
                  <template slot-scope="scope">
                      <span v-if="scope.row.DTRisk_bankId==0 || scope.row.DTRisk_bankId=='' || scope.row.DTRisk_bankId==null">未关联</span>
                      <span v-else>已关联</span>
                  </template>
              </el-table-column>
              <el-table-column prop="DTRisk_level" label="风险等级" align="center"> </el-table-column>
              <el-table-column prop="warningLevel" label="初始警情" align="center"> </el-table-column>
              <el-table-column prop="curWarningLevel" label="当前警情" align="center"> </el-table-column>
          </el-table>
          <el-button style="margin-top: 20px" @click="returnIndex">关闭</el-button>
      </div>
      <el-dialog
          :title="title"
          :visible.sync="dialogVisible"
@@ -295,23 +366,35 @@
              </el-row>
          </el-form>
      </el-dialog>
  </div>
</template>
<script>
import Titlename from "../../components/Titlename/index.vue";
    import Titlename from "../../components/Titlename/index.vue";
import {initJCBM ,initYHLX, initBC ,initJCLB ,initYHBM ,initYHJB,initLlr,initReformStatus,initYwks,initWxy} from "@/api/sgyhpczl/initSelect";
import {saveDanger,initDangerRebound,getDangerInfo,editDanger} from '@/api/sgyhpczl/hiddenDangerRegistration'
import {deepClone} from '@/utils'
    import {
        initBC,
        initJCBM,
        initJCLB,
        initLlr,
        initReformStatus,
        initWxy,
        initYHBM,
        initYHJB,
        initYHLX,
        initYwks
    } from "@/api/sgyhpczl/initSelect";
    import {getPageList,initDangerRebound,saveDanger} from '@/api/sgyhpczl/hiddenDangerRegistration'
    import {deepClone} from '@/utils'
export default {
    export default {
  components: { Titlename },
  name: "hiddenDangerList",
  data() {
    return {
        addShow:true,
        type: '0',
        id:'',
        rowIndex:-1,
        dangerList:[],
@@ -321,6 +404,7 @@
            address: [{ required: true, message: '不能为空', trigger: 'blur' },],
            ht_content: [{ required: true, message: '不能为空', trigger: 'blur' },],
            ht_typesub: [{ required: true, message: '不能为空', trigger: 'blur' },],
            measure: [{ required: true, message: '不能为空', trigger: 'blur' },],
            DTRisk_bankId: [{ required: true, message: '不能为空', trigger: 'blur' },],
            ht_level: [{ required: true, message: '不能为空', trigger: 'blur' },],
            alter_time: [{ required: true, message: '不能为空', trigger: 'blur' },],
@@ -341,8 +425,8 @@
        statusList:[],
        YWKSList:[],
        reboundList:[],
      ruleForm: {},
       rules: {
        ruleForm: {},
        rules: {
           check_date: [{ required: true, message: '不能为空', trigger: 'blur' },],
           check_class: [{ required: true, message: '不能为空', trigger: 'blur' },],
           check_main_branch: [{ required: true, message: '不能为空', trigger: 'blur' },],
@@ -350,9 +434,22 @@
           check_man: [{ required: true, message: '不能为空', trigger: 'blur' },],
           checktype: [{ required: true, message: '不能为空', trigger: 'blur' },],
          },
      tableData: [],
        tableData: [],
        paramsData: {},//上个页面参数
        listQuery:{
            page:1,
            limit:10,
            form:{},
        },
        currentPage: 1,
        pageSize: 10,
        recordTotal: 0,
        detailTableData:[],//隐患详情列表
        beforeData:{}, //上个页面信息
        beforeFlag:true,//上个页面信息保存标志
    };
  },
    mounted(){
        this.initBC()
        this.initJCLB()
@@ -364,23 +461,36 @@
        this.initYWKS()
        this.initWXY()
        this.initDangerRebound()
        this.id = this.$route.query.id;
        if( this.id!=null &&  this.id!=''){
            this.initInfo();
            this.addShow=false
        this.type = this.$route.query.type;
        if (this.type === '0'){
            this.initInfo(this.$route.query.data);
        }else {
            this.listQuery.form.jyfsId = this.$route.query.data.id
            this.getPageList();
        }
    },
  methods: {
      async initInfo(){
          var res=await getDangerInfo(this.id)
          if (res.data.ok==1){
              this.ruleForm=res.data.data
              this.changeJCDW(res.data.data.check_main_branch)
              var obj=deepClone(res.data.data)
              this.tableData.push(obj)
          }
      initInfo(data){
          this.paramsData = this.$route.query.data;
          this.ruleForm.jyfsId = data.id;
          this.dangerForm.address = data.address;
          this.dangerForm.ht_content = data.ht_content;
          // this.tableData[0] = {
          //     address: data.address,
          //     ht_content: data.ht_content,
          //     ht_level: data.ht_level,
          // };
      },
      // async initInfo(){
      //     var res=await getDangerInfo(this.id)
      //     if (res.data.ok==1){
      //         this.ruleForm=res.data.data
      //         this.changeJCDW(res.data.data.check_main_branch)
      //         var obj=deepClone(res.data.data)
      //         this.tableData.push(obj)
      //     }
      // },
      initDangerRebound(){
          initDangerRebound().then(res=>{
              if (res.data.ok==1){
@@ -394,7 +504,9 @@
          this.$refs[formName].validate((valid) => {
              if (valid) {
                  if(this.title=='新增'){
                      this.beforeFlag = false;
                      this.tableData.push(this.dangerForm)
                      console.log(this.tableData)
                  }else {
                      var arr = this.tableData;
                      arr.splice(this.rowIndex, 1, this.dangerForm);
@@ -408,9 +520,18 @@
              }
          });
      },
      getPageList(){
          this.listQuery.page=1
          getPageList(this.listQuery).then(res=>{
              if (res.data.ok==1) {
                  this.detailTableData = res.data.data.items
                  this.recordTotal=res.data.data.total
              }else{
                  this.$message({type:'error', message:res.data.msg, duration:3000})
              }
          })
      },
      deleteDanger(row, index) {
          this.$confirm('确认删除吗', '提示', {
              confirmButtonText: '确认',
              cancelButtonText: '取消',
@@ -442,7 +563,9 @@
      },
      addDanger(){
          this.dangerForm={}
          if (!this.beforeFlag){
              this.dangerForm={}
          }
          this.title="新增"
          this.dialogVisible=true
      },
@@ -552,55 +675,62 @@
      returnIndex(){
          this.$router.push({
              path:"/hiddenDangerRegistration"
              path:"/oneFromanother"
          })
      },
      judge(obj){
          console.log(obj)
          if (obj != null || ('ht_branch' in obj) || ('address' in obj) || ('ht_typesub' in obj) || ('dangerousSource' in obj)
              || ('alter_time' in obj) || ('duty_officer' in obj) || ('alter_status' in obj) || ('Review' in obj) || ('DTRisk_bankId' in  obj)){
              return true;
          }else {
              return false;
          }
      },
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
            if(this.tableData==null || this.tableData.length==0){
                this.$message({type:'error', message:"请添加隐患", duration:2000})
            }
            this.ruleForm.items=this.tableData
            if(this.addShow){
            // if(this.addShow){
                console.log(this.ruleForm)
                saveDanger(this.ruleForm).then(res=>{
                    if (res.data.ok==1){
                        this.$message({type:'success', message:"新增成功", duration:3000})
                        this.$message({type:'success', message:"保存成功", duration:3000})
                        this.$router.push({
                            path:"/hiddenDangerRegistration"
                            path:"/oneFromanother"
                        })
                    }else {
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            }else {
                var param=deepClone(this.ruleForm)
                var obj=deepClone(this.tableData[0])
                param.ht_branch=obj.ht_branch
                param.address=obj.address
                param.ht_content=obj.ht_content
                param.measure=obj.measure
                param.ht_typesub=obj.ht_typesub
                param.DTRisk_bankId=obj.DTRisk_bankId
                param.DTRisk_level=obj.mriskLevel
                param.dangerousSource=obj.mriskPoint
                param.ht_level=obj.ht_level
                param.alter_time=obj.alter_time
                param.duty_officer=obj.duty_officer
                param.alter_status=obj.alter_status
                param.Review=obj.Review
                param.repeatId=obj.repeatId
                editDanger(param).then(res=>{
                    if (res.data.ok==1){
                        this.$message({type:'success', message:"编辑成功", duration:3000})
                        this.$router.push({
                            path:"/hiddenDangerRegistration"
                        })
                    }else {
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            }
            // }else {
            //     var param=deepClone(this.ruleForm)
            //     var obj=deepClone(this.tableData[0])
            //     param.ht_branch=obj.ht_branch
            //     param.address=obj.address
            //     param.ht_content=obj.ht_content
            //     param.measure=obj.measure
            //     param.ht_typesub=obj.ht_typesub
            //     param.DTRisk_bankId=obj.DTRisk_bankId
            //     param.DTRisk_level=obj.mriskLevel
            //     param.dangerousSource=obj.mriskPoint
            //     param.ht_level=obj.ht_level
            //     param.alter_time=obj.alter_time
            //     param.duty_officer=obj.duty_officer
            //     param.alter_status=obj.alter_status
            //     param.Review=obj.Review
            //     param.repeatId=obj.repeatId
            //     editDanger(param).then(res=>{
            //         if (res.data.ok==1){
            //             this.$message({type:'success', message:"编辑成功", duration:3000})
            //             this.$router.push({
            //                 path:"/hiddenDangerRegistration"
            //             })
            //         }else {
            //             this.$message({type:'error', message:res.data.msg, duration:3000})
            //         }
            //     })
            // }
src/views/oneFromanother/index.vue
@@ -2,9 +2,9 @@
    <div class="app-container">
            <el-form ref="form" :inline="true" class="inquire" :model="listQuery" label-width="80px">
            <el-form-item label="下发单位">
               <el-select v-model="listQuery.form.ht_typesub" placeholder="请选择">
               <el-select v-model="listQuery.form.push_branch" placeholder="请选择">
                    <el-option
                        v-for="item in YHLXList"
                        v-for="item in XFDWList"
                        :key="item.value"
                        :label="item.value"
                        :value="item.value">
@@ -12,12 +12,12 @@
                </el-select>
            </el-form-item>
            <el-form-item label="隐患单位">
                <el-input v-model="listQuery.form.ht_branch" style="width:202px"></el-input>
                <el-input v-model="listQuery.form.ht_community" style="width:202px"></el-input>
            </el-form-item>
            <el-form-item label="隐患类别">
                <el-select v-model="listQuery.form.ht_typesub" placeholder="请选择">
                    <el-option
                        v-for="item in YHLXList"
                        v-for="item in YHLBList"
                        :key="item.value"
                        :label="item.value"
                        :value="item.value">
@@ -38,9 +38,9 @@
                <el-input v-model="listQuery.form.address" style="width:202px" placeholder="请输入内容"></el-input>
            </el-form-item>
               <el-form-item label="检查类别">
                <el-select v-model="listQuery.form.ht_typesub" placeholder="请选择">
                <el-select v-model="listQuery.form.checktype" placeholder="请选择">
                    <el-option
                        v-for="item in YHLXList"
                        v-for="item in JCLBList"
                        :key="item.value"
                        :label="item.value"
                        :value="item.value">
@@ -71,39 +71,53 @@
        </el-form>
     <el-row class="title-center">
            <el-col :span="10">
              <el-radio-group v-model="radio1">
            <el-radio-button label="待自查">待自查</el-radio-button>
            <el-radio-button label="已自查">已自查</el-radio-button>
          </el-radio-group>
                <el-radio-group v-model="listQuery.type" @change="radioChange">
                    <el-radio-button label="0">待自查</el-radio-button>
                    <el-radio-button label="1">已自查</el-radio-button>
                </el-radio-group>
            </el-col>
            <el-col :span="14" v-if="radio1=='待自查'" style="text-align:right;">
                <el-button class="btns" type="primary" size="small" @click="sendBath()">管理专业</el-button>
            </el-col>
              <el-col :span="14" v-if="radio1=='已自查'" style="text-align:right;">
                <el-button class="btns" type="primary" size="small" @click="sendBath()">撤销</el-button>
<!--            <el-col :span="14" v-if="type=='待自查'" style="text-align:right;">-->
<!--                <el-button class="btns" type="primary" size="small" @click="sendBath()">管理专业</el-button>-->
<!--            </el-col>-->
              <el-col :span="14" v-if="listQuery.type=='1'" style="text-align:right;">
                <el-button class="btns" type="primary" size="small" @click="revoke()">撤销</el-button>
            </el-col>
        </el-row>
         <el-table ref="dataTable" :data="tableData" style="width: 100%" @selection-change="handleSelectionChange">
         <el-table
            v-loading="listLoading"
            :data="tableData"
            style="width: 100%"
            @selection-change="changeBox">
            <el-table-column type="selection" width="55" align="center"></el-table-column>
          <el-table-column prop="check_date" label="检查时间" width="120" align="center">
                    <template slot-scope="scope">
          <el-table-column prop="check_date" label="检查时间" width="120" :formatter="formatColumnDate" align="center">
                    <!-- <template slot-scope="scope">
                        <label>{{ formatDate(scope.row.check_date)}}</label><br/>
                        <label>{{ scope.row.check_class}}</label>
                    </template>
                    </template> -->
                </el-table-column>
            <el-table-column prop="check_branch" label="检查单位" align="center"></el-table-column>
            <el-table-column prop="check_main_branch" label="检查单位" align="center"></el-table-column>
            <el-table-column prop="checktype" label="检查类别" align="center"></el-table-column>
                <el-table-column prop="measure" label="被检单位" align="center"></el-table-column>
            <el-table-column prop="date" label="隐患类别" align="center"></el-table-column>
            <el-table-column prop="DTRisk_level" label="隐患级别" align="center"></el-table-column>
            <el-table-column prop="warningLevel" label="隐患地点" align="center"></el-table-column>
            <el-table-column prop="curWarningLevel" label="内容" width="200" align="center"></el-table-column>
            <el-table-column prop="curWarningLevel" label="下发单位" align="center"></el-table-column>
                <el-table-column prop="ht_community" label="被检单位" align="center"></el-table-column>
            <el-table-column prop="ht_typesub" label="隐患类别" align="center"></el-table-column>
            <el-table-column prop="ht_level" label="隐患级别" align="center"></el-table-column>
            <el-table-column prop="address" label="隐患地点" align="center"></el-table-column>
            <el-table-column prop="ht_content" label="内容" width="200" align="center">
                <template slot-scope="scope">
                    <el-popover trigger="hover" placement="top">
                        <p>{{ scope.row.ht_content }}</p>
                        <div slot="reference" class="name-wrapper">{{
                                scope.row.ht_content != null && scope.row.ht_content.length > 10 ? scope.row.ht_content.substring(0, 8) + "...." : scope.row.ht_content
                            }}
                        </div>
                    </el-popover>
                </template>
            </el-table-column>
            <el-table-column prop="push_branch" label="下发单位" align="center"></el-table-column>
            <el-table-column prop="date" label="流程操作" align="center">
                <template slot-scope="scope">
                    <el-button @click="handleClick(scope.row)" type="text"  size="small">不存在</el-button>
                    <el-button @click="handleClick(scope.row)" type="text" v-if="radio1=='已自查'" size="small">追查结果</el-button>
                    <el-button @click="handleClick(scope.row,'存在')" type="text"  v-if="radio1=='待自查'" size="small">存在</el-button>
                    <el-button @click="handleClick(scope.row,'不存在')"  v-if="scope.row.jyfsFlag=='1'" type="text"  size="small">不存在</el-button>
                    <el-button @click="handleClick(scope.row)" type="text" v-if="listQuery.type=='0' || scope.row.jyfsFlag=='0'" size="small">存在</el-button>
                    <el-button @click="handleClick(scope.row)" type="text" v-if="listQuery.type=='1'" size="small">追查结果</el-button>
                </template>
            </el-table-column>
        </el-table>
@@ -120,32 +134,288 @@
            >
            </el-pagination>
        </div>
        <el-dialog :title="selfTitle" :visible.sync="selfInspectVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="600px">
            <el-form ref="selfInspectForm" :rules="selfInspectFormRules" :model="selfInspectForm" label-position="right" label-width="80px">
                <el-form-item label="自查人" prop="markUserName">
                    <el-input v-model="selfInspectForm.markUserName" class="analyseUnit_input"></el-input>
                </el-form-item>
                <el-form-item label="自查时间" prop="markDate">
                    <el-col :span="11">
                        <el-date-picker type="date" placeholder="选择日期" v-model="selfInspectForm.markDate"
                                        style="width: 100%;" value-format="yyyy-MM-dd">
                        </el-date-picker>
                    </el-col>
                </el-form-item>
                <el-form-item label="备注" prop="remark">
                    <el-input v-model="selfInspectForm.remark" type="textarea" rows="5" class="analyseUnit_input"></el-input>
                </el-form-item>
            </el-form>
            <div  align="center">
                <el-button type="primary" v-if="listQuery.type == '0'" @click="submitSelfInspect()">确认</el-button>
                <el-button @click="selfInspectVisible = false">关闭</el-button>
            </div>
        </el-dialog>
    </div>
</template>
<script>
    import { getPageList, noExistSave,selfCheckNotInfo, revoke, analogy_export_do} from "@/api/sgyhpczl/oneFromanother"
    import {initJCBM, initYHLX, initJCLB, initYHJB} from "@/api/sgyhpczl/initSelect";
    export default{
        name: 'index',
        data(){
            return{
                listQuery:{
                    form:{}
                    page:1,
                    limit:10,
                    type: 0,
                    form:{},
                },
                radio1:'待自查',
                currentPage: 1,
                pageSize: 10,
                recordTotal: 0,
                XFDWList:[],
                YHLBList:[],
                YHJBList:[],
                JCLBList:[],
                tableData:[],
                selectedList:[],
                listLoading: false,
                selfInspectVisible: false,
                selfInspectForm:{
                    id: '',
                    markUserName:'',
                    markDate:'',
                    remark:'',
                },
                selfTitle: '',
                selfInspectFormRules:{
                    markUserName: [{ required: true, message: '自查人不能为空', trigger: 'blur' }],
                    markDate: [{ required: true, message: '自查时间不能为空', trigger: 'blur' }]
                },
            }
        },
        mounted() {
            this.getPageList();
            this.initJCLB();
            this.initXFDW();
            this.initYHJB();
            this.initYHLB();
        },
        methods:{
            sendBath(){
                this.$router.push({
                    path:'/manage'
            revoke(){
                if (this.selectedList.length > 1 || this.selectedList.length === 0) {
                    this.$message({type:'warning', message:'请选择一条记录', duration:3000})
                    return
                }
                this.$confirm('确认撤销吗','提示', {
                    confirmButtonText: '确认',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(()=>{
                    revoke(this.selectedList[0].id).then((res)=>{
                        if (res.data.ok==1) {
                            this.getPageList();
                            this.$notify({
                                title: "成功",
                                message: "撤销成功",
                                type: "success",
                                duration: 2000,
                            });
                        }else{
                            this.$message({type:'error', message:res.data.msg, duration:3000})
                        }
                    })
                })
            },
            handleClick(data,val){
                if(val=='存在'){
                    this.$router.push({
                        path:'/exist'
                if(val=='不存在'){
                    this.$nextTick(() =>{
                        this.$refs["selfInspectForm"].clearValidate()
                    })
                    this.selfInspectForm={id:data.id}
                    this.selfInspectVisible = true
                    if (this.listQuery.type == '1'){
                        let params = {
                            id: data.id,
                            type: 0,
                        }
                        selfCheckNotInfo(params).then(res=>{
                            if (res.data.ok==1){
                                this.selfInspectForm=res.data.data[0]
                            } else{
                                this.$message({type:'error', message:res.data.msg, duration:3000})
                            }
                        })
                    }
                    return
                }
            }
                let puType = '0';
                if (this.listQuery.type=='1' && data.jyfsFlag=='0'){
                    puType = '1';
                }
                this.$router.push({
                    path:'/exist',
                    query: {
                        data: data,
                        type: puType
                    }
                })
            },
            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().then(res=>{
                    if (res.data.ok==1){
                        this.YHLBList=res.data.data
                    } else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            },
            initYHJB(){
                initYHJB().then(res=>{
                    if (res.data.ok==1){
                        this.YHJBList=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})
                    }
                })
            },
            checkTime(){
                if(this.listQuery.form.check_dateStart!=null && this.listQuery.form.check_dateStart!=''){
                    if(this.listQuery.form.check_dateEnd!=null && this.listQuery.form.check_dateEnd!=''){
                    }else {
                        this.$message({type:'error', message:"请选择检查结束时间", duration:3000})
                        return
                    }
                }
                if(this.listQuery.form.check_dateEnd!=null && this.listQuery.form.check_dateEnd!=''){
                    if(this.listQuery.form.check_dateStart!=null && this.listQuery.form.check_dateStart!=''){
                    }else {
                        this.$message({type:'error', message:"请选择检查开始时间", duration:3000})
                        return
                    }
                }
            },
            //搜索
            getPageList(){
                this.listQuery.page=1
                this.checkTime()
                this.listLoading = true
                getPageList(this.listQuery).then(res=>{
                    this.listLoading = false
                    if (res.data.ok==1) {
                        this.tableData = res.data.data.items
                        this.recordTotal=res.data.data.total
                    }else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            },
            reset(){
                this.listQuery.form={};
                this.getPageList()
            },
            //自查切换
            radioChange(val){
                this.listQuery.type = val;
                if (val == '0'){
                    this.selfTitle = '填写自查结果'
                }else {
                    this.selfTitle = '查看自查结果'
                }
                this.getPageList()
            },
            changeBox(val){
                this.selectedList = []
                val.forEach((item) => {
                    this.selectedList.push(item)
                })
            },
            handleSizeChange(val){
                this.listQuery.limit = val
                this.getPageListForPagination();
            },
            handleCurrentChange(val){
                this.listQuery.page = val
                this.getPageListForPagination();
            },
            getPageListForPagination(){
                this.checkTime()
                getPageList(this.listQuery).then(res=>{
                    if (res.data.ok==1) {
                        this.tableData = res.data.data.items
                        this.recordTotal=res.data.data.total
                    }else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            },
            submitSelfInspect(){
                this.$refs["selfInspectForm"].validate((valid) =>{
                    if (valid){
                        noExistSave(this.selfInspectForm).then((res)=>{
                            if (res.data.ok==1) {
                                this.$message({type:'success', message:"保存成功", duration:3000});
                                this.selfInspectVisible = false
                            }else{
                                this.$message({type:'error', message:res.data.msg, duration:3000})
                            }
                        })
                    }
                })
            },
            exportData() {
                this.listLoading = true
                var requestData = JSON.parse(JSON.stringify(this.listQuery));
                //删除分页参数
                this.$delete(requestData, 'page')
                this.$delete(requestData, 'limit')
                analogy_export_do(requestData).then(res => {
                    this.listLoading = false
                    var blob = new Blob([res.data])
                    var downloadElement = document.createElement('a')
                    var href = window.URL.createObjectURL(blob) //创建下载的链接
                    downloadElement.href = href
                    downloadElement.download = '举一反三隐患.xlsx' //下载后文件名
                    document.body.appendChild(downloadElement)
                    downloadElement.click() //点击下载
                    document.body.removeChild(downloadElement) //下载完成移除元素
                    window.URL.revokeObjectURL(href) //释放掉blob对象
                }).catch(err => {
                    console.log(err)
                })
            },
            //日期格式转换
            formatColumnDate(row, column) {
                // 获取单元格数据
                let data = row[column.property]
                if (data == null) {
                    return null
                }
                let dt = new Date(data)
                return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + ' '
            },
        }
    }
</script>
@@ -180,4 +450,4 @@
    background-color: #034ea2;
    background-color: #034ea2;
}
</style>
</style>
src/views/oneFromanotherN/addDanger.vue
对比新文件
@@ -0,0 +1,359 @@
<template>
  <div class="app-container">
    <div style="">
      <Titlename title="录入举一反三页面"></Titlename>
      <div class="whole-form">
        <el-form
          :model="ruleForm"
          :rules="rules"
          ref="ruleForm"
          label-width="150px"
          class="demo-ruleForm"
          style="margin: 0 14% 0 16%">
          <el-row>
            <el-col :span="9">
              <el-form-item label="检查时间" prop="check_date">
                <el-date-picker
                  v-model="ruleForm.check_date"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="选择日期"
                  style="width: 100%">
                </el-date-picker>
              </el-form-item>
            </el-col>
             <el-col :span="9">
              <el-form-item label="检查类别" prop="checktype">
                  <el-select v-model="ruleForm.checktype" placeholder="请选择"  style="width: 100%">
                      <el-option
                          v-for="item in JCLBList"
                          :key="item.value"
                          :label="item.value"
                          :value="item.value">
                      </el-option>
                  </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="9" >
              <el-form-item label="检查单位" prop="check_main_branch">
                  <el-input v-model="ruleForm.check_main_branch" style="width:100%"></el-input>
<!--                  <el-select v-model="ruleForm.check_main_branch" placeholder="请选择"  @change="changeJCDW"  style="width: 100%">-->
<!--                      <el-option-->
<!--                          v-for="item in JCDWList"-->
<!--                          :key="item.label"-->
<!--                          :label="item.label"-->
<!--                          :value="item.label"-->
<!--                      >-->
<!--                      </el-option>-->
<!--                  </el-select>-->
              </el-form-item>
            </el-col>
          </el-row>
            <el-row style="margin-bottom: 20px">
                <el-col :span="9">
                    <el-button type="primary" class="btns" @click="addDanger()">新增</el-button>
                </el-col>
            </el-row>
                <el-table :data="tableData" style="width: 100%">
                    <el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
                    <el-table-column prop="address"  align="center" label="隐患地点"></el-table-column>
                    <el-table-column prop="ht_content"  align="center" label="隐患内容"></el-table-column>
                    <el-table-column prop="ht_typesub"  align="center" label="隐患类别"></el-table-column>
                    <el-table-column prop="ht_level"  align="center" label="隐患级别"></el-table-column>
                    <el-table-column prop="time" label="操作" align="center" width="140">
                        <template slot-scope="scope">
                            <div style="display: flex;align-items: center;flex-direction: row;">
                                <el-button size="mini" @click="editDanger(scope.row, scope.$index)">
                                    编辑
                                </el-button>
                                <el-button size="mini" @click="deleteDanger(scope.row, scope.$index)">
                                    删除
                                </el-button>
                            </div>
                        </template>
                    </el-table-column>
                </el-table>
          <el-row style="margin-top: 20px">
            <el-col :span="22">
              <el-form-item style="text-align: center">
                <el-button type="primary" class="btns" @click="submitForm('ruleForm')">
                    保存
                </el-button>
                <el-button @click="closeShow">关闭</el-button>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
    </div>
      <el-dialog
          :title="title"
          :visible.sync="dialogVisible"
          :close-on-click-modal="false"
          width="40%">
          <el-form ref="form" :rules="dangerRules" :model="dangerForm" label-width="100px">
              <el-row>
                  <el-col :span="9">
                      <el-form-item label="隐患地点" prop="address">
                          <el-input v-model="dangerForm.address" rows="3" type="textarea" class="multiline"></el-input>
                      </el-form-item>
                  </el-col>
                  <el-col :span="9" :offset="4">
                      <el-form-item label="隐患内容" prop="ht_content">
                          <el-input v-model="dangerForm.ht_content" rows="3" type="textarea" class="multiline"></el-input>
                      </el-form-item>
                  </el-col>
              </el-row>
              <el-row>
                 <el-col :span="9">
                      <el-form-item label="隐患类别" prop="ht_typesub">
                          <el-select v-model="dangerForm.ht_typesub" placeholder="请选择">
                              <el-option
                                  v-for="item in YHLXList"
                                  :key="item.value"
                                  :label="item.value"
                                  :value="item.value">
                              </el-option>
                          </el-select>
                      </el-form-item>
                  </el-col>
                  <el-col :span="9" :offset="4">
                      <el-form-item label="隐患级别" prop="ht_level">
                          <el-select v-model="dangerForm.ht_level" placeholder="请选择">
                              <el-option
                                  v-for="item in YHJBList"
                                  :key="item.value"
                                  :label="item.label"
                                  :value="item.value">
                              </el-option>
                          </el-select>
                      </el-form-item>
                  </el-col>
              </el-row>
              <el-row>
                  <el-col :span="22">
                      <el-form-item style="text-align: center">
                          <el-button type="primary" class="btns" @click="submitDanger('form')">
                              保存
                          </el-button>
                          <el-button @click="dialogVisible=false">关闭</el-button>
                      </el-form-item>
                  </el-col>
              </el-row>
          </el-form>
      </el-dialog>
  </div>
</template>
<script>
import Titlename from "../../components/Titlename/index.vue";
import {initJCBM ,initYHLX,initJCLB,initYHJB,initReformStatus} from "@/api/sgyhpczl/initSelect";
import {saveDanger,initDangerRebound,getDangerInfo,editDanger} from '@/api/sgyhpczl/hiddenDangerRegistration'
import { save } from '@/api/sgyhpczl/oneFromanotherN'
import {deepClone} from '@/utils'
export default {
  components: { Titlename },
  name: "hiddenDangerList",
  data() {
    return {
        id:'',
        rowIndex:-1,
        dangerList:[],
        dangerForm:{},
        dangerRules:{
            address: [{ required: true, message: '不能为空', trigger: 'blur' },],
            ht_content: [{ required: true, message: '不能为空', trigger: 'blur' },],
            ht_typesub: [{ required: true, message: '不能为空', trigger: 'blur' },],
            ht_level: [{ required: true, message: '不能为空', trigger: 'blur' },],
        },
        title:'新增',
        dialogVisible:false,
        JCLBList:[],
        YHLXList:[],
        YHJBList:[],
        ruleForm: {},
        rules: {
           check_date: [{ required: true, message: '不能为空', trigger: 'blur' },],
           check_main_branch: [{ required: true, message: '不能为空', trigger: 'change' },],
           checktype: [{ required: true, message: '不能为空', trigger: 'blur' },],
        },
        tableData: [],
    };
  },
    mounted(){
        this.initJCLB()
        this.initYHJB()
        this.initYHLX()
    },
  methods: {
      submitDanger(formName){
          this.$refs[formName].validate((valid) => {
              if (valid) {
                  if(this.title=='新增'){
                      this.tableData.push(this.dangerForm)
                  }else {
                      var arr = this.tableData;
                      arr.splice(this.rowIndex, 1, this.dangerForm);
                      this.tableData = arr;
                  }
                  this.dialogVisible=false
              } else {
                  console.log("error submit!!");
                  return false;
              }
          });
      },
      deleteDanger(row, index) {
          this.$confirm('确认删除吗', '提示', {
              confirmButtonText: '确认',
              cancelButtonText: '取消',
              type: 'warning'
          })
              .then(() => {
                  var arr = deepClone(this.tableData);
                  var brr = [];
                  for (var i = 0; i < arr.length; i++) {
                      if (i == index) {
                      } else {
                          brr.push(arr[i]);
                      }
                  }
                  this.tableData = deepClone(brr);
                  //this.tableData.splice(index)
              })
              .catch(error => {
              });
      },
      editDanger(row, index) {
          this.dangerForm = deepClone(row);
          this.rowIndex = index;
          this.dialogVisible = true;
          this.title = '编辑';
      },
      addDanger(){
          this.dangerForm={}
          this.title="新增"
          this.dialogVisible=true
      },
      changeWxy(e){
          for(var i=0;i<this.dangerList.length;i++){
              if(e==this.dangerList[i].id){
                  this.dangerForm.DTRisk_level=this.dangerList[i].mriskLevel
                  this.dangerForm.dangerousSource=this.dangerList[i].mriskPoint
              }
          }
      },
      initReformStatus(){
          initReformStatus().then(res=>{
              if (res.data.ok==1){
                  this.statusList=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})
              }
          })
      },
      initYHLX(){
          initYHLX().then(res=>{
              if (res.data.ok==1){
                  this.YHLXList=res.data.data
              } else{
                  this.$message({type:'error', message:res.data.msg, duration:3000})
              }
          })
      },
      initYHJB(){
          initYHJB().then(res=>{
              if (res.data.ok==1){
                  this.YHJBList=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})
              }
          })
      },
      closeShow(){
          this.$router.push({
              path:"/oneFromanotherN"
          })
      },
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
            if(this.tableData==null || this.tableData.length==0){
                this.$message({type:'error', message:"请添加隐患", duration:2000})
            }
            this.ruleForm.items=this.tableData
            save(this.ruleForm).then(res=>{
                if (res.data.ok==1){
                    this.$message({type:'success', message:"新增成功", duration:3000})
                    this.$router.push({
                        path:"/oneFromanotherN"
                    })
                }else {
                    this.$message({type:'error', message:res.data.msg, duration:3000})
                }
            })
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
  },
};
</script>
<style scoped>
.app-container {
  padding: 20px;
  height: 850px;
  overflow-y: auto;
}
.app-container /deep/ .box {
  padding-top: 0;
}
/* /deep/ .multiline .el-input__inner {
  height: 62px;
} */
 .btns{
        background-color: #034ea2;
        border: 1px solid #034ea2;
    }
</style>
src/views/oneFromanotherN/existN.vue
@@ -1,249 +1,455 @@
<template>
  <div class="app-container">
    <div style="">
      <Titlename title="录入隐患单页面"></Titlename>
      <div class="whole-form">
        <el-form
          :model="ruleForm"
          :rules="rules"
          ref="ruleForm"
          label-width="150px"
          class="demo-ruleForm"
          style="margin: 0 14% 0 16%"
        >
          <el-row>
            <el-col :span="9">
              <el-form-item label="检查时间" prop="check_date">
                <el-date-picker
                  v-model="ruleForm.check_date"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="选择日期"
                  style="width: 100%"
    <div class="app-container" >
        <div v-if="type=='0'" style="">
            <Titlename title="录入隐患单页面"></Titlename>
            <div class="whole-form">
                <el-form
                    :model="ruleForm"
                    :rules="rules"
                    ref="ruleForm"
                    label-width="150px"
                    class="demo-ruleForm"
                    style="margin: 0 14% 0 16%"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
             <el-col :span="9">
              <el-form-item label="检查类别" prop="checktype">
                  <el-select v-model="ruleForm.checktype" placeholder="请选择"  style="width: 100%">
                      <el-option
                          v-for="item in JCLBList"
                          :key="item.value"
                          :label="item.value"
                          :value="item.value">
                      </el-option>
                  </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="9" >
              <el-form-item label="检查单位" prop="check_main_branch">
                  <el-select v-model="ruleForm.check_main_branch" placeholder="请选择"  @change="changeJCDW"  style="width: 100%">
                      <el-option
                          v-for="item in JCDWList"
                          :key="item.label"
                          :label="item.label"
                          :value="item.label"
                      >
                      </el-option>
                  </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <!-- <el-row>
            <el-col :span="9">
              <el-form-item label="检查人员" prop="check_man">
                <el-input v-model="ruleForm.check_man"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="9" :offset="4">
              <el-form-item label="陪检人员" prop="acc_man">
                <el-input v-model="ruleForm.acc_man"></el-input>
              </el-form-item>
            </el-col>
          </el-row> -->
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="检查时间" prop="check_date">
                                <el-date-picker
                                    v-model="ruleForm.check_date"
                                    type="date"
                                    value-format="yyyy-MM-dd"
                                    placeholder="选择日期"
                                    style="width: 100%"
                                >
                                </el-date-picker>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="班次" prop="check_class">
                                <el-select v-model="ruleForm.check_class" placeholder="请选择"  style="width: 100%">
                                    <el-option
                                        v-for="item in BCList"
                                        :key="item.value"
                                        :label="item.value"
                                        :value="item.value">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="检查类别" prop="checktype">
                                <el-select v-model="ruleForm.checktype" placeholder="请选择"  style="width: 100%">
                                    <el-option
                                        v-for="item in JCLBList"
                                        :key="item.value"
                                        :label="item.value"
                                        :value="item.value">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="检查单位" prop="check_main_branch">
                                <el-select v-model="ruleForm.check_main_branch" placeholder="请选择"  @change="changeJCDW"  style="width: 100%">
                                    <el-option
                                        v-for="item in JCDWList"
                                        :key="item.label"
                                        :label="item.label"
                                        :value="item.label"
                                    >
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="检查部门" prop="check_branch">
                                <el-select v-model="ruleForm.check_branch" placeholder="请选择" style="width: 100%">
                                    <el-option
                                        v-for="item in JCBMList"
                                        :key="item.value"
                                        :label="item.value"
                                        :value="item.value">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="检查人员" prop="check_man">
                                <el-input v-model="ruleForm.check_man"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="陪检人员" prop="acc_man">
                                <el-input v-model="ruleForm.acc_man"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="行走路线">
                                <el-input v-model="ruleForm.route" rows="3" type="textarea" class="multiline"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row style="margin-bottom: 20px">
                        <el-col :span="9">
                            <el-button type="primary" class="btns" @click="addDanger">新增隐患</el-button>
                        </el-col>
                    </el-row>
                    <el-table :data="tableData" style="width: 100%">
                        <el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
                        <el-table-column prop="ht_branch"  align="center" label="隐患部门"></el-table-column>
                        <el-table-column prop="address"  align="center" label="地点"></el-table-column>
                        <el-table-column prop="ht_content" align="center" label="隐患内容">
                            <template slot-scope="scope">
                                <el-popover trigger="hover" placement="top">
                                    <p>{{ scope.row.ht_content }}</p>
                                    <div slot="reference" class="name-wrapper">{{
                                            scope.row.ht_content != null && scope.row.ht_content.length > 10 ? scope.row.ht_content.substring(0, 8) + "...." : scope.row.ht_content
                                        }}
                                    </div>
                                </el-popover>
                            </template>
                        </el-table-column>
                        <el-table-column prop="measure"  align="center" label="整改措施"></el-table-column>
                        <el-table-column prop="ht_typesub"  align="center" label="隐患类别"></el-table-column>
                        <el-table-column prop="dangerousSource"  align="center" label="关联危险源"></el-table-column>
                        <el-table-column prop="DTRisk_level"  align="center" label="风险等级"></el-table-column>
                        <el-table-column prop="ht_level"  align="center" label="隐患级别"></el-table-column>
                        <el-table-column prop="alter_time"  align="center" label="限改时间"></el-table-column>
                        <el-table-column prop="duty_officer"  align="center" label="责任人"></el-table-column>
                        <el-table-column prop="alter_status"  align="center" label="整改情况"></el-table-column>
                        <el-table-column prop="Review"  align="center" label="业务科室"></el-table-column>
                        <el-table-column prop="time" label="操作" align="center" width="140">
                            <template slot-scope="scope">
                                <div style="display: flex;align-items: center;flex-direction: row;">
                                    <el-button
                                        size="mini"
                                        @click="editDanger(scope.row, scope.$index)"
                                    >编辑
                                    </el-button>
                                    <el-button
                                        size="mini"
                                        @click="deleteDanger(scope.row, scope.$index)"
                                    >删除
                                    </el-button>
                                </div>
                            </template>
                        </el-table-column>
                    </el-table>
            <!-- <el-row>
                <el-col :span="22">
                    <el-form-item label="行走路线">
                        <el-input v-model="ruleForm.route" rows="3" type="textarea" class="multiline"></el-input>
                    </el-form-item>
                </el-col>
            </el-row> -->
                    <el-row style="margin-top: 20px">
                        <el-col :span="22">
                            <el-form-item style="text-align: center">
                                <el-button type="primary" class="btns" @click="submitForm('ruleForm')"
                                >保存</el-button
                                >
                                <el-button @click="returnIndex">关闭</el-button>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-form>
            </div>
        </div>
        <div v-else>
            <el-table :data="detailTableData" style="width: 100%" >
                <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="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>
                    <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="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="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="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>
                <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>
                    </template>
                </el-table-column>
                <el-table-column prop="DTRisk_bankId" label="是否关联" align="center">
                    <template slot-scope="scope">
                        <span v-if="scope.row.DTRisk_bankId==0 || scope.row.DTRisk_bankId=='' || scope.row.DTRisk_bankId==null">未关联</span>
                        <span v-else>已关联</span>
                    </template>
                </el-table-column>
                <el-table-column prop="DTRisk_level" label="风险等级" align="center"> </el-table-column>
                <el-table-column prop="warningLevel" label="初始警情" align="center"> </el-table-column>
                <el-table-column prop="curWarningLevel" label="当前警情" align="center"> </el-table-column>
            </el-table>
            <!-- <el-row style="margin-bottom: 20px" v-if="addShow">
                <el-col :span="9">
                    <el-button type="primary" class="btns" @click="addDanger">新增隐患</el-button>
                </el-col>
            </el-row> -->
            <el-button style="margin-top: 20px" @click="returnIndex">关闭</el-button>
        </div>
        <el-dialog
            :title="title"
            :visible.sync="dialogVisible"
            :close-on-click-modal="false"
            width="40%">
            <el-form ref="form" :rules="dangerRules" :model="dangerForm" label-width="100px">
                <el-row>
                    <el-col :span="9">
                        <el-form-item label="隐患部门" prop="ht_branch">
                            <el-select v-model="dangerForm.ht_branch" placeholder="请选择">
                                <el-option
                                    v-for="item in YHBMList"
                                    :key="item.branch_id"
                                    :label="item.branch_name"
                                    :value="item.branch_name">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="9" :offset="4">
                        <el-form-item label="地点" prop="address">
                            <el-input v-model="dangerForm.address" rows="3" type="textarea" class="multiline"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-table :data="tableData" style="width: 100%">
                    <el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
                    <!-- <el-table-column prop="ht_branch"  align="center" label="隐患部门"></el-table-column> -->
                    <el-table-column prop="address"  align="center" label="隐患地点"></el-table-column>
                    <el-table-column prop="ht_content"  align="center" label="隐患内容"></el-table-column>
                    <!-- <el-table-column prop="measure"  align="center" label="整改措施"></el-table-column> -->
                    <el-table-column prop="ht_typesub"  align="center" label="隐患类别"></el-table-column>
                    <!-- <el-table-column prop="dangerousSource"  align="center" label="关联危险源"></el-table-column>
                    <el-table-column prop="DTRisk_level"  align="center" label="风险等级"></el-table-column> -->
                    <el-table-column prop="ht_level"  align="center" label="隐患级别"></el-table-column>
                    <!-- <el-table-column prop="alter_time"  align="center" label="限改时间"></el-table-column>
                    <el-table-column prop="duty_officer"  align="center" label="责任人"></el-table-column>
                    <el-table-column prop="alter_status"  align="center" label="整改情况"></el-table-column>
                    <el-table-column prop="Review"  align="center" label="业务科室"></el-table-column> -->
                    <el-table-column prop="time" label="操作" align="center" width="140">
                        <template slot-scope="scope">
                            <div style="display: flex;align-items: center;flex-direction: row;">
                                <el-button
                                    size="mini"
                                    @click="editDanger(scope.row, scope.$index)"
                                >添加
                                </el-button>
                                <el-button
                                    size="mini"
                                    v-if="addShow"
                                    @click="deleteDanger(scope.row, scope.$index)"
                                >删除
                                </el-button>
                            </div>
                        </template>
                    </el-table-column>
                </el-table>
                <el-row>
                    <el-col :span="9">
                        <el-form-item label="隐患内容" prop="ht_content">
                            <el-input v-model="dangerForm.ht_content" rows="3" type="textarea" class="multiline"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="9" :offset="4">
                        <el-form-item label="整改措施" prop="measure">
                            <el-input v-model="dangerForm.measure" rows="3" type="textarea" class="multiline"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="9">
                        <el-form-item label="隐患类别" prop="ht_typesub">
                            <el-select v-model="dangerForm.ht_typesub" placeholder="请选择">
                                <el-option
                                    v-for="item in YHLXList"
                                    :key="item.value"
                                    :label="item.value"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="9" :offset="4">
                        <el-form-item label="关联危险源" prop="DTRisk_bankId">
                            <el-select v-model="dangerForm.DTRisk_bankId" placeholder="请选择" @change="changeWxy" filterable>
                                <el-option
                                    v-for="item in dangerList"
                                    :key="item.id"
                                    :label="item.mriskPoint"
                                    :value="item.id">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
          <el-row style="margin-top: 20px">
            <el-col :span="22">
              <el-form-item style="text-align: center">
                <el-button type="primary" class="btns" @click="submitForm('ruleForm')"
                  >保存</el-button
                >
                <el-button @click="returnIndex">关闭</el-button>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
                <el-row>
                    <el-col :span="9">
                        <el-form-item label="风险等级" prop="DTRisk_level">
                            <el-input v-model="dangerForm.DTRisk_level" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="9" :offset="4">
                        <el-form-item label="隐患级别" prop="ht_level">
                            <el-select v-model="dangerForm.ht_level" placeholder="请选择">
                                <el-option
                                    v-for="item in YHJBList"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="9">
                        <el-form-item label="限改时间" prop="alter_time">
                            <el-date-picker
                                v-model="dangerForm.alter_time"
                                type="date"
                                value-format="yyyy-MM-dd"
                                placeholder="选择日期"
                                style="width: 100%"
                            >
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="9" :offset="4">
                        <el-form-item label="责任人" prop="duty_officer">
                            <el-input v-model="dangerForm.duty_officer"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="9">
                        <el-form-item label="整改情况" prop="alter_status">
                            <el-select v-model="dangerForm.alter_status" placeholder="请选择">
                                <el-option
                                    v-for="item in statusList"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="9" :offset="4">
                        <el-form-item label="业务科室" prop="Review">
                            <el-select v-model="dangerForm.Review" style="width: 100%">
                                <el-option
                                    v-for="item in YWKSList"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row v-if="dangerForm.alter_status=='重复反弹隐患'">
                    <el-col :span="9">
                        <el-form-item label="重复反弹隐患" prop="repeatId">
                            <el-select v-model="dangerForm.repeatId" placeholder="请选择">
                                <el-option
                                    v-for="item in reboundList"
                                    :key="item.id"
                                    :label="item.content"
                                    :value="item.id">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="22">
                        <el-form-item style="text-align: center">
                            <el-button type="primary" class="btns" @click="submitDanger('form')"
                            >保存</el-button
                            >
                            <el-button @click="dialogVisible=false">关闭</el-button>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </el-dialog>
    </div>
      <el-dialog
          :title="title"
          :visible.sync="dialogVisible"
          :close-on-click-modal="false"
          width="40%">
          <el-form ref="form" :rules="dangerRules" :model="dangerForm" label-width="100px">
              <el-row>
                  <el-col :span="9">
                      <el-form-item label="隐患地点" prop="address">
                          <el-input v-model="dangerForm.address" rows="3" type="textarea" class="multiline"></el-input>
                      </el-form-item>
                  </el-col>
                  <el-col :span="9" offset="4">
                      <el-form-item label="隐患内容" prop="ht_content">
                          <el-input v-model="dangerForm.ht_content" rows="3" type="textarea" class="multiline"></el-input>
                      </el-form-item>
                  </el-col>
              </el-row>
              <el-row>
                 <el-col :span="9">
                      <el-form-item label="隐患类别" prop="ht_typesub">
                          <el-select v-model="dangerForm.ht_typesub" placeholder="请选择">
                              <el-option
                                  v-for="item in YHLXList"
                                  :key="item.value"
                                  :label="item.value"
                                  :value="item.value">
                              </el-option>
                          </el-select>
                      </el-form-item>
                  </el-col>
                  <el-col :span="9" :offset="4">
                      <el-form-item label="隐患级别" prop="ht_level">
                          <el-select v-model="dangerForm.ht_level" placeholder="请选择">
                              <el-option
                                  v-for="item in YHJBList"
                                  :key="item.value"
                                  :label="item.label"
                                  :value="item.value">
                              </el-option>
                          </el-select>
                      </el-form-item>
                  </el-col>
              </el-row>
              <el-row>
                  <el-col :span="22">
                      <el-form-item style="text-align: center">
                          <el-button type="primary" class="btns" @click="submitDanger('form')"
                          >保存</el-button
                          >
                          <el-button @click="dialogVisible=false">关闭</el-button>
                      </el-form-item>
                  </el-col>
              </el-row>
          </el-form>
      </el-dialog>
  </div>
</template>
<script>
import Titlename from "../../components/Titlename/index.vue";
import {initJCBM ,initYHLX, initBC ,initJCLB ,initYHBM ,initYHJB,initLlr,initReformStatus,initYwks,initWxy} from "@/api/sgyhpczl/initSelect";
import {saveDanger,initDangerRebound,getDangerInfo,editDanger} from '@/api/sgyhpczl/hiddenDangerRegistration'
import {
    initBC,
    initJCBM,
    initJCLB,
    initLlr,
    initReformStatus,
    initWxy,
    initYHBM,
    initYHJB,
    initYHLX,
    initYwks
} from "@/api/sgyhpczl/initSelect";
import {getPageList,initDangerRebound,saveDanger} from '@/api/sgyhpczl/hiddenDangerRegistration'
import {deepClone} from '@/utils'
export default {
  components: { Titlename },
  name: "hiddenDangerList",
  data() {
    return {
        addShow:true,
        id:'',
        rowIndex:-1,
        dangerList:[],
        dangerForm:{},
        dangerRules:{
            ht_branch: [{ required: true, message: '不能为空', trigger: 'blur' },],
            address: [{ required: true, message: '不能为空', trigger: 'blur' },],
            ht_content: [{ required: true, message: '不能为空', trigger: 'blur' },],
            ht_typesub: [{ required: true, message: '不能为空', trigger: 'blur' },],
            DTRisk_bankId: [{ required: true, message: '不能为空', trigger: 'blur' },],
            ht_level: [{ required: true, message: '不能为空', trigger: 'blur' },],
            alter_time: [{ required: true, message: '不能为空', trigger: 'blur' },],
            alter_status: [{ required: true, message: '不能为空', trigger: 'blur' },],
            Review: [{ required: true, message: '不能为空', trigger: 'blur' },],
            duty_officer:[{ required: true, message: '不能为空', trigger: 'blur' },]
        },
        title:'新增',
        dialogVisible:false,
        BCList:[],
        JCLBList:[],
        JCDWList:[{label:"众泰煤焦化",value:0},{label:"上级单位",value:1}],
        YHBMList:[],
        YHLXList:[],
        YHJBList:[],
        JCBMList:[],
        llrList:[],
        statusList:[],
        YWKSList:[],
        reboundList:[],
      ruleForm: {},
       rules: {
           check_date: [{ required: true, message: '不能为空', trigger: 'blur' },],
           check_class: [{ required: true, message: '不能为空', trigger: 'blur' },],
           check_main_branch: [{ required: true, message: '不能为空', trigger: 'blur' },],
           check_branch: [{ required: true, message: '不能为空', trigger: 'blur' },],
           check_man: [{ required: true, message: '不能为空', trigger: 'blur' },],
           checktype: [{ required: true, message: '不能为空', trigger: 'blur' },],
          },
      tableData: [],
    };
  },
    components: { Titlename },
    name: "hiddenDangerList",
    data() {
        return {
            type: '0',
            id:'',
            rowIndex:-1,
            dangerList:[],
            dangerForm:{},
            dangerRules:{
                ht_branch: [{ required: true, message: '不能为空', trigger: 'blur' },],
                address: [{ required: true, message: '不能为空', trigger: 'blur' },],
                ht_content: [{ required: true, message: '不能为空', trigger: 'blur' },],
                ht_typesub: [{ required: true, message: '不能为空', trigger: 'blur' },],
                measure: [{ required: true, message: '不能为空', trigger: 'blur' },],
                DTRisk_bankId: [{ required: true, message: '不能为空', trigger: 'blur' },],
                ht_level: [{ required: true, message: '不能为空', trigger: 'blur' },],
                alter_time: [{ required: true, message: '不能为空', trigger: 'blur' },],
                alter_status: [{ required: true, message: '不能为空', trigger: 'blur' },],
                Review: [{ required: true, message: '不能为空', trigger: 'blur' },],
                duty_officer:[{ required: true, message: '不能为空', trigger: 'blur' },]
            },
            title:'新增',
            dialogVisible:false,
            BCList:[],
            JCLBList:[],
            JCDWList:[{label:"众泰煤焦化",value:0},{label:"上级单位",value:1}],
            YHBMList:[],
            YHLXList:[],
            YHJBList:[],
            JCBMList:[],
            llrList:[],
            statusList:[],
            YWKSList:[],
            reboundList:[],
            ruleForm: {},
            rules: {
                check_date: [{ required: true, message: '不能为空', trigger: 'blur' },],
                check_class: [{ required: true, message: '不能为空', trigger: 'blur' },],
                check_main_branch: [{ required: true, message: '不能为空', trigger: 'blur' },],
                check_branch: [{ required: true, message: '不能为空', trigger: 'blur' },],
                check_man: [{ required: true, message: '不能为空', trigger: 'blur' },],
                checktype: [{ required: true, message: '不能为空', trigger: 'blur' },],
            },
            tableData: [],
            paramsData: {},//上个页面参数
            listQuery:{
                page:1,
                limit:10,
                form:{},
            },
            currentPage: 1,
            pageSize: 10,
            recordTotal: 0,
            detailTableData:[],//隐患详情列表
            beforeData:{}, //上个页面信息
            beforeFlag:true,//上个页面信息保存标志
        };
    },
    mounted(){
        this.initBC()
        this.initJCLB()
@@ -255,272 +461,305 @@
        this.initYWKS()
        this.initWXY()
        this.initDangerRebound()
        this.id = this.$route.query.id;
        if( this.id!=null &&  this.id!=''){
            this.initInfo();
            this.addShow=false
        this.type = this.$route.query.type;
        if (this.type === '0'){
            this.initInfo(this.$route.query.data);
        }else {
            this.listQuery.form.jyfsId = this.$route.query.data.id
            this.getPageList();
        }
    },
  methods: {
      async initInfo(){
          var res=await getDangerInfo(this.id)
          if (res.data.ok==1){
              this.ruleForm=res.data.data
              this.changeJCDW(res.data.data.check_main_branch)
              var obj=deepClone(res.data.data)
              this.tableData.push(obj)
    methods: {
        initInfo(data){
            this.paramsData = this.$route.query.data;
            this.ruleForm.jyfsId = data.id;
            this.dangerForm.address = data.address;
            this.dangerForm.ht_content = data.ht_content;
            // this.tableData[0] = {
            //     address: data.address,
            //     ht_content: data.ht_content,
            //     ht_level: data.ht_level,
            // };
        },
          }
      },
      initDangerRebound(){
          initDangerRebound().then(res=>{
              if (res.data.ok==1){
                  this.reboundList=res.data.data
              } else{
                  this.$message({type:'error', message:res.data.msg, duration:3000})
              }
          })
      },
      submitDanger(formName){
          this.$refs[formName].validate((valid) => {
              if (valid) {
                  if(this.title=='新增'){
                      this.tableData.push(this.dangerForm)
                  }else {
                      var arr = this.tableData;
                      arr.splice(this.rowIndex, 1, this.dangerForm);
                      this.tableData = arr;
                  }
                  this.dialogVisible=false
              } else {
                  console.log("error submit!!");
                  return false;
              }
          });
      },
      deleteDanger(row, index) {
          this.$confirm('确认删除吗', '提示', {
              confirmButtonText: '确认',
              cancelButtonText: '取消',
              type: 'warning'
          })
              .then(() => {
                  var arr = deepClone(this.tableData);
                  var brr = [];
                  for (var i = 0; i < arr.length; i++) {
                      if (i == index) {
                      } else {
                          brr.push(arr[i]);
                      }
                  }
                  this.tableData = deepClone(brr);
                  //this.tableData.splice(index)
              })
              .catch(error => {
              });
      },
      editDanger(row, index) {
          this.dangerForm = deepClone(row);
          this.rowIndex = index;
          this.dialogVisible = true;
          this.title = '编辑';
      },
      addDanger(){
          this.dangerForm={}
          this.title="新增"
          this.dialogVisible=true
      },
      changeWxy(e){
          for(var i=0;i<this.dangerList.length;i++){
              if(e==this.dangerList[i].id){
                  this.dangerForm.DTRisk_level=this.dangerList[i].mriskLevel
                  this.dangerForm.dangerousSource=this.dangerList[i].mriskPoint
              }
          }
      },
      initWXY(){
          var param={
              page: 1,
              limit: 1000
          }
          initWxy(param).then(res=>{
              if (res.data.ok==1){
                  this.dangerList=res.data.data.items
              } else{
                  this.$message({type:'error', message:res.data.msg, duration:3000})
              }
          })
      },
      initYWKS(){
          initYwks().then(res=>{
              if (res.data.ok==1){
                  this.YWKSList=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})
              }
          })
      },
      initReformStatus(){
          initReformStatus().then(res=>{
              if (res.data.ok==1){
                  this.statusList=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})
              }
          })
      },
      initYHLX(){
          initYHLX().then(res=>{
              if (res.data.ok==1){
                  this.YHLXList=res.data.data
              } else{
                  this.$message({type:'error', message:res.data.msg, duration:3000})
              }
          })
      },
      initYHJB(){
          initYHJB().then(res=>{
              if (res.data.ok==1){
                  this.YHJBList=res.data.data
              } else{
                  this.$message({type:'error', message:res.data.msg, duration:3000})
              }
          })
      },
      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})
              }
          })
      },
      returnIndex(){
          this.$router.push({
              path:"/hiddenDangerRegistration"
          })
      },
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
            if(this.tableData==null || this.tableData.length==0){
                this.$message({type:'error', message:"请添加隐患", duration:2000})
            }
            this.ruleForm.items=this.tableData
            if(this.addShow){
                saveDanger(this.ruleForm).then(res=>{
                    if (res.data.ok==1){
                        this.$message({type:'success', message:"新增成功", duration:3000})
                        this.$router.push({
                            path:"/hiddenDangerRegistration"
                        })
        // async initInfo(){
        //     var res=await getDangerInfo(this.id)
        //     if (res.data.ok==1){
        //         this.ruleForm=res.data.data
        //         this.changeJCDW(res.data.data.check_main_branch)
        //         var obj=deepClone(res.data.data)
        //         this.tableData.push(obj)
        //     }
        // },
        initDangerRebound(){
            initDangerRebound().then(res=>{
                if (res.data.ok==1){
                    this.reboundList=res.data.data
                } else{
                    this.$message({type:'error', message:res.data.msg, duration:3000})
                }
            })
        },
        submitDanger(formName){
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    if(this.title=='新增'){
                        this.beforeFlag = false;
                        this.tableData.push(this.dangerForm)
                        console.log(this.tableData)
                    }else {
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                        var arr = this.tableData;
                        arr.splice(this.rowIndex, 1, this.dangerForm);
                        this.tableData = arr;
                    }
                    this.dialogVisible=false
                } else {
                    console.log("error submit!!");
                    return false;
                }
            });
        },
        getPageList(){
            this.listQuery.page=1
            getPageList(this.listQuery).then(res=>{
                if (res.data.ok==1) {
                    this.detailTableData = res.data.data.items
                    this.recordTotal=res.data.data.total
                }else{
                    this.$message({type:'error', message:res.data.msg, duration:3000})
                }
            })
        },
        deleteDanger(row, index) {
            this.$confirm('确认删除吗', '提示', {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                type: 'warning'
            })
                .then(() => {
                    var arr = deepClone(this.tableData);
                    var brr = [];
                    for (var i = 0; i < arr.length; i++) {
                        if (i == index) {
                        } else {
                            brr.push(arr[i]);
                        }
                    }
                    this.tableData = deepClone(brr);
                    //this.tableData.splice(index)
                })
                .catch(error => {
                });
        },
        editDanger(row, index) {
            this.dangerForm = deepClone(row);
            this.rowIndex = index;
            this.dialogVisible = true;
            this.title = '编辑';
        },
        addDanger(){
            if (!this.beforeFlag){
                this.dangerForm={}
            }
            this.title="新增"
            this.dialogVisible=true
        },
        changeWxy(e){
            for(var i=0;i<this.dangerList.length;i++){
                if(e==this.dangerList[i].id){
                    this.dangerForm.DTRisk_level=this.dangerList[i].mriskLevel
                    this.dangerForm.dangerousSource=this.dangerList[i].mriskPoint
                }
            }
        },
        initWXY(){
            var param={
                page: 1,
                limit: 1000
            }
            initWxy(param).then(res=>{
                if (res.data.ok==1){
                    this.dangerList=res.data.data.items
                } else{
                    this.$message({type:'error', message:res.data.msg, duration:3000})
                }
            })
        },
        initYWKS(){
            initYwks().then(res=>{
                if (res.data.ok==1){
                    this.YWKSList=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})
                }
            })
        },
        initReformStatus(){
            initReformStatus().then(res=>{
                if (res.data.ok==1){
                    this.statusList=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})
                }
            })
        },
        initYHLX(){
            initYHLX().then(res=>{
                if (res.data.ok==1){
                    this.YHLXList=res.data.data
                } else{
                    this.$message({type:'error', message:res.data.msg, duration:3000})
                }
            })
        },
        initYHJB(){
            initYHJB().then(res=>{
                if (res.data.ok==1){
                    this.YHJBList=res.data.data
                } else{
                    this.$message({type:'error', message:res.data.msg, duration:3000})
                }
            })
        },
        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})
                }
            })
        },
        returnIndex(){
            this.$router.push({
                path:"/oneFromanotherN"
            })
        },
        judge(obj){
            console.log(obj)
            if (obj != null || ('ht_branch' in obj) || ('address' in obj) || ('ht_typesub' in obj) || ('dangerousSource' in obj)
                || ('alter_time' in obj) || ('duty_officer' in obj) || ('alter_status' in obj) || ('Review' in obj) || ('DTRisk_bankId' in  obj)){
                return true;
            }else {
                var param=deepClone(this.ruleForm)
                var obj=deepClone(this.tableData[0])
                param.ht_branch=obj.ht_branch
                param.address=obj.address
                param.ht_content=obj.ht_content
                param.measure=obj.measure
                param.ht_typesub=obj.ht_typesub
                param.DTRisk_bankId=obj.DTRisk_bankId
                param.DTRisk_level=obj.mriskLevel
                param.dangerousSource=obj.mriskPoint
                param.ht_level=obj.ht_level
                param.alter_time=obj.alter_time
                param.duty_officer=obj.duty_officer
                param.alter_status=obj.alter_status
                param.Review=obj.Review
                param.repeatId=obj.repeatId
                editDanger(param).then(res=>{
                    if (res.data.ok==1){
                        this.$message({type:'success', message:"编辑成功", duration:3000})
                        this.$router.push({
                            path:"/hiddenDangerRegistration"
                        })
                    }else {
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
                return false;
            }
        },
        submitForm(formName) {
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    this.ruleForm.items=this.tableData
                    // if(this.addShow){
                    console.log(this.ruleForm)
                    saveDanger(this.ruleForm).then(res=>{
                        if (res.data.ok==1){
                            this.$message({type:'success', message:"保存成功", duration:3000})
                            this.$router.push({
                                path:"/oneFromanotherN"
                            })
                        }else {
                            this.$message({type:'error', message:res.data.msg, duration:3000})
                        }
                    })
                    // }else {
                    //     var param=deepClone(this.ruleForm)
                    //     var obj=deepClone(this.tableData[0])
                    //     param.ht_branch=obj.ht_branch
                    //     param.address=obj.address
                    //     param.ht_content=obj.ht_content
                    //     param.measure=obj.measure
                    //     param.ht_typesub=obj.ht_typesub
                    //     param.DTRisk_bankId=obj.DTRisk_bankId
                    //     param.DTRisk_level=obj.mriskLevel
                    //     param.dangerousSource=obj.mriskPoint
                    //     param.ht_level=obj.ht_level
                    //     param.alter_time=obj.alter_time
                    //     param.duty_officer=obj.duty_officer
                    //     param.alter_status=obj.alter_status
                    //     param.Review=obj.Review
                    //     param.repeatId=obj.repeatId
                    //     editDanger(param).then(res=>{
                    //         if (res.data.ok==1){
                    //             this.$message({type:'success', message:"编辑成功", duration:3000})
                    //             this.$router.push({
                    //                 path:"/hiddenDangerRegistration"
                    //             })
                    //         }else {
                    //             this.$message({type:'error', message:res.data.msg, duration:3000})
                    //         }
                    //     })
                    // }
        } else {
          console.log("error submit!!");
          return false;
        }
      });
                } else {
                    console.log("error submit!!");
                    return false;
                }
            });
        },
    },
  },
};
</script>
<style scoped>
.app-container {
  padding: 20px;
  height: 850px;
  overflow-y: auto;
    padding: 20px;
    height: 850px;
    overflow-y: auto;
}
.app-container /deep/ .box {
  padding-top: 0;
    padding-top: 0;
}
/* /deep/ .multiline .el-input__inner {
  height: 62px;
} */
 .btns{
        background-color: #034ea2;
        border: 1px solid #034ea2;
    }
.btns{
    background-color: #034ea2;
    border: 1px solid #034ea2;
}
</style>
src/views/oneFromanotherN/index.vue
@@ -1,28 +1,29 @@
<template>
    <div class="app-container">
            <el-form ref="form" :inline="true" class="inquire" :model="listQuery" label-width="80px">
            <el-form-item label="下发单位">
               <el-select v-model="listQuery.form.ht_typesub" placeholder="请选择">
                    <el-option
                        v-for="item in YHLXList"
                        :key="item.value"
                        :label="item.value"
                        :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form ref="form" :inline="true" class="inquire" :model="listQuery.form" label-width="80px">
            <el-form-item label="隐患单位">
                <el-input v-model="listQuery.form.ht_branch" style="width:202px"></el-input>
                <el-input v-model="listQuery.form.check_main_branch" style="width:202px"></el-input>
<!--                <el-select v-model="listQuery.form.check_main_branch" placeholder="请选择">-->
<!--                    <el-option-->
<!--                        v-for="item in XFDWList"-->
<!--                        :key="item.value"-->
<!--                        :label="item.value"-->
<!--                        :value="item.value">-->
<!--                    </el-option>-->
<!--                </el-select>-->
            </el-form-item>
            <el-form-item label="隐患类别">
                <el-select v-model="listQuery.form.ht_typesub" placeholder="请选择">
            <el-form-item label="检查类别">
                <el-select v-model="listQuery.form.checktype" placeholder="请选择">
                    <el-option
                        v-for="item in YHLXList"
                        v-for="item in JCLBList"
                        :key="item.value"
                        :label="item.value"
                        :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="被检单位">
                <el-input v-model="listQuery.form.ht_community" style="width:202px"></el-input>
            </el-form-item>
            <el-form-item label="隐患级别">
                <el-select v-model="listQuery.form.ht_level" placeholder="请选择">
@@ -34,21 +35,24 @@
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="隐患地点">
                <el-input v-model="listQuery.form.address" style="width:202px" placeholder="请输入内容"></el-input>
            </el-form-item>
               <el-form-item label="检查类别">
            <el-form-item label="隐患类别">
                <el-select v-model="listQuery.form.ht_typesub" placeholder="请选择">
                    <el-option
                        v-for="item in YHLXList"
                        v-for="item in YHLBList"
                        :key="item.value"
                        :label="item.value"
                        :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="隐患地点">
                <el-input v-model="listQuery.form.address" style="width:202px" placeholder="请输入内容"></el-input>
            </el-form-item>
            <el-form-item label="隐患内容">
                <el-input v-model="listQuery.form.ht_content" style="width:202px" placeholder="请输入内容"></el-input>
            </el-form-item>
            <el-form-item label="发送单位" v-if="listQuery.type=='1'">
                <el-input  v-model="listQuery.form.workGroupName" style="width:202px" placeholder="请输入内容"></el-input>
            </el-form-item>
            <el-form-item label="检查时间">
                <el-col :span="11">
@@ -65,93 +69,125 @@
                <el-button type="primary" class="btns" size="small" icon="el-icon-search" @click="getPageList()">查询
                </el-button>
                <el-button type="primary" class="btns" size="small" @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">
            <el-col :span="10">
              <el-radio-group v-model="radio1">
            <el-radio-button label="待发送">待发送</el-radio-button>
            <el-radio-button label="已发送">已发送</el-radio-button>
          </el-radio-group>
          <el-button class="btns" type="primary" size="small" v-if="table1" @click="handoff(1)">进入自查(3)</el-button>
                <el-radio-group v-if="table1" v-model="listQuery.type" @change="typeChange">
                    <el-radio-button label="0">待发送</el-radio-button>
                    <el-radio-button label="1">已发送</el-radio-button>
                </el-radio-group>
                <el-radio-group v-if="table2" v-model="listQuery.sendType" @change="sendTypeChange">
                    <el-radio-button label="0">待自查</el-radio-button>
                    <el-radio-button label="1">已自查</el-radio-button>
                </el-radio-group>
          <el-button class="btns" type="primary" size="small" v-if="table1" @click="handoff(1)">进入自查({{selfTotal}})</el-button>
          <el-button class="btns" type="primary" size="small" v-if="table2" @click="handoff(2)">返回填写</el-button>
            </el-col>
            <div v-if="table1">
            <el-col :span="14" style="text-align:right;" v-if="radio1=='待发送'">
                <el-button class="btns" type="primary" size="small" icon="el-icon-upload2" >发送</el-button>
                <el-button class="btns" type="primary" size="small" icon="el-icon-plus" @click="sendBath()">添加</el-button>
                <el-button size="small" >批量删除</el-button>
            <el-col :span="14" style="text-align:right;" v-if="listQuery.type==0">
                <el-button class="btns" type="primary" size="small" icon="el-icon-upload2" @click="openSend()">发送</el-button>
                <el-button class="btns" type="primary" size="small" icon="el-icon-plus" @click="addDanger()">添加</el-button>
                <el-button size="small" @click="deleteBatch()" >批量删除</el-button>
            </el-col>
             <el-col :span="14" style="text-align:right;" v-if="radio1=='已发送'">
                <el-button class="btns" type="primary" size="small" >收回</el-button>
             <el-col :span="14" style="text-align:right;" v-if="listQuery.type==1">
                <el-button class="btns" type="primary" size="small" @click="tackBack()">收回</el-button>
            </el-col>
            </div>
        </el-row>
        <div v-if="table1">
         <el-table ref="dataTable" v-if="radio1=='待发送'" :data="tableData" style="width: 100%" @selection-change="handleSelectionChange">
            <el-table-column type="selection" width="55" align="center"></el-table-column>
          <el-table-column prop="check_date" label="检查时间" width="120" align="center">
                    <template slot-scope="scope">
                        <label>{{ formatDate(scope.row.check_date)}}</label><br/>
                        <label>{{ scope.row.check_class}}</label>
                    </template>
         <el-table ref="dataTable"
                   v-if="listQuery.type==0"
                   v-loading="loading"
                   :data="tableData"
                   style="width: 100%"
                   @selection-change="handleSelectionChange">
             <el-table-column type="selection" width="55" align="center"></el-table-column>
          <el-table-column prop="check_date" label="检查时间" :formatter="formatColumnDate"  width="120" align="center">
<!--                    <template slot-scope="scope">-->
<!--                        <label>{{ formatDate(scope.row.check_date)}}</label><br/>-->
<!--                        <label>{{ scope.row.check_class}}</label>-->
<!--                    </template>-->
                </el-table-column>
            <el-table-column prop="check_branch" label="检查单位" align="center"></el-table-column>
            <el-table-column prop="check_main_branch" label="检查单位" align="center"></el-table-column>
            <el-table-column prop="checktype" label="检查类别" align="center"></el-table-column>
                <!-- <el-table-column prop="measure" label="被检单位" align="center"></el-table-column> -->
            <el-table-column prop="date" label="隐患类别" align="center"></el-table-column>
            <el-table-column prop="DTRisk_level" label="隐患级别" align="center"></el-table-column>
            <el-table-column prop="warningLevel" label="隐患地点" align="center"></el-table-column>
            <el-table-column prop="curWarningLevel" label="隐患内容" width="200" align="center"></el-table-column>
            <el-table-column prop="ht_typesub" label="隐患类别" align="center"></el-table-column>
            <el-table-column prop="ht_level" label="隐患级别" align="center"></el-table-column>
            <el-table-column prop="address" label="隐患地点" align="center"></el-table-column>
            <el-table-column prop="ht_content" label="隐患内容" width="200" align="center">
                <template slot-scope="scope">
                    <el-popover trigger="hover" placement="top">
                        <p>{{ scope.row.ht_content }}</p>
                        <div slot="reference" class="name-wrapper">{{
                                scope.row.ht_content != null && scope.row.ht_content.length > 10 ? scope.row.ht_content.substring(0, 8) + "...." : scope.row.ht_content
                            }}
                        </div>
                    </el-popover>
                </template>
            </el-table-column>
            <!-- <el-table-column prop="curWarningLevel" label="下发单位" align="center"></el-table-column> -->
            <el-table-column prop="date" label="基本操作" align="center">
                <template slot-scope="scope">
                    <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
                    <el-button @click="handleClick(scope.row)" type="text" size="small">删除</el-button>
                    <el-button @click="editDanger(scope.row)" type="text" size="small">编辑</el-button>
                    <el-button @click="deleteDanger(scope.row)" type="text" size="small">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
            <el-table ref="dataTable" v-if="radio1=='已发送'" :data="tableData" style="width: 100%" @selection-change="handleSelectionChange">
            <el-table ref="dataTable" v-if="listQuery.type==1" :data="tableData" style="width: 100%" @selection-change="handleSelectionChange">
            <el-table-column type="selection" width="55" align="center"></el-table-column>
          <el-table-column prop="check_date" label="检查时间" width="120" align="center">
                    <template slot-scope="scope">
                        <label>{{ formatDate(scope.row.check_date)}}</label><br/>
                        <label>{{ scope.row.check_class}}</label>
                    </template>
          <el-table-column prop="check_date" label="检查时间" :formatter="formatColumnDate" width="120" align="center">
<!--                    <template slot-scope="scope">-->
<!--                        <label>{{ formatDate(scope.row.check_date)}}</label><br/>-->
<!--                        <label>{{ scope.row.check_class}}</label>-->
<!--                    </template>-->
                </el-table-column>
            <el-table-column prop="check_branch" label="检查单位" align="center"></el-table-column>
            <el-table-column prop="check_main_branch" label="检查单位" align="center"></el-table-column>
            <el-table-column prop="checktype" label="检查类别" align="center"></el-table-column>
                <el-table-column prop="measure" label="被检单位" align="center"></el-table-column>
            <el-table-column prop="date" label="隐患类别" align="center"></el-table-column>
            <el-table-column prop="DTRisk_level" label="隐患级别" align="center"></el-table-column>
            <el-table-column prop="warningLevel" label="隐患地点" align="center"></el-table-column>
            <el-table-column prop="curWarningLevel" label="隐患内容" width="200" align="center"></el-table-column>
            <el-table-column prop="curWarningLevel" label="发送单位" align="center"></el-table-column>
            <el-table-column prop="date" label="未自查单位" align="center"></el-table-column>
            <el-table-column prop="ht_community" label="被检单位" align="center"></el-table-column>
            <el-table-column prop="ht_typesub" label="隐患类别" align="center"></el-table-column>
            <el-table-column prop="ht_level" label="隐患级别" align="center"></el-table-column>
            <el-table-column prop="address" label="隐患地点" align="center"></el-table-column>
            <el-table-column prop="ht_content" label="隐患内容" width="200" align="center">
                <template slot-scope="scope">
                    <el-popover trigger="hover" placement="top">
                        <p>{{ scope.row.ht_content }}</p>
                        <div slot="reference" class="name-wrapper">{{
                                scope.row.ht_content != null && scope.row.ht_content.length > 10 ? scope.row.ht_content.substring(0, 8) + "...." : scope.row.ht_content
                            }}
                        </div>
                    </el-popover>
                </template>
            </el-table-column>
            <el-table-column prop="workGroupName" label="发送单位" align="center"></el-table-column>
            <el-table-column prop="state" label="未自查单位" align="center"></el-table-column>
        </el-table>
        </div>
            <el-table ref="dataTable" v-if="table2" :data="tableData" style="width: 100%" @selection-change="handleSelectionChange">
            <el-table
                ref="dataTable"
                v-if="table2"
                :data="tableData" style="width: 100%"
                @selection-change="handleSelectionChange">
            <el-table-column type="selection" width="55" align="center"></el-table-column>
          <el-table-column prop="check_date" label="检查时间" width="120" align="center">
                    <template slot-scope="scope">
                        <label>{{ formatDate(scope.row.check_date)}}</label><br/>
                        <label>{{ scope.row.check_class}}</label>
                    </template>
          <el-table-column prop="check_date" label="检查时间" :formatter="formatColumnDate" width="120" align="center">
<!--                    <template slot-scope="scope">-->
<!--                        <label>{{ formatDate(scope.row.check_date)}}</label><br/>-->
<!--                        <label>{{ scope.row.check_class}}</label>-->
<!--                    </template>-->
                </el-table-column>
            <el-table-column prop="check_branch" label="检查单位" align="center"></el-table-column>
            <el-table-column prop="check_main_branch" label="检查单位" align="center"></el-table-column>
            <el-table-column prop="checktype" label="检查类别" align="center"></el-table-column>
                <el-table-column prop="measure" label="被检单位" align="center"></el-table-column>
            <el-table-column prop="date" label="隐患类别" align="center"></el-table-column>
            <el-table-column prop="DTRisk_level" label="隐患级别" align="center"></el-table-column>
            <el-table-column prop="warningLevel" label="隐患地点" align="center"></el-table-column>
            <el-table-column prop="curWarningLevel" label="内容" width="200" align="center"></el-table-column>
            <el-table-column prop="curWarningLevel" label="发送单位" align="center"></el-table-column>
                <el-table-column prop="ht_community" label="被检单位" align="center"></el-table-column>
            <el-table-column prop="ht_typesub" label="隐患类别" align="center"></el-table-column>
            <el-table-column prop="ht_level" label="隐患级别" align="center"></el-table-column>
            <el-table-column prop="address" label="隐患地点" align="center"></el-table-column>
            <el-table-column prop="ht_content" label="内容" width="200" align="center"></el-table-column>
            <el-table-column prop="workGroupName" label="发送单位" align="center"></el-table-column>
            <el-table-column prop="date" label="自查结果" align="center">
                <template slot-scope="scope">
                    <el-button @click="handleClick(scope.row)" type="text" size="small">不存在</el-button>
                    <el-button @click="handleClick(scope.row)" type="text" size="small">存在</el-button>
                    <el-button @click="handleClick(scope.row,'不存在')" type="text" size="small">不存在</el-button>
                    <el-button @click="handleClick(scope.row)" type="text" v-if="listQuery.sendType=='0'" size="small">存在</el-button>
                    <el-button @click="handleClick(scope.row)" type="text" v-if="listQuery.sendType=='1'" size="small">追查结果</el-button>
                </template>
            </el-table-column>
        </el-table>
@@ -168,44 +204,559 @@
            >
            </el-pagination>
        </div>
        <!-- 编辑弹窗 -->
        <el-dialog
            title="编辑"
            :visible.sync="dialogVisible"
            :close-on-click-modal="false"
            width="40%">
            <el-form ref="form" :rules="dangerRules" :model="dangerForm" label-width="100px">
                <el-row>
                    <el-col :span="9">
                        <el-form-item label="检查时间" prop="check_date">
                            <el-date-picker
                                v-model="dangerForm.check_date"
                                type="date"
                                value-format="yyyy-MM-dd"
                                placeholder="选择日期"
                                style="width: 100%"
                            >
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="9" :offset="4">
                        <el-form-item label="检查类别" prop="checktype">
                            <el-select v-model="dangerForm.checktype" placeholder="请选择">
                                <el-option
                                    v-for="item in JCLBList"
                                    :key="item.value"
                                    :label="item.value"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="9" >
                        <el-form-item label="检查单位" prop="check_main_branch">
                            <el-input v-model="dangerForm.check_main_branch" class="multiline"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="9">
                        <el-form-item label="地点" prop="address">
                            <el-input v-model="dangerForm.address" rows="3" type="textarea" class="multiline"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="9" :offset="4">
                        <el-form-item label="隐患内容" prop="ht_content">
                            <el-input v-model="dangerForm.ht_content" rows="3" type="textarea" class="multiline"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="9" >
                        <el-form-item label="隐患类别" prop="ht_typesub">
                            <el-select v-model="dangerForm.ht_typesub" placeholder="请选择">
                                <el-option
                                    v-for="item in YHLBList"
                                    :key="item.value"
                                    :label="item.value"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="9" :offset="4">
                        <el-form-item label="隐患级别" prop="ht_level">
                            <el-select v-model="dangerForm.ht_level" placeholder="请选择">
                                <el-option
                                    v-for="item in YHJBList"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="22">
                        <el-form-item style="text-align: center">
                            <el-button type="primary" class="btns" @click="submitDanger('form')">保存</el-button>
                            <el-button @click="dialogVisible=false">关闭</el-button>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </el-dialog>
        <!-- 部门弹窗 -->
        <el-dialog
            title="责任单位"
            :visible.sync="bmDialogVisible"
            :close-on-click-modal="false"
            width="40%">
            <el-form>
                <el-row>
                    <el-checkbox style="width: 80px;height: 30px"
                                 v-for="item in YHBMList"
                                 v-model="checked"
                                 :label="item.branch_id"
                                 :key="item.branch_name">
                        {{item.branch_name}}
                    </el-checkbox>
                </el-row>
                <el-row>
                    <el-col :span="22">
                        <el-form-item style="text-align: center;">
                            <el-button class="btn" size="small" type="primary" @click="submitForm()">
                                保存
                            </el-button>
                            <el-button size="small" @click="bmDialogVisible = false">关闭</el-button>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </el-dialog>
        <!-- 不存在弹窗-->
        <el-dialog :title="selfTitle" :visible.sync="selfInspectVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="600px">
            <el-form ref="selfInspectForm" :rules="selfInspectFormRules" :model="selfInspectForm" label-position="right" label-width="80px">
                <el-form-item label="自查人" prop="markUserName">
                    <el-input v-model="selfInspectForm.markUserName" class="analyseUnit_input"></el-input>
                </el-form-item>
                <el-form-item label="自查时间" prop="markDate">
                    <el-col :span="11">
                        <el-date-picker type="date" placeholder="选择日期" v-model="selfInspectForm.markDate"
                                        style="width: 100%;" value-format="yyyy-MM-dd">
                        </el-date-picker>
                    </el-col>
                </el-form-item>
                <el-form-item label="备注" prop="remark">
                    <el-input v-model="selfInspectForm.remark" type="textarea" rows="5" class="analyseUnit_input"></el-input>
                </el-form-item>
            </el-form>
            <div  align="center">
                <el-button type="primary" v-if="listQuery.sendType == '0'" @click="submitSelfInspect()">确认</el-button>
                <el-button @click="selfInspectVisible = false">关闭</el-button>
            </div>
        </el-dialog>
    </div>
</template>
<script>
import { getPageList, edit, del, send, revoke} from "@/api/sgyhpczl/oneFromanotherN"
import {noExistSave,selfCheckNotInfo} from "@/api/sgyhpczl/oneFromanother"
import {initJCBM, initYHLX, initJCLB, initYHJB,initYHBM} from "@/api/sgyhpczl/initSelect";
import {deepClone} from '@/utils'
    export default{
        data(){
            return{
                listQuery:{
                    form:{}
                    page:1,
                    limit:10,
                    type: 0,
                    sendType: 0,
                    form:{},
                },
                selfTotal: 0,
                radio1:'待发送',
                table1:true,
                table2:false
                table2:false,
                currentPage: 1,
                pageSize: 10,
                recordTotal: 0,
                YHBMList: [],
                bmDialogVisible: false,
                checked:[],
                requestData:{},//发送提交参数
                XFDWList:[],
                YHLBList:[],
                YHJBList:[],
                JCLBList:[],
                tableData:[],
                selectedList:[],
                loading:false,
                listLoading: false,
                selfInspectVisible: false,
                selfInspectForm:{
                    id: '',
                    markUserName:'',
                    markDate:'',
                    remark:'',
                },
                selfTitle: '',
                selfInspectFormRules:{
                    markUserName: [{ required: true, message: '自查人不能为空', trigger: 'blur' }],
                    markDate: [{ required: true, message: '自查时间不能为空', trigger: 'blur' }]
                },
                dialogVisible:false,
                dangerForm:{},
                dangerRules:{
                    check_date: [{ required: true, message: '不能为空', trigger: 'blur' },],
                    check_main_branch: [{ required: true, message: '不能为空', trigger: 'blur' },],
                    checktype: [{ required: true, message: '不能为空', trigger: 'blur' },],
                },
            }
        },
        mounted() {
            this.getPageList();
            this.getSelfTotal();
            this.initYHBM();
            this.initJCLB();
            this.initXFDW();
            this.initYHJB();
            this.initYHLB();
        },
        methods:{
            sendBath(){
            addDanger(){
                this.$router.push({
                    path:'/existN'
                    path:'/addDanger',
                })
            },
            handleClick(data,val){
                if(val=='存在'){
                    this.$router.push({
                        path:'/exist'
                if(val=='不存在'){
                    this.$nextTick(() =>{
                        this.$refs["selfInspectForm"].clearValidate()
                    })
                    this.selfInspectForm={id:data.id}
                    this.selfInspectVisible = true
                    if (this.listQuery.sendType == '1'){
                        let params = {
                            id: data.id,
                            type: 1,
                        }
                        selfCheckNotInfo(params).then(res=>{
                            if (res.data.ok==1){
                                this.selfInspectForm=res.data.data[0]
                            } else{
                                this.$message({type:'error', message:res.data.msg, duration:3000})
                            }
                        })
                    }
                    return
                }
                let puType = '0';
                this.$router.push({
                    path:'/existN',
                    query: {
                        data: data,
                        type: puType
                    }
                })
            },
            //不存在提交
            submitSelfInspect(){
                this.$refs["selfInspectForm"].validate((valid) =>{
                    if (valid){
                        noExistSave(this.selfInspectForm).then((res)=>{
                            if (res.data.ok==1) {
                                this.$message({type:'success', message:"保存成功", duration:3000});
                                this.selfInspectVisible = false
                            }else{
                                this.$message({type:'error', message:res.data.msg, duration:3000})
                            }
                        })
                    }
                })
            },
            handoff(index){
                if(index==1){
                    this.table1=false
                    this.table2=true
                    this.listQuery.type = 2
                    this.listQuery.sendType = 0
                    this.getPageList()
                }else{
                    this.listQuery.type = 0
                    this.getPageList()
                    this.getSelfTotal();
                    this.table1=true
                    this.table2=false
                }
            },
            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})
                    }
                })
            },
            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().then(res=>{
                    if (res.data.ok==1){
                        this.YHLBList=res.data.data
                    } else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            },
            initYHJB(){
                initYHJB().then(res=>{
                    if (res.data.ok==1){
                        this.YHJBList=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})
                    }
                })
            },
            checkTime(){
                if(this.listQuery.form.check_dateStart!=null && this.listQuery.form.check_dateStart!=''){
                    if(this.listQuery.form.check_dateEnd!=null && this.listQuery.form.check_dateEnd!=''){
                    }else {
                        this.$message({type:'error', message:"请选择检查结束时间", duration:3000})
                        return
                    }
                }
            },
            //搜索
            getPageList(){
                this.listQuery.page=1
                this.checkTime()
                this.loading=true
                getPageList(this.listQuery).then(res=>{
                    this.loading=false
                    if (res.data.ok==1) {
                        this.tableData = res.data.data.items
                        this.recordTotal=res.data.data.total
                    }else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            },
            //获取待自查数量
            getSelfTotal(){
                if (this.listQuery.type != '2'){
                    let query = {
                        page: 1,
                        sendType: 0,
                        type: 2,
                        form:{},
                    };
                    getPageList(query).then(res=>{
                        if (res.data.ok==1) {
                            this.selfTotal=res.data.data.total
                        }else{
                            this.$message({type:'error', message:res.data.msg, duration:3000})
                        }
                    })
                }
            },
            //重置
            reset(){
                this.listQuery.form={};
                this.getPageList()
            },
            handleSizeChange(val){
                this.listQuery.limit = val
                this.getPageListForPagination();
            },
            handleCurrentChange(val){
                this.listQuery.page = val
                this.getPageListForPagination();
            },
            getPageListForPagination(){
                this.checkTime()
                getPageList(this.listQuery).then(res=>{
                    if (res.data.ok==1) {
                        this.tableData = res.data.data.items
                        this.recordTotal=res.data.data.total
                    }else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            },
            typeChange(val){
                this.listQuery.type = val;
                this.getPageList()
            },
            sendTypeChange(val){
                this.listQuery.sendType = val;
                this.getPageList()
            },
            handleSelectionChange(val){
                this.selectedList = []
                val.forEach((item) => {
                    this.selectedList.push(item)
                })
            },
            //日期格式转换
            formatColumnDate(row, column) {
                // 获取单元格数据
                let data = row[column.property]
                if (data == null) {
                    return null
                }
                let dt = new Date(data)
                return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + ' '
            },
            editDanger(row, index) {
                this.dangerForm = deepClone(row);
                this.rowIndex = index;
                this.dialogVisible = true;
            },
            //编辑提交
            submitDanger(formName){
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        edit(this.dangerForm).then(res=>{
                            if (res.data.ok==1) {
                                this.dialogVisible=false
                                this.$message({type:'success', message:res.data.msg, duration:3000})
                                this.getPageList()
                            }else{
                                this.$message({type:'error', message:res.data.msg, duration:3000})
                            }
                        })
                    } else {
                        console.log("error submit!!");
                        return false;
                    }
                });
            },
            deleteBatch() {
                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(",")
                this.$confirm('确认删除吗', '提示', {
                    confirmButtonText: '确认',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                        del(ids).then(() => {
                            this.getPageList()
                            this.$notify({
                                title: "成功",
                                message: "删除成功",
                                type: "success",
                                duration: 2000,
                            });
                        });
                    })
                    .catch(error => {
                    });
            },
            deleteDanger(row) {
                this.$confirm('确认删除吗', '提示', {
                    confirmButtonText: '确认',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    console.log(row.id)
                        del(row.id).then(() => {
                            this.getPageList()
                            this.$notify({
                                title: "成功",
                                message: "删除成功",
                                type: "success",
                                duration: 2000,
                            });
                        });
                    }).catch(error => {
                });
            },
            //发送提交
            submitForm() {
                if (this.checked.length == 0) {
                    this.$message({
                        type: 'warning',
                        message: '请勾选需要发送的部门!'
                    });
                    return;
                }
                this.requestData.branchIds = this.checked.join(";");
                send(this.requestData).then(res => {
                    if (res.data.ok) {
                        this.$message({
                            type: 'success',
                            message: res.data.msg
                        });
                        this.bmDialogVisible = false;
                        this.getPageList();
                    } else {
                        this.$message({
                            type: 'error',
                            message: res.data.msg
                        });
                    }
                })
            },
            openSend() {
                if (this.selectedList.length != 1) {
                    this.$message({
                        type: 'warning',
                        message: '请选择一条数据!'
                    });
                    return false;
                } else {
                    this.requestData.id = this.selectedList[0].id;
                    this.bmDialogVisible = true;
                }
            },
            tackBack(){
                if (this.selectedList.length != 1) {
                    this.$message({
                        type: 'warning',
                        message: '请选择一条数据!'
                    });
                    return false;
                }else {
                    this.$confirm('确认收回吗', '提示', {
                        confirmButtonText: '确认',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(() => {
                        let data = {
                            id: this.selectedList[0].id
                        }
                        revoke(data).then(() => {
                            this.getPageList()
                            this.$notify({
                                title: "成功",
                                message: "收回成功",
                                type: "success",
                                duration: 2000,
                            });
                        });
                    }).catch(error => {
                    });
                }
            }
        }
    }
</script>
@@ -240,4 +791,4 @@
    background-color: #034ea2;
    background-color: #034ea2;
}
</style>
</style>
src/views/safetyHazardAccount/Dualbase.vue
对比新文件
@@ -0,0 +1,760 @@
<template>
  <div class="app-container">
    <div style="">
      <Titlename title="双基考核"></Titlename>
      <div class="whole-form">
        <el-form
          :model="ruleForm"
          :rules="rules"
          ref="ruleForm"
          label-width="150px"
          class="demo-ruleForm"
          style="margin: 0 10% 0 10%"
        >
          <el-row>
            <el-col :span="9">
              <el-form-item label="年月" prop="check_date">
                <el-date-picker
                  v-model="ruleForm.check_date"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="选择日期"
                  style="width: 100%"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="9" :offset="3">
              <el-form-item label="考核对象" prop="check_class">
                <el-select
                  v-model="ruleForm.check_class"
                  placeholder="请选择"
                  style="width: 100%"
                >
                  <el-option
                    v-for="item in BCList"
                    :key="item.value"
                    :label="item.value"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="3">
              <span
                style="
                  font-size: 14px;
                  text-align: center;
                  padding: 0px 8px;
                  line-height: 36px;
                "
                >查看双击考核标准</span
              >
            </el-col>
          </el-row>
          <!-- <el-row>
            <el-col :span="9">
              <el-form-item label="检查类别" prop="checktype">
                  <el-select v-model="ruleForm.checktype" placeholder="请选择"  style="width: 100%">
                      <el-option
                          v-for="item in JCLBList"
                          :key="item.value"
                          :label="item.value"
                          :value="item.value">
                      </el-option>
                  </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="9" :offset="4">
              <el-form-item label="检查单位" prop="check_main_branch">
                  <el-select v-model="ruleForm.check_main_branch" placeholder="请选择"  @change="changeJCDW"  style="width: 100%">
                      <el-option
                          v-for="item in JCDWList"
                          :key="item.label"
                          :label="item.label"
                          :value="item.label"
                      >
                      </el-option>
                  </el-select>
              </el-form-item>
            </el-col>
          </el-row>
            <el-row>
                <el-col :span="9">
                    <el-form-item label="深入现场情况" prop="check_branch">
                        <el-select v-model="ruleForm.check_branch" placeholder="请选择" style="width: 100%">
                            <el-option
                                v-for="item in JCBMList"
                                :key="item.value"
                                :label="item.value"
                                :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="9" :offset="4">
                <el-form-item label="深入现场人员" prop="check_man">
                <el-input v-model="ruleForm.check_man"></el-input>
              </el-form-item>
                </el-col>
            </el-row> -->
          <el-row>
            <el-col :span="9">
              <el-form-item label="扣分" prop="check_man">
                <el-input v-model="ruleForm.check_man"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="21">
              <el-form-item label="双击考核标准">
                <el-input
                  v-model="ruleForm.route"
                  rows="3"
                  type="textarea"
                  class="multiline"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="21">
              <el-form-item label="扣分原因">
                <el-input
                  v-model="ruleForm.route"
                  rows="3"
                  type="textarea"
                  class="multiline"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="title-center" style="margin-bottom: 20px" v-if="addShow">
            <el-col :span="14">
              <el-radio-group v-model="radio1">
                <el-radio-button label="2022年06月">2022年06月</el-radio-button>
                <el-radio-button label="2022年05月">2022年05月</el-radio-button>
                <el-radio-button label="2022年04月">2022年04月</el-radio-button>
                <el-radio-button label="2022年03月">2022年03月</el-radio-button>
                <el-radio-button label="2022年02月">2022年02月</el-radio-button>
                <el-radio-button label="2022年01月">2022年01月</el-radio-button>
              </el-radio-group>
            </el-col>
            <el-col :span="6">
                <el-row>
                    <el-col :span="6"><span style="font-size:14px;font-weight: bold;line-height:36px;color:#606266;">请选择年月</span></el-col>
                     <el-col :span="18">
                  <el-date-picker
                  v-model="ruleForm.check_date"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="选择日期"
                  style="width: 100%"
                >
                </el-date-picker>
              </el-col>
                </el-row>
            </el-col>
            <el-col :span="4" style="text-align:right">
              <el-button type="primary" class="btns" size="small" @click="addDanger"
                >编辑</el-button
              >
               <el-button type="primary" class="btns" size="small" @click="jump()"
                >本单位结果</el-button
              >
            </el-col>
          </el-row>
          <el-row>
            <el-table :data="tableData" style="width: 100%">
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              ></el-table-column>
              <!-- <el-table-column prop="ht_branch"  align="center" label="隐患部门"></el-table-column> -->
              <el-table-column
                prop="address"
                align="center"
                label="考核对象"
              ></el-table-column>
              <el-table-column
                prop="ht_content"
                align="center"
                label="双击考核标准"
              ></el-table-column>
              <el-table-column
                prop="measure"
                align="center"
                label="扣分"
              ></el-table-column>
              <el-table-column
                prop="ht_typesub"
                align="center"
                label="扣分原因"
              ></el-table-column>
              <el-table-column
                prop="dangerousSource"
                align="center"
                label="创建日期"
              ></el-table-column>
              <el-table-column prop="time" label="操作" align="center" width="140">
                        <template slot-scope="scope">
                            <div style="display: flex;align-items: center;flex-direction: row;">
                                <el-button
                                    size="mini"
                                    @click="editDanger(scope.row, scope.$index)"
                                >编辑
                                </el-button>
                                <el-button
                                    size="mini"
                                    v-if="addShow"
                                    @click="deleteDanger(scope.row, scope.$index)"
                                >删除
                                </el-button>
                            </div>
                        </template>
                    </el-table-column>
            </el-table>
          </el-row>
          <el-row style="margin-top: 20px">
            <el-col :span="22">
              <el-form-item style="text-align: center">
                <el-button
                  type="primary"
                  class="btns"
                  @click="submitForm('ruleForm')"
                  >保存</el-button
                >
                <el-button @click="returnIndex">关闭</el-button>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
    </div>
    <el-dialog
      :title="title"
      :visible.sync="dialogVisible"
      :close-on-click-modal="false"
      width="40%"
    >
      <el-form
        ref="form"
        :rules="dangerRules"
        :model="dangerForm"
        label-width="110px"
      >
        <el-row>
          <el-col :span="9">
            <el-form-item label="考核对象" prop="ht_typesub">
                <el-input v-model="dangerForm.duty_officer"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="9" :offset="4">
            <el-form-item label="扣分" prop="DTRisk_bankId">
             <el-input v-model="dangerForm.duty_officer"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="9">
            <el-form-item label="创建日期" prop="alter_time">
              <el-date-picker
                v-model="dangerForm.alter_time"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择日期"
                style="width: 100%"
              >
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="9" :offset="4">
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="9">
            <el-form-item label="双基考核标准" prop="ht_content">
              <el-input
                v-model="dangerForm.ht_content"
                rows="3"
                type="textarea"
                class="multiline"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="9" :offset="4">
            <el-form-item label="扣分原因" prop="measure">
              <el-input
                v-model="dangerForm.measure"
                rows="3"
                type="textarea"
                class="multiline"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="22">
            <el-form-item style="text-align: center">
              <el-button
                type="primary"
                class="btns"
                @click="submitDanger('form')"
                >保存</el-button
              >
              <el-button @click="dialogVisible = false">关闭</el-button>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </el-dialog>
  </div>
</template>
<script>
import Titlename from "../../components/Titlename/index.vue";
import {
  initJCBM,
  initYHLX,
  initBC,
  initJCLB,
  initYHBM,
  initYHJB,
  initLlr,
  initReformStatus,
  initYwks,
  initWxy,
} from "@/api/sgyhpczl/initSelect";
import {
  saveDanger,
  initDangerRebound,
  getDangerInfo,
  editDanger,
} from "@/api/sgyhpczl/hiddenDangerRegistration";
import { deepClone } from "@/utils";
export default {
  components: { Titlename },
  name: "hiddenDangerList",
  data() {
    return {
        radio1:"2022年06月",
      addShow: true,
      id: "",
      rowIndex: -1,
      dangerList: [],
      dangerForm: {},
      dangerRules: {
        ht_branch: [{ required: true, message: "不能为空", trigger: "blur" }],
        address: [{ required: true, message: "不能为空", trigger: "blur" }],
        ht_content: [{ required: true, message: "不能为空", trigger: "blur" }],
        ht_typesub: [{ required: true, message: "不能为空", trigger: "blur" }],
        DTRisk_bankId: [
          { required: true, message: "不能为空", trigger: "blur" },
        ],
        ht_level: [{ required: true, message: "不能为空", trigger: "blur" }],
        alter_time: [{ required: true, message: "不能为空", trigger: "blur" }],
        alter_status: [
          { required: true, message: "不能为空", trigger: "blur" },
        ],
        Review: [{ required: true, message: "不能为空", trigger: "blur" }],
        duty_officer: [
          { required: true, message: "不能为空", trigger: "blur" },
        ],
      },
      title: "新增",
      dialogVisible: false,
      BCList: [],
      JCLBList: [],
      JCDWList: [
        { label: "众泰煤焦化", value: 0 },
        { label: "上级单位", value: 1 },
      ],
      YHBMList: [],
      YHLXList: [],
      YHJBList: [],
      JCBMList: [],
      llrList: [],
      statusList: [],
      YWKSList: [],
      reboundList: [],
      ruleForm: {},
      rules: {
        check_date: [{ required: true, message: "不能为空", trigger: "blur" }],
        check_class: [{ required: true, message: "不能为空", trigger: "blur" }],
        check_main_branch: [
          { required: true, message: "不能为空", trigger: "blur" },
        ],
        check_branch: [
          { required: true, message: "不能为空", trigger: "blur" },
        ],
        check_man: [{ required: true, message: "不能为空", trigger: "blur" }],
        checktype: [{ required: true, message: "不能为空", trigger: "blur" }],
      },
      tableData: [],
    };
  },
  mounted() {
    this.initBC();
    this.initJCLB();
    this.initYHJB();
    this.initYHLX();
    //this.initLlr()
    this.initReformStatus();
    this.initYHBM();
    this.initYWKS();
    this.initWXY();
    this.initDangerRebound();
    this.id = this.$route.query.id;
    if (this.id != null && this.id != "") {
      this.initInfo();
      this.addShow = false;
    }
  },
  methods: {
    async initInfo() {
      var res = await getDangerInfo(this.id);
      if (res.data.ok == 1) {
        this.ruleForm = res.data.data;
        this.changeJCDW(res.data.data.check_main_branch);
        var obj = deepClone(res.data.data);
        this.tableData.push(obj);
      }
    },
    initDangerRebound() {
      initDangerRebound().then((res) => {
        if (res.data.ok == 1) {
          this.reboundList = res.data.data;
        } else {
          this.$message({
            type: "error",
            message: res.data.msg,
            duration: 3000,
          });
        }
      });
    },
    submitDanger(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          if (this.title == "新增") {
            this.tableData.push(this.dangerForm);
          } else {
            var arr = this.tableData;
            arr.splice(this.rowIndex, 1, this.dangerForm);
            this.tableData = arr;
          }
          this.dialogVisible = false;
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    deleteDanger(row, index) {
      this.$confirm("确认删除吗", "提示", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          var arr = deepClone(this.tableData);
          var brr = [];
          for (var i = 0; i < arr.length; i++) {
            if (i == index) {
            } else {
              brr.push(arr[i]);
            }
          }
          this.tableData = deepClone(brr);
          //this.tableData.splice(index)
        })
        .catch((error) => {});
    },
    editDanger(row, index) {
      this.dangerForm = deepClone(row);
      this.rowIndex = index;
      this.dialogVisible = true;
      this.title = "编辑";
    },
    addDanger() {
      this.dangerForm = {};
      this.title = "新增";
      this.dialogVisible = true;
    },
    changeWxy(e) {
      for (var i = 0; i < this.dangerList.length; i++) {
        if (e == this.dangerList[i].id) {
          this.dangerForm.DTRisk_level = this.dangerList[i].mriskLevel;
          this.dangerForm.dangerousSource = this.dangerList[i].mriskPoint;
        }
      }
    },
    initWXY() {
      var param = {
        page: 1,
        limit: 1000,
      };
      initWxy(param).then((res) => {
        if (res.data.ok == 1) {
          this.dangerList = res.data.data.items;
        } else {
          this.$message({
            type: "error",
            message: res.data.msg,
            duration: 3000,
          });
        }
      });
    },
    initYWKS() {
      initYwks().then((res) => {
        if (res.data.ok == 1) {
          this.YWKSList = 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,
          });
        }
      });
    },
    initReformStatus() {
      initReformStatus().then((res) => {
        if (res.data.ok == 1) {
          this.statusList = 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,
          });
        }
      });
    },
    initYHLX() {
      initYHLX().then((res) => {
        if (res.data.ok == 1) {
          this.YHLXList = res.data.data;
        } else {
          this.$message({
            type: "error",
            message: res.data.msg,
            duration: 3000,
          });
        }
      });
    },
    initYHJB() {
      initYHJB().then((res) => {
        if (res.data.ok == 1) {
          this.YHJBList = res.data.data;
        } else {
          this.$message({
            type: "error",
            message: res.data.msg,
            duration: 3000,
          });
        }
      });
    },
    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,
          });
        }
      });
    },
    returnIndex() {
      this.$router.push({
        path: "/hiddenDangerRegistration",
      });
    },
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          if (this.tableData == null || this.tableData.length == 0) {
            this.$message({
              type: "error",
              message: "请添加隐患",
              duration: 2000,
            });
          }
          this.ruleForm.items = this.tableData;
          if (this.addShow) {
            saveDanger(this.ruleForm).then((res) => {
              if (res.data.ok == 1) {
                this.$message({
                  type: "success",
                  message: "新增成功",
                  duration: 3000,
                });
                this.$router.push({
                  path: "/hiddenDangerRegistration",
                });
              } else {
                this.$message({
                  type: "error",
                  message: res.data.msg,
                  duration: 3000,
                });
              }
            });
          } else {
            var param = deepClone(this.ruleForm);
            var obj = deepClone(this.tableData[0]);
            param.ht_branch = obj.ht_branch;
            param.address = obj.address;
            param.ht_content = obj.ht_content;
            param.measure = obj.measure;
            param.ht_typesub = obj.ht_typesub;
            param.DTRisk_bankId = obj.DTRisk_bankId;
            param.DTRisk_level = obj.mriskLevel;
            param.dangerousSource = obj.mriskPoint;
            param.ht_level = obj.ht_level;
            param.alter_time = obj.alter_time;
            param.duty_officer = obj.duty_officer;
            param.alter_status = obj.alter_status;
            param.Review = obj.Review;
            param.repeatId = obj.repeatId;
            editDanger(param).then((res) => {
              if (res.data.ok == 1) {
                this.$message({
                  type: "success",
                  message: "编辑成功",
                  duration: 3000,
                });
                this.$router.push({
                  path: "/hiddenDangerRegistration",
                });
              } else {
                this.$message({
                  type: "error",
                  message: res.data.msg,
                  duration: 3000,
                });
              }
            });
          }
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    jump(){
      this.$router.push({
        path:"/DualbaseLost"
      })
    }
  },
};
</script>
<style scoped>
.app-container {
  padding: 20px;
  height: 850px;
  overflow-y: auto;
}
.app-container /deep/ .box {
  padding-top: 0;
}
/* /deep/ .multiline .el-input__inner {
  height: 62px;
} */
.btns {
  background-color: #034ea2;
  border: 1px solid #034ea2;
}
  .title-center /deep/ .el-radio-button:first-child .el-radio-button__inner {
    border: none;
}
.title-center /deep/ .el-radio-button__inner {
    border: none;
    border-radius: 0px;
}
.title-center /deep/ .el-radio-button__orig-radio:checked + .el-radio-button__inner {
    background-color: #034ea2;
    background-color: #034ea2;
}
.title-center /deep/ .el-radio-button--medium .el-radio-button__inner {
    padding: 11px 20px;
}
</style>
src/views/safetyHazardAccount/DualbaseLost.vue
对比新文件
@@ -0,0 +1,554 @@
<template>
  <div class="app-container">
    <div style="">
      <Titlename title="双基考核"></Titlename>
      <div class="whole-form">
        <el-form
          :model="ruleForm"
          :rules="rules"
          ref="ruleForm"
          label-width="150px"
          class="demo-ruleForm"
          style="margin: 0 10% 0 10%"
        >
          <el-row class="title-center" style="margin-bottom: 20px" v-if="addShow">
            <el-col :span="14">
              <el-radio-group v-model="radio1">
                <el-radio-button label="2022年06月">2022年06月</el-radio-button>
                <el-radio-button label="2022年05月">2022年05月</el-radio-button>
                <el-radio-button label="2022年04月">2022年04月</el-radio-button>
                <el-radio-button label="2022年03月">2022年03月</el-radio-button>
                <el-radio-button label="2022年02月">2022年02月</el-radio-button>
                <el-radio-button label="2022年01月">2022年01月</el-radio-button>
              </el-radio-group>
            </el-col>
            <el-col :span="6">
                <el-row>
                    <el-col :span="6"><span style="font-size:14px;font-weight: bold;line-height:36px;color:#606266;">请选择年月</span></el-col>
                     <el-col :span="18">
                  <el-date-picker
                  v-model="ruleForm.check_date"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="选择日期"
                  style="width: 100%"
                >
                </el-date-picker>
              </el-col>
                </el-row>
            </el-col>
            <!-- <el-col :span="4" style="text-align:right">
              <el-button type="primary" class="btns" size="small" @click="addDanger"
                >编辑</el-button
              >
               <el-button type="primary" class="btns" size="small" @click="addDanger"
                >本单位结果</el-button
              >
            </el-col> -->
          </el-row>
          <el-row>
            <el-table :data="tableData" style="width: 100%">
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              ></el-table-column>
              <!-- <el-table-column prop="ht_branch"  align="center" label="隐患部门"></el-table-column> -->
              <el-table-column
                prop="address"
                align="center"
                label="考核对象"
              ></el-table-column>
              <el-table-column
                prop="ht_content"
                align="center"
                label="双击考核标准"
              ></el-table-column>
              <el-table-column
                prop="measure"
                align="center"
                label="扣分"
              ></el-table-column>
              <el-table-column
                prop="ht_typesub"
                align="center"
                label="扣分原因"
              ></el-table-column>
              <el-table-column
                prop="dangerousSource"
                align="center"
                label="创建日期"
              ></el-table-column>
              <el-table-column prop="time" label="操作" align="center" width="140">
                        <template slot-scope="scope">
                            <div style="display: flex;align-items: center;flex-direction: row;">
                                <el-button
                                    size="mini"
                                    @click="editDanger(scope.row, scope.$index)"
                                >编辑
                                </el-button>
                                <el-button
                                    size="mini"
                                    v-if="addShow"
                                    @click="deleteDanger(scope.row, scope.$index)"
                                >删除
                                </el-button>
                            </div>
                        </template>
                    </el-table-column>
            </el-table>
          </el-row>
          <!-- <el-row style="margin-top: 20px">
            <el-col :span="22">
              <el-form-item style="text-align: center">
                <el-button
                  type="primary"
                  class="btns"
                  @click="submitForm('ruleForm')"
                  >保存</el-button
                >
                <el-button @click="returnIndex">关闭</el-button>
              </el-form-item>
            </el-col>
          </el-row> -->
        </el-form>
      </div>
    </div>
  </div>
</template>
<script>
import Titlename from "../../components/Titlename/index.vue";
import {
  initJCBM,
  initYHLX,
  initBC,
  initJCLB,
  initYHBM,
  initYHJB,
  initLlr,
  initReformStatus,
  initYwks,
  initWxy,
} from "@/api/sgyhpczl/initSelect";
import {
  saveDanger,
  initDangerRebound,
  getDangerInfo,
  editDanger,
} from "@/api/sgyhpczl/hiddenDangerRegistration";
import { deepClone } from "@/utils";
export default {
  components: { Titlename },
  name: "hiddenDangerList",
  data() {
    return {
        radio1:"2022年06月",
      addShow: true,
      id: "",
      rowIndex: -1,
      dangerList: [],
      dangerForm: {},
      dangerRules: {
        ht_branch: [{ required: true, message: "不能为空", trigger: "blur" }],
        address: [{ required: true, message: "不能为空", trigger: "blur" }],
        ht_content: [{ required: true, message: "不能为空", trigger: "blur" }],
        ht_typesub: [{ required: true, message: "不能为空", trigger: "blur" }],
        DTRisk_bankId: [
          { required: true, message: "不能为空", trigger: "blur" },
        ],
        ht_level: [{ required: true, message: "不能为空", trigger: "blur" }],
        alter_time: [{ required: true, message: "不能为空", trigger: "blur" }],
        alter_status: [
          { required: true, message: "不能为空", trigger: "blur" },
        ],
        Review: [{ required: true, message: "不能为空", trigger: "blur" }],
        duty_officer: [
          { required: true, message: "不能为空", trigger: "blur" },
        ],
      },
      title: "新增",
      dialogVisible: false,
      BCList: [],
      JCLBList: [],
      JCDWList: [
        { label: "众泰煤焦化", value: 0 },
        { label: "上级单位", value: 1 },
      ],
      YHBMList: [],
      YHLXList: [],
      YHJBList: [],
      JCBMList: [],
      llrList: [],
      statusList: [],
      YWKSList: [],
      reboundList: [],
      ruleForm: {},
      rules: {
        check_date: [{ required: true, message: "不能为空", trigger: "blur" }],
        check_class: [{ required: true, message: "不能为空", trigger: "blur" }],
        check_main_branch: [
          { required: true, message: "不能为空", trigger: "blur" },
        ],
        check_branch: [
          { required: true, message: "不能为空", trigger: "blur" },
        ],
        check_man: [{ required: true, message: "不能为空", trigger: "blur" }],
        checktype: [{ required: true, message: "不能为空", trigger: "blur" }],
      },
      tableData: [],
    };
  },
  mounted() {
    this.initBC();
    this.initJCLB();
    this.initYHJB();
    this.initYHLX();
    //this.initLlr()
    this.initReformStatus();
    this.initYHBM();
    this.initYWKS();
    this.initWXY();
    this.initDangerRebound();
    this.id = this.$route.query.id;
    if (this.id != null && this.id != "") {
      this.initInfo();
      this.addShow = false;
    }
  },
  methods: {
    async initInfo() {
      var res = await getDangerInfo(this.id);
      if (res.data.ok == 1) {
        this.ruleForm = res.data.data;
        this.changeJCDW(res.data.data.check_main_branch);
        var obj = deepClone(res.data.data);
        this.tableData.push(obj);
      }
    },
    initDangerRebound() {
      initDangerRebound().then((res) => {
        if (res.data.ok == 1) {
          this.reboundList = res.data.data;
        } else {
          this.$message({
            type: "error",
            message: res.data.msg,
            duration: 3000,
          });
        }
      });
    },
    submitDanger(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          if (this.title == "新增") {
            this.tableData.push(this.dangerForm);
          } else {
            var arr = this.tableData;
            arr.splice(this.rowIndex, 1, this.dangerForm);
            this.tableData = arr;
          }
          this.dialogVisible = false;
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    deleteDanger(row, index) {
      this.$confirm("确认删除吗", "提示", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          var arr = deepClone(this.tableData);
          var brr = [];
          for (var i = 0; i < arr.length; i++) {
            if (i == index) {
            } else {
              brr.push(arr[i]);
            }
          }
          this.tableData = deepClone(brr);
          //this.tableData.splice(index)
        })
        .catch((error) => {});
    },
    editDanger(row, index) {
      this.dangerForm = deepClone(row);
      this.rowIndex = index;
      this.dialogVisible = true;
      this.title = "编辑";
    },
    addDanger() {
      this.dangerForm = {};
      this.title = "新增";
      this.dialogVisible = true;
    },
    changeWxy(e) {
      for (var i = 0; i < this.dangerList.length; i++) {
        if (e == this.dangerList[i].id) {
          this.dangerForm.DTRisk_level = this.dangerList[i].mriskLevel;
          this.dangerForm.dangerousSource = this.dangerList[i].mriskPoint;
        }
      }
    },
    initWXY() {
      var param = {
        page: 1,
        limit: 1000,
      };
      initWxy(param).then((res) => {
        if (res.data.ok == 1) {
          this.dangerList = res.data.data.items;
        } else {
          this.$message({
            type: "error",
            message: res.data.msg,
            duration: 3000,
          });
        }
      });
    },
    initYWKS() {
      initYwks().then((res) => {
        if (res.data.ok == 1) {
          this.YWKSList = 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,
          });
        }
      });
    },
    initReformStatus() {
      initReformStatus().then((res) => {
        if (res.data.ok == 1) {
          this.statusList = 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,
          });
        }
      });
    },
    initYHLX() {
      initYHLX().then((res) => {
        if (res.data.ok == 1) {
          this.YHLXList = res.data.data;
        } else {
          this.$message({
            type: "error",
            message: res.data.msg,
            duration: 3000,
          });
        }
      });
    },
    initYHJB() {
      initYHJB().then((res) => {
        if (res.data.ok == 1) {
          this.YHJBList = res.data.data;
        } else {
          this.$message({
            type: "error",
            message: res.data.msg,
            duration: 3000,
          });
        }
      });
    },
    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,
          });
        }
      });
    },
    returnIndex() {
      this.$router.push({
        path: "/hiddenDangerRegistration",
      });
    },
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          if (this.tableData == null || this.tableData.length == 0) {
            this.$message({
              type: "error",
              message: "请添加隐患",
              duration: 2000,
            });
          }
          this.ruleForm.items = this.tableData;
          if (this.addShow) {
            saveDanger(this.ruleForm).then((res) => {
              if (res.data.ok == 1) {
                this.$message({
                  type: "success",
                  message: "新增成功",
                  duration: 3000,
                });
                this.$router.push({
                  path: "/hiddenDangerRegistration",
                });
              } else {
                this.$message({
                  type: "error",
                  message: res.data.msg,
                  duration: 3000,
                });
              }
            });
          } else {
            var param = deepClone(this.ruleForm);
            var obj = deepClone(this.tableData[0]);
            param.ht_branch = obj.ht_branch;
            param.address = obj.address;
            param.ht_content = obj.ht_content;
            param.measure = obj.measure;
            param.ht_typesub = obj.ht_typesub;
            param.DTRisk_bankId = obj.DTRisk_bankId;
            param.DTRisk_level = obj.mriskLevel;
            param.dangerousSource = obj.mriskPoint;
            param.ht_level = obj.ht_level;
            param.alter_time = obj.alter_time;
            param.duty_officer = obj.duty_officer;
            param.alter_status = obj.alter_status;
            param.Review = obj.Review;
            param.repeatId = obj.repeatId;
            editDanger(param).then((res) => {
              if (res.data.ok == 1) {
                this.$message({
                  type: "success",
                  message: "编辑成功",
                  duration: 3000,
                });
                this.$router.push({
                  path: "/hiddenDangerRegistration",
                });
              } else {
                this.$message({
                  type: "error",
                  message: res.data.msg,
                  duration: 3000,
                });
              }
            });
          }
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
  },
};
</script>
<style scoped>
.app-container {
  padding: 20px;
  height: 850px;
  overflow-y: auto;
}
.app-container /deep/ .box {
  padding-top: 0;
}
/* /deep/ .multiline .el-input__inner {
  height: 62px;
} */
.btns {
  background-color: #034ea2;
  border: 1px solid #034ea2;
}
  .title-center /deep/ .el-radio-button:first-child .el-radio-button__inner {
    border: none;
}
.title-center /deep/ .el-radio-button__inner {
    border: none;
    border-radius: 0px;
}
.title-center /deep/ .el-radio-button__orig-radio:checked + .el-radio-button__inner {
    background-color: #034ea2;
    background-color: #034ea2;
}
.title-center /deep/ .el-radio-button--medium .el-radio-button__inner {
    padding: 11px 20px;
}
</style>
src/views/safetyHazardAccount/accountSend.vue
对比新文件
@@ -0,0 +1,382 @@
<template>
    <div class="app-container">
        <div>
            <Titlename title="发送隐患单"></Titlename>
            <div class="whole-form">
                <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="150px" class="demo-ruleForm"
                         style="margin: 0 14% 0 16%;">
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="隐患编号" prop="number">
                                <el-input v-model="ruleForm.number" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="检查单位" prop="check_main_branch">
                                <el-input v-model="ruleForm.check_main_branch" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="检查人" prop="check_man">
                                <el-input v-model="ruleForm.check_man" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="陪检人员" prop="acc_man">
                                <el-input v-model="ruleForm.acc_man" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="检查时间" prop="check_date">
                                <el-date-picker
                                    v-model="ruleForm.check_date"
                                    type="date"
                                    :disabled="true"
                                    placeholder="选择日期"
                                    style="width: 100%">
                                </el-date-picker>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="班次" prop="check_class">
                                <el-input v-model="ruleForm.check_class" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="跟班、带班情况" prop="name">
                                <el-input v-model="ruleForm.name" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="跟班、带班人员" prop="name">
                                <el-input v-model="ruleForm.name" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="行走路线" prop="route">
                                <el-input type="textarea" v-model="ruleForm.route" class="multiline" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="隐患单位" prop="ht_community">
                                <el-input v-model="ruleForm.ht_community" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="隐患部门" prop="ht_branch">
                                <el-input v-model="ruleForm.ht_branch" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="隐患地点" prop="address">
                                <el-input type="textarea" v-model="ruleForm.address" class="multiline" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="隐患内容" prop="ht_content">
                                <el-input type="textarea" v-model="ruleForm.ht_content" class="multiline" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="隐患类别" prop="ht_typesub">
                                <el-input v-model="ruleForm.ht_typesub" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="隐患级别" prop="ht_level">
                                <el-input v-model="ruleForm.ht_level" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="整改措施" prop="measure">
                                <el-input v-model="ruleForm.measure" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="所需资金" prop="name">
                                <el-input v-model="ruleForm.name" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="限改时间" prop="alter_time">
                                <el-date-picker
                                    v-model="ruleForm.alter_time"
                                    type="date"
                                    :disabled="true"
                                    placeholder="选择日期"
                                    style="width: 100%">
                                </el-date-picker>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="责任人" prop="duty_officer">
                                <el-input v-model="ruleForm.duty_officer" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="完成时间" prop="name">
                                <!--<el-input v-model="ruleForm.name"></el-input>-->
                                <el-date-picker
                                    v-model="value1"
                                    type="date"
                                    :disabled="true"
                                    placeholder="选择日期"
                                    style="width: 100%">
                                </el-date-picker>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="整改完成情况" prop="alter_status">
                                <el-input v-model="ruleForm.alter_status" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="复查时间" prop="name">
                                <!--<el-input v-model="ruleForm.name"></el-input>-->
                                <el-date-picker
                                    v-model="value1"
                                    type="date"
                                    :disabled="true"
                                    placeholder="选择日期"
                                    style="width: 100%">
                                </el-date-picker>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="复查人" prop="name">
                                <el-input v-model="ruleForm.name" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="复查结果" prop="name">
                                <el-input v-model="ruleForm.name" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="整改次数" prop="name">
                                <el-input v-model="ruleForm.name" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="危险源" prop="dangerousSource">
                                <el-input type="textarea" v-model="ruleForm.dangerousSource" class="multiline" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="风险等级" prop="DTRisk_level">
                                <el-input v-model="ruleForm.DTRisk_level" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="业务科室" prop="Review">
                                <el-input v-model="ruleForm.Review" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="附件" prop="DTRisk_level">
                                <el-input v-model="ruleForm.DTRisk_level" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="流程信息" prop="name">
                                <!--                                <el-input v-model="ruleForm.name" class="multiline" :disabled="true"></el-input>-->
                                <el-table
                                    :data="tableData"
                                    border
                                    style="width: 100%">
                                    <el-table-column
                                        prop="date"
                                        label="步骤"
                                        align="center"
                                        width="60">
                                    </el-table-column>
                                    <el-table-column
                                        prop="name"
                                        label="操作人"
                                        align="center"
                                        width="138">
                                    </el-table-column>
                                    <el-table-column
                                        prop="province"
                                        label="处理时间"
                                        align="center"
                                        width="200">
                                    </el-table-column>
                                    <el-table-column
                                        prop="city"
                                        label="审批意见"
                                        align="center"
                                        width="260">
                                    </el-table-column>
                                    <el-table-column
                                        prop="address"
                                        label="流程信息"
                                        align="center"
                                        width="188">
                                    </el-table-column>
                                </el-table>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item style="text-align: center;">
                                <el-button  class="btn" size="small" type="primary" @click="close()"
                                >关闭</el-button>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-form>
            </div>
        </div>
    </div>
</template>
<script>
import Titlename from "../../components/Titlename/index.vue";
import {getDangerInfo,next_step_do} from '@/api/sgyhpczl/hiddenDangerRegistration'
import {deepClone} from '@/utils'
export default {
    components: {Titlename},
    name: "superiorsSend",
    data() {
        return {
            id:'',
            ruleForm: {},
            rules: {
                reviewTime: { required: true, message: '请填写复查时间', trigger: 'blur' },
                rechecker: { required: true, message: '请填写复查人', trigger: 'blur' },
                reviewResults: { required: true, message: '请填写复查结果', trigger: 'blur' },
                desc1: { required: true, message: '复查不通过时请在备注说明原因!', trigger: 'blur' },
            },
            tableData: [],
            fileList: [],
        };
    },
    mounted(){
        this.id = this.$route.query.id;
        if( this.id!=null &&  this.id!=''){
            this.initInfo();
        }
    },
    methods: {
        async initInfo(){
            var res=await getDangerInfo(this.id)
            if (res.data.ok==1){
                this.ruleForm=res.data.data
                this.ruleForm.next='发送到'+res.data.data.ht_community+res.data.data.ht_branch
            }
        },
        submitForm(formName) {
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    var param={
                        id:this.id,
                        step: "1",
                        dealContent: this.ruleForm.dealContent
                    }
                    next_step_do(param).then(res=>{
                        if (res.data.ok==1){
                            this.$message({type:'success', message:"fas成功", duration:3000})
                            this.close()
                        }else {
                            this.$message({type:'error', message:res.data.msg, duration:3000})
                        }
                    })
                } else {
                    console.log('error submit!!');
                    return false;
                }
            });
        },
        handleRemove(file, fileList) {
            console.log(file, fileList);
        },
        handlePreview(file) {
            console.log(file);
        },
        beforeUpload(file) {
            var FileExt = file.name.replace(/.+\./, "");
            if (['jpg','png','bmp','gif','jpeg'].indexOf(FileExt.toLowerCase()) === -1){
                this.$message({
                    type: 'warning',
                    message: '请上传后缀名为jpg、png、bmp、gif、jpeg的图片!'
                });
                return false;
            }
        },
        close(){
            this.$router.push({
                path:"/hiddenDangerRegistration"
            })
        }
    }
}
</script>
<style scoped>
.app-container {
    padding: 20px;
    height: 850px;
    overflow-y: auto;
}
/deep/ .box {
    padding-top: 0;
}
/deep/ .multiline .el-input__inner {
    height: 62px;
}
/deep/ .textarea .el-textarea__inner{
    height: 80px;
    max-height: 80px;
    overflow-y: auto
}
/deep/ .textarea2 .el-textarea__inner{
    height: 100px;
    max-height: 100px;
    overflow-y: auto
}
.btn{
    background-color: #034ea2;
    border: 1px solid #034ea2;
}
</style>
src/views/safetyHazardAccount/hazardSource.vue
对比新文件
@@ -0,0 +1,276 @@
<template>
    <div class="whole">
        <div class="left-tree">
            <el-tree
                :data="data"
                node-key="id"
                default-expand-all
                @node-drag-start="handleDragStart"
                @node-drag-enter="handleDragEnter"
                @node-drag-leave="handleDragLeave"
                @node-drag-over="handleDragOver"
                @node-drag-end="handleDragEnd"
                @node-drop="handleDrop"
                :allow-drop="allowDrop"
                :allow-drag="allowDrag">
                 <span slot-scope="{ node, data }" class="slot-t-node">
              <template>
                <i
                    v-if="data.ChildItems&&data.ChildItems.length"
                    :class="{
                    'el-icon-folder': !node.expanded, // 节点收缩时的图标
                    'el-icon-folder-opened': node.expanded, // 节点展开时的图标
                  }"
                    style="color: #409eff;"
                />
                <i v-else class="el-icon-folder-add" style="color: #EC933A;" />
                <span>{{ node.label }}</span>
              </template>
            </span>
            </el-tree>
        </div>
        <div class="right-table">
            <el-form :inline="true" :model="formInline" class="demo-form-inline">
                <el-checkbox-group v-model="checkList">
                    <el-checkbox style="margin-right: 50px">
                        <el-form-item label="事故来源">
                            <el-input v-model="formInline.user"></el-input>
                        </el-form-item>
                    </el-checkbox>
                    <el-checkbox style="margin-right: 50px">
                        <el-form-item label="事故类型">
                            <el-input v-model="formInline.user"></el-input>
                        </el-form-item>
                    </el-checkbox>
                    <el-form-item label="主要危险源" style="margin-right: 50px">
                        <el-input v-model="formInline.user"></el-input>
                    </el-form-item>
                </el-checkbox-group>
                <el-form-item>
                    <button class="btn" @click="onSubmit">查询</button>
                    <button class="btn" @click="onSubmit">确定</button>
                </el-form-item>
            </el-form>
            <el-table
                :data="tableData"
                ref="multipleTable"
                border
                @selection-change="handleSelectionChange"
                style="width: 100%">
                <el-table-column
                    type="selection"
                    width="55">
                </el-table-column>
                <el-table-column
                    prop="date"
                    label="风险点"
                    width="180">
                </el-table-column>
                <el-table-column
                    prop="name"
                    label="主要危险源"
                    width="180">
                </el-table-column>
                <el-table-column
                    prop="address"
                    label="事故类型">
                </el-table-column>
                <el-table-column
                    prop="address"
                    label="风险等级">
                </el-table-column>
                <el-table-column
                    prop="address"
                    label="管控措施">
                </el-table-column>
                <el-table-column
                    prop="address"
                    label="管控层级">
                </el-table-column>
                <el-table-column
                    prop="address"
                    label="责任单位">
                </el-table-column>
                <el-table-column
                    prop="address"
                    label="责任人">
                </el-table-column>
            </el-table>
            <div style="text-align:right">
                <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="currentPage4"
                    :page-sizes="[100, 200, 300, 400]"
                    :page-size="100"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="400">
                </el-pagination>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    name: "hazardSource",
    data() {
        return {
            data: [{
                id: 1,
                label: '危险源等级',
                icon:'el-icon-folder',
                children: [{
                    id: 2,
                    label: '低风险',
                    icon:'el-icon-folder',
                },
                {
                    id: 3,
                    label: '一般风险',
                    icon:'el-icon-success',
                },
                {
                    id: 4,
                    label: '较大风险',
                    icon:'el-icon-success',
                },
                {
                    id: 5,
                    label: '重大风险',
                    icon:'el-icon-success',
                }]
            }],
            formInline: {
                user: '',
                region: ''
            },
            checkList: ['选中且禁用','复选框 A'],
            tableData: [{
                date: '2016-05-02',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1518 弄'
            }, {
                date: '2016-05-04',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1517 弄'
            }, {
                date: '2016-05-01',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1519 弄'
            }, {
                date: '2016-05-03',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1516 弄'
            }],
            multipleSelection: [],
            currentPage4: 4
        };
    },
    mounted(){
        this.getAllColumns()
    },
    methods: {
        handleDragStart(node, ev) {
            console.log('drag start', node);
        },
        handleDragEnter(draggingNode, dropNode, ev) {
            console.log('tree drag enter: ', dropNode.label);
        },
        handleDragLeave(draggingNode, dropNode, ev) {
            console.log('tree drag leave: ', dropNode.label);
        },
        handleDragOver(draggingNode, dropNode, ev) {
            console.log('tree drag over: ', dropNode.label);
        },
        handleDragEnd(draggingNode, dropNode, dropType, ev) {
            console.log('tree drag end: ', dropNode && dropNode.label, dropType);
        },
        handleDrop(draggingNode, dropNode, dropType, ev) {
            console.log('tree drop: ', dropNode.label, dropType);
        },
        allowDrop(draggingNode, dropNode, type) {
            if (dropNode.data.label === '二级 3-1') {
                return type !== 'inner';
            } else {
                return true;
            }
        },
        allowDrag(draggingNode) {
            return draggingNode.data.label.indexOf('三级 3-2-2') === -1;
        },
        // 获取表格数据进行渲染
        getAllColumns() {
            var data = this.$route.query
        },
        handleChange(file, fileList) {
            this.fileList = fileList.slice(-3);
        },
        onSubmit() {
            console.log('submit!');
        },
        handleSelectionChange(val) {
            this.multipleSelection = val;
        },
        // 页码
        handleSizeChange(val) {
            console.log(`每页 ${val} 条`);
        },
        handleCurrentChange(val) {
            console.log(`当前页: ${val}`);
        }
    }
}
</script>
<style scoped>
.whole{
    display: flex;
}
.left-tree{
    width: 15%;
}
.left-tree .el-tree{
    background: #f0f6e4;
    height: 400px;
    overflow-y: scroll;
    border: 1px solid #000;
}
/deep/ .is-leaf{
    background: transparent !important;
    width: 5px;
    height: 5px;
    background-size: 100%;
    margin-right: 5px;
}
/deep/ .el-icon-caret-right:before{
    content: '';
}
.right-table{
    width: 85%;
    padding-left: 20px;
}
.demo-form-inline /deep/ .el-checkbox__inner{
    top: 9px;
}
.demo-form-inline{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: start;
    background: #FFFFFF;
    padding: 15px 10px 0px 10px;
    margin-bottom: 20px;
}
.btn{
    background: url(../../assets/btn.gif) no-repeat;
    width: 76px;
    height: 26px;
    line-height: 26px;
    font-size: 14px;
    border: none;
    color: #fff;
    cursor: pointer;
    overflow: visible;
}
</style>
src/views/safetyHazardAccount/index.vue
@@ -1,13 +1,771 @@
<template>
    <div class="app-container">
        <el-form ref="form" :inline="true" class="inquire" :model="form" label-width="100px">
            <el-form-item label="编号">
                <el-input v-model="listQuery.form.number" style="width:202px" placeholder="请输入内容"></el-input>
            </el-form-item>
            <el-form-item label="检查单位">
                <el-select v-model="listQuery.form.check_main_branch" placeholder="请选择" @change="changeJCDW">
                    <el-option
                        v-for="item in JCDWList"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                    >
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="检查部门">
                <el-select v-model="listQuery.form.check_branch" placeholder="请选择">
                    <el-option
                        v-for="item in JCBMList"
                        :key="item.value"
                        :label="item.value"
                        :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="检查人">
                <el-input v-model="listQuery.form.check_man" style="width:202px" placeholder="请输入内容"></el-input>
            </el-form-item>
            <el-form-item label="隐患单位">
                <el-input v-model="listQuery.form.ht_community" style="width:202px" :disabled="true"></el-input>
                <!--<el-select v-model="listQuery.form.ht_community" placeholder="请选择" @change="changeYHDW">
             <el-option
               v-for="item in JCDWList"
               :key="item.value"
               :label="item.label"
               :value="item.value">
             </el-option>
           </el-select>-->
            </el-form-item>
            <el-form-item label="隐患部门">
                <el-select v-model="listQuery.form.ht_branch" placeholder="请选择">
                    <el-option
                        v-for="item in YHBMList"
                        :key="item.branch_name"
                        :label="item.branch_name"
                        :value="item.branch_name">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="隐患类别">
                <el-select v-model="listQuery.form.ht_typesub" placeholder="请选择">
                    <el-option
                        v-for="item in YHLXList"
                        :key="item.value"
                        :label="item.value"
                        :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="隐患级别">
                <el-select v-model="listQuery.form.ht_level" placeholder="请选择">
                    <el-option
                        v-for="item in YHJBList"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="检查类别">
                <el-select v-model="listQuery.form.checktype" placeholder="请选择">
                    <el-option
                        v-for="item in JCLBList"
                        :key="item.value"
                        :label="item.value"
                        :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="隐患地点">
                <el-input v-model="listQuery.form.address" style="width:202px" placeholder="请输入内容"></el-input>
            </el-form-item>
            <el-form-item label="隐患内容">
                <el-input v-model="listQuery.form.ht_content" style="width:202px" placeholder="请输入内容"></el-input>
            </el-form-item>
            <el-form-item label="班次">
                <el-select v-model="listQuery.form.check_class" placeholder="请选择">
                    <el-option
                        v-for="item in BCList"
                        :key="item.value"
                        :label="item.value"
                        :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="风险等级">
                <el-select v-model="listQuery.form.DTRisk_level" placeholder="请选择">
                    <el-option
                        v-for="item in levelList"
                        :key="item.name"
                        :label="item.name"
                        :value="item.name">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="录入单位">
                <el-select v-model="listQuery.form.createBy" placeholder="请选择">
                    <el-option
                        v-for="item in llrList"
                        :key="item.id"
                        :label="item.realName"
                        :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="深入现场情况">
                <el-select v-model="listQuery.form.class_situation" placeholder="请选择">
                    <el-option
                        v-for="item in llrList"
                        :key="item.id"
                        :label="item.realName"
                        :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="是否关联">
                <el-select v-model="listQuery.form.DTRisk_bankId" placeholder="请选择">
                    <el-option
                        v-for="item in reList"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="复查单位">
                <el-select v-model="listQuery.form.callback_branch" placeholder="请选择">
                    <el-option
                        v-for="item in YHBMList"
                        :key="item.branch_id"
                        :label="item.branch_name"
                        :value="item.branch_name">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="检查时间">
                <el-col :span="11">
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.check_dateStart"
                                    style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker>
                </el-col>
                <el-col style="text-align:center" :span="2">-</el-col>
                <el-col :span="11">
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.check_dateEnd"
                                    style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker>
                </el-col>
            </el-form-item>
            <el-form-item label="限改时间">
                <el-col :span="11">
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.alter_timeStart"
                                    value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker>
                </el-col>
                <el-col style="text-align:center" :span="2">-</el-col>
                <el-col :span="11">
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.alter_timeEnd"
                                    value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker>
                </el-col>
            </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" @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">
            <el-col :span="12">
                <el-radio-group v-model="YHType">
                    <el-radio-button label="1">超期整改</el-radio-button>
                    <el-radio-button label="2">到期未整改</el-radio-button>
                    <el-radio-button label="3">二次整改</el-radio-button>
                    <el-radio-button label="4">正在整改</el-radio-button>
                    <el-radio-button label="5">正在复查</el-radio-button>
                    <el-radio-button label="6">整改完成</el-radio-button>
                    <el-radio-button label="0">全部隐患</el-radio-button>
                </el-radio-group>
            </el-col>
            <el-col :span="12" style="text-align:right;" v-if="YHType=='0'">
                <el-button type="primary" class="btns" size="small" @click="supervision('1')">督查督办</el-button>
                <el-button type="primary" class="btns" size="small" @click="supervision('2')">举一反三</el-button>
                <!--                <el-button type="primary" class="btns" size="small" @click="base()">双基考核</el-button>-->
                <el-button type="primary" class="btns" size="small" @click='deleteBatch'>删除</el-button>
            </el-col>
        </el-row>
        <el-table :data="tableData" ref="pageTable" style="width: 100%" @selection-change="changeBox"  v-loading="loading">
            <el-table-column type="selection" width="55" align="center"></el-table-column>
            <el-table-column prop="number" label="编号" align="center" width="120">
                <template slot-scope="scope">
                    <div class="blue-font-color" @click="showDetails(scope.row)">{{ scope.row.number }}</div>
                </template>
            </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">
                    <template slot-scope="scope">
                        <label>{{ formatDate(scope.row.check_date) }}</label><br/>
                        <label>{{ scope.row.check_class }}</label>
                    </template>
                </el-table-column>
                <el-table-column prop="address" label="地点" align="center">
                    <template slot-scope="scope">
                        <el-popover trigger="hover" placement="top">
                            <p>{{ scope.row.address }}</p>
                            <div slot="reference" class="name-wrapper">{{
                                    scope.row.address != null && scope.row.address.length > 10 ? scope.row.address.substring(0, 8) + "...." : scope.row.address
                                }}
                            </div>
                        </el-popover>
                    </template>
                </el-table-column>
                <el-table-column prop="ht_content" label="内容" width="150" align="center">
                    <template slot-scope="scope">
                        <el-popover trigger="hover" placement="top">
                            <p>{{ scope.row.ht_content }}</p>
                            <div slot="reference" class="name-wrapper">{{
                                    scope.row.ht_content != null && scope.row.ht_content.length > 10 ? scope.row.ht_content.substring(0, 8) + "...." : scope.row.ht_content
                                }}
                            </div>
                        </el-popover>
                    </template>
                </el-table-column>
                <el-table-column prop="ht_typesub" label="类别" 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="measure" label="整改措施" width="150" align="center">
                    <template slot-scope="scope">
                        <el-popover trigger="hover" placement="top">
                            <p>{{ scope.row.measure }}</p>
                            <div slot="reference" class="name-wrapper">{{
                                    scope.row.measure != null && scope.row.measure.length > 10 ? scope.row.measure.substring(0, 8) + "...." : scope.row.measure
                                }}
                            </div>
                        </el-popover>
                    </template>
                </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"  :formatter="formatColumnDate" 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"  :formatter="formatColumnDate" 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"  :formatter="formatColumnDate" 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>
                </template>
            </el-table-column>
            <el-table-column prop="DTRisk_bankId" label="是否关联" align="center">
                <template slot-scope="scope">
                    <span style ="color: red"
                        v-if="scope.row.DTRisk_bankId==0 || scope.row.DTRisk_bankId=='' || scope.row.DTRisk_bankId==null">未关联</span>
                    <span v-else>已关联</span>
                </template>
            </el-table-column>
            <el-table-column prop="DTRisk_level" label="风险等级" align="center"></el-table-column>
            <el-table-column prop="warningLevel" label="初始警情" align="center"></el-table-column>
            <el-table-column prop="curWarningLevel" label="当前警情" align="center"></el-table-column>
            <!-- <el-table-column prop="date" label="流程操作" align="center"  fixed="right">
                <template slot-scope="scope">
                    <el-button @click="handleClick(scope.row)" type="text" size="small">点击发送</el-button>
                </template>
            </el-table-column> -->
            <el-table-column prop="date" label="操作" align="center" fixed="right">
                <template slot-scope="scope">
                    <el-button @click="updateClick(scope.row)" type="text" size="small">编辑</el-button>
                    <el-button @click="deleteClick(scope.row)" type="text" size="small">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
        <div style="text-align: right">
            <el-pagination
                v-show="recordTotal > 0"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-sizes="[10, 20, 30, 50]"
                :page-size="pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="recordTotal"
            >
            </el-pagination>
        </div>
        <!--批量复查弹窗-->
        <el-dialog
            :title="titleStr"
            :visible.sync="dialogVisible"
            :close-on-click-modal="false"
            width="40%"
        >
            <el-form>
                <el-row>
                    <el-checkbox style="width: 80px;height: 30px" :key="item.branch_id" v-for="item in YHBMList"
                                 v-model="checked"
                                 :label="item.branch_id">{{
                            item.branch_name
                        }}
                    </el-checkbox>
                </el-row>
                <el-row>
                    <el-col :span="22">
                        <el-form-item style="text-align: center;">
                            <el-button class="btn" size="small" type="primary" @click="submitForm()">
                                保存
                            </el-button>
                            <el-button size="small" @click="close()">关闭</el-button>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </el-dialog>
    </div>
</template>
<script>
import {getPageList, inspect_do, draw_inferences_do} from "@/api/sgyhpczl/safetyHazardAccount";
import {delDanger} from "@/api/sgyhpczl/hiddenDangerRegistration";
import {danger_export_do} from "@/api/sgyhpczl/hiddenDangerRectification";
import {initJCBM, initYHLX, initBC, initJCLB, initYHBM, initYHJB, initLlr} from "@/api/sgyhpczl/initSelect";
export default {
    name: "index"
}
    data() {
        return {
            titleStr:"",
            dialogVisible: false,
            checked: [],
            YHType: '0',
            selectedList: [],
            reList: [{label: "未关联", value: 0}],
            llrList: [],
            options: [],
            form: {},
            buttonType: "",
            JCDWList: [{label: "众泰煤焦化", value: 0}, {label: "上级单位", value: 1}],
            JCBMList: [],
            YHLXList: [],
            BCList: [],
            JCLBList: [],
            YHBMList: [],
            YHJBList: [],
            tableData: [],
            requestData: {},
            levelList:[{id:1,name:'低风险'},{id:2,name:'一般风险'},{id:3,name:'较大风险'},{id:4,name:'重大风险'}],
            loading:false,
            listQuery: {
                page: 1,
                limit: 10,
                form: {
                    ht_community: "众泰煤焦化"
                },
            },
            currentPage: 1,
            pageSize: 10,
            recordTotal: 0,
        };
    },
    watch: {
        "YHType": function (newVal, oldVal) {
            if (newVal) {
                this.listQuery.type = parseInt(newVal);
                this.getPageList();
            }
        },
        "dialogVisible": function (newVal, oldVal) {
            this.checked = [];
        }
    },
    mounted() {
        this.getPageList()
        this.initYHLX()
        this.initYHJB()
        this.initBC()
        this.initJCLB()
        this.initLlr()
        this.initYHBM()
    },
    methods: {
        close() {
            this.dialogVisible = false;
        },
        deleteBatch() {
            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(",")
            this.$confirm('确认删除吗', '提示', {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                type: 'warning'
            })
                .then(() => {
                    delDanger(ids).then(() => {
                        this.getPageList()
                        this.$notify({
                            title: "成功",
                            message: "删除成功",
                            type: "success",
                            duration: 2000,
                        });
                    });
                })
                .catch(error => {
                });
        },
        changeBox(val) {
            this.selectedList = []
            val.forEach((item) => {
                this.selectedList.push(item)
            })
        },
        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})
                }
            })
        },
        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})
                }
            })
        },
        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})
                }
            })
        },
        checkTime() {
            if (this.listQuery.form.check_dateStart != null && this.listQuery.form.check_dateStart != '') {
                if (this.listQuery.form.check_dateEnd != null && this.listQuery.form.check_dateEnd != '') {
                } else {
                    this.$message({type: 'error', message: "请选择检查结束时间", duration: 3000})
                    return
                }
            }
            if (this.listQuery.form.check_dateEnd != null && this.listQuery.form.check_dateEnd != '') {
                if (this.listQuery.form.check_dateStart != null && this.listQuery.form.check_dateStart != '') {
                } else {
                    this.$message({type: 'error', message: "请选择检查开始时间", duration: 3000})
                    return
                }
            }
            if (this.listQuery.form.alter_timeStart != null && this.listQuery.form.alter_timeStart != '') {
                if (this.listQuery.form.alter_timeEnd != null && this.listQuery.form.alter_timeEnd != '') {
                } else {
                    this.$message({type: 'error', message: "请选择限改结束时间", duration: 3000})
                    return
                }
            }
            if (this.listQuery.form.alter_timeEnd != null && this.listQuery.form.alter_timeEnd != '') {
                if (this.listQuery.form.alter_timeStart != null && this.listQuery.form.alter_timeStart != '') {
                } else {
                    this.$message({type: 'error', message: "请选择改开始时间", duration: 3000})
                    return
                }
            }
        },
        getPageList() {
            this.listQuery.page = 1
            this.checkTime()
            this.loading = true;
            getPageList(this.listQuery).then(res => {
                this.loading = false;
                if (res.data.ok == 1) {
                    this.tableData = res.data.data.items
                    this.recordTotal = res.data.data.total
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        reset() {
            this.listQuery.form = {ht_community: "众泰煤焦化"}
            this.getPageList()
        },
        handleSizeChange(val) {
            this.listQuery.limit = val
            this.getPageListForPagination();
        },
        handleCurrentChange(val) {
            this.listQuery.page = val
            this.getPageListForPagination();
        },
        getPageListForPagination() {
            this.checkTime()
            getPageList(this.listQuery).then(res => {
                if (res.data.ok == 1) {
                    this.tableData = res.data.data.items
                    this.recordTotal = res.data.data.total
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        initYHLX() {
            initYHLX().then(res => {
                if (res.data.ok == 1) {
                    this.YHLXList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        initYHJB() {
            initYHJB().then(res => {
                if (res.data.ok == 1) {
                    this.YHJBList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        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})
                }
            })
        },
        updateClick(row) {
            this.$router.push({
                path: "/hiddenDangerAdd?id=" + row.id + "&route=safetyHazardAccount"
            })
        },
        jump() {
            this.$router.push({
                path: "/hiddenDangerAdd"
            })
        },
        // 发送隐患单跳转
        handleClick(row) {
            this.$router.push({
                path: "/hiddenDangerList?id=" + row.id,
            })
        },
        //方法区
        formatDate(data) {
            // 获取单元格数据
            if (data == null) {
                return null
            }
            let dt = new Date(data)
            return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate()
        },
        //方法区
        formatColumnDate(row, column) {
            // 获取单元格数据
            let data = row[column.property]
            if (data == null) {
                return null
            }
            let dt = new Date(data)
            return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + ' '
        },
        deleteClick(row) {
            this.$confirm('确认删除吗', '提示', {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                type: 'warning'
            })
                .then(() => {
                    delDanger(row.id).then(() => {
                        this.getPageList()
                        this.$notify({
                            title: "成功",
                            message: "删除成功",
                            type: "success",
                            duration: 2000,
                        });
                    });
                })
                .catch(error => {
                });
        },
        base() {
            this.$router.push({
                path: "/Dualbase"
            })
        },
        supervision(type) {
            if(type == '1'){
                this.titleStr = "督查督办";
            }else{
                this.titleStr = "举一反三";
            }
            var selectDataList = this.$refs.pageTable.selection;
            this.buttonType = type;
            if (selectDataList.length != 1) {
                this.$message({
                    type: 'warning',
                    message: '请选择一条数据!'
                });
                return false;
            } else {
                this.requestData.id = selectDataList[0].id;
                this.dialogVisible = true;
            }
        },
        submitForm() {
            if (this.checked.length == 0) {
                this.$message({
                    type: 'warning',
                    message: '请勾选需要发送的部门!'
                });
                return;
            }
            this.requestData.branchIds = this.checked.join(";");
            if (this.buttonType == '1') {
                inspect_do(this.requestData).then(res => {
                    if (res.data.ok) {
                        this.$message({
                            type: 'success',
                            message: res.data.msg
                        });
                        this.dialogVisible = false;
                        this.getPageList();
                    } else {
                        this.$message({
                            type: 'error',
                            message: res.data.msg
                        });
                    }
                })
            } else {
                var checkData = this.YHBMList.filter(n => {
                    return this.checked.indexOf(n.branch_id) != -1;
                })
                var branchNames = "";
                checkData.forEach(n => {
                    branchNames += n.branch_name + ";";
                })
                this.requestData.branchNames = branchNames;
                draw_inferences_do(this.requestData).then(res => {
                    if (res.data.ok) {
                        this.$message({
                            type: 'success',
                            message: res.data.msg
                        });
                        this.dialogVisible = false;
                        this.getPageList();
                    } else {
                        this.$message({
                            type: 'error',
                            message: res.data.msg
                        });
                    }
                })
            }
        },
        showDetails(row){
            this.$router.push({
                path: "/dangerDetails",
                query:{"id":row.id,"route":"/safetyHazardAccount"}
            })
        },
        exportData() {
            this.listLoading = true
            var requestData = JSON.parse(JSON.stringify(this.listQuery));
            requestData.export_type = 6;
            //删除分页参数
            this.$delete(requestData, 'page')
            this.$delete(requestData, 'limit')
            danger_export_do(requestData).then(res => {
                this.listLoading = false
                var blob = new Blob([res.data])
                var downloadElement = document.createElement('a')
                var href = window.URL.createObjectURL(blob) //创建下载的链接
                downloadElement.href = href
                downloadElement.download = '安全隐患台账.xlsx' //下载后文件名
                document.body.appendChild(downloadElement)
                downloadElement.click() //点击下载
                document.body.removeChild(downloadElement) //下载完成移除元素
                window.URL.revokeObjectURL(href) //释放掉blob对象
            }).catch(err => {
                console.log(err)
            })
        },
    }
};
</script>
<style scoped>
.inquire {
    display: flex;
    justify-content: left;
    flex-wrap: wrap;
}
.inquire .el-form-item {
    padding: 0 30px;
}
.title-center {
    padding: 20px 0;
}
.btns {
    background-color: #034ea2;
    border: 1px solid #034ea2;
}
.title-center /deep/ .el-radio-button:first-child .el-radio-button__inner {
    border: none;
}
.title-center /deep/ .el-radio-button__inner {
    border: none;
    border-radius: 0px;
}
.title-center /deep/ .el-radio-button__orig-radio:checked + .el-radio-button__inner {
    background-color: #034ea2;
    background-color: #034ea2;
}
.blue-font-color:hover{
    cursor: pointer;
    color: blue;
}
</style>
src/views/safetyHazardAccount/inferOtherThings.vue
对比新文件
@@ -0,0 +1,108 @@
<template>
    <div>
        <el-button type="text" @click="dialogVisible = true">点击打开 Dialog</el-button>
        <el-dialog
            title="责任单位"
            :visible.sync="dialogVisible"
            width="37%"
            :before-close="handleClose">
            <el-checkbox-group v-model="checkList">
                <el-checkbox label="安全环保部"></el-checkbox>
                <el-checkbox label="生产技术部 "></el-checkbox>
                <el-checkbox label="机电部"></el-checkbox>
                <el-checkbox label="企管部"></el-checkbox>
                <el-checkbox label="消防保卫部"></el-checkbox>
                <el-checkbox label="质检中心"></el-checkbox>
                <el-checkbox label="市场开发部"></el-checkbox>
                <el-checkbox label="综合办公室"></el-checkbox>
                <el-checkbox label="工程部 "></el-checkbox>
                <el-checkbox label="财务部"></el-checkbox>
                <el-checkbox label="党群工作部"></el-checkbox>
                <el-checkbox label="纪检监察部"></el-checkbox>
                <el-checkbox label="化产一车间"></el-checkbox>
                <el-checkbox label="炼焦一车间"></el-checkbox>
                <el-checkbox label="原料一车间"></el-checkbox>
                <el-checkbox label="选煤厂"></el-checkbox>
                <el-checkbox label="电仪车间"></el-checkbox>
                <el-checkbox label="众和机电"></el-checkbox>
                <el-checkbox label="原料二车间"></el-checkbox>
                <el-checkbox label="化产二车间"></el-checkbox>
                <el-checkbox label="炼焦二车间"></el-checkbox>
                <el-checkbox label="甲醇厂"></el-checkbox>
                <el-checkbox label="干熄焦"></el-checkbox>
            </el-checkbox-group>
            <span slot="footer" class="dialog-footer">
            <el-button class="btn" type="primary" @click="dialogVisible = false">确 定</el-button>
          </span>
        </el-dialog>
    </div>
</template>
<script>
export default {
    name: "inferOtherThings",
    data() {
        return {
            dialogVisible: false,
            checkList: []
        };
    },
    methods: {
        handleClose(done) {
            this.$confirm('确认关闭?')
                .then(_ => {
                    done();
                })
                .catch(_ => {});
        }
    }
}
</script>
<style scoped>
/deep/ .el-dialog__header{
    text-align: center;
    padding: 50px 50px 20px 50px;
}
/deep/ .el-dialog__header .el-dialog__title {
    font-size: 12px;
    font-weight: bold;
}
/deep/ .el-dialog__body{
    text-align: center;
    padding: 30px 50px 30px 50px;
}
/deep/ .el-checkbox-group{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
}
/deep/ .el-checkbox{
    width: 120px;
    text-align: left;
    line-height: 25px;
}
/deep/ .el-dialog__footer{
    text-align: center;
}
.btn{
    background: url(../../assets/btn.gif) no-repeat;
    width: 76px;
    height: 26px;
    line-height: 26px;
    font-size: 14px;
    border: none;
    color: #fff;
    cursor: pointer;
    overflow: visible;
    padding: 0;
}
/deep/ .el-checkbox__inner{
    border: 1px solid #000000;
}
</style>
src/views/safetyHazardAccount/safetyedit.vue
对比新文件
@@ -0,0 +1,653 @@
<template>
  <div class="app-container">
    <div style="">
      <Titlename title="隐患单修改页面"></Titlename>
      <div class="whole-form">
        <el-form
          :model="ruleForm"
          :rules="rules"
          ref="ruleForm"
          label-width="150px"
          class="demo-ruleForm"
          style="margin: 0 14% 0 16%"
        >
        <el-row>
            <el-col :span="9">
              <el-form-item label="隐患编号" prop="check_date">
               <el-input v-model="ruleForm.check_man"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="9">
              <el-form-item label="检查时间" prop="check_date">
                <el-date-picker
                  v-model="ruleForm.check_date"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="选择日期"
                  style="width: 100%"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="9" :offset="4">
              <el-form-item label="班次" prop="check_class">
                  <el-select v-model="ruleForm.check_class" placeholder="请选择"  style="width: 100%">
                      <el-option
                          v-for="item in BCList"
                          :key="item.value"
                          :label="item.value"
                          :value="item.value">
                      </el-option>
                  </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="9">
              <el-form-item label="检查类别" prop="checktype">
                  <el-select v-model="ruleForm.checktype" placeholder="请选择"  style="width: 100%">
                      <el-option
                          v-for="item in JCLBList"
                          :key="item.value"
                          :label="item.value"
                          :value="item.value">
                      </el-option>
                  </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="9" :offset="4">
              <el-form-item label="检查单位" prop="check_main_branch">
                  <el-select v-model="ruleForm.check_main_branch" placeholder="请选择"  @change="changeJCDW"  style="width: 100%">
                      <el-option
                          v-for="item in JCDWList"
                          :key="item.label"
                          :label="item.label"
                          :value="item.label"
                      >
                      </el-option>
                  </el-select>
              </el-form-item>
            </el-col>
          </el-row>
            <el-row>
                <el-col :span="9">
                    <el-form-item label="深入现场情况" prop="check_branch">
                        <el-select v-model="ruleForm.check_branch" placeholder="请选择" style="width: 100%">
                            <el-option
                                v-for="item in JCBMList"
                                :key="item.value"
                                :label="item.value"
                                :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="9" :offset="4">
                <el-form-item label="深入现场人员" prop="check_man">
                <el-input v-model="ruleForm.check_man"></el-input>
              </el-form-item>
                </el-col>
            </el-row>
          <el-row>
            <el-col :span="9">
              <el-form-item label="检查人员" prop="check_man">
                <el-input v-model="ruleForm.check_man"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="9" :offset="4">
              <el-form-item label="陪检人员" prop="acc_man">
                <el-input v-model="ruleForm.acc_man"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
            <el-row>
                <el-col :span="22">
                    <el-form-item label="行走路线">
                        <el-input v-model="ruleForm.route" rows="3" type="textarea" class="multiline"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row style="margin-bottom: 20px" v-if="addShow">
                <el-col :span="9">
                    <el-button type="primary" class="btns" @click="addDanger">新增隐患</el-button>
                </el-col>
            </el-row>
            <el-row>
                <el-table :data="tableData" style="width: 100%">
                    <el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
                    <!-- <el-table-column prop="ht_branch"  align="center" label="隐患部门"></el-table-column> -->
                    <el-table-column prop="address"  align="center" label="地点"></el-table-column>
                    <el-table-column prop="ht_content"  align="center" label="隐患内容"></el-table-column>
                    <el-table-column prop="measure"  align="center" label="整改措施"></el-table-column>
                    <el-table-column prop="ht_typesub"  align="center" label="隐患类别"></el-table-column>
                    <el-table-column prop="dangerousSource"  align="center" label="关联危险源"></el-table-column>
                    <el-table-column prop="DTRisk_level"  align="center" label="风险等级"></el-table-column>
                    <el-table-column prop="ht_level"  align="center" label="隐患级别"></el-table-column>
                    <el-table-column prop="alter_time"  align="center" label="限改时间"></el-table-column>
                    <el-table-column prop="duty_officer"  align="center" label="责任人"></el-table-column>
                    <el-table-column prop="alter_status"  align="center" label="完成时间"></el-table-column>
                    <el-table-column prop="Review"  align="center" label="复查时间"></el-table-column>
                    <el-table-column prop="Review"  align="center" label="复查人"></el-table-column>
                     <el-table-column prop="Review"  align="center" label="复查结果"></el-table-column>
                    <!-- <el-table-column prop="time" label="操作" align="center" width="140">
                        <template slot-scope="scope">
                            <div style="display: flex;align-items: center;flex-direction: row;">
                                <el-button
                                    size="mini"
                                    @click="editDanger(scope.row, scope.$index)"
                                >编辑
                                </el-button>
                                <el-button
                                    size="mini"
                                    v-if="addShow"
                                    @click="deleteDanger(scope.row, scope.$index)"
                                >删除
                                </el-button>
                            </div>
                        </template>
                    </el-table-column> -->
                </el-table>
            </el-row>
          <el-row style="margin-top: 20px">
            <el-col :span="22">
              <el-form-item style="text-align: center">
                <el-button type="primary" class="btns" @click="submitForm('ruleForm')"
                  >保存</el-button
                >
                <el-button @click="returnIndex">关闭</el-button>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
    </div>
      <el-dialog
          :title="title"
          :visible.sync="dialogVisible"
          :close-on-click-modal="false"
          width="40%">
          <el-form ref="form" :rules="dangerRules" :model="dangerForm" label-width="100px">
              <el-row>
                  <el-col :span="9">
                      <el-form-item label="复查结果" prop="ht_branch">
                          <el-input v-model="dangerForm.address" rows="3" type="textarea" class="multiline"></el-input>
                      </el-form-item>
                  </el-col>
                  <el-col :span="9" :offset="4">
                      <el-form-item label="地点" prop="address">
                          <el-input v-model="dangerForm.address" rows="3" type="textarea" class="multiline"></el-input>
                      </el-form-item>
                  </el-col>
              </el-row>
              <el-row>
                  <el-col :span="9">
                      <el-form-item label="隐患内容" prop="ht_content">
                          <el-input v-model="dangerForm.ht_content" rows="3" type="textarea" class="multiline"></el-input>
                      </el-form-item>
                  </el-col>
                  <el-col :span="9" :offset="4">
                      <el-form-item label="整改措施" prop="measure">
                          <el-input v-model="dangerForm.measure" rows="3" type="textarea" class="multiline"></el-input>
                      </el-form-item>
                  </el-col>
              </el-row>
              <el-row>
                  <el-col :span="9">
                      <el-form-item label="隐患类别" prop="ht_typesub">
                          <el-select v-model="dangerForm.ht_typesub" placeholder="请选择">
                              <el-option
                                  v-for="item in YHLXList"
                                  :key="item.value"
                                  :label="item.value"
                                  :value="item.value">
                              </el-option>
                          </el-select>
                      </el-form-item>
                  </el-col>
                  <el-col :span="9" :offset="4">
                      <el-form-item label="关联危险源" prop="DTRisk_bankId">
                          <el-select v-model="dangerForm.DTRisk_bankId" placeholder="请选择" @change="changeWxy" filterable>
                              <el-option
                                  v-for="item in dangerList"
                                  :key="item.id"
                                  :label="item.mriskPoint"
                                  :value="item.id">
                              </el-option>
                          </el-select>
                      </el-form-item>
                  </el-col>
              </el-row>
              <el-row>
                  <el-col :span="9">
                      <el-form-item label="风险等级" prop="DTRisk_level">
                          <el-input v-model="dangerForm.DTRisk_level" :disabled="true"></el-input>
                      </el-form-item>
                  </el-col>
                  <el-col :span="9" :offset="4">
                      <el-form-item label="隐患级别" prop="ht_level">
                          <el-select v-model="dangerForm.ht_level" placeholder="请选择">
                              <el-option
                                  v-for="item in YHJBList"
                                  :key="item.value"
                                  :label="item.label"
                                  :value="item.value">
                              </el-option>
                          </el-select>
                      </el-form-item>
                  </el-col>
              </el-row>
              <el-row>
                  <el-col :span="9">
                      <el-form-item label="限改时间" prop="alter_time">
                          <el-date-picker
                              v-model="dangerForm.alter_time"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="选择日期"
                              style="width: 100%"
                          >
                          </el-date-picker>
                      </el-form-item>
                  </el-col>
                  <el-col :span="9" :offset="4">
                      <el-form-item label="责任人" prop="duty_officer">
                          <el-input v-model="dangerForm.duty_officer"></el-input>
                      </el-form-item>
                  </el-col>
              </el-row>
              <el-row>
                  <el-col :span="9">
                       <el-form-item label="完成时间" prop="alter_time">
                          <el-date-picker
                              v-model="dangerForm.alter_time"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="选择日期"
                              style="width: 100%"
                          >
                          </el-date-picker>
                      </el-form-item>
                  </el-col>
                  <el-col :span="9" :offset="4">
                      <el-form-item label="复查时间" prop="alter_time">
                          <el-date-picker
                              v-model="dangerForm.alter_time"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="选择日期"
                              style="width: 100%"
                          >
                          </el-date-picker>
                      </el-form-item>
                  </el-col>
              </el-row>
              <el-row>
                  <el-col :span="9">
                      <el-form-item label="复查人" prop="repeatId">
                          <el-input v-model="dangerForm.duty_officer"></el-input>
                      </el-form-item>
                  </el-col>
              </el-row>
              <el-row>
                  <el-col :span="22">
                      <el-form-item style="text-align: center">
                          <el-button type="primary" class="btns" @click="submitDanger('form')"
                          >保存</el-button
                          >
                          <el-button @click="dialogVisible=false">关闭</el-button>
                      </el-form-item>
                  </el-col>
              </el-row>
          </el-form>
      </el-dialog>
  </div>
</template>
<script>
import Titlename from "../../components/Titlename/index.vue";
import {initJCBM ,initYHLX, initBC ,initJCLB ,initYHBM ,initYHJB,initLlr,initReformStatus,initYwks,initWxy} from "@/api/sgyhpczl/initSelect";
import {saveDanger,initDangerRebound,getDangerInfo,editDanger} from '@/api/sgyhpczl/hiddenDangerRegistration'
import {deepClone} from '@/utils'
export default {
  components: { Titlename },
  name: "hiddenDangerList",
  data() {
    return {
        addShow:true,
        id:'',
        rowIndex:-1,
        dangerList:[],
        dangerForm:{},
        dangerRules:{
            ht_branch: [{ required: true, message: '不能为空', trigger: 'blur' },],
            address: [{ required: true, message: '不能为空', trigger: 'blur' },],
            ht_content: [{ required: true, message: '不能为空', trigger: 'blur' },],
            ht_typesub: [{ required: true, message: '不能为空', trigger: 'blur' },],
            DTRisk_bankId: [{ required: true, message: '不能为空', trigger: 'blur' },],
            ht_level: [{ required: true, message: '不能为空', trigger: 'blur' },],
            alter_time: [{ required: true, message: '不能为空', trigger: 'blur' },],
            alter_status: [{ required: true, message: '不能为空', trigger: 'blur' },],
            Review: [{ required: true, message: '不能为空', trigger: 'blur' },],
            duty_officer:[{ required: true, message: '不能为空', trigger: 'blur' },]
        },
        title:'新增',
        dialogVisible:false,
        BCList:[],
        JCLBList:[],
        JCDWList:[{label:"众泰煤焦化",value:0},{label:"上级单位",value:1}],
        YHBMList:[],
        YHLXList:[],
        YHJBList:[],
        JCBMList:[],
        llrList:[],
        statusList:[],
        YWKSList:[],
        reboundList:[],
      ruleForm: {},
       rules: {
           check_date: [{ required: true, message: '不能为空', trigger: 'blur' },],
           check_class: [{ required: true, message: '不能为空', trigger: 'blur' },],
           check_main_branch: [{ required: true, message: '不能为空', trigger: 'blur' },],
           check_branch: [{ required: true, message: '不能为空', trigger: 'blur' },],
           check_man: [{ required: true, message: '不能为空', trigger: 'blur' },],
           checktype: [{ required: true, message: '不能为空', trigger: 'blur' },],
          },
      tableData: [],
    };
  },
    mounted(){
        this.initBC()
        this.initJCLB()
        this.initYHJB()
        this.initYHLX()
        //this.initLlr()
        this.initReformStatus()
        this.initYHBM()
        this.initYWKS()
        this.initWXY()
        this.initDangerRebound()
        this.id = this.$route.query.id;
        if( this.id!=null &&  this.id!=''){
            this.initInfo();
            this.addShow=false
        }
    },
  methods: {
      async initInfo(){
          var res=await getDangerInfo(this.id)
          if (res.data.ok==1){
              this.ruleForm=res.data.data
              this.changeJCDW(res.data.data.check_main_branch)
              var obj=deepClone(res.data.data)
              this.tableData.push(obj)
          }
      },
      initDangerRebound(){
          initDangerRebound().then(res=>{
              if (res.data.ok==1){
                  this.reboundList=res.data.data
              } else{
                  this.$message({type:'error', message:res.data.msg, duration:3000})
              }
          })
      },
      submitDanger(formName){
          this.$refs[formName].validate((valid) => {
              if (valid) {
                  if(this.title=='新增'){
                      this.tableData.push(this.dangerForm)
                  }else {
                      var arr = this.tableData;
                      arr.splice(this.rowIndex, 1, this.dangerForm);
                      this.tableData = arr;
                  }
                  this.dialogVisible=false
              } else {
                  console.log("error submit!!");
                  return false;
              }
          });
      },
      deleteDanger(row, index) {
          this.$confirm('确认删除吗', '提示', {
              confirmButtonText: '确认',
              cancelButtonText: '取消',
              type: 'warning'
          })
              .then(() => {
                  var arr = deepClone(this.tableData);
                  var brr = [];
                  for (var i = 0; i < arr.length; i++) {
                      if (i == index) {
                      } else {
                          brr.push(arr[i]);
                      }
                  }
                  this.tableData = deepClone(brr);
                  //this.tableData.splice(index)
              })
              .catch(error => {
              });
      },
      editDanger(row, index) {
          this.dangerForm = deepClone(row);
          this.rowIndex = index;
          this.dialogVisible = true;
          this.title = '编辑';
      },
      addDanger(){
          this.dangerForm={}
          this.title="新增"
          this.dialogVisible=true
      },
      changeWxy(e){
          for(var i=0;i<this.dangerList.length;i++){
              if(e==this.dangerList[i].id){
                  this.dangerForm.DTRisk_level=this.dangerList[i].mriskLevel
                  this.dangerForm.dangerousSource=this.dangerList[i].mriskPoint
              }
          }
      },
      initWXY(){
          var param={
              page: 1,
              limit: 1000
          }
          initWxy(param).then(res=>{
              if (res.data.ok==1){
                  this.dangerList=res.data.data.items
              } else{
                  this.$message({type:'error', message:res.data.msg, duration:3000})
              }
          })
      },
      initYWKS(){
          initYwks().then(res=>{
              if (res.data.ok==1){
                  this.YWKSList=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})
              }
          })
      },
      initReformStatus(){
          initReformStatus().then(res=>{
              if (res.data.ok==1){
                  this.statusList=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})
              }
          })
      },
      initYHLX(){
          initYHLX().then(res=>{
              if (res.data.ok==1){
                  this.YHLXList=res.data.data
              } else{
                  this.$message({type:'error', message:res.data.msg, duration:3000})
              }
          })
      },
      initYHJB(){
          initYHJB().then(res=>{
              if (res.data.ok==1){
                  this.YHJBList=res.data.data
              } else{
                  this.$message({type:'error', message:res.data.msg, duration:3000})
              }
          })
      },
      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})
              }
          })
      },
      returnIndex(){
          this.$router.push({
              path:"/hiddenDangerRegistration"
          })
      },
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
            if(this.tableData==null || this.tableData.length==0){
                this.$message({type:'error', message:"请添加隐患", duration:2000})
            }
            this.ruleForm.items=this.tableData
            if(this.addShow){
                saveDanger(this.ruleForm).then(res=>{
                    if (res.data.ok==1){
                        this.$message({type:'success', message:"新增成功", duration:3000})
                        this.$router.push({
                            path:"/hiddenDangerRegistration"
                        })
                    }else {
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            }else {
                var param=deepClone(this.ruleForm)
                var obj=deepClone(this.tableData[0])
                param.ht_branch=obj.ht_branch
                param.address=obj.address
                param.ht_content=obj.ht_content
                param.measure=obj.measure
                param.ht_typesub=obj.ht_typesub
                param.DTRisk_bankId=obj.DTRisk_bankId
                param.DTRisk_level=obj.mriskLevel
                param.dangerousSource=obj.mriskPoint
                param.ht_level=obj.ht_level
                param.alter_time=obj.alter_time
                param.duty_officer=obj.duty_officer
                param.alter_status=obj.alter_status
                param.Review=obj.Review
                param.repeatId=obj.repeatId
                editDanger(param).then(res=>{
                    if (res.data.ok==1){
                        this.$message({type:'success', message:"编辑成功", duration:3000})
                        this.$router.push({
                            path:"/hiddenDangerRegistration"
                        })
                    }else {
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            }
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
  },
};
</script>
<style scoped>
.app-container {
  padding: 20px;
  height: 850px;
  overflow-y: auto;
}
.app-container /deep/ .box {
  padding-top: 0;
}
/* /deep/ .multiline .el-input__inner {
  height: 62px;
} */
 .btns{
        background-color: #034ea2;
        border: 1px solid #034ea2;
    }
</style>
src/views/safetyHazardAccount/superiorsSend.vue
文件已删除
src/views/safetyHazardAccount/supervision.vue
对比新文件
@@ -0,0 +1,108 @@
<template>
    <div>
        <el-button type="text" @click="dialogVisible = true">点击打开 Dialog</el-button>
        <el-dialog
            title="督查督办"
            :visible.sync="dialogVisible"
            width="37%"
            :before-close="handleClose">
            <el-checkbox-group v-model="checkList">
                <el-checkbox label="安全环保部"></el-checkbox>
                <el-checkbox label="生产技术部 "></el-checkbox>
                <el-checkbox label="机电部"></el-checkbox>
                <el-checkbox label="企管部"></el-checkbox>
                <el-checkbox label="消防保卫部"></el-checkbox>
                <el-checkbox label="质检中心"></el-checkbox>
                <el-checkbox label="市场开发部"></el-checkbox>
                <el-checkbox label="综合办公室"></el-checkbox>
                <el-checkbox label="工程部 "></el-checkbox>
                <el-checkbox label="财务部"></el-checkbox>
                <el-checkbox label="党群工作部"></el-checkbox>
                <el-checkbox label="纪检监察部"></el-checkbox>
                <el-checkbox label="化产一车间"></el-checkbox>
                <el-checkbox label="炼焦一车间"></el-checkbox>
                <el-checkbox label="原料一车间"></el-checkbox>
                <el-checkbox label="选煤厂"></el-checkbox>
                <el-checkbox label="电仪车间"></el-checkbox>
                <el-checkbox label="众和机电"></el-checkbox>
                <el-checkbox label="原料二车间"></el-checkbox>
                <el-checkbox label="化产二车间"></el-checkbox>
                <el-checkbox label="炼焦二车间"></el-checkbox>
                <el-checkbox label="甲醇厂"></el-checkbox>
                <el-checkbox label="干熄焦"></el-checkbox>
            </el-checkbox-group>
            <span slot="footer" class="dialog-footer">
            <el-button class="btn" type="primary" @click="dialogVisible = false">确 定</el-button>
          </span>
        </el-dialog>
    </div>
</template>
<script>
export default {
    name: "supervision",
    data() {
        return {
            dialogVisible: false,
            checkList: []
        };
    },
    methods: {
        handleClose(done) {
            this.$confirm('确认关闭?')
                .then(_ => {
                    done();
                })
                .catch(_ => {});
        }
    }
}
</script>
<style scoped>
/deep/ .el-dialog__header{
    text-align: center;
    padding: 50px 50px 20px 50px;
}
/deep/ .el-dialog__header .el-dialog__title {
    font-size: 12px;
    font-weight: bold;
}
/deep/ .el-dialog__body{
    text-align: center;
    padding: 30px 50px 30px 50px;
}
/deep/ .el-checkbox-group{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
}
/deep/ .el-checkbox{
    width: 120px;
    text-align: left;
    line-height: 25px;
}
/deep/ .el-dialog__footer{
    text-align: center;
}
.btn{
    background: url(../../assets/btn.gif) no-repeat;
    width: 76px;
    height: 26px;
    line-height: 26px;
    font-size: 14px;
    border: none;
    color: #fff;
    cursor: pointer;
    overflow: visible;
    padding: 0;
}
/deep/ .el-checkbox__inner{
    border: 1px solid #000000;
}
</style>
src/views/summaryPotentialSafetyHzards/index.vue
@@ -1,13 +1,498 @@
<template>
    <div>
        <div class="whole_top">
            <el-form ref="form" :inline="true" :model="form" label-width="100px">
                <div class="top">
                    <div class="select">
                        <el-form-item>
                            <el-select v-model="form.ht_branch" multiple placeholder="请选择隐患部门" style="color: red">
                                <el-option
                                    v-for="item in YHBMList"
                                    :key="item.branch_name"
                                    :label="item.branch_name"
                                    :value="item.branch_name">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item>
                            <el-select v-model="form.ht_typesub" multiple placeholder="请选择隐患专业" style="color: red">
                                <el-option
                                    v-for="item in YHLXList"
                                    :key="item.value"
                                    :label="item.value"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item>
                            <el-select v-model="form.ht_level" multiple placeholder="请选择隐患级别" style="color: red">
                                <el-option
                                    v-for="item in YHJBList"
                                    :key="item.value"
                                    :label="item.value"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item>
                            <el-select v-model="form.checktype" multiple placeholder="请选择检查类型" style="color: red">
                                <el-option
                                    v-for="item in JCLBList"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item>
                            <el-select v-model="form.ht_community" multiple placeholder="请选择上级检查单位"
                                       style="color: red">
                                <el-option
                                    v-for="item in SJLBList"
                                    :key="item.value"
                                    :label="item.value"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item>
                            <el-select v-model="form.check_branch" multiple placeholder="请选择本部检查单位"
                                       style="color: red">
                                <el-option
                                    v-for="item in JCBMList"
                                    :key="item.value"
                                    :label="item.value"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </div>
                    <el-row>
                        <el-form-item label="统计类别">
                            <el-radio-group v-model="form.x_axis" style="padding: 0px 0;">
                                <el-radio label="ht_branch">按隐患部门</el-radio>
                                <el-radio label="ht_typesub">按专业</el-radio>
                                <el-radio label="ht_level">按级别</el-radio>
                                <el-radio label="checktype">按检查类别</el-radio>
                                <el-radio label="ht_community">按检查单位(上级单位)</el-radio>
                                <el-radio label="check_branch">按检查单位(本部单位)</el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </el-row>
                    <el-row>
                        <el-form-item label="汇总类别">
                            <el-radio-group v-model="form.y_axis">
                                <el-radio label="ht_branch">按隐患部门</el-radio>
                                <el-radio label="ht_typesub">按专业</el-radio>
                                <el-radio label="ht_level">按级别</el-radio>
                                <el-radio label="checktype">按检查类别</el-radio>
                                <el-radio label="ht_community">按检查单位(上级单位)</el-radio>
                                <el-radio label="check_branch">按检查单位(本部单位)</el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </el-row>
                </div>
                <div class="center" style="text-align: center;padding-top: 10px;">
                    <el-form-item label="检查时间:">
                        <el-date-picker
                            v-model="time"
                            type="daterange"
                            range-separator="至"
                            value-format="yyyy-MM-dd"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item>
                        <el-button class="btn" size="small" type="primary" @click="queryData"
                        >汇总
                        </el-button>
                        <el-button class="btn" size="small" type="primary" @click="exportData()"
                        >导出Excel
                        </el-button>
                    </el-form-item>
                </div>
            </el-form>
            <el-table id="out-table"
                      :data="tableData"
                      v-loading="loading"
                      style="width: 100%">
                <el-table-column align="center" label="众泰煤焦化-安全隐患台帐">
                    <el-table-column
                        prop="y_label"
                        label="隐患部门\隐患专业"
                        align="center">
                    </el-table-column>
                    <el-table-column
                        v-for="item in tableData[0].items"
                        :key="item.x_label"
                        :label="item.x_label"
                        align="center">
                        <template slot-scope="scope">
                            <span @click="showYHList(scope.row,item)" class="clickSpan">
                                {{ getRowNum(scope.row, item.x_label) }}
                            </span>
                        </template>
                    </el-table-column>
                </el-table-column>
            </el-table>
            <div style="color: #c5021a;margin-top: 20px;">
                <div>温馨提示:</div>
                <div>点选可查询隐患详情。</div>
            </div>
        </div>
    </div>
</template>
<script>
import {
    initJCBM,
    initYHLX,
    initBC,
    initJCLB,
    initYHBM,
    initYHJB,
    initLlr,
    initReformStatus
} from "@/api/sgyhpczl/initSelect";
import {danger_summary} from "@/api/sgyhpczl/summaryPotentialSafetyHzards";
import FileSaver from "file-saver";
import XLSX from "xlsx";
export default {
    name: "index"
    name: "index",
    data() {
        return {
            options: [{
                value: '选项1',
                label: '安全环保部'
            }, {
                value: '选项2',
                label: '生产技术部'
            }, {
                value: '选项3',
                label: '企管部'
            }, {
                value: '选项4',
                label: '消防保卫部'
            }, {
                value: '选项5',
                label: '质检中心'
            }],
            value1: [],
            value2: [],
            value3: [],
            value4: [],
            value5: [],
            value6: [],
            radio: 3,
            TJType: "ht_typesub",
            HZType: "ht_branch",
            time: [],
            tableData: [
                {}
            ],
            form: {
                x_axis: "ht_typesub",
                y_axis: "ht_branch"
            },
            JCDWList: [{label: "众泰煤焦化", value: 0}, {label: "上级单位", value: 1}],
            JCBMList: [],
            YHLXList: [],
            BCList: [],
            JCLBList: [],
            SJLBList: [],
            YHBMList: [],
            YHJBList: [],
            YHZTList: [],
            loading: false,
            searchData:{},
            startDate: "",
            endDate: "",
        }
    },
    mounted() {
        this.initYHLX()
        this.initYHJB()
        this.initBC()
        this.initJCLB()
        this.initLlr()
        this.initYHBM()
        this.initYHZT()
        this.initJCBM()
        this.initSJJCBM()
        let startDate = this.getCurrentMonthFirst();
        let endDate = this.getCurrentMonthLast();
        this.time.push(startDate, endDate);
        this.queryData();
    },
    methods: {
        initYHLX() {
            initYHLX().then(res => {
                if (res.data.ok == 1) {
                    this.YHLXList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        initYHJB() {
            initYHJB().then(res => {
                if (res.data.ok == 1) {
                    this.YHJBList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        initYHZT() {
            initReformStatus().then(res => {
                if (res.data.ok == 1) {
                    this.YHZTList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        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})
                }
            })
        },
        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})
                }
            })
        },
        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})
                }
            })
        },
        initJCBM() {
            initJCBM(0).then(res => {
                if (res.data.ok == 1) {
                    this.JCBMList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        initSJJCBM() {
            initJCBM(1).then(res => {
                if (res.data.ok == 1) {
                    this.SJLBList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        queryData() {
            let requestData = {};
            let selectData = []
            for (const queryElement in this.form) {
                if (queryElement != "x_axis" && queryElement != "y_axis") {
                    if (this.form[queryElement] != null && this.form[queryElement] != '') {
                        let searchCloumn = {
                            "field": queryElement,
                            "value": this.form[queryElement].join(','),
                            "type": "IN"
                        }
                        selectData.push(searchCloumn);
                    }
                } else {
                    requestData[queryElement] = this.form[queryElement];
                }
            }
            let timeSearchCloumn = {
                "field": "check_date",
                "value": this.time[0] + "至" + this.time[1],
                "type": "DAT"
            }
            selectData.push(timeSearchCloumn)
            requestData.query_condition = selectData;
            this.searchData = requestData;
            console.log(this.searchData)
            this.loading = true;
            danger_summary(requestData).then(res => {
                this.loading = false;
                if (res.data.ok == 1) {
                    this.tableData = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        getCurrentMonthFirst() {
            var date = new Date();
            date.setDate(1);
            var month = parseInt(date.getMonth() + 1);
            var day = date.getDate();
            if (month < 10) {
                month = '0' + month
            }
            if (day < 10) {
                day = '0' + day
            }
            return date.getFullYear() + '-' + month + '-' + day;
        },
        getCurrentMonthLast() {
            var date = new Date();
            var currentMonth = date.getMonth();
            var nextMonth = ++currentMonth;
            var nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1);
            var oneDay = 1000 * 60 * 60 * 24;
            var lastTime = new Date(nextMonthFirstDay - oneDay);
            var month = parseInt(lastTime.getMonth() + 1);
            var day = lastTime.getDate();
            if (month < 10) {
                month = '0' + month
            }
            if (day < 10) {
                day = '0' + day
            }
            return date.getFullYear() + '-' + month + '-' + day;
        },
        getRowNum(row, str) {
            var data = row.items.find(n => n.x_label == str);
            return data.value
        },
        showYHList(row, item) {
            var searchData = this.searchData;
            searchData.x_label = item.x_label;
            searchData.y_label = row.y_label;
            this.$router.push({
                path: "/summaryList",
                query: {"searchData": searchData}
            })
        },
        exportData() {
            var xlsxParam = {raw: true};
            /* 从表生成工作簿对象 */
            var wb = XLSX.utils.table_to_book(
                document.querySelector("#out-table"),
                xlsxParam
            );
            /* 获取二进制字符串作为输出 */
            var wbout = XLSX.write(wb, {
                bookType: "xlsx",
                bookSST: true,
                type: "array",
            });
            try {
                FileSaver.saveAs(
                    //Blob 对象表示一个不可变、原始数据的类文件对象。
                    //Blob 表示的不一定是JavaScript原生格式的数据。
                    //File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
                    //返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
                    new Blob([wbout], {type: "application/octet-stream"}),
                    //设置导出文件名称
                    "安全隐患汇总.xlsx"
                );
            } catch (e) {
                if (typeof console !== "undefined") console.log(e, wbout);
            }
            return wbout;
        }
    }
}
</script>
<style scoped>
.top {
    padding: 10px 5px;
    background: #e4edf4;
}
/*下拉框图标隐藏*/
.whole_top .select /deep/ .el-input__suffix-inner .is-reverse {
    display: none;
}
.whole_top .select /deep/ .el-input__suffix-inner .el-icon-arrow-up {
    display: none;
}
/*设下拉框颜色*/
.select /deep/ .el-input__inner {
    border: 1px solid #c5dbec;
    font-weight: bold;
    background: #dfeffc;
    /*.el-icon-circle-close*/
}
.whole_top .select /deep/ .el-select .el-input__inner:focus {
    color: #e6860b;
}
.select /deep/ .is-focus .el-select__tags-text {
    color: #000000;
}
/*下拉框选值之后的样式*/
.select /deep/ .el-tag.el-tag--info {
    background-color: transparent;;
    border-color: transparent;
    font-weight: bold;
    color: #e6860b;
}
/*placeholder颜色修改*/
.whole_top ::-webkit-input-placeholder {
    color: #000000;
}
.whole_top :-moz-placeholder {
    color: #000000;
}
.whole_top ::-moz-placeholder {
    color: #000000;
}
.whole_top :-ms-input-placeholder {
    color: #000000;
}
/*日期*/
/deep/ .el-date-editor .el-range-separator {
    width: auto;
}
.clickSpan:hover {
    cursor: pointer;
}
.btn {
    background-color: #034ea2;
    border: 1px solid #034ea2;
}
</style>
src/views/summaryPotentialSafetyHzards/summaryForm.vue
对比新文件
@@ -0,0 +1,386 @@
<template>
    <div class="app-container">
        <div>
            <Titlename title="发送隐患单"></Titlename>
            <div class="whole-form">
                <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="150px" class="demo-ruleForm"
                         style="margin: 0 14% 0 16%;">
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="隐患编号" prop="number">
                                <el-input v-model="ruleForm.number" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="检查单位" prop="check_main_branch">
                                <el-input v-model="ruleForm.check_main_branch" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="检查人" prop="check_man">
                                <el-input v-model="ruleForm.check_man" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="陪检人员" prop="acc_man">
                                <el-input v-model="ruleForm.acc_man" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="检查时间" prop="check_date">
                                <el-date-picker
                                    v-model="ruleForm.check_date"
                                    type="date"
                                    :disabled="true"
                                    placeholder="选择日期"
                                    style="width: 100%">
                                </el-date-picker>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="班次" prop="check_class">
                                <el-input v-model="ruleForm.check_class" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="跟班、带班情况" prop="name">
                                <el-input v-model="ruleForm.name" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="跟班、带班人员" prop="name">
                                <el-input v-model="ruleForm.name" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="行走路线" prop="route">
                                <el-input type="textarea" v-model="ruleForm.route" class="multiline" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="隐患单位" prop="ht_community">
                                <el-input v-model="ruleForm.ht_community" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="隐患部门" prop="ht_branch">
                                <el-input v-model="ruleForm.ht_branch" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="隐患地点" prop="address">
                                <el-input type="textarea" v-model="ruleForm.address" class="multiline" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="隐患内容" prop="ht_content">
                                <el-input type="textarea" v-model="ruleForm.ht_content" class="multiline" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="隐患类别" prop="ht_typesub">
                                <el-input v-model="ruleForm.ht_typesub" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="隐患级别" prop="ht_level">
                                <el-input v-model="ruleForm.ht_level" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="整改措施" prop="measure">
                                <el-input v-model="ruleForm.measure" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="所需资金" prop="name">
                                <el-input v-model="ruleForm.name" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="限改时间" prop="alter_time">
                                <el-date-picker
                                    v-model="ruleForm.alter_time"
                                    type="date"
                                    :disabled="true"
                                    placeholder="选择日期"
                                    style="width: 100%">
                                </el-date-picker>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="责任人" prop="duty_officer">
                                <el-input v-model="ruleForm.duty_officer" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="完成时间" prop="name">
                                <!--<el-input v-model="ruleForm.name"></el-input>-->
                                <el-date-picker
                                    v-model="value1"
                                    type="date"
                                    :disabled="true"
                                    placeholder="选择日期"
                                    style="width: 100%">
                                </el-date-picker>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="整改完成情况" prop="alter_status">
                                <el-input v-model="ruleForm.alter_status" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="复查时间" prop="name">
                                <!--<el-input v-model="ruleForm.name"></el-input>-->
                                <el-date-picker
                                    v-model="value1"
                                    type="date"
                                    :disabled="true"
                                    placeholder="选择日期"
                                    style="width: 100%">
                                </el-date-picker>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="复查人" prop="name">
                                <el-input v-model="ruleForm.name" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="复查结果" prop="name">
                                <el-input v-model="ruleForm.name" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="整改次数" prop="name">
                                <el-input v-model="ruleForm.name" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="危险源" prop="dangerousSource">
                                <el-input type="textarea" v-model="ruleForm.dangerousSource" class="multiline" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="9">
                            <el-form-item label="风险等级" prop="DTRisk_level">
                                <el-input v-model="ruleForm.DTRisk_level" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9" :offset="4">
                            <el-form-item label="业务科室" prop="Review">
                                <el-input v-model="ruleForm.Review" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="附件" prop="DTRisk_level">
                                <el-input v-model="ruleForm.DTRisk_level" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="流程信息" prop="name">
                                <!--                                <el-input v-model="ruleForm.name" class="multiline" :disabled="true"></el-input>-->
                                <el-table
                                    :data="tableData"
                                    border
                                    style="width: 100%">
                                    <el-table-column
                                        prop="date"
                                        label="步骤"
                                        align="center"
                                        width="60">
                                    </el-table-column>
                                    <el-table-column
                                        prop="name"
                                        label="操作人"
                                        align="center"
                                        width="138">
                                    </el-table-column>
                                    <el-table-column
                                        prop="province"
                                        label="处理时间"
                                        align="center"
                                        width="200">
                                    </el-table-column>
                                    <el-table-column
                                        prop="city"
                                        label="审批意见"
                                        align="center"
                                        width="260">
                                    </el-table-column>
                                    <el-table-column
                                        prop="address"
                                        label="流程信息"
                                        align="center"
                                        width="188">
                                    </el-table-column>
                                </el-table>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="22">
                            <el-form-item style="text-align: center;">
                                <el-button  class="btn" size="small" type="primary" @click="close()"
                                >关闭</el-button>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-form>
            </div>
        </div>
    </div>
</template>
<script>
    import Titlename from "../../components/Titlename/index.vue";
    import {getDangerInfo,next_step_do} from '@/api/sgyhpczl/hiddenDangerRegistration'
    import {deepClone} from '@/utils'
    export default {
        components: {Titlename},
        name: "hiddenDangerList",
        data() {
            return {
                id:'',
                ruleForm: {},
                rules: {
                    reviewTime: { required: true, message: '请填写复查时间', trigger: 'blur' },
                    rechecker: { required: true, message: '请填写复查人', trigger: 'blur' },
                    reviewResults: { required: true, message: '请填写复查结果', trigger: 'blur' },
                    desc1: { required: true, message: '复查不通过时请在备注说明原因!', trigger: 'blur' },
                },
                tableData: [],
                fileList: [],
            };
        },
        mounted(){
            this.id = this.$route.query.id;
            if( this.id!=null &&  this.id!=''){
                this.initInfo();
            }
        },
        methods: {
            async initInfo(){
                var res=await getDangerInfo(this.id)
                if (res.data.ok==1){
                    this.ruleForm=res.data.data
                    this.ruleForm.next='发送到'+res.data.data.ht_community+res.data.data.ht_branch
                }
            },
            submitForm(formName) {
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        var param={
                            id:this.id,
                            step: "1",
                            dealContent: this.ruleForm.dealContent
                        }
                        next_step_do(param).then(res=>{
                            if (res.data.ok==1){
                                this.$message({type:'success', message:"fas成功", duration:3000})
                                this.close()
                            }else {
                                this.$message({type:'error', message:res.data.msg, duration:3000})
                            }
                        })
                    } else {
                        console.log('error submit!!');
                        return false;
                    }
                });
            },
            handleRemove(file, fileList) {
                console.log(file, fileList);
            },
            handlePreview(file) {
                console.log(file);
            },
            beforeUpload(file) {
                var FileExt = file.name.replace(/.+\./, "");
                if (['jpg','png','bmp','gif','jpeg'].indexOf(FileExt.toLowerCase()) === -1){
                    this.$message({
                        type: 'warning',
                        message: '请上传后缀名为jpg、png、bmp、gif、jpeg的图片!'
                    });
                    return false;
                }
            },
            close(){
                this.$router.push({
                    path:"/hiddenDangerRegistration"
                })
            }
        }
    }
</script>
<style scoped>
    .app-container {
        padding: 20px;
        height: 850px;
        overflow-y: auto;
    }
    /deep/ .box {
        padding-top: 0;
    }
    /deep/ .multiline .el-input__inner {
        height: 62px;
    }
    /deep/ .textarea .el-textarea__inner{
        height: 80px;
        max-height: 80px;
        overflow-y: auto
    }
    /deep/ .textarea2 .el-textarea__inner{
        height: 100px;
        max-height: 100px;
        overflow-y: auto
    }
    .btn{
        background-color: #034ea2;
        border: 1px solid #034ea2;
    }
    /*.el-button:hover {*/
    /*    background: #66b1ff;*/
    /*    border-color: #66b1ff;*/
    /*    color: #FFF;*/
    /*}*/
</style>
src/views/summaryPotentialSafetyHzards/summaryList.vue
对比新文件
@@ -0,0 +1,377 @@
<template>
    <div class="app-container">
        <el-table :data="tableData" style="width: 100%" @selection-change="changeBox">
            <el-table-column type="selection" width="55" align="center"></el-table-column>
            <el-table-column prop="ht_community" label="单位" align="center" width="120"></el-table-column>
            <el-table-column prop="number" label="编号" align="center" width="120">
                <template slot-scope="scope">
                    <div class="blue-font-color" @click="showDetails(scope.row)">{{ scope.row.number }}</div>
                </template>
            </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">
                    <template slot-scope="scope">
                        <label>{{ formatDate(scope.row.check_date) }}</label><br/>
                        <label>{{ scope.row.check_class }}</label>
                    </template>
                </el-table-column>
                <el-table-column prop="address" label="地点" align="center">
                    <template slot-scope="scope">
                        <el-popover trigger="hover" placement="top">
                            <p>{{ scope.row.address }}</p>
                            <div slot="reference" class="name-wrapper">{{
                                    scope.row.address != null && scope.row.address.length > 10 ? scope.row.address.substring(0, 8) + "...." : scope.row.address
                                }}
                            </div>
                        </el-popover>
                    </template>
                </el-table-column>
                <el-table-column prop="ht_content" label="内容" align="center">
                    <template slot-scope="scope">
                        <el-popover trigger="hover" placement="top">
                            <p>{{ scope.row.ht_content }}</p>
                            <div slot="reference" class="name-wrapper">{{
                                    scope.row.ht_content != null && scope.row.ht_content.length > 10 ? scope.row.ht_content.substring(0, 8) + "...." : scope.row.ht_content
                                }}
                            </div>
                        </el-popover>
                    </template>
                </el-table-column>
                <el-table-column prop="ht_typesub" label="类别" align="center"></el-table-column>
                <el-table-column prop="ht_level" label="级别" width="100" align="center"></el-table-column>
            </el-table-column>
            <el-table-column label="整改计划" align="center">
                <el-table-column prop="measure" label="整改措施" width="150" 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" :formatter="formatColumnDate"
                                 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" :formatter="formatColumnDate"
                                 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" :formatter="formatColumnDate"
                                 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>
                </template>
            </el-table-column>
            <el-table-column prop="DTRisk_bankId" label="是否关联" align="center">
                <template slot-scope="scope">
                    <span style="color: red"
                          v-if="scope.row.DTRisk_bankId==0 || scope.row.DTRisk_bankId=='' || scope.row.DTRisk_bankId==null">未关联</span>
                    <span v-else>已关联</span>
                </template>
            </el-table-column>
            <el-table-column prop="DTRisk_level" label="风险等级" align="center"></el-table-column>
            <el-table-column prop="warningLevel" label="初始警情" align="center"></el-table-column>
            <el-table-column prop="curWarningLevel" label="当前警情" align="center"></el-table-column>
            <!-- <el-table-column prop="date" label="流程操作" align="center"  fixed="right">
                <template slot-scope="scope">
                    <el-button @click="handleClick(scope.row)" type="text" size="small">点击发送</el-button>
                </template>
            </el-table-column> -->
            <!-- <el-table-column prop="date" label="操作" align="center"  fixed="right">
                <template slot-scope="scope">
                    <el-button @click="updateClick(scope.row)" type="text" size="small">编辑</el-button>
                    <el-button @click="deleteClick(scope.row)" type="text" size="small">删除</el-button>
                </template>
            </el-table-column> -->
        </el-table>
        <div style="text-align: right">
            <el-pagination
                v-show="recordTotal > 0"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-sizes="[10, 20, 30, 50]"
                :page-size="pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="recordTotal"
            >
            </el-pagination>
        </div>
        <div class="btn">
            <el-button size="small" @click="close()">关闭</el-button>
        </div>
    </div>
</template>
<script>
import {getPageList} from "@/api/sgyhpczl/summaryPotentialSafetyHzards.js";
import {initJCBM, initYHLX, initBC, initJCLB, initYHBM, initYHJB, initLlr} from "@/api/sgyhpczl/initSelect";
export default {
    data() {
        return {
            radio1: '超期整改',
            selectedList: [],
            reList: [{label: "未关联", value: 0}],
            llrList: [],
            options: [],
            form: {},
            JCDWList: [{label: "众泰煤焦化", value: 0}, {label: "上级单位", value: 1}],
            JCBMList: [],
            YHLXList: [],
            BCList: [],
            JCLBList: [],
            YHBMList: [],
            YHJBList: [],
            tableData: [],
            listQuery: {
                page: 1,
                limit: 10,
                type: 0,
                form: {
                    // ht_community:"众泰煤焦化"
                },
            },
            currentPage: 1,
            pageSize: 10,
            recordTotal: 0,
        };
    },
    mounted() {
        if (this.$route.query.searchData.query_condition != null) {
            var searchData = this.$route.query.searchData;
            for (const argumentsKey in searchData) {
                this.listQuery[argumentsKey] = searchData[argumentsKey];
            }
            this.getPageList()
        }
        this.initYHLX()
        this.initYHJB()
        this.initBC()
        this.initJCLB()
        this.initLlr()
        this.initYHBM()
    },
    methods: {
        changeBox(val) {
            this.selectedList = []
            val.forEach((item) => {
                this.selectedList.push(item)
            })
        },
        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})
                }
            })
        },
        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})
                }
            })
        },
        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})
                }
            })
        },
        checkTime() {
            if (this.listQuery.form.check_dateStart != null && this.listQuery.form.check_dateStart != '') {
                if (this.listQuery.form.check_dateEnd != null && this.listQuery.form.check_dateEnd != '') {
                } else {
                    this.$message({type: 'error', message: "请选择检查结束时间", duration: 3000})
                    return
                }
            }
            if (this.listQuery.form.check_dateEnd != null && this.listQuery.form.check_dateEnd != '') {
                if (this.listQuery.form.check_dateStart != null && this.listQuery.form.check_dateStart != '') {
                } else {
                    this.$message({type: 'error', message: "请选择检查开始时间", duration: 3000})
                    return
                }
            }
            if (this.listQuery.form.alter_timeStart != null && this.listQuery.form.alter_timeStart != '') {
                if (this.listQuery.form.alter_timeEnd != null && this.listQuery.form.alter_timeEnd != '') {
                } else {
                    this.$message({type: 'error', message: "请选择限改结束时间", duration: 3000})
                    return
                }
            }
            if (this.listQuery.form.alter_timeEnd != null && this.listQuery.form.alter_timeEnd != '') {
                if (this.listQuery.form.alter_timeStart != null && this.listQuery.form.alter_timeStart != '') {
                } else {
                    this.$message({type: 'error', message: "请选择改开始时间", duration: 3000})
                    return
                }
            }
        },
        getPageList() {
            this.listQuery.page = 1
            getPageList(this.listQuery).then(res => {
                if (res.data.ok == 1) {
                    this.tableData = res.data.data.items
                    this.recordTotal = res.data.data.total
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        reset() {
            this.listQuery.form = {ht_community: "众泰煤焦化"}
            this.getPageList()
        },
        handleSizeChange(val) {
            this.listQuery.limit = val
            this.getPageListForPagination();
        },
        handleCurrentChange(val) {
            this.listQuery.page = val
            this.getPageListForPagination();
        },
        getPageListForPagination() {
            this.checkTime()
            getPageList(this.listQuery).then(res => {
                if (res.data.ok == 1) {
                    this.tableData = res.data.data.items
                    this.recordTotal = res.data.data.total
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        initYHLX() {
            initYHLX().then(res => {
                if (res.data.ok == 1) {
                    this.YHLXList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        initYHJB() {
            initYHJB().then(res => {
                if (res.data.ok == 1) {
                    this.YHJBList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        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})
                }
            })
        },
        //方法区
        formatDate(data) {
            // 获取单元格数据
            if (data == null) {
                return null
            }
            let dt = new Date(data)
            return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate()
        },
        //方法区
        formatColumnDate(row, column) {
            // 获取单元格数据
            let data = row[column.property]
            if (data == null) {
                return null
            }
            let dt = new Date(data)
            return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + ' '
        },
        showDetails(row) {
            this.$router.push({
                path: "/dangerDetails",
                query: {"id": row.id, "route": "/summaryList"}
            })
        },
        close() {
            this.$router.push({
                path: "/summaryPotentialSafetyHzards"
            })
        }
    }
};
</script>
<style scoped>
.inquire {
    display: flex;
    justify-content: left;
    flex-wrap: wrap;
}
.inquire .el-form-item {
    padding: 0 30px;
}
.title-center {
    padding: 20px 0;
}
.btns {
    background-color: #034ea2;
    border: 1px solid #034ea2;
}
.title-center /deep/ .el-radio-button:first-child .el-radio-button__inner {
    border: none;
}
.title-center /deep/ .el-radio-button__inner {
    border: none;
    border-radius: 0px;
}
.title-center /deep/ .el-radio-button__orig-radio:checked + .el-radio-button__inner {
    background-color: #034ea2;
    background-color: #034ea2;
}
.btn {
    text-align: center;
    margin-top: 20px;
}
.blue-font-color:hover {
    cursor: pointer;
    color: blue;
}
</style>
src/views/troubleshooting/index.vue
对比新文件
@@ -0,0 +1,655 @@
<template>
  <div class="app-container">
    <el-form
      ref="form"
      :inline="true"
      class="inquire"
      :model="listQuery.form"
      label-width="100px"
    >
      <el-form-item label="地点">
        <el-input v-model="listQuery.form.ADDRESS" style="width: 202px" placeholder="请输入内容"></el-input>
      </el-form-item>
      <el-form-item label="主持人">
        <el-input v-model="listQuery.form.HOST" style="width: 202px" placeholder="请输入内容"></el-input>
      </el-form-item>
      <el-form-item label="召开时间">
        <el-col :span="11">
          <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.Conference_TimeStart" style="width: 100%" value-format="yyyy-MM-dd"></el-date-picker>
        </el-col>
        <el-col style="text-align: center" :span="2">-</el-col>
        <el-col :span="11">
          <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.Conference_TimeEnd" style="width: 100%" value-format="yyyy-MM-dd"></el-date-picker>
        </el-col>
      </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-form-item>
    </el-form>
    <el-row class="title-center">
        <el-col :span="5">
            <el-radio-group v-model="listQuery.type" @change="typeChange">
                <el-radio-button label="0">未上报</el-radio-button>
                <el-radio-button label="1">已上报</el-radio-button>
                <el-radio-button label="2">上级公司会议</el-radio-button>
            </el-radio-group>
      </el-col>
      <div v-if="listQuery.type==0">
        <el-col :span="15">
            <el-col :span="4" :offset="offset" style="text-align: right;">
                <span style="line-height: 36px; font-size: 14px; color: #606266;margin-right:10px;font-weight: bold;">请选择上报方式</span>
            </el-col>
            <el-col :span="4">
                <el-select v-model="upType" placeholder="请选择" @change="changeUpType">
                    <el-option v-for="item in upTypeList" :key="item.value" :label="item.label" :value="item.value">
                    </el-option>
                </el-select>
            </el-col>
            <div v-if="upType == 2">
                <el-col :span="5" :offset="1">
                    <el-date-picker type="date" placeholder="选择日期" v-model="upTimeStart" style="width: 100%" value-format="yyyy-MM-dd"></el-date-picker>
                </el-col>
                <el-col style="text-align: center" :span="1">
                    <span style="line-height: 36px; font-size: 14px; color: #606266;font-weight: bold;">至</span>
                </el-col>
                <el-col :span="5">
                    <el-date-picker type="date" placeholder="选择日期" v-model="upTimeEnd" style="width: 100%" value-format="yyyy-MM-dd"></el-date-picker>
                </el-col>
            </div>
                <el-col :span="2" style="text-align: right">
                    <el-button type="primary" class="btns" size="small" @click="putBatch">上报</el-button>
                </el-col>
        </el-col>
        <el-col :span="4" style="text-align: right">
          <el-button class="btns" type="primary" size="small" icon="el-icon-plus" @click="addMeeting">添加</el-button>
          <el-button class="btns" type="primary" size="small" icon="el-icon-close" @click="deleteBatch()">批量删除</el-button>
        </el-col>
      </div>
       <div v-if="listQuery.type==1">
        <el-col :span="18" style="text-align: right">
          <el-button class="btns" type="primary" size="small" @click="revokeBatch">撤销</el-button>
        </el-col>
      </div>
    </el-row>
    <el-row class="title-center">
      <el-col :span="10">
        <el-radio-group v-model="listQuery.form.CONFERENCE_PROFESSIONAL" @change="changeType2">
          <el-radio-button label="0">全部</el-radio-button>
          <el-radio-button label="综合">综合</el-radio-button>
          <el-radio-button label="生产">生产</el-radio-button>
          <el-radio-button label="设备">设备</el-radio-button>
          <el-radio-button label="电器">电器</el-radio-button>
          <el-radio-button label="仪表">仪表</el-radio-button>
          <el-radio-button label="消防">消防</el-radio-button>
          <el-radio-button label="安全管理">安全管理</el-radio-button>
          <el-radio-button label="其他">其他</el-radio-button>
        </el-radio-group>
      </el-col>
    </el-row>
    <el-table :data="tableData" style="width: 100%" @selection-change="handleSelectionChange" v-loading="listLoading">
        <el-table-column type="selection" width="55" align="center"></el-table-column>
        <el-table-column v-if="listQuery.type==2" prop="communityname" label="会议单位" align="center" width="120"></el-table-column>
        <el-table-column prop="CONFERENCE_TIME" label="召开时间" :formatter="formatColumnDate" align="center" width="120"></el-table-column>
        <el-table-column prop="ADDRESS" label="地点" align="center" width="120"></el-table-column>
        <el-table-column prop="HOST" label="主持人" align="center" width="120"></el-table-column>
        <el-table-column prop="CONFERENCE_PROFESSIONAL" label="会议专业" align="center" width="120"></el-table-column>
        <el-table-column prop="meeting_content" label="会议摘要" align="center">
            <template slot-scope="scope">
                <el-popover trigger="hover" placement="top">
                    <p>{{ scope.row.meeting_content }}</p>
                    <div slot="reference" class="name-wrapper">{{
                            scope.row.meeting_content != null && scope.row.meeting_content.length > 20 ? scope.row.meeting_content.substring(0, 18) + "...." : scope.row.meeting_content
                        }}
                    </div>
                </el-popover>
            </template>
        </el-table-column>
        <el-table-column prop="realFileName" label="会议纪要" align="center">
            <template slot-scope="scope" >
                <div v-for="item in scope.row.realFileName">
                    <el-link  type="primary" @click="downloadFile(subFile(item))">
                        {{subFile(item)}}
                    </el-link>
                </div>
            </template>
        </el-table-column>
        <el-table-column prop="date" v-if="listQuery.type==0" label="基本操作" align="center">
            <template slot-scope="scope">
                <el-button @click="editMeeting(scope.row)" type="text" size="small">编辑</el-button>
<!--                <el-button @click="updateClick(scope.row)" type="text" size="small">保存</el-button>-->
                <el-button @click="deleteMeeting(scope.row)" type="text" size="small">删除</el-button>
            </template>
        </el-table-column>
    </el-table>
    <div style="text-align: right">
      <el-pagination
        v-show="recordTotal > 0"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-sizes="[10, 20, 30, 50]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="recordTotal"
      >
      </el-pagination>
    </div>
      <el-dialog
          :title="title"
          :visible.sync="dialogVisible"
          :close-on-click-modal="false"
          width="40%">
          <el-form ref="form" :rules="meetingRules" :model="meetingForm" label-width="100px">
              <el-row>
                  <el-col :span="9">
                      <el-form-item label="召开时间" prop="CONFERENCE_TIME">
                          <el-date-picker type="date" placeholder="选择日期"
                                          v-model="meetingForm.CONFERENCE_TIME"
                                          style="width: 100%" value-format="yyyy-MM-dd"
                          ></el-date-picker>
                      </el-form-item>
                  </el-col>
                  <el-col :span="9" :offset="4">
                      <el-form-item label="会议专业" prop="CONFERENCE_PROFESSIONAL">
                          <el-select v-model="meetingForm.CONFERENCE_PROFESSIONAL" placeholder="请选择">
                              <el-option
                                  v-for="item in YHLXList"
                                  :key="item.value"
                                  :label="item.label"
                                  :value="item.value">
                              </el-option>
                          </el-select>
                      </el-form-item>
                  </el-col>
              </el-row>
              <el-row>
                  <el-col :span="9">
                      <el-form-item label="地点" prop="ADDRESS">
                          <el-input v-model="meetingForm.ADDRESS" rows="3" type="textarea" class="multiline"></el-input>
                      </el-form-item>
                  </el-col>
                  <el-col :span="9" :offset="4">
                      <el-form-item label="主持人" prop="HOST">
                          <el-input v-model="meetingForm.HOST" rows="3" type="textarea" class="multiline"></el-input>
                      </el-form-item>
                  </el-col>
              </el-row>
              <el-row>
                  <el-col :span="22">
                      <el-form-item label="会议摘要" prop="meeting_content">
                          <el-input v-model="meetingForm.meeting_content" rows="3" type="textarea" class="multiline"></el-input>
                      </el-form-item>
                  </el-col>
              </el-row>
              <el-row>
                  <el-col :span="22" >
                      <el-form-item label="会议纪要" prop="realFileName">
                          <el-upload
                              class="upload-demo"
                              ref="upload"
                              action="https://jsonplaceholder.typicode.com/posts/"
                              :http-request="uploadSectionFile"
                              :on-preview="handlePreview"
                              :on-remove="handleRemove"
                              :file-list="fileList"
                              :before-upload="beforeUpload"
                              :auto-upload="true">
                              <el-button slot="trigger" size="small" type="primary" class="btns">上传附件</el-button>
                          </el-upload>
                      </el-form-item>
                  </el-col>
              </el-row>
              <el-row>
                  <el-col :span="22">
                      <el-form-item style="text-align: center">
                          <el-button type="primary" class="btns" @click="submitFrom('form')">
                              保存
                          </el-button>
                          <el-button @click="dialogVisible=false">关闭</el-button>
                      </el-form-item>
                  </el-col>
              </el-row>
          </el-form>
      </el-dialog>
  </div>
</template>
<script>
import {getPageList,addOrEdit, del, revoke, upload_do} from "@/api/sgyhpczl/troubleshooting";
import {uploadFile} from "@/api/sgyhpczl/hiddenDangerRectification";
import {deepClone} from '@/utils'
import {downloadFile} from "@/api/sgyhpczl/fileUtils";
import {
  initYHLX,
} from "@/api/sgyhpczl/initSelect";
export default {
    data() {
        return {
            listQuery: {
            page: 1,
            limit: 10,
            type: 0,//type=0 待上报 type=1 已上报 type=2 上级公司会议
            form: {
                CONFERENCE_PROFESSIONAL: '0'
            },
            },
            form: {},
            currentPage: 1,
            pageSize: 10,
            recordTotal: 0,
            YHLXList:[],
            tableData: [],
            selectedList: [],
            listLoading: false,
            // fileList:[{name:'aa.doc',url:'sssss.doc'}],
            fileList:[],
            upTypeList:[{label:"按勾选上报",value:0},{label:"按时间上报",value:2}],
            upType:0,
            upTimeStart:'',
            upTimeEnd:'',
            offset: 14,
            title:'',
            dialogVisible:false,
            meetingForm:{},
            meetingRules:{
                CONFERENCE_TIME: [{ required: true, message: '不能为空', trigger: 'blur' },],
                ADDRESS: [{ required: true, message: '不能为空', trigger: 'blur' },],
                HOST: [{ required: true, message: '不能为空', trigger: 'blur' },],
                meeting_content: [{ required: true, message: '不能为空', trigger: 'blur' },],
                CONFERENCE_PROFESSIONAL: [{ required: true, message: '不能为空', trigger: 'blur' },],
            },
        };
  },
    mounted() {
        this.getPageList();
        this.initYHLX();
    },
  methods: {
      initYHLX(){
          initYHLX().then(res=>{
              if (res.data.ok==1){
                  this.YHLXList=res.data.data
              } else{
                  this.$message({type:'error', message:res.data.msg, duration:3000})
              }
          })
      },
      changeUpType(val){
        this.upType = val;
          if (val == 2){
              this.offset = 2;
          }else {
              this.offset = 14;
          }
      },
      checkTime(){
          if(this.listQuery.form.Conference_TimeStart!=null && this.listQuery.form.Conference_TimeStart!=''){
              if(this.listQuery.form.Conference_TimeEnd!=null && this.listQuery.form.Conference_TimeEnd!=''){
              }else {
                  this.$message({type:'error', message:"请选择检查结束时间", duration:3000})
                  return
              }
          }
      },
    //搜索
    getPageList() {
      this.listQuery.page = 1;
      this.checkTime();
      this.listLoading = true
      getPageList(this.listQuery).then((res) => {
          this.listLoading = false
          if (res.data.ok == 1) {
          this.tableData = res.data.data.items;
          this.recordTotal = res.data.data.total;
        } else {
          this.$message({
            type: "error",
            message: res.data.msg,
            duration: 3000,
          });
        }
      });
    },
    //重置
    reset() {
      this.listQuery.form = {
          CONFERENCE_PROFESSIONAL: '0'
      };
      this.getPageList();
    },
    handleSizeChange(val) {
      this.listQuery.limit = val;
      this.getPageListForPagination();
    },
    handleCurrentChange(val) {
      this.listQuery.page = val;
      this.getPageListForPagination();
    },
    getPageListForPagination() {
      this.checkTime();
      getPageList(this.listQuery).then((res) => {
        if (res.data.ok == 1) {
          this.tableData = res.data.data.items;
          this.recordTotal = res.data.data.total;
        } else {
          this.$message({
            type: "error",
            message: res.data.msg,
            duration: 3000,
          });
        }
      });
    },
    typeChange(val) {
      this.listQuery.type = val;
      this.getPageList();
    },
      changeType2(val){
          this.listQuery.form.CONFERENCE_PROFESSIONAL = val;
          this.getPageList();
      },
    handleSelectionChange(val) {
      this.selectedList = [];
      val.forEach((item) => {
        this.selectedList.push(item);
      });
    },
      uploadSectionFile(param) {
          let form = new FormData();
          form.append('file', param.file);
          form.append('type', "1");
          uploadFile(form).then(res => {
              var data = res.data;
              if (data.ok) {
                  var fileName = data.data.fileName[0];
                  if (!fileName.endsWith("a62b")) {
                      fileName = fileName + "a62b";
                  }
                  this.fileList.push({name:fileName,url:fileName})
              }
          }).error(res => {
              this.$message({
                  type: 'error',
                  message: '附件上传失败,请重试!'
              });
          })
      },
      downloadFile(path){
          let params = {
              type: 1,
              fileName: path,
          };
          downloadFile(params).then((res) => {
              if(res.data.type=='text/json'){
                  const reader  = new FileReader();  //创建一个FileReader实例
                  reader.readAsText(res.data, 'utf-8'); //读取文件,结果用字符串形式表示
                  //读取完成后,**获取reader.result**
                    reader.onload = e => {
                        this.$message({
                            type: "error",
                            message: JSON.parse(reader.result).msg,
                            duration: 3000,
                        });
                    }
              } else {
                  let blob = new Blob([res.data], {type: 'application/octet-stream'})
                  console.log(blob)
                  // 创建下载的链接
                  let blobUrl = window.URL.createObjectURL(blob)
                  let downloadElement = document.createElement('a')
                  downloadElement.href = blobUrl
                  //下载后文件名
                  downloadElement.download = path
                  document.body.appendChild(downloadElement)
                  //点击下载
                  downloadElement.click()
                  //下载完成移除元素
                  document.body.removeChild(downloadElement)
                  // 释放掉blob对象
                  window.URL.revokeObjectURL(blobUrl)
              }
          });
      },
      subFile(fileName){
        return  fileName.substring(fileName.indexOf("fileName=")+9)
      },
      //删除上传组件文件
      handleRemove(file, fileList) {
          this.fileList = fileList;
      },
      //点击上传组件-文件列表
      handlePreview(file) {
          this.downloadFile(file.url)
      },
      beforeUpload(file) {
          var FileExt = file.name.replace(/.+\./, "");
          if (['doc', 'docx', 'pdf', 'ppt', 'pptx','xls','xlsx','rar','zip'].indexOf(FileExt.toLowerCase()) === -1) {
              this.$message({
                  type: 'warning',
                  message: '请上传正确格式的文件!(.doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx,.rar,.zip)'
              });
              return false;
          }
      },
      editMeeting(row, index) {
          this.meetingForm = deepClone(row);
          this.rowIndex = index;
          this.dialogVisible = true;
          this.title = '编辑';
          this.fileList = [];
          const arr = this.meetingForm.realFileName;
          for (let i = 0; i < arr.length; i++) {
              this.fileList.push({name:this.subFile(arr[i]),url:this.subFile(arr[i])})
          }
      },
      addMeeting(){
          this.fileList = [];
          this.meetingForm={}
          this.title="新增"
          this.dialogVisible=true
      },
      //提交表单
      submitFrom(formName){
          let fileStr = '';
          if (this.fileList.length != 0){
              this.fileList.forEach((item,index,arr)=>{
                  if (item.url.endsWith("a62b")) {
                      fileStr = fileStr + item.url;
                  }else {
                      fileStr = fileStr + item.url + "a62b";
                  }
              })
          }
          this.meetingForm.realFileName = fileStr;
          console.log(this.meetingForm)
          this.$refs[formName].validate((valid) => {
              if (valid) {
                  addOrEdit(this.meetingForm).then(res=>{
                      if (res.data.ok==1) {
                          this.dialogVisible=false
                          this.$message({type:'success', message:res.data.msg, duration:3000})
                          this.getPageList()
                      }else{
                          this.$message({type:'error', message:res.data.msg, duration:3000})
                      }
                  })
              } else {
                  console.log("error submit!!");
                  return false;
              }
          });
      },
      deleteBatch() {
          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(",")
          this.$confirm('确认删除吗', '提示', {
              confirmButtonText: '确认',
              cancelButtonText: '取消',
              type: 'warning'
          }).then(() => {
              del(ids).then(() => {
                  this.getPageList()
                  this.$notify({
                      title: "成功",
                      message: "删除成功",
                      type: "success",
                      duration: 2000,
                  });
              });
          })
              .catch(error => {
              });
      },
      deleteMeeting(row) {
          this.$confirm('确认删除吗', '提示', {
              confirmButtonText: '确认',
              cancelButtonText: '取消',
              type: 'warning'
          }).then(() => {
              console.log(row.id)
              del(row.id).then(() => {
                  this.getPageList()
                  this.$notify({
                      title: "成功",
                      message: "删除成功",
                      type: "success",
                      duration: 2000,
                  });
              });
          }).catch(error => {
          });
      },
      //撤销
      revokeBatch() {
          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(",")
          this.$confirm('确认撤销吗', '提示', {
              confirmButtonText: '确认',
              cancelButtonText: '取消',
              type: 'warning'
          }).then(() => {
              let data = {
                  id:ids
              }
              revoke(data).then(() => {
                  this.getPageList()
                  this.$notify({
                      title: "成功",
                      message: "撤销成功",
                      type: "success",
                      duration: 2000,
                  });
              });
          }).catch(error => {
          });
      },
      //上报
      putBatch() {
          let data = {}
          if (this.upType == 0){
              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(",")
              data = {
                  type: this.upType,
                  id: ids,
              }
          }else {
              data = {
                  type: this.upType,
                  time: this.upTimeStart+'至'+this.upTimeEnd,
              }
          }
          this.$confirm('确认上报吗', '提示', {
              confirmButtonText: '确认',
              cancelButtonText: '取消',
              type: 'warning'
          }).then(() => {
              upload_do(data).then(() => {
                  this.getPageList()
                  this.$notify({
                      title: "成功",
                      message: "上报成功",
                      type: "success",
                      duration: 2000,
                  });
              });
          }).catch(error => {
          });
      },
    //日期格式转换
    formatColumnDate(row, column) {
      // 获取单元格数据
      let data = row[column.property];
      if (data == null) {
        return null;
      }
      let dt = new Date(data);
      return (
        dt.getFullYear() + "-" + (dt.getMonth() + 1) + "-" + dt.getDate() + " "
      );
    },
  },
};
</script>
<style scoped>
.inquire {
  display: flex;
  justify-content: left;
  flex-wrap: wrap;
}
.inquire .el-form-item {
  padding: 0 20px;
}
.title-center {
  padding: 20px 0;
}
.btns {
  background-color: #034ea2;
  border: 1px solid #034ea2;
}
.title-center /deep/ .el-radio-button:first-child .el-radio-button__inner {
  border: none;
}
.title-center /deep/ .el-radio-button__inner {
  border: none;
  border-radius: 0px;
}
.title-center
  /deep/
  .el-radio-button__orig-radio:checked
  + .el-radio-button__inner {
  background-color: #034ea2;
  background-color: #034ea2;
}
</style>