internshipRecord.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <view class="defaultBgc">
  3. <uni-segmented-control :current="current" class="MiSans-Normal" :values="controlList" @clickItem="handleChange" styleType="text" activeColor="#00B760" style="background-color: #fff;"></uni-segmented-control>
  4. <scroll-view class="scrollBox defaultBgc" scroll-y="true" @scrolltolower="loadingMore" style="height: calc(100vh - 36px);">
  5. <view v-if="dataList.length">
  6. <uni-card v-for="(val, index) in dataList" :key="index" :is-shadow="true" :border='false' shadow="0px 0px 3px 1px rgba(0,0,0,0.1)">
  7. <!-- 企业信息 -->
  8. <view class="entInfoBox d-flex align-center ss-p-10 ss-p-l-20 ss-m-b-20">
  9. <image class="enterAvatar" :src="val.enterprise.logoUrl ? val.enterprise.logoUrl : 'https://minio.citupro.com/dev/menduner/company-avatar.png'"></image>
  10. <view class="ellipsis ss-m-l-20" style="flex: 1;">
  11. <view class="enterpriseName font-size-16 ellipsis">{{ formatName(val.enterprise.anotherName || val.enterprise.name) }}</view>
  12. <!-- <view class="ss-m-t-5">
  13. <span class="color-999">{{ val.enterprise?.industryName || '' }}</span>
  14. <span class="divider tag-gap1" v-if="val.enterprise?.industryName && val.enterprise?.scaleName"> | </span>
  15. <span class="color-999">{{ val.enterprise?.scaleName || '' }}</span>
  16. </view> -->
  17. </view>
  18. </view>
  19. <!-- 职位信息 -->
  20. <view class="list-shape ss-p-b-10" >
  21. <view class="titleBox my-5">
  22. <view class="job-name font-size-16" :style="{'max-width': !val.job.payFrom && !val.job.payTo ? '65vw' : '50vw'}">{{ formatName(val.job.name) }}</view>
  23. <span v-if="!val.job.payFrom && !val.job.payTo" class="salary-text">面议</span>
  24. <span v-else class="salary-text">{{ val.job.payFrom }}-{{ val.job.payTo }}{{ val.job.payName ? '/' + val.job.payName : '' }}</span>
  25. </view>
  26. <view style="font-size: 13px;" class="ss-m-t-10">
  27. <span class="tag-gap" style="color: #808080;">
  28. <span>{{ val.job.area?.str ?? '全国' }}</span>
  29. <span class="ss-m-x-10" v-if="val.job.eduName">|</span>
  30. <span>{{ val.job.eduName }}</span>
  31. <span class="ss-m-x-10" v-if="val.job.expName">|</span>
  32. <span>{{ val.job.expName }}</span>
  33. </span>
  34. </view>
  35. </view>
  36. <view>实习时间:{{ timesTampChange(val?.startTime, 'Y-M-D') }} 至 {{ timesTampChange(val?.endTime, 'Y-M-D') }}</view>
  37. <view v-if="current" style="text-align: right;">
  38. <view class="line ss-m-y-20"></view>
  39. <button @tap="handleToReport(val)" class="ss-m-r-10" type="warning" size="mini" style="color:#fff; backgroundColor:#fb8c00;borderColor:#fb8c00">实习报告</button>
  40. <button @tap="handleToCertificate(val)" class="ss-m-x-10" type="warning" size="mini" style="color:#fff; backgroundColor:#00b760;borderColor:#00b760">实习证书</button>
  41. <button @tap="preview(val?.recommendationLetter)" class="ss-m-l-10" type="warning" size="mini" style="color:#fff; backgroundColor:#00897b;borderColor:#00897b">企业推荐信</button>
  42. </view>
  43. <!-- 等待中 -->
  44. <view v-if="!current && !val.internshipEnterprise" style="text-align: right;">
  45. <view class="line ss-m-y-20"></view>
  46. <button @tap.stop="handleReport(val)" class="ss-m-l-10" type="warning" size="mini" style="color:#fff; backgroundColor:#00897b;borderColor:#00897b">上报为实习企业</button>
  47. </view>
  48. </uni-card>
  49. <uni-load-more :status="more" />
  50. </view>
  51. <view v-else class="nodata-img-parent">
  52. <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
  53. </view>
  54. </scroll-view>
  55. <!-- 确认框 -->
  56. <uni-popup ref="confirmRef" type="dialog">
  57. <uni-popup-dialog
  58. type="warn"
  59. cancelText="取消"
  60. confirmText="确认"
  61. title="系统提示"
  62. content="是否确定上报为实习企业?"
  63. @confirm="handleConfirm"
  64. ></uni-popup-dialog>
  65. </uni-popup>
  66. </view>
  67. </template>
  68. <script setup>
  69. import { ref } from 'vue'
  70. import { getDict } from '@/hooks/useDictionaries'
  71. import { getStudentPage } from '@/api/student'
  72. import { formatName } from '@/utils/getText'
  73. import { timesTampChange } from '@/utils/date'
  74. import { dealDictObjData } from '@/utils/position'
  75. import { preview } from '@/utils/preview'
  76. import { reportStudentPracticeEnterprise } from '@/api/student'
  77. const more = ref('more')
  78. const current = ref(0)
  79. const query = ref({
  80. pageNo: 1,
  81. pageSize: 10
  82. })
  83. const dataList = ref([])
  84. const getData = async () => {
  85. try {
  86. const params = {
  87. studentProcessStatus: tabList.value[current.value]?.value,
  88. status: 1,
  89. ...query.value
  90. }
  91. if (!params?.status) return
  92. const { data } = await getStudentPage(params)
  93. const list = data?.list?.length && data.list || []
  94. list.forEach(e => {
  95. e.enterprise = dealDictObjData({}, e.enterprise)
  96. e.job = dealDictObjData({}, e.job)
  97. })
  98. //
  99. dataList.value = dataList.value.concat(list)
  100. more.value = dataList.value?.length === data?.total ? 'noMore' : 'more'
  101. } catch (error) {
  102. query.pageNo--
  103. more.value = 'more'
  104. }
  105. }
  106. const handleChange = (e) => {
  107. current.value = e.currentIndex
  108. query.value.pageNo = 1
  109. dataList.value = []
  110. getData()
  111. }
  112. // 加载更多
  113. const loadingMore = () => {
  114. more.value = 'loading'
  115. query.value.pageNo++
  116. getData()
  117. }
  118. const tabList = ref([])
  119. const controlList = ref([])
  120. const getTabList = async () => {
  121. const { data } = await getDict('student_practice_status')
  122. if (data.code !== 0) {
  123. return
  124. }
  125. tabList.value = data?.data?.length && data.data || []
  126. controlList.value = tabList.value.map(e => e.label) || []
  127. if (tabList.value?.length) getData()
  128. }
  129. getTabList()
  130. // 实习报告
  131. const handleToReport = (val) => {
  132. uni.navigateTo({ url: `/pagesA/student/internshipReport?enterpriseId=${val?.enterprise?.id}` })
  133. }
  134. // 查看证书详情
  135. const handleToCertificate = (val) => {
  136. const itemData = JSON.stringify({
  137. student: { schoolName: formatName(val?.student?.schoolInfo?.name), majorName: val?.student?.major?.nameCn },
  138. person: { name: val?.person?.name },
  139. enterprise: { anotherName: formatName(val?.enterprise?.anotherName || val?.enterprise?.name) },
  140. startTime: val?.startTime,
  141. endTime: val?.endTime,
  142. evaluate: val?.evaluate,
  143. certificate: val?.certificate,
  144. createTime: val?.createTime
  145. })
  146. uni.navigateTo({ url: `/pagesA/student/certificateDetail?itemData=${itemData}` })
  147. }
  148. const handleConfirm = async() => {
  149. try {
  150. const enterpriseId = handleVal.value?.enterprise?.id
  151. const jobId = handleVal.value?.job?.id
  152. await reportStudentPracticeEnterprise(enterpriseId, jobId)
  153. uni.showToast({ title: '上报成功', icon: 'success' })
  154. } catch (error) {
  155. uni.showToast({ title: error?.msg || error, icon: 'none' })
  156. } finally {
  157. confirmRef.value.close()
  158. query.value.pageNo = 1
  159. dataList.value = []
  160. getData()
  161. }
  162. }
  163. const confirmRef = ref()
  164. const handleVal = ref('')
  165. // 上报为实习企业
  166. const handleReport = (val) => {
  167. if (!val?.enterprise?.id || !val?.job?.id) uni.showToast({ title: '企业或职位信息错误', icon: 'none' })
  168. handleVal.value = val
  169. confirmRef.value.open()
  170. }
  171. </script>
  172. <style scoped lang="scss">
  173. :deep(.segmented-control) {
  174. background-color: #fff !important;
  175. }
  176. .enterpriseName {
  177. color: #0E100F;
  178. // font-weight: 700;
  179. }
  180. .enterAvatar {
  181. width: 25px;
  182. height: 25px;
  183. // border-radius: 50%;
  184. margin: auto;
  185. }
  186. .line {
  187. border-top: 1px solid #ccc;
  188. }
  189. .list-shape {
  190. background-color: #fff;
  191. border-radius: 12px 12px 0 0;
  192. .titleBox {
  193. display: flex;
  194. align-items: center;
  195. justify-content: space-between;
  196. }
  197. }
  198. .salary-text {
  199. float: right;
  200. font-size: 15px;
  201. color: #00B760;
  202. font-weight: 700;
  203. }
  204. .job-name {
  205. font-size: 30rpx;
  206. // font-weight: 700;
  207. color: #0E100F;
  208. overflow: hidden;
  209. white-space: nowrap;
  210. text-overflow: ellipsis;
  211. }
  212. .ellipsis {
  213. white-space: nowrap;
  214. text-overflow: ellipsis;
  215. overflow: hidden;
  216. }
  217. .entInfoBox {
  218. background: linear-gradient(90deg, #f5fcfc, #fcfbfa);
  219. }
  220. </style>