Manage.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <style lang="scss">
  2. .preview {
  3. .el-form-item {
  4. margin-bottom: 15px;
  5. }
  6. label,
  7. p {
  8. line-height: 25px !important;
  9. }
  10. }
  11. .hotel {
  12. .el-dialog {
  13. margin-top: 30px !important;
  14. }
  15. }
  16. .desc {
  17. overflow: hidden;
  18. text-overflow: ellipsis;
  19. display: -webkit-box;
  20. -webkit-line-clamp: 3;
  21. -webkit-box-orient: vertical;
  22. white-space: normal;
  23. }
  24. </style>
  25. <template>
  26. <section>
  27. <p><span>会议系统></span>会议管理</p>
  28. <div class="content">
  29. <div class="filter">
  30. <el-form
  31. size="small"
  32. label-width="70px"
  33. :inline="true"
  34. label-position="left"
  35. >
  36. <el-form-item label="">
  37. <el-input
  38. clearable
  39. placeholder="请输入标题"
  40. v-model="form.name"
  41. ></el-input>
  42. </el-form-item>
  43. <el-form-item>
  44. <el-select v-model="form.contype" placeholder="请选择会议类型" clearable @clear="getData" @change="getData">
  45. <el-option key="offline" label="线下会议" value="offline">
  46. </el-option>
  47. <el-option key="online" label="线上会议" value="online">
  48. </el-option>
  49. </el-select>
  50. </el-form-item>
  51. <el-form-item>
  52. <el-button @click="getData" type="primary">搜索</el-button>
  53. </el-form-item>
  54. <el-form-item style="float: right">
  55. <el-button @click="addConference" type="primary"
  56. >新增会议</el-button
  57. >
  58. </el-form-item>
  59. </el-form>
  60. </div>
  61. <el-table
  62. class="table"
  63. :data="list"
  64. height="59vh"
  65. border
  66. v-loading="loading"
  67. default-expand-all
  68. row-key="id"
  69. style="width: 100%"
  70. >
  71. <el-table-column prop="name" width="200" label="会议名称">
  72. </el-table-column>
  73. <el-table-column prop="username" label="会议海报" width="130">
  74. <template slot-scope="scope"
  75. ><img width="100" :src="scope.row.img" alt=""
  76. /></template>
  77. </el-table-column>
  78. <el-table-column prop="contype" label="会议类型">
  79. <template slot-scope="scope">
  80. <el-tag v-if="scope.row.contype == 'offline'" size="mini">线下会议</el-tag>
  81. <el-tag v-else type="info" size="mini">线上会议</el-tag>
  82. </template>
  83. </el-table-column>
  84. <el-table-column prop="organizer_name" label="主办方">
  85. </el-table-column>
  86. <el-table-column prop="speaker_name" label="主讲人"> </el-table-column>
  87. <el-table-column prop="" width="120" label="状态">
  88. <template slot-scope="scope">
  89. <el-tag v-if="scope.row.is_signup&&!scope.row.is_over" size="mini">可报名</el-tag>
  90. <el-tag v-if="scope.row.is_over" type="info" size="mini">已结束</el-tag>
  91. <el-tag v-if="!scope.row.is_signup&&!scope.row.is_over" size="mini">不可报名</el-tag>
  92. </template>
  93. </el-table-column>
  94. <el-table-column width="220" label="会议时间">
  95. <template slot-scope="scope">
  96. 开始:{{ scope.row.begin_time }} <br />
  97. 结束:{{ scope.row.end_time }}
  98. </template>
  99. </el-table-column>
  100. <el-table-column prop="desc" width="300" label="会议简介">
  101. <template slot-scope="scope">
  102. <div class="desc">{{ scope.row.desc }}</div>
  103. </template>
  104. </el-table-column>
  105. <el-table-column prop="hotel_name" label="酒店信息"> </el-table-column>
  106. <el-table-column prop="zip" width="220" fixed="right" label="操作">
  107. <template slot-scope="scope">
  108. <el-button
  109. v-if="scope.row.contype == 'offline'"
  110. @click="
  111. (dialogVisible1 = true),
  112. (cur_id = scope.row.id),
  113. (name = scope.row.name),
  114. getHotel(scope.row.id)
  115. "
  116. type="text"
  117. >管理酒店</el-button
  118. >
  119. <el-button
  120. v-if="scope.row.contype == 'online'"
  121. @click="
  122. (dialogVisible2 = true),
  123. (cur_id = scope.row.id),
  124. (online_address = scope.row.online_address)
  125. "
  126. type="text"
  127. >会议地址</el-button
  128. >
  129. <!-- <el-button @click="dialogVisible=true,status='bind',cur_id=scope.row.id,name=scope.row.name" type="text" >添加酒店</el-button> -->
  130. <el-button
  131. @click="
  132. $router.push({
  133. path: '/conference/conference/add',
  134. query: { id: scope.row.id },
  135. })
  136. "
  137. class="edit"
  138. type="text"
  139. >编辑会议</el-button
  140. >
  141. <el-button @click="del(scope.row.id)" type="text" class="del"
  142. >删除会议</el-button
  143. >
  144. </template>
  145. </el-table-column>
  146. </el-table>
  147. <Page
  148. ref="pageButton"
  149. :current="form.page"
  150. :page_size="form.page_size"
  151. :total="total"
  152. @pageChange="gopage"
  153. />
  154. </div>
  155. <el-dialog
  156. width="80%"
  157. class="hotel"
  158. title="酒店列表"
  159. :close-on-click-modal="false"
  160. :visible.sync="dialogVisible1"
  161. >
  162. 会议名称:{{ name }}
  163. <el-button
  164. size="small"
  165. @click="(dialogVisible = true), (status = 'bind')"
  166. type="primary"
  167. >添加酒店</el-button
  168. >
  169. <el-table
  170. class="table"
  171. :data="hotel_list"
  172. height="400"
  173. default-expand-all
  174. style="width: 100%; margin-top: 10px"
  175. >
  176. <el-table-column prop="name" label="酒店名称"> </el-table-column>
  177. <el-table-column prop="telephone" label="电话"> </el-table-column>
  178. <el-table-column prop="address" label="地址"> </el-table-column>
  179. <el-table-column prop="ctime" label="创建时间"> </el-table-column>
  180. <el-table-column prop="zip" width="220" label="操作">
  181. <template slot-scope="scope">
  182. <el-button @click="editHotel(scope.row.id)" type="text"
  183. >编辑</el-button
  184. >
  185. <el-button @click="delHotel(scope.row.id)" type="text" class="del"
  186. >删除</el-button
  187. >
  188. <el-button
  189. @click="updown(scope.row.id, 'up')"
  190. type="text"
  191. class="edit"
  192. >上移</el-button
  193. >
  194. <el-button
  195. @click="updown(scope.row.id, 'down')"
  196. type="text"
  197. class="edit"
  198. >下移</el-button
  199. >
  200. </template>
  201. </el-table-column>
  202. </el-table>
  203. </el-dialog>
  204. <el-dialog
  205. width="80%"
  206. class="hotel"
  207. :title="dialogTitle"
  208. :close-on-click-modal="false"
  209. :visible.sync="dialogVisible"
  210. >
  211. <Hotel
  212. :status="status"
  213. :huiyi_name="name"
  214. :huiyi_id="cur_id"
  215. :cur_id="h_id"
  216. @addSuccess="add"
  217. />
  218. </el-dialog>
  219. <!-- 线上会议地址 -->
  220. <el-dialog title="线上会议地址" :visible.sync="dialogVisible2" width="50%">
  221. <div>
  222. <el-input
  223. v-model="online_address"
  224. placeholder="请输入在线会议地址"
  225. type="textarea"
  226. ></el-input>
  227. </div>
  228. <div slot="footer">
  229. <el-button @click="dialogVisible2 = false" size="mini">取 消</el-button>
  230. <el-button type="primary" @click="updateConference" size="mini"
  231. >确 定</el-button
  232. >
  233. </div>
  234. </el-dialog>
  235. </section>
  236. </template>
  237. <script>
  238. import Page from "../../components/Page";
  239. import Hotel from "../../components/hotel";
  240. export default {
  241. components: {
  242. Page,
  243. Hotel,
  244. },
  245. data() {
  246. return {
  247. edit: 0,
  248. cur_id: "",
  249. h_id: "",
  250. name: "",
  251. status: "",
  252. form: { name: "", page: 1, page_size: 20 },
  253. form1: {},
  254. total: 1,
  255. list: [{ name: "2333" }],
  256. loading: false,
  257. input: "",
  258. dialogVisible: false,
  259. dialogVisible1: false,
  260. dialogTitle: "添加酒店",
  261. defaultProps: {},
  262. data: [],
  263. hotel_list: [],
  264. dialogVisible2: false,
  265. online_address: "",
  266. };
  267. },
  268. methods: {
  269. addConference() {
  270. this.$router.push({ path: "/conference/conference/add" });
  271. },
  272. //添加酒店
  273. add() {
  274. this.dialogVisible = false;
  275. this.getHotel(this.cur_id);
  276. },
  277. gopage(size) {
  278. if (size) {
  279. this.form.page_size = size;
  280. }
  281. this.form.page = this.$refs.pageButton.page;
  282. this.getData();
  283. },
  284. getPermissions() {
  285. this.$api.getUserPermissions().then((res) => {
  286. this.data = res.data.data;
  287. });
  288. },
  289. getHotel(id) {
  290. this.$api.getConferenceHotel({ conference_id: id }).then((res) => {
  291. this.hotel_list = res.data.data;
  292. });
  293. },
  294. updown(id, type) {
  295. this.$api
  296. .updown({ rank: type, hotel_id: id, conference_id: this.cur_id })
  297. .then((res) => {
  298. if (res.data.code == 0) {
  299. this.getHotel(this.cur_id);
  300. } else {
  301. this.$message({
  302. message: res.data.message,
  303. type: "error",
  304. });
  305. }
  306. });
  307. },
  308. getData() {
  309. var parm = this.form;
  310. this.loading = true;
  311. this.$api.getConferenceList(parm).then((res) => {
  312. this.list = res.data.data.list;
  313. this.total = res.data.data.total;
  314. this.loading = false;
  315. });
  316. },
  317. del(id) {
  318. this.$confirm("确定删除吗?关联数据都会被删除!", "提示", {
  319. type: "warning",
  320. }).then(() => {
  321. this.$api.deleteConference({ id: id }).then((res) => {
  322. this.$message({
  323. message: "删除成功",
  324. type: "success",
  325. });
  326. this.getData();
  327. });
  328. });
  329. },
  330. delHotel(id) {
  331. this.$confirm("确定删除吗", "提示", {
  332. type: "warning",
  333. }).then(() => {
  334. this.$api
  335. .deleteConferenceHotel({ hotel_id: id, conference_id: this.cur_id })
  336. .then((res) => {
  337. this.$message({
  338. message: "删除成功",
  339. type: "success",
  340. });
  341. this.getHotel(this.cur_id);
  342. });
  343. });
  344. },
  345. editHotel(id) {
  346. this.getHotel(this.cur_id);
  347. this.dialogVisible = true;
  348. this.dialogTitle = "编辑酒店";
  349. this.status = "edit";
  350. this.h_id = id;
  351. },
  352. updateConference() {
  353. this.$api
  354. .updateConference({
  355. id: this.cur_id,
  356. online_address: this.online_address,
  357. })
  358. .then((res) => {
  359. this.$message({
  360. message: "删除成功",
  361. type: "success",
  362. });
  363. this.getData();
  364. this.dialogVisible2 = false;
  365. });
  366. },
  367. },
  368. created() {
  369. // this.getPermissions()
  370. this.getData();
  371. },
  372. };
  373. </script>