123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <template>
- <div id="adviserList">
- <look-detail
- :liebiaoList="liebiaoList"
- @deleteRow="deleteRow"
- @success="success"
- @shibai="shibai"
- :resultTable="resultTable"
- @onsave="onsaveClick"
- ></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: () => ({
- 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() {
- console.log(this.data);
- // let id = this.data;
- // console.log(res.data);
- this.$set(this, `resultTable`, this.data.apply);
- console.log();
- },
- 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: '/' });
- },
- 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>
|