123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959 |
- <template>
- <div class="card-edit">
- <a-form :model="dataModel" autocomplete="off" @finish="onFinish">
- <a-divider orientation="left">求职人员信息</a-divider>
- <a-row :gutter="24">
- <a-col :span="8">
- <a-form-item label="姓名" :label-col="{ span: 6 }"
- name="name" :rules="[{ required: true, message: '请输入姓名!' }]">
- <a-input v-model:value="dataModel.name" placeholder=""/>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item label="身份证号码" :label-col="{ span: 6 }"
- name="identityNumber" :rules="[{ required: true, message: '请输入身份证号码!' }]" >
- <a-input v-model:value="dataModel.identityNumber" placeholder="" @change="onIdentityNumberChange()"/>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item label="性别" :label-col="{span:6}"
- name="sex" :rules="[{ required: true, message: '请选择性别!' }]">
- <a-select
- ref="select" disabled
- v-model:value="dataModel.sex"
- :options="genderList"
- :field-names="{ label: 'name', value: 'value' }"
- :allow-clear="true"
- >
- </a-select>
- </a-form-item>
- </a-col>
- </a-row>
- <a-row :gutter="24">
- <a-col :span="8">
- <a-form-item label="重点人员类别" :label-col="{span:6}" name="keyPersonTypeID"
- :rules="[{ required: true, message: '请选择重点人员类别!' }]">
- <a-select
- ref="select"
- v-model:value="dataModel.keyPersonTypeID"
- :options="keyPersonTypeList"
- :field-names="{ label: 'name', value: 'value' }"
- :allow-clear="true"
- >
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item label="就业状态" :label-col="{span:6}" name="jobStatusID"
- :rules="[{ required: true, message: '请选择就业状态!' }]">
- <a-select
- ref="select"
- v-model:value="dataModel.jobStatusID"
- :options="jobStatusList"
- :field-names="{ label: 'name', value: 'value' }"
- :allow-clear="true"
- >
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item label="所属驿站" :label-col="{span:6}" name="siteID"
- :rules="[{ required: true, message: '请选择所属驿站!' }]">
- <a-select
- ref="select"
- v-model:value="dataModel.siteID"
- :options="siteList"
- :field-names="{ label: 'siteName', value: 'siteID' }"
- :allow-clear="true"
- >
- </a-select>
- </a-form-item>
- </a-col>
- </a-row>
- <a-row :gutter="24">
- <a-col :span="8">
- <a-form-item
- label="联系人"
- :label-col="{ span: 6 }"
- name="userName">
- <a-input v-model:value="dataModel.userName" placeholder=""/>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item label="联系电话" :label-col="{ span: 6 }"
- name="userMobile" :rules="[{ required: true,message: '请输入联系电话!' }]">
- <a-input v-model:value="dataModel.userMobile" placeholder=""/>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item
- label="地址"
- :label-col="{ span: 6 }"
- name="address"
- :rules="[{ required: true, message: '请输入地址!' }]"
- >
- <a-input v-model:value="dataModel.address" placeholder=""/>
- </a-form-item>
- </a-col>
- </a-row>
- <a-row :gutter="24">
- <a-col :span="8">
- <a-form-item
- label="籍贯"
- :label-col="{ span: 6 }"
- name="nativePlace">
- <a-input v-model:value="dataModel.nativePlace" placeholder=""/>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- </a-col>
- <a-col :span="8">
- </a-col>
- </a-row>
- <a-divider orientation="left">其它信息</a-divider>
- <a-row :gutter="24">
- <a-col :span="8">
- <a-form-item label="社会保障卡号" :label-col="{ span: 6 }" name="socialSecurityCard">
- <a-input v-model:value="dataModel.socialSecurityCard" placeholder=""/>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item label="毕业院校" :label-col="{span:6}" name="finishSchool">
- <a-input v-model:value="dataModel.finishSchool" placeholder=""/>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item label="专业" :label-col="{ span: 6 }" name="profession">
- <a-input v-model:value="dataModel.profession" placeholder=""/>
- </a-form-item>
- </a-col>
- </a-row>
- <a-row :gutter="24">
- <a-col :span="8">
- <a-form-item label="是否全日制" :label-col="{ span: 6 }" name="socialSecurityCard">
- <a-select ref="select" v-model:value="dataModel.isFullTime" :options="isFullTimeList"
- :field-names="{ label: 'name', value: 'value' }" :allow-clear="false"></a-select>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item label="职业资格类别" :label-col="{span:6}" name="occupationalCategoryName">
- <a-cascader :load-data="loadLevelOccupationalCategoryList"
- v-model:value="dataModel.occupationalCategoryName"
- :options="occupationalCategoryList" change-on-select @change="occupationalChange">
- </a-cascader>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item label="职业资格等级" :label-col="{ span: 6 }" name="profession">
- <a-select ref="select" v-model:value="dataModel.occupationalLevel" :options="occupationalLevelList"
- :field-names="{ label: 'name', value: 'value' }" :allow-clear="false"></a-select>
- </a-form-item>
- </a-col>
- </a-row>
- <a-row :gutter="24">
- <a-col :span="8">
- <a-form-item label="民族" :label-col="{ span: 6 }" name="nation">
- <a-select
- ref="select"
- v-model:value="dataModel.nation"
- :options="nationList"
- :field-names="{ label: 'name', value: 'value' }"
- :allow-clear="true"
- ></a-select>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item label="政治面貌" :label-col="{span:6}" name="politicsStatusID">
- <a-select
- ref="select"
- v-model:value="dataModel.politicsStatusID"
- :options="politicsStatusList"
- :field-names="{ label: 'name', value: 'value' }"
- :allow-clear="true"
- >
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item label="出生地" :label-col="{ span: 6 }" name="birthPlace">
- <a-input v-model:value="dataModel.birthPlace" placeholder=""/>
- </a-form-item>
- </a-col>
- </a-row>
- <a-row :gutter="24">
- <a-col :span="8">
- <a-form-item label="出生日期" :label-col="{ span: 6 }" name="birthDay" >
- <a-date-picker disabled
- v-model:value="dataModel.birthDay"
- picker="date"
- value-format="YYYY-MM-DD"/>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item label="户口性质" :label-col="{span:6}" name="familyNatureID" >
- <a-select
- ref="select"
- v-model:value="dataModel.familyNatureID"
- :options="familyNatureList"
- :field-names="{ label: 'name', value: 'value' }"
- :allow-clear="true"
- >
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item label="最高学历" :label-col="{span:6}" name="cultureRank">
- <a-select
- ref="select"
- v-model:value="dataModel.cultureRank"
- :options="cultureList"
- :field-names="{ label: 'name', value: 'value' }"
- :allow-clear="true"
- >
- </a-select>
- </a-form-item>
- </a-col>
- </a-row>
- <a-row :gutter="24">
- <a-col :span="8">
- <a-form-item label="健康状况" :label-col="{span:6}" name="healthID">
- <a-select
- ref="select"
- v-model:value="dataModel.healthID"
- :options="healthList"
- :field-names="{ label: 'name', value: 'value' }"
- :allow-clear="true"
- >
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item label="婚姻状况" :label-col="{span:6}" name="maritalStatusID">
- <a-select
- ref="select"
- v-model:value="dataModel.maritalStatusID"
- :options="maritalStatusList"
- :field-names="{ label: 'name', value: 'value' }"
- :allow-clear="true"
- >
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item
- label="电子邮箱"
- :label-col="{ span: 6 }"
- name="email">
- <a-input v-model:value="dataModel.email" placeholder=""/>
- </a-form-item>
- <!-- <a-form-item-->
- <!-- label="血型"-->
- <!-- :label-col="{ span: 6 }"-->
- <!-- name="bloodTypeID" >-->
- <!-- <a-select-->
- <!-- ref="select"-->
- <!-- v-model:value="dataModel.bloodTypeID"-->
- <!-- :options="bloodTypeList"-->
- <!-- :field-names="{ label: 'name', value: 'value' }"-->
- <!-- :allow-clear="true"-->
- <!-- >-->
- <!-- </a-select>-->
- <!-- </a-form-item>-->
- </a-col>
- </a-row>
- <a-row :gutter="24">
- <a-col :span="8">
- <a-form-item
- label="身高"
- :label-col="{ span: 6 }"
- name="height">
- <a-input v-model:value="dataModel.height" placeholder="" suffix="cm"/>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item
- label="体重"
- :label-col="{ span: 6 }"
- name="weight" >
- <a-input v-model:value="dataModel.weight" placeholder="" suffix="kg"/>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item
- label="视力"
- :label-col="{ span: 6 }"
- name="vision">
- <a-input v-model:value="dataModel.vision" placeholder=""/>
- </a-form-item>
- </a-col>
- </a-row>
- <a-row :gutter="24">
- <a-col :span="8">
- <a-form-item label="省份" :label-col="{span:6}" name="provinceCode">
- <a-select
- ref="select"
- v-model:value="dataModel.provinceCode"
- :options="provinceList"
- :field-names="{ label: 'name', value: 'code' }"
- :allow-clear="true"
- >
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item label="市/县" :label-col="{span:6}" name="regionCode">
- <a-select
- ref="select"
- v-model:value="dataModel.regionCode"
- :options="regionList"
- :field-names="{ label: 'name', value: 'code' }"
- :allow-clear="true"
- @change="regionChange"
- >
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <a-form-item label="镇街" :label-col="{span:6}" name="streetCode">
- <a-select
- ref="select"
- v-model:value="dataModel.streetCode"
- :options="streetList"
- :field-names="{ label: 'name', value: 'code' }"
- :allow-clear="true"
- >
- </a-select>
- </a-form-item>
- </a-col>
- </a-row>
- <a-row :gutter="24">
- <a-col :span="8">
- <a-form-item
- label="家庭住址"
- :label-col="{ span: 6 }"
- name="familyAddress" >
- <a-input v-model:value="dataModel.familyAddress" placeholder=""/>
- </a-form-item>
- </a-col>
- <a-col :span="8">
- <!-- <a-form-item-->
- <!-- label="邮政编码"-->
- <!-- :label-col="{ span: 6 }"-->
- <!-- name="postalCode">-->
- <!-- <a-input v-model:value="dataModel.postalCode" placeholder=""/>-->
- <!-- </a-form-item>-->
- </a-col>
- <a-col :span="8">
- </a-col>
- </a-row>
- <a-row :gutter="24">
- <a-col :span="16">
- <a-form-item label="兴趣爱好" :label-col="{ span: 3}" name="hobby" >
- <a-textarea v-model:value="dataModel.hobby" placeholder="兴趣爱好" :rows="2" />
- </a-form-item>
- </a-col>
- </a-row>
- <a-row :gutter="24">
- <a-col :span="16">
- <a-form-item label="个人技能" :label-col="{ span: 3 }" name="personalSkills" >
- <a-textarea v-model:value="dataModel.personalSkills" placeholder="个人技能" :rows="4" />
- </a-form-item>
- </a-col>
- </a-row>
- <a-row :gutter="24">
- <a-col :span="24">
- <a-form-item label="标签" :label-col="{ span: 2 }" name="listLabel" >
- <a-button style="margin: 0px 5px 5px 0px;color: black;border: 1px solid rgb(217, 217, 217);" v-for="item in dataModel.listLabel">
- {{ item.labelName }}
- </a-button>
- <a-button @click="onSelectModel">
- <plus-circle-outlined/>选择标签
- </a-button>
- </a-form-item>
- </a-col>
- </a-row>
- <a-row>
- <a-col :span="24" style="text-align: right; margin-top: 20px; margin-right: 20px">
- <Space>
- <a-button @click="addEducation">
- <template #icon>
- <plus-circle-outlined/>
- </template>
- 新增
- </a-button>
- </Space>
- </a-col>
- </a-row>
- <a-divider orientation="left">教育经历</a-divider>
- <a-row>
- <a-col style="margin-bottom: 20px;">
- <a-table :columns="educationColumns" :data-source="educationData" :pagination="false" bordered>
- <template #bodyCell="{ column ,index}">
- <template v-if="column.key === 'schoolName'">
- <div>
- <a-input v-model:value="educationData[index][column.key]" style="width: 200px" />
- </div>
- </template>
- <template v-if="column.key === 'cultureRank'">
- <div>
- <a-select
- ref="select"
- v-model:value="educationData[index][column.key]"
- :options="cultureList"
- :field-names="{ label: 'name', value: 'value' }"
- :allow-clear="false" style="width: 200px" >
- </a-select>
- </div>
- </template>
- <template v-if="column.key === 'schoolTime'">
- <div>
- <a-date-picker
- v-model:value="educationData[index][column.key]"
- picker="date" :allow-clear="false"
- value-format="YYYY-MM-DD"
- />
- </div>
- </template>
- <template v-if="column.key === 'overTime'">
- <div>
- <a-date-picker
- v-model:value="educationData[index][column.key]"
- picker="date" :allow-clear="false"
- value-format="YYYY-MM-DD"
- />
- </div>
- </template>
- <template v-if="column.key === 'major'">
- <div>
- <a-input
- v-model:value="educationData[index][column.key]" style="width: 200px"
- />
- </div>
- </template>
- <template v-if="column.key === 'educationOperation'">
- <a-button type="link" size="small" @click="delEducation(index)">删除</a-button>
- </template>
- </template>
- </a-table>
- </a-col>
- </a-row>
- <a-row>
- <a-col :span="24" style="text-align: right; margin-top: 20px; margin-right: 20px">
- <Space>
- <a-button @click="addExperience">
- <template #icon>
- <plus-circle-outlined/>
- </template>
- 新增
- </a-button>
- </Space>
- </a-col>
- </a-row>
- <a-divider orientation="left">工作经历</a-divider>
- <a-row>
- <a-col style="margin-bottom: 20px;">
- <a-table :columns="experienceColumns" :data-source="experienceData" :pagination="false"
- bordered>
- <template #bodyCell="{ column ,index}">
- <template v-if="column.key === 'startTime'">
- <div>
- <a-date-picker v-model:value="experienceData[index][column.key]"
- picker="date" value-format="YYYY-MM-DD" :allow-clear="false" />
- </div>
- </template>
- <template v-if="column.key === 'endTime'">
- <div>
- <a-date-picker v-model:value="experienceData[index][column.key]"
- picker="date" value-format="YYYY-MM-DD" :allow-clear="false" />
- </div>
- </template>
- <template v-if="column.key === 'workAddress'">
- <div>
- <a-input
- v-model:value="experienceData[index][column.key]" style="width: 200px"
- />
- </div>
- </template>
- <template v-if="column.key === 'duties'">
- <div>
- <a-input
- v-model:value="experienceData[index][column.key]" style="width: 200px"
- />
- </div>
- </template>
- <template v-if="column.key === 'experienceOperation'">
- <a-button type="link" size="small" @click="deleteExperience(index)">删除</a-button>
- </template>
- </template>
- </a-table>
- </a-col>
- </a-row>
- <a-form-item class="buttom-btns">
- <a-button @click="onClose">取消</a-button>
- <a-button type="primary" html-type="submit">提交</a-button>
- </a-form-item>
- </a-form>
- <select-label ref="refSelectModel" :list-label="dataModel.listLabel" :big-type="2" @selectLabelChecks="selectLabelChecks"></select-label>
- </div>
- </template>
- <script lang="ts">
- import {defineComponent, reactive, ref, toRefs} from 'vue';
- import type {SelectProps, TableColumnsType} from 'ant-design-vue';
- import {message} from "ant-design-vue";
- import {useTabsViewStore} from '@/store/modules/tabsView';
- import BUploadFile from '@/components/file/uploadFile.vue';
- import {get} from "@/api/common";
- import {getSysDictionaryList} from '@/api/system/dictionary';
- import {getDataById, getEducationList, getExperienceList, save} from '@/api/jobUserManager/jobuser';
- import {getSiteList} from "@/api/baseSettings/siteInfo";
- import {getInfo} from "@/api/account";
- import dayjs from "dayjs";
- import SelectLabel from "@/views/baseSettings/label/selectLabel.vue";
- interface FormState {
- dataModel: any;
- }
- export default defineComponent(
- {
- components: {BUploadFile,SelectLabel},
- setup() {
- // const router = useRouter();
- const isAllowCommit = ref(true);
- const refSelectModel = ref();
- const formState = reactive<FormState>({dataModel: {}});
- const formTableState = reactive({loading: false});
- const searchParams = reactive({
- pageIndex: 1,
- pageSize: 99
- });
- const provinceList = ref<SelectProps['options']>([{name: '广东省', code: '440000000000000'}]);
- const siteList = ref<any>([]);
- const genderList = ref<SelectProps['options']>();
- const keyPersonTypeList = ref<SelectProps['options']>();
- const jobStatusList = ref<SelectProps['options']>();
- const maritalStatusList = ref<SelectProps['options']>();
- const healthList = ref<SelectProps['options']>();
- const bloodTypeList = ref<SelectProps['options']>();
- const cultureList = ref<SelectProps['options']>();
- const politicsStatusList = ref<SelectProps['options']>();
- const regionList = ref<SelectProps['options']>();
- const streetList = ref<SelectProps['options']>();
- const familyNatureList = ref<SelectProps['options']>();
- const nationList = ref<SelectProps['options']>();
- const isFullTimeList = ref<SelectProps["options"]>();
- const occupationalCategoryList = ref<SelectProps["options"]>();
- const occupationalLevelList = ref<SelectProps["options"]>();
- const educationData = ref([]);
- const educationColumns: TableColumnsType = [
- {
- title: '序号',
- align: "center",
- key: 'educationID',
- width: 120,
- customRender: item => `${searchParams.pageSize * (searchParams.pageIndex - 1) + item.index + 1}`
- },
- {
- title: '学校名',
- dataIndex: 'schoolName',
- key: 'schoolName',
- align: "center",
- width: 120
- },
- {
- title: '最高学历',
- dataIndex: 'cultureRank',
- key: 'cultureRank',
- align: "center",
- width: 120
- },
- {
- title: '就读时间',
- dataIndex: 'schoolTime',
- key: 'schoolTime',
- align: "center",
- width: 120
- },
- {
- title: '毕业时间',
- dataIndex: 'overTime',
- key: 'overTime',
- align: "center",
- width: 120
- },
- {
- title: '专业',
- dataIndex: 'major',
- key: 'major',
- align: "center",
- width: 120
- },
- {title: '操作', key: 'educationOperation', fixed: 'right', width: 120, align: "center"},
- ];
- // const fullpath = router.currentRoute.value.fullPath;
- const tabsViewStore = useTabsViewStore();
- const isEdit = true;
- const fileList = ref();
- const setFileList = (files) => {
- fileList.value = files;
- };
- const onIdentityNumberChange =()=>{
- const identReg = /^[1-9]{1}[0-9]{14}$|^[1-9]{1}[0-9]{16}([0-9]|[xX])$/;
- if(formState.dataModel.identityNumber.match(identReg)&&formState.dataModel.identityNumber.length==18){
- const birthDayStr = String(formState.dataModel.identityNumber).substring(6,14);
- const sexStr = String(formState.dataModel.identityNumber).substring(16,17);
- formState.dataModel.sex = parseInt(sexStr)%2 == 0 ? 2 : 1; //双女单男
- formState.dataModel.birthDay = dayjs(birthDayStr).format("YYYY-MM-DD");
- }
- }
- const inputDataValidate = () =>{
- isAllowCommit.value = true;
- const identReg = /^[1-9]{1}[0-9]{14}$|^[1-9]{1}[0-9]{16}([0-9]|[xX])$/;
- if(!formState.dataModel.identityNumber.match(identReg)){
- message.error("输入的身份证号码有误!");
- isAllowCommit.value = false;
- }
- const mobileReg = /^1[3|4|5|6|7|8|9]\d{9}$/;
- if(!mobileReg.test(formState.dataModel.userMobile)){
- message.error("输入的联系电话有误!");
- isAllowCommit.value = false;
- }
- const emailReg = /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
- if(formState.dataModel.email!=null && formState.dataModel.email.trim()!==""){
- if(!emailReg.test(formState.dataModel.email)){
- message.error("输入的电子邮箱有误!");
- isAllowCommit.value = false;
- }
- }
- };
- const getAllSites = () => {
- getSiteList({pageIndex:1,pageSize:9999}).then((result :any) => {
- siteList.value = result.list;
- })
- }
- const getHealthList = () => {
- getSysDictionaryList('Health').then((data) => {
- healthList.value = data;
- });
- };
- const getGenderList = () => {
- getSysDictionaryList('Gender').then((data) => {
- genderList.value = data;
- });
- };
- const getCultureList = () => {
- getSysDictionaryList('HighestDegree').then((data) => {
- cultureList.value = data;
- });
- };
- const getJobStatusList = () => {
- getSysDictionaryList('JobStatus').then((data) => {
- jobStatusList.value = data;
- });
- };
- const getNationList = () => {
- getSysDictionaryList('NationType').then((data) => {
- nationList.value = data;
- });
- };
- const getBloodTypeList = () => {
- getSysDictionaryList('BloodType').then((data) => {
- bloodTypeList.value = data;
- });
- };
- const getFamilyNatureList = () => {
- getSysDictionaryList('FamilyNature').then((data) => {
- familyNatureList.value = data;
- });
- };
- const getKeyPersonTypeList = () => {
- getSysDictionaryList('KeyPersonType').then((data) => {
- keyPersonTypeList.value = data;
- });
- };
- const getMaritalStatusList = () => {
- getSysDictionaryList('MaritalStatus').then((data) => {
- maritalStatusList.value = data;
- });
- };
- const getPoliticsStatusList = () => {
- getSysDictionaryList('PoliticsStatus').then((data) => {
- politicsStatusList.value = data;
- });
- };
- const getIsFullTimeList = async function () {
- const result: any = await getSysDictionaryList("IsFullTime");
- isFullTimeList.value = result;
- }
- const getOccupationalLevelList = async function () {
- const result: any = await getSysDictionaryList("OccupationalLevel");
- occupationalLevelList.value = result;
- }
- get('system/area/getCityList', {}).then(data => {
- regionList.value = data;
- });
- const changeCity = () => {
- if (formState.dataModel.regionCode) {
- get('system/area/getAreaList', {code: formState.dataModel.regionCode}).then(data => {
- streetList.value = data;
- // formState.dataModel.streetCode = "";
- })
- }
- }
- const regionChange = async function () {
- formState.dataModel.streetCode = null;
- changeCity();
- }
- const loadEducation = (id: any) => {
- getEducationList(id).then(data => {
- if (data)
- educationData.value = data;
- });
- }
- const addEducation = () => {
- (educationData.value as any[]).push({
- schoolName: '',
- cultureRank: null,
- schoolTime: null,
- overTime: null,
- major: ''
- });
- }
- const delEducation = (record) => {
- (educationData.value as any[]).splice(record, 1);
- }
- const experienceColumns: TableColumnsType = [
- {
- title: '序号',
- align: "center",
- key: 'experienceID',
- width: 120,
- customRender: item => `${searchParams.pageSize * (searchParams.pageIndex - 1) + item.index + 1}`
- },
- {
- title: '开始时间',
- dataIndex: 'startTime',
- key: 'startTime',
- align: "center",
- width: 120
- },
- {
- title: '结束时间',
- dataIndex: 'endTime',
- key: 'endTime',
- align: "center",
- width: 120
- },
- {
- title: '工作单位',
- dataIndex: 'workAddress',
- key: 'workAddress',
- align: "center",
- width: 120
- },
- {
- title: '职务',
- dataIndex: 'duties',
- key: 'duties',
- align: "center",
- width: 120
- },
- {title: '操作', key: 'experienceOperation', fixed: 'right', width: 120, align: "center"},
- ]
- const experienceData = ref([]);
- const loadExperienceData = (id: any) => {
- getExperienceList(id).then(data => {
- if (data) {
- experienceData.value = data;
- }
- })
- }
- const deleteExperience = (record) => {
- (experienceData.value as any[]).splice(record, 1);
- }
- const addExperience = () => {
- (experienceData.value as any[]).push({
- startTime: null,
- endTime: null,
- workAddress: null,
- duties: null,
- });
- }
- const onClose = (reload: any) => {
- tabsViewStore.closeCurrentTabByPath('/jobusermgr/jobseeker/add');
- tabsViewStore.closeCurrentTabByPath('/jobusermgr/jobseeker/edit');
- tabsViewStore.openTab('/jobusermgr/jobseeker/index', {reload: reload});
- };
- const onFinish = () => {
- inputDataValidate();
- if(isAllowCommit.value){
- formState.dataModel.jobEducation = educationData.value;
- formState.dataModel.jobExperience = experienceData.value;
- save(formState.dataModel).then(result => {
- if (result) {
- onClose(1)
- }
- });
- }
- }
- const getFirstOccupationalList = () => {
- get("occupational/getFirstOccupationalList", null).then(data => {
- occupationalCategoryList.value = (data as any[]).map((x) => {
- return {
- label: x.name,
- value: x.code,
- isLeaf: false,
- tag: 'firstLevel'
- }
- });
- });
- }
- const loadLevelOccupationalCategoryList = (selectedOptions) => {
- let targetOption = selectedOptions[selectedOptions.length - 1];
- if (targetOption) {
- get("occupational/getListByParentOccupationalID", {parentOccupationalID: targetOption.value}).then(data => {
- targetOption.loading = false;
- targetOption.children = (data as any[]).map((x) => {
- return {
- label: x.name,
- value: x.code,
- isLeaf: true,
- tag: 'secondLevel'
- };
- });
- });
- formState.dataModel.hasOccupational = false;
- }
- };
- // 职业资格选择变更事件
- function occupationalChange(value: any, selectedOptions: any) {
- if (value.length >= 2) {
- formState.dataModel.occupationalCategory = selectedOptions[1].value;
- formState.dataModel.occupationalCategoryName = selectedOptions[1].label;
- } else {
- formState.dataModel.occupationalCategory = "";
- formState.dataModel.occupationalCategoryName = "";
- }
- }
- const onSelectModel = ()=>{
- refSelectModel.value.show();
- }
- const selectLabelChecks = (list: any)=>{
- formState.dataModel.listLabel = list;
- }
- const loadData = (id: any) => {
- getAllSites();
- getHealthList();
- getGenderList();
- getCultureList();
- getJobStatusList();
- getNationList();
- getBloodTypeList();
- getFamilyNatureList();
- getKeyPersonTypeList();
- getMaritalStatusList();
- getPoliticsStatusList();
- getIsFullTimeList()
- getOccupationalLevelList()
- getFirstOccupationalList()
- getInfo().then((loginUserInfo:any)=>{
- getDataById(id,loginUserInfo.userID,null).then(data => {
- formState.dataModel = data;
- if (formState.dataModel.regionCode) {
- changeCity();
- }
- });
- });
- };
- return {
- ...toRefs(formState),
- isEdit,
- loadData,
- onClose,
- onFinish,
- setFileList,
- addEducation,
- delEducation,
- loadEducation,
- inputDataValidate,
- onIdentityNumberChange,
- onSelectModel,
- selectLabelChecks,
- refSelectModel,
- siteList,
- regionList,
- streetList,
- cultureList,
- genderList,
- healthList,
- jobStatusList,
- provinceList,
- bloodTypeList,
- maritalStatusList,
- familyNatureList,
- formState,
- educationData,
- experienceData,
- formTableState,
- keyPersonTypeList,
- politicsStatusList,
- changeCity,
- regionChange,
- loadExperienceData,
- deleteExperience,
- addExperience,
- experienceColumns,
- educationColumns,
- nationList,
- isFullTimeList,
- occupationalCategoryList,
- occupationalLevelList,
- loadLevelOccupationalCategoryList,
- occupationalChange
- }
- },
- created() {
- const id = history.state.params?.id;
- this.loadData(id);
- if (id) {
- this.loadEducation(id);
- this.loadExperienceData(id);
- }
- }
- })
- </script>
|