|
@@ -4,6 +4,14 @@
|
|
|
<van-nav-bar title="选择录入类型" left-arrow @click-left="onBack" fixed :z-index="999" />
|
|
<van-nav-bar title="选择录入类型" left-arrow @click-left="onBack" fixed :z-index="999" />
|
|
|
<view class="content">
|
|
<view class="content">
|
|
|
<view class="student-info">
|
|
<view class="student-info">
|
|
|
|
|
+ <view class="info-row">
|
|
|
|
|
+ <text class="label">学校</text>
|
|
|
|
|
+ <text class="value">{{ schoolName }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="info-row">
|
|
|
|
|
+ <text class="label">班级</text>
|
|
|
|
|
+ <text class="value">{{ gradeName }} {{ className }}</text>
|
|
|
|
|
+ </view>
|
|
|
<view class="info-row">
|
|
<view class="info-row">
|
|
|
<text class="label">姓名</text>
|
|
<text class="label">姓名</text>
|
|
|
<text class="value">{{ studentName }}</text>
|
|
<text class="value">{{ studentName }}</text>
|
|
@@ -13,6 +21,7 @@
|
|
|
<text class="value">{{ studentIdCard }}</text>
|
|
<text class="value">{{ studentIdCard }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
<view class="type-list">
|
|
<view class="type-list">
|
|
|
<view class="type-card" @click="selectType('vision')" v-if="visionStatus === 0">
|
|
<view class="type-card" @click="selectType('vision')" v-if="visionStatus === 0">
|
|
|
<view class="type-name">视力数据录入</view>
|
|
<view class="type-name">视力数据录入</view>
|
|
@@ -22,31 +31,55 @@
|
|
|
<view class="type-name">屈光度数据录入</view>
|
|
<view class="type-name">屈光度数据录入</view>
|
|
|
<van-icon name="arrow" />
|
|
<van-icon name="arrow" />
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view class="all-done" v-if="visionStatus === 1 && refractionStatus === 1">
|
|
|
|
|
+ <van-icon name="checked" color="#07c160" size="48rpx" />
|
|
|
|
|
+ <text class="all-done-text">该学生数据已全部录入</text>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { getStudentInfo } from '@/services/common'
|
|
|
|
|
-
|
|
|
|
|
|
|
+import { getStudentInfo, getStudentVisionData } from '@/services/common'
|
|
|
|
|
|
|
|
const studentName = ref('')
|
|
const studentName = ref('')
|
|
|
const studentIdCard = ref('')
|
|
const studentIdCard = ref('')
|
|
|
|
|
+const schoolName = ref('')
|
|
|
|
|
+const gradeName = ref('')
|
|
|
|
|
+const className = ref('')
|
|
|
const visionStatus = ref(0)
|
|
const visionStatus = ref(0)
|
|
|
const refractionStatus = ref(0)
|
|
const refractionStatus = ref(0)
|
|
|
|
|
+const studentId = ref('')
|
|
|
const params = ref({})
|
|
const params = ref({})
|
|
|
|
|
|
|
|
|
|
+const fetchVisionStatus = async () => {
|
|
|
|
|
+ if (!studentId.value) return
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await getStudentVisionData(studentId.value)
|
|
|
|
|
+ if (res && res.code === 200 && res.data) {
|
|
|
|
|
+ visionStatus.value = res.data.vision_input_status || 0
|
|
|
|
|
+ refractionStatus.value = res.data.refraction_input_status || 0
|
|
|
|
|
+ if (res.data.id) {
|
|
|
|
|
+ params.value.visionDataId = res.data.id
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ visionStatus.value = 0
|
|
|
|
|
+ refractionStatus.value = 0
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
onLoad((options) => {
|
|
onLoad((options) => {
|
|
|
- if (options.studentId) {
|
|
|
|
|
- getStudentInfo(
|
|
|
|
|
- options.studentId
|
|
|
|
|
- ).then((res) => {
|
|
|
|
|
|
|
+ if (options.studentId && !options.studentName) {
|
|
|
|
|
+ studentId.value = options.studentId
|
|
|
|
|
+ getStudentInfo(options.studentId).then((res) => {
|
|
|
studentName.value = res.data.name
|
|
studentName.value = res.data.name
|
|
|
studentIdCard.value = res.data.id_card
|
|
studentIdCard.value = res.data.id_card
|
|
|
- visionStatus.value = 0
|
|
|
|
|
- refractionStatus.value = 0
|
|
|
|
|
- params.value = res.data
|
|
|
|
|
|
|
+ schoolName.value = res.data.school_name || ''
|
|
|
|
|
+ gradeName.value = res.data.grade || ''
|
|
|
|
|
+ className.value = res.data.class_name || ''
|
|
|
|
|
+ studentId.value = res.data.id
|
|
|
|
|
|
|
|
params.value = {
|
|
params.value = {
|
|
|
studentId: res.data.id,
|
|
studentId: res.data.id,
|
|
@@ -59,17 +92,20 @@ onLoad((options) => {
|
|
|
visionDataId: res.data.vision_data_id || '',
|
|
visionDataId: res.data.vision_data_id || '',
|
|
|
schoolName: res.data.school_name || '',
|
|
schoolName: res.data.school_name || '',
|
|
|
userName: res.data.name || '',
|
|
userName: res.data.name || '',
|
|
|
- userPhone:'17766664444',
|
|
|
|
|
- // userOrg: options.userOrg
|
|
|
|
|
|
|
+ userPhone: options.userPhone || '',
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ fetchVisionStatus()
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (options.studentName) {
|
|
if (options.studentName) {
|
|
|
|
|
+ studentId.value = options.studentId
|
|
|
studentName.value = decodeURIComponent(options.studentName || '')
|
|
studentName.value = decodeURIComponent(options.studentName || '')
|
|
|
studentIdCard.value = decodeURIComponent(options.studentIdCard || '')
|
|
studentIdCard.value = decodeURIComponent(options.studentIdCard || '')
|
|
|
- visionStatus.value = Number(options.visionStatus || 0)
|
|
|
|
|
- refractionStatus.value = Number(options.refractionStatus || 0)
|
|
|
|
|
|
|
+ schoolName.value = decodeURIComponent(options.schoolName || '')
|
|
|
|
|
+ gradeName.value = decodeURIComponent(options.grade || '')
|
|
|
|
|
+ className.value = decodeURIComponent(options.className || '')
|
|
|
|
|
|
|
|
params.value = {
|
|
params.value = {
|
|
|
studentId: options.studentId,
|
|
studentId: options.studentId,
|
|
@@ -85,11 +121,13 @@ onLoad((options) => {
|
|
|
userPhone: options.userPhone,
|
|
userPhone: options.userPhone,
|
|
|
userOrg: options.userOrg
|
|
userOrg: options.userOrg
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
+ fetchVisionStatus()
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
|
|
|
|
|
|
|
+onShow(() => {
|
|
|
|
|
+ fetchVisionStatus()
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const selectType = (type) => {
|
|
const selectType = (type) => {
|
|
@@ -100,11 +138,9 @@ const selectType = (type) => {
|
|
|
const onBack = () => {
|
|
const onBack = () => {
|
|
|
uni.navigateBack({
|
|
uni.navigateBack({
|
|
|
delta: 1,
|
|
delta: 1,
|
|
|
- success: () => { },
|
|
|
|
|
|
|
+ success: () => {},
|
|
|
fail: () => {
|
|
fail: () => {
|
|
|
- uni.switchTab({
|
|
|
|
|
- url: '/pages/index/index'
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ uni.switchTab({ url: '/pages/index/index' })
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -190,4 +226,20 @@ const onBack = () => {
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
right: 30rpx;
|
|
right: 30rpx;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+.all-done {
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ border-radius: 20rpx;
|
|
|
|
|
+ padding: 50rpx 30rpx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ gap: 16rpx;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.all-done-text {
|
|
|
|
|
+ font-size: 30rpx;
|
|
|
|
|
+ color: #07c160;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|