|
|
|
@ -24,6 +24,9 @@
|
|
|
|
|
<Button type="primary" class="search-btn"
|
|
|
|
|
@click="addOneAccount()">+添加账户
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
|
|
<Button type="primary" class="search-btn" @click="exportData" :loading="loading">导出数据</Button>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</Row>
|
|
|
|
|
</template>
|
|
|
|
@ -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]))
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|