enterprisejb.vue 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <div id="adviserList">
  3. <enterprisejb-detail
  4. :info="info"
  5. :form="form"
  6. @onSubmit="onSubmit"
  7. :liebiaoList="liebiaoList"
  8. @onsave="onsaveClick"
  9. :userinfo="userinfo"
  10. ></enterprisejb-detail>
  11. </div>
  12. </template>
  13. <script>
  14. import enterprisejbDetail from '@/components/enterprise/enterprisejb.vue';
  15. import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
  16. const { mapActions: login } = createNamespacedHelpers('login');
  17. const { mapActions: market } = createNamespacedHelpers('market');
  18. export default {
  19. name: 'adviserList',
  20. props: {},
  21. components: {
  22. enterprisejbDetail,
  23. },
  24. data: () => ({
  25. form: {},
  26. info: {},
  27. liebiaoList: [
  28. { name: '基本信息' },
  29. { name: '消息管理' },
  30. { name: '我的发布' },
  31. { name: '事项管理' },
  32. { name: '展会管理' },
  33. // { name: '返回首页' },
  34. { name: '修改密码' },
  35. { name: '注销账号' },
  36. ],
  37. userinfo: {},
  38. }),
  39. created() {
  40. this.searchInfo();
  41. },
  42. computed: {
  43. ...mapState(['user']),
  44. },
  45. methods: {
  46. ...market(['fetch', 'update']),
  47. ...login({ logout: 'logout', transactiondtetle: 'delete' }),
  48. // 查询基本信息
  49. async searchInfo() {
  50. let res = await this.fetch(this.user.userid);
  51. if (res.errcode === 0) {
  52. this.$set(this, `form`, res.data);
  53. }
  54. },
  55. async onSubmit({ data }) {
  56. console.log(data);
  57. let res;
  58. let msg;
  59. res = await this.update(data);
  60. },
  61. async onsaveClick({ id }) {
  62. console.log(id);
  63. if (id === '基本信息') {
  64. this.$router.push({ path: '/enterprise/enterprisejb' });
  65. } else if (id === '消息管理') {
  66. this.$router.push({ path: '/enterprise/enterprisexx' });
  67. } else if (id === '我的发布') {
  68. this.$router.push({ path: '/enterprise/enterprisefabu' });
  69. } else if (id === '事项管理') {
  70. this.$router.push({ path: '/enterprise/enterprisedg' });
  71. } else if (id === '展会管理') {
  72. this.$router.push({ path: '/enterprise/appointment' });
  73. } else if (id === '修改密码') {
  74. this.$router.push({ path: '/enterprise/xiugai' });
  75. } else if (id === '返回首页') {
  76. this.$router.push({ path: '/' });
  77. } else if (id === '注销账号') {
  78. this.logout();
  79. this.$message({
  80. message: '注销成功',
  81. type: 'success',
  82. });
  83. this.toLogin();
  84. }
  85. },
  86. async toLogin() {
  87. this.$router.push({ path: '/platlive' });
  88. },
  89. },
  90. };
  91. </script>
  92. <style lang="less" scoped></style>