123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- <template>
- <div id="adviserList">
- <enterprisedg-detail
- :liebiaoList="liebiaoList"
- :dinggou1="dinggou1"
- :dinggou2="dinggou2"
- :dinggou3="dinggou3"
- @onsave="onsaveClick"
- :total1="total1"
- :total2="total2"
- :total3="total3"
- @handleCurrentChange="change1"
- @handleCurrentChange1="change2"
- @handleCurrentChange2="change3"
- @deletes="deleteData"
- :faqilist="faqilist"
- :totalfaqi="totalfaqi"
- @handleCurrentChangefaqi="handleCurrentChangefaqi"
- @jiaoyisuccess="jiaoyisuccess"
- @shibai="shibai"
- @success="success"
- ></enterprisedg-detail>
- </div>
- </template>
- <script>
- import enterprisedgDetail from '@/components/enterprise/enterpisedg.vue';
- import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
- const { mapActions: transaction } = createNamespacedHelpers('transaction');
- const { mapActions: expertsaudit } = createNamespacedHelpers('expertsaudit');
- const { mapActions: login } = createNamespacedHelpers('login');
- export default {
- name: 'adviserList',
- props: {},
- components: {
- enterprisedgDetail,
- },
- data: () => ({
- liebiaoList: [
- { name: '基本信息' },
- { name: '消息管理' },
- { name: '我的发布' },
- { name: '事项管理' },
- { name: '展会管理' },
- // { name: '返回首页' },
- { name: '修改密码' },
- { name: '注销账号' },
- ],
- total1: 0,
- total2: 0,
- total3: 0,
- totalfaqi: 0,
- faqilist: [],
- dinggou1: [],
- dinggou2: [],
- dinggou3: [],
- skip: '',
- }),
- created() {
- this.jiaoyi1();
- this.jiaoyi2();
- this.jiaoyi3();
- this.faqijiaoyi();
- },
- computed: {
- ...mapState(['user']),
- },
- methods: {
- ...transaction({ transactionList: 'query', transactiondtetle: 'delete', shenheupdate: 'update' }),
- ...expertsaudit({ expertsauditList: 'query', expertsauditdtetle: 'delete', expertsauditupdate: 'update' }),
- ...login({ logout: 'logout', transactiondtetlse: 'delete' }),
- // 查询
- async faqijiaoyi({ skip = 0, limit = 3, ...info } = {}) {
- let status = 0;
- let market_userid = this.user.uid;
- skip = this.skip;
- if (this.user.role == '2' || this.user.role == '3') {
- const res = await this.transactionList({ skip, limit, market_userid, status, ...info });
- if (this.$checkRes(res)) {
- this.$set(this, `faqilist`, res.data);
- this.$set(this, `totalfaqi`, res.total);
- }
- } else if (this.role == '6') {
- const res = await this.expertsauditList({ skip, limit, market_userid, status, ...info });
- if (this.$checkRes(res)) {
- this.$set(this, `faqilist`, res.data);
- this.$set(this, `totalfaqi`, res.total);
- }
- }
- },
- async jiaoyi1({ skip = 0, limit = 3, ...info } = {}) {
- let status = 1;
- let market_userid = this.user.uid;
- skip = this.skip;
- if (this.user.role == '2' || this.user.role == '3') {
- const res = await this.transactionList({ skip, limit, market_userid, status, ...info });
- if (this.$checkRes(res)) {
- this.$set(this, `dinggou1`, res.data);
- this.$set(this, `total1`, res.total);
- }
- } else if (this.role == '6') {
- const res = await this.expertsauditList({ skip, limit, market_userid, status, ...info });
- if (this.$checkRes(res)) {
- this.$set(this, `faqilist`, res.data);
- this.$set(this, `totalfaqi`, res.total);
- }
- }
- },
- async jiaoyi2({ skip = 0, limit = 3, ...info } = {}) {
- let status = 2;
- let market_userid = this.user.uid;
- skip = this.skip;
- if (this.user.role == '2' || this.user.role == '3') {
- const res = await this.transactionList({ skip, limit, market_userid, status, ...info });
- if (this.$checkRes(res)) {
- this.$set(this, `dinggou2`, res.data);
- this.$set(this, `total2`, res.total);
- }
- } else if (this.role == '6') {
- const res = await this.expertsauditList({ skip, limit, market_userid, status, ...info });
- if (this.$checkRes(res)) {
- this.$set(this, `faqilist`, res.data);
- this.$set(this, `totalfaqi`, res.total);
- }
- }
- },
- async jiaoyi3({ skip = 0, limit = 3, ...info } = {}) {
- skip = this.skip;
- if (this.user.role == '2' || this.user.role == '3') {
- const res = await this.transactionList({ skip, limit, ...info });
- if (this.$checkRes(res)) {
- this.$set(this, `dinggou3`, res.data);
- this.$set(this, `total3`, res.total);
- }
- } else if (this.role == '6') {
- const res = await this.expertsauditList({ skip, limit, market_userid, status, ...info });
- if (this.$checkRes(res)) {
- this.$set(this, `faqilist`, res.data);
- this.$set(this, `totalfaqi`, res.total);
- }
- }
- },
- //审核
- async jiaoyisuccess({ item }) {
- item.status = '1';
- let res = await this.shenheupdate(item);
- this.jiaoyi1();
- this.$checkRes(res, '同意成功', '审核失败');
- },
- async shibai({ item }) {
- item.status = '3';
- let res = await this.shenheupdate(item);
- this.$checkRes(res, '审核成功', '审核失败');
- this.jiaoyi3();
- },
- async success({ item }) {
- item.status = '2';
- let res = await this.shenheupdate(item);
- this.$checkRes(res, '审核成功', '审核失败');
- this.jiaoyi2();
- },
- //分页
- async handleCurrentChangefaqi({ skip, limit, currentPage }) {
- this.$set(this, `skip`, skip);
- this.faqijiaoyi();
- },
- async change1({ skip, limit, currentPage }) {
- this.$set(this, `skip`, skip);
- this.jiaoyi1();
- },
- async change2({ skip, limit, currentPage }) {
- this.$set(this, `skip`, skip);
- this.jiaoyi2();
- },
- async change3({ skip, limit, currentPage }) {
- this.$set(this, `skip`, skip);
- this.jiaoyi3();
- },
- async deleteData({ item }) {
- const res = await this.transactiondtetle(item.id);
- this.$checkRes(res, '删除成功', '删除失败');
- },
- async onsaveClick({ id }) {
- console.log(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' });
- } else if (id === '修改密码') {
- this.$router.push({ path: '/enterprise/xiugai' });
- } else if (id === '返回首页') {
- this.$router.push({ path: '/' });
- } else if (id === '注销账号') {
- this.logout();
- this.$message({
- message: '注销成功',
- type: 'success',
- });
- this.toLogin();
- } else if (id === '展会管理') {
- this.$router.push({ path: '/enterprise/appointment' });
- }
- },
- async toLogin() {
- this.$router.push({ path: '/platlive' });
- },
- },
- };
- </script>
- <style lang="less" scoped></style>
|