|
@@ -1,21 +1,12 @@
|
|
|
<template>
|
|
|
<div class="card-edit">
|
|
|
- <!-- <a-divider orientation="left">关联企业信息</a-divider>-->
|
|
|
<a-form :model="postCompany" autocomplete="off">
|
|
|
<h1>关联企业信息</h1>
|
|
|
- <a-row>
|
|
|
- <a-col flex="800px">
|
|
|
- <a-form-item
|
|
|
- label="企业名称"
|
|
|
- :label-col="{ span: 3}"
|
|
|
- name="companyId"
|
|
|
- :rules="[{ required: true, message: '请输入企业名称!' }]"
|
|
|
- >
|
|
|
- <a-select
|
|
|
- ref="select"
|
|
|
- show-search optionFilterProp="label"
|
|
|
- v-model:value="postCompany.companyId"
|
|
|
- >
|
|
|
+ <a-row justify="start" :gutter="24" >
|
|
|
+ <a-col flex="895px">
|
|
|
+ <a-form-item label="企业名称" :label-col="{ span: 3}"
|
|
|
+ name="companyId" :rules="[{ required: true, message: '请输入企业名称!' }]" >
|
|
|
+ <a-select ref="select" show-search optionFilterProp="label" v-model:value="postCompany.companyId" >
|
|
|
<a-select-option v-for="item in companyList" :label="item.companyName" :value="item.companyID"
|
|
|
:key="item.companyID">
|
|
|
<span>{{ item.companyName }}</span>
|
|
@@ -40,74 +31,46 @@
|
|
|
</Space>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
- <!--<a-divider orientation="left">岗位管理</a-divider>-->
|
|
|
<div v-for="(item,index) in postDataList" style="margin-bottom: 20px;background-color: #f0f0f0" :key="index">
|
|
|
<h1>基础信息</h1>
|
|
|
<a-form :model="item" autocomplete="off">
|
|
|
- <a-row :gutter="24">
|
|
|
+ <a-row :gutter="24" justify="center">
|
|
|
<a-col flex="400px">
|
|
|
- <a-form-item
|
|
|
- label="岗位名称"
|
|
|
- :label-col="{ span: 6 }"
|
|
|
- :wrapper-col="{ span: 18 }"
|
|
|
- name="postName"
|
|
|
- :rules="[{ required: true, message: '请输入岗位名称!' }]"
|
|
|
- >
|
|
|
+ <a-form-item label="岗位名称" :label-col="{ span: 7 }"
|
|
|
+ name="postName" :rules="[{ required: true, message: '请输入岗位名称!' }]" >
|
|
|
<a-input v-model:value="item.postName" placeholder=""/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col flex="400px">
|
|
|
- <a-form-item
|
|
|
- label="招聘人数"
|
|
|
- :label-col="{ span: 6 }"
|
|
|
- :wrapper-col="{ span: 18 }"
|
|
|
- name="recruitCount"
|
|
|
- :rules="[{ required: true, message: '请输入招聘人数!' }]"
|
|
|
- >
|
|
|
+ <a-form-item label="招聘人数" :label-col="{ span: 7 }"
|
|
|
+ name="recruitCount" :rules="[{ required: true, message: '请输入招聘人数!' }]" >
|
|
|
<a-input v-model:value="item.recruitCount" placeholder=""/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col flex="300px" :offset="1">
|
|
|
- <a-form-item
|
|
|
- label="招聘日期"
|
|
|
- :label-col="{ span: 8 }"
|
|
|
- name="startTime"
|
|
|
- :rules="[{ required: true, message: '请输入招聘开始时间' }]"
|
|
|
- >
|
|
|
- <a-date-picker
|
|
|
- v-model:value="item.startTime"
|
|
|
- picker="date"
|
|
|
- value-format="YYYY-MM-DD"
|
|
|
- />
|
|
|
+ <a-col flex="315px">
|
|
|
+ <a-form-item label="招聘日期" :label-col="{ span: 9 }"
|
|
|
+ name="startTime" :rules="[{ required: true, message: '请输入招聘开始时间' }]" >
|
|
|
+ <a-date-picker v-model:value="item.startTime" picker="date" value-format="YYYY-MM-DD" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- 至
|
|
|
- <a-col flex="200px">
|
|
|
- <a-form-item
|
|
|
- name="endTime"
|
|
|
- :rules="[{ required: true, message: '请输入招聘结束时间' }]"
|
|
|
- >
|
|
|
- <a-date-picker
|
|
|
- v-model:value="item.endTime"
|
|
|
- picker="date"
|
|
|
- value-format="YYYY-MM-DD"
|
|
|
- />
|
|
|
+ <label style="margin:5px;">至</label>
|
|
|
+ <a-col flex="215px">
|
|
|
+ <a-form-item name="endTime" :rules="[{ required: true, message: '请输入招聘结束时间' }]" >
|
|
|
+ <a-date-picker v-model:value="item.endTime" picker="date" value-format="YYYY-MM-DD" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
-
|
|
|
- <a-row>
|
|
|
- <a-col class="table-bottom-a1" span="22">
|
|
|
- <a-form-item :label-col="{span:2}" name="jobPlace" label="招聘地点"
|
|
|
- :rules="[{ required: true, message: '请输入招聘地点' }]"
|
|
|
- >
|
|
|
+ <a-row justify="center">
|
|
|
+ <a-col flex="1330px">
|
|
|
+ <a-form-item label="招聘地点" :label-col="{span:2}" name="jobPlace"
|
|
|
+ :rules="[{ required: true, message: '请输入招聘地点' }]" >
|
|
|
<a-textarea v-model:value="item.jobPlace" placeholder="" :rows="4"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
<h1>其他信息</h1>
|
|
|
- <a-row>
|
|
|
- <a-col flex="300px" style="margin-left: 3px;">
|
|
|
+ <a-row justify="center">
|
|
|
+ <a-col flex="300px" >
|
|
|
<a-form-item
|
|
|
label="岗位月薪(元)"
|
|
|
name="minSalary"
|
|
@@ -117,7 +80,7 @@
|
|
|
<a-input v-model:value="item.minSalary" placeholder="请输入金额"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- 至
|
|
|
+ <label style="margin:5px 8px 5px 8px;">至</label>
|
|
|
<a-col flex="200px">
|
|
|
<a-form-item
|
|
|
:label-col="{ span: 6 }"
|
|
@@ -143,10 +106,10 @@
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col flex="400px" :offset="1">
|
|
|
+ <a-col flex="400px" >
|
|
|
<a-form-item
|
|
|
label="试用期(月)"
|
|
|
- :label-col="{ span: 9 }"
|
|
|
+ :label-col="{ span: 7 }"
|
|
|
name="trailtime"
|
|
|
:rules="[{ required: false, message: '请选择试用期时长!' }]"
|
|
|
>
|
|
@@ -155,8 +118,8 @@
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
|
|
|
- <a-row>
|
|
|
- <a-col flex="300px" style="margin-left: 3px;">
|
|
|
+ <a-row justify="center">
|
|
|
+ <a-col flex="300px">
|
|
|
<a-form-item
|
|
|
label="试用期月薪(元)"
|
|
|
name="trailMaxSalary"
|
|
@@ -166,7 +129,7 @@
|
|
|
<a-input v-model:value="item.trailMaxSalary" placeholder="请输入金额"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- 至
|
|
|
+ <label style="margin:5px 8px 5px 8px;">至</label>
|
|
|
<a-col flex="200px">
|
|
|
<a-form-item
|
|
|
:label-col="{ span: 6 }"
|
|
@@ -192,10 +155,10 @@
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col flex="400px" :offset="1">
|
|
|
+ <a-col flex="400px">
|
|
|
<a-form-item
|
|
|
label="学历要求"
|
|
|
- :label-col="{ span: 9 }"
|
|
|
+ :label-col="{ span: 7 }"
|
|
|
name="trailtime"
|
|
|
:rules="[{ required: false, message: '请选择试用期时长!' }]"
|
|
|
>
|
|
@@ -209,15 +172,15 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
- <a-row>
|
|
|
- <a-col class="table-bottom-a1" span="22">
|
|
|
+ <a-row justify="center">
|
|
|
+ <a-col flex="1330px">
|
|
|
<a-form-item :label-col="{span:2}" name="welfare" label="福利待遇">
|
|
|
<a-textarea v-model:value="item.welfare" placeholder="" :rows="4"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
- <a-row>
|
|
|
- <a-col class="table-bottom-a1" span="22">
|
|
|
+ <a-row justify="center">
|
|
|
+ <a-col flex="1330px">
|
|
|
<a-form-item :label-col="{span:2}" name="postDesc" label="其他要求">
|
|
|
<a-textarea v-model:value="item.postDesc" placeholder="" :rows="4"/>
|
|
|
</a-form-item>
|
|
@@ -238,11 +201,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-// import {defineComponent, reactive, ref, toRefs} from 'vue';
|
|
|
import {defineComponent, reactive, ref} from 'vue';
|
|
|
import {useRouter} from 'vue-router';
|
|
|
-// import {save, getPostByID,savePostList} from '@/api/companyService/post'
|
|
|
-import {savePostList, getPostByID} from '@/api/companyService/post'
|
|
|
+import {savePostList, getPostByID} from '@/api/companyService/post';
|
|
|
+import {getCompanyById} from '@/api/companyService/company'
|
|
|
import type {SelectProps} from 'ant-design-vue';
|
|
|
import {message} from 'ant-design-vue';
|
|
|
import {useTabsViewStore} from '@/store/modules/tabsView';
|
|
@@ -257,6 +219,9 @@ interface postModel {
|
|
|
jobPlace: string | null,
|
|
|
maxSalary: number | null,
|
|
|
minSalary: number | null,
|
|
|
+ userName: string,
|
|
|
+ userMobile: string | null,
|
|
|
+ postEmail: string | null,
|
|
|
isTrail: number | null,
|
|
|
trailtime: string | null,
|
|
|
trailMaxSalary: number | null,
|
|
@@ -265,12 +230,15 @@ interface postModel {
|
|
|
cultureRank: number | null,
|
|
|
welfare: string | null,
|
|
|
postDesc: string | null,
|
|
|
- companyID: string | null
|
|
|
+ companyID: string | null,
|
|
|
recordStatus: number | null,
|
|
|
}
|
|
|
|
|
|
interface companyModel {
|
|
|
- companyId: string | null;
|
|
|
+ companyId: string | null,
|
|
|
+ userName: string | null,
|
|
|
+ userMobile: string | null,
|
|
|
+ companyEmail: string | null,
|
|
|
}
|
|
|
|
|
|
export default defineComponent(
|
|
@@ -278,7 +246,7 @@ export default defineComponent(
|
|
|
name: 'PostEdit',
|
|
|
components: {BUploadFile},
|
|
|
setup() {
|
|
|
- const postCompany = reactive<companyModel>({companyId: null});//关联企业信息
|
|
|
+ const postCompany = reactive<companyModel>({companyId: null,userName: null,userMobile: null,companyEmail: null},);
|
|
|
const router = useRouter();
|
|
|
const fullpath = router.currentRoute.value.fullPath;
|
|
|
const tabsViewStore = useTabsViewStore();
|
|
@@ -315,6 +283,7 @@ export default defineComponent(
|
|
|
(postDataList.value as any[]).splice(index, 1);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
get('system/dictionary/getDictionaryItemByCodeList', {code: 'CultureLevel'}).then(result => {
|
|
|
cultureLevelList.value = result;
|
|
|
});
|
|
@@ -323,9 +292,9 @@ export default defineComponent(
|
|
|
WorkYearTypeList.value = result;
|
|
|
});
|
|
|
|
|
|
- get('companyService/company/getList', {pageIndex: 1, pageSize: 999}).then(result => {
|
|
|
+ get('companyService/company/getList', {pageIndex: 1, pageSize: 9999}).then(result => {
|
|
|
companyList.value = result.list;
|
|
|
- console.log(companyList);
|
|
|
+ // console.log(companyList);
|
|
|
})
|
|
|
|
|
|
const onClose = () => {
|
|
@@ -335,22 +304,32 @@ export default defineComponent(
|
|
|
};
|
|
|
|
|
|
const onFinish = () => {
|
|
|
- postDataList.value.forEach(item => {
|
|
|
- item.companyID = postCompany.companyId + "";
|
|
|
- item.recordStatus = 1;
|
|
|
- })
|
|
|
- //判断重复-根据岗位名称、工作年限、学历要求、岗位薪资、试用期薪资
|
|
|
- const isRepetition = hasDuplicates(postDataList.value, compareFunction);
|
|
|
- if (isRepetition) {
|
|
|
- message.warning('岗位信息存在重复!');
|
|
|
- return;
|
|
|
+ if(postCompany.companyId!=null){
|
|
|
+ getCompanyById(postCompany.companyId).then((result:any)=>{
|
|
|
+ const curSelectCompany:any = result;
|
|
|
+ postDataList.value.forEach(item => {
|
|
|
+ item.companyID = curSelectCompany.companyID;
|
|
|
+ item.userName = curSelectCompany.userName;
|
|
|
+ item.userMobile = curSelectCompany.userMobile;
|
|
|
+ item.postEmail = curSelectCompany.companyEmail;
|
|
|
+ item.recordStatus = 1;
|
|
|
+ });
|
|
|
+ console.log("postList",postDataList.value);
|
|
|
+ //判断重复-根据岗位名称、工作年限、学历要求、岗位薪资、试用期薪资
|
|
|
+ const isRepetition = hasDuplicates(postDataList.value, compareFunction);
|
|
|
+ if (isRepetition) {
|
|
|
+ message.warning('岗位信息存在重复!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ savePostList(postDataList.value).then((result) => {
|
|
|
+ if (result) {
|
|
|
+ tabsViewStore.closeCurrentTab(fullpath);
|
|
|
+ tabsViewStore.addTabByPath('/companyService/post/index', {reload: 1});
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
- savePostList(postDataList.value).then((result) => {
|
|
|
- if (result) {
|
|
|
- tabsViewStore.closeCurrentTab(fullpath);
|
|
|
- tabsViewStore.addTabByPath('/companyService/post/index', {reload: 1});
|
|
|
- }
|
|
|
- });
|
|
|
}
|
|
|
|
|
|
const hasDuplicates = (arr, compareFn) => {
|
|
@@ -371,8 +350,7 @@ export default defineComponent(
|
|
|
|
|
|
const loadData = (id: any) => {
|
|
|
getPostByID(id).then(result => {
|
|
|
- // formState.dataModel = result;
|
|
|
- console.log(result);
|
|
|
+ // console.log(result);
|
|
|
postCompany.companyId = (result as postModel).companyID;
|
|
|
(postDataList.value as any[]).push(result);
|
|
|
})
|
|
@@ -383,14 +361,14 @@ export default defineComponent(
|
|
|
loadData,
|
|
|
onClose,
|
|
|
onFinish,
|
|
|
+ addPost,
|
|
|
+ delPostItem,
|
|
|
companyList,
|
|
|
postStatusList,
|
|
|
trialStatusList,
|
|
|
cultureLevelList,
|
|
|
postDataList,
|
|
|
- addPost,
|
|
|
WorkYearTypeList,
|
|
|
- delPostItem,
|
|
|
postCompany,
|
|
|
isEdit
|
|
|
}
|