From 06690f7e42ca433c0c226f3d9b08142a988e5045 Mon Sep 17 00:00:00 2001 From: LegnaYet <1023868505@qq.com> Date: Tue, 19 May 2020 16:00:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=97=E9=93=BA=E5=8F=B7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/data/StoreDetail.vue | 49 ++------------------------- src/services/datacenter/DataCenter.js | 9 ++++- 2 files changed, 11 insertions(+), 47 deletions(-) diff --git a/src/pages/data/StoreDetail.vue b/src/pages/data/StoreDetail.vue index d123468..616c13a 100644 --- a/src/pages/data/StoreDetail.vue +++ b/src/pages/data/StoreDetail.vue @@ -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; //把data里的tableData存到list - const data = that.formatJson(filterVal, list); - export_json_to_excel(tHeader, data, title); - }); - } - }) + customerDetail.downloadstoreDataDetailExcel(request, null); }, getStorerData: function () { diff --git a/src/services/datacenter/DataCenter.js b/src/services/datacenter/DataCenter.js index b9bed5f..eadbfcd 100644 --- a/src/services/datacenter/DataCenter.js +++ b/src/services/datacenter/DataCenter.js @@ -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,