detail.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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.workCategoryName }}</a-descriptions-item>
  8. <a-descriptions-item label="招聘人数">{{ postInfo.recruitCount }}</a-descriptions-item>
  9. <a-descriptions-item label="招聘日期">
  10. {{ postInfo.startTime ? dayjs(postInfo.startTime).format('YYYY-MM-DD') : '' }}
  11. {{ postInfo.endTime ? dayjs(postInfo.endTime).format('YYYY-MM-DD') : '' }}
  12. </a-descriptions-item>
  13. <a-descriptions-item :span="3" label="工作地点">{{ postInfo.jobPlace }}</a-descriptions-item>
  14. <a-descriptions-item label="联系人姓名">{{ postInfo.contactName }}</a-descriptions-item>
  15. <a-descriptions-item label="联系人电话">{{ postInfo.contactMobile }}</a-descriptions-item>
  16. <a-descriptions-item label="联系人邮箱">{{ postInfo.contactEmail }}</a-descriptions-item>
  17. <a-descriptions-item label="工作性质">{{ postInfo.workNatureName }}</a-descriptions-item>
  18. <a-descriptions-item label="最后更新人">{{ postInfo.modifyUserName }}</a-descriptions-item>
  19. <a-descriptions-item label="最后更新时间">
  20. {{
  21. postInfo.modifyTime ? dayjs(postInfo.modifyTime).format('YYYY-MM-DD') : ''
  22. }}
  23. </a-descriptions-item>
  24. </a-descriptions>
  25. <a-divider orientation="left">其他信息</a-divider>
  26. <a-descriptions bordered>
  27. <a-descriptions-item label="岗位月薪(元)">
  28. {{ showSalary(postInfo.minSalary, postInfo.maxSalary) }}
  29. </a-descriptions-item>
  30. <a-descriptions-item label="是否有试用期">{{ postInfo.isTrail ? '是' : '否' }}</a-descriptions-item>
  31. <a-descriptions-item label="试用期(月)">{{ postInfo.trailMonths }}</a-descriptions-item>
  32. <a-descriptions-item label="试用期月薪(元)">
  33. {{ showSalary(postInfo.trailMinSalary, postInfo.trailMaxSalary) }}
  34. </a-descriptions-item>
  35. <a-descriptions-item label="工作年限要求">{{ workYear }}</a-descriptions-item>
  36. <a-descriptions-item label="学历要求">{{ postInfo.cultureLevelName }}</a-descriptions-item>
  37. <a-descriptions-item :span="3" label="标签">
  38. <a-button style="margin: 0px 5px 5px 0px;color: black;border: 1px solid rgb(217, 217, 217);" v-for="item in postInfo.listLabel">
  39. {{ item.labelName }}
  40. </a-button>
  41. </a-descriptions-item>
  42. <a-descriptions-item :span="3" label="福利待遇">{{ postInfo.welfare }}</a-descriptions-item>
  43. <a-descriptions-item :span="3" label="其他要求">{{ postInfo.postDesc }}</a-descriptions-item>
  44. </a-descriptions>
  45. </div>
  46. </template>
  47. <script setup lang="ts">
  48. import {getPostByID} from "@/api/companyService/post";
  49. import {computed, onMounted, reactive, ref} from "vue";
  50. import dayjs from "dayjs";
  51. import {get} from "@/api/common";
  52. // 岗位信息
  53. const postInfo = reactive({
  54. companyName: "",
  55. professionName: "",
  56. workCategoryName: "",
  57. recruitCount: "",
  58. startTime: "",
  59. endTime: "",
  60. jobPlace: "",
  61. minSalary: "",
  62. maxSalary: "",
  63. isTrail: "",
  64. trailMonths: "",
  65. trailMinSalary: "",
  66. trailMaxSalary: "",
  67. workYear: "",
  68. cultureLevelName: "",
  69. listLabel: null,
  70. welfare: "",
  71. postDesc: "",
  72. contactName: "",
  73. contactMobile: "",
  74. contactEmail: "",
  75. workNatureName: "",
  76. modifyUserName: "",
  77. modifyTime: ""
  78. })
  79. // 工作年限数据
  80. const WorkYearTypeList = ref<Array<any>>([])
  81. // 获取工作年限
  82. const workYear = computed(() => {
  83. if (postInfo.workYear && WorkYearTypeList.value.length > 0) {
  84. const item = WorkYearTypeList.value.find(item => item.value == postInfo.workYear)
  85. if (item) {
  86. return item.name;
  87. }
  88. }
  89. return postInfo.workYear;
  90. })
  91. // 数据加载
  92. function loadData(id: any) {
  93. getPostByID(id).then(result => {
  94. Object.keys(postInfo).forEach((key) => {
  95. postInfo[key] = result[key];
  96. })
  97. })
  98. }
  99. const showSalary = (minSalary: any, maxSalary: any) => {
  100. if (minSalary != null) {
  101. if (maxSalary != null) {
  102. return minSalary.toString() + "-" + maxSalary.toString();
  103. } else {
  104. return "≥" + minSalary.toString();
  105. }
  106. } else {
  107. if (maxSalary != null) {
  108. return "≤" + maxSalary.toString();
  109. } else {
  110. return "";
  111. }
  112. }
  113. }
  114. // 页面初始化
  115. onMounted(() => {
  116. const id = history.state.params?.id;
  117. loadData(id);
  118. get('system/dictionary/getDictionaryItemByCodeList', {code: 'WorkYearType'}).then(result => {
  119. WorkYearTypeList.value = result;
  120. });
  121. })
  122. </script>
  123. <script lang="ts">
  124. // 设置页面名称进行组件缓存
  125. export default {
  126. name: "PostDetail"
  127. }
  128. </script>
  129. <style scoped>
  130. </style>