tanyanfei vor 4 Jahren
Ursprung
Commit
131bb744a7
2 geänderte Dateien mit 18 neuen und 2 gelöschten Zeilen
  1. 3 0
      src/api.js
  2. 15 2
      src/views/conference/Manage.vue

+ 3 - 0
src/api.js

@@ -294,6 +294,9 @@ export default {
 	deleteConferenceHotel: params => {
 		return axios.delete(`${baseURL}/api/admin/conference/hotel`, {params:params});
 	},
+	updown: params => {
+		return axios.put(`${baseURL}/api/admin/conference/hotel/rank`, params);
+	},
 	getHotelList: params => {
 		return axios.get(`${baseURL}/api/admin/hotel/list`, { params: params });
 	},

+ 15 - 2
src/views/conference/Manage.vue

@@ -120,8 +120,10 @@
                     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="dialogVisible=true,dialogTitle='编辑酒店',status='edit',h_id=scope.row.id"  type="text">编辑</el-button>
                         <el-button @click="delHotel(scope.row.id)" type="text" class="del">删除</el-button>
+                        <el-button @click="updown(scope.row.id,'up')" type="text" class="edit">上移</el-button>
+                        <el-button @click="updown(scope.row.id,'down')" type="text" class="edit">下移</el-button>
                     </template>
                     </el-table-column>
            </el-table>
@@ -185,10 +187,21 @@ export default {
         },
         getHotel(id){
             this.$api.getConferenceHotel({conference_id:id}).then(res=>{
-                console.log(res.data)
                 this.hotel_list=res.data.data;
             })
         },
+        updown(id,type){
+            this.$api.updown({rank:type,hotel_id:id,conference_id:this.cur_id}).then(res=>{
+                if(res.data.code==0){
+                    this.getHotel(this.cur_id)
+                }else{
+                    this.$message({
+                                message: res.data.message,
+                                type: 'error'
+                    })
+                }
+            })
+        },
         getData(){
             var parm=this.form;        
             this.loading=true