menu1.0
fanluyan 2 months ago
commit d60bf45bad

@ -36,6 +36,13 @@
" :value="item.id"></el-option> " :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="活动" class="activitybox"
v-if="roleName === 'superadmin' || roleName === 'Matthew'">
<el-select @keyup.enter.native="onSubmit()" v-model="formdata.activityId" filterable @change="changeActive">
<el-option v-for="item in activityOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="开始日期"> <el-form-item label="开始日期">
<el-date-picker v-model="formdata.starttime" type="datetime" placeholder="开始日期" <el-date-picker v-model="formdata.starttime" type="datetime" placeholder="开始日期"
value-format="timestamp" :picker-options="pickerOptions" default-time="00:00:00"> value-format="timestamp" :picker-options="pickerOptions" default-time="00:00:00">
@ -116,6 +123,9 @@ import {
deletePicList, deletePicList,
getStatisticalReport, getStatisticalReport,
} from "@/utils/api/index"; } from "@/utils/api/index";
import {
getActivityApi,
} from "@/utils/api/reportApi";
import defaultImage from "../../assets/img/nodatapic2.jpg"; import defaultImage from "../../assets/img/nodatapic2.jpg";
export default { export default {
name: "statisticalReport", name: "statisticalReport",
@ -133,6 +143,7 @@ export default {
gtOptions: [{ id: -1, name: "全部" }], // gtOptions: [{ id: -1, name: "全部" }], //
zzOptions: [{ id: -1, name: "全部" }], // zzOptions: [{ id: -1, name: "全部" }], //
tdOptions: [{ id: -1, name: "全部", alias: null }], // tdOptions: [{ id: -1, name: "全部", alias: null }], //
activityOptions: [{ id: -1, name: "全部" }], //
formdata: { formdata: {
dyid: -1, dyid: -1,
lineid: -1, lineid: -1,
@ -140,6 +151,7 @@ export default {
channelid: -1, channelid: -1,
termid: -1, termid: -1,
search: "", search: "",
activityId: -1
}, },
tdTermid: "", tdTermid: "",
page: 1, // page: 1, //
@ -151,6 +163,7 @@ export default {
}, },
created() { created() {
var that = this; var that = this;
this.roleName = localStorage.getItem("userName");
document.onkeydown = function (e) { document.onkeydown = function (e) {
var key = window.event.keyCode; var key = window.event.keyCode;
if (key === 13) { if (key === 13) {
@ -159,6 +172,7 @@ export default {
}; };
}, },
mounted() { mounted() {
this.getactiveList();
this.$set(this.formdata, "endtime", new Date().getTime()); this.$set(this.formdata, "endtime", new Date().getTime());
if (JSON.stringify(this.$route.query) === "{}") { if (JSON.stringify(this.$route.query) === "{}") {
this.$set( this.$set(
@ -175,6 +189,7 @@ export default {
this.formdata.towerid = this.$route.query.towerId; this.formdata.towerid = this.$route.query.towerId;
this.formdata.channelid = this.$route.query.channelId; this.formdata.channelid = this.$route.query.channelId;
this.formdata.termid = this.$route.query.termId; 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.$set(this.formdata, "starttime", Number(this.$route.query.date));
this.getPicData(); this.getPicData();
} }
@ -188,7 +203,7 @@ export default {
var txt = ""; var txt = "";
row.hours.forEach(data => { row.hours.forEach(data => {
if (data.base < data.timeList.length) { 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 + "张 , "; txt += hour + "点" + data.wrongDetail + "张 , ";
return; return;
} }
@ -208,25 +223,25 @@ export default {
var txt = ""; var txt = "";
row.hours.forEach(data => { row.hours.forEach(data => {
if (data.base > data.timeList.length) { if (data.base > data.timeList.length) {
let hour = data.hour.substring(11,13); let hour = data.hour.substring(11, 13);
//30 //30
let da = 0; let da = 0;
//30 //30
let xi = 0; let xi = 0;
data.timeList.forEach(timedata => { data.timeList.forEach(timedata => {
let min = parseInt(timedata.substring(11,13)); let min = parseInt(timedata.substring(11, 13));
if ( min > 30 ) { if (min > 30) {
da++; da++;
} else if ( min < 30 ) { } else if (min < 30) {
xi++; xi++;
} }
}); });
if ( da == 0 ) { if (xi == 0) {
txt += hour + ":30点少1张 , ";
}
if ( xi == 0 ) {
txt += hour + ":00点少1张 , "; txt += hour + ":00点少1张 , ";
} }
if (da == 0) {
txt += hour + ":30点少1张 , ";
}
return; return;
} }
}); });
@ -327,6 +342,25 @@ export default {
}) })
.catch((err) => { }); .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() { getSearchtdAlone() {
getSearchInfo({ type: 5, id: this.tdTermid }) getSearchInfo({ type: 5, id: this.tdTermid })
.then((res) => { .then((res) => {
@ -340,7 +374,7 @@ export default {
this.loading = true; this.loading = true;
this.$set(this.formdata, "pageindex", this.page); this.$set(this.formdata, "pageindex", this.page);
this.$set(this.formdata, "pagesize", this.pageSize); this.$set(this.formdata, "pagesize", this.pageSize);
// console.log(this.formdata); console.log(this.formdata);
getStatisticalReport(this.formdata).then((res) => { getStatisticalReport(this.formdata).then((res) => {
this.picList = []; this.picList = [];
//presetList //presetList

Loading…
Cancel
Save