look.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <div id="adviserList">
  3. <look-detail
  4. :liebiaoList="liebiaoList"
  5. @deleteRow="deleteRow"
  6. @success="success"
  7. @shibai="shibai"
  8. :resultTable="resultTable"
  9. @onsave="onsaveClick"
  10. ></look-detail>
  11. </div>
  12. </template>
  13. <script>
  14. import lookDetail from '@/components/enterprise/look.vue';
  15. import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
  16. const { mapActions: apply } = createNamespacedHelpers('apply');
  17. const { mapActions: login } = createNamespacedHelpers('login');
  18. export default {
  19. name: 'adviserList',
  20. props: {},
  21. components: {
  22. lookDetail,
  23. },
  24. data: () => ({
  25. info: {},
  26. liebiaoList: [
  27. { name: '基本信息' },
  28. { name: '消息管理' },
  29. { name: '我的发布' },
  30. { name: '事项管理' },
  31. { name: '展会预约' },
  32. { name: '返回首页' },
  33. { name: '修改密码' },
  34. { name: '注销账号' },
  35. ],
  36. resultTable: [],
  37. form: {},
  38. }),
  39. created() {
  40. this.search();
  41. },
  42. computed: {
  43. data() {
  44. return this.$route.query.data;
  45. },
  46. ...mapState(['user']),
  47. },
  48. methods: {
  49. ...apply(['query', 'delete', 'update']),
  50. ...login({ logout: 'logout', transactiondtetle: 'delete' }),
  51. //查询
  52. async search() {
  53. console.log(this.data);
  54. // let id = this.data;
  55. // console.log(res.data);
  56. this.$set(this, `resultTable`, this.data.apply);
  57. console.log();
  58. },
  59. async onsaveClick({ id }) {
  60. console.log(id);
  61. if (id === '基本信息') {
  62. this.$router.push({ path: '/enterprise/enterprisejb' });
  63. } else if (id === '消息管理') {
  64. this.$router.push({ path: '/enterprise/enterprisexx' });
  65. } else if (id === '我的发布') {
  66. this.$router.push({ path: '/enterprise/enterprisefabu' });
  67. } else if (id === '事项管理') {
  68. this.$router.push({ path: '/enterprise/enterprisedg' });
  69. } else if (id === '展会预约') {
  70. this.$router.push({ path: '/enterprise/appointment' });
  71. } else if (id === '修改密码') {
  72. this.$router.push({ path: '/enterprise/xiugai' });
  73. } else if (id === '返回首页') {
  74. this.$router.push({ path: '/home' });
  75. } else if (id === '注销账号') {
  76. this.logout();
  77. this.$message({
  78. message: '注销成功',
  79. type: 'success',
  80. });
  81. this.toLogin();
  82. }
  83. },
  84. async toLogin() {
  85. this.$router.push({ path: '/' });
  86. },
  87. async success(row) {
  88. row.status = '1';
  89. row.dock_id = this.data.id;
  90. row.id = data._id;
  91. console.log(row);
  92. let res = await this.update(row);
  93. this.$checkRes(res, '通过审核', '添加失败');
  94. },
  95. async shibai(row) {
  96. row.status = '2';
  97. row.dock_id = this.data.id;
  98. row.id = data._id;
  99. console.log(row);
  100. let res = await this.update(row);
  101. this.$checkRes(res, '审核拒绝', '添加失败');
  102. },
  103. async deleteRow(id) {
  104. const res = await this.delete(id);
  105. if (this.$checkRes(res, '删除成功', res.errmsg || '删除失败')) this.search();
  106. },
  107. },
  108. };
  109. </script>
  110. <style lang="less" scoped></style>