From b4e0830d722a84273dbad1f89fdfcc24b1a54589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E6=89=BF?= Date: Wed, 9 Apr 2025 17:13:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E5=A2=9E=E5=8A=A0=E6=B4=BB=E5=8A=A8=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/statisticalReport/index.vue | 54 ++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/src/views/statisticalReport/index.vue b/src/views/statisticalReport/index.vue index 3b6c458..6377c5b 100644 --- a/src/views/statisticalReport/index.vue +++ b/src/views/statisticalReport/index.vue @@ -36,6 +36,13 @@ " :value="item.id"> + + + + + @@ -116,6 +123,9 @@ import { deletePicList, getStatisticalReport, } from "@/utils/api/index"; +import { + getActivityApi, +} from "@/utils/api/reportApi"; import defaultImage from "../../assets/img/nodatapic2.jpg"; export default { name: "statisticalReport", @@ -133,6 +143,7 @@ export default { gtOptions: [{ id: -1, name: "全部" }], //杆塔数据 zzOptions: [{ id: -1, name: "全部" }], //装置数据 tdOptions: [{ id: -1, name: "全部", alias: null }], //通道数据 + activityOptions: [{ id: -1, name: "全部" }], //活动 formdata: { dyid: -1, lineid: -1, @@ -140,6 +151,7 @@ export default { channelid: -1, termid: -1, search: "", + activityId: -1 }, tdTermid: "", page: 1, // 当前页数 @@ -151,6 +163,7 @@ export default { }, created() { var that = this; + this.roleName = localStorage.getItem("userName"); document.onkeydown = function (e) { var key = window.event.keyCode; if (key === 13) { @@ -159,6 +172,7 @@ export default { }; }, mounted() { + this.getactiveList(); this.$set(this.formdata, "endtime", new Date().getTime()); if (JSON.stringify(this.$route.query) === "{}") { this.$set( @@ -175,6 +189,7 @@ export default { this.formdata.towerid = this.$route.query.towerId; this.formdata.channelid = this.$route.query.channelId; this.formdata.termid = this.$route.query.termId; + this.formdata.activityId = this.$route.query.activityId; this.$set(this.formdata, "starttime", Number(this.$route.query.date)); this.getPicData(); } @@ -188,7 +203,7 @@ export default { var txt = ""; row.hours.forEach(data => { if (data.base < data.timeList.length) { - let hour = parseInt(data.hour.substring(11,13)); + let hour = parseInt(data.hour.substring(11, 13)); txt += hour + "点" + data.wrongDetail + "张 , "; return; } @@ -208,25 +223,25 @@ export default { var txt = ""; row.hours.forEach(data => { if (data.base > data.timeList.length) { - let hour = data.hour.substring(11,13); + let hour = data.hour.substring(11, 13); //记录大于30之后的 let da = 0; //记录大于30之前的 let xi = 0; data.timeList.forEach(timedata => { - let min = parseInt(timedata.substring(11,13)); - if ( min > 30 ) { + let min = parseInt(timedata.substring(11, 13)); + if (min > 30) { da++; - } else if ( min < 30 ) { + } else if (min < 30) { xi++; } }); - if ( da == 0 ) { - txt += hour + ":30点少1张 , "; - } - if ( xi == 0 ) { + if (xi == 0) { txt += hour + ":00点少1张 , "; } + if (da == 0) { + txt += hour + ":30点少1张 , "; + } return; } }); @@ -327,6 +342,25 @@ export default { }) .catch((err) => { }); }, + //获取活动列表 + getactiveList() { + getActivityApi().then((res) => { + // this.activityOptions = this.activityOptions.concat(res.data.list); + let activeArr = res.data.map((item) => ({ + id: item.id, + name: item.title, + })); + this.activityOptions = this.activityOptions.concat(activeArr); + this.formdata.activityId = this.activityOptions[0].id; + // this.formdata.activityId = + // JSON.parse(localStorage.getItem("activeId")) !== null + // ? JSON.parse(localStorage.getItem("activeId")) + // : this.activityOptions[0].id; + }).catch((err) => { }); + }, + changeActive(val){ + this.formdata.activityId = val; + }, getSearchtdAlone() { getSearchInfo({ type: 5, id: this.tdTermid }) .then((res) => { @@ -340,7 +374,7 @@ export default { this.loading = true; this.$set(this.formdata, "pageindex", this.page); this.$set(this.formdata, "pagesize", this.pageSize); - // console.log(this.formdata); + console.log(this.formdata); getStatisticalReport(this.formdata).then((res) => { this.picList = []; //presetList