|
@@ -1,5 +1,11 @@
|
|
<template>
|
|
<template>
|
|
<view style="padding: 20rpx 30rpx;">
|
|
<view style="padding: 20rpx 30rpx;">
|
|
|
|
+ <view class="d-flex align-center">
|
|
|
|
+ <uni-section title="企业:"></uni-section>
|
|
|
|
+ <uni-data-picker v-model="enterpriseId" class="picker" :localdata="companyList" placeholder="请选择要查看的企业" popup-title="选择企业" @change="getList" :map="{ text: 'enterpriseName', value: 'id' }"></uni-data-picker>
|
|
|
|
+ <button type="primary" size="mini" @click="getList" style="height: 35px; line-height: 35px; margin: 0;">刷新</button>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="line ss-m-y-20"></view>
|
|
<view v-if="items.length > 0" class="wrapper">
|
|
<view v-if="items.length > 0" class="wrapper">
|
|
<view v-for="(item,index) in items" :key="index" style="margin: 0 0 50rpx 0;">
|
|
<view v-for="(item,index) in items" :key="index" style="margin: 0 0 50rpx 0;">
|
|
<uni-section :title="item.date" type="line"></uni-section>
|
|
<uni-section :title="item.date" type="line"></uni-section>
|
|
@@ -21,19 +27,20 @@
|
|
import { ref } from 'vue'
|
|
import { ref } from 'vue'
|
|
import { getStudentReportList, getStudentPracticeCompanyList } from '@/api/student.js'
|
|
import { getStudentReportList, getStudentPracticeCompanyList } from '@/api/student.js'
|
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
|
-import { formatName } from '@/utils/index.js'
|
|
|
|
|
|
+import { formatName } from '@/utils/getText'
|
|
|
|
|
|
const enterpriseId = ref(null)
|
|
const enterpriseId = ref(null)
|
|
const items = ref([])
|
|
const items = ref([])
|
|
|
|
+const companyList = ref([])
|
|
|
|
|
|
const getCompanyList = async () => {
|
|
const getCompanyList = async () => {
|
|
try {
|
|
try {
|
|
const { data } = await getStudentPracticeCompanyList()
|
|
const { data } = await getStudentPracticeCompanyList()
|
|
- data.forEach(e => {
|
|
|
|
|
|
+ data?.length && data.forEach(e => {
|
|
e.id = e.id.toString()
|
|
e.id = e.id.toString()
|
|
e.enterpriseName = formatName(e.anotherName || e.name)
|
|
e.enterpriseName = formatName(e.anotherName || e.name)
|
|
})
|
|
})
|
|
- console.log(data, '实习企业列表')
|
|
|
|
|
|
+ companyList.value = data || []
|
|
} catch {}
|
|
} catch {}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -50,29 +57,26 @@ const getList = async () => {
|
|
}
|
|
}
|
|
|
|
|
|
onShow(() => {
|
|
onShow(() => {
|
|
- console.log('onSHow11111111')
|
|
|
|
getCompanyList()
|
|
getCompanyList()
|
|
})
|
|
})
|
|
|
|
|
|
onLoad((options) => {
|
|
onLoad((options) => {
|
|
- console.log(options, 'options-实习报告')
|
|
|
|
if (options.enterpriseId) {
|
|
if (options.enterpriseId) {
|
|
enterpriseId.value = options.enterpriseId
|
|
enterpriseId.value = options.enterpriseId
|
|
}
|
|
}
|
|
getList()
|
|
getList()
|
|
})
|
|
})
|
|
|
|
|
|
-const addReport = () => {}
|
|
|
|
-
|
|
|
|
-// 预览图片
|
|
|
|
-const previewImage = (url, i) => {
|
|
|
|
- uni.previewImage({
|
|
|
|
- current: i,
|
|
|
|
- urls: url,
|
|
|
|
- longPressActions : {
|
|
|
|
- itemList: ['发送给朋友', '保存图片', '收藏']
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+const addReport = () => {
|
|
|
|
+ if (!companyList.value?.length) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '没有查到实习企业记录!',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ const list = JSON.stringify(companyList.value)
|
|
|
|
+ uni.navigateTo({ url: `/pagesA/student/addReport?companyList=${list}` })
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
@@ -90,4 +94,60 @@ const previewImage = (url, i) => {
|
|
:deep(.uni-section .uni-section-header__decoration) {
|
|
:deep(.uni-section .uni-section-header__decoration) {
|
|
background-color: #00B760 !important;
|
|
background-color: #00B760 !important;
|
|
}
|
|
}
|
|
|
|
+.line {
|
|
|
|
+ border-top: 1px solid #ccc;
|
|
|
|
+}
|
|
|
|
+.picker {
|
|
|
|
+ flex: 1;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ margin-right: 12px;
|
|
|
|
+}
|
|
|
|
+.reportPopup {
|
|
|
|
+ width: 96vw;
|
|
|
|
+ .uploadTip {
|
|
|
|
+ color: #00B760;
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
+ font-size: 13px;
|
|
|
|
+ }
|
|
|
|
+ .dialog-title {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ align-items: center;
|
|
|
|
+ color:#767a82;
|
|
|
|
+ padding: 20rpx;
|
|
|
|
+ .title {
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ margin-left: 10rpx;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .dialog-content{
|
|
|
|
+ padding: 20rpx;
|
|
|
|
+ padding-bottom: 50rpx;
|
|
|
|
+ }
|
|
|
|
+ .dialog-bottom{
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 44px;
|
|
|
|
+ line-height: 44px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ color: #fff !important;
|
|
|
|
+ background-color: #00B760 !important;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.upload-img{
|
|
|
|
+ position: relative;
|
|
|
|
+ width: 200rpx;
|
|
|
|
+ height: 200rpx;
|
|
|
|
+ border: 1px solid #f1f1f1;
|
|
|
|
+ margin: 10rpx;
|
|
|
|
+}
|
|
|
|
+.upload-file{
|
|
|
|
+ width: 200rpx;
|
|
|
|
+ height: 200rpx;
|
|
|
|
+ border: 1px solid #f1f1f1;
|
|
|
|
+ margin: 10rpx;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ border-radius: 10rpx;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|