enterprisefabu.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <div id="adviserList">
  3. <enterprisefabu-detail
  4. :info="info"
  5. :liebiaoList="liebiaoList"
  6. :recruitData="recruitData"
  7. @delete="deleteData"
  8. @onsave="onsaveClick"
  9. :successlist="successlist"
  10. :shenheList="shenheList"
  11. :Transactionlist="Transactionlist"
  12. :total="total"
  13. :total4="total4"
  14. :total5="total5"
  15. :total6="total6"
  16. :tatalstatus1="tatalstatus1"
  17. :tatalstatus2="tatalstatus2"
  18. @handleCurrentChange="handleCurrentChange"
  19. @handleCurrentChange1="handleCurrentChange1"
  20. @handleCurrentChange2="handleCurrentChange2"
  21. :jiaoyilist="jiaoyilist"
  22. :jiaoyilist1="jiaoyilist1"
  23. @deteles="deletestate"
  24. ></enterprisefabu-detail>
  25. </div>
  26. </template>
  27. <script>
  28. import enterprisefabuDetail from '@/components/enterprise/enterprisefabu.vue';
  29. import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
  30. const { mapActions: mapSite } = createNamespacedHelpers('site');
  31. const { mapActions: mapRecruit } = createNamespacedHelpers('market');
  32. const { mapActions: marketproduct } = createNamespacedHelpers('marketproduct');
  33. const { mapActions: transaction } = createNamespacedHelpers('transaction');
  34. export default {
  35. name: 'adviserList',
  36. props: {},
  37. components: {
  38. enterprisefabuDetail,
  39. },
  40. data: () => ({
  41. shenheList: [],
  42. successlist: [],
  43. info: {},
  44. liebiaoList: [{ name: '基本信息' }, { name: '消息管理' }, { name: '我的发布' }, { name: '我的订购' }, { name: '注销账号' }],
  45. recruitData: [],
  46. gonggeiData: [],
  47. Transactionlist: [],
  48. jiaoyilist: [],
  49. jiaoyilist1: [],
  50. total: 1,
  51. total4: 1,
  52. total5: 1,
  53. total6: 1,
  54. tatalstatus1: 1,
  55. tatalstatus2: 1,
  56. skip: '',
  57. }),
  58. created() {
  59. this.searchSite();
  60. this.searchInfo();
  61. this.searchstatus1();
  62. this.searchstaus2();
  63. this.jiaoyi1();
  64. this.jiaoyi2();
  65. this.jiaoyi3();
  66. },
  67. computed: {
  68. ...mapState(['user']),
  69. },
  70. methods: {
  71. ...mapSite(['showInfo']),
  72. ...mapRecruit({ columnList: 'query', columnInfo: 'fetch' }),
  73. ...marketproduct({ productList: 'query', columnInfo: 'fetch', marketcerate: 'create', productdeltet: 'delete' }),
  74. ...transaction({ list: 'query', columnInfo: 'fetch', marketcerate: 'create', delete: 'delete' }),
  75. // 查询站点信息
  76. async searchSite() {
  77. let res = await this.showInfo();
  78. let object = JSON.parse(JSON.stringify(res.data));
  79. if (object) {
  80. this.$set(this, `info`, res.data);
  81. } else {
  82. this.$message.error(res.errmsg ? res.errmsg : 'error');
  83. }
  84. },
  85. // 查询列表
  86. async searchInfo({ skip = 0, limit = 3, ...info } = {}) {
  87. skip = this.skip;
  88. let status = 1;
  89. let userid = this.user.uid;
  90. const res = await this.productList({ skip, limit, status, userid, ...info });
  91. if (this.$checkRes(res)) {
  92. this.$set(this, `recruitData`, res.data);
  93. this.$set(this, `total`, res.total);
  94. }
  95. },
  96. async searchstatus1({ skip, limit = 3, ...info } = {}) {
  97. let status = 0;
  98. skip = this.skip;
  99. let userid = this.user.uid;
  100. const res = await this.productList({ skip, limit, status, userid, ...info });
  101. if (this.$checkRes(res)) {
  102. this.$set(this, `shenheList`, res.data);
  103. this.$set(this, `tatalstatus1`, res.total);
  104. }
  105. },
  106. async searchstaus2({ skip = 0, limit = 3, ...info } = {}) {
  107. let status = 2;
  108. skip = this.skip;
  109. let userid = this.user.uid;
  110. console.log();
  111. const res = await this.productList({ skip, limit, status, userid, ...info });
  112. console.log(res);
  113. if (this.$checkRes(res)) {
  114. this.$set(this, `successlist`, res.data);
  115. this.$set(this, `tatalstatus2`, res.total);
  116. }
  117. },
  118. async jiaoyi1({ skip = 0, limit = 3, ...info } = {}) {
  119. let status = 1;
  120. skip = this.skip;
  121. console.log();
  122. const res = await this.list({ skip, limit, status, ...info });
  123. console.log(res);
  124. if (this.$checkRes(res)) {
  125. this.$set(this, `Transactionlist`, res.data);
  126. this.$set(this, `total4`, res.total);
  127. }
  128. },
  129. async jiaoyi2({ skip = 0, limit = 3, ...info } = {}) {
  130. let status = 2;
  131. skip = this.skip;
  132. console.log();
  133. const res = await this.list({ skip, limit, status, ...info });
  134. console.log(res);
  135. if (this.$checkRes(res)) {
  136. this.$set(this, `jiaoyilist`, res.data);
  137. this.$set(this, `total5`, res.total);
  138. }
  139. },
  140. async jiaoyi3({ skip = 0, limit = 3, ...info } = {}) {
  141. let status = 3;
  142. skip = this.skip;
  143. console.log();
  144. const res = await this.list({ skip, limit, status, ...info });
  145. console.log(res);
  146. if (this.$checkRes(res)) {
  147. this.$set(this, `jiaoyilist1`, res.data);
  148. console.log(res);
  149. this.$set(this, `total6`, res.total);
  150. }
  151. },
  152. //分页
  153. async handleCurrentChange({ skip, limit, currentPage }) {
  154. this.$set(this, `skip`, skip);
  155. this.searchInfo();
  156. },
  157. async handleCurrentChange1({ skip, limit, currentPage }) {
  158. this.$set(this, `skip`, skip);
  159. console.log(skip);
  160. this.searchstatus1();
  161. },
  162. async handleCurrentChange2({ skip, limit, currentPage }) {
  163. this.$set(this, `skip`, skip);
  164. this.searchstaus2();
  165. },
  166. async handleCurrentChange4({ skip, limit, currentPage }) {
  167. this.$set(this, `skip`, skip);
  168. this.jiaoyi1();
  169. },
  170. async handleCurrentChange5({ skip, limit, currentPage }) {
  171. this.$set(this, `skip`, skip);
  172. this.jiaoyi2();
  173. },
  174. async handleCurrentChange6({ skip, limit, currentPage }) {
  175. this.$set(this, `skip`, skip);
  176. this.jiaoyi3();
  177. },
  178. // 删除信息
  179. async deleteData({ item }) {
  180. const res = await this.productdeltet(item.id);
  181. this.$checkRes(res, '删除成功', '删除失败');
  182. },
  183. async deletestate({ item }) {
  184. const res = await this.delete(item.id);
  185. this.$checkRes(res, '删除成功', '删除失败');
  186. },
  187. async onsaveClick({ id }) {
  188. if (id === '基本信息') {
  189. this.$router.push({ path: '/enterprise/enterprisejb' });
  190. } else if (id === '消息管理') {
  191. this.$router.push({ path: '/enterprise/enterprisexx' });
  192. } else if (id === '我的发布') {
  193. this.$router.push({ path: '/enterprise/enterprisefabu' });
  194. } else if (id === '我的订购') {
  195. this.$router.push({ path: '/enterprise/enterprisedg' });
  196. }
  197. },
  198. },
  199. };
  200. </script>
  201. <style lang="less" scoped></style>