马宇豪
2025-04-23 34ec919649adfefeecd0418284dd7b02e9ed49b8
src/views/specialCheck/components/wholesaleForm.vue
@@ -2,18 +2,18 @@
    <div class="table">
        <div class="filter-container">
            <div class="table-tit">
                <h2 v-show="enterpriseType == 1">2023年上半年烟花爆竹生产经营安全检查(批发)</h2>
                <h2 v-show="enterpriseType == 2">2023年上半年烟花爆竹生产经营安全检查(零售)</h2>
                <h2 v-show="enterpriseType == 1">{{taskName}}(批发)</h2>
                <h2 v-show="enterpriseType == 2">{{taskName}}(零售)</h2>
                <span>(检查一家反馈一家,没有检查出隐患问题的也要登记反馈)</span>
            </div>
            <div class="control-bar">
                <div v-show="enterpriseType == 1">
                    批发企业共计<span class="point-data" @click="getEnterpriseCompleteInfoList">{{enterpriseCount}}</span>家,其中:已自查<span class="point-data" @click="toSelfEnterprise(1)">{{ selfCheckEnterpriseCount }}</span>家,未自查<span @click="toSelfEnterprise(0)" class="undone point-data">{{ noSelfCheckEnterpriseCount }}</span>家;本级已经抽查<span class="point-data" @click="toLevelEnterprise(1)">{{ thislevelAlreadyCheckCount }}</span>家,未检查<span @click="toLevelEnterprise(0)" class="undone point-data">{{ thislevelNoCheckCount }}</span>家,完成率<span>{{ thislevelCompletionRate + '%' }}</span>。
                    批发企业共计<span class="point-data" @click="resetSearch()">{{enterpriseCount}}</span>家,其中:已自查<span class="point-data" @click="toSelfEnterprise(1)">{{ selfCheckEnterpriseCount }}</span>家,未自查<span @click="toSelfEnterprise(0)" class="undone point-data">{{ noSelfCheckEnterpriseCount }}</span>家;本级已经抽查<span class="point-data" @click="toLevelEnterprise(1)">{{ thislevelAlreadyCheckCount }}</span>家,未检查<span @click="toLevelEnterprise(0)" class="undone point-data">{{ thislevelNoCheckCount }}</span>家,检查覆盖要求<span class="undone">{{ thislevelCompletionRateRequire }}{{thislevelCompletionRateRequireUnit ==1?'家':'%'}}</span>,完成率<span>{{ thislevelCompletionRate == null?'--':thislevelCompletionRate + '%' }}</span>。
                </div>
                <div v-show="enterpriseType == 2">
                    零售企业共计<span class="point-data" @click="getEnterpriseCompleteInfoList">{{enterpriseCount}}</span>家,其中:已自查<span class="point-data" @click="toSelfEnterprise(1)">{{ selfCheckEnterpriseCount }}</span>家,未自查<span @click="toSelfEnterprise(0)" class="undone point-data">{{ noSelfCheckEnterpriseCount }}</span>家;本级已经抽查<span class="point-data" @click="toLevelEnterprise(1)">{{ thislevelAlreadyCheckCount }}</span>家,未检查<span @click="toLevelEnterprise(0)" class="undone point-data">{{ thislevelNoCheckCount }}</span>家,完成率<span>{{ thislevelCompletionRate + '%' }}</span>。
                    零售企业共计<span class="point-data" @click="resetSearch()">{{enterpriseCount}}</span>家,其中:已自查<span class="point-data" @click="toSelfEnterprise(1)">{{ selfCheckEnterpriseCount }}</span>家,未自查<span @click="toSelfEnterprise(0)" class="undone point-data">{{ noSelfCheckEnterpriseCount }}</span>家;本级已经抽查<span class="point-data" @click="toLevelEnterprise(1)">{{ thislevelAlreadyCheckCount }}</span>家,未检查<span @click="toLevelEnterprise(0)" class="undone point-data">{{ thislevelNoCheckCount }}</span>家,检查覆盖要求<span class="undone">{{ thislevelCompletionRateRequire }}{{thislevelCompletionRateRequireUnit ==1?'家':'%'}}</span>,完成率<span>{{ thislevelCompletionRate == null?'--':thislevelCompletionRate + '%' }}</span>。
                </div>
                <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-search" @click="showFilter = !showFilter">{{showFilter?'关闭查询':'自定义查询'}}</el-button>
                <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-search" @click="openSearch()">{{showFilter?'关闭查询':'自定义查询'}}</el-button>
            </div>
            <transition name="el-zoom-in-top">
                <el-row v-show="showFilter" :gutter="20">
