diff --git a/src/pages/data/CustomerDetail.vue b/src/pages/data/CustomerDetail.vue index ea30ee5..10d310f 100644 --- a/src/pages/data/CustomerDetail.vue +++ b/src/pages/data/CustomerDetail.vue @@ -248,6 +248,8 @@ } }, mounted: function () { + this.dateRange[0] = this.$moment().format("YYYY-MM-DD"); + this.dateRange[1] = this.$moment().format("YYYY-MM-DD"); this.getCustomerData(); this.getSelectList(); this.downSellerData(); diff --git a/src/pages/user/AccountManager.vue b/src/pages/user/AccountManager.vue index 5c83886..3c85bfc 100644 --- a/src/pages/user/AccountManager.vue +++ b/src/pages/user/AccountManager.vue @@ -24,6 +24,9 @@ + + + @@ -47,6 +50,7 @@ import accountManagement from "../../services/account/AccountManagement"; import zeroExtend from "../../services/customer/zeroExtend"; import staff from "../../services/staff/staff"; + import IncreaseData from "../../services/generalize/IncreaseData"; export default { data() { @@ -457,6 +461,60 @@ } }) }, + //零推广导出 + exportData: function () { + + this.loading = true; + let that = this; + let request = { + searchContent: that.searchContent, + pageNum: that.pageNum, + pageSize: that.totalSize, + roleId: that.selectedRoleId, + companyId: that.selectedCompanyId, + shopId: that.selectedShopId + }; + accountManagement.listAccountInfoApi(request, function (data) { + that.loading = false; + + that.data1 = []; + data = data.data; + if (data.code === '0001') { + return + } + if (data.code === '0000') { + if (data) { + let row = data.results.list; + that.totalSize = data.results.total; + if (row && row.length > 0) { + let originAllData = []; + for (let i = 0; i < row.length; i++) { + let entity = row[i]; + entity.index = i + 1; + originAllData.push(entity); + } + let title = "账号"; + require.ensure([], () => { + const {export_json_to_excel} = require('../../excel/Export2Excel'); + const tHeader = ['序号', '用户名', '别名', '账号', '手机号码', '角色', '零售公司', '零售公司编码', '店铺名称', '店铺编码']; + // 属性名 + const filterVal = ['index', 'userName', 'abbreviation', 'account', 'mobil', 'roleName', 'companyName', 'companyCode', 'shopName', 'shopCode']; + + // 数据 + //把data里的tableData存到list + const data = that.formatJson(filterVal, originAllData); + export_json_to_excel(tHeader, data, title); + }); + } + } + } + }, function () { + that.loading = false; + }); + }, + formatJson(filterVal, jsonData) { + return jsonData.map(v => filterVal.map(j => v[j])) + }, }, }