<template>
    <div class="checkInfo">
        <div class="region">
            <el-table :data="list" border style="width: 100%">
                <el-table-column type="index" align="center" show-overflow-tooltip label="序号" width="60"></el-table-column>
                <el-table-column prop="jgId" align="center" show-overflow-tooltip label="任务编号" ></el-table-column>
                <el-table-column prop="rwmc" align="center" show-overflow-tooltip label="任务名称" ></el-table-column>
                <el-table-column prop="rwlxMc" align="center" show-overflow-tooltip label="任务类型">
                </el-table-column>
                <el-table-column prop="bjdwName" align="center" show-overflow-tooltip label="被检单位"></el-table-column>
                <el-table-column prop="jcdwmc" align="center" show-overflow-tooltip label="检查单位"></el-table-column>
                <el-table-column prop="jcsj" align="center" show-overflow-tooltip label="检查时间"></el-table-column>
                <el-table-column prop="jgZglxmc" align="center" show-overflow-tooltip label="整改类型"></el-table-column>
                <el-table-column prop="address" align="center" show-overflow-tooltip label="操作">
                    <template slot-scope="scope">
                        <el-tooltip class="item" effect="light" content="查看" placement="top"
                                    v-if="scope.row.sfgs === '1'">
                            <i class="iconfont iconchakan2"
                               @click="showInfo(scope.row.jgId,scope.row.rwlxId)"
                               style="width:24px;
						height:24px;
						float:left;
						text-align:center;
						line-height:24px;
						font-size:13px;
						color:#fff;
						background:#67c23a;
						border-radius:3px;
						cursor:pointer;
						display:inline-block;"></i>
                        </el-tooltip>
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <div style="margin-top: 10px;text-align:center;">
            <el-button type="primary" icon="iconfont iconfanhui" @click="cancel">返回</el-button>
        </div>
    </div>
</template>
<script>
    import {getParameter} from "@/utils";
    import {getCheckResultList} from "@/api/enterpriseInformationBase/index";

    export default {
        name: "enterpriseInformationDetail",
        props: [ "formQuery"],
        data() {
            return {
                list:[],
                qymc: null,
            };
        },
        mounted() {
        },
        watch: {
            formQuery(val, oldVal) {
                if (val !== oldVal) {
                    this.getInfo();
                }
            }
        },
        methods: {
            cancel() {
                this.$router.go(-1)
            },
            showInfo(jgId,rwlxId){
                if(rwlxId == '5000110'){
                    let obj = {
                        changeTitle: "结果反馈",
                        changeSubTitle: "日常检查结果",
                        changeSubGnTitle: "查看"
                    };
                    this.$router.push({ path:"/inspection/dailyCheckResultDetail", query: {jgId:jgId,obj:JSON.stringify(obj)}});
                }else if(rwlxId == '5000120'){
                    let obj = {
                        changeTitle: "结果反馈",
                        changeSubTitle: "防汛检查结果",
                        changeSubGnTitle: "查看"
                    };
                    this.$router.push({ path:"/inspection/floodPreventionCheckDetail", query: {jgId:params.row.jgId,obj:JSON.stringify(obj)}});
                }else if(rwlxId == '5000160'){
                    let obj = {
                        changeTitle: "结果反馈",
                        changeSubTitle: "专项检查-粮食储备处",
                        changeSubGnTitle: "查看"
                    };
                    this.$router.push({ path:"/inspection/specialPreventionCheckDetailReserves", query: {jgId:params.row.jgId,obj:JSON.stringify(obj)}});
                }else{

                }

            },
            getInfo(){
                let data = {
                    bjdwName: this.formQuery.qymc,
                    pageNum: 1,
                    pageSize: 10000,
                }
                getCheckResultList(data).then((res)=>{
                    if(res.infoCode && res.infoCode == 200){
                        this.list = res.data.items;
                        this.list.forEach(item=>{
                            if(item.jgTbbh == '5'){
                                item.jgTbmc = '待整改'
                            }else if(item.jgTbbh == '33'){
                                item.jgTbmc = '组长审批'
                            }
                        })
                    }
                }).catch(()=>{
                })
            },
        }
    };
</script>
<style scoped>
    .companyInfo {
        margin: 10px;
    }
    .takeover {
        margin-top: 20px;
    }
</style>
