1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["SignUpLevel"],{1710:function(e,t,a){},a276:function(e,t,a){"use strict";var r=a("1710"),i=a.n(r);i.a},a9ab:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"signUpLevel"},[a("m-step",{attrs:{number:3}}),e.examSubjectList.length>0?a("div",[a("div",{staticClass:"title"},[e._v("报考专业")]),a("van-field",{attrs:{readonly:"",required:"",name:"subjectId",label:"报考专业",placeholder:"请选择","is-link":""},on:{click:function(t){return e.onGetSheetList("examSubject")}},model:{value:e.formText.subjectName,callback:function(t){e.$set(e.formText,"subjectName",t)},expression:"formText.subjectName"}}),a("van-field",{attrs:{readonly:"",required:"",name:"levelId",label:"专业级别",placeholder:"请选择","is-link":""},on:{click:function(t){return e.onGetSheetList("level")}},model:{value:e.formText.levelName,callback:function(t){e.$set(e.formText,"levelName",t)},expression:"formText.levelName"}}),a("div",{staticClass:"title"},[e._v("报考曲目")]),e.form.levelId?a("div",{staticClass:"van-hairline--bottom"},[e.practiceSongIdList?a("div",{key:"practiceNum",staticClass:"van-hairline--bottom"},e._l(e.practiceNum,(function(t,r){return a("van-field",{key:r,attrs:{required:"",readonly:"",label:"练习曲"+e.numberToCN(r)+"名称及作者",placeholder:"请选择","is-link":""},on:{click:function(t){return e.onChangePractice("practice",r)}},model:{value:e.practiceSelect[r],callback:function(t){e.$set(e.practiceSelect,r,"string"===typeof t?t.trim():t)},expression:"practiceSelect[index]"}})})),1):a("div",{key:"practiceNum",staticClass:"van-hairline--bottom"},e._l(e.practiceNum,(function(t,r){return a("van-field",{key:r,attrs:{required:"",readonly:"",clearable:"",name:"code",label:"练习曲"+e.numberToCN(r)+"名称及作者"},scopedSlots:e._u([{key:"button",fn:function(){return[a("span",{staticClass:"codeText",on:{click:function(t){return e.onUploadSong("practiceNum",r)}}},[e._v("上传曲目")])]},proxy:!0}],null,!0),model:{value:e.practiceSelect[r],callback:function(t){e.$set(e.practiceSelect,r,"string"===typeof t?t.trim():t)},expression:"practiceSelect[index]"}})})),1),e.performSongIdList?a("div",{key:"performNum"},e._l(e.performNum,(function(t,r){return a("van-field",{key:r,attrs:{required:"",readonly:"",label:"演奏曲"+e.numberToCN(r)+"名称及作者",placeholder:"请选择","is-link":""},on:{click:function(t){return e.onChangePractice("performNum",r)}},model:{value:e.performNumSelect[r],callback:function(t){e.$set(e.performNumSelect,r,"string"===typeof t?t.trim():t)},expression:"performNumSelect[index]"}})})),1):a("div",{key:"performNum"},e._l(e.performNum,(function(t,r){return a("van-field",{key:r,attrs:{required:"",readonly:"",clearable:"",name:"code",label:"演奏曲"+e.numberToCN(r)+"名称及作者"},scopedSlots:e._u([{key:"button",fn:function(){return[a("span",{staticClass:"codeText",on:{click:function(t){return e.onUploadSong("performNum",r)}}},[e._v("上传曲目")])]},proxy:!0}],null,!0),model:{value:e.performNumSelect[r],callback:function(t){e.$set(e.performNumSelect,r,"string"===typeof t?t.trim():t)},expression:"performNumSelect[index]"}})})),1)]):e._e(),a("van-field",{attrs:{readonly:"",clearable:"",name:"code",label:"已获最高等级专业证书"},scopedSlots:e._u([{key:"input",fn:function(){return[a("van-uploader",{attrs:{name:"certificate","before-read":e.beforeRead,"before-delete":e.beforeDelete,"after-read":e.afterRead,accept:"image/*","max-count":1},model:{value:e.uploadCertificate,callback:function(t){e.uploadCertificate=t},expression:"uploadCertificate"}})]},proxy:!0}],null,!1,1933645032)})],1):e._e(),a("div",{staticClass:"title"},[e._v("乐理知识")]),a("van-field",{attrs:{required:"",readonly:"",clickable:"",name:"nation",label:"乐理级别",placeholder:"请选择乐理级别","is-link":""},on:{click:function(t){return e.onGetSheetList("examMusicTheory")}},model:{value:e.formText.examMusicTheoryName,callback:function(t){e.$set(e.formText,"examMusicTheoryName",t)},expression:"formText.examMusicTheoryName"}}),a("van-field",{attrs:{readonly:"",clearable:"",name:"code",label:"已获最高等级乐理证书"},scopedSlots:e._u([{key:"input",fn:function(){return[a("van-uploader",{attrs:{name:"certificate2","before-read":e.beforeRead,"before-delete":e.beforeDelete,"after-read":e.afterRead,accept:"image/*","max-count":1},model:{value:e.uploadCertificate2,callback:function(t){e.uploadCertificate2=t},expression:"uploadCertificate2"}})]},proxy:!0}])}),a("div",{staticClass:"title"},[e._v("指导老师")]),a("van-field",{attrs:{name:"adviserName",label:"老师姓名",placeholder:"请输入老师姓名"},model:{value:e.form.adviserName,callback:function(t){e.$set(e.form,"adviserName",t)},expression:"form.adviserName"}}),a("van-field",{attrs:{name:"adviserPhone",maxlength:"11",type:"tel",label:"联系方式",placeholder:"请输入联系方式"},model:{value:e.form.adviserPhone,callback:function(t){e.$set(e.form,"adviserPhone",t)},expression:"form.adviserPhone"}}),a("div",{staticClass:"m-btn-group"},[a("van-button",{staticClass:"btn_prev",staticStyle:{"background-color":"transparent"},attrs:{round:"",color:"#2DC7AA",plain:""},on:{click:e.onBack}},[e._v("上一步")]),a("van-button",{attrs:{round:"",color:"#2DC7AA"},on:{click:e.onSubmit}},[e._v("确认报名")])],1),a("van-popup",{attrs:{position:"bottom"},model:{value:e.sheetForm.sheetStatus,callback:function(t){e.$set(e.sheetForm,"sheetStatus",t)},expression:"sheetForm.sheetStatus"}},[a("van-picker",{attrs:{loading:e.sheetForm.loading,"default-index":e.sheetForm.index,columns:e.sheetForm.columns,"show-toolbar":""},on:{cancel:function(t){e.sheetForm.sheetStatus=!1},confirm:e.onSheetConfirm}})],1),a("van-popup",{attrs:{position:"bottom"},model:{value:e.sheetSong.status,callback:function(t){e.$set(e.sheetSong,"status",t)},expression:"sheetSong.status"}},[a("van-picker",{attrs:{"default-index":e.sheetSong.index,columns:e.sheetSong.columns,"show-toolbar":""},on:{cancel:function(t){e.sheetSong.status=!1},confirm:e.onPracticeConfirm}})],1),a("van-popup",{staticClass:"van-popup-song",attrs:{"close-on-click-overlay":!1},model:{value:e.songUpload.songStatus,callback:function(t){e.$set(e.songUpload,"songStatus",t)},expression:"songUpload.songStatus"}},[a("div",{staticClass:"song-popup"},[a("div",{staticClass:"title"},[e._v("自定义曲目")]),a("van-field",{attrs:{name:"songName",label:"曲名",placeholder:"请输入曲名"},scopedSlots:e._u([{key:"label",fn:function(){return[a("i",{staticStyle:{color:"#ee0a24"}},[e._v("*")]),e._v("曲名")]},proxy:!0}]),model:{value:e.songUpload.name,callback:function(t){e.$set(e.songUpload,"name",t)},expression:"songUpload.name"}}),a("van-field",{attrs:{name:"songAuthor",label:"作者",placeholder:"请输入作者"},scopedSlots:e._u([{key:"label",fn:function(){return[a("i",{staticStyle:{color:"#ffffff"}},[e._v("*")]),e._v("作者")]},proxy:!0}]),model:{value:e.songUpload.author,callback:function(t){e.$set(e.songUpload,"author",t)},expression:"songUpload.author"}}),a("van-field",{attrs:{readonly:"",clearable:""},scopedSlots:e._u([{key:"input",fn:function(){return["practiceNum"==e.songUpload.indexName?a("van-uploader",{attrs:{name:e.songUpload.indexName+"-"+e.songUpload.index,"before-read":e.beforeRead,"before-delete":e.beforeDelete,"after-read":e.afterRead,multiple:"",accept:"image/*","max-count":5},model:{value:e.practiceUpload[e.songUpload.index],callback:function(t){e.$set(e.practiceUpload,e.songUpload.index,"string"===typeof t?t.trim():t)},expression:"practiceUpload[songUpload.index]"}}):e._e(),"performNum"==e.songUpload.indexName?a("van-uploader",{attrs:{name:e.songUpload.indexName+"-"+e.songUpload.index,"before-read":e.beforeRead,"before-delete":e.beforeDelete,"after-read":e.afterRead,multiple:"",accept:"image/*","max-count":5},model:{value:e.performNumUpload[e.songUpload.index],callback:function(t){e.$set(e.performNumUpload,e.songUpload.index,"string"===typeof t?t.trim():t)},expression:"performNumUpload[songUpload.index]"}}):e._e()]},proxy:!0}])}),a("p",{staticClass:"song-popup-tips"},[a("i",{staticStyle:{color:"#ee0a24"}},[e._v("*")]),e._v("支持格式:png,jpg,bmp")]),a("div",{staticClass:"popup-group"},[a("span",{on:{click:e.onSaveCancel}},[e._v("取消")]),a("span",{staticClass:"popup-sure",on:{click:e.onSaveUpload}},[e._v("确定")])])],1)])],1)},i=[],n=a("a34a"),o=a.n(n),s=a("ab6b"),c=a("3908"),l=a("b48b"),u=a("8900");function m(e,t,a,r,i,n,o){try{var s=e[n](o),c=s.value}catch(l){return void a(l)}s.done?t(c):Promise.resolve(c).then(r,i)}function p(e){return function(){var t=this,a=arguments;return new Promise((function(r,i){var n=e.apply(t,a);function o(e){m(n,r,i,o,s,"next",e)}function s(e){m(n,r,i,o,s,"throw",e)}o(void 0)}))}}var d={1:"壹级",2:"贰级",3:"叁级",4:"肆级",5:"伍级",6:"陆级",7:"柒级",8:"捌级",9:"玖级",10:"拾级"},h={name:"signUpLevel",components:{MStep:s["a"]},data:function(){var e=localStorage.getItem("examId"),t=localStorage.getItem("organId"),a=localStorage.getItem("examRegistrationParams")?JSON.parse(localStorage.getItem("examRegistrationParams")):null;return{examId:e,organId:t,examRegistrationParams:a,patternPhone:l["a"],sheetForm:{currentType:null,sheetStatus:!1,loading:!1,index:0,columns:[]},examSubjectList:[],examSubjectIndex:0,levelList:[],levelIndex:0,practiceNum:0,practiceSongIdList:null,performNum:0,performSongIdList:null,songList:[],songUpload:{songStatus:!1,indexName:null,index:null,name:null,author:null},form:{subjectId:null,levelId:null,examSubjectSongId:null,adviserName:null,adviserPhone:null,lastExamCertificateUrl:null,lastMusicTheoryCertificateUrl:null,examMusicTheoryId:null,examMusicTheoryLevel:null,levelFee:0,theoryLevelFee:0},formText:{subjectName:null,levelName:null,examMusicTheoryName:null},sheetSong:{status:!1,index:0,columns:[]},practiceSelect:[],practiceSelectUploadList:[],practiceSelectList:[],practiceSelectIds:[],performNumSelect:[],performNumSelectUploadList:[],performNumSelectList:[],performNumSelectIds:[],songSelectIndex:null,uploadCertificate:[],uploadCertificate2:[],practiceUpload:[],practiceUploadTemp:[],performNumUpload:[],performNumUploadTemp:[],examMusicTheoryList:[],examMusicTheoryIndex:0}},mounted:function(){this.__init(),this.examRegistrationParams&&this.getRegisterInfo(this.examRegistrationParams),this.onCheckOrder()},methods:{onCheckOrder:function(){var e=p(o.a.mark((function e(){var t,a,r=this;return o.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(u["e"])({examinationBasicId:this.examId});case 2:t=e.sent,a=t.data,200==a.code&&a.data&&this.$dialog.confirm({title:"提示",message:"您当前有待支付订单",confirmButtonColor:"#269a93",cancelButtonText:"取消订单",confirmButtonText:"去支付"}).then((function(){r.$router.push({path:"/signUpPayment",query:{orderNo:a.data.orderNo,examRegistrationId:a.data.examRegistrationId}})})).catch((function(){var e=a.data.orderNo;r.$dialog.close(),e&&r.onCloseOrder(e)}));case 5:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),onCloseOrder:function(){var e=p(o.a.mark((function e(t){return o.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return Object(c["a"])(!0),e.next=3,Object(u["a"])({orderNo:t});case 3:Object(c["a"])(!1);case 4:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}(),getRegisterInfo:function(){var e=p(o.a.mark((function e(t){var a,r,i=this;return o.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:a=this.form,r=this.formText,a.subjectId=t.subjectId,r.subjectName=t.subjectName,a.levelFee=t.levelFee,a.theoryLevelFee=t.theoryLevelFee,this.getExamSubjectLevel((function(e){e.forEach((function(e){e.level==t.level&&(a.levelId=e.value,a.examSubjectSongId=e.id,r.levelName=d[t.level],i.practiceNum=e.practiceNum,i.practiceSongIdList=e.practiceSongIdList,i.performNum=e.performNum,i.performSongIdList=e.performSongIdList)})),i.getExamSubjectSong();var n=t.songJson?JSON.parse(t.songJson):[],o=[],s=[],c=[],l=[];n.forEach((function(e){var t=e.songName+(e.songAuthor?"-"+e.songAuthor:"");"PERFORM"==e.type?(c.push(e),l.push(t),i.performNumSelectIds.push(e.id)):"PRACTICE"==e.type&&(o.push(e),s.push(t),i.practiceSelectIds.push(e.id))})),i.practiceSelect=s,i.practiceSongIdList?i.practiceSelectList=o:(o.forEach((function(e){e.name=e.songName,e.author=e.songAuthor;var t=e.uploadUrl?e.uploadUrl.split(","):[],a=[];t.forEach((function(e){a.push({url:e})})),i.practiceUpload.push(a),i.practiceUploadTemp.push(a)})),i.practiceSelectUploadList=o),i.performNumSelect=l,i.performSongIdList?i.performNumSelectList=c:(c.forEach((function(e){e.name=e.songName,e.author=e.songAuthor;var t=e.uploadUrl?e.uploadUrl.split(","):[],a=[];t.forEach((function(e){a.push({url:e})})),i.performNumUpload.push(a),i.performNumUploadTemp.push(a)})),i.performNumSelectUploadList=c)})),t.lastExamCertificateUrl&&(a.lastExamCertificateUrl=t.lastExamCertificateUrl,this.uploadCertificate=[{url:t.lastExamCertificateUrl}]),this.getTheoryLevelList((function(e){e.forEach((function(e){t.examMusicTheoryId||t.examMusicTheoryLevel?e.level==t.examMusicTheoryLevel&&(a.examMusicTheoryId=e.id,a.examMusicTheoryLevel=e.level,r.examMusicTheoryName=e.text):(a.examMusicTheoryId=999,a.examMusicTheoryLevel=999,r.examMusicTheoryName="免考")}))})),t.lastMusicTheoryCertificateUrl&&(a.lastMusicTheoryCertificateUrl=t.lastMusicTheoryCertificateUrl,this.uploadCertificate2=[{url:t.lastMusicTheoryCertificateUrl}]),a.adviserName=t.adviserName,a.adviserPhone=t.adviserPhone;case 11:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}(),__init:function(){var e=p(o.a.mark((function e(){var t,a,r;return o.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return Object(c["a"])(!0),e.prev=1,e.next=4,Object(u["i"])({examId:this.examId});case 4:t=e.sent,a=t.data,200==a.code&&a.data.length>0&&(r=[],a.data.forEach((function(e){e.value=e.id,e.text=e.name,r.push(e)})),this.examSubjectList=r),this.getTheoryLevelList(),e.next=12;break;case 10:e.prev=10,e.t0=e["catch"](1);case 12:Object(c["a"])(!1);case 13:case"end":return e.stop()}}),e,this,[[1,10]])})));function t(){return e.apply(this,arguments)}return t}(),getTheoryLevelList:function(){var e=p(o.a.mark((function e(t){var a,r,i;return o.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return Object(c["a"])(!0),e.prev=1,e.next=4,Object(u["k"])({examId:this.examId});case 4:a=e.sent,r=a.data,200==r.code&&r.data.length>0&&(i=[],this.examSubjectList.length>0&&(i=[{id:999,value:999,text:"免考",level:999,fee:0}]),r.data.forEach((function(e){e.value=e.id,e.text=d[e.level],i.push(e)})),this.examMusicTheoryList=i,t&&t(i)),e.next=11;break;case 9:e.prev=9,e.t0=e["catch"](1);case 11:Object(c["a"])(!1);case 12:case"end":return e.stop()}}),e,this,[[1,9]])})));function t(t){return e.apply(this,arguments)}return t}(),onGetSheetList:function(e){var t=this.sheetForm,a=this.form;if(t.columns=[],t.currentType=e,t.index=0,"examSubject"===e){if(!(this.examSubjectList.length>0))return void this.$toast("暂无报考专业");t.sheetStatus=!0,t.columns=this.examSubjectList,t.index=this.examSubjectIndex}else if("level"===e){if(!a.subjectId)return void this.$toast("请选择报考专业");if(!(this.levelList.length>0))return void this.$toast("暂无报专业级别");t.sheetStatus=!0,t.columns=this.levelList,t.index=this.levelIndex}else if("examMusicTheory"==e){if(!(this.examMusicTheoryList.length>0))return void this.$toast("暂无乐理级别");t.sheetStatus=!0,t.columns=this.examMusicTheoryList,t.index=this.examMusicTheoryIndex}},onSheetConfirm:function(e,t){var a=this.sheetForm,r=this.form,i=this.formText;if(e)if("examSubject"==a.currentType)r.subjectId!=e.id&&(r.subjectId=e.id,i.subjectName=e.name,this.examSubjectIndex=t,r.levelId=null,i.levelName=null,r.examSubjectSongId=null,r.levelFee=0,this.levelIndex=0,this.practiceNum=0,this.practiceSongIdList=null,this.performNum=0,this.performSongIdList=null,this.onResetSong(),this.getExamSubjectLevel()),a.sheetStatus=!1;else if("level"==a.currentType){if(a.sheetStatus=!1,r.levelId===e.value)return;r.levelId=e.value,r.examSubjectSongId=e.id,r.levelFee=e.registrationFee,i.levelName=e.text,this.levelIndex=t,this.practiceNum=e.practiceNum,this.practiceSongIdList=e.practiceSongIdList,this.performNum=e.performNum,this.performSongIdList=e.performSongIdList,this.onResetSong(),this.getExamSubjectSong()}else"examMusicTheory"==a.currentType&&(r.examMusicTheoryId=e.value,r.theoryLevelFee=e.fee,r.examMusicTheoryLevel=e.level,i.examMusicTheoryName=e.text,this.examMusicTheoryIndex=t,a.sheetStatus=!1);else a.sheetStatus=!1},onResetSong:function(){this.practiceSelect=[],this.practiceUpload=[],this.practiceUploadTemp=[],this.practiceSelectUploadList=[],this.practiceSelectIds=[],this.performNumSelectUploadList=[],this.performNumSelect=[],this.performNumUpload=[],this.performNumUploadTemp=[],this.performNumSelectIds=[]},getExamSubjectLevel:function(){var e=p(o.a.mark((function e(t){var a,r,i,n;return o.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return Object(c["a"])(!0),e.prev=1,a=this.form,e.next=5,Object(u["g"])({examSubjectId:a.subjectId,examinationBasicId:this.examId});case 5:r=e.sent,i=r.data,200==i.code&&i.data.length>0&&(n=[],i.data.forEach((function(e){e.value=e.level,e.text=d[e.level],n.push(e)})),this.levelList=n,t&&t(n)),e.next=12;break;case 10:e.prev=10,e.t0=e["catch"](1);case 12:Object(c["a"])(!1);case 13:case"end":return e.stop()}}),e,this,[[1,10]])})));function t(t){return e.apply(this,arguments)}return t}(),getExamSubjectSong:function(){var e=p(o.a.mark((function e(t){var a,r,i,n,s;return o.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return Object(c["a"])(!0),e.prev=1,a=this.form,r={examSubjectId:a.subjectId,examinationBasicId:this.examId,level:a.levelId},e.next=6,Object(u["h"])(r);case 6:i=e.sent,n=i.data,200==n.code&&n.data.length>0&&(s=[],n.data.forEach((function(e){e.value=e.id,e.text=e.songName+"-"+e.songAuthor,e.uploadUrl=e.fileUrlList,s.push(e)})),this.songList=s,t&&t(s)),e.next=13;break;case 11:e.prev=11,e.t0=e["catch"](1);case 13:Object(c["a"])(!1);case 14:case"end":return e.stop()}}),e,this,[[1,11]])})));function t(t){return e.apply(this,arguments)}return t}(),onChangePractice:function(e,t){var a=this.songList,r=this.sheetSong;r.columns=[],r.index=0;var i=[],n=[];a.forEach((function(e){"PERFORM"==e.type?n.push(e):"PRACTICE"==e.type&&i.push(e)})),"practice"==e?r.columns=i:"performNum"==e&&(r.columns=n),this.songSelectIndex=t,r.status=!0},onPracticeConfirm:function(e){if(e){var t=this.songSelectIndex;"PRACTICE"==e.type?(this.practiceSelect[t]=e.text,this.practiceSelectIds[t]=e.value,this.practiceSelectList[t]=e):"PERFORM"==e.type&&(this.performNumSelect[t]=e.text,this.performNumSelectIds[t]=e.value,this.performNumSelectList[t]=e),this.sheetSong.status=!1}},beforeRead:function(e){var t=e.size/1024/1024<5;return!!t||(this.$toast("上传图片大小不能超过 5MB"),!1)},beforeDelete:function(e,t){var a=t.name.split("-"),r=this.form;return"certificate2"==a[0]?r.lastMusicTheoryCertificateUrl="":"certificate"==a[0]&&(r.lastExamCertificateUrl=""),!0},afterRead:function(){var e=p(o.a.mark((function e(t,a){var r,i,n,s,c;return o.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=a.name.split("-"),e.prev=1,t.status="uploading",t.message="上传中...",i=new FormData,i.append("file",t.file),e.next=8,Object(u["r"])(i);case 8:if(n=e.sent,s=n.data,200!=s.code){e.next=16;break}t.status="done",c=this.form,"certificate2"==r[0]?c.lastMusicTheoryCertificateUrl=s.data.url:"certificate"==r[0]?c.lastExamCertificateUrl=s.data.url:("practiceNum"==r[0]||"performNum"==r[0])&&(t.url=s.data.url),e.next=20;break;case 16:return t.status="failed",t.message="上传失败",this.$toast(s.msg),e.abrupt("return",!1);case 20:e.next=25;break;case 22:return e.prev=22,e.t0=e["catch"](1),e.abrupt("return",!1);case 25:case"end":return e.stop()}}),e,this,[[1,22]])})));function t(t,a){return e.apply(this,arguments)}return t}(),onUploadSong:function(e,t){var a=this.songUpload;a.songStatus=!0,a.indexName=e,a.index=t;var r=this.practiceSelectUploadList[t],i=this.performNumSelectUploadList[t];"practiceNum"==e?(a.name=r?r.name:null,a.author=r?r.author:null):"performNum"==e&&(a.name=i?i.name:null,a.author=i?i.author:null)},onSaveCancel:function(){this.songUpload.songStatus=!1,this.performNumUpload=JSON.parse(JSON.stringify(this.performNumUploadTemp)),this.practiceUpload=JSON.parse(JSON.stringify(this.practiceUploadTemp))},onSaveUpload:function(){var e=this.songUpload;if(e.name){var t=e.name+(e.author?"-"+e.author:"");if("practiceNum"==e.indexName){var a=this.practiceUpload[e.index],r=a?a.length:0;if(!(a&&r>0&&a[0].url))return void this.$toast("请上传文件");if(!a[r-1].url)return void this.$toast("上传曲谱中,请稍等");this.practiceSelect[e.index]=t,this.practiceSelectUploadList[e.index]=JSON.parse(JSON.stringify(e)),this.practiceUploadTemp=JSON.parse(JSON.stringify(this.practiceUpload))}else if("performNum"==e.indexName){var i=this.performNumUpload[e.index],n=i?i.length:0;if(!(i&&n>0))return void this.$toast("请上传文件");if(!i[n-1].url)return void this.$toast("上传曲谱中,请稍等");this.performNumSelect[e.index]=t,this.performNumSelectUploadList[e.index]=JSON.parse(JSON.stringify(e)),this.performNumUploadTemp=JSON.parse(JSON.stringify(this.performNumUpload))}e.name=null,e.author=null,e.songStatus=!1}else this.$toast("请输入曲名")},onSubmit:function(){var e=p(o.a.mark((function e(){var t,a,r,i,n,s;return o.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(Object(c["a"])(!0),e.prev=1,this.onCheckFields()){e.next=4;break}return e.abrupt("return");case 4:t=[],this.practiceSongIdList?this.practiceSelectList.forEach((function(e){t.push({id:e.id,type:e.type,songName:e.songName,songAuthor:e.songAuthor,uploadUrl:e.uploadUrl})})):(a=this.practiceUpload,this.practiceSelectUploadList.forEach((function(e){var r=[];a[e.index].forEach((function(e){r.push(e.url)})),t.push({songName:e.name,songAuthor:e.author,index:e.index,type:"PRACTICE",uploadUrl:r.join(",")})}))),this.performSongIdList?this.performNumSelectList.forEach((function(e){t.push({id:e.id,type:e.type,songName:e.songName,songAuthor:e.songAuthor,uploadUrl:e.uploadUrl})})):(r=this.performNumUpload,this.performNumSelectUploadList.forEach((function(e){var a=[];r[e.index].forEach((function(e){a.push(e.url)})),t.push({songName:e.name,songAuthor:e.author,index:e.index,type:"PERFORM",uploadUrl:a.join(",")})}))),i=this.form,n=this.formText,s={examStartTime:localStorage.getItem("examStartTime"),adviserName:i.adviserName,adviserPhone:i.adviserPhone,examMusicTheoryId:999==i.examMusicTheoryId?null:i.examMusicTheoryId,examMusicTheoryLevel:999==i.examMusicTheoryLevel?null:i.examMusicTheoryLevel,examinationBasicId:this.examId,lastExamCertificateUrl:i.lastExamCertificateUrl,lastMusicTheoryCertificateUrl:i.lastMusicTheoryCertificateUrl,level:i.levelId,examSubjectSongId:i.examSubjectSongId,subjectId:i.subjectId,subjectName:n.subjectName,songJson:JSON.stringify(t),organId:this.organId,levelFee:i.levelFee,theoryLevelFee:i.theoryLevelFee},Object(c["a"])(!1),localStorage.setItem("examRegistrationParams",JSON.stringify(s)),this.$router.push({path:"/signUpPayment"}),e.next=16;break;case 14:e.prev=14,e.t0=e["catch"](1);case 16:case"end":return e.stop()}}),e,this,[[1,14]])})));function t(){return e.apply(this,arguments)}return t}(),onCheckFields:function(){var e=this.form;if(this.examSubjectList.length>0){if(!e.subjectId)return this.$toast("请选择报考专业"),!1;if(!e.levelId)return this.$toast("请选择专业级别"),!1}if(this.practiceSongIdList){if(this.practiceSelectIds.length!=this.practiceNum)return this.$toast("请选择练习曲"),!1;var t=new Set(this.practiceSelectIds);if(this.practiceSelectIds.length!=t.size)return this.$toast("不能选择重复的练习曲"),!1}else if(this.practiceUpload.length!=this.practiceNum)return this.$toast("请上传练习曲"),!1;if(this.performSongIdList){if(this.performNumSelectIds.length!=this.performNum)return this.$toast("请选择演奏曲"),!1;var a=new Set(this.performNumSelectIds);if(this.performNumSelectIds.length!=a.size)return this.$toast("不能选择重复的演奏曲"),!1}else if(this.performNumUpload.length!=this.performNum)return this.$toast("请上传演奏曲"),!1;return e.examMusicTheoryId?!(e.adviserPhone&&!this.checkPhone(e.adviserPhone)):(this.$toast("请选择乐理级别"),!1)},checkPhone:function(e){var t=!0;return this.patternPhone.test(e)||(this.$toast("联系方式输入有误"),t=!1),t},onBack:function(){window.history.go(-1)},numberToCN:function(e){var t={0:"一",1:"二",2:"三",3:"四",4:"五",5:"六",6:"七",7:"八",8:"九",9:"十"};return t[e]}},destroyed:function(){this.$toast.clear(),this.$dialog.close()}},f=h,v=(a("a276"),a("2877")),x=Object(v["a"])(f,r,i,!1,null,"6ce973b7",null);t["default"]=x.exports}}]);
|