123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- <template>
- <div id="adviserList">
- <enterprisefabu-detail
- :info="info"
- :liebiaoList="liebiaoList"
- :recruitData="recruitData"
- @delete="deleteData"
- @onsave="onsaveClick"
- :successlist="successlist"
- :shenheList="shenheList"
- :Transactionlist="Transactionlist"
- :total="total"
- :total4="total4"
- :total5="total5"
- :total6="total6"
- :tatalstatus1="tatalstatus1"
- :tatalstatus2="tatalstatus2"
- @handleCurrentChange="handleCurrentChange"
- @handleCurrentChange1="handleCurrentChange1"
- @handleCurrentChange2="handleCurrentChange2"
- :jiaoyilist="jiaoyilist"
- :jiaoyilist1="jiaoyilist1"
- @deteles="deletestate"
- ></enterprisefabu-detail>
- </div>
- </template>
- <script>
- import enterprisefabuDetail from '@/components/enterprise/enterprisefabu.vue';
- import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
- const { mapActions: mapSite } = createNamespacedHelpers('site');
- const { mapActions: mapRecruit } = createNamespacedHelpers('market');
- const { mapActions: marketproduct } = createNamespacedHelpers('marketproduct');
- const { mapActions: transaction } = createNamespacedHelpers('transaction');
- export default {
- name: 'adviserList',
- props: {},
- components: {
- enterprisefabuDetail,
- },
- data: () => ({
- shenheList: [],
- successlist: [],
- info: {},
- liebiaoList: [{ name: '基本信息' }, { name: '消息管理' }, { name: '我的发布' }, { name: '我的订购' }, { name: '注销账号' }],
- recruitData: [],
- gonggeiData: [],
- Transactionlist: [],
- jiaoyilist: [],
- jiaoyilist1: [],
- total: 1,
- total4: 1,
- total5: 1,
- total6: 1,
- tatalstatus1: 1,
- tatalstatus2: 1,
- skip: '',
- }),
- created() {
- this.searchSite();
- this.searchInfo();
- this.searchstatus1();
- this.searchstaus2();
- this.jiaoyi1();
- this.jiaoyi2();
- this.jiaoyi3();
- },
- computed: {
- ...mapState(['user']),
- },
- methods: {
- ...mapSite(['showInfo']),
- ...mapRecruit({ columnList: 'query', columnInfo: 'fetch' }),
- ...marketproduct({ productList: 'query', columnInfo: 'fetch', marketcerate: 'create', productdeltet: 'delete' }),
- ...transaction({ list: 'query', columnInfo: 'fetch', marketcerate: 'create', delete: 'delete' }),
- // 查询站点信息
- async searchSite() {
- let res = await this.showInfo();
- let object = JSON.parse(JSON.stringify(res.data));
- if (object) {
- this.$set(this, `info`, res.data);
- } else {
- this.$message.error(res.errmsg ? res.errmsg : 'error');
- }
- },
- // 查询列表
- async searchInfo({ skip = 0, limit = 3, ...info } = {}) {
- skip = this.skip;
- let status = 1;
- let userid = this.user.uid;
- const res = await this.productList({ skip, limit, status, userid, ...info });
- if (this.$checkRes(res)) {
- this.$set(this, `recruitData`, res.data);
- this.$set(this, `total`, res.total);
- }
- },
- async searchstatus1({ skip, limit = 3, ...info } = {}) {
- let status = 0;
- skip = this.skip;
- let userid = this.user.uid;
- const res = await this.productList({ skip, limit, status, userid, ...info });
- if (this.$checkRes(res)) {
- this.$set(this, `shenheList`, res.data);
- this.$set(this, `tatalstatus1`, res.total);
- }
- },
- async searchstaus2({ skip = 0, limit = 3, ...info } = {}) {
- let status = 2;
- skip = this.skip;
- let userid = this.user.uid;
- console.log();
- const res = await this.productList({ skip, limit, status, userid, ...info });
- console.log(res);
- if (this.$checkRes(res)) {
- this.$set(this, `successlist`, res.data);
- this.$set(this, `tatalstatus2`, res.total);
- }
- },
- async jiaoyi1({ skip = 0, limit = 3, ...info } = {}) {
- let status = 1;
- skip = this.skip;
- console.log();
- const res = await this.list({ skip, limit, status, ...info });
- console.log(res);
- if (this.$checkRes(res)) {
- this.$set(this, `Transactionlist`, res.data);
- this.$set(this, `total4`, res.total);
- }
- },
- async jiaoyi2({ skip = 0, limit = 3, ...info } = {}) {
- let status = 2;
- skip = this.skip;
- console.log();
- const res = await this.list({ skip, limit, status, ...info });
- console.log(res);
- if (this.$checkRes(res)) {
- this.$set(this, `jiaoyilist`, res.data);
- this.$set(this, `total5`, res.total);
- }
- },
- async jiaoyi3({ skip = 0, limit = 3, ...info } = {}) {
- let status = 3;
- skip = this.skip;
- console.log();
- const res = await this.list({ skip, limit, status, ...info });
- console.log(res);
- if (this.$checkRes(res)) {
- this.$set(this, `jiaoyilist1`, res.data);
- console.log(res);
- this.$set(this, `total6`, res.total);
- }
- },
- //分页
- async handleCurrentChange({ skip, limit, currentPage }) {
- this.$set(this, `skip`, skip);
- this.searchInfo();
- },
- async handleCurrentChange1({ skip, limit, currentPage }) {
- this.$set(this, `skip`, skip);
- console.log(skip);
- this.searchstatus1();
- },
- async handleCurrentChange2({ skip, limit, currentPage }) {
- this.$set(this, `skip`, skip);
- this.searchstaus2();
- },
- async handleCurrentChange4({ skip, limit, currentPage }) {
- this.$set(this, `skip`, skip);
- this.jiaoyi1();
- },
- async handleCurrentChange5({ skip, limit, currentPage }) {
- this.$set(this, `skip`, skip);
- this.jiaoyi2();
- },
- async handleCurrentChange6({ skip, limit, currentPage }) {
- this.$set(this, `skip`, skip);
- this.jiaoyi3();
- },
- // 删除信息
- async deleteData({ item }) {
- const res = await this.productdeltet(item.id);
- this.$checkRes(res, '删除成功', '删除失败');
- },
- async deletestate({ item }) {
- const res = await this.delete(item.id);
- this.$checkRes(res, '删除成功', '删除失败');
- },
- async onsaveClick({ id }) {
- if (id === '基本信息') {
- this.$router.push({ path: '/enterprise/enterprisejb' });
- } else if (id === '消息管理') {
- this.$router.push({ path: '/enterprise/enterprisexx' });
- } else if (id === '我的发布') {
- this.$router.push({ path: '/enterprise/enterprisefabu' });
- } else if (id === '我的订购') {
- this.$router.push({ path: '/enterprise/enterprisedg' });
- }
- },
- },
- };
- </script>
- <style lang="less" scoped></style>
|