detail.vue 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <div class="card-edit">
  3. <a-divider orientation="left">岗位基础信息</a-divider>
  4. <a-descriptions bordered>
  5. <a-descriptions-item label="企业名称">{{ postInfo.companyName }}</a-descriptions-item>
  6. <a-descriptions-item label="岗位名称">{{ postInfo.professionName }}</a-descriptions-item>
  7. <a-descriptions-item label="招聘人数">{{ postInfo.recruitCount }}</a-descriptions-item>
  8. <a-descriptions-item label="招聘日期">
  9. {{ postInfo.startTime ? dayjs(postInfo.startTime).format('YYYY-MM-DD') : '' }}
  10. {{ postInfo.endTime ? dayjs(postInfo.endTime).format('YYYY-MM-DD') : '' }}
  11. </a-descriptions-item>
  12. <a-descriptions-item :span="3" label="招聘地点">{{ postInfo.jobPlace }}</a-descriptions-item>
  13. </a-descriptions>
  14. <a-divider orientation="left">其他信息</a-divider>
  15. <a-descriptions bordered>
  16. <a-descriptions-item label="岗位月薪(元)">
  17. {{ postInfo.minSalary }}
  18. {{ postInfo.maxSalary }}
  19. </a-descriptions-item>
  20. <a-descriptions-item label="是否有试用期">{{ postInfo.isTrail ? '是' : '否' }}</a-descriptions-item>
  21. <a-descriptions-item label="试用期(月)">{{ postInfo.trailMonths }}</a-descriptions-item>
  22. <a-descriptions-item label="试用期月薪(元)">
  23. {{ postInfo.trailMinSalary }}
  24. {{ postInfo.trailMaxSalary }}
  25. </a-descriptions-item>
  26. <a-descriptions-item label="工作年限要求">{{ workYear }}</a-descriptions-item>
  27. <a-descriptions-item label="学历要求">{{ postInfo.cultureLevelName }}</a-descriptions-item>
  28. <a-descriptions-item :span="3" label="福利待遇">{{ postInfo.welfare }}</a-descriptions-item>
  29. <a-descriptions-item :span="3" label="其他要求">{{ postInfo.postDesc }}</a-descriptions-item>
  30. </a-descriptions>
  31. </div>
  32. </template>
  33. <script setup lang="ts">
  34. import {getPostByID} from "@/api/companyService/post";
  35. import {computed, onMounted, reactive, ref} from "vue";
  36. import dayjs from "dayjs";
  37. import {get} from "@/api/common";
  38. // 岗位信息
  39. const postInfo = reactive({
  40. companyName: "",
  41. professionName: "",
  42. recruitCount: "",
  43. startTime: "",
  44. endTime: "",
  45. jobPlace: "",
  46. minSalary: "",
  47. maxSalary: "",
  48. isTrail: "",
  49. trailMonths: "",
  50. trailMinSalary: "",
  51. trailMaxSalary: "",
  52. workYear: "",
  53. cultureLevelName: "",
  54. welfare: "",
  55. postDesc: "",
  56. })
  57. // 工作年限数据
  58. const WorkYearTypeList = ref<Array<any>>([])
  59. // 获取工作年限
  60. const workYear = computed(() => {
  61. if (postInfo.workYear && WorkYearTypeList.value.length > 0) {
  62. const item = WorkYearTypeList.value.find(item => item.value == postInfo.workYear)
  63. if (item) {
  64. return item.name;
  65. }
  66. }
  67. return postInfo.workYear;
  68. })
  69. // 数据加载
  70. function loadData(id: any) {
  71. getPostByID(id).then(result => {
  72. Object.keys(postInfo).forEach((key) => {
  73. postInfo[key] = result[key];
  74. })
  75. })
  76. }
  77. // 页面初始化
  78. onMounted(() => {
  79. const id = history.state.params?.id;
  80. loadData(id);
  81. get('system/dictionary/getDictionaryItemByCodeList', {code: 'WorkYearType'}).then(result => {
  82. WorkYearTypeList.value = result;
  83. });
  84. })
  85. </script>
  86. <style scoped>
  87. </style>