tanyanfei 4 سال پیش
والد
کامیت
47b1741ddc
5فایلهای تغییر یافته به همراه99 افزوده شده و 19 حذف شده
  1. 6 0
      src/api.js
  2. 13 13
      src/components/hotel.vue
  3. 4 1
      src/views/activity/AddActivity.vue
  4. 29 0
      src/views/conference/AddConference.vue
  5. 47 5
      src/views/conference/Manage.vue

+ 6 - 0
src/api.js

@@ -288,6 +288,12 @@ export default {
 	addConferenceHotel: params => {
 		return axios.post(`${baseURL}/api/admin/conference/hotel`, params);
 	},
+	getConferenceHotel: params => {
+		return axios.get(`${baseURL}/api/admin/conference/hotel`, {params:params});
+	},
+	deleteConferenceHotel: params => {
+		return axios.delete(`${baseURL}/api/admin/conference/hotel`, {params:params});
+	},
 	getHotelList: params => {
 		return axios.get(`${baseURL}/api/admin/hotel/list`, { params: params });
 	},

+ 13 - 13
src/components/hotel.vue

@@ -426,10 +426,10 @@ export default {
                                     message: '添加成功',
                                     type: 'success'
                         })
-                        if(type==1){
-                                this.form={imgs:[]};
-                                this.type=[{imgs:[]}];
-                        }else{
+                        this.form={imgs:[]};
+                        this.type=[{imgs:[]}];
+                        this.h_id='';
+                        if(type!=1){
                                 this.$emit('addSuccess')
                         }
                     }else{
@@ -448,10 +448,10 @@ export default {
                                     message: '添加成功',
                                     type: 'success'
                         })
-                        if(type==1){
-                                this.form={imgs:[]};
-                                this.type=[{imgs:[]}];
-                        }else{
+                        this.form={imgs:[]};
+                        this.type=[{imgs:[]}];
+                        this.h_id='';
+                        if(type!=1){
                                 this.$emit('addSuccess')
                         }
                     }else{
@@ -469,11 +469,11 @@ export default {
                                     message: '修改成功',
                                     type: 'success'
                         })
-                        if(type==1){
-                            this.form={imgs:[]};
-                            this.type=[{imgs:[]}];
-                        }else{
-                            this.$emit('addSuccess')
+                        this.form={imgs:[]};
+                        this.type=[{imgs:[]}];
+                        this.h_id='';
+                        if(type!=1){
+                                this.$emit('addSuccess')
                         }
                         
                     }else{

+ 4 - 1
src/views/activity/AddActivity.vue

@@ -130,7 +130,7 @@
                     </el-col>
                     <el-col :span="12">
                         <el-form-item label="承办方:">
-                            <el-select placeholder="请选择承办方" v-model="form.organizer_id" filterable>
+                            <el-select placeholder="请选择承办方" v-model="form.subject_id" filterable>
                                 <el-option
                                     v-for="(item, index) in organizerList"
                                     :key="index"
@@ -413,6 +413,9 @@ export default {
                 this.form.is_recommend=Boolean(this.form.is_recommend)
                 this.form.citys=this.form.city.split(' ')
                 this.form.time=[this.form.begin_time,this.form.end_time]
+                if(!this.form.speaker){
+                    this.form.speaker=[{}]
+                }
             })
         }
     },

+ 29 - 0
src/views/conference/AddConference.vue

@@ -477,6 +477,35 @@ export default {
                 })
                 return
             }
