郑永安
2023-06-19 2befd4a5d3733520b69ed97da88e675b6b086a3c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<template>
    <el-dialog
        :visible.sync="dialogVisible"
        append-to-body
        :close-on-click-modal="false"
        width="80%"
        center
    >
        <div class="table_cont">
 
            <el-table
                v-loading="listLoading"
                :key="tableKey"
                :data="checkList"
                border
                fit
                highlight-current-row
                style="width: 100%;"
            >
 
                <el-table-column type="index" label="序号" align="center" width="80"/>
                <el-table-column label="被检查企业" prop="enterpriseName" align="center" width="180"></el-table-column>
                <el-table-column label="检查单位" prop="checkName" align="center"></el-table-column>
                <el-table-column label="隐患总数" prop="hiddendangerSum" align="center"></el-table-column>
                <el-table-column label="重大隐患总数" prop="majorHiddendangerNum" align="center"></el-table-column>
                <el-table-column label="整改数量" prop="completedRectifyHiddendangerSum" width="130" align="center" sortable></el-table-column>
                <el-table-column label="重大隐患整改数量" prop="completedRectifyMajorHiddendangerNum" align="center"></el-table-column>
                <el-table-column label="是否外埠检查" align="center">否</el-table-column>
                <el-table-column label="检查时间" prop="checkTime" align="center"></el-table-column>
                <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
                    <template slot-scope="scope">
                        <el-button type="text" @click="toCheck(scope.row.id)">查看</el-button>
                    </template>
                </el-table-column>
            </el-table>
 
            <el-pagination
                v-show="recordTotal>0"
                :current-page="pageIndex"
                :page-sizes="[10, 20, 30, 50]"
                :page-size="pageSize"
                :total="recordTotal"
                layout="total, sizes, prev, pager, next, jumper"
                background
                style="float:right;margin:3px"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
            />
        </div>
        <span slot="footer" class="dialog-footer">
          <el-button type="primary" @click="dialogVisible = false">确认</el-button>
        </span>
<!--        <check-details ref="report"></check-details>-->
        <supervision-details ref="report"></supervision-details>
    </el-dialog>
</template>
 
<script>
    import {computePageCount} from "@/utils";
    import { getSpotCheckRecord } from "@/api/specialCheck";
    // import checkDetails from "../../selfCheck/components/checkDetails"
    import supervisionDetails from "../../selfCheck/components/supervisionDetails"
 
    export default {
        name: "checkEnterprises",
        components: {
            supervisionDetails
        },
        data(){
            return{
                taskId: null,
                enterpriseType: null,
                checkUnitType: null,
                enterpriseCity: '',
                enterpriseArea: '',
                listLoading: false,
                recordTotal: 0,
                pageSize: 10,
                pageIndex: 1,
                tableKey: 0,
                dialogVisible:false,
                checkList:[]
            }
        },
        created() {
            // this.getEnterprises()
        },
        watch: {
        },
        methods:{
            handleSizeChange: function (val) {
                this.pageSize = val
                this.pageIndex = 1
                this.getEnterprises()
            },
            handleCurrentChange: function (val) {
                this.pageIndex = val
                this.getEnterprises()
            },
 
            async getEnterprises(){
                const t = this
                t.listLoading = true
                const data = {taskId: t.taskId,enterpriseType:t.enterpriseType,enterpriseCity:t.enterpriseCity,enterpriseArea:t.enterpriseArea,pageIndex:t.pageIndex,pageSize:t.pageSize}
                let res = await getSpotCheckRecord(data)
                if(res.data.code === "200"){
                    t.checkList = res.data.result.records
                    t.recordTotal = res.data.result.total
                }else{
                    t.$message({
                        type:'warning',
                        message:res.data.message
                    })
                }
                t.listLoading = false
            },
 
            toCheck(id){
                const t = this
                t.$refs.report.id = id
                t.$refs.report.enterpriseType = t.enterpriseType
                t.$refs.report.checkUnitType = t.checkUnitType
                t.$refs.report.getEnterpriseInfo()
                t.$refs.report.dialogVisible = true
            }
        },
    }
</script>
 
<style lang="scss" scoped>
    .input-with-select .el-select {
        width: 120px;
    }
 
    .el-date-editor.el-input{
        width: 100%;
    }
 
    .el-divider__text{
        background-color: #fafafa;
        color: #034EA2;
    }
 
    .table_cont{
        width: 100%;
    }
</style>