123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <template>
- <div id="adviserList">
- <enterprisexuqiu-detail
- :info="info"
- :columnList="columnList"
- :liebiaoList="liebiaoList"
- @onsaves="onsaveClicks"
- :form="form"
- @onsave="onsaveClick"
- ></enterprisexuqiu-detail>
- <!-- @detailcm="clickDetailcm" -->
- </div>
- </template>
- <script>
- import enterprisexuqiuDetail from '@/components/enterprise/enterprisexuqiu.vue';
- import { createNamespacedHelpers, mapGetters } from 'vuex';
- const { mapActions: mapSite } = createNamespacedHelpers('site');
- const { mapActions: mapRecruit } = createNamespacedHelpers('market');
- const { mapActions: marketproduct } = createNamespacedHelpers('marketproduct');
- const { mapActions: mapColumn } = createNamespacedHelpers('markettype');
- export default {
- name: 'adviserList',
- props: {},
- components: {
- enterprisexuqiuDetail,
- },
- data: () => ({
- info: {},
- liebiaoList: [{ name: '基本信息' }, { name: '消息管理' }, { name: '我的发布' }, { name: '我的订购' }, { name: '注销账号' }],
- columnName: '',
- recruitData: [],
- columnList: [],
- form: {},
- }),
- created() {
- this.search();
- this.searchSite();
- this.searchColumn();
- },
- computed: {
- id() {
- return this.$route.query.id;
- },
- keyWord() {
- let meta = this.$route.meta;
- let main = meta.title || '';
- return main;
- },
- },
- methods: {
- ...mapSite(['showInfo']),
- ...marketproduct({ list: 'query', columnInfo: 'fetch', marketcerate: 'create' }),
- ...mapColumn({ queryList: 'query' }),
- async search() {
- this.loading = false;
- if (this.$route.query.id) {
- const res = await this.columnInfo(this.id);
- this.$set(this, `form`, res.data);
- }
- this.loading = true;
- },
- async searchColumn({ ...info } = {}) {
- const res = await this.queryList({ ...info });
- if (this.$checkRes(res)) {
- this.$set(this, `columnList`, res.data);
- }
- },
- // 查询站点信息
- 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 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' });
- }
- },
- async onsaveClicks(form) {
- let data = this.form;
- console.log(data);
- let res;
- let msg;
- if (data.id) {
- res = await this.columnInfo(data);
- msg = `${this.keyWord}修改成功`;
- } else {
- res = await this.marketcerate(data);
- msg = `${this.keyWord}添加成功`;
- }
- if (this.$checkRes(res, msg)) this.$router.push({ path: '/policy/index' });
- },
- },
- };
- </script>
- <style lang="less" scoped></style>
|