|
|
|
@ -9,7 +9,7 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="mccm-outter">
|
|
|
|
|
<v-label-div title="切换车型">
|
|
|
|
|
<a-button style="margin-right: 1rem" :loading="btnLoading" @click="handlerExport" v-if="getMComparison.length > 0" v-has="'btn_model_c_toppt'">导出报告</a-button>
|
|
|
|
|
<!-- <a-button style="margin-right: 1rem" :loading="btnLoading" @click="handlerExport" v-if="getMComparison.length > 0" v-has="'btn_model_c_toppt'">导出报告</a-button> -->
|
|
|
|
|
<v-btn @click="goback">返回洞察详情</v-btn>
|
|
|
|
|
</v-label-div>
|
|
|
|
|
<div class="mccm-inner">
|
|
|
|
@ -33,8 +33,8 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { getToPptTask } from "@/api/BrandInsight";
|
|
|
|
|
import { getUserSeriesName } from "@/api/comm";
|
|
|
|
|
// import { getToPptTask } from "@/api/BrandInsight";
|
|
|
|
|
// import { getUserSeriesName } from "@/api/comm";
|
|
|
|
|
export default {
|
|
|
|
|
name: "brandCompateHeader",
|
|
|
|
|
props: {
|
|
|
|
@ -45,18 +45,18 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
data: {
|
|
|
|
|
handler(val) {
|
|
|
|
|
if (val.length > 0) {
|
|
|
|
|
val.forEach((ele, index) => {
|
|
|
|
|
this.list[index] = Object.assign(this.list[index], ele);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
immediate: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
// watch: {
|
|
|
|
|
// data: {
|
|
|
|
|
// handler(val) {
|
|
|
|
|
// if (val.length > 0) {
|
|
|
|
|
// val.forEach((ele, index) => {
|
|
|
|
|
// this.list[index] = Object.assign(this.list[index], ele);
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// immediate: true,
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
btnLoading: false,
|
|
|
|
@ -104,90 +104,90 @@ export default {
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.brand = this.getBrand.brandname || "奥迪";
|
|
|
|
|
this.modelData();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
goback() {
|
|
|
|
|
this.$router.go(-1);
|
|
|
|
|
},
|
|
|
|
|
// 获取车型
|
|
|
|
|
modelData() {
|
|
|
|
|
let model = this.getModel.name || "";
|
|
|
|
|
if (!model) {
|
|
|
|
|
this.getUserSeriesName(this.brand);
|
|
|
|
|
} else {
|
|
|
|
|
this.model = model;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 获取车型
|
|
|
|
|
getUserSeriesName(brandName) {
|
|
|
|
|
this.form.token = this.getToken;
|
|
|
|
|
this.form.sBrandName = brandName;
|
|
|
|
|
getUserSeriesName(this.form).then((res) => {
|
|
|
|
|
let data = res.data || [];
|
|
|
|
|
this.model = data[0].name;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 打开选择车型的弹出框
|
|
|
|
|
handlerChoose(n) {
|
|
|
|
|
this.chooseIndex = n;
|
|
|
|
|
this.modelShow = true;
|
|
|
|
|
},
|
|
|
|
|
// 删除车型
|
|
|
|
|
handlerDel(n) {
|
|
|
|
|
let row = this.list[n];
|
|
|
|
|
row.brand = "";
|
|
|
|
|
row.model = "";
|
|
|
|
|
row.isDel = false;
|
|
|
|
|
let filterArr = this.list.filter((ele) => {
|
|
|
|
|
return ele.brand && ele.model;
|
|
|
|
|
});
|
|
|
|
|
this.$emit("del", n);
|
|
|
|
|
this.$emit("change", filterArr);
|
|
|
|
|
},
|
|
|
|
|
// 获取切换车型的数据
|
|
|
|
|
handlerBrand(arr) {
|
|
|
|
|
let n = this.list.findIndex((ele) => ele.model === arr[1].name);
|
|
|
|
|
if (n != -1) return;
|
|
|
|
|
let row = this.list[this.chooseIndex];
|
|
|
|
|
row.brand = arr[0].brandname;
|
|
|
|
|
row.model = arr[1].name;
|
|
|
|
|
row.isDel = true;
|
|
|
|
|
let filterArr = this.list.filter((ele) => {
|
|
|
|
|
return ele.brand && ele.model;
|
|
|
|
|
});
|
|
|
|
|
this.$emit("change", filterArr);
|
|
|
|
|
},
|
|
|
|
|
handlerExport() {
|
|
|
|
|
this.btnLoading = true;
|
|
|
|
|
let arr = this.getMComparison;
|
|
|
|
|
let brands = [];
|
|
|
|
|
let models = [];
|
|
|
|
|
arr.forEach((ele) => {
|
|
|
|
|
brands.push(ele.brand);
|
|
|
|
|
models.push(ele.model);
|
|
|
|
|
});
|
|
|
|
|
let sBrand = brands.toString();
|
|
|
|
|
let sSeriesName = models.toString();
|
|
|
|
|
let obj = Object.assign({}, this.getCtime2, {
|
|
|
|
|
token: this.getToken,
|
|
|
|
|
iContrastType: 2,
|
|
|
|
|
sBrand: sBrand,
|
|
|
|
|
sSeriesName: sSeriesName,
|
|
|
|
|
sType: 'ToSeriesPptV6'
|
|
|
|
|
});
|
|
|
|
|
getToPptTask(obj).then(() => {
|
|
|
|
|
this.$notification.open({
|
|
|
|
|
message: `数据生成中`,
|
|
|
|
|
description: '请前往个人中心查看下载进度',
|
|
|
|
|
placement: 'bottomRight',
|
|
|
|
|
});
|
|
|
|
|
this.btnLoading = false;
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// created() {
|
|
|
|
|
// this.brand = this.getBrand.brandname || "奥迪";
|
|
|
|
|
// this.modelData();
|
|
|
|
|
// },
|
|
|
|
|
// methods: {
|
|
|
|
|
// goback() {
|
|
|
|
|
// this.$router.go(-1);
|
|
|
|
|
// },
|
|
|
|
|
// // 获取车型
|
|
|
|
|
// modelData() {
|
|
|
|
|
// let model = this.getModel.name || "";
|
|
|
|
|
// if (!model) {
|
|
|
|
|
// this.getUserSeriesName(this.brand);
|
|
|
|
|
// } else {
|
|
|
|
|
// this.model = model;
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// // 获取车型
|
|
|
|
|
// getUserSeriesName(brandName) {
|
|
|
|
|
// this.form.token = this.getToken;
|
|
|
|
|
// this.form.sBrandName = brandName;
|
|
|
|
|
// getUserSeriesName(this.form).then((res) => {
|
|
|
|
|
// let data = res.data || [];
|
|
|
|
|
// this.model = data[0].name;
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// // 打开选择车型的弹出框
|
|
|
|
|
// handlerChoose(n) {
|
|
|
|
|
// this.chooseIndex = n;
|
|
|
|
|
// this.modelShow = true;
|
|
|
|
|
// },
|
|
|
|
|
// // 删除车型
|
|
|
|
|
// handlerDel(n) {
|
|
|
|
|
// let row = this.list[n];
|
|
|
|
|
// row.brand = "";
|
|
|
|
|
// row.model = "";
|
|
|
|
|
// row.isDel = false;
|
|
|
|
|
// let filterArr = this.list.filter((ele) => {
|
|
|
|
|
// return ele.brand && ele.model;
|
|
|
|
|
// });
|
|
|
|
|
// this.$emit("del", n);
|
|
|
|
|
// this.$emit("change", filterArr);
|
|
|
|
|
// },
|
|
|
|
|
// // 获取切换车型的数据
|
|
|
|
|
// handlerBrand(arr) {
|
|
|
|
|
// let n = this.list.findIndex((ele) => ele.model === arr[1].name);
|
|
|
|
|
// if (n != -1) return;
|
|
|
|
|
// let row = this.list[this.chooseIndex];
|
|
|
|
|
// row.brand = arr[0].brandname;
|
|
|
|
|
// row.model = arr[1].name;
|
|
|
|
|
// row.isDel = true;
|
|
|
|
|
// let filterArr = this.list.filter((ele) => {
|
|
|
|
|
// return ele.brand && ele.model;
|
|
|
|
|
// });
|
|
|
|
|
// this.$emit("change", filterArr);
|
|
|
|
|
// },
|
|
|
|
|
// handlerExport() {
|
|
|
|
|
// this.btnLoading = true;
|
|
|
|
|
// let arr = this.getMComparison;
|
|
|
|
|
// let brands = [];
|
|
|
|
|
// let models = [];
|
|
|
|
|
// arr.forEach((ele) => {
|
|
|
|
|
// brands.push(ele.brand);
|
|
|
|
|
// models.push(ele.model);
|
|
|
|
|
// });
|
|
|
|
|
// let sBrand = brands.toString();
|
|
|
|
|
// let sSeriesName = models.toString();
|
|
|
|
|
// let obj = Object.assign({}, this.getCtime2, {
|
|
|
|
|
// token: this.getToken,
|
|
|
|
|
// iContrastType: 2,
|
|
|
|
|
// sBrand: sBrand,
|
|
|
|
|
// sSeriesName: sSeriesName,
|
|
|
|
|
// sType: 'ToSeriesPptV6'
|
|
|
|
|
// });
|
|
|
|
|
// getToPptTask(obj).then(() => {
|
|
|
|
|
// this.$notification.open({
|
|
|
|
|
// message: `数据生成中`,
|
|
|
|
|
// description: '请前往个人中心查看下载进度',
|
|
|
|
|
// placement: 'bottomRight',
|
|
|
|
|
// });
|
|
|
|
|
// this.btnLoading = false;
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|