index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
  4. <el-form-item label="团队名称" label-width="70px">
  5. <el-input
  6. v-model="queryParams.teamName"
  7. placeholder="请输入团队名称"
  8. clearable
  9. style="width: 240px;"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="票务名称:" prop="goodsId">
  14. <el-select
  15. v-model="queryParams.goodsId"
  16. placeholder="票务名称"
  17. clearable
  18. style="width: 100%;"
  19. >
  20. <el-option
  21. v-for="dict in ticketList"
  22. :key="dict.id"
  23. :label="dict.goodsName"
  24. :value="dict.id"
  25. />
  26. </el-select>
  27. </el-form-item>
  28. <el-form-item label="审核状态">
  29. <el-select
  30. v-model="queryParams.status"
  31. placeholder="审核状态"
  32. clearable
  33. style="width: 100%"
  34. >
  35. <el-option
  36. v-for="dict in statusList"
  37. :key="dict.value"
  38. :label="dict.name"
  39. :value="dict.value"
  40. />
  41. </el-select>
  42. </el-form-item>
  43. <el-form-item>
  44. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  45. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  46. </el-form-item>
  47. </el-form>
  48. <el-row :gutter="10" class="mb8">
  49. <el-col :span="1.5">
  50. <el-button
  51. type="primary"
  52. plain
  53. icon="el-icon-plus"
  54. size="mini"
  55. @click="handleAdd"
  56. v-hasPermi="['applicationMr:applicationMr:add']"
  57. >新增报名</el-button>
  58. </el-col>
  59. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  60. </el-row>
  61. <el-table ref="tables" v-loading="loading" :data="dataList" border>
  62. <el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
  63. <el-table-column label="团队名称" align="center" prop="teamName" />
  64. <el-table-column label="预约场馆" align="center" prop="theatreName" />
  65. <el-table-column label="预约演出厅" align="center" prop="auditoriumName" />
  66. <el-table-column label="预约剧目" align="center" prop="performName" />
  67. <el-table-column label="票务名称" align="center" prop="goodsName" />
  68. <el-table-column label="座位类型" align="center" prop="seatTypeName" />
  69. <el-table-column label="团购单价" align="center" prop="price">
  70. <template slot-scope="scope">
  71. <span v-if="scope.row.price">¥{{ scope.row.price }}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="预约时间" align="center" width="160">
  75. <template slot-scope="scope">
  76. <span>{{ scope.row.performDate }}日 <br /> {{ scope.row.performTimeStart }}-{{ scope.row.performTimeEnd }}</span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="观影人数" align="center" prop="viewerNum" />
  80. <el-table-column label="合计" align="center" prop="priceTotal" />
  81. <el-table-column label="报名时间" align="center" prop="createTime" width="160">
  82. <template slot-scope="scope">
  83. <span>{{ parseTime(scope.row.createTime) }}</span>
  84. </template>
  85. </el-table-column>
  86. <el-table-column label="审核状态" align="center">
  87. <template slot-scope="scope">
  88. <el-tag type="info" v-if="scope.row.status == 0">待审核</el-tag>
  89. <el-tag type="success" v-if="scope.row.status == 1">审核成功</el-tag>
  90. <el-tag type="danger" v-if="scope.row.status == 2">审核失败</el-tag>
  91. <el-tag type="info" v-if="scope.row.status == 3">关闭</el-tag>
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="审核时间" align="center" prop="createTime" width="160">
  95. <template slot-scope="scope">
  96. <span>{{ parseTime(scope.row.createTime) }}</span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="审核人" align="center" prop="checkorName" />
  100. <el-table-column label="操作" align="center" fixed="right" width="150" class-name="small-padding fixed-width">
  101. <template slot-scope="scope">
  102. <el-button
  103. size="mini"
  104. type="text"
  105. @click="handleUpdate(scope.row)"
  106. v-if="name==scope.row.createBy && scope.row.status == 2"
  107. v-hasPermi="['applicationMr:applicationMr:edit']"
  108. >修改</el-button>
  109. <el-button
  110. size="mini"
  111. type="text"
  112. v-if="scope.row.status == 0"
  113. @click="handleDetails(scope.row, 'examine')"
  114. v-hasPermi="['applicationMr:applicationMr:examine']"
  115. >审核</el-button>
  116. <el-button
  117. size="mini"
  118. type="text"
  119. @click="handleDetails(scope.row)"
  120. v-hasPermi="['applicationMr:applicationMr:details']"
  121. >详情</el-button>
  122. <el-button
  123. size="mini"
  124. type="text"
  125. v-if="scope.row.status == 1"
  126. @click="handleOrderDetails(scope.row)"
  127. v-hasPermi="['applicationMr:applicationMr:order']"
  128. >查看订单</el-button>
  129. </template>
  130. </el-table-column>
  131. </el-table>
  132. <pagination
  133. v-show="total>0"
  134. :total="total"
  135. :page.sync="queryParams.pageNum"
  136. :limit.sync="queryParams.pageSize"
  137. @pagination="getList"
  138. />
  139. <!-- 新增/编辑弹框 -->
  140. <add-and-edit
  141. ref="addAndEdit"
  142. :dict="dict"
  143. @getList="getList"
  144. />
  145. <!-- 详情弹框 -->
  146. <application-details
  147. :dict="dict"
  148. @getList="getList"
  149. ref="appDetails"></application-details>
  150. <!-- 团购订单详情弹框 -->
  151. <order-details
  152. :dict="dict"
  153. ref="orderDetails"></order-details>
  154. <el-dialog
  155. title="查看"
  156. :visible.sync="visibleStatus"
  157. width="600px"
  158. :destroy-on-close="true"
  159. :close-on-click-modal="false"
  160. >
  161. <div v-if="visibleType == 'img'">
  162. <el-image
  163. style="width: 400px; height: 100%"
  164. :src="newObj.mainImg"
  165. fit="cover"
  166. />
  167. </div>
  168. <div v-if="visibleType == 'html'">
  169. <div v-html="newObj.centent"></div>
  170. </div>
  171. <div slot="footer" class="dialog-footer">
  172. <el-button type="primary" @click="visibleStatus = false">确 定</el-button>
  173. </div>
  174. </el-dialog>
  175. </div>
  176. </template>
  177. <script>
  178. import { pageList, deleteById, updateStatus } from '@/api/team/applicationMr'
  179. import addAndEdit from "./dialog/addAndEdit.vue";
  180. import applicationDetails from "./dialog/applicationDetails.vue";
  181. import orderDetails from "./dialog/orderDetails.vue";
  182. import { ticketPageList } from '@/api/ticketMr/ticketMr'
  183. import { mapGetters } from 'vuex'
  184. export default {
  185. name: "agreement",
  186. dicts: ['team_type'],
  187. components: { addAndEdit, applicationDetails, orderDetails },
  188. data() {
  189. return {
  190. // 遮罩层
  191. loading: true,
  192. // 选中数组
  193. ids: [],
  194. // 非单个禁用
  195. single: true,
  196. // 非多个禁用
  197. multiple: true,
  198. // 显示搜索条件
  199. showSearch: true,
  200. // 总条数
  201. total: 0,
  202. // 用户表格数据
  203. dataList: null,
  204. // 弹出层标题
  205. title: "",
  206. // 是否显示弹出层
  207. open: false,
  208. // 日期范围
  209. dateRange: [],
  210. // 查询参数
  211. queryParams: {
  212. pageNum: 1,
  213. pageSize: 10,
  214. type: undefined
  215. },
  216. statusList: [
  217. {id: 1, name: '待审核', value: 0},
  218. {id: 2, name: '已通过', value: 1},
  219. {id: 3, name: '已驳回', value: 2},
  220. ],
  221. visibleStatus: false,
  222. newObj: {},
  223. visibleType: '',
  224. setStatus: false,
  225. setForm: {},
  226. setRules: [],
  227. setLoading: false,
  228. ticketList: []
  229. };
  230. },
  231. computed: {
  232. ...mapGetters([
  233. 'name',
  234. ]),
  235. },
  236. created() {
  237. this.getList();
  238. this.ticketListApi();
  239. },
  240. methods: {
  241. /** 查询列表 */
  242. getList() {
  243. this.loading = true;
  244. pageList(this.queryParams)
  245. .then(response => {
  246. this.dataList = response.data.rows;
  247. this.dataList.forEach(item =>{
  248. item.switchValue = item.status;
  249. })
  250. this.total = response.data.total;
  251. this.loading = false;
  252. }
  253. );
  254. },
  255. /** 票务列表查询 */
  256. ticketListApi() {
  257. ticketPageList(this.addDateRange({pageNum: 1, pageSize: 100, goodsType: 2, classifyId: 1, status: 0}))
  258. .then(response => {
  259. this.ticketList = response.data.rows;
  260. });
  261. },
  262. // 取消按钮
  263. cancel() {
  264. this.open = false;
  265. },
  266. /** 搜索按钮操作 */
  267. handleQuery() {
  268. this.queryParams.pageNum = 1;
  269. this.getList();
  270. },
  271. /** 重置按钮操作 */
  272. resetQuery() {
  273. this.dateRange = [];
  274. this.$set(this.queryParams, 'teamName', '');
  275. this.$set(this.queryParams, 'goodsId', '');
  276. this.$set(this.queryParams, 'status', '');
  277. this.queryParams.pageNum = 1;
  278. this.handleQuery();
  279. },
  280. /** 价格输入事件 */
  281. changePriceAmount(key) {
  282. if(this.setForm[key] * 1 < 0){
  283. this.$message.error("输入需大于或等于0!");
  284. this.$set(this.setForm, key, '');
  285. return false
  286. }
  287. },
  288. /** 新增按钮操作 */
  289. handleAdd() {
  290. this.$refs["addAndEdit"].openDialog("新增数据", null);
  291. },
  292. /** 修改 */
  293. handleUpdate(row) {
  294. this.$refs["addAndEdit"].openDialog("新增数据", {...row});
  295. },
  296. /** 详情审核按钮操作 */
  297. handleDetails(row, type) {
  298. this.$refs["appDetails"].openDialog("查看详情", row, type);
  299. },
  300. /** 详情按钮操作 */
  301. handleOrderDetails(row) {
  302. this.$refs["orderDetails"].openDialog("查看详情", row);
  303. },
  304. /** 团队绑定按钮操作 */
  305. handleTeam(row) {
  306. this.$refs["dumplingEdit"].openDialog("团队绑定", row);
  307. },
  308. /** 禁用或者启用发布按钮操作 */
  309. ionlineApi(row) {
  310. this.$confirm("是否对剧目名称为" + row.performName + "的数据进行" + (row.status == 1 ? '下架?' : '上架?'), '提示', {
  311. confirmButtonText: '确定',
  312. cancelButtonText: '取消',
  313. type: 'warning'
  314. }).then(() => {
  315. updateStatus({ id: row.id, status: row.status == 1 ? 0 : 1 }).then((res) => {
  316. if (res.code == 200) {
  317. this.$message({
  318. type: 'success',
  319. message: '操作成功!'
  320. });
  321. this.getList();
  322. }
  323. });
  324. }).catch(() => {});
  325. },
  326. /** 删除按钮操作 */
  327. handleDelete(row) {
  328. this.$modal.confirm('是否确认删除数据剧目名称为"' + row.performName + '"的数据项?').then(function() {
  329. return deleteById(row.id);
  330. }).then(() => {
  331. this.getList();
  332. this.$modal.msgSuccess("删除成功");
  333. }).catch(() => {});
  334. },
  335. /** 查看按钮操作 */
  336. seeCenter(obj, type) {
  337. this.visibleStatus = true
  338. this.visibleType = type;
  339. this.newObj = obj;
  340. }
  341. }
  342. };
  343. </script>