| | |
| | | <Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search">搜索</Button> |
| | | </Form> |
| | | </Row> |
| | | <Row class="operation padding-row" v-if="!selectedMember"> |
| | | <Button @click="addMember" type="primary">添加会员</Button> |
| | | <Row class="operation padding-row" > |
| | | <Button @click="addMember" v-if="!selectedMember" type="primary">添加会员</Button> |
| | | <Button @click="exportExcel" type="primary">导出excel</Button> |
| | | </Row> |
| | | |
| | | <Table :loading="loading" border :columns="columns" class="mt_10" :data="data" ref="table"></Table> |
| | |
| | | import * as RegExp from "@/libs/RegExp.js"; |
| | | import { getTags } from "@/api/tag.js"; |
| | | import { detailById } from "@/api/memberCustomerTag.js" |
| | | import {exportMemberListData} from "@/api/member.js"; |
| | | |
| | | export default { |
| | | name: "member", |
| | |
| | | this.searchForm.pageNumber = 1; |
| | | this.searchForm.pageSize = 10; |
| | | this.getData(); |
| | | }, // 搜索 |
| | | exportExcel() { |
| | | API_Member.exportMemberListData(this.searchForm).then(res =>{ |
| | | const blob = new Blob([res], { |
| | | type: "application/vnd.ms-excel;charset=utf-8", |
| | | }); |
| | | //对于<a>标签,只有 Firefox 和 Chrome(内核) 支持 download 属性 |
| | | //IE10以上支持blob但是依然不支持download |
| | | if ("download" in document.createElement("a")) { |
| | | //支持a标签download的浏览器 |
| | | const link = document.createElement("a"); //创建a标签 |
| | | link.download = "会员列表.xlsx"; //a标签添加属性 |
| | | link.style.display = "none"; |
| | | link.href = URL.createObjectURL(blob); |
| | | document.body.appendChild(link); |
| | | link.click(); //执行下载 |
| | | URL.revokeObjectURL(link.href); //释放url |
| | | document.body.removeChild(link); //释放标签 |
| | | } else { |
| | | navigator.msSaveBlob(blob, fileName); |
| | | } |
| | | }) |
| | | }, |
| | | //查看详情修改 |
| | | editPerm(val) { |