|
|
|
|
|
|
|
|
<template> |
|
|
<template> |
|
|
|
|
|
|
|
|
<template v-if="detail"> |
|
|
<template v-if="detail"> |
|
|
<a-page-header> |
|
|
<a-page-header> |
|
|
<template #title> |
|
|
<template #title> |
|
|
|
|
|
|
|
|
</a-button> |
|
|
</a-button> |
|
|
</template> |
|
|
</template> |
|
|
<a-card style="width: 100%"> |
|
|
<a-card style="width: 100%"> |
|
|
<a-card-meta :title="detail.title" > |
|
|
|
|
|
|
|
|
<a-card-meta :title="detail.title"> |
|
|
<template #description> |
|
|
<template #description> |
|
|
<div> |
|
|
<div> |
|
|
开始时间: {{detail.open_date}} |
|
|
开始时间: {{detail.open_date}} |
|
|
|
|
|
|
|
|
<div v-html="detail.content"></div> |
|
|
<div v-html="detail.content"></div> |
|
|
</a-card> |
|
|
</a-card> |
|
|
<div class="company-box"> |
|
|
<div class="company-box"> |
|
|
<a-typography> |
|
|
|
|
|
<a-typography-title :level="5" v-if="companyList && companyList.length > 0">参与的企业({{companyList.length}}家)</a-typography-title> |
|
|
|
|
|
<a-typography-paragraph> |
|
|
|
|
|
<a-row :gutter="[10,10]" v-if="companyList && companyList.length > 0"> |
|
|
|
|
|
<a-col v-for="(item, index) in companyList"> |
|
|
|
|
|
<div style="color: #808080" @click="toCompanyDetail(item.company_id)">{{item.company_name}}</div> |
|
|
|
|
|
</a-col> |
|
|
|
|
|
</a-row> |
|
|
|
|
|
<div style="color: #808080" v-else>暂无企业</div> |
|
|
|
|
|
</a-typography-paragraph> |
|
|
|
|
|
</a-typography> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a-space direction="vertical" style="width: 100%"> |
|
|
|
|
|
<table id="company-box" border="1" style="border-collapse: collapse;width: 100%;text-align: center;"> |
|
|
|
|
|
<thead> |
|
|
|
|
|
<th style="height: 44px;width: 50%;">参与企业</th> |
|
|
|
|
|
<th style="height: 44px;width: 50%;">参与职位</th> |
|
|
|
|
|
</thead> |
|
|
|
|
|
<template v-if="companyList && companyList.length > 0"> |
|
|
|
|
|
<tbody v-for="(item, index) in companyList" :key="index"> |
|
|
|
|
|
<tr v-if="item.company_name"> |
|
|
|
|
|
<td :rowspan="item.jobs.length > 1 ? item.jobs.length : 1" style="height: 36px;"> |
|
|
|
|
|
<a-button type="link" |
|
|
|
|
|
@click="toCompanyDetail(item.company_id)">{{item.company_name}}</a-button> |
|
|
|
|
|
</td> |
|
|
|
|
|
<td v-if="item.jobs.length > 0" style="height: 36px;"> |
|
|
|
|
|
<a-button type="link" |
|
|
|
|
|
@click="toJobDetail(item.jobs[0].id, item.company_id)">{{item.jobs[0].name}}</a-button> |
|
|
|
|
|
</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
<template v-if="item.jobs.length > 1"> |
|
|
|
|
|
<tr v-for="(itemJob, indexJob) in item.jobs" :key="indexJob" v-if="indexJob !== 0"> |
|
|
|
|
|
<td style="height: 36px;"> |
|
|
|
|
|
</td> |
|
|
|
|
|
<td style="height: 36px;"> |
|
|
|
|
|
<a-button type="link" |
|
|
|
|
|
@click="toJobDetail(itemJob.id, item.company_id)">{{itemJob.name}}</a-button> |
|
|
|
|
|
</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
</template> |
|
|
|
|
|
</tbody> |
|
|
|
|
|
</template> |
|
|
|
|
|
<template v-else> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td style="height: 36px;"> |
|
|
|
|
|
无 |
|
|
|
|
|
</td> |
|
|
|
|
|
<td style="height: 36px;"> |
|
|
|
|
|
无 |
|
|
|
|
|
</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
</template> |
|
|
|
|
|
</table> |
|
|
|
|
|
<a-flex justify="flex-end" v-if="companyList && companyList.length > 0"> |
|
|
|
|
|
<a-space> |
|
|
|
|
|
<a-button type="primary" @click="exportToWord">导出表格</a-button> |
|
|
|
|
|
</a-space> |
|
|
|
|
|
</a-flex> |
|
|
|
|
|
</a-space> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
</a-page-header> |
|
|
</a-page-header> |
|
|
|
|
|
<a-back-top :visibility-height="10" /> |
|
|
</template> |
|
|
</template> |
|
|
<template v-else> |
|
|
<template v-else> |
|
|
<a-list item-layout="horizontal" :data-source="recruitmentList" style="cursor: pointer;"> |
|
|
<a-list item-layout="horizontal" :data-source="recruitmentList" style="cursor: pointer;"> |
|
|
|
|
|
|
|
|
<a-pagination hideOnSinglePage v-model:current="current" :total="total" @change="pageChange" /> |
|
|
<a-pagination hideOnSinglePage v-model:current="current" :total="total" @change="pageChange" /> |
|
|
</a-flex> |
|
|
</a-flex> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import { ref, computed, onMounted ,defineEmits} from 'vue'; |
|
|
|
|
|
import he from 'he'; |
|
|
|
|
|
|
|
|
import { ref, computed, onMounted, defineEmits } from 'vue'; |
|
|
|
|
|
import he from 'he'; |
|
|
import { PostRecruitmentList, PostRecruitmentBookcompany } from '@/apis/models'; |
|
|
import { PostRecruitmentList, PostRecruitmentBookcompany } from '@/apis/models'; |
|
|
import { ArrowLeftOutlined } from '@ant-design/icons-vue'; |
|
|
import { ArrowLeftOutlined } from '@ant-design/icons-vue'; |
|
|
import { router } from '@/router'; |
|
|
import { router } from '@/router'; |
|
|
|
|
|
import * as htmlDocx from "html-docx-js-typescript"; |
|
|
|
|
|
import { saveAs } from 'file-saver' |
|
|
const emit = defineEmits(); |
|
|
const emit = defineEmits(); |
|
|
let recruitmentList = ref<object[]>([]) |
|
|
let recruitmentList = ref<object[]>([]) |
|
|
let detail = ref<Object>(null) |
|
|
let detail = ref<Object>(null) |
|
|
let current = ref<Number>(1) |
|
|
let current = ref<Number>(1) |
|
|
let total = ref<Number>(0) |
|
|
let total = ref<Number>(0) |
|
|
let companyList = ref<Object>([]) |
|
|
let companyList = ref<Object>([]) |
|
|
|
|
|
|
|
|
|
|
|
const exportToWord = async () => { |
|
|
|
|
|
const htmlContent = document.getElementById('company-box'); // 获取需要转换的HTML内容 |
|
|
|
|
|
const convertedFile = htmlDocx.asBlob(htmlContent?.outerHTML!); |
|
|
|
|
|
const fileData = await convertedFile |
|
|
|
|
|
saveAs((fileData as Blob), detail.value.title + '招聘会.docx') |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const pageChange = (page) => { |
|
|
const pageChange = (page) => { |
|
|
current.value = page |
|
|
current.value = page |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
|
|
|
|
|
|
getRecruitmentList() |
|
|
getRecruitmentList() |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
companyList.value = res.data.recruitmentbooks |
|
|
companyList.value = res.data.recruitmentbooks |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const toCompanyDetail = (val : Number) => { |
|
|
const toCompanyDetail = (val : Number) => { |
|
|
sessionStorage.setItem('tab_key', 1) |
|
|
sessionStorage.setItem('tab_key', 1) |
|
|
sessionStorage.setItem('pubilc_id', val) |
|
|
sessionStorage.setItem('pubilc_id', val) |
|
|
sessionStorage.setItem('mode', 'detail') |
|
|
sessionStorage.setItem('mode', 'detail') |
|
|
window.open('/company/detail', "_blank"); |
|
|
window.open('/company/detail', "_blank"); |
|
|
} |
|
|
} |
|
|
|
|
|
const toJobDetail = (val : Number, company_id : Number) => { |
|
|
|
|
|
sessionStorage.setItem('tab_key', 2) |
|
|
|
|
|
sessionStorage.setItem('pubilc_id', company_id) |
|
|
|
|
|
sessionStorage.setItem('job_id', val) |
|
|
|
|
|
sessionStorage.setItem('mode', 'detail') |
|
|
|
|
|
window.open('/company/detail', "_blank"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const back = (data) => { |
|
|
const back = (data) => { |
|
|
detail.value = null |
|
|
detail.value = null |