index.vue 12 KB

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