enterprisedg.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <div id="adviserList">
  3. <enterprisedg-detail
  4. :liebiaoList="liebiaoList"
  5. :dinggou1="dinggou1"
  6. :dinggou2="dinggou2"
  7. :dinggou3="dinggou3"
  8. @onsave="onsaveClick"
  9. :total1="total1"
  10. :total2="total2"
  11. :total3="total3"
  12. @handleCurrentChange="change1"
  13. @handleCurrentChange1="change2"
  14. @handleCurrentChange2="change3"
  15. @deletes="deleteData"
  16. :faqilist="faqilist"
  17. :totalfaqi="totalfaqi"
  18. @handleCurrentChangefaqi="handleCurrentChangefaqi"
  19. @jiaoyisuccess="jiaoyisuccess"
  20. @shibai="shibai"
  21. @success="success"
  22. ></enterprisedg-detail>
  23. </div>
  24. </template>
  25. <script>
  26. import enterprisedgDetail from '@/components/enterprise/enterpisedg.vue';
  27. import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
  28. const { mapActions: transaction } = createNamespacedHelpers('transaction');
  29. const { mapActions: expertsaudit } = createNamespacedHelpers('expertsaudit');
  30. const { mapActions: login } = createNamespacedHelpers('login');
  31. export default {
  32. name: 'adviserList',
  33. props: {},
  34. components: {
  35. enterprisedgDetail,
  36. },
  37. data: () => ({
  38. liebiaoList: [
  39. { name: '基本信息' },
  40. { name: '消息管理' },
  41. { name: '我的发布' },
  42. { name: '事项管理' },
  43. { name: '展会管理' },
  44. // { name: '返回首页' },
  45. { name: '修改密码' },
  46. { name: '注销账号' },
  47. ],
  48. total1: 0,
  49. total2: 0,
  50. total3: 0,
  51. totalfaqi: 0,
  52. faqilist: [],
  53. dinggou1: [],
  54. dinggou2: [],
  55. dinggou3: [],
  56. skip: '',
  57. }),
  58. created() {
  59. this.jiaoyi1();
  60. this.jiaoyi2();
  61. this.jiaoyi3();
  62. this.faqijiaoyi();
  63. },
  64. computed: {
  65. ...mapState(['user']),
  66. },
  67. methods: {
  68. ...transaction({ transactionList: 'query', transactiondtetle: 'delete', shenheupdate: 'update' }),
  69. ...expertsaudit({ expertsauditList: 'query', expertsauditdtetle: 'delete', expertsauditupdate: 'update' }),
  70. ...login({ logout: 'logout', transactiondtetlse: 'delete' }),
  71. // 查询
  72. async faqijiaoyi({ skip = 0, limit = 3, ...info } = {}) {
  73. let status = 0;
  74. let market_userid = this.user.uid;
  75. skip = this.skip;
  76. if (this.user.role == '2' || this.user.role == '3') {
  77. const res = await this.transactionList({ skip, limit, market_userid, status, ...info });
  78. if (this.$checkRes(res)) {
  79. this.$set(this, `faqilist`, res.data);
  80. this.$set(this, `totalfaqi`, res.total);
  81. }
  82. } else if (this.role == '6') {
  83. const res = await this.expertsauditList({ skip, limit, market_userid, status, ...info });
  84. if (this.$checkRes(res)) {
  85. this.$set(this, `faqilist`, res.data);
  86. this.$set(this, `totalfaqi`, res.total);
  87. }
  88. }
  89. },
  90. async jiaoyi1({ skip = 0, limit = 3, ...info } = {}) {
  91. let status = 1;
  92. let market_userid = this.user.uid;
  93. skip = this.skip;
  94. if (this.user.role == '2' || this.user.role == '3') {
  95. const res = await this.transactionList({ skip, limit, market_userid, status, ...info });
  96. if (this.$checkRes(res)) {
  97. this.$set(this, `dinggou1`, res.data);
  98. this.$set(this, `total1`, res.total);
  99. }
  100. } else if (this.role == '6') {
  101. const res = await this.expertsauditList({ skip, limit, market_userid, status, ...info });
  102. if (this.$checkRes(res)) {
  103. this.$set(this, `faqilist`, res.data);
  104. this.$set(this, `totalfaqi`, res.total);
  105. }
  106. }
  107. },
  108. async jiaoyi2({ skip = 0, limit = 3, ...info } = {}) {
  109. let status = 2;
  110. let market_userid = this.user.uid;
  111. skip = this.skip;
  112. if (this.user.role == '2' || this.user.role == '3') {
  113. const res = await this.transactionList({ skip, limit, market_userid, status, ...info });
  114. if (this.$checkRes(res)) {
  115. this.$set(this, `dinggou2`, res.data);
  116. this.$set(this, `total2`, res.total);
  117. }
  118. } else if (this.role == '6') {
  119. const res = await this.expertsauditList({ skip, limit, market_userid, status, ...info });
  120. if (this.$checkRes(res)) {
  121. this.$set(this, `faqilist`, res.data);
  122. this.$set(this, `totalfaqi`, res.total);
  123. }
  124. }
  125. },
  126. async jiaoyi3({ skip = 0, limit = 3, ...info } = {}) {
  127. skip = this.skip;
  128. if (this.user.role == '2' || this.user.role == '3') {
  129. const res = await this.transactionList({ skip, limit, ...info });
  130. if (this.$checkRes(res)) {
  131. this.$set(this, `dinggou3`, res.data);
  132. this.$set(this, `total3`, res.total);
  133. }
  134. } else if (this.role == '6') {
  135. const res = await this.expertsauditList({ skip, limit, market_userid, status, ...info });
  136. if (this.$checkRes(res)) {
  137. this.$set(this, `faqilist`, res.data);
  138. this.$set(this, `totalfaqi`, res.total);
  139. }
  140. }
  141. },
  142. //审核
  143. async jiaoyisuccess({ item }) {
  144. item.status = '1';
  145. let res = await this.shenheupdate(item);
  146. this.jiaoyi1();
  147. this.$checkRes(res, '同意成功', '审核失败');
  148. },
  149. async shibai({ item }) {
  150. item.status = '3';
  151. let res = await this.shenheupdate(item);
  152. this.$checkRes(res, '审核成功', '审核失败');
  153. this.jiaoyi3();
  154. },
  155. async success({ item }) {
  156. item.status = '2';
  157. let res = await this.shenheupdate(item);
  158. this.$checkRes(res, '审核成功', '审核失败');
  159. this.jiaoyi2();
  160. },
  161. //分页
  162. async handleCurrentChangefaqi({ skip, limit, currentPage }) {
  163. this.$set(this, `skip`, skip);
  164. this.faqijiaoyi();
  165. },
  166. async change1({ skip, limit, currentPage }) {
  167. this.$set(this, `skip`, skip);
  168. this.jiaoyi1();
  169. },
  170. async change2({ skip, limit, currentPage }) {
  171. this.$set(this, `skip`, skip);
  172. this.jiaoyi2();
  173. },
  174. async change3({ skip, limit, currentPage }) {
  175. this.$set(this, `skip`, skip);
  176. this.jiaoyi3();
  177. },
  178. async deleteData({ item }) {
  179. const res = await this.transactiondtetle(item.id);
  180. this.$checkRes(res, '删除成功', '删除失败');
  181. },
  182. async onsaveClick({ id }) {
  183. console.log(id);
  184. if (id === '基本信息') {
  185. this.$router.push({ path: '/enterprise/enterprisejb' });
  186. } else if (id === '消息管理') {
  187. this.$router.push({ path: '/enterprise/enterprisexx' });
  188. } else if (id === '我的发布') {
  189. this.$router.push({ path: '/enterprise/enterprisefabu' });
  190. } else if (id === '事项管理') {
  191. this.$router.push({ path: '/enterprise/enterprisedg' });
  192. } else if (id === '修改密码') {
  193. this.$router.push({ path: '/enterprise/xiugai' });
  194. } else if (id === '返回首页') {
  195. this.$router.push({ path: '/' });
  196. } else if (id === '注销账号') {
  197. this.logout();
  198. this.$message({
  199. message: '注销成功',
  200. type: 'success',
  201. });
  202. this.toLogin();
  203. } else if (id === '展会管理') {
  204. this.$router.push({ path: '/enterprise/appointment' });
  205. }
  206. },
  207. async toLogin() {
  208. this.$router.push({ path: '/platlive' });
  209. },
  210. },
  211. };
  212. </script>
  213. <style lang="less" scoped></style>