|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<view class="content">
|
|
|
- <u-card :title="classInfo.name" :show-foot="false" title-size="32" margin="0px 0px 10px 0px" :head-style="cardStyle">
|
|
|
+ <u-card :title="classInfo.name" :sub-title="classInfo.useLessonsType == 1 ? '体验班' : ''" :show-foot="false" title-size="32" margin="0px 0px 10px 0px" :head-style="cardStyle">
|
|
|
<view slot="body">
|
|
|
<view class="class-info-text">
|
|
|
<u-icon name="clock"></u-icon>
|
|
@@ -14,9 +14,13 @@
|
|
|
<u-icon name="map"></u-icon>
|
|
|
{{classInfo.address}}
|
|
|
</view>
|
|
|
+ <view style="display: flex;justify-content: flex-end;" v-if="classInfo.state != 0">
|
|
|
+ <u-button type="warning" :custom-style="{background: mainColor}" size="mini" shape="circle" :ripple="true" @click="handleUpdateClassClick">修改</u-button>
|
|
|
+ <u-button v-if="!classInfo.studentSignList.length" type="warning" :custom-style="{background: mainColor,marginLeft: '5px'}" size="mini" shape="circle" :ripple="true" @click="handleDeleteClick">删除</u-button>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</u-card>
|
|
|
- <u-card :title="'学员信息(' + getStudentsNumber() + ')'" title-size="32" margin="0px 0px 10px 0px" :head-style="cardStyle">
|
|
|
+ <u-card :title="'学员信息(' + getStudentsNumber(1) + ')'" title-size="32" margin="0px 0px 10px 0px" :head-style="cardStyle">
|
|
|
<u-grid :col="3" slot="body" :border="false">
|
|
|
<u-grid-item v-for="(item, index) in classInfo.studentSignList" :key="index" :custom-style="gridCustomStyle" @click="goToStudentInfo(item)">
|
|
|
<view class="class-student-col" :class="item.state ? 'student-active' : ''">
|
|
@@ -26,6 +30,33 @@
|
|
|
</u-grid-item>
|
|
|
</u-grid>
|
|
|
</u-card>
|
|
|
+ <u-card margin="0px 0px 10px 0px" :head-style="cardStyle" :show-head="false" @click="handleScanClick">
|
|
|
+ <view slot="body" style="display: flex;justify-content: space-between;">
|
|
|
+ <view style="font-size: 32rpx;font-weight: bold;color:#000000;">扫码</view>
|
|
|
+ <u-icon name="scan" size="32"></u-icon>
|
|
|
+ </view>
|
|
|
+ </u-card>
|
|
|
+ <u-card :title="'事假(' + getStudentsNumber(2) + ')'" title-size="32" margin="0px 0px 10px 0px" :head-style="cardStyle">
|
|
|
+ <u-grid :col="3" slot="body" :border="false">
|
|
|
+ <u-grid-item v-for="(item, index) in classInfo.studentLeaveRecordList" :key="index" :custom-style="gridCustomStyle">
|
|
|
+ <!-- <view class="class-student-col" :class="item.agreeType == 1 ? 'student-active' : ''" @click="handleleaveClick(item.leaveRecordId)"> -->
|
|
|
+ <view class="class-student-col" @click="handleleaveClick(item)">
|
|
|
+ {{item.name}}
|
|
|
+ <u-icon :name="item.agreeType == 1 ? 'bookmark-fill' : 'bookmark'" :color="mainColor" size="48"></u-icon>
|
|
|
+ </view>
|
|
|
+ </u-grid-item>
|
|
|
+ </u-grid>
|
|
|
+ </u-card>
|
|
|
+ <u-card :title="'续费卡(' + getStudentsNumber(3) + ')'" title-size="32" margin="0px 0px 10px 0px" :head-style="cardStyle">
|
|
|
+ <u-grid :col="3" slot="body" :border="false">
|
|
|
+ <u-grid-item v-for="(item, index) in classInfo.studentRenewList" :key="index" :custom-style="gridCustomStyle">
|
|
|
+ <view class="class-student-col" :class="item.state ? 'student-active' : ''" @click="handleVtCardClick(item)">
|
|
|
+ {{item.name}}
|
|
|
+ <u-icon name="bookmark" :color="mainColor" size="48"></u-icon>
|
|
|
+ </view>
|
|
|
+ </u-grid-item>
|
|
|
+ </u-grid>
|
|
|
+ </u-card>
|
|
|
<u-card title="班级近况" :sub-title="imgEdit ? '完成' : '管理'" :sub-title-color="imgEdit ? '#19be6b' : '#909399'" :show-foot="false"
|
|
|
title-size="32" margin="0px" :head-style="cardStyle" @sub-click="imgEdit = !imgEdit">
|
|
|
<view class="class-show-box" slot="body">
|
|
@@ -43,9 +74,42 @@
|
|
|
</view>
|
|
|
</u-card>
|
|
|
<view class="handle-fix-box">
|
|
|
- <u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="goToSignForm()">立即签到</u-button>
|
|
|
+ <u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="goToSignForm">立即签到</u-button>
|
|
|
</view>
|
|
|
<u-action-sheet :list="uploadTypeList" v-model="uploadTypeShow" @click="selectUploadType"></u-action-sheet>
|
|
|
+ <!-- 事假 -->
|
|
|
+ <u-popup v-model="leaveShow" mode="center" border-radius="30" width="600rpx">
|
|
|
+ <view class="common-title">事假</view>
|
|
|
+ <view class="menber-box">
|
|
|
+ <u-form :model="leaveForm" ref="leaveFormRef" label-width="140">
|
|
|
+ <u-form-item label="请假时间" prop="time">
|
|
|
+ <u-input v-model="leaveForm.time" disabled type="text" />
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item label="请假理由" prop="leaveReason">
|
|
|
+ <u-input v-model="leaveForm.leaveReason" disabled type="text" />
|
|
|
+ </u-form-item>
|
|
|
+ </u-form>
|
|
|
+ <view style="height:20px;"></view>
|
|
|
+ <u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="handleAgreeClick">同意</u-button>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+ <!-- 续费卡 -->
|
|
|
+ <u-popup v-model="vtCardShow" mode="center" border-radius="30" width="600rpx">
|
|
|
+ <view class="common-title">续费卡</view>
|
|
|
+ <view class="menber-box">
|
|
|
+ <u-radio-group v-model="vtCardValue" @change="handleRadioChange">
|
|
|
+ <u-radio class="menber-col" v-for="(item,index) in vtCardList" :key="index" :name="item.cardName">
|
|
|
+ <view class="menber-label">卡名:{{ item.cardName }}</view>
|
|
|
+ <!-- <view class="menber-label">售价: ¥ 1111</view> -->
|
|
|
+ <!-- <view class="menber-label">使用时间: 11111</view> -->
|
|
|
+ <!-- <u-checkbox v-model="true" active-color="#ff6e3e">选择</u-checkbox> -->
|
|
|
+ <!-- <view class="menber-icon iconfont iconzu4931"></view> -->
|
|
|
+ </u-radio>
|
|
|
+ </u-radio-group>
|
|
|
+ <view style="height:20px;"></view>
|
|
|
+ <u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="handleAffirmClick">确认</u-button>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
<u-top-tips ref="uTips"></u-top-tips>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -66,6 +130,7 @@
|
|
|
data() {
|
|
|
return {
|
|
|
classId: '',
|
|
|
+ studentId: '',
|
|
|
classInfo: {
|
|
|
name: '',
|
|
|
classStartDate: '',
|
|
@@ -77,6 +142,8 @@
|
|
|
classExtrasList: [],
|
|
|
studentSignList: [],
|
|
|
showList: [],
|
|
|
+ studentLeaveRecordList: [],
|
|
|
+ studentRenewList: []
|
|
|
},
|
|
|
classShowList: [],
|
|
|
uploadTypeShow: false,
|
|
@@ -93,7 +160,13 @@
|
|
|
},
|
|
|
gridCustomStyle: {
|
|
|
padding: '0 2px'
|
|
|
- }
|
|
|
+ },
|
|
|
+ leaveShow: false,
|
|
|
+ leaveForm: {},
|
|
|
+ vtCardShow: false,
|
|
|
+ vtCardId: '',
|
|
|
+ vtCardValue: '',
|
|
|
+ vtCardList: [],
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
@@ -121,7 +194,47 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- // 文件上传成功回调
|
|
|
+ // 扫码
|
|
|
+ handleScanClick() {
|
|
|
+ try {
|
|
|
+ let that = this
|
|
|
+ uni.scanCode({
|
|
|
+ onlyFromCamera: true,
|
|
|
+ success: function (res) {
|
|
|
+ // const studentId = parseInt(res.result)
|
|
|
+ const studentId = 8999
|
|
|
+ const classId = parseInt(that.classId)
|
|
|
+ NET.request(API.classCourseWriteOff, {
|
|
|
+ studentId,classId
|
|
|
+ }, 'POST').then(res => {
|
|
|
+ if(res.status == 10000) {
|
|
|
+ that.$refs.uTips.show({
|
|
|
+ title: res.message,
|
|
|
+ type: 'success',
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ that.$refs.uTips.show({
|
|
|
+ title: res.message,
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fail: function (res) {
|
|
|
+ that.$refs.uTips.show({
|
|
|
+ title: "调用摄像头失败",
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ },
|
|
|
+ });
|
|
|
+ } catch {
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: "调用摄像头失败",
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 班级近况
|
|
|
getClassShow() {
|
|
|
NET.request(API.getClassDetailShowList, {
|
|
|
id: this.classId,
|
|
@@ -136,9 +249,111 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ // 删除班级(班级内无学员)
|
|
|
+ handleDeleteClick() {
|
|
|
+ NET.request(API.deleteById, {
|
|
|
+ id: parseInt(this.classId)
|
|
|
+ }, 'POST').then( res=> {
|
|
|
+ if(res.status == 10000) {
|
|
|
+ uni.navigateBack({})
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 获取学生数量
|
|
|
- getStudentsNumber() {
|
|
|
- return this.classInfo.studentSignList.length
|
|
|
+ getStudentsNumber(num) {
|
|
|
+ // 1 学生数晾 2 事假数量 3 续费卡数量
|
|
|
+ switch (num){
|
|
|
+ case 1:
|
|
|
+ return this.classInfo.studentSignList.length
|
|
|
+ case 2:
|
|
|
+ return this.classInfo.studentLeaveRecordList.length
|
|
|
+ case 3:
|
|
|
+ return this.classInfo.studentRenewList.length
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 事假信息
|
|
|
+ handleleaveClick(item) {
|
|
|
+ if(agreeType == 1) return
|
|
|
+ NET.request(API.leaveLessonsInfo,{
|
|
|
+ id: parseInt(item.leaveRecordId)
|
|
|
+ },'POST').then(res=> {
|
|
|
+ if(res.status == 10000) {
|
|
|
+ this.leaveForm = { ...res.data }
|
|
|
+ this.leaveShow = true
|
|
|
+ } else {
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: res.message,
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 事假信息->同意
|
|
|
+ handleAgreeClick() {
|
|
|
+ NET.request(API.leaveLessonsOk, {
|
|
|
+ leaveId: parseInt(this.leaveForm.leaveId)
|
|
|
+ }, 'POST').then(res => {
|
|
|
+ if(res.status == 10000) {
|
|
|
+ this.leaveShow = false
|
|
|
+ this.leaveForm = {}
|
|
|
+ this.initialize()
|
|
|
+ } else {
|
|
|
+ this.leaveShow = false
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: res.message,
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 续费卡列表
|
|
|
+ handleVtCardClick(item) {
|
|
|
+ this.studentId = parseInt(item.id)
|
|
|
+ const data = {
|
|
|
+ studentId: parseInt(this.studentId),
|
|
|
+ classId: parseInt(this.classId)
|
|
|
+ }
|
|
|
+ NET.request(API.stuRenewalCardList, data, 'POST').then(res=> {
|
|
|
+ if(res.status == 10000) {
|
|
|
+ this.vtCardList = res.data
|
|
|
+ this.vtCardShow = true
|
|
|
+ } else {
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: res.message,
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ this.vtCardShow = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 续费卡切换
|
|
|
+ handleRadioChange(cardName) {
|
|
|
+ this.vtCardId = this.vtCardList.find( item => item.cardName = cardName).id
|
|
|
+ this.vtCardValue = cardName
|
|
|
+ },
|
|
|
+ // 续费卡确认
|
|
|
+ handleAffirmClick() {
|
|
|
+ const data = {
|
|
|
+ cardId: parseInt(this.vtCardId),
|
|
|
+ studentId: parseInt(this.studentId),
|
|
|
+ classId: parseInt(this.classId)
|
|
|
+ }
|
|
|
+ NET.request(API.openRenewalCard, data,'POST').then(res=> {
|
|
|
+ if(res.status == 10000) {
|
|
|
+ this.vtCardShow = false
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: res.message,
|
|
|
+ type: 'success',
|
|
|
+ })
|
|
|
+ this.initialize()
|
|
|
+ } else {
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: res.message,
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ this.vtCardShow = false
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 选择上传文件类型
|
|
|
selectUploadType(index) {
|
|
@@ -214,6 +429,20 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ // 跳转修改班级
|
|
|
+ handleUpdateClassClick() {
|
|
|
+ const form = {
|
|
|
+ classId: this.classId,
|
|
|
+ name: this.classInfo.name,
|
|
|
+ startDate: this.classInfo.classStartDate,
|
|
|
+ endDate: this.classInfo.classEndDate,
|
|
|
+ timeReqList: this.classInfo.classExtrasList,
|
|
|
+ maxStudentCount: this.classInfo.maxStudentCount
|
|
|
+ }
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pagesClass/updateClassForm?form=' + encodeURIComponent(JSON.stringify(form))
|
|
|
+ });
|
|
|
+ },
|
|
|
// 跳转学生详情
|
|
|
goToStudentInfo(item) {
|
|
|
uni.navigateTo({
|
|
@@ -227,6 +456,12 @@
|
|
|
url: '/pagesClass/signForm?id=' + this.classId + '&status=' + this.classInfo.signStatus
|
|
|
});
|
|
|
},
|
|
|
+ // 跳转续费卡详情
|
|
|
+ jumpVtCardPage(id) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pagesClass/vtCardInfo?id=${id}`
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
@@ -317,5 +552,56 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .menber-box {
|
|
|
+ width: 100%;
|
|
|
+ // float: left;
|
|
|
+ padding: 10px 15px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+
|
|
|
+ .menber-col {
|
|
|
+ width: 100%;
|
|
|
+ padding: 15px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ display: inline-block;
|
|
|
+ background-color: #FFFFFF;
|
|
|
+ border-radius: 15px;
|
|
|
+ box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
|
|
|
+ position: relative;
|
|
|
+ overflow: hidden;
|
|
|
+ box-sizing: border-box;
|
|
|
+
|
|
|
+ .menber-label {
|
|
|
+ width: 100%;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ float: left;
|
|
|
+ font-size: 14px;
|
|
|
+ // line-height: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .menber-num {
|
|
|
+ width: 100%;
|
|
|
+ float: left;
|
|
|
+ font-size: 26px;
|
|
|
+ line-height: 28px;
|
|
|
+ color: $mainColor;
|
|
|
+ }
|
|
|
+
|
|
|
+ .menber-icon {
|
|
|
+ font-size: 100px;
|
|
|
+ color: $mainColor;
|
|
|
+ position: absolute;
|
|
|
+ right: -5px;
|
|
|
+ bottom: -30px;
|
|
|
+ opacity: 0.5;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .common-title {
|
|
|
+ width:100%;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 20px;
|
|
|
+ margin: 10px 0;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|