|
|
@@ -31,9 +31,6 @@
|
|
|
@change="handlePostNameChange"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="岗位编码" prop="postCode">
|
|
|
- <el-input v-model="form.postCode" placeholder="请输入岗位编码" maxlength="64" />
|
|
|
- </el-form-item>
|
|
|
<el-form-item label="地区" prop="regionCodes">
|
|
|
<el-cascader v-model="form.regionCodes" :options="regionOptions" :props="regionProps" clearable filterable placeholder="请选择地区" />
|
|
|
</el-form-item>
|
|
|
@@ -183,7 +180,7 @@ import { useRoute, useRouter } from 'vue-router';
|
|
|
import { regionData, codeToText } from 'element-china-area-data';
|
|
|
import type { CascaderOption } from 'element-plus';
|
|
|
import PageShell from '@/components/PageShell/index.vue';
|
|
|
-import { addPostManage, checkPostCode, getPostManage, updatePostManage } from '@/api/main/postManage';
|
|
|
+import { addPostManage, getPostManage, updatePostManage } from '@/api/main/postManage';
|
|
|
import type { MainPostApplyVO } from '@/api/main/postManage/types';
|
|
|
import { getDictsFresh } from '@/api/system/dict/data';
|
|
|
import { listIndustryOpen, listIndustrySkillOpen } from '@/api/system/industry';
|
|
|
@@ -216,7 +213,6 @@ interface PostCreateFormModel {
|
|
|
internshipDuration: string;
|
|
|
travelRequired: string;
|
|
|
jobDescription: string;
|
|
|
- postCode: string;
|
|
|
postCategory: string;
|
|
|
evaluationDuration: string;
|
|
|
passingScores: Array<{ key: string; score: string }>;
|
|
|
@@ -274,7 +270,6 @@ const form = reactive<PostCreateFormModel>({
|
|
|
internshipDuration: '',
|
|
|
travelRequired: '0',
|
|
|
jobDescription: '',
|
|
|
- postCode: '',
|
|
|
postCategory: '',
|
|
|
evaluationDuration: '',
|
|
|
passingScores: [
|
|
|
@@ -311,23 +306,6 @@ const validatePassingScores = (rule: any, value: any, callback: any) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-const validatePostCode = async (rule: any, value: any, callback: any) => {
|
|
|
- if (!value) {
|
|
|
- callback(new Error('岗位编码不能为空'));
|
|
|
- return;
|
|
|
- }
|
|
|
- try {
|
|
|
- const res = await checkPostCode(value, form.id);
|
|
|
- if (!res.data) {
|
|
|
- callback(new Error('岗位编码已存在'));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- } catch {
|
|
|
- callback();
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
const rules = reactive<any>({
|
|
|
postNamePath: [{ required: true, message: '岗位名称不能为空', trigger: 'change' }],
|
|
|
regionCodes: [{ required: true, message: '地区不能为空', trigger: 'change' }],
|
|
|
@@ -335,7 +313,6 @@ const rules = reactive<any>({
|
|
|
jobType: [{ required: true, message: '岗位类型不能为空', trigger: 'change' }],
|
|
|
salaryMin: [{ required: true, message: '最低薪资不能为空', trigger: 'blur' }],
|
|
|
salaryMax: [{ required: true, message: '最高薪资不能为空', trigger: 'blur' }],
|
|
|
- postCode: [{ required: true, validator: validatePostCode, trigger: 'blur' }],
|
|
|
postCategory: [{ required: true, message: '岗位级别不能为空', trigger: 'change' }],
|
|
|
evaluationDuration: [{ required: true, message: '测评时长不能为空', trigger: 'blur' }],
|
|
|
postSort: [{ required: true, message: '岗位顺序不能为空', trigger: 'blur' }],
|
|
|
@@ -535,7 +512,6 @@ const fillForm = (data: MainPostApplyVO) => {
|
|
|
form.auditId = data.auditId;
|
|
|
form.postName = data.postName || '';
|
|
|
form.postNamePath = data.postName ? findPostNamePathByLabel(postNameOptions.value, data.postName) : [];
|
|
|
- form.postCode = data.applyNo || '';
|
|
|
form.regionCodes = [];
|
|
|
form.addressDetail = data.workAddress || '';
|
|
|
form.jobType = data.postType || '';
|
|
|
@@ -592,7 +568,7 @@ const handleApplyUnlimitedChange = (value: boolean) => {
|
|
|
|
|
|
const validateStep = async () => {
|
|
|
if (activeStep.value === 0) {
|
|
|
- await formRef.value?.validateField(['postNamePath', 'postCode', 'regionCodes', 'addressDetail', 'jobType', 'salaryMin', 'salaryMax', 'recruitCount', 'applyTimeRange']);
|
|
|
+ await formRef.value?.validateField(['postNamePath', 'regionCodes', 'addressDetail', 'jobType', 'salaryMin', 'salaryMax', 'recruitCount', 'applyTimeRange']);
|
|
|
if (Number(form.salaryMin) > Number(form.salaryMax)) throw new Error('最低薪资不能大于最高薪资');
|
|
|
}
|
|
|
if (activeStep.value === 1) {
|
|
|
@@ -657,7 +633,6 @@ const handleSubmit = async () => {
|
|
|
await validateStep();
|
|
|
const payload = buildPayload();
|
|
|
if (isEdit.value) {
|
|
|
- payload.applyNo = form.postCode;
|
|
|
await updatePostManage(payload);
|
|
|
} else {
|
|
|
await addPostManage(payload);
|