index.vue 6.7 KB

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