index.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <!-- 实习情况 -->
  2. <template>
  3. <v-card class="card-box pa-3">
  4. <div class="d-flex justify-space-between align-center">
  5. <div class="d-flex align-center statistics">
  6. <div v-for="(val, index) in statistics" :key="index" class="statistics-card pa-5">
  7. <div class="color-666">{{ val.label }}</div>
  8. <div class="">
  9. <span class="value font-weight-bold color-primary">{{ val.value }}</span>
  10. <span class="color-999 font-size-14">人</span>
  11. </div>
  12. </div>
  13. </div>
  14. </div>
  15. <CtTable
  16. class="mt-5"
  17. :items="tableData"
  18. :headers="headers"
  19. :loading="loading"
  20. :elevation="0"
  21. :is-tools="false"
  22. :showPage="true"
  23. :total="total"
  24. :page-info="query"
  25. itemKey="id"
  26. @pageHandleChange="handleChangePage"
  27. >
  28. <template #enterpriseName="{ item }">
  29. <div class="d-flex align-center">
  30. <v-avatar size="40" :image="item.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'"></v-avatar>
  31. <span class="ml-3 color-primary cursor-pointer" @click="handleEnterprise(item.id)">{{ formatName(item.anotherName || item.name) }}</span>
  32. </div>
  33. </template>
  34. <template #internshipNumber="{ item }">
  35. <span class="color-primary cursor-pointer" @click="handleDetail(item, '实习中')">{{ item.internshipNumber || 0 }}人</span>
  36. </template>
  37. <template #waitInternshipNumber="{ item }">
  38. <span class="color-primary cursor-pointer" @click="handleDetail(item, '等待实习')">{{ item.waitInternshipNumber || 0 }}人</span>
  39. </template>
  40. <template #internshipSuccessNumber="{ item }">
  41. <span class="color-primary cursor-pointer" @click="handleDetail(item, '结束实习')">{{ item.internshipSuccessNumber || 0 }}人</span>
  42. </template>
  43. <template #actions="{ item }">
  44. <v-btn v-if="!item?.recommendationLetter" color="primary" variant="text" @click="handleUploadLetter(item.id)">上传推荐信</v-btn>
  45. <v-btn v-if="!item?.evaluate" color="#00897B" variant="text" @click="handleIssueCertificate(item.id)">颁发实习证书</v-btn>
  46. </template>
  47. </CtTable>
  48. </v-card>
  49. <CtDialog :visible="drill.show" :widthType="1" titleClass="text-h6" :footer="false" :title="drill.title" @close="handleClose">
  50. <CtTable
  51. :items="drill.list"
  52. :headers="drill.headers"
  53. :loading="false"
  54. :elevation="0"
  55. :isTools="false"
  56. :showPage="true"
  57. :total="drill.total"
  58. :page-info="drill.query"
  59. itemKey="id"
  60. @pageHandleChange="handleChangeDrillPage"
  61. >
  62. <template #studentName="{ item }">
  63. <div class="d-flex align-center">
  64. <v-avatar size="40" :image="getUserAvatar(item.headImg, item.teacherSex)"></v-avatar>
  65. <span class="ml-3 color-primary cursor-pointer" @click="handleToStudentDetail(item.studentId)">{{ item.studentName || item.phone }}</span>
  66. </div>
  67. </template>
  68. </CtTable>
  69. </CtDialog>
  70. <v-navigation-drawer v-model="showDetail" absolute location="right" rounded temporary width="700" class="pa-5">
  71. 111
  72. </v-navigation-drawer>
  73. </template>
  74. <script setup>
  75. defineOptions({name: 'studentList-internship-situation'})
  76. import { ref, onMounted } from 'vue'
  77. import { getUserAvatar } from '@/utils/avatar'
  78. import { getStudentPage } from '@/api/recruit/enterprise/student'
  79. import { dealDictObjData } from '@/utils/position'
  80. import { formatName } from '@/utils/getText'
  81. import Snackbar from '@/plugins/snackbar'
  82. import { studentPracticeStatistics } from '@/api/school'
  83. const statistics = ref([
  84. { label: '等待实习', value: 0, key: 'waitInternshipNumber' },
  85. { label: '实习中', value: 1, key: 'internshipNumber' },
  86. { label: '实习结束', value: 0, key: 'internshipSuccessNumber' }
  87. ])
  88. const loading = ref(false)
  89. const total = ref(0)
  90. const query = ref({
  91. pageNo: 1,
  92. pageSize: 10,
  93. startTime: null
  94. })
  95. const tableData = ref([
  96. {
  97. "id": 1,
  98. "name": "门墩儿信息科技有限公司",
  99. "anotherName": "门墩儿",
  100. "industryId": "1829087620475494402",
  101. "industryName": '互联网',
  102. "scale": "0",
  103. "scaleName": '0-20人',
  104. "logoUrl": "https://minio.menduner.com/dev/1e6893918ef378ca280360078dfe74ade10b27101c89865261824b46de7d34a6.png",
  105. internshipNumber: 2,
  106. internshipSuccessNumber: 0,
  107. waitInternshipNumber: 0
  108. }
  109. ])
  110. const schoolInfo = ref(localStorage.getItem('schoolInfo') ? JSON.parse(localStorage.getItem('schoolInfo')) : {})
  111. const headers = [
  112. { title: '实习企业', key: 'enterpriseName', sortable: false },
  113. { title: '所在行业', key: 'industryName', sortable: false },
  114. { title: '企业规模', key: 'scaleName', sortable: false },
  115. { title: '实习中', key: 'internshipNumber', sortable: false },
  116. { title: '实习结束', key: 'internshipSuccessNumber', sortable: false },
  117. { title: '等待实习', key: 'waitInternshipNumber', sortable: false },
  118. ]
  119. // 学生列表
  120. const getList = async () => {
  121. loading.value = true
  122. try {
  123. const result = await getStudentPage(query.value)
  124. tableData.value = result?.list.map(e => {
  125. e.enterprise = dealDictObjData({}, e.enterprise)
  126. e.job = dealDictObjData({}, e.job)
  127. return e
  128. })
  129. total.value = result?.total || 0
  130. } finally {
  131. loading.value = false
  132. }
  133. }
  134. // 数值统计
  135. const getStatistics = async () => {
  136. try {
  137. const data = await studentPracticeStatistics({ schoolId: schoolInfo.value?.school?.schoolId })
  138. console.log(data, 'data')
  139. // statistics.value.forEach(e => {
  140. // const obj = data.find(val => val.key === e.value)
  141. // e.count = obj ? obj.value : 0
  142. // })
  143. } catch {}
  144. }
  145. onMounted(async () => {
  146. // const { data } = await getDict('student_practice_status')
  147. // statistics.value = data
  148. // getStatistics()
  149. // getList()
  150. })
  151. const handleChangePage = (val) => {
  152. query.value.pageNo = val
  153. getList()
  154. }
  155. // 跳转企业详情
  156. const handleEnterprise = (id) => {
  157. if (!id) return
  158. window.open(`/recruit/personal/company/details/${id}?key=briefIntroduction`)
  159. }
  160. // 实习学生
  161. const drill = ref({
  162. total: 0,
  163. query: {
  164. size: 10,
  165. current: 1
  166. },
  167. title: '学生列表',
  168. show: false,
  169. list: [{
  170. studentName: '张三',
  171. enterpriseName: '北京字节跳动科技有限公司',
  172. phone: '12345678901',
  173. schoolDepartmentName: '计算机科学与技术',
  174. majorName: '计算机科学与技术',
  175. schoolClassName: '2019级',
  176. studentNo: '2019111111',
  177. studentId: 1,
  178. teacherSex: '1',
  179. headImg: '',
  180. phone: '12345678901',
  181. studentPracticeStatus: '实习中'
  182. }],
  183. headers: [
  184. { title: '状态', key: 'studentPracticeStatus', sortable: false },
  185. { title: '学生姓名', key: 'studentName', sortable: false },
  186. { title: '实习企业', key: 'enterpriseName', sortable: false },
  187. { title: '联系电话', key: 'phone', sortable: false },
  188. { title: '所属院系', key: 'schoolDepartmentName', sortable: false },
  189. { title: '所属专业', key: 'majorName', sortable: false },
  190. { title: '所在班级', key: 'schoolClassName', sortable: false },
  191. { title: '学号', key: 'studentNo', sortable: false },
  192. ]
  193. })
  194. // 学生列表
  195. const handleDetail = (item, label) => {
  196. drill.value.title = `${item.anotherName} - 状态[${label}] - 学生列表`
  197. drill.value.query.current = 1
  198. drill.value.show = true
  199. }
  200. const handleChangeDrillPage = (page) => {}
  201. const handleClose = () => {
  202. drill.value.show = false
  203. // drill.value.list = []
  204. }
  205. const showDetail = ref(false)
  206. const handleToStudentDetail = (id) => {
  207. showDetail.value = true
  208. }
  209. </script>
  210. <style scoped lang="scss">
  211. .statistics {
  212. width: 70%;
  213. &-card {
  214. width: 33.33%;
  215. margin-right: 12px;
  216. background-color: #f7f8fa;
  217. border-radius: 10px;
  218. &:nth-child(3) {
  219. margin-right: 0;
  220. }
  221. .value {
  222. font-size: 44px;
  223. }
  224. }
  225. }
  226. </style>