index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="演出厅名称" label-width="90px">
  5. <el-input
  6. v-model="queryParams.name"
  7. placeholder="请输入演出厅名称"
  8. clearable
  9. style="width: 200px;"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="场馆名称" style="margin-left: 30px">
  14. <el-input
  15. v-model="queryParams.theatreName"
  16. placeholder="请输入场馆名称"
  17. clearable
  18. style="width: 200px;"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item>
  23. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  24. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  25. </el-form-item>
  26. </el-form>
  27. <el-row :gutter="10" class="mb8">
  28. <el-col :span="1.5">
  29. <el-button
  30. type="primary"
  31. plain
  32. icon="el-icon-plus"
  33. size="mini"
  34. @click="handleAdd"
  35. v-hasPermi="['performanceHallMr:performanceHallMr:add']"
  36. >新增</el-button>
  37. </el-col>
  38. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  39. </el-row>
  40. <el-table ref="tables" v-loading="loading" :data="dataList" border>
  41. <el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
  42. <el-table-column label="演出厅名称" align="center" prop="name" />
  43. <el-table-column label="所属场馆" align="center" prop="theatreName" />
  44. <el-table-column label="票区图" align="center" prop="type">
  45. <template slot-scope="scope">
  46. <el-button type="text" @click="seeCenter(scope.row, 'img')">查看</el-button>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="创建时间" align="center" prop="createTime" width="160">
  50. <template slot-scope="scope">
  51. <span>{{ parseTime(scope.row.createTime) }}</span>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  55. <template slot-scope="scope">
  56. <el-button
  57. size="mini"
  58. type="text"
  59. @click="handleSeat(scope.row)"
  60. v-hasPermi="['performanceHallMr:performanceHallMr:edit']"
  61. >座位管理</el-button>
  62. <!-- <el-button-->
  63. <!-- size="mini"-->
  64. <!-- type="text"-->
  65. <!-- @click="handleMr(scope.row)"-->
  66. <!-- v-hasPermi="['performanceHallMr:performanceHallMr:edit']"-->
  67. <!-- >剧目管理</el-button>-->
  68. <el-button
  69. size="mini"
  70. type="text"
  71. @click="handleUpdate(scope.row)"
  72. v-hasPermi="['performanceHallMr:performanceHallMr:edit']"
  73. >编辑</el-button>
  74. <el-button
  75. size="mini"
  76. type="text"
  77. @click="handleDelete(scope.row,scope.index)"
  78. v-hasPermi="['performanceHallMr:performanceHallMr:delete']"
  79. >删除</el-button>
  80. </template>
  81. </el-table-column>
  82. </el-table>
  83. <pagination
  84. v-show="total>0"
  85. :total="total"
  86. :page.sync="queryParams.pageNum"
  87. :limit.sync="queryParams.pageSize"
  88. @pagination="getList"
  89. />
  90. <!-- 新增/编辑弹框 -->
  91. <add-and-edit
  92. ref="addAndEdit"
  93. @getList="getList"
  94. />
  95. <!-- 座位模板 -->
  96. <seat-template-edit ref="seatTemplateEdit" @getList="getList"></seat-template-edit>
  97. <!-- 剧目管理 -->
  98. <programme-add-and-edit ref="programmeAddAndEdit" @getList="getList"></programme-add-and-edit>
  99. <el-dialog
  100. title="查看"
  101. :visible.sync="visibleStatus"
  102. width="600px"
  103. :destroy-on-close="true"
  104. :close-on-click-modal="false"
  105. >
  106. <div v-if="visibleType == 'img'">
  107. <el-image
  108. style="width: 400px; height: 100%"
  109. :src="newObj.seatImg"
  110. fit="cover"
  111. />
  112. </div>
  113. <div v-if="visibleType == 'html'">
  114. <div v-html="newObj.centent"></div>
  115. </div>
  116. <div slot="footer" class="dialog-footer">
  117. <el-button type="primary" @click="visibleStatus = false">确 定</el-button>
  118. </div>
  119. </el-dialog>
  120. </div>
  121. </template>
  122. <script>
  123. import { merchantPageList, deleteById } from '@/api/performanceHallMr/performanceHallMr'
  124. import addAndEdit from "./dialog/addAndEdit.vue";
  125. import seatTemplateEdit from "./dialog/seatTemplateEdit";
  126. // import seatTemplateEdit from "./dialog/seatTemplateEditOld";
  127. import programmeAddAndEdit from "./dialog/programmeAddAndEdit";
  128. export default {
  129. name: "agreement",
  130. components: { addAndEdit, seatTemplateEdit, programmeAddAndEdit },
  131. data() {
  132. return {
  133. // 遮罩层
  134. loading: true,
  135. // 选中数组
  136. ids: [],
  137. // 非单个禁用
  138. single: true,
  139. // 非多个禁用
  140. multiple: true,
  141. // 显示搜索条件
  142. showSearch: true,
  143. // 总条数
  144. total: 0,
  145. // 用户表格数据
  146. dataList: null,
  147. // 弹出层标题
  148. title: "",
  149. // 是否显示弹出层
  150. open: false,
  151. // 日期范围
  152. dateRange: [],
  153. // 查询参数
  154. queryParams: {
  155. pageNum: 1,
  156. pageSize: 10,
  157. type: undefined
  158. },
  159. statusList: [
  160. {id: 1, name: '未发布', value: 0},
  161. {id: 2, name: '已上架', value: 1},
  162. {id: 3, name: '未上架', value: 2},
  163. ],
  164. visibleStatus: false,
  165. newObj: {},
  166. visibleType: '',
  167. seatList: [],
  168. };
  169. },
  170. created() {
  171. this.getList();
  172. },
  173. methods: {
  174. /** 查询列表 */
  175. getList() {
  176. this.loading = true;
  177. merchantPageList(this.addDateRange(this.queryParams, this.dateRange))
  178. .then(response => {
  179. this.dataList = response.data.rows;
  180. this.total = response.data.total;
  181. this.loading = false;
  182. }
  183. );
  184. },
  185. // 取消按钮
  186. cancel() {
  187. this.open = false;
  188. },
  189. /** 搜索按钮操作 */
  190. handleQuery() {
  191. this.queryParams.pageNum = 1;
  192. this.getList();
  193. },
  194. /** 重置按钮操作 */
  195. resetQuery() {
  196. this.dateRange = [];
  197. this.$set(this.queryParams, 'name', '');
  198. this.$set(this.queryParams, 'theatreName', '');
  199. this.queryParams.pageNum = 1;
  200. this.handleQuery();
  201. },
  202. // 多选框选中数据
  203. handleSelectionChange(selection) {
  204. this.ids = selection.map(item => item.userId);
  205. this.single = selection.length != 1;
  206. this.multiple = !selection.length;
  207. },
  208. /** 新增按钮操作 */
  209. handleAdd() {
  210. this.$refs["addAndEdit"].openDialog("新增数据", null);
  211. },
  212. /** 修改按钮操作 */
  213. handleUpdate(row) {
  214. this.$refs["addAndEdit"].openDialog("修改数据", row);
  215. },
  216. /** 座位管理按钮操作 */
  217. handleSeat(row) {
  218. this.$refs["seatTemplateEdit"].openDialog("座位管理", row);
  219. },
  220. /** 剧目管理按钮操作 */
  221. handleMr(row) {
  222. this.$refs["programmeAddAndEdit"].openDialog("剧目管理", row);
  223. },
  224. /** 删除按钮操作 */
  225. handleDelete(row) {
  226. this.$modal.confirm('是否确认删除数据演出厅为"' + row.name + '"的数据项?').then(function() {
  227. return deleteById(row.id);
  228. }).then(() => {
  229. this.getList();
  230. this.$modal.msgSuccess("删除成功");
  231. }).catch(() => {});
  232. },
  233. /** 查看按钮操作 */
  234. seeCenter(obj, type) {
  235. this.visibleStatus = true
  236. this.visibleType = type;
  237. this.newObj = obj;
  238. }
  239. }
  240. };
  241. </script>