zhongrj
2024-04-26 4ed290876c265a61bc705d1f91526be8a48a8c6b
新增九小场所统计
3 files modified
118 ■■■■ changed files
src/api/site/index.js 12 ●●●●● patch | view | raw | blame | history
src/views/practitionersManage/index.vue 2 ●●● patch | view | raw | blame | history
src/views/site/index.vue 104 ●●●● patch | view | raw | blame | history
src/api/site/index.js
@@ -120,3 +120,15 @@
    })
}
/**
 * 获取九小场所隐患数量统计
 * @returns
 */
export const getNineStatisticsNum = (params) => {
    return request({
        url: "/api/blade-place/place/getNineStatisticsNum",
        method: "get",
        params,
    })
}
src/views/practitionersManage/index.vue
@@ -26,7 +26,7 @@
                    <el-button @click="clearRow" icon="el-icon-delete" class="bjnr-btn">清除</el-button>
                </div>
                <div class="search-item-box" style="justify-content: flex-start;">
                    <el-button @click="filterBtn" icon="el-icon-notebook-2" class="bjnr-btn"
                    <el-button @click="filterBtn" class="bjnr-btn"
                        :class="{ isOneClick: criminalRecordFlag == 1 }">有前科({{ scycNum ? scycNum :
            '0'
                        }})</el-button>
src/views/site/index.vue
@@ -35,6 +35,27 @@
                    <el-button @click="searchBtn" icon="el-icon-search" class="bjnr-btn">搜索</el-button>
                    <el-button @click="clearRow" icon="el-icon-delete" class="bjnr-btn">清除</el-button>
                </div>
                <div class="search-item-box" style="overflow-wrap: break-word;">
                    <el-button @click="filterBtn(1)" class="bjnr-btn"
                        :class="{ isOneClick: criminalRecordFlag == 1 }">有隐患场所({{ yhcsNum ? yhcsNum :
            '0'
                        }})隐患总数({{ yhNum ? yhNum :
            '0' }})</el-button>
                </div>
                <div class="search-item-box" style="overflow-wrap: break-word;">
                    <el-button @click="filterBtn(2)" class="bjnr-btn"
                        :class="{ isOneClick: criminalRecordFlag == 1 }">已整改场所({{ yzgcsNum ? yzgcsNum :
            '0'
                        }})已整改隐患({{ yzgyhNum ? yzgyhNum :
            '0' }})</el-button>
                </div>
                <div class="search-item-box" style="overflow-wrap: break-word;">
                    <el-button @click="filterBtn(3)" class="bjnr-btn"
                        :class="{ isOneClick: criminalRecordFlag == 1 }">未整改场所({{ wzgcsNum ? wzgcsNum :
            '0'
                        }})未整改隐患({{ wzgyhNum ? wzgyhNum :
            '0' }})</el-button>
                </div>
            </div>
            <div class="list police-info" ref="tableBox">
