Ver código fonte

选择活动是时需要选中第一个学生编号

lex-xin 3 anos atrás
pai
commit
0e5bd6acd3
2 arquivos alterados com 17 adições e 3 exclusões
  1. 10 2
      src/views/teacher/VIP00Apply.vue
  2. 7 1
      src/views/teacher/VIP11Apply.vue

+ 10 - 2
src/views/teacher/VIP00Apply.vue

@@ -345,9 +345,13 @@
 			onGetSheetList(name) { // 获取科目列表
 				let sheetForm = this.sheetForm
 				sheetForm.columns = []
-				if (!this.form.vipGroupCategoryId && name == 'vipGroupActivity') { // 判断是否选择了课程形式
+				console.log(this.checkboxSelectDataList)
+				if(!this.form.vipGroupCategoryId &&  name == 'vipGroupActivity') {
 					this.$toast('请选择课程形式')
 					return
+				} else if ((!this.checkboxSelectDataList || this.checkboxSelectDataList && this.checkboxSelectDataList.length <= 0) && name == 'vipGroupActivity') { // 判断是否选择了课程形式
+					this.$toast('请选择上课学生')
+					return
 				}
 				sheetForm.sheetStatus = true
 				sheetForm.loading = true
@@ -401,8 +405,10 @@
 						}
 					})
 				} else if (sheetForm.currentType == 'vipGroupActivity') { // 活动文案
+					let firstStudentId = this.checkboxSelectDataList.length > 0 ? this.checkboxSelectDataList[0].userId : null
 					findByVipGroupCategory({
-                        categoryId: this.form.vipGroupCategoryId
+                        categoryId: this.form.vipGroupCategoryId,
+						firstStudentId
 					}).then(res => {
 						let result = res.data
 						if (result.code == 200 && result.data.length > 0) {
@@ -1165,6 +1171,8 @@
 				form.totalClassTimes = Number(form.onlineClassesNums) + Number(form.offlineClassesNums) + Number(this.other.giveNum)
 				form.paymentExpireDate = form.coursesExpireDate
 				form.studentIdList = this.checkboxSelectIds.join(',')
+
+				form.firstStudentId = this.checkboxSelectDataList.length > 0 ? this.checkboxSelectDataList[0].userId : null
 				let params = {
 					courseSchedules: this.timeTable,
 					vipGroupApplyBaseInfo: form

+ 7 - 1
src/views/teacher/VIP11Apply.vue

@@ -7,13 +7,13 @@
 			<van-field v-model="formName.subjectListName" @click="onGetSheetList('subjectList')" label="科目名称" :readonly="true" input-align="right" is-link size="large" placeholder="请选择" />
 			<van-field v-model="formName.vipGroupCategoryName" @click="onGetSheetList('vipGroupCategory')" label="课程形式" :readonly="true" input-align="right" is-link size="large" placeholder="请选择" />
 			<van-field v-model="formName.educationalTeacherName" @click="onGetSheetList('teacherList')" label="乐团主管" :readonly="true" input-align="right" is-link size="large" placeholder="请选择" />
-			<van-field v-model="formName.vipGroupActivityName" @click="onGetSheetList('vipGroupActivity')" label="活动方案" :readonly="true" input-align="right" is-link size="large" placeholder="请选择" />
 			<van-cell title="上课学生" @click="onCheckStudent" :readonly="true" input-align="right" :is-link="checkboxSelectDataList.length > 0 ? false : true" size="large" :value="checkboxSelectDataList.length > 0 ? '重新选择' : '请选择'" :value-class="checkboxSelectDataList.length > 0 ? 'studentColor' : null" />
 			<div v-if="checkboxSelectDataList.length > 0" style="text-align: center;line-height: 1.8; padding: .05rem 0;background: #fafbff;">
 				<p style="color: #323233;" v-for="(item, index) in checkboxSelectDataList" :key="index">
 					{{ item.userName }} - {{ item.phone }}
 				</p>
 			</div>
+			<van-field v-model="formName.vipGroupActivityName" @click="onGetSheetList('vipGroupActivity')" label="活动方案" :readonly="true" input-align="right" is-link size="large" placeholder="请选择" />
 		</van-cell-group>
 		<div class="vip-title">课时组成</div>
 		<van-cell-group>
@@ -330,6 +330,9 @@
 				if (!this.form.vipGroupCategoryId && name == 'vipGroupActivity') { // 判断是否选择了课程形式
 					this.$toast('请选择课程形式')
 					return
+				} else if ((!this.checkboxSelectDataList || this.checkboxSelectDataList && this.checkboxSelectDataList.length <= 0) && name == 'vipGroupActivity') { // 判断是否选择了课程形式
+					this.$toast('请选择上课学生')
+					return
 				}
 				sheetForm.sheetStatus = true
 				sheetForm.loading = true
@@ -385,9 +388,11 @@
 						}
 					})
 				} else if (sheetForm.currentType == 'vipGroupActivity') { // 活动文案
+					let firstStudentId = this.checkboxSelectDataList.length > 0 ? this.checkboxSelectDataList[0].userId : null
 					findByVipGroupCategory({
 						categoryId: this.form.vipGroupCategoryId,
 						onlySpecialActivity: true,
+						firstStudentId
 					}).then(res => {
 						let result = res.data
 						if (result.code == 200 && result.data.length > 0) {
@@ -1075,6 +1080,7 @@
 				form.totalClassTimes = Number(form.onlineClassesNums) + Number(form.offlineClassesNums) + Number(this.other.giveNum)
 				form.paymentExpireDate = form.coursesExpireDate
 				form.studentIdList = this.checkboxSelectIds.join(',')
+				form.firstStudentId = this.checkboxSelectDataList.length > 0 ? this.checkboxSelectDataList[0].userId : null
 				let params = {
 					courseSchedules: this.timeTable,
 					vipGroupApplyBaseInfo: form