|
@@ -1,6 +1,11 @@
|
|
|
<template>
|
|
|
<div id="detail">
|
|
|
<el-form ref="form" :model="info" label-width="0" label-position="left" style="padding:0 0.5rem;" :rules="rules">
|
|
|
+ <form-item label="发布学校" prop="schid">
|
|
|
+ <el-col :span="24">
|
|
|
+ <drawer :data="schList" type="schid" need="value" :selected="query.schid" placeholder="请选择发布学校" @select="selectSch"></drawer>
|
|
|
+ </el-col>
|
|
|
+ </form-item>
|
|
|
<form-item label="招聘简章" prop="profile_id">
|
|
|
<el-col :span="24">
|
|
|
<drawer :data="profileList" type="profile_id" need="value" :selected="info.profile_id" placeholder="请选择招聘简章" @select="getProfile"></drawer>
|
|
@@ -166,6 +171,8 @@ export default {
|
|
|
profileList: [],
|
|
|
jobList: [],
|
|
|
OrJobList: [],
|
|
|
+ schList: [],
|
|
|
+ query: {},
|
|
|
datePick: false,
|
|
|
endDate: `${new Date().getFullYear() + 1}-${new Date().getMonth() + 1}-${new Date().getDate()}`,
|
|
|
rules: {
|
|
@@ -190,9 +197,10 @@ export default {
|
|
|
loading: true,
|
|
|
}),
|
|
|
created() {
|
|
|
+ this.$set(this.info, `title`, JSON.parse(JSON.stringify(this.user.corpname)));
|
|
|
this.getProfileList();
|
|
|
this.getJobsList();
|
|
|
- this.$set(this.info, `title`, this.user.corpname);
|
|
|
+ this.getSchList();
|
|
|
this.search();
|
|
|
},
|
|
|
computed: {
|
|
@@ -201,7 +209,7 @@ export default {
|
|
|
}),
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapActions(['profilesOperation', 'talksOperation', 'postsOperation']),
|
|
|
+ ...mapActions(['profilesOperation', 'talksOperation', 'postsOperation', 'corpSchInfo']),
|
|
|
async search() {
|
|
|
if (this.$route.query.id) {
|
|
|
this.$set(this, `loading`, false);
|
|
@@ -225,7 +233,7 @@ export default {
|
|
|
} else {
|
|
|
result = await this.talksOperation({
|
|
|
type: 'add',
|
|
|
- data: { info: data, schid: 999991, corpid: this.user.coprid, corpname: this.user.corpname, schname: '测试学校1' },
|
|
|
+ data: { info: data, corpid: this.user.corpid, corpname: this.user.corpname, ...this.query },
|
|
|
});
|
|
|
}
|
|
|
if (`${result.errcode}` === '0') {
|
|
@@ -303,12 +311,34 @@ export default {
|
|
|
let result = await this.profilesOperation({ type: 'search', data: { id: this.info.profile_id } });
|
|
|
if (`${result.errcode}` === `0`) {
|
|
|
this.$set(this.info, `content`, result.data.content);
|
|
|
- this.$set(this.info, `title`, result.data.title);
|
|
|
}
|
|
|
} else {
|
|
|
this.$set(_.get(this, checkType[0]), `${checkType[1]}`, value);
|
|
|
}
|
|
|
},
|
|
|
+ async getSchList() {
|
|
|
+ let result = await await this.corpSchInfo({ type: 'list', data: { corpid: this.user.corpid } });
|
|
|
+ if (`${result.errcode}` === '0') {
|
|
|
+ let arr = result.data.map(item => {
|
|
|
+ let object = {};
|
|
|
+ object.label = item.schname;
|
|
|
+ object.value = item.schid;
|
|
|
+ return object;
|
|
|
+ });
|
|
|
+ this.$set(this, `schList`, arr);
|
|
|
+ } else {
|
|
|
+ this.$message.error(result.errmsg ? result.errmsg : 'error');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ selectSch({ type, value }) {
|
|
|
+ let res = this.schList.filter(item => {
|
|
|
+ return `${item.value}` === `${value}`;
|
|
|
+ });
|
|
|
+ if (res.length > 0) {
|
|
|
+ this.$set(this.query, `schid`, value);
|
|
|
+ this.$set(this.query, `schname`, res[0].label);
|
|
|
+ }
|
|
|
+ },
|
|
|
dateChoose(date) {
|
|
|
this.$set(this.info, `date`, `${date[0]}-${date[1]}-${date[2]}`);
|
|
|
this.$set(this.info, `time`, date[5]);
|