|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
<!--
|
|
|
|
|
* @Author: xw
|
|
|
|
|
* @Date: 2021-10-08 18:58:00
|
|
|
|
|
* @LastEditTime: 2021-12-02 10:26:23
|
|
|
|
|
* @LastEditTime: 2021-12-13 18:52:34
|
|
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
|
|
* @Description: 热销排行
|
|
|
|
|
* @FilePath: /data-show/src/views/Index/salesRank/index.vue
|
|
|
|
@ -28,8 +28,12 @@
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import createOpt from "./opt";
|
|
|
|
|
import {getCheZhuBrandCount0528, getCheZhuTime0528} from "@/api/home"
|
|
|
|
|
import {getBrandName,getUserSeriesName} from "@/api/comm"
|
|
|
|
|
import { getCheZhuBrandCount0528, getCheZhuTime0528 } from "@/api/home";
|
|
|
|
|
import {
|
|
|
|
|
getBrandName,
|
|
|
|
|
getUserSeriesName,
|
|
|
|
|
getBrandOrSeriesLevel,
|
|
|
|
|
} from "@/api/comm";
|
|
|
|
|
export default {
|
|
|
|
|
name: "sales-rank",
|
|
|
|
|
data() {
|
|
|
|
@ -41,13 +45,13 @@ export default {
|
|
|
|
|
sQueryType: 1,
|
|
|
|
|
sTimeType: 4,
|
|
|
|
|
sStartTime: "",
|
|
|
|
|
sEndTime: ""
|
|
|
|
|
sEndTime: "",
|
|
|
|
|
},
|
|
|
|
|
selArr: [],
|
|
|
|
|
pdata: [],
|
|
|
|
|
opt:{},
|
|
|
|
|
opt: {},
|
|
|
|
|
visible: false,
|
|
|
|
|
ModalText: ""
|
|
|
|
|
ModalText: "",
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
@ -62,9 +66,9 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 选择时间
|
|
|
|
|
handlerSelect(key) {
|
|
|
|
|
let n = this.selArr.findIndex(ele => {
|
|
|
|
|
return ele.key === key
|
|
|
|
|
})
|
|
|
|
|
let n = this.selArr.findIndex((ele) => {
|
|
|
|
|
return ele.key === key;
|
|
|
|
|
});
|
|
|
|
|
let obj = this.selArr[n];
|
|
|
|
|
this.form.sStartTime = obj.starttime;
|
|
|
|
|
this.form.sEndTime = obj.endtime;
|
|
|
|
@ -73,66 +77,76 @@ export default {
|
|
|
|
|
// 获取选择时间的数据
|
|
|
|
|
getSelect() {
|
|
|
|
|
this.load = true;
|
|
|
|
|
getCheZhuTime0528().then(res => {
|
|
|
|
|
this.selArr = res.data
|
|
|
|
|
getCheZhuTime0528().then((res) => {
|
|
|
|
|
this.selArr = res.data;
|
|
|
|
|
this.selVal = this.selArr[0].key;
|
|
|
|
|
this.form.sStartTime = this.selArr[0].starttime;
|
|
|
|
|
this.form.sEndTime = this.selArr[0].endtime;
|
|
|
|
|
this.getData();
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 获取数据
|
|
|
|
|
getData() {
|
|
|
|
|
this.load = true;
|
|
|
|
|
getCheZhuBrandCount0528(this.form).then(res => {
|
|
|
|
|
getCheZhuBrandCount0528(this.form).then((res) => {
|
|
|
|
|
let data = res.data;
|
|
|
|
|
this.pdata = data;
|
|
|
|
|
this.load = false;
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 获取分页的数据
|
|
|
|
|
handlerPage(arr = []) {
|
|
|
|
|
let dx = [];
|
|
|
|
|
let ds = [];
|
|
|
|
|
arr.forEach(ele => {
|
|
|
|
|
arr.forEach((ele) => {
|
|
|
|
|
let key = ele.key;
|
|
|
|
|
let value = ele.value;
|
|
|
|
|
dx.push(key);
|
|
|
|
|
ds.push(value);
|
|
|
|
|
})
|
|
|
|
|
this.opt = createOpt(dx, ds)
|
|
|
|
|
});
|
|
|
|
|
this.opt = createOpt(dx, ds);
|
|
|
|
|
},
|
|
|
|
|
handleCancel() {
|
|
|
|
|
this.visible = false;
|
|
|
|
|
},
|
|
|
|
|
handleOk() {
|
|
|
|
|
this.$router.push('/login')
|
|
|
|
|
this.$router.push("/login");
|
|
|
|
|
},
|
|
|
|
|
clickEchars(data) {
|
|
|
|
|
if (!this.getToken) {
|
|
|
|
|
this.visible = true;
|
|
|
|
|
this.ModalText = "您还未登录,是否前往登录"
|
|
|
|
|
this.ModalText = "您还未登录,是否前往登录";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let ele = data[0];
|
|
|
|
|
if(this.type === 1) {
|
|
|
|
|
let model = ele.axisValueLabel
|
|
|
|
|
this.setModel({name: model});
|
|
|
|
|
if (this.type === 1) {
|
|
|
|
|
let model = ele.axisValueLabel;
|
|
|
|
|
getBrandOrSeriesLevel({
|
|
|
|
|
token: this.getToken,
|
|
|
|
|
sSeriesName: model,
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.setModel({ name: model });
|
|
|
|
|
this.setHeaderType(3);
|
|
|
|
|
let obj = {
|
|
|
|
|
token: this.getToken,
|
|
|
|
|
sSeriesName: model
|
|
|
|
|
}
|
|
|
|
|
sSeriesName: model,
|
|
|
|
|
};
|
|
|
|
|
getBrandName(obj).then((res) => {
|
|
|
|
|
this.setBrand({brandname: res.data})
|
|
|
|
|
this.setBrand({ brandname: res.data });
|
|
|
|
|
this.$router.push("/modelInsight");
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
let brand = ele.axisValueLabel;
|
|
|
|
|
getBrandOrSeriesLevel({
|
|
|
|
|
token: this.getToken,
|
|
|
|
|
sBrand: brand,
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getUserSeriesName(brand); //同步车型
|
|
|
|
|
this.setBrand({brandname: brand});
|
|
|
|
|
this.setBrand({ brandname: brand });
|
|
|
|
|
this.setHeaderType(3);
|
|
|
|
|
this.$router.push("/brandInsight");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 获取车型
|
|
|
|
|