|
@@ -0,0 +1,137 @@
|
|
|
+<template>
|
|
|
+ <add :after-add="afterAdd" :valid="validate">
|
|
|
+ <template #timeline>
|
|
|
+ <v-timeline-item
|
|
|
+ dot-color="light-blue darken-1"
|
|
|
+ icon="mdi-numeric-3"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <h2 class="mt-n1 headline font-weight-regular">{{ t('common.other') }}</h2>
|
|
|
+ <CtForm ref="formPageRef" class="mt-3" :items="items" style="width: 650px;">
|
|
|
+ <template #frequency>
|
|
|
+ <div class="pl-3">111</div>
|
|
|
+ </template>
|
|
|
+ </CtForm>
|
|
|
+ </div>
|
|
|
+ </v-timeline-item>
|
|
|
+ </template>
|
|
|
+ </add>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+defineOptions({ name: 'editJob' })
|
|
|
+import { ref, watch, computed } from 'vue'
|
|
|
+import { useRoute, useRouter } from 'vue-router'
|
|
|
+import CtForm from '@/components/CtForm'
|
|
|
+import Add from '@/views/recruit/enterprise/positionManagement/components/add.vue'
|
|
|
+import { useI18n } from '@/hooks/web/useI18n'
|
|
|
+import { schoolMajorByName } from '@/api/recruit/personal/resume'
|
|
|
+import { saveJobAdvertisedExtend, joinJobFairPosition } from '@/api/recruit/enterprise/jobFair'
|
|
|
+import Snackbar from '@/plugins/snackbar'
|
|
|
+
|
|
|
+const { t } = useI18n()
|
|
|
+const route = useRoute()
|
|
|
+const router = useRouter()
|
|
|
+
|
|
|
+const formPageRef = ref(null)
|
|
|
+
|
|
|
+const items = ref({
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ type: 'text',
|
|
|
+ key: 'dept',
|
|
|
+ value: null,
|
|
|
+ label: '招聘部门 *',
|
|
|
+ rules: [v => !!v || '请选择招聘部门']
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'autocomplete',
|
|
|
+ key: 'majorId',
|
|
|
+ search: getMajorList,
|
|
|
+ value: null,
|
|
|
+ label: '专业要求 *',
|
|
|
+ itemText: 'nameCn',
|
|
|
+ itemValue: 'id',
|
|
|
+ rules: [v => !!v || '专业要求'],
|
|
|
+ noDataText: '请输入检索专业',
|
|
|
+ items: []
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'autocomplete',
|
|
|
+ key: 'frequency-dateType',
|
|
|
+ value: null,
|
|
|
+ label: '工作频率 *',
|
|
|
+ col: 6,
|
|
|
+ rules: [v => !!v || '请选择工作频率'],
|
|
|
+ items: [
|
|
|
+ { label: '每周', value: 'week' },
|
|
|
+ { label: '每月', value: 'month' },
|
|
|
+ { label: '每年', value: 'year' },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'number',
|
|
|
+ key: 'frequency-day',
|
|
|
+ value: null,
|
|
|
+ flexStyle: 'ml-3',
|
|
|
+ col: 6,
|
|
|
+ label: '出勤天数 *',
|
|
|
+ rules: [v => v > 0 || '请填写正确的出勤天数']
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'ifRadio',
|
|
|
+ key: 'hot',
|
|
|
+ value: 1,
|
|
|
+ label: '热门职位 *',
|
|
|
+ items: [
|
|
|
+ { label: '是', value: 1 },
|
|
|
+ { label: '否', value: 0 },
|
|
|
+ ],
|
|
|
+ rules: [v => !!v || '请选择是否热门']
|
|
|
+ },
|
|
|
+ ]
|
|
|
+})
|
|
|
+
|
|
|
+async function getMajorList (name) {
|
|
|
+ if (!name) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const res = await schoolMajorByName({ name })
|
|
|
+ items.value.options.find(e => e.key === 'majorId').items = res
|
|
|
+}
|
|
|
+
|
|
|
+const validate = async () => {
|
|
|
+ const res = await formPageRef.value.formRef.validate()
|
|
|
+ return res
|
|
|
+}
|
|
|
+const afterAdd = async (jobId) => {
|
|
|
+ try {
|
|
|
+ const query = items.value.options.reduce((r, v) => {
|
|
|
+ if (v.key.includes('frequency')) {
|
|
|
+ const keys = v.key.split('-')
|
|
|
+ if (!r[keys[0]]) {
|
|
|
+ r[keys[0]] = {}
|
|
|
+ }
|
|
|
+ r[keys[0]][keys[1]] = v.type === 'number' ? +v.value : v.value
|
|
|
+ return r
|
|
|
+ }
|
|
|
+ r[v.key] = v.type === 'number' ? +v.value : v.value
|
|
|
+ return r
|
|
|
+ }, { jobId })
|
|
|
+ await saveJobAdvertisedExtend(query)
|
|
|
+ console.log('招聘会职位扩展信息保存成功')
|
|
|
+ await joinJobFairPosition({
|
|
|
+ jobFairId: route.params.jobFairId,
|
|
|
+ jobId
|
|
|
+ })
|
|
|
+ Snackbar.success(t('common.publishSuccessMsg'))
|
|
|
+ router.push(`/recruit/enterprise/jobFair/details/${route.params.jobFairId}`)
|
|
|
+ } catch (error) {
|
|
|
+ Snackbar.error(t('sys.api.operationFailed'))
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+
|
|
|
+</style>
|