|
|
@@ -0,0 +1,502 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container app-container-scheduling" :style="{ '--q-height': qHeight }">
|
|
|
+ <div class="app-container-query" ref="queryFormBox">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :rules="rules" size="small" :inline="true" v-show="showSearch"
|
|
|
+ label-width="100px">
|
|
|
+ <el-form-item label="演出厅" prop="auditoriumId">
|
|
|
+ <el-select v-model="queryParams.auditoriumId" placeholder="演出厅" clearable style="width: 100%"
|
|
|
+ @change="changeTime($event, 'auditoriumId')">
|
|
|
+ <el-option v-for="dict in merchantTheatreAuditoriumListS" :key="dict.id" :label="dict.name"
|
|
|
+ :value="dict.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="场次时间" prop="performDate">
|
|
|
+ <el-date-picker type="date" placeholder="选择场次时间" v-model="queryParams.performDate"
|
|
|
+ @change="changeTime($event, 'performDate')" value-format="yyyy-MM-dd"></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="场次" prop="performTimeId">
|
|
|
+ <el-select v-model="queryParams.performTimeId" placeholder="场次" clearable style="width: 100%"
|
|
|
+ @change="changeTime($event, 'performTimeId')">
|
|
|
+ <el-option v-for="dict in merchantPerformTimeListS" :key="dict.id"
|
|
|
+ :label="dict.timeSnapshot + '(' + dict.performTimeStart + '-' + dict.performTimeEnd + ')'"
|
|
|
+ :value="dict.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button style="margin-left: 10px;" type="primary" icon="el-icon-search" size="mini"
|
|
|
+ @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="app-container-table-box">
|
|
|
+ <div class="movie-countdown">
|
|
|
+ <!-- 显示下一个场次倒计时 -->
|
|
|
+ <div v-if="nextSession" class="countdown">
|
|
|
+ <!-- <p>时间:{{ formatTime(nextSession.time) }}</p> -->
|
|
|
+ <p class="timer">
|
|
|
+ 距离本场
|
|
|
+ {{ pTime }}
|
|
|
+ 开始剩余:
|
|
|
+ <span v-if="days > 0">{{ days }}</span>
|
|
|
+ <span class="dot" v-if="days > 0">:</span>
|
|
|
+ <span v-if="hours > 0">{{ hours }}</span>
|
|
|
+ <span class="dot" v-if="hours > 0">:</span>
|
|
|
+ <span>{{ minutes }}</span>
|
|
|
+ <span class="dot">:</span>
|
|
|
+ <span>{{ seconds }}</span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="app-container-table-info">
|
|
|
+ <el-table ref="multipleTable" max-height="380px" class="section-table" v-loading="loading" :data="dataList"
|
|
|
+ :row-style="tableRowStyle" border style="width: 100%">
|
|
|
+ <el-table-column label="序号" align="center" type="index" width="60"></el-table-column>
|
|
|
+ <el-table-column label="订单号" align="center" prop="orderId" width="170" />
|
|
|
+ <el-table-column label="观影人姓名" align="center" prop="name" width="120" />
|
|
|
+ <el-table-column label="购票人手机号" align="center" prop="memberMobile" />
|
|
|
+ <el-table-column label="座位类型" align="center" prop="seatTypeName" />
|
|
|
+ <el-table-column label="购票渠道" align="center" prop="source">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="dict.type.order_form_type" :value="scope.row.source" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <!-- <el-table-column label="剧目名称" align="center" prop="performName" />
|
|
|
+ <el-table-column label="票务名称" align="center" prop="goodsName" /> -->
|
|
|
+ <el-table-column label="日期" align="center" prop="performDate" />
|
|
|
+ <el-table-column label="场次" width="180" align="center" prop="timeSnapshot">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.timeSnapshot }}<br />({{ scope.row.performTimeStart + '-' +
|
|
|
+ scope.row.performTimeEnd
|
|
|
+ }})</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="订单状态" align="center" prop="orderStatus">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="dict.type.order_status_type" :value="scope.row.orderStatus" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="打印次数" align="center" prop="ticketPrintTotal" />
|
|
|
+ <!-- <el-table-column label="金额" align="center" prop="realPrice">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.status != 0">¥{{ scope.row.realPrice }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+
|
|
|
+
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList" />
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+import { pageExpiryList, pagePerformTimeList } from '@/api/order/service';
|
|
|
+// import { pagePerformTimeList } from "@/api/schedulingMr/schedulingMr"
|
|
|
+import { getDetailById } from '@/api/order/service';
|
|
|
+import {
|
|
|
+ merchantTheatreAuditoriumList,
|
|
|
+} from '@/api/windowTicketSales/ticketingSales'
|
|
|
+import moment from "moment"
|
|
|
+export default {
|
|
|
+ name: "Notice",
|
|
|
+ dicts: ['order_form_type', 'order_status_type'],
|
|
|
+ // components: { detailsDia },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ qHeight: '0px',
|
|
|
+ resizeObserver: null,
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 用户表格数据
|
|
|
+ dataList: [],
|
|
|
+ // 日期范围
|
|
|
+ dateRange: [],
|
|
|
+ statusOptions: [{
|
|
|
+ label: '待处理',
|
|
|
+ value: 1
|
|
|
+ }, {
|
|
|
+ label: '处理中',
|
|
|
+ value: 2
|
|
|
+ }, {
|
|
|
+ label: '处理完成',
|
|
|
+ value: 3
|
|
|
+ }],
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ performTimeId: '',
|
|
|
+ performDate: null,
|
|
|
+ auditoriumId: null,
|
|
|
+ // goodsId: null,
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ auditoriumId: [
|
|
|
+ { required: true, message: '请选择演出厅', trigger: ['blur', 'change'] }
|
|
|
+ ],
|
|
|
+ performDate: [
|
|
|
+ { required: true, message: '请选择时间', trigger: ['blur', 'change'] }
|
|
|
+ ],
|
|
|
+ // performTimeId: [
|
|
|
+ // { required: true, message: '请选择场次', trigger: ['blur', 'change'] }
|
|
|
+ // ]
|
|
|
+ },
|
|
|
+ // pagePerformTimeList: [], // 场次列表
|
|
|
+ merchantTheatreAuditoriumListS: [], // 演出厅
|
|
|
+ merchantPerformTimeListS: [], // 场次
|
|
|
+ pTime: '',
|
|
|
+ days: 0,
|
|
|
+ hours: 0,
|
|
|
+ minutes: 0,
|
|
|
+ seconds: 0,
|
|
|
+ nextSession: null, // 下一场信息
|
|
|
+ timer: null
|
|
|
+
|
|
|
+ // multiPerformDate: false,
|
|
|
+ // fixed: 'left',
|
|
|
+
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.merchantTheatreAuditoriumListFun()
|
|
|
+ this.$set(this.queryParams, 'performDate', moment().format("yyyy-MM-DD"))
|
|
|
+ // this.pagePerformTimeListFun(this.queryParams.performDate)
|
|
|
+ },
|
|
|
+ activated() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.resizeObserver = new ResizeObserver(entries => {
|
|
|
+ for (let entry of entries) {
|
|
|
+ const { width, height } = entry.contentRect;
|
|
|
+ this.qHeight = height + 'px'
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.resizeObserver.observe(this.$refs.queryFormBox);
|
|
|
+ // this.getList();
|
|
|
+ this.initCountdown()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ tableRowStyle({ row, rowIndex }) {
|
|
|
+ // 例如:根据状态设置背景色
|
|
|
+ if (row.isHighlight === 1) {
|
|
|
+ return { backgroundColor: '#ffcf8b' }
|
|
|
+ }
|
|
|
+ return {} // 默认样式
|
|
|
+ },
|
|
|
+ // 初始化:找出下一个未开始的场次
|
|
|
+ initCountdown() {
|
|
|
+ const now = new Date().getTime()
|
|
|
+ // 找出第一个时间大于当前时间的场次
|
|
|
+ //this.nextSession = this.sessions
|
|
|
+ // .map(s => ({ ...s, timestamp: new Date(s.time).getTime() }))
|
|
|
+ // .find(s => s.timestamp > now) || null
|
|
|
+ if (this.queryParams.performTimeId) {
|
|
|
+ let timeInfo = this.merchantPerformTimeListS.find(ele => ele.id === this.queryParams.performTimeId);
|
|
|
+ console.log(timeInfo, 'timeInfo');
|
|
|
+ if (timeInfo) {
|
|
|
+ let startTimer = new Date(timeInfo.performStartTime).getTime();
|
|
|
+ if (startTimer > now) {
|
|
|
+ timeInfo.timestamp = startTimer
|
|
|
+ this.nextSession = timeInfo
|
|
|
+ this.pTime = '(' + timeInfo.performTimeStart + '-' + timeInfo.performTimeEnd + ')'
|
|
|
+ } else {
|
|
|
+ this.nextSession = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.nextSession = null
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果有下一场,开始倒计时
|
|
|
+ if (this.nextSession) {
|
|
|
+ this.startTimer()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 开始倒计时
|
|
|
+ startTimer() {
|
|
|
+ // 立即更新一次
|
|
|
+ this.updateCountdown()
|
|
|
+
|
|
|
+ // 每秒更新
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ this.updateCountdown()
|
|
|
+ }, 1000)
|
|
|
+ },
|
|
|
+
|
|
|
+ // 更新倒计时
|
|
|
+ updateCountdown() {
|
|
|
+ const now = new Date().getTime()
|
|
|
+ const distance = this.nextSession.timestamp - now
|
|
|
+
|
|
|
+ if (distance <= 0) {
|
|
|
+ // 当前场次已开始,清除定时器,重新初始化找下一场
|
|
|
+ clearInterval(this.timer)
|
|
|
+ this.timer = null
|
|
|
+ this.initCountdown() // 重新查找下一个未开始的场次
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 更新显示时间
|
|
|
+ this.days = Math.floor(distance / (1000 * 60 * 60 * 24))
|
|
|
+ this.hours = String(Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))).padStart(2, '0')
|
|
|
+ this.minutes = String(Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60))).padStart(2, '0')
|
|
|
+ this.seconds = String(Math.floor((distance % (1000 * 60)) / 1000)).padStart(2, '0')
|
|
|
+ },
|
|
|
+
|
|
|
+ // 格式化时间显示(如 2025-08-25 16:00)
|
|
|
+ formatTime(dateTimeStr) {
|
|
|
+ const date = new Date(dateTimeStr)
|
|
|
+ return date.toLocaleString('zh-CN', {
|
|
|
+ year: 'numeric',
|
|
|
+ month: '2-digit',
|
|
|
+ day: '2-digit',
|
|
|
+ hour: '2-digit',
|
|
|
+ minute: '2-digit'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 查询订单列表
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ pageExpiryList(this.queryParams).then(response => {
|
|
|
+ this.dataList = response.data.rows;
|
|
|
+ this.total = response.data.total;
|
|
|
+ this.loading = false;
|
|
|
+ }).catch(() => {
|
|
|
+ this.dataList = [];
|
|
|
+ this.total = 0;
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 查询订单列表
|
|
|
+ getRegistInfo(id) {
|
|
|
+ getDetailById(id).then(response => {
|
|
|
+ this.addForm = response.data;
|
|
|
+ }).catch(() => {
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.dateRange = [];
|
|
|
+ this.$set(this.queryParams, 'orderId', '');
|
|
|
+ this.$set(this.queryParams, 'memberMobile', '');
|
|
|
+ this.$set(this.queryParams, 'performDate', '');
|
|
|
+ this.$set(this.queryParams, 'performTimeId', '');
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ /** 获取演出厅 */
|
|
|
+ async merchantTheatreAuditoriumListFun() {
|
|
|
+ try {
|
|
|
+ let res = await merchantTheatreAuditoriumList({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 999
|
|
|
+ })
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.merchantTheatreAuditoriumListS = res.data.rows
|
|
|
+ if (this.merchantTheatreAuditoriumListS.length > 0) {
|
|
|
+ this.$set(this.queryParams, 'auditoriumId', this.merchantTheatreAuditoriumListS[0].id)
|
|
|
+ this.changeTime(this.queryParams.auditoriumId, 'auditoriumId')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /** 选择场次时间 */
|
|
|
+ changeTime(value, type) {
|
|
|
+ if (type == 'performTimeId') {
|
|
|
+ this.initCountdown()
|
|
|
+ // this.$set(this.queryParams, 'goodsId', '')
|
|
|
+ // this.stockType = null
|
|
|
+ // if (value) {
|
|
|
+ // let flog = false
|
|
|
+ // let list2 = []
|
|
|
+ // this.merchantPerformTimeListS.forEach((item, index) => {
|
|
|
+ // if (item.id == value) {
|
|
|
+ // flog = true
|
|
|
+ // list2 = item.goodsList
|
|
|
+ // // this.stockType = item.stockType
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ this.changeTimeCheck(value, type)
|
|
|
+
|
|
|
+ },
|
|
|
+ /** 选择场次时间 */
|
|
|
+ async changeTimeCheck(value, type) {
|
|
|
+ if (this.queryParams && this.queryParams.performTimeId && type != 'performTimeId') {
|
|
|
+ this.$set(this.queryParams, 'performTimeId', '')
|
|
|
+ this.merchantPerformTimeListS = []
|
|
|
+ }
|
|
|
+ if (this.queryParams.auditoriumId && this.queryParams.performDate && type != 'performTimeId') {
|
|
|
+ // 获取场次
|
|
|
+ this.pagePerformTimeListFun(this.queryParams.performDate)
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async pagePerformTimeListFun(value) {
|
|
|
+ try {
|
|
|
+ this.merchantPerformTimeListS = []
|
|
|
+ this.$set(this.queryParams, 'performTimeId', null)
|
|
|
+ if (!value) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let { data, code } = await pagePerformTimeList({
|
|
|
+ performDate: value,
|
|
|
+ auditoriumId: this.queryParams.auditoriumId,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 999
|
|
|
+ })
|
|
|
+ // this.pagePerformTimeList = [].concat(data.rows)
|
|
|
+ this.merchantPerformTimeListS = [].concat(data.rows)
|
|
|
+ if (this.merchantPerformTimeListS.length > 0) {
|
|
|
+ this.queryParams.performTimeId = this.merchantPerformTimeListS[0].id;
|
|
|
+ this.initCountdown()
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ clearQuery(key) {
|
|
|
+ this.$set(this.queryParams, key, '')
|
|
|
+ if (key == 'performDate') {
|
|
|
+ this.$set(this.queryParams, 'performTimeId', '')
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ this.resizeObserver.unobserve(this.$refs.queryFormBox);
|
|
|
+ this.resizeObserver.disconnect();
|
|
|
+ if (this.timer) {
|
|
|
+ clearInterval(this.timer)
|
|
|
+ }
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style scoped lang="scss">
|
|
|
+.app-container {
|
|
|
+ height: calc(100vh - 110px);
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+
|
|
|
+// .section-table thead .el-table-column--selection .cell {
|
|
|
+// display: none;
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+.app-container-table-box {
|
|
|
+ height: calc(100% - var(--q-height));
|
|
|
+
|
|
|
+ .movie-countdown {
|
|
|
+ font-family: 'Microsoft YaHei', sans-serif;
|
|
|
+ // padding: 20px;
|
|
|
+ // max-width: 400px;
|
|
|
+ // margin: 20px auto;
|
|
|
+ // border: 1px solid #ddd;
|
|
|
+ // border-radius: 8px;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+
|
|
|
+ .countdown {
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+
|
|
|
+ .countdown .timer {
|
|
|
+ font-size: 16px;
|
|
|
+ margin: 0 0 15px 0;
|
|
|
+ // color: #e67e22;
|
|
|
+ color: #333;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .timer span {
|
|
|
+ display: inline-block;
|
|
|
+ min-width: 24px;
|
|
|
+ // margin: 0 3px;
|
|
|
+ text-align: center;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #e67e22;
|
|
|
+ }
|
|
|
+
|
|
|
+ .timer .dot {
|
|
|
+ min-width: 6px;
|
|
|
+ margin: 0 3px;
|
|
|
+ color: #f35034;
|
|
|
+ }
|
|
|
+
|
|
|
+ .btn-warp {
|
|
|
+ width: 120px;
|
|
|
+ height: 40px;
|
|
|
+ margin: 0 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .app-container-table-info {
|
|
|
+ //height: calc(100% - 100px);
|
|
|
+ height: auto;
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep .section-table thead .el-table-column--selection .cell {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ //.custom-header ::v-deep(.el-checkbox) {
|
|
|
+ // display: none !important;
|
|
|
+ //}
|
|
|
+
|
|
|
+ /* 可选:如果你想让表头文字居中对齐 */
|
|
|
+ // .custom-header {
|
|
|
+ // text-align: center;
|
|
|
+ // width: 100%;
|
|
|
+ // /* 如果需要,可以设置字体大小、颜色等 */
|
|
|
+ // font-weight: normal;
|
|
|
+ // color: #606266;
|
|
|
+ // }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+.app-container-scheduling ::v-deep .el-select__tags {
|
|
|
+ flex-wrap: inherit !important;
|
|
|
+ overflow-x: auto !important;
|
|
|
+}
|
|
|
+
|
|
|
+.app-container-scheduling ::v-deep .el-form-item__content {
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.app-container-scheduling ::v-deep .el-form-item__content .query_clear {
|
|
|
+ position: absolute;
|
|
|
+ top: -15px;
|
|
|
+ right: -10px;
|
|
|
+ display: none;
|
|
|
+ cursor: pointer;
|
|
|
+ z-index: 99;
|
|
|
+}
|
|
|
+
|
|
|
+.app-container-scheduling ::v-deep .el-form-item__content:hover .query_clear {
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+</style>
|