enterprisefabu.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <div id="adviserList">
  3. <enterprisefabu-detail
  4. :liebiaoList="liebiaoList"
  5. :recruitData="recruitData"
  6. @delete="deleteData"
  7. @onsave="onsaveClick"
  8. :successlist="successlist"
  9. :shenheList="shenheList"
  10. :Transactionlist="Transactionlist"
  11. :total="total"
  12. :total4="total4"
  13. :total5="total5"
  14. :total6="total6"
  15. :tatalstatus1="tatalstatus1"
  16. :tatalstatus2="tatalstatus2"
  17. @handleCurrentChange="handleCurrentChange"
  18. @handleCurrentChange1="handleCurrentChange1"
  19. @handleCurrentChange2="handleCurrentChange2"
  20. :jiaoyilist="jiaoyilist"
  21. :jiaoyilist1="jiaoyilist1"
  22. @deteles="deteles"
  23. @handleDelete="handleDelete"
  24. @shibai="shibai"
  25. @success="success"
  26. @jiaoyisuccess="jiaoyisuccess"
  27. :faqilist="faqilist"
  28. :totalfaqi="totalfaqi"
  29. @handleCurrentChangefaqi="handleCurrentChangefaqi"
  30. @handleCurrentChange4="handleCurrentChange4"
  31. @handleCurrentChange5="handleCurrentChange5"
  32. @handleCurrentChange6="handleCurrentChange6"
  33. ></enterprisefabu-detail>
  34. </div>
  35. </template>
  36. <script>
  37. import enterprisefabuDetail from '@/components/enterprise/enterprisefabu.vue';
  38. import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
  39. const { mapActions: mapSite } = createNamespacedHelpers('site');
  40. const { mapActions: mapRecruit } = createNamespacedHelpers('market');
  41. const { mapActions: marketproduct } = createNamespacedHelpers('marketproduct');
  42. const { mapActions: transaction } = createNamespacedHelpers('transaction');
  43. export default {
  44. name: 'adviserList',
  45. props: {},
  46. components: {
  47. enterprisefabuDetail,
  48. },
  49. data: () => ({
  50. shenheList: [],
  51. successlist: [],
  52. info: {},
  53. liebiaoList: [{ name: '基本信息' }, { name: '消息管理' }, { name: '我的发布' }, { name: '我的订购' }, { name: '注销账号' }],
  54. recruitData: [],
  55. gonggeiData: [],
  56. Transactionlist: [],
  57. jiaoyilist: [],
  58. jiaoyilist1: [],
  59. total: 1,
  60. total4: 1,
  61. total5: 1,
  62. total6: 1,
  63. tatalstatus1: 1,
  64. tatalstatus2: 1,
  65. skip: '',
  66. faqilist: [],
  67. totalfaqi: 1,
  68. }),
  69. created() {
  70. this.searchInfo();
  71. this.searchstatus1();
  72. this.searchstaus2();
  73. this.jiaoyi1();
  74. this.jiaoyi2();
  75. this.jiaoyi3();
  76. this.faqijiaoyi();
  77. },
  78. computed: {
  79. ...mapState(['user']),
  80. },
  81. methods: {
  82. ...mapRecruit({ columnList: 'query', columnInfo: 'fetch' }),
  83. ...marketproduct({ productList: 'query', columnInfo: 'fetch', marketcerate: 'create', productdeltet: 'delete' }),
  84. ...transaction({ list: 'query', columnInfo: 'fetch', marketcerate: 'create', delete: 'delete', shenheupdate: 'update' }),
  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 faqijiaoyi({ skip = 0, limit = 3, ...info } = {}) {
  119. let status = 0;
  120. skip = this.skip;
  121. const res = await this.list({ skip, limit, status, ...info });
  122. console.log(res.total);
  123. if (this.$checkRes(res)) {
  124. this.$set(this, `faqilist`, res.data);
  125. this.$set(this, `totalfaqi`, res.total);
  126. }
  127. },
  128. async jiaoyi1({ skip = 0, limit = 3, ...info } = {}) {
  129. let status = 1;
  130. skip = this.skip;
  131. console.log();
  132. const res = await this.list({ skip, limit, status, ...info });
  133. console.log(res);
  134. if (this.$checkRes(res)) {
  135. this.$set(this, `Transactionlist`, res.data);
  136. this.$set(this, `total4`, res.total);
  137. }
  138. },
  139. async jiaoyi2({ skip = 0, limit = 3, ...info } = {}) {
  140. let status = 2;
  141. skip = this.skip;
  142. console.log();
  143. const res = await this.list({ skip, limit, status, ...info });
  144. console.log(res);
  145. if (this.$checkRes(res)) {
  146. this.$set(this, `jiaoyilist1`, res.data);
  147. this.$set(this, `total5`, res.total);
  148. }
  149. },
  150. async jiaoyi3({ skip = 0, limit = 3, ...info } = {}) {
  151. let status = 3;
  152. skip = this.skip;
  153. console.log();
  154. const res = await this.list({ skip, limit, status, ...info });
  155. if (this.$checkRes(res)) {
  156. this.$set(this, `jiaoyilist`, res.data);
  157. this.$set(this, `total6`, res.total);
  158. }
  159. },
  160. //分页
  161. async handleCurrentChangefaqi({ skip, limit, currentPage }) {
  162. this.$set(this, `skip`, skip);
  163. this.faqijiaoyi();
  164. },
  165. async handleCurrentChange({ skip, limit, currentPage }) {
  166. this.$set(this, `skip`, skip);
  167. this.searchInfo();
  168. },
  169. async handleCurrentChange1({ skip, limit, currentPage }) {
  170. this.$set(this, `skip`, skip);
  171. console.log(skip);
  172. this.searchstatus1();
  173. },
  174. async handleCurrentChange2({ skip, limit, currentPage }) {
  175. this.$set(this, `skip`, skip);
  176. this.searchstaus2();
  177. },
  178. async handleCurrentChange4({ skip, limit, currentPage }) {
  179. this.$set(this, `skip`, skip);
  180. this.jiaoyi1();
  181. },
  182. async handleCurrentChange5({ skip, limit, currentPage }) {
  183. this.$set(this, `skip`, skip);
  184. this.jiaoyi2();
  185. },
  186. async handleCurrentChange6({ skip, limit, currentPage }) {
  187. this.$set(this, `skip`, skip);
  188. this.jiaoyi3();
  189. },
  190. // 删除信息
  191. async deleteData({ item }) {
  192. const res = await this.productdeltet(item.id);
  193. this.$checkRes(res, '删除成功', '删除失败');
  194. },
  195. async deteles({ item }) {
  196. const res = await this.delete(item.id);
  197. this.$checkRes(res, '删除成功', '删除失败');
  198. },
  199. async handleDelete({ item }) {
  200. const res = await this.productdeltet(item.id);
  201. this.$checkRes(res, '删除成功', '删除失败');
  202. },
  203. //审核
  204. async jiaoyisuccess({ item }) {
  205. item.status = '1';
  206. let res = await this.shenheupdate(item);
  207. this.faqijiaoyi();
  208. this.$checkRes(res, '同意成功', '审核失败');
  209. },
  210. async shibai({ item }) {
  211. item.status = '3';
  212. let res = await this.shenheupdate(item);
  213. this.$checkRes(res, '审核成功', '审核失败');
  214. this.jiaoyi3();
  215. },
  216. async success({ item }) {
  217. item.status = '2';
  218. let res = await this.shenheupdate(item);
  219. this.$checkRes(res, '审核成功', '审核失败');
  220. this.jiaoyi2();
  221. },
  222. async onsaveClick({ id }) {
  223. if (id === '基本信息') {
  224. this.$router.push({ path: '/enterprise/enterprisejb' });
  225. } else if (id === '消息管理') {
  226. this.$router.push({ path: '/enterprise/enterprisexx' });
  227. } else if (id === '我的发布') {
  228. this.$router.push({ path: '/enterprise/enterprisefabu' });
  229. } else if (id === '我的订购') {
  230. this.$router.push({ path: '/enterprise/enterprisedg' });
  231. }
  232. },
  233. },
  234. };
  235. </script>
  236. <style lang="less" scoped></style>