@@ -40,7 +40,7 @@
                    </el-col>
                    <el-col :span="4">
                        <el-button style="margin-right: 10px;" type="primary" @click="searchData()">查询</el-button>
                        <el-button class="resetBtn"  type="primary" plain @click="resetSearch()">重置</el-button>
                        <el-button class="resetBtn" plain @click="resetSearch()">重置</el-button>
                    </el-col>
                </el-row>
            </transition>
@@ -59,7 +59,11 @@
                <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="enterpriseOfficephone" align="center"></el-table-column>
                <el-table-column label="库存数量/万箱" prop="stockNum" align="center"></el-table-column>
                <el-table-column label="填报时库存数量/箱" prop="stockNum" align="center">
                    <template slot-scope="scope">
                        <span>{{ scope.row.stockNum == null ? '--' : scope.row.stockNum }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="是否查出隐患" prop="hiddendangerStatus" align="center">
                    <template slot-scope="scope">
                        <span>{{ scope.row.hiddendangerStatus == 1 ? '是' : '否' }}</span>
@@ -71,7 +75,7 @@
                        <span>{{ scope.row.selfcheckStatus == 1 ? '已填报' : '未填报' }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="详情" align="center" class-name="small-padding fixed-width">
                <el-table-column label="自查详情" align="center" class-name="small-padding fixed-width">
                    <template slot-scope="scope">
                        <el-button type="text" @click="viewDetails(scope.row)">查看</el-button>
                    </template>
@@ -81,9 +85,9 @@
                        <span>{{ scope.row.thislevelCheckStatus == 1 ? '已反馈' : '未反馈' }}</span>
                    </template>
                </el-table-column>
                <el-table-column fixed="right" :label="unitType==1?'执法抽查':'执法检查'" align="center" class-name="small-padding fixed-width">
                <el-table-column v-if="unitType!=0" fixed="right" :label="unitType==1?'执法抽查':'执法检查'" align="center" class-name="small-padding fixed-width">
                    <template slot-scope="scope">
                        <el-button type="text" @click="toFeedback(scope.row)">情况反馈</el-button>
                        <el-button  type="text" @click="toFeedback(scope.row)">情况反馈</el-button>
                    </template>
                </el-table-column>
            </el-table>
@@ -97,7 +101,7 @@
                :total="recordTotal"
                layout="total, sizes, prev, pager, next, jumper"
                background
                style="float:right;margin:3px"
                style="float:right;margin:20px 0 0"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
            />
@@ -109,7 +113,7 @@
<script>
import {mapGetters} from "vuex";
import Cookies from "_js-cookie@2.2.0@js-cookie";
import {paramList} from "../../../api/contract";
import {computePageCount} from "../../../utils";
import {parseError} from "../../../utils/messageDialog";
@@ -129,16 +133,17 @@
            currentPage: 1,
            unitType: null,
            taskId: null,
            taskName: '',
            enterpriseType: null,
            selfcheckStatus: null,
            thislevelCheckStatus: null,
            listLoading: false,
            showFilter: false,
            search:{
                name: '',
                province: '',
                city: '',
                area: '',
                name: null,
                province: null,
                city: null,
                area: null,
                isRisky: null
            },
            tableKey: 0,
@@ -148,6 +153,8 @@
            selfCheckEnterpriseCount: null,
            noSelfCheckEnterpriseCount: null,
            thislevelAlreadyCheckCount: null,
            thislevelCompletionRateRequire: null,
            thislevelCompletionRateRequireUnit: null,
            thislevelNoCheckCount: null,
            thislevelCompletionRate: null,
            checkData: []
@@ -156,11 +163,7 @@
    created() {
        const t = this
        t.getCheckUnitType()
        if(t.taskId && t.enterpriseType){
            t.getEnterpriseCompleteInfoList()
        }else{
            t.getCheckTask()
        }
        t.getCheckTask()
    },
    computed: {
        ...mapGetters([
@@ -171,7 +174,6 @@
    methods:{
        async getCheckUnitType(){
            const t = this
            t.listLoading = true
            let res = await getCheckUnitType()
            if(res.data.code === "200"){
                t.unitType = res.data.result.checkUnitType
@@ -181,13 +183,14 @@
                    message:res.data.message
                })
            }
            t.listLoading = false
        },
        async getCheckTask(){
            const t = this
            t.listLoading = true
            const res = await getSpecialCheckTask()
            if(res.data.code === "200"){
                t.taskId = res.data.result.specialCheckTaskSimplifyInfos[0].id
                t.taskName = res.data.result.specialCheckTaskSimplifyInfos[0].taskName
                t.enterpriseType = 1
                t.getEnterpriseCompleteInfoList()
            }else{
@@ -196,10 +199,12 @@
                    message:res.data.message
                })
            }
            t.listLoading = false
        },
        async getEnterpriseCompleteInfoList(){
            const t = this
            t.listLoading = true
            if(t.search.name == ''){t.search.name = null}
            let data = {pageIndex: t.currentPage,pageSize: t.pageSize,taskId: t.taskId,enterpriseType: t.enterpriseType,selfcheckStatus:t.selfcheckStatus,thislevelCheckStatus: t.thislevelCheckStatus,enterpriseName: t.search.name, enterpriseProvince: t.search.province, enterpriseCity: t.search.city, enterpriseArea: t.search.area, hiddendangerStatus: t.search.isRisky}
            let res = await getEnterpriseCompleteInfoList(data)
            if(res.data.code === "200"){
@@ -208,6 +213,8 @@
                t.noSelfCheckEnterpriseCount = res.data.result.noSelfCheckEnterpriseCount
                t.thislevelAlreadyCheckCount = res.data.result.thislevelAlreadyCheckCount
                t.thislevelNoCheckCount = res.data.result.thislevelNoCheckCount
                t.thislevelCompletionRateRequire = res.data.result.thislevelCompletionRateRequire
                t.thislevelCompletionRateRequireUnit = res.data.result.thislevelCompletionRateRequireUnit
                t.thislevelCompletionRate = res.data.result.thislevelCompletionRate
                t.checkData = res.data.result.iPage.records
                t.recordTotal = res.data.result.iPage.total
@@ -218,6 +225,14 @@
                })
            }
            t.listLoading = false
        },
        openSearch(){
            const t = this
            t.showFilter = !t.showFilter
            if(t.showFilter == false){
                t.resetSearch()
            }
        },
        handleSizeChange: function (val) {
@@ -231,14 +246,19 @@
        },
        locationChange(value) {
            const t = this
            t.selfcheckStatus = null
            t.thislevelCheckStatus = null
            t.search.province = value[0]
            t.search.city = value[1] ? value[1] : ''
            t.search.area = value[2] ? value[2] : ''
            t.search.city = value[1] ? value[1] : null
            t.search.area = value[2] ? value[2] : null
            t.getEnterpriseCompleteInfoList()
        },
        changeRadio(){
            this.getEnterpriseCompleteInfoList()
            const t = this
            t.selfcheckStatus = null
            t.thislevelCheckStatus = null
            t.getEnterpriseCompleteInfoList()
        },
        searchData(){
@@ -246,17 +266,19 @@
        },
        resetSearch(){
            this.search = {
                name: '',
                province: '',
                city: '',
                area: '',
            const t = this
            t.selfcheckStatus = null
            t.thislevelCheckStatus = null
            t.search = {
                name: null,
                province: null,
                city: null,
                area: null,
                isRisky: null
            }
            this.selectedOptions = []
            this.getEnterpriseCompleteInfoList()
            t.selectedOptions = []
            t.getEnterpriseCompleteInfoList()
        },
        toSelfEnterprise(value){
            const t = this
            t.thislevelCheckStatus = null
@@ -273,6 +295,7 @@
            const t = this
            t.$refs.report.id = row.id
            t.$refs.report.getEnterpriseInfo()
            t.$refs.report.enterpriseType = t.enterpriseType
            t.$refs.report.dialogVisible = true
        },
@@ -283,6 +306,8 @@
            t.$refs.feedback.feedbackForm.id = row.id
            t.$refs.feedback.getSpotCheckReportInfo()
            t.$refs.feedback.unitType = t.unitType
            t.$refs.feedback.enterpriseType = t.enterpriseType
            t.$refs.feedback.getSpotCheckReportInfo()
            t.$refs.feedback.dialogVisible = true
        }
    }
@@ -350,8 +375,7 @@
                        width: 100%;
                    }
                    .resetBtn{
                        color: #034EA2;
                        background-color: #ecf5ff;
                        color: #fff;
                    }
                }
            }