Manage.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  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="type" label="会议类型">
  79. <template slot-scope="scope">
  80. <el-tag v-if="scope.row.contype == 'offline'">线下会议</el-tag>
  81. <el-tag v-else type="info">线上会议</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">可报名</el-tag>
  90. <el-tag v-else type="info">不可报名</el-tag>
  91. </template>
  92. </el-table-column>
  93. <el-table-column width="220" label="会议时间">
  94. <template slot-scope="scope">
  95. 开始:{{ scope.row.begin_time }} <br />
  96. 结束:{{ scope.row.end_time }}
  97. </template>
  98. </el-table-column>
  99. <el-table-column prop="desc" width="300" label="会议简介">
  100. <template slot-scope="scope">
  101. <div class="desc">{{ scope.row.desc }}</div>
  102. </template>
  103. </el-table-column>
  104. <el-table-column prop="hotel_name" label="酒店信息"> </el-table-column>
  105. <el-table-column prop="zip" width="220" fixed="right" label="操作">
  106. <template slot-scope="scope">
  107. <el-button
  108. v-if="scope.row.contype == 'offline'"
  109. @click="
  110. (dialogVisible1 = true),
  111. (cur_id = scope.row.id),
  112. (name = scope.row.name),
  113. getHotel(scope.row.id)
  114. "
  115. type="text"
  116. >管理酒店</el-button
  117. >
  118. <el-button
  119. v-if="scope.row.contype == 'online'"
  120. @click="
  121. (dialogVisible2 = true),
  122. (cur_id = scope.row.id),
  123. (online_address = scope.row.online_address)
  124. "
  125. type="text"
  126. >会议地址</el-button
  127. >
  128. <!-- <el-button @click="dialogVisible=true,status='bind',cur_id=scope.row.id,name=scope.row.name" type="text" >添加酒店</el-button> -->
  129. <el-button
  130. @click="
  131. $router.push({
  132. path: '/conference/conference/add',
  133. query: { id: scope.row.id },
  134. })
  135. "
  136. class="edit"
  137. type="text"
  138. >编辑会议</el-button
  139. >
  140. <el-button @click="del(scope.row.id)" type="text" class="del"
  141. >删除会议</el-button
  142. >
  143. </template>
  144. </el-table-column>
  145. </el-table>
  146. <Page
  147. ref="pageButton"
  148. :current="form.page"
  149. :page_size="form.page_size"
  150. :total="total"
  151. @pageChange="gopage"
  152. />
  153. </div>
  154. <el-dialog
  155. width="80%"
  156. class="hotel"
  157. title="酒店列表"
  158. :close-on-click-modal="false"
  159. :visible.sync="dialogVisible1"
  160. >
  161. 会议名称:{{ name }}
  162. <el-button
  163. size="small"
  164. @click="(dialogVisible = true), (status = 'bind')"
  165. type="primary"
  166. >添加酒店</el-button
  167. >
  168. <el-table
  169. class="table"
  170. :data="hotel_list"
  171. height="400"
  172. default-expand-all
  173. style="width: 100%; margin-top: 10px"
  174. >
  175. <el-table-column prop="name" label="酒店名称"> </el-table-column>
  176. <el-table-column prop="telephone" label="电话"> </el-table-column>
  177. <el-table-column prop="address" label="地址"> </el-table-column>
  178. <el-table-column prop="ctime" label="创建时间"> </el-table-column>
  179. <el-table-column prop="zip" width="220" label="操作">
  180. <template slot-scope="scope">
  181. <el-button @click="editHotel(scope.row.id)" type="text"
  182. >编辑</el-button
  183. >
  184. <el-button @click="delHotel(scope.row.id)" type="text" class="del"
  185. >删除</el-button
  186. >
  187. <el-button
  188. @click="updown(scope.row.id, 'up')"
  189. type="text"
  190. class="edit"
  191. >上移</el-button
  192. >
  193. <el-button
  194. @click="updown(scope.row.id, 'down')"
  195. type="text"
  196. class="edit"
  197. >下移</el-button
  198. >
  199. </template>
  200. </el-table-column>
  201. </el-table>
  202. </el-dialog>
  203. <el-dialog
  204. width="80%"
  205. class="hotel"
  206. :title="dialogTitle"
  207. :close-on-click-modal="false"
  208. :visible.sync="dialogVisible"
  209. >
  210. <Hotel
  211. :status="status"
  212. :huiyi_name="name"
  213. :huiyi_id="cur_id"
  214. :cur_id="h_id"
  215. @addSuccess="add"
  216. />
  217. </el-dialog>
  218. <!-- 线上会议地址 -->
  219. <el-dialog title="线上会议地址" :visible.sync="dialogVisible2" width="50%">
  220. <div>
  221. <el-input
  222. v-model="online_address"
  223. placeholder="请输入在线会议地址"
  224. type="textarea"
  225. ></el-input>
  226. </div>
  227. <div slot="footer">
  228. <el-button @click="dialogVisible2 = false" size="mini">取 消</el-button>
  229. <el-button type="primary" @click="updateConference" size="mini"
  230. >确 定</el-button
  231. >
  232. </div>
  233. </el-dialog>
  234. </section>
  235. </template>
  236. <script>
  237. import Page from "../../components/Page";
  238. import Hotel from "../../components/hotel";
  239. export default {
  240. components: {
  241. Page,
  242. Hotel,
  243. },
  244. data() {
  245. return {
  246. edit: 0,
  247. cur_id: "",
  248. h_id: "",
  249. name: "",
  250. status: "",
  251. form: { name: "", page: 1, page_size: 20 },
  252. form1: {},
  253. total: 1,
  254. list: [{ name: "2333" }],
  255. loading: false,
  256. input: "",
  257. dialogVisible: false,
  258. dialogVisible1: false,
  259. dialogTitle: "添加酒店",
  260. defaultProps: {},
  261. data: [],
  262. hotel_list: [],
  263. dialogVisible2: false,
  264. online_address: "",
  265. };
  266. },
  267. methods: {
  268. addConference() {
  269. this.$router.push({ path: "/conference/conference/add" });
  270. },
  271. //添加酒店
  272. add() {
  273. this.dialogVisible = false;
  274. this.getHotel(this.cur_id);
  275. },
  276. gopage(size) {
  277. if (size) {
  278. this.form.page_size = size;
  279. }
  280. this.form.page = this.$refs.pageButton.page;
  281. this.getData();
  282. },
  283. getPermissions() {
  284. this.$api.getUserPermissions().then((res) => {
  285. this.data = res.data.data;
  286. });
  287. },
  288. getHotel(id) {
  289. this.$api.getConferenceHotel({ conference_id: id }).then((res) => {
  290. this.hotel_list = res.data.data;
  291. });
  292. },
  293. updown(id, type) {
  294. this.$api
  295. .updown({ rank: type, hotel_id: id, conference_id: this.cur_id })
  296. .then((res) => {
  297. if (res.data.code == 0) {
  298. this.getHotel(this.cur_id);
  299. } else {
  300. this.$message({
  301. message: res.data.message,
  302. type: "error",
  303. });
  304. }
  305. });
  306. },
  307. getData() {
  308. var parm = this.form;
  309. this.loading = true;
  310. this.$api.getConferenceList(parm).then((res) => {
  311. this.list = res.data.data.list;
  312. this.total = res.data.data.total;
  313. this.loading = false;
  314. });
  315. },
  316. del(id) {
  317. this.$confirm("确定删除吗?关联数据都会被删除!", "提示", {
  318. type: "warning",
  319. }).then(() => {
  320. this.$api.deleteConference({ id: id }).then((res) => {
  321. this.$message({
  322. message: "删除成功",
  323. type: "success",
  324. });
  325. this.getData();
  326. });
  327. });
  328. },
  329. delHotel(id) {
  330. this.$confirm("确定删除吗", "提示", {
  331. type: "warning",
  332. }).then(() => {
  333. this.$api
  334. .deleteConferenceHotel({ hotel_id: id, conference_id: this.cur_id })
  335. .then((res) => {
  336. this.$message({
  337. message: "删除成功",
  338. type: "success",
  339. });
  340. this.getHotel(this.cur_id);
  341. });
  342. });
  343. },
  344. editHotel(id) {
  345. this.getHotel(this.cur_id);
  346. this.dialogVisible = true;
  347. this.dialogTitle = "编辑酒店";
  348. this.status = "edit";
  349. this.h_id = id;
  350. },
  351. updateConference() {
  352. this.$api
  353. .updateConference({
  354. id: this.cur_id,
  355. online_address: this.online_address,
  356. })
  357. .then((res) => {
  358. this.$message({
  359. message: "删除成功",
  360. type: "success",
  361. });
  362. this.dialogVisible2 = false;
  363. });
  364. },
  365. },
  366. created() {
  367. // this.getPermissions()
  368. this.getData();
  369. },
  370. };
  371. </script>