123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468 |
- <template>
- <div>
- <template v-if="state">
- <a-form layout="vertical" class="resume-form">
- <a-tabs v-model:activeKey="activeKey" style="width: 100%" type="card">
- <a-tab-pane :key="1" tab="意向地区">
- <a-row :gutter="20">
- <a-col span="24">
- <a-form-item label="意向地区">
- <a-jilian :dict="2009" @saveCascader="areaSave" placeholder="请选择意向地区"
- :cascader_content="addOtherForm.area"></a-jilian>
- </a-form-item>
- </a-col>
- <a-col span="24">
- <a-flex justify="flex-end">
- <a-space>
- <a-button @click="resetForm('area')" size="large">取消</a-button>
- <a-button type="primary" @click="sumbitAreaForm" size="large">保存</a-button>
- </a-space>
- </a-flex>
- </a-col>
- </a-row>
- </a-tab-pane>
- <a-tab-pane :key="2" tab="意向职位" force-render>
- <a-row :gutter="20">
- <a-col span="24">
- <a-form-item label="意向职位">
- <a-jilian :dict="2004" @saveCascader="positionSave" placeholder="请选择意向职位"
- :cascader_content="addOtherForm.position"></a-jilian>
- </a-form-item>
- </a-col>
- <a-col span="24">
- <a-flex justify="flex-end">
- <a-space>
- <a-button @click="resetForm('position')" size="large">取消</a-button>
- <a-button type="primary" @click="sumbitPositionForm" size="large">保存</a-button>
- </a-space>
- </a-flex>
- </a-col>
- </a-row>
- </a-tab-pane>
- <a-tab-pane :key="3" tab="其他意向">
- <a-row :gutter="20">
- <a-col span="12">
- <a-form-item label="其他职位">
- <a-input v-model:value="basicForm.other_positions" placeholder="请输入其他职位"
- size="large" />
- </a-form-item>
- </a-col>
- <a-col span="12">
- <a-form-item label="求职类型">
- <a-xuanze :dict="2019" placeholder="请选择求职类型" @saveSelect="saveJobType"
- :select_content="basicForm.job_type"></a-xuanze>
- </a-form-item>
- </a-col>
- <a-col span="12">
- <a-form-item label="人才类型">
- <a-xuanze :dict="2020" placeholder="请选择人才类型" @saveSelect="saveTalentType"
- :select_content="basicForm.talent_type"></a-xuanze>
- </a-form-item>
- </a-col>
- <a-col span="12">
- <a-form-item label="工作经验" name="work_experience">
- <a-xuanze :dict="2021" placeholder="请选择求工作经验" @saveSelect="saveWorkExperience"
- :select_content="basicForm.work_experience"></a-xuanze>
- </a-form-item>
- </a-col>
-
- <a-col span="12">
- <a-form-item label="月薪要求范围">
- <a-xuanze :dict="2005" placeholder="请选择月薪要求范围" @saveSelect="saveSalaryRange"
- :select_content="basicForm.salary_range"></a-xuanze>
- </a-form-item>
- </a-col>
- <a-col span="12">
- <a-form-item label="可到职日期">
- <a-xuanze :dict="2013" placeholder="请选择可到职日期" @saveSelect="saveAvailableDate"
- :select_content="basicForm.available_date"></a-xuanze>
- </a-form-item>
- </a-col>
- <a-col span="12">
- <a-form-item label="职称要求">
- <a-xuanze :dict="2014" placeholder="请选择职称要求" @saveSelect="saveTitleRequirement"
- :select_content="basicForm.title_requirement"></a-xuanze>
- </a-form-item>
- </a-col>
- <a-col span="12">
- <a-form-item label="技能认证">
- <a-xuanze :dict="2015" placeholder="请选择技能认证" @saveSelect="saveSkillCertification"
- :select_content="basicForm.skill_certification"></a-xuanze>
- </a-form-item>
- </a-col>
- <a-col span="12">
- <a-form-item label="食宿要求">
- <a-xuanze :dict="2016" placeholder="请选择食宿要求"
- @saveSelect="saveAccommodationRequirement"
- :select_content="basicForm.accommodation_requirement"></a-xuanze>
- </a-form-item>
- </a-col>
- <a-col span="12">
- <a-form-item label="节假日休息情况">
- <a-xuanze :dict="2017" placeholder="请选择节假日休息情况" @saveSelect="saveHolidayRest"
- :select_content="basicForm.holiday_rest"></a-xuanze>
- </a-form-item>
- </a-col>
- <a-col span="24">
- <a-flex justify="flex-end">
- <a-space>
- <a-button @click="resetForm('basic')" size="large">取消</a-button>
- <a-button type="primary" @click="sumbitBasicForm" size="large">保存</a-button>
- </a-space>
- </a-flex>
- </a-col>
- </a-row>
- </a-tab-pane>
- </a-tabs>
- </a-form>
- </template>
- <template v-else>
- <template v-if="positionList.length > 0">
- <a-typography>
- <a-typography-title :level="5">
- 意向职位
- </a-typography-title>
- </a-typography>
- <a-typography-paragraph>
- <a-space direction="vertical">
- <template v-for="(item,index) in positionList">
- <div>
- {{item.level1_txt}}/{{item.level2_txt}}
- <a-divider type="vertical" />
- <a-button size="small" type="text" @click="toPositionEdit(item)">
- <EditOutlined />
- </a-button>
- <a-divider type="vertical" />
- <a-popconfirm title="是否删除该意向职位" @confirm="delPosition(item.id)">
- <a-button size="small" type="text">
- <DeleteOutlined />
- </a-button>
- </a-popconfirm>
- </div>
- </template>
- </a-space>
- </a-typography-paragraph>
- </template>
-
- <template v-if="areaList.length > 0">
- <a-typography>
- <a-typography-title :level="5">
- 意向地区
- </a-typography-title>
- </a-typography>
- <a-typography-paragraph>
- <a-space direction="vertical">
- <template v-for="(item,index) in areaList">
- <div>
- {{item.level1_txt}}
- <span v-if="item.level2_txt">/</span>
- {{item.level2_txt}}
- <span v-if="item.level3_txt">/</span>
- {{item.level3_txt}}
- <span v-if="item.level4_txt">/</span>
- {{item.level4_txt}}
- <a-divider type="vertical" />
- <a-button size="small" type="text" @click="toEdit(item)">
- <EditOutlined />
- </a-button>
- <a-divider type="vertical" />
- <a-popconfirm title="是否删除该意向地区" @confirm="delArea(item.id)">
- <a-button size="small" type="text">
- <DeleteOutlined />
- </a-button>
- </a-popconfirm>
- </div>
- </template>
- </a-space>
- </a-typography-paragraph>
- </template>
- <template v-if="basic">
- <a-typography>
- <a-typography-title :level="5">
- 其他意向
- </a-typography-title>
- </a-typography>
- <a-typography-paragraph>
- <div>{{basic.job_type_txt}}职位</div>
- <div>
- {{basic.talent_type_txt}}
- <a-divider type="vertical" />
- {{basic.holiday_rest_txt}}
- <a-divider type="vertical" />
- {{basic.salary_range_txt}}
- <a-divider type="vertical" />
- <a-button size="small" type="text" @click="toBasicEdit">
- <EditOutlined />
- </a-button>
- <a-divider type="vertical" />
- <a-popconfirm title="是否删除其他意向" @confirm="delBasic(basic.id)">
- <a-button size="small" type="text">
- <DeleteOutlined />
- </a-button>
- </a-popconfirm>
- </div>
- </a-typography-paragraph>
- </template>
- </template>
- </div>
- </template>
-
- <script setup lang="ts">
- import { ref, onMounted, computed, defineProps, watch, defineEmits, createVNode } from 'vue';
- import { PostJobapplicantAdddesirearea, PostJobapplicantDeldesirearea, PostJobapplicantUpdatedesirearea, PostJobapplicantListdesirearea, PostJobapplicantDesireareadetail, PostJobapplicantAdddesireindustry, PostJobapplicantDeldesireindustry, PostJobapplicantUpdatedesireindustry, PostJobapplicantListdesireindustry, PostJobapplicantDesireindustrydetail, PostJobapplicantAdddesirebase, PostJobapplicantDeldesirebase, PostJobapplicantUpdatedesirebase, PostJobapplicantDesirebasedetail } from '@/apis/models';
- import { intersectionAlike } from '@/utils/dataHelper';
- import { warnToast, successToast } from '@/utils/toastHelper';
- import { dataAreaForm, dataPositionForm, dataBasicForm, otherDataForm, reset } from '@/components/jobseeker/resume/intention/data.ts';
- import { EditOutlined, FileSearchOutlined, RedoOutlined, DeleteOutlined } from '@ant-design/icons-vue';
- import { useCommon } from '@/hooks/useCommon';
- let { store, dayjs, commomParams, richOption, ExclamationCircleOutlined, Modal } = useCommon();
- const dayjsRef = ref(dayjs);
- let props = defineProps(['form_state']);
- const emit = defineEmits();
- let state = ref<Boolean>(false)
- let basic = ref<Object>(null)
- let positionList = ref<Object[]>([])
- let areaList = ref<Object[]>([])
- let activeKey = ref<Number>(1)
- let areaForm = ref<JobseekerIntentionType.JobseekerIntentionAreaFormType>(dataAreaForm)
- let positionForm = ref<JobseekerIntentionType.JobseekerIntentionPositionFormType>(dataPositionForm)
- let basicForm = ref<JobseekerIntentionType.JobseekerIntentionBasicFormType>(dataBasicForm)
- let addOtherForm = ref<JobseekerIntentionType.OtherFormType>(otherDataForm)
-
- onMounted(() => {
- getBasic()
- getPosition()
- getArea()
- })
-
- const getBasic = () => {
- PostJobapplicantDesirebasedetail().then(res => {
- basic.value = res.data
- basicForm.value = intersectionAlike(basicForm.value, res.data)
- console.log(basicForm.value)
- basicForm.value.id = res.data.id;
- })
- }
-
- const getArea = () => {
- PostJobapplicantListdesirearea().then(res => {
- areaList.value = res.data.jobapplicantareas
- areaForm.value = intersectionAlike(areaForm.value, res.data)
- })
- }
-
- const getPosition = () => {
- PostJobapplicantListdesireindustry().then(res => {
- positionList.value = res.data.jobapplicantpositions
- positionForm.value = intersectionAlike(positionForm.value, res.data)
- })
- }
-
- // 意向地区
- const areaSave = (data) => {
- for (let i = 0; i < 4; i++) {
- areaForm.value[`level${i + 1}`] = data.arr1[i] || 0;
- }
-
- }
-
- // 保存意向地区
- const sumbitAreaForm = () => {
- if (areaForm.value.id) {
- PostJobapplicantUpdatedesirearea(areaForm.value).then(res => {
- successToast('保存成功');
- getArea();
- resetForm('area')
- }).catch(err => {
- })
- } else {
- PostJobapplicantAdddesirearea(areaForm.value).then(res => {
- successToast('保存成功');
- getArea();
- resetForm('area')
- }).catch(err => {
- })
- }
- }
-
- const toEdit = (item : Object) => {
- areaForm.value.id = item.id;
- getDetail(areaForm.value.id)
- emit("editEdit")
- }
-
- // 详情
- const getDetail = (val) => {
- PostJobapplicantDesireareadetail({ id: val }).then(res => {
- areaForm.value = intersectionAlike(areaForm.value, res.data)
- areaForm.value.id = res.data.id;
- for (var i = 1; i <= 4; i++) {
- if (res.data['level' + i]) {
- addOtherForm.value.area.push(res.data['level' + i]);
- }
- }
- })
- }
- const delArea = (id : number) => {
- commomParams.value.delParam = { id: id };
- PostJobapplicantDeldesirearea(commomParams.value.delParam).then(res => {
- successToast('删除成功');
- areaList.value = [];
- getArea();
- })
- }
- // 意向求职
- const positionSave = (data) => {
- for (let i = 0; i < 2; i++) {
- positionForm.value[`level${i + 1}`] = data.arr1[i] || 0;
- }
- console.log(positionForm.value)
- }
- const sumbitPositionForm = () => {
- if (positionForm.value.id) {
- PostJobapplicantUpdatedesireindustry(positionForm.value).then(res => {
- successToast('保存成功');
- getPosition();
- resetForm('position')
- }).catch(err => {
- })
- } else {
- PostJobapplicantAdddesireindustry(positionForm.value).then(res => {
- successToast('保存成功');
- getPosition();
- resetForm('position')
- }).catch(err => {
- })
- }
- }
-
- const toPositionEdit = (item : Object) => {
- positionForm.value.id = item.id;
- getPositionDetail(positionForm.value.id)
- activeKey.value = 2
- emit("editEdit")
- }
-
- // 详情
- const getPositionDetail = (val) => {
- PostJobapplicantDesireindustrydetail({ id: val }).then(res => {
- positionForm.value = intersectionAlike(positionForm.value, res.data)
- positionForm.value.id = res.data.id;
- for (var i = 1; i <= 2; i++) {
- if (res.data['level' + i]) {
- addOtherForm.value.position.push(res.data['level' + i]);
- }
- }
- })
- }
- const delPosition = (id : number) => {
- commomParams.value.delParam = { id: id };
- PostJobapplicantDeldesireindustry(commomParams.value.delParam).then(res => {
- successToast('删除成功');
- positionList.value = [];
- getPosition();
- })
- }
-
- // 求职类型
- const saveJobType = (data) => {
- basicForm.value.job_type = data.val.key;
- }
- // 人才类型
- const saveTalentType = (data) => {
- basicForm.value.talent_type = data.val.key;
- }
-
- // 工作经验
- const saveWorkExperience = (data) => {
- basicForm.value.work_experience = data.val.key;
- }
-
-
- // 月薪要求范围
- const saveSalaryRange = (data) => {
- basicForm.value.salary_range = data.val.key;
- }
- // 可到职日期
- const saveAvailableDate = (data) => {
- basicForm.value.available_date = data.val.key;
- }
- // 职称要求
- const saveTitleRequirement = (data) => {
- basicForm.value.title_requirement = data.val.key;
- }
-
- // 技能认证
- const saveSkillCertification = (data) => {
- basicForm.value.skill_certification = data.val.key;
- }
-
- // 食宿要求
- const saveAccommodationRequirement = (data) => {
- basicForm.value.accommodation_requirement = data.val.key;
- }
-
- // 节假日休息情况
- const saveHolidayRest = (data) => {
- basicForm.value.holiday_rest = data.val.key;
- }
-
- const sumbitBasicForm = () => {
- if (basicForm.value.id) {
- PostJobapplicantUpdatedesirebase(basicForm.value).then(res => {
- successToast('保存成功');
- getBasic();
- resetForm('basic')
- }).catch(err => {
- })
- } else {
- PostJobapplicantAdddesirebase(basicForm.value).then(res => {
- successToast('保存成功');
- getBasic();
- resetForm('basic')
- }).catch(err => {
- })
- }
- }
-
- const toBasicEdit = (item : Object) => {
- getBasic()
- activeKey.value = 3
- emit("editEdit")
- }
-
- const delBasic = (id : number) => {
- commomParams.value.delParam = { id: id };
- PostJobapplicantDeldesirebase(commomParams.value.delParam).then(res => {
- successToast('删除成功');
- basic.value = null;
- getBasic();
- })
- }
-
-
- const resetForm = (val) => {
- if (val == 'area') {
- areaForm.value = reset().dataAreaForm as JobseekerIntentionType.JobseekerIntentionAreaFormType;
- }
- if (val == 'position') {
- positionForm.value = reset().dataPositionForm as JobseekerIntentionType.JobseekerIntentionPositionFormType;
- }
- if (val == 'basic') {
- basicForm.value = reset().dataBasicForm as JobseekerIntentionType.JobseekerIntentionBasicFormType;
- }
- addOtherForm.value = reset().otherDataForm as JobseekerIntentionType.OtherFormType;
- state.value = false;
- emit("quitEdit")
- }
-
- watch(() => [props.form_state], (newVal) => {
- state.value = newVal[0];
- getBasic();
- getPosition();
- getArea();
- })
- </script>
-
- <style>
- </style>
|