+            if(!form.desc){
+                this.$message({
+                    message: '请输入会议简介',
+                    type: 'error'
+                })
+                return
+            }
+            if(form.speaker.length<=0){
+                this.$message({
+                    message: '请添加主讲人',
+                    type: 'error'
+                })
+                return
+            }else{
+                if(!form.speaker[0].name){
+                    this.$message({
+                        message: '请输入主讲人姓名',
+                        type: 'error'
+                    })
+                    return
+                }
+                if(!form.speaker[0].img){
+                    this.$message({
+                        message: '请上传主讲人头像',
+                        type: 'error'
+                    })
+                    return
+                }
+            }
             // form.organizer_name=this.organizerList.filter(item=>item.id==form.organizer_id)[0].name
             console.log(form)
             if(this.id){

+ 47 - 5
src/views/conference/Manage.vue

@@ -88,11 +88,10 @@
                     prop="zip"  width="220" fixed="right"
                     label="操作">
                     <template slot-scope="scope">
-                        <el-button  @click="dialogVisible1=true,cur_id=scope.row.id,name=scope.row.name"  type="text" >管理酒店</el-button>
+                        <el-button  @click="dialogVisible1=true,cur_id=scope.row.id,name=scope.row.name,getHotel(scope.row.id)"  type="text" >管理酒店</el-button>
                         <!-- <el-button  @click="dialogVisible=true,status='bind',cur_id=scope.row.id,name=scope.row.name"  type="text" >添加酒店</el-button> -->
                         <el-button @click="$router.push({path:'/conference/conference/add',query:{id:scope.row.id}})" class="edit" type="text">编辑会议</el-button>
                         <el-button @click="del(scope.row.id)" type="text" class="del">删除会议</el-button>
-
                     </template>
                     </el-table-column>
             </el-table>
@@ -104,11 +103,33 @@
         :visible.sync="dialogVisible1">
             会议名称:{{name}}
             <el-button size="small" @click="dialogVisible=true,status='bind'" type="primary">添加酒店</el-button>
+            <el-table
+                    class="table"
+                    :data="hotel_list" height="400"
+                    default-expand-all 
+                    style="width: 100%;margin-top:10px;">
+                    <el-table-column prop="name"  label="酒店名称">
+                    </el-table-column>
+                    <el-table-column prop="telephone"    label="电话">
+                    </el-table-column>
+                    <el-table-column prop="address"    label="地址">
+                    </el-table-column>
+                    <el-table-column prop="ctime"    label="创建时间">
+                    </el-table-column>
+                    <el-table-column  
+                    prop="zip"  width="220" 
+                    label="操作">
+                    <template slot-scope="scope">
+                        <el-button @click="dialogVisible=true,dialogTitle='编辑酒店',status='edit',h_id=scope.row.id" class="edit" type="text">编辑</el-button>
+                        <el-button @click="delHotel(scope.row.id)" type="text" class="del">删除</el-button>
+                    </template>
+                    </el-table-column>
+           </el-table>
         </el-dialog>
         <el-dialog width="80%" class="hotel"
         :title="dialogTitle" :close-on-click-modal='false'
         :visible.sync="dialogVisible">
-            <Hotel :status='status' :huiyi_name='name' :huiyi_id='cur_id' @addSuccess='add'/>
+            <Hotel :status='status' :huiyi_name='name' :huiyi_id='cur_id' :cur_id='h_id' @addSuccess='add'/>
         </el-dialog>
     </section>
 </template>
@@ -124,6 +145,7 @@ export default {
     return{
       edit:0,
       cur_id:'',
+      h_id:'',
       name:'',
       status:'',
       form:{name:'',page:1,page_size:20},
@@ -137,6 +159,7 @@ export default {
       dialogTitle:"添加酒店",
       defaultProps:{},
       data: [],
+      hotel_list:[]
     }
   },
   methods:{
@@ -145,8 +168,8 @@ export default {
       },
       //添加酒店
       add(){
-          this.dialogVisible=false;
-         
+           this.dialogVisible=false;
+           this.getHotel(this.cur_id)
       },
       gopage(size){
             if(size){
@@ -160,6 +183,12 @@ export default {
                 this.data = res.data.data
             })
         },
+        getHotel(id){
+            this.$api.getConferenceHotel({conference_id:id}).then(res=>{
+                console.log(res.data)
+                this.hotel_list=res.data.data;
+            })
+        },
         getData(){
             var parm=this.form;        
             this.loading=true
@@ -182,6 +211,19 @@ export default {
                     })
                 })
         },
+        delHotel(id){
+                this.$confirm('确定删除吗', '提示', {
+                        type: 'warning'
+                    }).then(() => {
+                    this.$api.deleteConferenceHotel({hotel_id:id,conference_id:this.cur_id}).then((res)=>{
+                            this.$message({
+                                message: '删除成功',
+                                type: 'success'
+                            })
+                            this.getHotel(this.cur_id)
+                    })
+                })
+        },
   },
   created(){
     //   this.getPermissions()