店铺号数据下载

feature_0521
LegnaYet 6 years ago
parent 16cdfe3006
commit 06690f7e42

@ -142,6 +142,8 @@
},
exportData() {
let that = this;
this.loading = true;
that.data1 = [];
let stdate = null;
let eddate = null;
if (that.dateRange[0]) {
@ -149,8 +151,6 @@
eddate = this.$moment(that.dateRange[1]).format("YYYY-MM-DD");
}
let csvdata = [];
let request =
{
userId: that.userId,
@ -158,51 +158,8 @@
endDate: eddate,
companyId: that.changeData(that.companyId),
shopId: that.changeData(that.shopId),
sellerId: that.changeData(that.sellerId),
pageNum: 1,
pageSize: that.totalSize
};
customerDetail.dataDetail(request, function (data) {
data = data.data.results;
if (data) {
for (let i = 0; i < data.length; i++) {
let entity = data[i];
if (entity) {
if (i === 0) that.totalSize = entity.totalSize;
let birthday = entity.birthday;
let createTime = entity.createTime;
if (birthday) {
entity.birthday = that.$moment(birthday).format("MM-DD")
}
if (createTime) {
entity.createTime = that.$moment(createTime).format("YYYY-MM-DD")
}
that.checkParamBlank(entity);
csvdata.push(entity);
}
}
if (stdate == null) {
stdate = "--";
}
if (eddate == null) {
eddate = "--";
}
let title = "客户明细";
require.ensure([], () => {
const {export_json_to_excel} = require('../../excel/Export2Excel');
const tHeader = ['序号', '好友名称', '所属门店', '店铺编号', '所属导购', '工号', '创建时间', '好友手机号', '关联会员', '会员等级', '会员生日'];
//
const filterVal = ['number', 'name', 'shopName', 'shopCode', 'sellerName', 'sellerCode', 'createTime', 'phone', 'vipName', 'vipLevel', 'birthday'];
//
const list = csvdata; //datatableDatalist
const data = that.formatJson(filterVal, list);
export_json_to_excel(tHeader, data, title);
});
}
})
customerDetail.downloadstoreDataDetailExcel(request, null);
},
getStorerData: function () {

@ -2,7 +2,7 @@
* 客户数据明细
*/
import http from '../CommonHttp'
import http, {downloadExcel} from '../CommonHttp'
/**
* 查询客户数据明细
@ -17,6 +17,12 @@ export function dataDetail(params, call, errorCallBack) {
export function storeDataDetail(params, call, errorCallBack) {
return http.post('/store/promotion/data/behavior',params).then(call).catch(errorCallBack)
}
/**
* 查询客户数据明细
*/
export function downloadstoreDataDetailExcel(params,call) {
return http.downloadExcel('/store/promotion/data/behavior/excel','店铺号数据',params).then(call)
}
/**
* 下拉框数据导购
@ -57,6 +63,7 @@ export default {
dataDetail: dataDetail,
downSellerData: downSellerData,
storeDataDetail,
downloadstoreDataDetailExcel,
downShopData,
downRegionData,
editCustomerData,

Loading…
Cancel
Save