Browse Source

移动端统计修改

v3
zouyx 2 years ago
parent
commit
a241dbc335
  1. 186
      src/views/common/analyse.vue
  2. 141
      src/views/common/analyseFilter.vue

186
src/views/common/analyse.vue

@ -69,9 +69,11 @@
<div class="selected-box"> <div class="selected-box">
<div><label>执法部门:</label><div><span>深圳市司法局</span>,<span>深圳市公安局</span><span>深圳市司法局</span>,<span>深圳市公安局</span></div></div> <div><label>执法区域:</label><div><!-- <span v-for="item in ">{{ item.text }}</span> --></div></div>
<div><label>企业类型:</label><div><span>内资企业</span></div></div> <div><label>执法部门:</label><div><span v-for="item in data.formShowData">{{ item.text }}</span></div></div>
<div><label>检查类别:</label><div><span>日常检查</span></div></div> <div><label>企业类型:</label><div><span v-for="item in data.qyFormShowData">{{ item.text }}</span></div></div>
<div><label>检查类别:</label><div><span v-for="item in data.jcFormShowData">{{ item.text }}</span></div></div>
<div><label>投诉类型:</label><div><span v-for="item in data.tsFormShowData">{{ item.text }}</span></div></div>
</div> </div>
<div class="stat-box"> <div class="stat-box">
@ -81,20 +83,29 @@
<div class="percent-tag"> <div class="percent-tag">
<!-- <span class="time-last"><span class="data-rise">--</span><label>较上年</label></span> --> <!-- <span class="time-last"><span class="data-rise">--</span><label>较上年</label></span> -->
<span class="time-last"> <span class="time-last">
<div v-if="data.staCount.deptTong == 0"> <div v-if="data.staCount.deptHuan == 0 || data.staCount.deptHuan == NULL">
<span class="data-rise" > <span class="data-rise" >
<van-icon name="down" />--</span> <van-icon name="down" />--</span>
<label>较上年</label> <label v-if="searchParam.dateType==5">较上年</label>
<label v-else-if="searchParam.dateType==6">较上月</label>
<label v-else-if="searchParam.dateType==1">较上季</label>
<label v-else>较上时段</label>
</div> </div>
<div v-if="data.staCount.deptTong > 0"> <div v-if="data.staCount.deptHuan > 0">
<span class="data-rise"> <span class="data-rise">
<van-icon name="down" />{{ data.staCount.deptTong }}</span> <van-icon name="down" />{{ data.staCount.deptHuan }}</span>
<label>较上年</label> <label v-if="searchParam.dateType==5">较上年</label>
<label v-else-if="searchParam.dateType==6">较上月</label>
<label v-else-if="searchParam.dateType==1">较上季</label>
<label v-else>较上时段</label>
</div> </div>
<div v-if="data.staCount.deptTong < 0"> <div v-if="data.staCount.deptHuan < 0">
<span class="data-rise" > <span class="data-fall" >
<van-icon name="down" />{{ data.staCount.deptTong }}</span> <van-icon name="down" />{{ data.staCount.deptHuan }}</span>
<label>较上年</label> <label v-if="searchParam.dateType==5">较上年</label>
<label v-else-if="searchParam.dateType==6">较上月</label>
<label v-else-if="searchParam.dateType==1">较上季</label>
<label v-else>较上时段</label>
</div> </div>
</span> </span>
@ -105,20 +116,29 @@
<div class="count-tot"><b>{{ data.staCount.qyTotal }}</b></div> <div class="count-tot"><b>{{ data.staCount.qyTotal }}</b></div>
<div class="percent-tag"> <div class="percent-tag">
<span class="time-last"> <span class="time-last">
<div v-if="data.staCount.qyTong == 0"> <div v-if="data.staCount.qyHuan == 0 || data.staCount.qyHuan ==NULL">
<span class="data-rise"> <span class="data-rise">
<van-icon name="down" />--</span> <van-icon name="down" />--</span>
<label>较上年</label> <label v-if="searchParam.dateType==5">较上年</label>
<label v-else-if="searchParam.dateType==6">较上月</label>
<label v-else-if="searchParam.dateType==1">较上季</label>
<label v-else>较上时段</label>
</div> </div>
<div v-if="data.staCount.qyTong > 0"> <div v-if="data.staCount.qyHuan > 0">
<span class="data-rise"> <span class="data-rise">
<van-icon name="down" />{{ data.staCount.qyTong }}</span> <van-icon name="down" />{{ data.staCount.qyHuan }}</span>
<label>较上年</label> <label v-if="searchParam.dateType==5">较上年</label>
<label v-else-if="searchParam.dateType==6">较上月</label>
<label v-else-if="searchParam.dateType==1">较上季</label>
<label v-else>较上时段</label>
</div> </div>
<div v-if="data.staCount.qyTong < 0"> <div v-if="data.staCount.qyHuan < 0">
<span class="data-rise" > <span class="data-fall" >
<van-icon name="down" />{{ data.staCount.qyTong }}</span> <van-icon name="down" />{{ data.staCount.qyHuan }}</span>
<label>较上年</label> <label v-if="searchParam.dateType==5">较上年</label>
<label v-else-if="searchParam.dateType==6">较上月</label>
<label v-else-if="searchParam.dateType==1">较上季</label>
<label v-else>较上时段</label>
</div> </div>
</span> </span>
@ -132,20 +152,29 @@
<span class="time-last"> <span class="time-last">
<!-- <span class="data-rise"><van-icon name="down" />32</span><label>较上年</label> --> <!-- <span class="data-rise"><van-icon name="down" />32</span><label>较上年</label> -->
<span class="time-last"> <span class="time-last">
<div v-if="data.staCount.jcTong == 0"> <div v-if="data.staCount.jcHuan == 0 || data.staCount.jcHuan == NULL">
<span class="data-rise"> <span class="data-rise">
<van-icon name="down" />--</span> <van-icon name="down" />--</span>
<label>较上年</label> <label v-if="searchParam.dateType==5">较上年</label>
<label v-else-if="searchParam.dateType==6">较上月</label>
<label v-else-if="searchParam.dateType==1">较上季</label>
<label v-else>较上时段</label>
</div> </div>
<div v-if="data.staCount.jcTong > 0"> <div v-if="data.staCount.jcHuan > 0">
<span class="data-rise"> <span class="data-rise">
<van-icon name="down" />{{ data.staCount.jcTong }}</span> <van-icon name="down" />{{ data.staCount.jcHuan }}</span>
<label>较上年</label> <label v-if="searchParam.dateType==5">较上年</label>
<label v-else-if="searchParam.dateType==6">较上月</label>
<label v-else-if="searchParam.dateType==1">较上季</label>
<label v-else>较上时段</label>
</div> </div>
<div v-if="data.staCount.jcTong < 0"> <div v-if="data.staCount.jcHuan < 0">
<span class="data-rise" > <span class="data-fall" >
<van-icon name="down" />{{ data.staCount.jcTong }}</span> <van-icon name="down" />{{ data.staCount.jcHuan }}</span>
<label>较上年</label> <label v-if="searchParam.dateType==5">较上年</label>
<label v-else-if="searchParam.dateType==6">较上月</label>
<label v-else-if="searchParam.dateType==1">较上季</label>
<label v-else>较上时段</label>
</div> </div>
</span> </span>
</span> </span>
@ -157,20 +186,29 @@
<div class="percent-tag"> <div class="percent-tag">
<span class="time-last"> <span class="time-last">
<!-- <span class="data-fall"><van-icon name="down" />3</span><label>较上年</label> --> <!-- <span class="data-fall"><van-icon name="down" />3</span><label>较上年</label> -->
<div v-if="data.staCount.complaintTong == 0"> <div v-if="data.staCount.complaintHuan == 0 || data.staCount.complaintHuan==NULL">
<span class="data-rise"> <span class="data-rise">
<van-icon name="down" />--</span> <van-icon name="down" />--</span>
<label>较上年</label> <label v-if="searchParam.dateType==5">较上年</label>
<label v-else-if="searchParam.dateType==6">较上月</label>
<label v-else-if="searchParam.dateType==1">较上季</label>
<label v-else>较上时段</label>
</div> </div>
<div v-if="data.staCount.complaintTong > 0"> <div v-if="data.staCount.complaintHuan > 0">
<span class="data-rise"> <span class="data-rise">
<van-icon name="down" />{{ data.staCount.complaintTotal }}</span> <van-icon name="down" />{{ data.staCount.complaintHuan }}</span>
<label>较上年</label> <label v-if="searchParam.dateType==5">较上年</label>
<label v-else-if="searchParam.dateType==6">较上月</label>
<label v-else-if="searchParam.dateType==1">较上季</label>
<label v-else>较上时段</label>
</div> </div>
<div v-if="data.staCount.complaintTong < 0"> <div v-if="data.staCount.complaintTong < 0">
<span class="data-rise" > <span class="data-fall" >
<van-icon name="down" />{{ data.staCount.complaintTong }}</span> <van-icon name="down" />{{ data.staCount.complaintHuan }}</span>
<label>较上年</label> <label v-if="searchParam.dateType==5">较上年</label>
<label v-else-if="searchParam.dateType==6">较上月</label>
<label v-else-if="searchParam.dateType==1">较上季</label>
<label v-else>较上时段</label>
</div> </div>
</span> </span>
</div> </div>
@ -178,7 +216,7 @@
</div> </div>
<van-popup v-model:show="data.showTimePicker" position="bottom" :style="{ height: '30%' }"> <van-popup v-model:show="data.showTimePicker" position="bottom" :style="{ height: '30%' }">
<van-date-picker <van-date-picker
type="time" type="time"
:columns-type="data.columnsType" :columns-type="data.columnsType"
@ -248,7 +286,7 @@
import { onBeforeUnmount, getCurrentInstance,nextTick } from 'vue'; import { onBeforeUnmount, getCurrentInstance,nextTick } from 'vue';
import util from "@/util/area"; import util from "@/util/area";
import {queryStatisticalData} from '@/api/enforce'; import {queryStatisticalData,getDeptListToDept,getDeptListToPerson} from '@/api/enforce';
import { getDict } from '@/api/Home'; import { getDict } from '@/api/Home';
import {queryStatisticsIndicatorPart1,queryStatisticsIndicatorPart2,queryStatisticsIndicatorPart3} from '@/api/enterprise'; import {queryStatisticsIndicatorPart1,queryStatisticsIndicatorPart2,queryStatisticsIndicatorPart3} from '@/api/enterprise';
@ -455,6 +493,11 @@
//查询统计数据 //查询统计数据
queryStatisticsIndicatorPart(); queryStatisticsIndicatorPart();
queryStatisticsIndicatorPartTwo(); queryStatisticsIndicatorPartTwo();
getDeptList(data.dataType,(val)=>{
console.log(val)
data.ruleList=val;
})
queryDictData("enterpriseType",(val) =>{ queryDictData("enterpriseType",(val) =>{
console.log(val) console.log(val)
@ -530,16 +573,16 @@
const element3 = success.data[3] const element3 = success.data[3]
//部门统计 //部门统计
data.staCount.deptTotal = element.number; data.staCount.deptTotal = element.number;
data.staCount.deptTong = element.tong; data.staCount.deptHuan = element.huan;
//企业统计 //企业统计
data.staCount.qyTotal = element1.number; data.staCount.qyTotal = element1.number;
data.staCount.qyTong = element1.tong; data.staCount.qyHuan = element1.huan;
//检查统计 //检查统计
data.staCount.jcTotal = element2.number; data.staCount.jcTotal = element2.number;
data.staCount.jcTong = element2.tong; data.staCount.jcHuan = element2.huan;
//投诉统计 //投诉统计
data.staCount.complaintTotal = element3.number; data.staCount.complaintTotal = element3.number;
data.staCount.complaintTong = element3.tong; data.staCount.complaintHuan = element3.huan;
},error =>{ },error =>{
@ -557,16 +600,16 @@
const element3 = success.data[3] const element3 = success.data[3]
//部门统计 //部门统计
data.staCount.deptTotal = element.number; data.staCount.deptTotal = element.number;
data.staCount.deptTong = element.tong; data.staCount.deptHuan = element.huan;
//企业统计 //企业统计
data.staCount.qyTotal = element1.number; data.staCount.qyTotal = element1.number;
data.staCount.qyTong = element1.tong; data.staCount.qyHuan = element1.huan;
//检查统计 //检查统计
data.staCount.jcTotal = element2.number; data.staCount.jcTotal = element2.number;
data.staCount.jcTong = element2.tong; data.staCount.jcHuan = element2.huan;
//投诉统计 //投诉统计
data.staCount.complaintTotal = element3.number; data.staCount.complaintTotal = element3.number;
data.staCount.complaintTong = element3.tong; data.staCount.complaintHuan = element3.huan;
},error =>{ },error =>{
@ -611,11 +654,23 @@
} }
} }
// 点击确定 // 点击确定-部门
const confirmMultiple = () =>{ const confirmMultiple = () =>{
data.formShowData = data.copyArr; data.formShowData = data.copyArr;
data.multipleShowPicker = false; data.multipleShowPicker = false;
data.copyArr = []; data.copyArr = [];
const tmpArr = [];
data.formShowData.forEach(res =>{
tmpArr.push(res.value);
})
searchParam.deptId = tmpArr.join(",");
if(data.dataType == 0){
queryStatisticsIndicatorPartTwo();
}
if(data.dataType == 1){
queryStatisticsIndicatorPartThree();
}
} }
// 点击取消 // 点击取消
@ -707,6 +762,33 @@
callback(dictList); callback(dictList);
}, error => {}) }, error => {})
} }
const getDeptList=(type,callback)=>{
if(type==0){
//个人
getDeptListToPerson(searchParam,success=>{
var dictList=[];
console.log(success);
success.data.forEach(res => {
console.log(res)
var obj = {text: res.dictLabel, value: res.dictValue};
dictList.push(obj)
})
callback(dictList);
}, error => {})
}else if(type==1){
//部门
getDeptListToDept(searchParam,success=>{
var dictList=[];
console.log(success);
success.data.forEach(res => {
console.log(res)
var obj = {text: res.dictLabel, value: res.dictValue};
dictList.push(obj)
})
callback(dictList);
}, error => {})
}
}
// 企业类型打开弹出时触发 // 企业类型打开弹出时触发
const openJcPicker = (item) =>{ const openJcPicker = (item) =>{

141
src/views/common/analyseFilter.vue

@ -20,9 +20,40 @@
<van-pull-refresh v-model="refreshing" @refresh="onRefresh"> <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list finished-text="没有更多了" @load="onLoad"> <van-list finished-text="没有更多了" @load="onLoad">
<van-checkbox-group> <!-- <van-checkbox-group v-model="data.checked" v-for="(item,index) in data.addressQYListAll" :key="index" @click="qytake(item)">
<van-checkbox v-model="checked">全市</van-checkbox> <van-checkbox :name="">罗湖区</van-checkbox>
<van-checkbox>福田区</van-checkbox> </van-checkbox-group> -->
<!-- <van-checkbox-group v-model="checked">
<van-cell-group inset>
<van-cell v-for="(item, index) in data.addressQYListAll" :key="item.value">
<div style="width: 70%; text-align: left;">{{item.text}}<van-icon name="arrow" size="0.35rem" clickable @click="jdShowOrClose(item)"/></div>
<van-checkbox-group v-show="qyhave(item)">
<van-cell-group inset>
<van-cell v-for="(i, index) in qyGetList(item)" :key="i.value" clickable >
<div style="width: 70%; text-align: right;">{{i.text}}</div>
</van-cell>
</van-cell-group>
</van-checkbox-group>
</van-cell>
</van-cell-group>
</van-checkbox-group> -->
<van-checkbox-group v-model="checked">
<van-cell-group inset>
<van-cell v-for="(item, index) in data.addressQYListAll" :key="item.value">
<div style="width: 70%; text-align: left;">{{item.text}}<van-icon name="arrow" size="0.35rem" clickable @click="f1(item)"/></div>
<van-checkbox-group v-show="item.isShow">
<van-cell-group inset>
<van-cell v-for="(i, index) in item.list" :key="i.value" clickable >
<div style="width: 70%; text-align: right;">{{i.text}}</div>
</van-cell>
</van-cell-group>
</van-checkbox-group>
</van-cell>
</van-cell-group>
</van-checkbox-group>
<!-- <van-checkbox-group v-model="checked">
<van-checkbox name="FT">福田区</van-checkbox>
<van-checkbox>罗湖区</van-checkbox> <van-checkbox>罗湖区</van-checkbox>
<van-checkbox>盐田区</van-checkbox> <van-checkbox>盐田区</van-checkbox>
<van-checkbox>南山区</van-checkbox> <van-checkbox>南山区</van-checkbox>
@ -33,7 +64,7 @@
<van-checkbox>光明区</van-checkbox> <van-checkbox>光明区</van-checkbox>
<van-checkbox>大鹏新区</van-checkbox> <van-checkbox>大鹏新区</van-checkbox>
<van-checkbox>深汕特别合作区</van-checkbox> <van-checkbox>深汕特别合作区</van-checkbox>
</van-checkbox-group> </van-checkbox-group> -->
</van-list> </van-list>
</van-pull-refresh> </van-pull-refresh>
</div> </div>
@ -43,8 +74,108 @@
</div> </div>
</template> </template>
<script setup>
import { getDict } from '@/api/Home';
import { reactive } from 'vue';
const data = reactive({
addressQYListAll:[],
addressStr:[],
checked:[],
jdBoolean:false,
addressJDListAll:[]
});
var jdAllList=[];
onMounted(() => {
queryDictData("address_type",(val) =>{
console.log(val)
data.addressQYListAll = val;
})
});
const queryDictData = (dictType,callback) =>{
getDict({"dictType": dictType}, success => {
var dictList = [];
console.log(success);
success.data.forEach(res => {
console.log(res)
var obj = {text: res.dictLabel, value: res.dictValue};
dictList.push(obj)
})
callback(dictList);
}, error => {})
}
const qytake=(item)=>{
console.log(item);
console.log(data.checked);
data.addressStr.push(item);
console.log(data.addressStr);
}
const jdShowOrClose=(item)=>{
console.log("打开函数前"+new Date())
let count=0;
for(let i=0;i<jdAllList.length;i++){
if(item.value==jdAllList[i].value){
count=1;
if(jdAllList[i].jdBoolean==true){
jdAllList[i].jdBoolean=false
}else{
jdAllList[i].jdBoolean=true
}
console.log(jdAllList[i].jdBoolean)
}
}
if(count==0){
queryDictData(item.value,(val) =>{
console.log(val)
jdAllList.push({"value":item.value,"list":val,"jdBoolean":true});
})
}
console.log("打开函数后"+new Date())
}
//判断该区域是否打开
const qyhave=(item)=>{
for(let i=0;i<jdAllList.length;i++){
if(item.value==jdAllList[i].value){
return jdAllList[i].jdBoolean;
}
}
return false;
}
const qyGetList=(item)=>{
for(let i=0;i<jdAllList.length;i++){
if(item.value==jdAllList[i].value){
if(jdAllList[i].jdBoolean==true){
return jdAllList[i].list
}
}
}
return [];
}
const f1=(item)=>{
for(let i=0;i<jdAllList.length;i++){
if(item.value==jdAllList[i].value){
if(item.isShow==false){
jdAllList[i].isShow=true;
}else{
jdAllList[i].isShow=false
}
if(item.list.length<=0){
queryDictData(item.value,(val) =>{
console.log(val)
jdAllList[i].list=val;
})
}
}
}
}
</script>
<script> <script>
export default { export default {
props: { props: {
visible: { visible: {
type: Boolean, type: Boolean,
@ -53,7 +184,7 @@
content: { content: {
type: String, type: String,
default: '' default: ''
} },
}, },
methods: { methods: {
closePopup() { closePopup() {

Loading…
Cancel
Save