|
@@ -47,9 +47,9 @@
|
|
|
</template>
|
|
|
</van-field>
|
|
|
<div class="title">乐理知识</div>
|
|
|
- <van-field required @click="onGetSheetList('examMusicTheory')" readonly clickable name="nation" label="专业级别" v-model="form.examMusicTheoryName" placeholder="请选择专业级别" is-link />
|
|
|
+ <van-field required @click="onGetSheetList('examMusicTheory')" readonly clickable name="nation" label="专业级别" v-model="formText.examMusicTheoryName" placeholder="请选择专业级别" is-link />
|
|
|
<!-- <van-field readonly clickable name="nation" label="上次考级级别" placeholder="请选择" is-link /> -->
|
|
|
- <van-field readonly :required="form.examMusicTheoryId ? true : false" clearable name="code" label="上次考级证书" >
|
|
|
+ <van-field readonly :required="form.examMusicTheoryId == 999 ? true : false" clearable name="code" label="上次考级证书" >
|
|
|
<template #input>
|
|
|
<van-uploader
|
|
|
name="certificate2"
|
|
@@ -128,7 +128,7 @@ import MHeader from '@/components/MHeader'
|
|
|
import MStep from '@/components/MStep'
|
|
|
import setLoading from '@/utils/loading'
|
|
|
import { patternPhone } from '@/utils/validateRules'
|
|
|
-import { getExamSubjects, getExamSubjectLevel, getExamSubjectSong, uploadFile, getTheoryLevelList, examRegistrationAdd, examRegistrationUpdate } from './SignUpApi'
|
|
|
+import { getExamSubjects, getExamSubjectLevel, getExamSubjectSong, uploadFile, getTheoryLevelList } from './SignUpApi'
|
|
|
const levelToCN = {
|
|
|
1: "一级",
|
|
|
2: "二级",
|
|
@@ -147,9 +147,13 @@ export default {
|
|
|
data () {
|
|
|
const examId = localStorage.getItem('examId')
|
|
|
const organId = localStorage.getItem('organId')
|
|
|
+ const examRegistrationParams = localStorage.getItem("examRegistrationParams") ? JSON.parse(localStorage.getItem("examRegistrationParams")) : null
|
|
|
+ const query = this.$route.query
|
|
|
return {
|
|
|
examId: examId,
|
|
|
organId: organId,
|
|
|
+ examRegistrationParams: examRegistrationParams,
|
|
|
+ studentName: query.studentName,
|
|
|
patternPhone: patternPhone,
|
|
|
sheetForm: { // 上拉弹窗
|
|
|
currentType: null, // 当前选择的类型
|
|
@@ -176,12 +180,16 @@ export default {
|
|
|
},
|
|
|
form: {
|
|
|
subjectId: null,
|
|
|
- levelId: null,
|
|
|
+ levelId: null, // 级别
|
|
|
+ examSubjectSongId: null, // 级别编号
|
|
|
adviserName: null, // 老师姓名
|
|
|
adviserPhone: null, // 联系电话
|
|
|
lastExamCertificateUrl: null,
|
|
|
lastMusicTheoryCertificateUrl: null,
|
|
|
examMusicTheoryId: null,
|
|
|
+ examMusicTheoryLevel: null,
|
|
|
+ levelFee: 0,// 级别费用
|
|
|
+ theoryLevelFee: 0, // 乐理费用
|
|
|
},
|
|
|
formText: {
|
|
|
subjectName: null,
|
|
@@ -218,6 +226,11 @@ export default {
|
|
|
// localStorage.setItem('userInfo', decodeURI(params.Authorization))
|
|
|
// }
|
|
|
this.__init()
|
|
|
+ if(this.examRegistrationParams) {
|
|
|
+ this.getRegisterInfo(this.examRegistrationParams)
|
|
|
+ } else {
|
|
|
+ this.getTheoryLevelList()
|
|
|
+ }
|
|
|
// this.form.levelId = 1
|
|
|
// this.practiceNum = 2
|
|
|
// this.practiceSongIdList = ""
|
|
@@ -226,6 +239,116 @@ export default {
|
|
|
// this.getExamSubjectSong()
|
|
|
},
|
|
|
methods: {
|
|
|
+ async getRegisterInfo(data) {
|
|
|
+ if(!data) { // 判断是否有数据
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let form = this.form,
|
|
|
+ formText = this.formText
|
|
|
+ form.subjectId = data.subjectId // 报考专业专业
|
|
|
+ formText.subjectName = data.subjectName // 报考专业名称
|
|
|
+ form.levelFee = data.levelFee,// 级别费用
|
|
|
+ form.theoryLevelFee = data.theoryLevelFee, // 乐理费用
|
|
|
+ this.getExamSubjectLevel((tempList) => {
|
|
|
+ //
|
|
|
+ tempList.forEach(item => {
|
|
|
+ if(item.level == data.level) {
|
|
|
+ form.levelId = item.value
|
|
|
+ form.examSubjectSongId = item.id
|
|
|
+ formText.levelName = levelToCN[data.level]
|
|
|
+ this.practiceNum = item.practiceNum
|
|
|
+ this.practiceSongIdList = item.practiceSongIdList
|
|
|
+ this.performNum = item.performNum
|
|
|
+ this.performSongIdList = item.performSongIdList
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ // 报考曲目
|
|
|
+ this.getExamSubjectSong()
|
|
|
+
|
|
|
+ const songJsonParse = data.songJson ? JSON.parse(data.songJson) : []
|
|
|
+ let tempPracticeArr = [],
|
|
|
+ tempPracticeStr = [],
|
|
|
+ tempPerformArr = [],
|
|
|
+ tempPerformStr = []
|
|
|
+ songJsonParse.forEach(item => {
|
|
|
+ if(item.type == "PERFORM") {
|
|
|
+ tempPerformArr.push(item)
|
|
|
+ tempPerformStr.push(item.songName + '-' + item.songAuthor)
|
|
|
+ this.performNumSelectIds.push(item.id)
|
|
|
+ } else if(item.type == "PRACTICE") {
|
|
|
+ tempPracticeArr.push(item)
|
|
|
+ tempPracticeStr.push(item.songName + '-' + item.songAuthor)
|
|
|
+ this.practiceSelectIds.push(item.id)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 练习课 "PRACTICE"
|
|
|
+ this.practiceSelect = tempPracticeStr
|
|
|
+ if(this.practiceSongIdList) {
|
|
|
+ this.practiceSelectList = tempPracticeArr
|
|
|
+ } else {
|
|
|
+ tempPracticeArr.forEach(item => {
|
|
|
+ item.name = item.songName
|
|
|
+ item.author = item.songAuthor
|
|
|
+ const urlList = item.uploadUrl ? item.uploadUrl.split(',') : []
|
|
|
+ let tempUrl = []
|
|
|
+ urlList.forEach(url => {
|
|
|
+ tempUrl.push({
|
|
|
+ url: url
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.practiceUpload.push(tempUrl)
|
|
|
+ })
|
|
|
+ this.practiceSelectUploadList = tempPracticeArr
|
|
|
+ }
|
|
|
+ // 演奏课 "PERFORM"
|
|
|
+ this.performNumSelect = tempPerformStr
|
|
|
+ if(this.performSongIdList) {
|
|
|
+ this.performNumSelectList = tempPerformArr
|
|
|
+ } else {
|
|
|
+ tempPerformArr.forEach(item => {
|
|
|
+ item.name = item.songName
|
|
|
+ item.author = item.songAuthor
|
|
|
+ const urlList = item.uploadUrl ? item.uploadUrl.split(',') : []
|
|
|
+ let tempUrl = []
|
|
|
+ urlList.forEach(url => {
|
|
|
+ tempUrl.push({
|
|
|
+ url: url
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.performNumUpload.push(tempUrl)
|
|
|
+ })
|
|
|
+ this.performNumSelectUploadList = tempPerformArr
|
|
|
+ }
|
|
|
+ }) // 获取报考级别
|
|
|
+
|
|
|
+ // 上传证书(上次考级证书)
|
|
|
+ if(data.lastExamCertificateUrl) {
|
|
|
+ form.lastExamCertificateUrl = data.lastExamCertificateUrl
|
|
|
+ this.uploadCertificate = [{ url: data.lastExamCertificateUrl }]
|
|
|
+ }
|
|
|
+ // 乐理知识
|
|
|
+ this.getTheoryLevelList((tempList) => {
|
|
|
+ tempList.forEach(item => {
|
|
|
+ if(!data.examMusicTheoryId && !data.examMusicTheoryLevel) {
|
|
|
+ form.examMusicTheoryId = 999
|
|
|
+ form.examMusicTheoryLevel = 999
|
|
|
+ formText.examMusicTheoryName = "免考"
|
|
|
+ } else if(item.level == data.examMusicTheoryLevel) {
|
|
|
+ form.examMusicTheoryId = item.id
|
|
|
+ form.examMusicTheoryLevel = item.level
|
|
|
+ formText.examMusicTheoryName = item.text
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ if(data.lastMusicTheoryCertificateUrl) {
|
|
|
+ form.lastMusicTheoryCertificateUrl = data.lastMusicTheoryCertificateUrl
|
|
|
+ this.uploadCertificate2 = [{ url: data.lastMusicTheoryCertificateUrl }]
|
|
|
+ }
|
|
|
+ form.adviserName = data.adviserName
|
|
|
+ form.adviserPhone = data.adviserPhone
|
|
|
+ },
|
|
|
async __init() {
|
|
|
setLoading(true)
|
|
|
try {
|
|
@@ -241,17 +364,31 @@ export default {
|
|
|
})
|
|
|
this.examSubjectList = tempArr
|
|
|
}
|
|
|
-
|
|
|
+ } catch(err) {
|
|
|
+ //
|
|
|
+ }
|
|
|
+ setLoading(false)
|
|
|
+ },
|
|
|
+ async getTheoryLevelList(callBack) {
|
|
|
+ setLoading(true)
|
|
|
+ try {
|
|
|
const resTheory = await getTheoryLevelList({ examId: this.examId })
|
|
|
const resultTheory = resTheory.data
|
|
|
if(resultTheory.code == 200 && resultTheory.data.length > 0) {
|
|
|
- let tempArr2 = []
|
|
|
+ let tempArr2 = [{
|
|
|
+ id: 999,
|
|
|
+ value: 999,
|
|
|
+ text: "免考",
|
|
|
+ level: 999,
|
|
|
+ fee: 0
|
|
|
+ }]
|
|
|
resultTheory.data.forEach(item => {
|
|
|
item.value = item.id
|
|
|
item.text = levelToCN[item.level]
|
|
|
tempArr2.push(item)
|
|
|
})
|
|
|
this.examMusicTheoryList = tempArr2
|
|
|
+ callBack && callBack(tempArr2)
|
|
|
}
|
|
|
} catch(err) {
|
|
|
//
|
|
@@ -307,14 +444,16 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
if(sheetForm.currentType == "examSubject") {
|
|
|
- if(form.subjectId != value.examSubjectId) {
|
|
|
- form.subjectId = value.examSubjectId
|
|
|
+ if(form.subjectId != value.id) {
|
|
|
+ form.subjectId = value.id
|
|
|
formText.subjectName = value.name
|
|
|
this.examSubjectIndex = index
|
|
|
|
|
|
// 清除报考级别
|
|
|
form.levelId = null
|
|
|
formText.levelName = null
|
|
|
+ form.examSubjectSongId = null
|
|
|
+ form.levelFee = 0
|
|
|
this.levelIndex = 0
|
|
|
this.practiceNum = 0 // 练习曲数量
|
|
|
this.practiceSongIdList = null
|
|
@@ -325,6 +464,8 @@ export default {
|
|
|
sheetForm.sheetStatus = false
|
|
|
} else if(sheetForm.currentType == 'level') {
|
|
|
form.levelId = value.value
|
|
|
+ form.examSubjectSongId = value.id
|
|
|
+ form.levelFee = value.registrationFee // 级别费用
|
|
|
formText.levelName = value.text
|
|
|
this.levelIndex = index
|
|
|
this.practiceNum = value.practiceNum
|
|
@@ -335,12 +476,14 @@ export default {
|
|
|
this.getExamSubjectSong()
|
|
|
} else if(sheetForm.currentType == "examMusicTheory") {
|
|
|
form.examMusicTheoryId = value.value
|
|
|
- form.examMusicTheoryName = value.text
|
|
|
+ form.theoryLevelFee = value.fee
|
|
|
+ form.examMusicTheoryLevel = value.level
|
|
|
+ formText.examMusicTheoryName = value.text
|
|
|
this.examMusicTheoryIndex = index
|
|
|
sheetForm.sheetStatus = false
|
|
|
}
|
|
|
},
|
|
|
- async getExamSubjectLevel() {
|
|
|
+ async getExamSubjectLevel(callBack) {
|
|
|
setLoading(true)
|
|
|
try {
|
|
|
const form = this.form
|
|
@@ -354,23 +497,24 @@ export default {
|
|
|
tempArr.push(item)
|
|
|
})
|
|
|
this.levelList = tempArr
|
|
|
+ callBack && callBack(tempArr)
|
|
|
}
|
|
|
} catch(err) {
|
|
|
//
|
|
|
}
|
|
|
setLoading(false)
|
|
|
},
|
|
|
- async getExamSubjectSong() {
|
|
|
+ async getExamSubjectSong(callBack) {
|
|
|
setLoading(true)
|
|
|
try {
|
|
|
const form = this.form
|
|
|
const params = {
|
|
|
- // examSubjectId: form.subjectId,
|
|
|
- // examinationBasicId: this.examId,
|
|
|
- // level: form.levelId
|
|
|
- examSubjectId: 5,
|
|
|
- examinationBasicId: 6,
|
|
|
- level: 1
|
|
|
+ examSubjectId: form.subjectId,
|
|
|
+ examinationBasicId: this.examId,
|
|
|
+ level: form.levelId
|
|
|
+ // examSubjectId: 5,
|
|
|
+ // examinationBasicId: 6,
|
|
|
+ // level: 1
|
|
|
}
|
|
|
const res = await getExamSubjectSong(params)
|
|
|
const result = res.data
|
|
@@ -382,6 +526,8 @@ export default {
|
|
|
tempArr.push(item)
|
|
|
})
|
|
|
this.songList = tempArr
|
|
|
+
|
|
|
+ callBack && callBack(tempArr)
|
|
|
}
|
|
|
} catch(err) {
|
|
|
//
|
|
@@ -420,15 +566,6 @@ export default {
|
|
|
}
|
|
|
this.songSelectIndex = index
|
|
|
sheetSong.status = true
|
|
|
- // console.log(sheetSong)
|
|
|
- // if(this.examSubjectList.length > 0) {
|
|
|
- // sheetForm.sheetStatus = true
|
|
|
- // sheetForm.columns = this.examSubjectList
|
|
|
- // sheetForm.index = this.examSubjectIndex
|
|
|
- // } else {
|
|
|
- // this.$toast("暂无报考专业")
|
|
|
- // return
|
|
|
- // }
|
|
|
},
|
|
|
onPracticeConfirm(value) {
|
|
|
// 没有内容
|
|
@@ -563,12 +700,14 @@ export default {
|
|
|
const practiceUpload = this.practiceUpload
|
|
|
this.practiceSelectUploadList.forEach(item => {
|
|
|
let tempUrl = []
|
|
|
+ console.log(item)
|
|
|
practiceUpload[item.index].forEach(item => {
|
|
|
tempUrl.push(item.url)
|
|
|
})
|
|
|
songJson.push({
|
|
|
songName: item.name,
|
|
|
songAuthor: item.author,
|
|
|
+ index: item.index,
|
|
|
type: "PRACTICE",
|
|
|
uploadUrl: tempUrl.join(',')
|
|
|
})
|
|
@@ -594,6 +733,7 @@ export default {
|
|
|
songJson.push({
|
|
|
songName: item.name,
|
|
|
songAuthor: item.author,
|
|
|
+ index: item.index,
|
|
|
type: "PERFORM",
|
|
|
uploadUrl: tempUrl.join(',')
|
|
|
})
|
|
@@ -603,35 +743,29 @@ export default {
|
|
|
let form = this.form,
|
|
|
formText = this.formText
|
|
|
let params = {
|
|
|
+ studentName: this.studentName,
|
|
|
adviserName: form.adviserName,
|
|
|
adviserPhone: form.adviserPhone,
|
|
|
- examMusicTheoryId: form.examMusicTheoryId,
|
|
|
- examMusicTheoryLevel: formText.examMusicTheoryName,
|
|
|
- examSubjectSongId: form.subjectId,
|
|
|
+ examMusicTheoryId: form.examMusicTheoryId == 999 ? null : form.examMusicTheoryId,
|
|
|
+ examMusicTheoryLevel: form.examMusicTheoryLevel == 999 ? null : form.examMusicTheoryLevel,
|
|
|
examinationBasicId: this.examId,
|
|
|
lastExamCertificateUrl: form.lastExamCertificateUrl,
|
|
|
lastMusicTheoryCertificateUrl: form.lastMusicTheoryCertificateUrl,
|
|
|
level: form.levelId,
|
|
|
+ examSubjectSongId: form.examSubjectSongId,
|
|
|
subjectId: form.subjectId, // 考级专业
|
|
|
+ subjectName: formText.subjectName,
|
|
|
songJson: JSON.stringify(songJson),
|
|
|
- organId: this.organId
|
|
|
+ organId: this.organId,
|
|
|
+ levelFee: form.levelFee,
|
|
|
+ theoryLevelFee: form.theoryLevelFee
|
|
|
}
|
|
|
console.log("参数", params)
|
|
|
- const res = await examRegistrationAdd(params)
|
|
|
setLoading(false)
|
|
|
- const result = res.data
|
|
|
- if(result.code == 200) {
|
|
|
- const tempResult = result.data
|
|
|
- this.$router.push({
|
|
|
- path: '/signUpPayment',
|
|
|
- query: {
|
|
|
- examRegistrationId: tempResult.examRegister.id,
|
|
|
- payMap: JSON.stringify(tempResult.payMap)
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$toast(result.msg)
|
|
|
- }
|
|
|
+ localStorage.setItem("examRegistrationParams", JSON.stringify(params))
|
|
|
+ this.$router.push({
|
|
|
+ path: '/signUpPayment'
|
|
|
+ })
|
|
|
} catch(err) {
|
|
|
//
|
|
|
}
|
|
@@ -678,7 +812,7 @@ export default {
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
- if(form.examMusicTheoryId > 1 && !form.lastMusicTheoryCertificateUrl) {
|
|
|
+ if(form.examMusicTheoryId == 999 && !form.lastMusicTheoryCertificateUrl) {
|
|
|
this.$toast('请上传考级证书')
|
|
|
return false
|
|
|
}
|