Manage.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <style lang="scss">
  2. .preview{
  3. .el-form-item{
  4. margin-bottom:15px;
  5. }
  6. label,p{
  7. line-height: 25px !important;
  8. }
  9. }
  10. .hotel{
  11. .el-dialog{
  12. margin-top: 30px !important;
  13. }
  14. }
  15. .desc{
  16. overflow: hidden;
  17. text-overflow: ellipsis;
  18. display: -webkit-box;
  19. -webkit-line-clamp: 3;
  20. -webkit-box-orient: vertical;
  21. white-space: normal;
  22. }
  23. </style>
  24. <template>
  25. <section>
  26. <p><span>会议系统></span>会议管理</p>
  27. <div class="content">
  28. <div class="filter">
  29. <el-form size="small" label-width="70px" :inline="true" label-position="left">
  30. <el-form-item label="">
  31. <el-input clearable placeholder="请输入标题" v-model="form.name"></el-input>
  32. </el-form-item>
  33. <el-form-item>
  34. <el-button @click="getData" type="primary">搜索</el-button>
  35. </el-form-item>
  36. <el-form-item style="float:right" >
  37. <el-button @click="addConference" type="primary">新增会议</el-button>
  38. </el-form-item>
  39. </el-form>
  40. </div>
  41. <el-table
  42. class="table"
  43. :data="list"
  44. height='59vh'
  45. border v-loading="loading"
  46. default-expand-all row-key="id"
  47. style="width: 100%">
  48. <el-table-column
  49. prop="name" width="200"
  50. label="会议名称">
  51. </el-table-column>
  52. <el-table-column
  53. prop="username"
  54. label="会议海报">
  55. <template slot-scope="scope"><img width="100" :src="scope.row.img" alt=""></template>
  56. </el-table-column>
  57. <el-table-column
  58. prop="username"
  59. label="主办方">
  60. </el-table-column>
  61. <el-table-column
  62. prop=""
  63. label="主讲人">
  64. </el-table-column>
  65. <el-table-column
  66. width="350"
  67. label="会议时间">
  68. <template slot-scope="scope">
  69. {{scope.row.begin_time}}-{{scope.row.end_time}}
  70. </template>
  71. </el-table-column>
  72. <el-table-column
  73. prop="desc" width="300"
  74. label="会议简介">
  75. <template slot-scope="scope">
  76. <div class="desc">{{scope.row.desc}}</div>
  77. </template>
  78. </el-table-column>
  79. <el-table-column
  80. prop=""
  81. label="酒店信息">
  82. </el-table-column>
  83. <el-table-column
  84. prop=""
  85. label="状态">
  86. </el-table-column>
  87. <el-table-column
  88. prop="zip" width="220" fixed="right"
  89. label="操作">
  90. <template slot-scope="scope">
  91. <el-button @click="dialogVisible1=true,cur_id=scope.row.id,name=scope.row.name,getHotel(scope.row.id)" type="text" >管理酒店</el-button>
  92. <!-- <el-button @click="dialogVisible=true,status='bind',cur_id=scope.row.id,name=scope.row.name" type="text" >添加酒店</el-button> -->
  93. <el-button @click="$router.push({path:'/conference/conference/add',query:{id:scope.row.id}})" class="edit" type="text">编辑会议</el-button>
  94. <el-button @click="del(scope.row.id)" type="text" class="del">删除会议</el-button>
  95. </template>
  96. </el-table-column>
  97. </el-table>
  98. <Page ref="pageButton" :current='form.page' :page_size='form.page_size' :total='total' @pageChange='gopage'/>
  99. </div>
  100. <el-dialog width="80%" class="hotel"
  101. title="酒店列表" :close-on-click-modal='false'
  102. :visible.sync="dialogVisible1">
  103. 会议名称:{{name}}
  104. <el-button size="small" @click="dialogVisible=true,status='bind'" type="primary">添加酒店</el-button>
  105. <el-table
  106. class="table"
  107. :data="hotel_list" height="400"
  108. default-expand-all
  109. style="width: 100%;margin-top:10px;">
  110. <el-table-column prop="name" label="酒店名称">
  111. </el-table-column>
  112. <el-table-column prop="telephone" label="电话">
  113. </el-table-column>
  114. <el-table-column prop="address" label="地址">
  115. </el-table-column>
  116. <el-table-column prop="ctime" label="创建时间">
  117. </el-table-column>
  118. <el-table-column
  119. prop="zip" width="220"
  120. label="操作">
  121. <template slot-scope="scope">
  122. <el-button @click="dialogVisible=true,dialogTitle='编辑酒店',status='edit',h_id=scope.row.id" class="edit" type="text">编辑</el-button>
  123. <el-button @click="delHotel(scope.row.id)" type="text" class="del">删除</el-button>
  124. </template>
  125. </el-table-column>
  126. </el-table>
  127. </el-dialog>
  128. <el-dialog width="80%" class="hotel"
  129. :title="dialogTitle" :close-on-click-modal='false'
  130. :visible.sync="dialogVisible">
  131. <Hotel :status='status' :huiyi_name='name' :huiyi_id='cur_id' :cur_id='h_id' @addSuccess='add'/>
  132. </el-dialog>
  133. </section>
  134. </template>
  135. <script>
  136. import Page from '../../components/Page';
  137. import Hotel from '../../components/hotel';
  138. export default {
  139. components:{
  140. Page,Hotel
  141. },
  142. data(){
  143. return{
  144. edit:0,
  145. cur_id:'',
  146. h_id:'',
  147. name:'',
  148. status:'',
  149. form:{name:'',page:1,page_size:20},
  150. form1:{},
  151. total:1,
  152. list:[{name:'2333'}],
  153. loading:false,
  154. input:'',
  155. dialogVisible:false,
  156. dialogVisible1:false,
  157. dialogTitle:"添加酒店",
  158. defaultProps:{},
  159. data: [],
  160. hotel_list:[]
  161. }
  162. },
  163. methods:{
  164. addConference(){
  165. this.$router.push({path:'/conference/conference/add'})
  166. },
  167. //添加酒店
  168. add(){
  169. this.dialogVisible=false;
  170. this.getHotel(this.cur_id)
  171. },
  172. gopage(size){
  173. if(size){
  174. this.form.page_size=size
  175. }
  176. this.form.page=this.$refs.pageButton.page
  177. this.getData()
  178. },
  179. getPermissions(){
  180. this.$api.getUserPermissions().then(res=>{
  181. this.data = res.data.data
  182. })
  183. },
  184. getHotel(id){
  185. this.$api.getConferenceHotel({conference_id:id}).then(res=>{
  186. console.log(res.data)
  187. this.hotel_list=res.data.data;
  188. })
  189. },
  190. getData(){
  191. var parm=this.form;
  192. this.loading=true
  193. this.$api.getConferenceList(parm).then(res=>{
  194. this.list=res.data.data.list;
  195. this.total=res.data.data.total
  196. this.loading=false
  197. })
  198. },
  199. del(id){
  200. this.$confirm('确定删除吗', '提示', {
  201. type: 'warning'
  202. }).then(() => {
  203. this.$api.deleteConference({id:id}).then((res)=>{
  204. this.$message({
  205. message: '删除成功',
  206. type: 'success'
  207. })
  208. this.getData()
  209. })
  210. })
  211. },
  212. delHotel(id){
  213. this.$confirm('确定删除吗', '提示', {
  214. type: 'warning'
  215. }).then(() => {
  216. this.$api.deleteConferenceHotel({hotel_id:id,conference_id:this.cur_id}).then((res)=>{
  217. this.$message({
  218. message: '删除成功',
  219. type: 'success'
  220. })
  221. this.getHotel(this.cur_id)
  222. })
  223. })
  224. },
  225. },
  226. created(){
  227. // this.getPermissions()
  228. this.getData()
  229. }
  230. }
  231. </script>