mo vor 1 Jahr
Ursprung
Commit
bd8079d8b2

+ 1 - 0
src/views/tenantStudentRejest/index.tsx

@@ -160,6 +160,7 @@ export default defineComponent({
     }
 
     const downApp = ()=>{
+      window.open(location.origin + '/student/#/download')
       data.showSuccess = false
     }
 

+ 24 - 7
src/views/tenantTeacherRejest/index.tsx

@@ -26,7 +26,7 @@ export default defineComponent({
       realName: '',
       phone: '',
       subjectId: '',
-      tenantId: '',
+      tenantId: route.query.tenantId,
       birthdate: '',
       code: ''
     });
@@ -45,10 +45,11 @@ export default defineComponent({
       openStatus: false,
       dateState: false,
       showSuccess: false,
-      selectedSubjectList: [] as any,
-      choiceSubjectIds: [] as any
+      // selectedSubjectList: [] as any,
+      choiceSubjectIds: [] as any,
+      choiceSubjectNames: [] as any
     });
-    const handleSubmit = () => {
+    const handleSubmit = async () => {
       console.log(forms, 'forms')
       if (!forms.username) {
         Toast('请输入老师昵称')
@@ -65,9 +66,15 @@ export default defineComponent({
       if (!forms.idCardNo) {
         Toast('请输入身份证号')
       }
-      if (!forms.subjectId) {
+      if (data.choiceSubjectIds.length < 1) {
         Toast('请选择声部')
       }
+      try {
+        const res = await request.post('/api-tenant/open/teacher/submit', { data: { ...forms, subjectId: data.choiceSubjectIds.join(',') } })
+        data.showSuccess = true
+      } catch (e) {
+        console.log(e)
+      }
     }
     const getSubjectList = async () => {
       try {
@@ -144,12 +151,22 @@ export default defineComponent({
     }
 
     const downApp = () => {
+      window.open(location.origin + '/student/#/download?type=teacher')
       data.showSuccess = false
     }
 
     const onChoice = (val: any) => {
+
       data.searchStatus = false
-      data.selectedSubjectList = [val]
+      data.choiceSubjectIds = [...val]
+      const chioseSound = [] as any
+      data.subjectList.forEach((item: any) => {
+        if (data.choiceSubjectIds.indexOf(item.id) != -1) {
+          chioseSound.push(item.name)
+        }
+      })
+      data.choiceSubjectNames = [...chioseSound]
+      // data.choiceSubjectNames =
     }
 
     return () =>
@@ -252,7 +269,7 @@ export default defineComponent({
                     label="声部"
                     placeholder="请选择声部"
                     readonly
-                    v-model={data.cityName}
+                    v-model={data.choiceSubjectNames}
                     onClick={() => (data.searchStatus = true)}>
                     {{
                       button: () => (

+ 6 - 2
src/views/tenantTeacherRejest/modals/chioseSuond.tsx

@@ -55,15 +55,18 @@ export default defineComponent({
     }
   },
   async mounted() {
+    console.log('mounted=====>', this.selectType)
     if (this.selectType === 'Radio') {
       this.radio = this.choiceSubjectIds[0]
     } else {
-      this.checkBox = this.choiceSubjectIds as never[]
+
+      this.checkBox = [...this.choiceSubjectIds] as never[]
     }
   },
   watch: {
     choiceSubjectIds(val: any, oldVal) {
       // 同步更新显示数据
+      console.log(this.choiceSubjectIds, this.checkBox, 'choiceSubjectIds')
       this.checkBox = [...val] as never[]
     }
   },
@@ -77,6 +80,7 @@ export default defineComponent({
           Toast(`乐器最多选择${this.max}个`)
         }
         this.checkboxRefs[id].toggle()
+        console.log(this.checkBox, 'onSelect====>')
       } else if (this.selectType === 'Radio') {
         this.radio = id
       }
@@ -288,7 +292,7 @@ export default defineComponent({
           <Sticky offsetBottom={0} position="bottom">
             <div class={'btnGroup'}>
 
-              <img src={chioseOk} class={styels.chioseBtn} alt="" onClick={() =>
+              <img src={chioseOk} class={styles.chioseBtn} alt="" onClick={() =>
                 this.onChoice(
                   this.selectType === 'Checkbox' ? this.checkBox : this.radio
                 )