|
@@ -1,7 +1,9 @@
|
|
|
-<template>
|
|
|
+<template
|
|
|
+>
|
|
|
<el-card header="">
|
|
|
<div slot="header" class="clearfix">
|
|
|
<searchHeader
|
|
|
+ v-if="mdate.length>0"
|
|
|
:dates="mdate"
|
|
|
:title="'业务数据'"
|
|
|
:isShowQuert='false'
|
|
@@ -42,6 +44,10 @@ import searchHeader from "./modals/searchHeader";
|
|
|
import { getTimes } from "@/utils";
|
|
|
import { getIndex } from "../api";
|
|
|
import { descs,chioseNum } from "../constant";
|
|
|
+import {
|
|
|
+ getNowDateAndSunday,
|
|
|
+ getNowDateAndMonday,
|
|
|
+} from "@/utils/date";
|
|
|
export default {
|
|
|
props: ['data',"search"],
|
|
|
components: {
|
|
@@ -91,20 +97,25 @@ export default {
|
|
|
},
|
|
|
chartData() {
|
|
|
const values = Object.values(this.items)
|
|
|
+ console.log(values)
|
|
|
const months = {}
|
|
|
for (const item of values) {
|
|
|
for (const row of (item.indexMonthData || [])) {
|
|
|
const key = this.$helpers.dayjs(row.month).format('YYYY-MM-DD')
|
|
|
if (!months[key]) {
|
|
|
months[key] = {
|
|
|
- '日期': key,
|
|
|
+ '日期': key+'/'+getNowDateAndSunday(key),
|
|
|
}
|
|
|
}
|
|
|
months[key][item.title] = row.percent
|
|
|
}
|
|
|
}
|
|
|
+ console.log( Object.values(months))
|
|
|
+
|
|
|
return {
|
|
|
- columns: ['日期', ...values.map(item => item.title)],
|
|
|
+ columns: ['日期', ...values.map(item => {
|
|
|
+ return item.title
|
|
|
+ })],
|
|
|
rows: Object.values(months)
|
|
|
}
|
|
|
},
|
|
@@ -115,11 +126,17 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
active: 'ACTIVATION_RATE',
|
|
|
- mdate: this.search?.dates,
|
|
|
+ mdate: [],
|
|
|
+ loading:false
|
|
|
}
|
|
|
},
|
|
|
mounted(){
|
|
|
- console.log(this.mdate)
|
|
|
+ let nowTiem = this.$helpers.dayjs(new Date()).format('YYYY-MM-DD')
|
|
|
+ let startTime = this.$helpers.dayjs(getNowDateAndMonday(nowTiem)).subtract(56,'day').format('YYYY-MM-DD')
|
|
|
+ let endTime = getNowDateAndSunday(nowTiem)
|
|
|
+ this.mdate = [startTime,endTime];
|
|
|
+ this.FetchDetail();
|
|
|
+
|
|
|
},
|
|
|
methods:{
|
|
|
changeValue(date) {
|
|
@@ -129,6 +146,7 @@ export default {
|
|
|
this.FetchDetail();
|
|
|
},
|
|
|
async FetchDetail() {
|
|
|
+ this.loading = true;
|
|
|
const data = this.data;
|
|
|
try {
|
|
|
const { dates, ...rest } = this.search;
|
|
@@ -148,10 +166,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
|
}
|
|
|
- console.log(data)
|
|
|
+ this.loading = false
|
|
|
this.dataInfo = data;
|
|
|
this.$emit("resetDate", data);
|
|
|
},
|