@@ -73,23 +94,28 @@
<script>
import { initMapPosition } from '@/utils/mapPositionInit'
import { getNineTypeTree, getNinePage } from "@/api/site/index.js"
import { getNineTypeTree, getNinePage, getNineStatisticsNum } from "@/api/site/index.js"
let loading = null
export default {
    inject: ['userInfo'],
    data () {
    data() {
        return {
            boxShow: false,
            isDanger:null,
            placeName: '',
            typeValue: '',
            typeOptions: [],
            tableData: [],
            yhcsNum: 0,
            yhNum: 0,
            yzgcsNum: 0,
            yzgyhNum: 0,
            wzgcsNum: 0,
            wzgyhNum: 0,
            pages: {
                current: 1,
                size: 22,
@@ -99,7 +125,9 @@
        }
    },
    created () {
    created() {
        // 获取九小场所隐患数量统计
        this.getNineStatisticsNum()
        this.getNineTypeTree()
        this.getNinePage()
        const that = this
@@ -109,7 +137,7 @@
        })
    },
    mounted () {
    mounted() {
        this.$parent.$parent.resize('400px', true)
        this.$nextTick(() => {
@@ -118,7 +146,7 @@
    },
    computed: {
        positionColor () {
        positionColor() {
            return (row) => {
                if (row.X && row.X != 0 || row.lng && row.lng != 0 || row.longitude && row.longitude != 0 || row.x && row.x != 0) {
                    return "#1AFA29"
@@ -128,7 +156,7 @@
            }
        },
        positionDisabled () {
        positionDisabled() {
            return (row) => {
                if (row.X && row.X != 0 || row.lng && row.lng != 0 || row.longitude && row.longitude != 0 || row.x && row.x != 0) {
                    return false
@@ -140,38 +168,63 @@
    },
    methods: {
        getNineTypeTree () {
        // 是否有隐患
        filterBtn(isDanger){
            this.isDanger = isDanger;
            this.getNinePage()
        },
        // 获取九小场所隐患数量统计
        getNineStatisticsNum() {
            var that = this;
            getNineStatisticsNum({
                nineType: this.typeValue,
                placeName: this.placeName
            }).then(res => {
                const data = res.data.data;
                that.yhcsNum = data[0].total;
                that.yhNum = data[0].patrolNum;
                that.yzgcsNum = data[1].total;
                that.yzgyhNum = data[1].patrolNum;
                that.wzgcsNum = data[2].total;
                that.wzgyhNum = data[2].patrolNum;
            })
        },
        getNineTypeTree() {
            getNineTypeTree().then(res => {
                this.typeOptions = res.data.data
            })
        },
        // 切换登记类型
        typeChange () {
        typeChange() {
            this.pages.current = 1
            this.getNinePage()
            this.getNineStatisticsNum()
        },
        searchChange () {
        searchChange() {
            if (this.placeName.trim() == '') {
                this.pages.current = 1
                this.getNinePage()
                this.getNineStatisticsNum()
            }
        },
        searchBtn () {
        searchBtn() {
            this.pages.current = 1
            this.getNinePage()
            this.getNineStatisticsNum()
        },
        // 分页处理
        handleCurrentChange (current) {
        handleCurrentChange(current) {
            this.pages.current = current
            this.getNinePage()
            this.getNineStatisticsNum()
        },
        // 加载动画
        loading () {
        loading() {
            loading = this.$loading({
                lock: true,
                text: '拼命加载中',
@@ -180,14 +233,15 @@
            })
        },
        getNinePage () {
        getNinePage() {
            this.loading()
            getNinePage({
                current: this.pages.current,
                size: this.pages.size,
                nineType: this.typeValue,
                placeName: this.placeName
                placeName: this.placeName,
                isDanger:this.isDanger
            }).then(res => {
                const data = res.data.data
@@ -205,7 +259,7 @@
        },
        // 点击定位
        rowClick (row) {
        rowClick(row) {
            let lng = global.DC.CoordTransform.GCJ02ToWGS84(row.lng, row.lat)[0]
            let lat = global.DC.CoordTransform.GCJ02ToWGS84(row.lng, row.lat)[1]
@@ -235,30 +289,36 @@
        },
        // 查看详情
        goDetail (row) {
        goDetail(row) {
            this.$refs.SiteDialogPopup.initOpen(row)
        },
        siteClick (e) {
        siteClick(e) {
            this.$refs.SiteDialogPopup.initOpen(e.overlay.attrParams)
        },
        // 清空按钮-清除图标图层
        clearRow () {
        clearRow() {
            this.isDanger = null
            this.placeName = null
            this.typeValue = null
            this.$EventBus.$emit('mapClearLayer', {
                layerName: 'scanLayer',
                type: 'VectorLayer'
            })
            this.$store.commit('SET_DIALOGDETAILPOPUP', false)
            this.pages.current = 1
            this.getNinePage()
            this.getNineStatisticsNum()
        },
        // 大小重置
        boxResize (val) {
        boxResize(val) {
            this.boxShow = val
        },
    },
    destroyed () {
    destroyed() {
        loading && loading.close()
        this.$parent.$parent.resize('0px')