|
@@ -11,24 +11,20 @@
|
|
|
</van-tab>
|
|
|
</van-tabs> -->
|
|
|
<van-col span="24" class="one">
|
|
|
- <van-button type="info" size="small" @click="getTemplate()">数据模板下载</van-button>
|
|
|
<van-button type="info" size="small" @click="toImport()">批量注册用户</van-button>
|
|
|
+ <van-button type="info" size="small" @click="tpExport()">批量导出用户</van-button>
|
|
|
</van-col>
|
|
|
<van-col span="24" class="two">
|
|
|
<personal-1 :list="personalList" @detail="perDetail"></personal-1>
|
|
|
</van-col>
|
|
|
</template>
|
|
|
</admin-frame>
|
|
|
- <van-dialog class="dialog" v-model="dialog.show" :title="dialog.title" :show-confirm-button="false" show-cancel-button>
|
|
|
- <importForm-1 :form="form" v-if="dialog.type == '1'" @onSubmit="onSubmit"></importForm-1>
|
|
|
- </van-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import personal1 from './parts/personal-1.vue';
|
|
|
import company1 from './parts/company-1.vue';
|
|
|
-import importForm1 from './parts/importForm-1.vue';
|
|
|
import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: personal } = createNamespacedHelpers('personal');
|
|
@@ -39,7 +35,6 @@ export default {
|
|
|
components: {
|
|
|
adminFrame,
|
|
|
personal1,
|
|
|
- importForm1,
|
|
|
},
|
|
|
data: function () {
|
|
|
return {
|
|
@@ -48,17 +43,13 @@ export default {
|
|
|
companyList: [],
|
|
|
total: 0,
|
|
|
limit: 5,
|
|
|
- // 弹框
|
|
|
- dialog: { show: false, title: '批量注册', type: '1' },
|
|
|
- // 详细信息
|
|
|
- form: {},
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
|
await this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
- ...personal(['query', 'import']),
|
|
|
+ ...personal(['query', 'export']),
|
|
|
...organization({ orgQuery: 'query' }),
|
|
|
// 查询列表
|
|
|
async search({ skip = 0, limit = this.limit, ...info } = {}) {
|
|
@@ -94,23 +85,16 @@ export default {
|
|
|
},
|
|
|
// 批量注册用户
|
|
|
toImport() {
|
|
|
- this.dialog = { show: true, title: '批量注册', type: '1' };
|
|
|
+ this.$router.push({ path: `/account/adminCenter/users/import_user` });
|
|
|
},
|
|
|
- async onSubmit(data) {
|
|
|
- var p1 = data.file.map((item) => ({ uri: item.url }))[0];
|
|
|
- let res = await this.import(p1);
|
|
|
+ // 导出用户
|
|
|
+ async tpExport() {
|
|
|
+ let res = await this.export();
|
|
|
if (this.$checkRes(res)) {
|
|
|
- this.$toast({ type: `success`, message: `操作完成` });
|
|
|
- this.search();
|
|
|
- this.dialog = { show: false, title: '批量注册', type: '1' };
|
|
|
- } else {
|
|
|
- this.$toast({ type: `success`, message: `${res.errmsg}` });
|
|
|
+ window.location.href = `${process.env.VUE_APP_HOST}/${res.data}`;
|
|
|
}
|
|
|
},
|
|
|
- // 数据模板下载
|
|
|
- getTemplate() {
|
|
|
- window.location.href = `${process.env.VUE_APP_HOST}/${process.env.VUE_APP_ROUTER}/用户批量注册数据模板.xlsx`;
|
|
|
- },
|
|
|
+
|
|
|
// 返回
|
|
|
back() {
|
|
|
this.$router.push({ path: `/account/index` });
|
|
@@ -141,10 +125,4 @@ export default {
|
|
|
margin: 0 10px;
|
|
|
}
|
|
|
}
|
|
|
-.dialog {
|
|
|
- /deep/.van-dialog__content {
|
|
|
- max-height: 350px;
|
|
|
- overflow-y: auto;
|
|
|
- }
|
|
|
-}
|
|
|
</style>
|