|
@@ -1,53 +1,49 @@
|
|
|
<template>
|
|
|
<div id="adviserList">
|
|
|
- <useredit-detail
|
|
|
+ <duijiedetail-detail
|
|
|
:info="info"
|
|
|
+ :options="options"
|
|
|
+ :form="form"
|
|
|
+ @onSubmit="onSubmit"
|
|
|
:liebiaoList="liebiaoList"
|
|
|
@onsave="onsaveClick"
|
|
|
- :forms="forms"
|
|
|
- @demandSubmit="demandSubmit"
|
|
|
- :columnList="columnList"
|
|
|
- @changeType="changeType"
|
|
|
- :totaltype="totaltype"
|
|
|
- ></useredit-detail>
|
|
|
+ ></duijiedetail-detail>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import usereditDetail from '@/components/enterprise/useredit.vue';
|
|
|
+import duijiedetailDetail from '@/components/enterprise/duijiedetail.vue';
|
|
|
import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
|
|
|
-const { mapActions: mapMarkettype } = createNamespacedHelpers('markettype');
|
|
|
-const { mapActions: mapMarketproduct } = createNamespacedHelpers('marketproduct');
|
|
|
const { mapActions: login } = createNamespacedHelpers('login');
|
|
|
-
|
|
|
+const { mapActions: dock } = createNamespacedHelpers('dock');
|
|
|
+const { mapActions: palce } = createNamespacedHelpers('palce');
|
|
|
export default {
|
|
|
name: 'adviserList',
|
|
|
props: {},
|
|
|
components: {
|
|
|
- usereditDetail,
|
|
|
+ duijiedetailDetail,
|
|
|
},
|
|
|
data: () => ({
|
|
|
+ form: {},
|
|
|
info: {},
|
|
|
+ options: [],
|
|
|
liebiaoList: [
|
|
|
{ name: '基本信息' },
|
|
|
{ name: '消息管理' },
|
|
|
{ name: '我的发布' },
|
|
|
{ name: '事项管理' },
|
|
|
+ { name: '展会预约' },
|
|
|
{ name: '返回首页' },
|
|
|
{ name: '修改密码' },
|
|
|
{ name: '注销账号' },
|
|
|
],
|
|
|
- forms: {},
|
|
|
- columnList: [],
|
|
|
- totaltype: 0,
|
|
|
}),
|
|
|
created() {
|
|
|
- this.maarkettype();
|
|
|
this.searchInfo();
|
|
|
+ this.search();
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
|
-
|
|
|
id() {
|
|
|
return this.$route.query.id;
|
|
|
},
|
|
@@ -58,41 +54,42 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapMarkettype({ markettypeList: 'query' }),
|
|
|
- ...mapMarketproduct({ productFetch: 'fetch', productCreate: 'create', productUpdate: 'update' }),
|
|
|
+ ...dock(['query', 'delete', 'update', 'create', 'fetch']),
|
|
|
+ ...palce({ palcequery: 'query', transactiondtetle: 'delete' }),
|
|
|
+
|
|
|
...login({ logout: 'logout', transactiondtetle: 'delete' }),
|
|
|
+ // 查询基本信息
|
|
|
async searchInfo() {
|
|
|
- if (this.$route.query.id) {
|
|
|
- const res = await this.productFetch(this.id);
|
|
|
- this.$set(this, `demandForm`, res.data);
|
|
|
+ if (this.id) {
|
|
|
+ let res = await this.fetch(this.id);
|
|
|
+ if (res.errcode === 0) {
|
|
|
+ this.$set(this, `form`, res.data);
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- async demandSubmit(demandForm) {
|
|
|
- let data = this.demandForm;
|
|
|
- console.log(data);
|
|
|
- data.userid = this.user.uid;
|
|
|
- console.log(data.userid);
|
|
|
+ async search() {
|
|
|
+ let parent = 220000;
|
|
|
+ let level = 2;
|
|
|
+ let res = await this.palcequery({ parent, level });
|
|
|
+
|
|
|
+ this.$set(this, `options`, res.data);
|
|
|
+ },
|
|
|
|
|
|
+ async onSubmit({ data }) {
|
|
|
let res;
|
|
|
let msg;
|
|
|
+ data.user_id = this.user.uid;
|
|
|
if (data.id) {
|
|
|
- res = await this.productUpdate(data);
|
|
|
- msg = `${this.keyWord}修改成功`;
|
|
|
+ res = await this.update(data);
|
|
|
+ this.$checkRes(res, '修改成功', res.errmsg || '删除失败');
|
|
|
} else {
|
|
|
- res = await this.productCreate(data);
|
|
|
- msg = `${this.keyWord}添加成功`;
|
|
|
+ res = await this.create(data);
|
|
|
+ this.$checkRes(res, '添加成功', res.errmsg || '删除失败');
|
|
|
}
|
|
|
- if (this.$checkRes(res, msg)) this.$router.push({ path: '/enterprise/enterprisefabu' });
|
|
|
+ this.$router.push({ path: '/enterprise/appointment' });
|
|
|
},
|
|
|
- // 查询类型
|
|
|
- async maarkettype({ category = 123, ...info } = {}) {
|
|
|
- const res = await this.markettypeList({ category, ...info });
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `columnList`, res.data);
|
|
|
- }
|
|
|
- },
|
|
|
- // 栏目跳转
|
|
|
async onsaveClick({ id }) {
|
|
|
+ console.log(id);
|
|
|
if (id === '基本信息') {
|
|
|
this.$router.push({ path: '/enterprise/enterprisejb' });
|
|
|
} else if (id === '消息管理') {
|
|
@@ -101,6 +98,8 @@ export default {
|
|
|
this.$router.push({ path: '/enterprise/enterprisefabu' });
|
|
|
} else if (id === '事项管理') {
|
|
|
this.$router.push({ path: '/enterprise/enterprisedg' });
|
|
|
+ } else if (id === '展会预约') {
|
|
|
+ this.$router.push({ path: '/enterprise/appointment' });
|
|
|
} else if (id === '修改密码') {
|
|
|
this.$router.push({ path: '/enterprise/xiugai' });
|
|
|
} else if (id === '返回首页') {
|
|
@@ -114,14 +113,9 @@ export default {
|
|
|
this.toLogin();
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
async toLogin() {
|
|
|
this.$router.push({ path: '/' });
|
|
|
},
|
|
|
- changeType(item) {
|
|
|
- console.log(item);
|
|
|
- this.$set(this, `totaltype`, item);
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|