prod
parent
a53ce96429
commit
0de76e2404
@ -0,0 +1,205 @@
|
|||||||
|
import {getSalesType1,getSalesType0} from "@/api/SaleRankCity";
|
||||||
|
import {getSalesType6,getSalesType7} from "@/api/SaleRankCity";
|
||||||
|
import {getExcleTime} from "@/api/SaleRankCity";
|
||||||
|
import {getBrandType, getUserBrand, getUserSeriesName} from "@/api/comm"
|
||||||
|
import moment from "moment";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
getApi() {
|
||||||
|
getBrandType({token: this.getToken}).then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.brandTypeList = data
|
||||||
|
}),
|
||||||
|
getUserBrand({token: this.getToken}).then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
let brandList = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]];
|
||||||
|
let letters = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
|
||||||
|
for(let i = 0; i<data.length;i++) {
|
||||||
|
let index = letters.indexOf(data[i].firstword)
|
||||||
|
if(index >= 0) {
|
||||||
|
let obj = {
|
||||||
|
label: data[i].brandname,
|
||||||
|
value: data[i].brandname,
|
||||||
|
}
|
||||||
|
brandList[index].push(obj)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.brandList = brandList;
|
||||||
|
this.letters = letters;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getData() {
|
||||||
|
this.tableLoad = true;
|
||||||
|
let o = {token: this.getToken};
|
||||||
|
getExcleTime(o).then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.form.sStartTime = data.startTime.slice(0,7);
|
||||||
|
this.form.sEndTime = data.endTime.slice(0,7);
|
||||||
|
this.selTime[0] = data.startTime.slice(0,7);
|
||||||
|
this.selTime[1] = data.endTime.slice(0,7);
|
||||||
|
this.dDate = data.endTime;
|
||||||
|
let obj = {
|
||||||
|
token: this.getToken,
|
||||||
|
sTimeType: 4,
|
||||||
|
sStartTime: this.form.sStartTime,
|
||||||
|
sEndTime: this.form.sEndTime,
|
||||||
|
sBrandType: this.form.sBrandType,
|
||||||
|
iPageIndex: 1,
|
||||||
|
}
|
||||||
|
getSalesType1(obj).then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.pagination.total = res.totalNum
|
||||||
|
this.tbData = data
|
||||||
|
this.tableLoad = false;
|
||||||
|
});
|
||||||
|
getSalesType0(obj).then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.pagination2.total = res.totalNum
|
||||||
|
this.tbData2 = data;
|
||||||
|
this.tableLoad = false;
|
||||||
|
})
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//切换类型
|
||||||
|
handlerTime(activeIndex) {
|
||||||
|
this.activeIndex = activeIndex
|
||||||
|
},
|
||||||
|
//返回
|
||||||
|
goBack() {
|
||||||
|
this.$router.go(-1);
|
||||||
|
},
|
||||||
|
disabledDate(current) {
|
||||||
|
return (current > moment(this.dDate)) && moment(this.dDate);
|
||||||
|
},
|
||||||
|
//查询
|
||||||
|
onSearch() {
|
||||||
|
this.tableLoad = true;
|
||||||
|
this.form.sStartTime = this.selTime[0];
|
||||||
|
this.form.sEndTime = this.selTime[1];
|
||||||
|
getSalesType1(this.form).then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.pagination.total = res.totalNum
|
||||||
|
this.tbData = data
|
||||||
|
this.tableLoad = false;
|
||||||
|
});
|
||||||
|
getSalesType0(this.form).then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.pagination2.total = res.totalNum
|
||||||
|
this.tbData2 = data;
|
||||||
|
this.tableLoad = false;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//点击明细
|
||||||
|
onSalePro(record) {
|
||||||
|
let obj = {
|
||||||
|
token: this.form.token,
|
||||||
|
sTimeType: 4,
|
||||||
|
sStartTime: this.form.sStartTime,
|
||||||
|
sEndTime: this.form.sEndTime,
|
||||||
|
sBrandType: this.form.sBrandType,
|
||||||
|
iPageIndex: 1,
|
||||||
|
sProv: record.key
|
||||||
|
}
|
||||||
|
let o = {
|
||||||
|
sBrand: this.form.sBrand,
|
||||||
|
sSeriesName: this.form.sSeriesName
|
||||||
|
}
|
||||||
|
getSalesType0(Object.assign({},obj,o)).then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.dataProCity = data
|
||||||
|
})
|
||||||
|
getSalesType6(obj).then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.dataProBrand = data
|
||||||
|
})
|
||||||
|
getSalesType7(obj).then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.dataProSeries = data
|
||||||
|
})
|
||||||
|
this.visible = true;
|
||||||
|
},
|
||||||
|
onSaleCity(record) {
|
||||||
|
let obj = {
|
||||||
|
token: this.form.token,
|
||||||
|
sTimeType: 4,
|
||||||
|
sStartTime: this.form.sStartTime,
|
||||||
|
sEndTime: this.form.sEndTime,
|
||||||
|
sBrandType: this.form.sBrandType,
|
||||||
|
iPageIndex: 1,
|
||||||
|
sCity: record.key
|
||||||
|
}
|
||||||
|
getSalesType6(obj).then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.dataCityBrand = data
|
||||||
|
})
|
||||||
|
getSalesType7(obj).then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.dataCitySeries = data
|
||||||
|
})
|
||||||
|
this.visible2 = true;
|
||||||
|
},
|
||||||
|
//改变页面数据
|
||||||
|
handlerPagnation(page) {
|
||||||
|
this.tableLoading = true;
|
||||||
|
let cur = page.current;
|
||||||
|
this.pagination.current = cur;
|
||||||
|
this.form.iPageIndex = cur;
|
||||||
|
getSalesType1(this.form).then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.pagination.total = res.totalNum
|
||||||
|
this.tbData = data;
|
||||||
|
this.tableLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handlerPagnation2(page) {
|
||||||
|
this.tableLoading = true;
|
||||||
|
let cur = page.current;
|
||||||
|
this.pagination.current = cur;
|
||||||
|
this.form.iPageIndex = cur;
|
||||||
|
getSalesType0(this.form).then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.pagination2.total = res.totalNum
|
||||||
|
this.tbData = data;
|
||||||
|
this.tableLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//改变窗口模式
|
||||||
|
handlerProMode(activeIndex) {
|
||||||
|
this.pValue = activeIndex
|
||||||
|
},
|
||||||
|
handlerCityMode(activeIndex) {
|
||||||
|
this.cValue = activeIndex
|
||||||
|
},
|
||||||
|
//关闭窗口
|
||||||
|
onClose() {
|
||||||
|
this.visible = false
|
||||||
|
},
|
||||||
|
onClose2() {
|
||||||
|
this.visible2 = false
|
||||||
|
},
|
||||||
|
//抽屉
|
||||||
|
brandDrawer() {
|
||||||
|
this.drVisible = true
|
||||||
|
},
|
||||||
|
drClose() {
|
||||||
|
this.drVisible = false
|
||||||
|
},
|
||||||
|
//锚点
|
||||||
|
anchorClick(e, link) {
|
||||||
|
// 阻止点击的默认事件修改路由
|
||||||
|
e.preventDefault();
|
||||||
|
if(link.href) {
|
||||||
|
document.getElementById(link.href).scrollIntoView();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
drawerChooseBrand(val) {
|
||||||
|
this.form.sBrand = val;
|
||||||
|
let o = {token: this.getToken, sBrandName: this.form.sBrand};
|
||||||
|
getUserSeriesName(o).then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.seriesList = data;
|
||||||
|
this.form.sSeriesName = undefined;
|
||||||
|
})
|
||||||
|
this.drVisible = false;
|
||||||
|
},
|
||||||
|
}
|
Loading…
Reference in new issue