123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <template>
- <div id="adviserList">
- <look-detail
- :liebiaoList="liebiaoList"
- @deleteRow="deleteRow"
- @success="success"
- @shibai="shibai"
- :resultTable="resultTable"
- @onsave="onsaveClick"
- :limit="limit"
- :total="total"
- @handleCurrentChange="handleCurrentChange"
- :pageSize="pageSize"
- :display="display"
- ></look-detail>
- </div>
- </template>
- <script>
- import lookDetail from '@/components/enterprise/look.vue';
- import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
- const { mapActions: apply } = createNamespacedHelpers('apply');
- const { mapActions: login } = createNamespacedHelpers('login');
- export default {
- name: 'adviserList',
- props: {},
- components: {
- lookDetail,
- },
- data: () => ({
- total: 0,
- limit: 4,
- display: 'list',
- pageSize: 4,
- info: {},
- liebiaoList: [
- { name: '基本信息' },
- { name: '消息管理' },
- { name: '我的发布' },
- { name: '事项管理' },
- { name: '展会管理' },
- // { name: '返回首页' },
- { name: '修改密码' },
- { name: '退出账号' },
- ],
- resultTable: [],
- form: {},
- }),
- created() {
- this.search();
- },
- computed: {
- data() {
- return this.$route.query.data;
- },
- ...mapState(['user']),
- },
- methods: {
- ...apply(['query', 'delete', 'update']),
- ...login({ logout: 'logout', transactiondtetle: 'delete' }),
- //查询
- async search({ skip = 0, limit = 4, currentPage } = { skip: 0, limit: 10 }) {
- console.log(this.data);
- console.log(this.data.apply.length);
- this.$set(this, `total`, this.data.apply.length);
- console.log();
- const newProducts = [];
- for (let index = skip; index < skip + limit; index++) {
- if (this.data.apply[index]) {
- newProducts.push(this.data.apply[index]);
- }
- }
- console.log(newProducts);
- this.$set(this, `resultTable`, newProducts);
- },
- handleCurrentChange({ currentPage }) {
- this.search({ skip: (currentPage - 1) * this.pageSize, limit: this.pageSize, currentPage });
- console.log(currentPage);
- },
- async onsaveClick({ id }) {
- console.log(id);
- if (id === '基本信息') {
- this.$router.push({ path: '/enterprise/enterprisejb' });
- } else if (id === '消息管理') {
- this.$router.push({ path: '/enterprise/enterprisexx' });
- } else if (id === '我的发布') {
- this.$router.push({ path: '/enterprise/enterprisefabu' });
- } else if (id === '事项管理') {
- this.$router.push({ path: '/enterprise/enterprisedg' });
- } else if (id === '展会管理') {
- this.$router.push({ path: '/enterprise/appointment' });
- } else if (id === '修改密码') {
- this.$router.push({ path: '/enterprise/xiugai' });
- } else if (id === '返回首页') {
- this.$router.push({ path: '/home' });
- } else if (id === '退出账号') {
- this.logout();
- this.$message({
- message: '注销成功',
- type: 'success',
- });
- this.toLogin();
- }
- },
- async toLogin() {
- this.$router.push({ path: '/platlive' });
- },
- async success(row) {
- row.status = '1';
- row.dock_id = this.data.id;
- row.id = data._id;
- console.log(row);
- let res = await this.update(row);
- this.$checkRes(res, '通过审核', '添加失败');
- },
- async shibai(row) {
- row.status = '2';
- row.dock_id = this.data.id;
- row.id = data._id;
- console.log(row);
- let res = await this.update(row);
- this.$checkRes(res, '审核拒绝', '添加失败');
- },
- async deleteRow(id) {
- const res = await this.delete(id);
- if (this.$checkRes(res, '删除成功', res.errmsg || '删除失败')) this.search();
- },
- },
- };
- </script>
- <style lang="less" scoped></style>
|