xjc 4 年之前
父节点
当前提交
754c5a3116
共有 3 个文件被更改,包括 33 次插入6 次删除
  1. 4 3
      src/components/MulSubject.vue
  2. 5 0
      src/views/apply/Detail.vue
  3. 24 3
      src/views/classes/Add.vue

+ 4 - 3
src/components/MulSubject.vue

@@ -6,8 +6,9 @@
         }
     }
 </style>
-<template>
-    <el-cascader-multi :value="value2" :data="data" :props='props' > </el-cascader-multi>
+
+<template>  
+    <el-cascader-multi v-model="value2" :data="data" @change="valChange" value="value2"> </el-cascader-multi>
 </template>   
 <script>
 export default {
@@ -50,7 +51,7 @@ export default {
                 }else{
                     this.data=res.data.data
                 }
-                // this.checkList = [[1,32,38]]              
+                // this.value2 = [[1,32,38]]              
           })
         },
         handleChange(value) {

+ 5 - 0
src/views/apply/Detail.vue

@@ -185,6 +185,10 @@
                     <li class="title">学历照 <i @click="rotate(form.education_img,'education_img')" class="el-icon-refresh-right"></i></li>
                     <img width="100%" :src="form.education_img" alt="">
                 </ul>
+                <ul v-if='form.has_healthimg'>
+                    <li class="title">体检表照片 <i @click="rotate(form.health_img,'health_img')" class="el-icon-refresh-right"></i></li>
+                    <img width="100%" :src="form.health_img" alt="">
+                </ul>
                 <ul v-if='form.train_type == "换证"||form.train_type=="复审"'>
                     <li class="title">原证件照 <i @click="rotate(form.oldcard_img,'oldcard_img')" class="el-icon-refresh-right"></i></li>
                     <img width="100%" :src="form.oldcard_img" alt="">
@@ -211,6 +215,7 @@ export default {
               this.form=res.data.data
               this.idnoimg_face = res.data.data.idnoimg_face
               this.form.subject_items=this.form.subject_item.split('|')
+              this.form.has_healthimg = this.form.subject_item.split('|')[0].indexOf("特种设备")!=-1
           })
       },
       rotate(url,key){

+ 24 - 3
src/views/classes/Add.vue

@@ -20,7 +20,8 @@
                     <Subject @subChange='subChange'/>
                 </el-form-item> -->
                 <el-form-item label="培训项目">
-                    <MulSubject :value2="form.subject_id" @valchange="change"/>
+                    <!-- <MulSubject :value2="form.subject_id" @valchange="change"/> -->
+                    <el-cascader-multi :data="data" @change="change" :value="value2" v-model="value2"> </el-cascader-multi>
                 </el-form-item>
                 <el-form-item label="班级名称">
                         <el-input placeholder="班级名称" v-model="form.name"></el-input>
@@ -51,9 +52,11 @@ export default {
     },
   data(){
     return{
-      form:{name:''},
+      form:{
+          name:'',subject_id:[]},
       id:'',
-      value2:[]
+      value2:[],
+      data:[]
     }
   },
   methods:{
@@ -68,9 +71,26 @@ export default {
         } 
         return res;
       },
+      getSubjects(){
+          //
+          this.$api.getSubList().then(res=>{
+                let data=res.data.data;
+                if(this.subject_id){
+                    for(let i=0;i<data.length;i++){
+                        if(data[i].id == this.subject_id){
+                            this.data=data[i].children
+                        }
+                    }
+                }else{
+                    this.data=res.data.data
+                }
+                // this.value2 = [[1,32,38]]              
+          })
+      },
       getData(){
           this.$api.getaClass({id:this.form.id}).then(res=>{
               this.form=res.data.data
+              this.value2 = res.data.data.subject_id
           })
       },
       subChange(data,id){
@@ -104,6 +124,7 @@ export default {
       }
   },
   created(){
+      this.getSubjects()
       if(this.$route.query.id){
             this.form.id=this.$route.query.id
             this.id=this.$route.query.id