Commit f3728cbb by xue_wengang

报表修改

parent 4906ebdc
......@@ -190,12 +190,12 @@
style="
position: fixed;
right: 0px;
width: 438px;
width: 24%;
z-index: 999;
width: 23%;
transition: width 0.3s ease-out
"
:style="{ top: marginTop + 'px',width: isClose ? '438px' : 0 }"
:style="{ top: marginTop + 'px',width: isClose ? '24%' : 0 }"
>
<div class="tizi" @click="handleCollapse"><i :class="isClose ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"></i></div>
<el-card class="box-card" style="height: 600px">
......
......@@ -10,6 +10,7 @@ import VueWechatTitle from "vue-wechat-title";
import "@/assets/styles/iconfont.css";
import dataV from '@jiaminghi/data-view'
import moment from 'moment'
import './utils/table2excel'
/**/
import Driver from 'driver.js'
import 'driver.js/dist/driver.min.css'
......
......@@ -235,7 +235,15 @@
<div class="flTtitle" style="margin-bottom: 0">
<span class="border"></span>分析结果
</div>
<div class="zdy-icon-container">
<div
class="zdy-icon-container"
v-if="
!isShowSearch &&
isHasYear &&
(formData.year || formData.currentTime)
"
>
<el-button @click="exportExcel" size="mini">导出</el-button>
<div
v-show="fullscreen"
@click="controlFullscreen(false)"
......@@ -265,7 +273,7 @@
></iframe>
<component
id="tongji-baobiao"
:ref="componentName"
ref="tableList"
v-if="
!isShowSearch &&
isHasYear &&
......@@ -333,8 +341,8 @@ export default {
jssj: this.timeStampTurnTime(new Date()),
fakssj: "",
fajssj: "",
year:this.$moment(new Date()).format("YYYY"),
currentTime:this.$moment(new Date()).format("YYYY-M")
year: this.$moment(new Date()).format("YYYY"),
currentTime: this.$moment(new Date()).format("YYYY-M"),
},
//查询条件配置
propQueryField: [
......@@ -401,31 +409,14 @@ export default {
},
created() {},
methods: {
exportExcel() {
this.$refs.tableList.exportExcel();
},
controlFullscreen(value) {
this.fullscreen = value;
},
selectChange(value) {
console.log(value);
this.tableType = value;
switch (value) {
case "05":
this.componentName = "fpatj";
break;
case "06":
this.componentName = "lnafyytj";
break;
case "07":
this.componentName = "gdmfaqk";
break;
case "08":
this.componentName = "qgmafaqktjb";
break;
case "09":
this.componentName = "yassdrdzb";
break;
default:
break;
}
if (value == "05" || value == "06" || value == "07" || value == "09") {
this.propQueryField = [
{
......@@ -450,7 +441,7 @@ export default {
name: "案发年份",
id: "year",
type: "selectYear",
value: '',
value: "",
col: "3",
},
];
......@@ -478,11 +469,12 @@ export default {
name: "案发年月",
id: "currentTime",
type: "selectYearAndMonth",
value: '',
value: "",
col: "3",
},
];
} else {
this.componentName = "";
this.propQueryField = [
{
name: "报表源",
......@@ -518,20 +510,6 @@ export default {
value: "",
col: "3",
},
// {
// name: "开始时间",
// id: "kssj",
// type: "datetime",
// value: "",
// col: "3",
// },
// {
// name: "结束时间",
// id: "jssj",
// type: "datetime",
// value: "",
// col: "3",
// },
{
name: "统计单位",
id: "tjdw",
......@@ -555,10 +533,30 @@ export default {
},
//开始统计
doQueryBtn() {
console.log(this.formData, "ooooooooooooo");
if (this.formData.year || this.formData.currentTime) {
this.isHasYear = true;
this.$refs[this.componentName].getData()
switch (this.tableType) {
case "05":
this.componentName = "fpatj";
break;
case "06":
this.componentName = "lnafyytj";
break;
case "07":
this.componentName = "gdmfaqk";
break;
case "08":
this.componentName = "qgmafaqktjb";
break;
case "09":
this.componentName = "yassdrdzb";
break;
default:
break;
}
this.$nextTick(() => {
this.$refs.tableList.getData();
});
}
var self = this;
var url =
......
<!-- -->
<template>
<div class="gdmfaqk">
<table class="table-header" border="0" cellspacing="0" cellpadding="0" align="center">
<table
class="table-header"
border="0"
cellspacing="0"
cellpadding="0"
align="center"
>
<tr>
<td align="center" class="biaoti" height="60">{{ currentYear }}年各地每月发案统计</td>
<td align="center" class="biaoti" height="60">
{{ currentYear }}年各地每月发案统计
</td>
</tr>
</table>
<table border="0" cellspacing="1" cellpadding="4" class="table-body" align="center">
<table
border="0"
cellspacing="1"
cellpadding="4"
class="table-body"
align="center"
id="tableContent"
style="width:100%"
>
<thead>
<tr>
<th></th>
......@@ -34,91 +50,91 @@
:class="{ ableClick: item.janFas && item.janFas != '0' }"
@click="toTs(item, item.janFas, 'mafa', 'aj', 1)"
>
{{ ['',-1].includes(item.janFas) ? '/' : item.janFas }}
{{ ["", -1].includes(item.janFas) ? "/" : item.janFas }}
</td>
<td
align="center"
:class="{ ableClick: item.febFas && item.febFas != '0' }"
@click="toTs(item, item.febFas, 'mafa', 'aj', 2)"
>
{{ ['',-1].includes(item.febFas) ? '/' : item.febFas }}
{{ ["", -1].includes(item.febFas) ? "/" : item.febFas }}
</td>
<td
align="center"
:class="{ ableClick: item.marFas && item.marFas != '0' }"
@click="toTs(item, item.marFas, 'mafa', 'aj', 3)"
>
{{ ['',-1].includes(item.marFas) ? '/' : item.marFas }}
{{ ["", -1].includes(item.marFas) ? "/" : item.marFas }}
</td>
<td
align="center"
:class="{ ableClick: item.aprFas && item.aprFas != '0' }"
@click="toTs(item, item.aprFas, 'mafa', 'aj', 4)"
>
{{ ['',-1].includes(item.aprFas) ? '/' : item.aprFas }}
{{ ["", -1].includes(item.aprFas) ? "/" : item.aprFas }}
</td>
<td
align="center"
:class="{ ableClick: item.mayFas && item.mayFas != '0' }"
@click="toTs(item, item.mayFas, 'mafa', 'aj', 5)"
>
{{ ['',-1].includes(item.mayFas) ? '/' : item.mayFas }}
{{ ["", -1].includes(item.mayFas) ? "/" : item.mayFas }}
</td>
<td
align="center"
:class="{ ableClick: item.junFas && item.junFas != '0' }"
@click="toTs(item, item.junFas, 'mafa', 'aj', 6)"
>
{{ ['',-1].includes(item.junFas) ? '/' : item.junFas }}
{{ ["", -1].includes(item.junFas) ? "/" : item.junFas }}
</td>
<td
align="center"
:class="{ ableClick: item.julFas && item.julFas != '0' }"
@click="toTs(item, item.julFas, 'mafa', 'aj', 7)"
>
{{ ['',-1].includes(item.julFas) ? '/' : item.julFas }}
{{ ["", -1].includes(item.julFas) ? "/" : item.julFas }}
</td>
<td
align="center"
:class="{ ableClick: item.augFas && item.augFas != '0' }"
@click="toTs(item, item.augFas, 'mafa', 'aj', 8)"
>
{{ ['',-1].includes(item.augFas) ? '/' : item.augFas }}
{{ ["", -1].includes(item.augFas) ? "/" : item.augFas }}
</td>
<td
align="center"
:class="{ ableClick: item.sepFas && item.sepFas != '0' }"
@click="toTs(item, item.sepFas, 'mafa', 'aj', 9)"
>
{{ ['',-1].includes(item.sepFas) ? '/' : item.sepFas }}
{{ ["", -1].includes(item.sepFas) ? "/" : item.sepFas }}
</td>
<td
align="center"
:class="{ ableClick: item.octFas && item.octFas != '0' }"
@click="toTs(item, item.octFas, 'mafa', 'aj', 10)"
>
{{ ['',-1].includes(item.octFas) ? '/' : item.octFas }}
{{ ["", -1].includes(item.octFas) ? "/" : item.octFas }}
</td>
<td
align="center"
:class="{ ableClick: item.novFas && item.novFas != '0' }"
@click="toTs(item, item.novFas, 'mafa', 'aj', 11)"
>
{{ ['',-1].includes(item.novFas) ? '/' : item.novFas }}
{{ ["", -1].includes(item.novFas) ? "/" : item.novFas }}
</td>
<td
align="center"
:class="{ ableClick: item.decFas && item.decFas != '0' }"
@click="toTs(item, item.decFas, 'mafa', 'aj', 12)"
>
{{ ['',-1].includes(item.decFas) ? '/' : item.decFas }}
{{ ["", -1].includes(item.decFas) ? "/" : item.decFas }}
</td>
<td
align="center"
:class="{ ableClick: item.num && item.num != '0' }"
@click="toTs(item, item.num, 'mafa', 'aj', '')"
>
{{ ['',-1].includes(item.num) ? '/' : item.num }}
{{ ["", -1].includes(item.num) ? "/" : item.num }}
</td>
</tr>
</tbody>
......@@ -127,9 +143,9 @@
</template>
<script>
import Http from '@/utils/axiosHttp.js';
import url from '@/api/base';
import qs from 'qs';
import Http from "@/utils/axiosHttp.js";
import url from "@/api/base";
import qs from "qs";
export default {
props: {
currentYear: {
......@@ -144,11 +160,16 @@ export default {
components: {},
computed: {},
created() {
},
created() {},
mounted() {},
methods: {
exportExcel() {
debugger;
$("#tableContent").table2excel({
subtotal: 1, //"合计"行所在的行号(不包括标题行)
filename: `${this.currentYear}年各地每月发案统计`, //文件名称
});
},
handleChange(value) {
console.log(value);
this.getData();
......@@ -158,7 +179,7 @@ export default {
let routeData;
if (count && count > 0) {
routeData = this.$router.resolve({
path: '/bndfas2',
path: "/bndfas2",
query: {
year: this.currentYear,
month: month,
......@@ -167,24 +188,24 @@ export default {
xzqh: item.xzqh,
},
});
window.open(routeData.href, '_blank');
window.open(routeData.href, "_blank");
}
},
getData() {
let self = this;
var loading = self.$loading({
lock: true,
text: '正在查询...',
spinner: 'el-icon-loading',
background: 'rgba(255, 255, 255, 0.7)',
text: "正在查询...",
spinner: "el-icon-loading",
background: "rgba(255, 255, 255, 0.7)",
});
let url = '/lstbtj/getGdmaqkTj';
let url = "/lstbtj/getGdmaqkTj";
let params = {
year: this.currentYear,
};
self
.doQueryRequest(params, url)
.then(res => {
.then((res) => {
if (res.data.code == 200) {
console.log(res.data.data.rows);
this.tableList = res.data.data.rows;
......@@ -192,22 +213,22 @@ export default {
} else {
loading.close();
self.$message({
type: 'error',
type: "error",
message: res.data.message,
});
}
})
.catch(err => {});
.catch((err) => {});
},
doQueryRequest(form, relurl) {
/*post方法*/
return Http({
url: url.BaseURL + relurl,
data: qs.stringify(form),
method: 'post',
method: "post",
headers: {
'blade-auth': sessionStorage.getItem('token'),
'Content-Type': 'application/x-www-form-urlencoded',
"blade-auth": sessionStorage.getItem("token"),
"Content-Type": "application/x-www-form-urlencoded",
},
});
},
......@@ -216,7 +237,6 @@ export default {
</script>
<style lang="scss" scoped>
.gdmfaqk {
width: 1200px;
margin: 0 auto;
background: #fff;
padding-bottom: 40px;
......
<!-- -->
<template>
<div class="qgmafaqktjb">
<table class="table-header" border="0" cellspacing="0" cellpadding="0" align="center">
<table
class="table-header"
border="0"
cellspacing="0"
cellpadding="0"
align="center"
>
<tr>
<td align="center" class="biaoti" height="60">全国发案排名统计</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="4" class="table-body" align="center">
<table
border="0"
cellspacing="0"
cellpadding="4"
class="table-body"
align="center"
id="tableContent"
style="width: 100%"
>
<thead>
<tr>
<th>本月</th>
<th colspan="3">1-{{ currentMonth }}</th>
</tr>
</thead>
<tbody>
<tr>
......@@ -26,17 +41,30 @@
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in tableListInfo.thisMonthList" :key="index">
<tr
v-for="(item, index) in tableListInfo.thisMonthList"
:key="index"
>
<td>{{ item.xzqhStr }}</td>
<td
:class="{ ableClick: item.mas && item.mas != '0' }"
@click="toTs(item, item.mas, 'mafa', 'aj', parseInt(currentMonth))"
@click="
toTs(item, item.mas, 'mafa', 'aj', parseInt(currentMonth))
"
>
{{ item.mas }}
</td>
<td
:class="{ ableClick: item.ysdrajs && item.ysdrajs != '0' }"
@click="toTs(item, item.ysdrajs, 'maysdra', 'aj', parseInt(currentMonth))"
@click="
toTs(
item,
item.ysdrajs,
'maysdra',
'aj',
parseInt(currentMonth)
)
"
>
{{ item.ysdrajs }}
</td>
......@@ -54,7 +82,10 @@
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in tableListInfo.maRankList" :key="index">
<tr
v-for="(item, index) in tableListInfo.maRankList"
:key="index"
>
<td>{{ item.xzqhStr }}</td>
<td
:class="{ ableClick: item.mas && item.mas != '0' }"
......@@ -77,7 +108,10 @@
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in tableListInfo.mswrfaRankList" :key="index">
<tr
v-for="(item, index) in tableListInfo.mswrfaRankList"
:key="index"
>
<td>{{ item.xzqhStr }}</td>
<td>{{ item.mswrfas }}</td>
<td>{{ item.rank }}</td>
......@@ -95,11 +129,16 @@
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in tableListInfo.ysdrRankList" :key="index">
<tr
v-for="(item, index) in tableListInfo.ysdrRankList"
:key="index"
>
<td>{{ item.xzqhStr }}</td>
<td
:class="{ ableClick: item.ysdrajs && item.ysdrajs != '0' }"
@click="toTs(item, item.ysdrajs, 'maysdralj', 'aj', currentMonth)"
@click="
toTs(item, item.ysdrajs, 'maysdralj', 'aj', currentMonth)
"
>
{{ item.ysdrajs }}
</td>
......@@ -115,9 +154,9 @@
</template>
<script>
import Http from '@/utils/axiosHttp.js';
import url from '@/api/base';
import qs from 'qs';
import Http from "@/utils/axiosHttp.js";
import url from "@/api/base";
import qs from "qs";
export default {
props: {
currentTime: {
......@@ -131,21 +170,27 @@ export default {
},
computed: {
currentYear() {
return this.currentTime.split('-')[0];
return this.currentTime.split("-")[0];
},
currentMonth() {
return this.currentTime.split('-')[1];
},
return this.currentTime.split("-")[1];
},
created() {
},
created() {},
methods: {
exportExcel() {
debugger;
$("#tableContent").table2excel({
subtotal: 1, //"合计"行所在的行号(不包括标题行)
filename: "全国发案排名统计", //文件名称
});
},
toTs(item, count, type, tsType, month) {
console.log(item, count, type, tsType, month);
let routeData;
if (count && count > 0) {
routeData = this.$router.resolve({
path: '/bndfas2',
path: "/bndfas2",
query: {
year: this.currentYear,
month: month,
......@@ -154,31 +199,31 @@ export default {
xzqh: item.xzqh,
},
});
window.open(routeData.href, '_blank');
window.open(routeData.href, "_blank");
}
},
handleChange(value) {
console.log(value);
this.currentYear = this.currentTime.split('-')[0];
this.currentMonth = this.currentTime.split('-')[1];
this.currentYear = this.currentTime.split("-")[0];
this.currentMonth = this.currentTime.split("-")[1];
this.getData();
},
getData() {
let self = this;
var loading = self.$loading({
lock: true,
text: '正在查询...',
spinner: 'el-icon-loading',
background: 'rgba(255, 255, 255, 0.7)',
text: "正在查询...",
spinner: "el-icon-loading",
background: "rgba(255, 255, 255, 0.7)",
});
let url = '/lstbtj/getQgMaTjb';
let url = "/lstbtj/getQgMaTjb";
let params = {
year: this.currentYear,
month: this.currentMonth,
};
self
.doQueryRequest(params, url)
.then(res => {
.then((res) => {
if (res.data.code == 200) {
console.log(res.data.data);
this.tableListInfo = res.data.data;
......@@ -186,22 +231,22 @@ export default {
} else {
loading.close();
self.$message({
type: 'error',
type: "error",
message: res.data.message,
});
}
})
.catch(err => {});
.catch((err) => {});
},
doQueryRequest(form, relurl) {
/*post方法*/
return Http({
url: url.BaseURL + relurl,
data: qs.stringify(form),
method: 'post',
method: "post",
headers: {
'blade-auth': sessionStorage.getItem('token'),
'Content-Type': 'application/x-www-form-urlencoded',
"blade-auth": sessionStorage.getItem("token"),
"Content-Type": "application/x-www-form-urlencoded",
},
});
},
......@@ -210,7 +255,6 @@ export default {
</script>
<style lang="scss" scoped>
.qgmafaqktjb {
width: 1200px;
margin: 0 auto;
background: #fff;
padding-bottom: 40px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment