enterprisefabu.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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. :tatalcaogao="tatalcaogao"
  34. :caogao="caogao"
  35. @handleCurrentcaogao="handleCurrentcaogao"
  36. @submitcaogao="submitcaogao"
  37. ></enterprisefabu-detail>
  38. </div>
  39. </template>
  40. <script>
  41. import enterprisefabuDetail from '@/components/enterprise/enterprisefabu.vue';
  42. import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
  43. const { mapActions: mapSite } = createNamespacedHelpers('site');
  44. const { mapActions: mapRecruit } = createNamespacedHelpers('market');
  45. const { mapActions: marketproduct } = createNamespacedHelpers('marketproduct');
  46. const { mapActions: transaction } = createNamespacedHelpers('transaction');
  47. const { mapActions: login } = createNamespacedHelpers('login');
  48. export default {
  49. name: 'adviserList',
  50. props: {},
  51. components: {
  52. enterprisefabuDetail,
  53. },
  54. data: () => ({
  55. shenheList: [],
  56. successlist: [],
  57. info: {},
  58. liebiaoList: [
  59. { name: '基本信息' },
  60. { name: '消息管理' },
  61. { name: '我的发布' },
  62. { name: '事项管理' },
  63. { name: '展会管理' },
  64. // { name: '返回首页' },
  65. { name: '修改密码' },
  66. { name: '注销账号' },
  67. ],
  68. recruitData: [],
  69. gonggeiData: [],
  70. Transactionlist: [],
  71. jiaoyilist: [],
  72. jiaoyilist1: [],
  73. total: 1,
  74. total4: 1,
  75. total5: 1,
  76. total6: 1,
  77. tatalstatus1: 1,
  78. tatalstatus2: 1,
  79. skip: '',
  80. faqilist: [],
  81. totalfaqi: 1,
  82. tatalcaogao: 1,
  83. caogao: [],
  84. }),
  85. created() {
  86. this.searchInfo();
  87. this.searchstatus1();
  88. this.searchstaus2();
  89. this.caogaolist();
  90. },
  91. computed: {
  92. ...mapState(['user']),
  93. },
  94. methods: {
  95. ...mapRecruit({ columnList: 'query', columnInfo: 'fetch' }),
  96. ...marketproduct({ productList: 'query', columnInfo: 'fetch', marketcerate: 'create', productdeltet: 'delete', upup: 'update' }),
  97. ...transaction({ list: 'query', columnInfo: 'fetch', marketcerate: 'create', delete: 'delete', shenheupdate: 'update' }),
  98. ...login({ logout: 'logout', transactiondtetle: 'delete' }),
  99. // 查询列表
  100. async searchInfo({ skip = 0, limit = 3, ...info } = {}) {
  101. skip = this.skip;
  102. let status = 1;
  103. let userid = this.user.uid;
  104. const res = await this.productList({ skip, limit, status, userid, ...info });
  105. if (this.$checkRes(res)) {
  106. this.$set(this, `recruitData`, res.data);
  107. this.$set(this, `total`, res.total);
  108. }
  109. },
  110. async searchstatus1({ skip, limit = 3, ...info } = {}) {
  111. let status = 0;
  112. skip = this.skip;
  113. let userid = this.user.uid;
  114. const res = await this.productList({ skip, limit, status, userid, ...info });
  115. if (this.$checkRes(res)) {
  116. this.$set(this, `shenheList`, res.data);
  117. this.$set(this, `tatalstatus1`, res.total);
  118. }
  119. },
  120. async searchstaus2({ skip = 0, limit = 3, ...info } = {}) {
  121. let status = 2;
  122. skip = this.skip;
  123. let userid = this.user.uid;
  124. console.log();
  125. const res = await this.productList({ skip, limit, status, userid, ...info });
  126. console.log(res);
  127. if (this.$checkRes(res)) {
  128. this.$set(this, `successlist`, res.data);
  129. this.$set(this, `tatalstatus2`, res.total);
  130. }
  131. },
  132. async caogaolist({ skip = 0, limit = 3, ...info } = {}) {
  133. let status = '3';
  134. skip = this.skip;
  135. const res = await this.productList({ skip, limit, status, ...info });
  136. console.log(res.total);
  137. if (this.$checkRes(res)) {
  138. this.$set(this, `caogao`, res.data);
  139. this.$set(this, `tatalcaogao`, res.total);
  140. }
  141. },
  142. //分页
  143. async handleCurrentChangefaqi({ skip, limit, currentPage }) {
  144. this.$set(this, `skip`, skip);
  145. this.faqijiaoyi();
  146. },
  147. async handleCurrentChange({ skip, limit, currentPage }) {
  148. this.$set(this, `skip`, skip);
  149. this.searchInfo();
  150. },
  151. async handleCurrentChange1({ skip, limit, currentPage }) {
  152. this.$set(this, `skip`, skip);
  153. console.log(skip);
  154. this.searchstatus1();
  155. },
  156. async handleCurrentcaogao({ skip, limit, currentPage }) {
  157. this.$set(this, `skip`, skip);
  158. console.log(skip);
  159. this.caogaolist();
  160. },
  161. async handleCurrentChange2({ skip, limit, currentPage }) {
  162. this.$set(this, `skip`, skip);
  163. this.searchstaus2();
  164. },
  165. async handleCurrentChange4({ skip, limit, currentPage }) {
  166. this.$set(this, `skip`, skip);
  167. this.jiaoyi1();
  168. },
  169. async handleCurrentChange5({ skip, limit, currentPage }) {
  170. this.$set(this, `skip`, skip);
  171. this.jiaoyi2();
  172. },
  173. async handleCurrentChange6({ skip, limit, currentPage }) {
  174. this.$set(this, `skip`, skip);
  175. this.jiaoyi3();
  176. },
  177. // 删除信息
  178. async deleteData({ item }) {
  179. const res = await this.productdeltet(item.id);
  180. this.$checkRes(res, '删除成功', '删除失败');
  181. },
  182. async deteles({ item }) {
  183. const res = await this.delete(item.id);
  184. this.$checkRes(res, '删除成功', '删除失败');
  185. },
  186. async handleDelete({ item }) {
  187. const res = await this.productdeltet(item.id);
  188. this.$checkRes(res, '删除成功', '删除失败');
  189. },
  190. //审核
  191. async submitcaogao({ item }) {
  192. item.status = '0';
  193. let res = await this.upup(item);
  194. this.$checkRes(res, '发布成功', '审核失败');
  195. this.searchInfo();
  196. this.caogaolist();
  197. },
  198. async jiaoyisuccess({ item }) {},
  199. async shibai({ item }) {},
  200. async success({ item }) {},
  201. async onsaveClick({ id }) {
  202. console.log(id);
  203. if (id === '基本信息') {
  204. this.$router.push({ path: '/enterprise/enterprisejb' });
  205. } else if (id === '消息管理') {
  206. this.$router.push({ path: '/enterprise/enterprisexx' });
  207. } else if (id === '我的发布') {
  208. this.$router.push({ path: '/enterprise/enterprisefabu' });
  209. } else if (id === '事项管理') {
  210. this.$router.push({ path: '/enterprise/enterprisedg' });
  211. } else if (id === '展会管理') {
  212. this.$router.push({ path: '/enterprise/appointment' });
  213. } else if (id === '修改密码') {
  214. this.$router.push({ path: '/enterprise/xiugai' });
  215. } else if (id === '返回首页') {
  216. this.$router.push({ path: '/' });
  217. } else if (id === '注销账号') {
  218. this.logout();
  219. this.$message({
  220. message: '注销成功',
  221. type: 'success',
  222. });
  223. this.toLogin();
  224. }
  225. },
  226. async toLogin() {
  227. this.$router.push({ path: '/platlive' });
  228. },
  229. },
  230. };
  231. </script>
  232. <style lang="less" scoped></style>