浏览代码

1. 新增

MONSTER-ygh 1 月之前
父节点
当前提交
882780457b

+ 56 - 0
src/api/priceConfiguration/index.js

@@ -0,0 +1,56 @@
+import request from '@/utils/request'
+
+// 分页查询
+export const pageList = (query) => {
+  return request({
+    url: '/merchant/priceInfo/pageList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 新增/修改
+export const saveAndEdit = (data) => {
+  return request({
+    url: '/merchant/priceInfo/insertOrUpdate',
+    method: 'post',
+    data: data
+  })
+}
+
+// 查询详情
+export function getSelectById(params) {
+  return request({
+    url: '/merchant/priceInfo/selectById',
+    method: 'get',
+    params
+  })
+}
+
+
+// 查询价格日历列表
+export function getCalendarList(params) {
+  return request({
+    url: '/merchant/priceCalendar/pageList',
+    method: 'get',
+    params
+  })
+}
+
+// 删除模板
+export const deleteById = (params) => {
+  return request({
+    url: '/merchant/priceInfo/deleteById',
+    method: 'delete',
+    params
+  })
+}
+
+// 更新状态
+export const updateById = (data) => {
+  return request({
+    url: '/merchant/priceInfo/updateById',
+    method: 'put',
+    data
+  })
+}

+ 1 - 1
src/api/windowTicketSales/rebook.js

@@ -20,7 +20,7 @@ export const getDateTimeAll = (query) => {
   
 
 // 订单改签
-export const rebook = (data) => {
+export const rebookApi = (data) => {
   return request({
     url: '/order/orderResubmit/reSubmit',
     method: 'post',

+ 1 - 1
src/views/ticket/InventoryTemplate/dialog/addAndEdit.vue

@@ -516,7 +516,7 @@ export default {
     },
     /**  获取座位  */
     async getSeatSelectById() {
-      if(!this.form.auditoriumId){  return }
+      if(!this.form.auditoriumId){  this.dataList = []; return }
       if(!this.dataList || this.dataList.length == 0 || this.dataList[0].auditoriumId !== this.form.auditoriumId) {
         let res = await getSeatSelectByIdApi(this.form.auditoriumId)
         this.dataList = res.data;

+ 2 - 2
src/views/ticket/schedulingConfiguration/dialog/addAndEdit.vue

@@ -228,7 +228,7 @@ export default {
         {name: "星期四",key: "4"},
         {name: "星期五",key: "5"},
         {name: "星期六",key: "6"},
-        {name: "星期",key: "7"},
+        {name: "星期",key: "7"},
       ],
       inventoryTemplateList: []
     };
@@ -260,8 +260,8 @@ export default {
           goodsIds: obj.goodsIds ? obj.goodsIds.split(','):[],
           weekDay: obj.weekDay ? obj.weekDay.split(','):[],
           planSessionList: obj.planSessionList ? obj.planSessionList:[],
+          id: null
         }
-        this.editType = true;
         console.log("form====",this.form)
       }else{
         this.title = "新增排期";

+ 8 - 7
src/views/ticket/schedulingConfiguration/dialog/perFormDeatils.vue

@@ -113,6 +113,7 @@
             <el-button 
             :type="this.form.status == 2 ? 'primary': 'danger'" 
             @click="releaseFun" 
+            v-hasPermi="['ticketMr:schedulingConfiguration:release']"
             :loading="loading">
                 <span>{{ this.form.status == 2 ? '启用本场次': '禁用本场次' }}</span>
             </el-button>
@@ -153,17 +154,17 @@ export default {
          */
         async openDialog(title, obj, type) {
             this.open = true;
-            this.radio1 == 0
-            this.goodsIds = []
+            this.radio1 = 1
+            this.goodsIds = null
             let list = ["星期天","星期一","星期二","星期三","星期四","星期五","星期六"]
             this.title = obj.performDate + "  " + list[moment(obj.performDate).day()] +"  "+ obj.performTimeStart + "-" + obj.performTimeEnd 
             this.form = {}
             console.log("boj===",obj)
-            this.goodsPageListFun(obj.performId)
+            await this.goodsPageListFun(obj.performId)
             if(this.radio1 == 1) {
-                this.getPerformTimeByIdFun(obj.id)
+                await this.getPerformTimeByIdFun(obj.id)
             }else if(this.radio1 == 2){
-                this.getPerformTimeDataFun(obj)
+                await this.getPerformTimeDataFun(obj)
             }
         },
         /**  票务信息  */
@@ -207,7 +208,7 @@ export default {
                 this.loading = true
                 let res = await seatTypeTmpSaleCount({
                     id: this.form.id,
-                    goodsId: this.goodsId
+                    goodsId: this.goodsIds
                 })
                 if(res.code == 200){
                 this.timeList = res.data.rows.filter((item)=>{
@@ -222,7 +223,7 @@ export default {
             }
         },
         releaseFun(){
-            let srt = this.form.status == 1?`确定要启用该场次进行售卖吗?`:`确定要禁用该场次进行售卖吗?`
+            let srt = this.form.status == 2?`确定要启用该场次进行售卖吗?`:`确定要禁用该场次停止售卖吗?`
             this.$modal.confirm(srt).then(()=> {
                 this.submitForm()
             }).catch(() => {});

+ 10 - 6
src/views/ticket/schedulingConfiguration/dialog/perFormListBox.vue

@@ -3,7 +3,7 @@
         :close-on-click-modal="false" @close="cancel">
         <div class="dialog">
             <div>
-                <el-button type="primary" @click="handleAdd('ADD')">新增</el-button>
+                <el-button type="primary" v-hasPermi="['ticketMr:schedulingConfiguration:add']" @click="handleAdd('ADD')">新增</el-button>
             </div>
             <el-table ref="tables" v-loading="loading" :data="timeList" border>
                 <el-table-column label="序号" align="center" type="index" />
@@ -13,9 +13,11 @@
                         {{ scope.row.dateStart }} - {{ scope.row.dateEnd }}
                     </template>
                 </el-table-column>
-                <el-table-column label="星期" align="center" prop="weekType">
+                <el-table-column label="星期" align="center" prop="weekDay">
                     <template slot-scope="scope">
-                        <span>{{ weekList[scope.row.weekType] }}</span>
+                        <div v-if="scope.row.weekDay">
+                            <span :key="item" v-for="(item,index) in scope.row.weekDay.split(',')">{{ weekList[item] }}{{ index == scope.row.weekDay.split(',').length-1?'':', '}}</span>
+                        </div>
                     </template>
                 </el-table-column>
                 <el-table-column label="票务" align="center" prop="goodsNames" />
@@ -38,12 +40,14 @@
                             size="mini"
                             type="text"
                             @click="copyAdd(scope.row)"
-                        >复刻</el-button>
+                             v-hasPermi="['ticketMr:schedulingConfiguration:add']"
+                        >复制</el-button>
                         <el-button
                             size="mini"
                             type="text"
                             style="margin-left: 10px;"
                             @click="deleteFun(scope.row)"
+                             v-hasPermi="['ticketMr:schedulingConfiguration:delect']"
                             >删除</el-button>
                     </template>
                 </el-table-column>
@@ -68,7 +72,6 @@
 
 <script>
 import { deleteById,pageList, getPerformTimeById } from "@/api/ticketMr/schedulingConfiguration";
-import moment from "moment"
 import addAndEdit from "./addAndEdit";
 export default {
     name: "PerFormListBox",
@@ -80,7 +83,7 @@ export default {
             open: false,
             loading: false,
             timeList: [],
-            weekList: ["星期一","星期二","星期三","星期四","星期五","星期六","星期天"],
+            weekList: ["","星期一","星期二","星期三","星期四","星期五","星期六","星期天"],
             form: {
                 id: undefined,
                 timeList: [],
@@ -163,6 +166,7 @@ export default {
          * @returns {any}
          */
         cancel() {
+            this.$emit("getList")
             this.open = false;
         },
         deleteFun(row){

+ 3 - 3
src/views/ticket/schedulingConfiguration/index.vue

@@ -1,19 +1,19 @@
 <template>
   <div class="app-container app-calendar-container">
     <div>
-      <el-button type="primary" @click="handlePerFormList('ADD')">排期配置</el-button>
+      <el-button  type="primary" @click="handlePerFormList('ADD')">排期配置</el-button>
     </div>
     <div v-loading="loading">
       <el-calendar v-model="timeValue" v-if="showCalendar">
         <template
           slot="dateCell"
           slot-scope="{date, data}">
-          <div @click.stop="selectTime(data.day)" :class="data.isSelected ? 'is-selected' : ''">
+          <div @click.stop="selectTime(data.day)">
             <span>{{ data.day.split('-').slice(1).join('-') }}</span>
             <div style="width: 100%; display: flex;flex-wrap: wrap;" >
               <div 
               :key="index"
-              :style="{marginLeft: index%2 == 0?'':'20px'}"
+              :style="{marginLeft: index%2 == 0?'':'20px',color: item.status == 1 ?'#67c23a':'#909399'}"
               v-for="(item,index) in getPerFormList(data)"
               @click.stop="handlePerFormDeatils(item)"
               >

+ 835 - 0
src/views/windowTicketSales/model/rebookBox.vue

@@ -0,0 +1,835 @@
+<template>
+    <!-- 改签对话框 -->
+    <el-dialog 
+    title="订单改签" 
+    :visible.sync="rebookDialog" 
+    width="900" 
+    append-to-body 
+    class="rebook-dialog"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    :modal="false"
+    :before-close="handleClose"
+    >
+        <div class="rebook-box" v-loading="loading">
+            <div class="rebook-from">
+                <div class="tip-box">
+                    <p>温馨提示:每张票仅限改签一次,改签成功后原订单费用将原路返回退还给客户,请知悉。</p>
+                </div>
+                <el-form :model="rebookForm" ref="rebookForm" label-width="100px" :rules="rules">
+                    <el-form-item label="选择日期:" prop="performDate">
+                        <el-date-picker v-model="rebookForm.performDate" type="date" value-format="yyyy-MM-dd"
+                            placeholder="选择日期" @change="handleDateChange" />
+                    </el-form-item>
+                    <el-form-item label="选择场次:" prop="performTimeId">
+                        <div v-loading="intervalListLoading" element-loading-text="获取场次中...">
+                            <div class="interval-list">
+                                <el-button 
+                                v-for="item in intervalList" 
+                                :key="item.performTimeId"
+                                :type="rebookForm.performTimeId === item.performTimeId ? 'primary' : ''"
+                                @click="selectInterval(item)">
+                                    {{ item.performInterval }}
+                                </el-button>
+                            </div>
+                            <el-alert
+                                v-if="intervalList.length==0"
+                                title="没有可改签的场次!!!"
+                                type="error"
+                                :closable="false"
+                                :show-icon="false">
+                            </el-alert>
+                        </div>
+                    </el-form-item>
+                    <el-form-item label="支付方式 :" prop="paymentType">
+                        <el-radio-group v-model="rebookForm.paymentType">
+                        <el-radio label="1">扫码支付</el-radio>
+                        <!-- <el-radio label="2">现金支付</el-radio> -->
+                        <!-- <el-radio v-if="['10','11','13','14','18','19'].includes(ruleForm.source)" label="3">对公支付</el-radio> -->
+                        <!-- <el-radio v-if="['10','11','13','14','18','19'].includes(ruleForm.source)" label="4">账户余额({{ balance }})</el-radio>
+                        <el-radio v-if="['10','11','13','14','18','19'].includes(ruleForm.source)" label="5">授信余额({{ grantQuota }})</el-radio> -->
+                        </el-radio-group>
+                    </el-form-item>
+
+                    <el-form-item label="">
+                        <div style="width: 100%;display: flex;justify-content: center;">
+                            <el-button @click="rebookDialog = false">取 消</el-button>
+                            <el-button type="primary" @click="submitRebook">确认改签</el-button>
+                        </div>
+                    </el-form-item>
+                </el-form>
+            </div>
+            <!--  支付过程 控制  -->
+            <div v-if="payStatus" class="increase-viewers-pay-status">
+                <div class="increase-viewers-pay-status-info" v-if="!loading">
+                    <span style="font-weight: 600;font-size: 20px;">提示</span>
+                    <span style="padding: 10px 0;">
+                        {{ payStatus==1 ? '生成订单失败!!!' : 
+                        payStatus==2 ? '生成订单生成成功,请点击调取扫码盒子' : 
+                        payStatus==4 ? '扫码支付失败!!!' :
+                        payStatus==5 ? '请出示付款码!!!' :
+                        payStatus==5.5 ? '扫码成功,支付中...' :
+                        payStatus==5.6 ? '扫码成功,支付中...' :
+                        payStatus==6 ? '连接扫码器失败!!!' :
+                        payStatus==7 ? '用户支付失败或未支付,请重新连接支付!!!' :
+                        payStatus==8 ? '用户支付成功,请点击打印票!!!' :
+                        payStatus==9 ? '支付超时!!!' :
+                        payStatus==10 ? '订单已关闭,请重新选择座位,再购买!!!' :
+                        payStatus==3 ? '现金支付记录入库失败,请重新提交' : '未知状态' }}
+                    </span>
+                    <span v-if="payStatus==2">需支付{{ rebookForm.payAmount }}元</span>
+                    <!-- 重新生成订单 1  -->
+                    <div v-if="payStatus==1" style="display: flex;">
+                        <el-button @click="payStatus = null" type="success">修改信息</el-button>
+                        <el-button @click="orderInfoSubmitFun()" style="margin-left: 20px;" type="primary">重新生成订单</el-button>
+                    </div>
+                    <!--  生成订单成功 选择支付方式  -->
+                    <div>
+                        <!-- 扫码支付 2 -->
+                        <el-button v-if="payStatus==2" @click="vbar_open(orderId)" type="success">扫码支付</el-button>
+                        <!-- 扫码支付 4 -->
+                        <el-button v-if="payStatus==4" @click="vbar_open(orderId)" type="success">重新扫码支付</el-button>
+                        <!-- 重新支付 3 -->
+                        <el-button v-if="payStatus==3" @click="gotoCashPayFun(orderId)" type="success">重新提交入库</el-button>
+                        <!-- 重新支付 6  7 -->
+                        <el-button v-if="payStatus==6 || payStatus==7" @click="vbar_open(orderId)" type="success">重新连接扫码支付</el-button>
+                    
+                        <!--   现金支付  -->
+                        <el-button v-if="payStatus==2" @click="vbar_open(orderId)" type="success">扫码支付</el-button>
+                        
+                        <!--   现金支付  -->
+                        <el-button v-if="payStatus==2" @click="vbar_open(orderId)" type="success">扫码支付</el-button>
+
+                    </div>
+                    
+                    <!-- 打印 8  -->
+                    <div v-if="payStatus==8">
+                        <el-select v-model="printListId" placeholder="选择打印机">
+                            <el-option 
+                            :label="item.deviceName" 
+                            :key="item.id" 
+                            :value="item.id" 
+                            v-for="(item) in printList"></el-option>
+                        </el-select>
+                        <el-button style="margin-left: 15px" @click="print" type="success">打印门票</el-button>
+                        <el-button style="margin-left: 15px" @click="goTicketingCollections" type="success">跳转取票界面</el-button>
+                    </div>
+                    <!-- 支付超时 9  -->
+                    <div v-if="payStatus==9">
+                        <!-- <el-button @click="print" type="danger">取消支付</el-button> -->
+                        <el-button @click="orderInfoSubmitFun()" type="primary">重新扫码</el-button>
+                    </div>
+                    <!-- 订单被关闭 10  -->
+                    <div v-if="payStatus==10">
+                        <!-- <el-button @click="print" type="danger">取消支付</el-button> -->
+                        <el-button @click="handleClose()" type="primary">关闭</el-button>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </el-dialog>
+</template>
+<script>
+import { reSubmitPageList, getDateTimeAll, rebook } from '@/api/windowTicketSales/rebook'
+import { 
+  orderInfoSubmit,
+  gotoMicroPay,
+  gotoCashPay,
+  gotoCorporatePay,
+  gotoBalancePay,
+  gotoQuotaPay,
+  payQuery,
+  selectRegion,
+  orderInfoCancel,
+  factorAuth,
+  selectMarketTeamBySourceApi
+ } from '@/api/windowTicketSales/ticketingSales'
+ import { pageList as getPrintListApi } from "@/api/device/pda";
+ import { printApi } from '@/api/windowTicketSales/ticketingCollection'
+ import { rebookApi } from '@/api/windowTicketSales/rebook'
+ const mathM = require('mathjs')
+ const https = require('https');
+ const axios = require('axios');
+export default {
+    name: "RebookBox",
+    data() {
+        return {
+            // 改签对话框
+            rebookDialog: false,
+            // 改签表单
+            rebookForm: {
+                orderId: undefined,
+                performDate: undefined,
+                performTimeId: undefined,
+                performInterval: undefined,
+                performId: undefined,
+                auditoriumId: undefined
+            },
+            rules: {
+                performDate: [{ required: true, message: '请选择日期', trigger: ['blur','change'] }],
+                performTimeId: [{ required: true, message: '请选择场次', trigger: ['blur','change'] }]
+            },
+            // 场次列表
+            intervalList: [],
+            intervalListLoading: false,
+            // 支付相关
+            payDialog: false,
+            payStatus: null,
+            code: '',
+            websocketData: null,
+            codeTime: null,
+            // 成功对话框
+            successDialog: false,
+            newOrderId: '',
+            printList: [],
+        }
+    },
+    methods: {
+        initData(row) {
+            this.rebookDialog = true
+            this.payStatus = null
+            this.rebookForm = {
+                orderId: row.orderId,
+                performDate: undefined,
+                performTimeId: undefined,
+                performId: row.performId,
+                auditoriumId: row.auditoriumId,
+                paymentType: "1", // 支付方式
+            }
+            this.$nextTick(()=>{
+                this.$refs.rebookForm.clearValidate()
+            })
+        },
+        handleDialogOpen() {
+            const today = new Date()
+            this.rebookForm.performDate = this.formatDate(today)
+            this.handleDateChange()
+        },
+        /** 获取场次  */
+        handleDateChange() {
+            this.intervalListLoading = true
+            this.rebookForm.performTimeId = undefined
+            this.intervalList = []
+            if (!this.rebookForm.performDate) return
+            
+            getDateTimeAll({
+                performDate: this.rebookForm.performDate,
+                orderId: this.rebookForm.orderId,
+                performId: this.rebookForm.performId,
+                auditoriumId: this.rebookForm.auditoriumId
+            }).then(response => {
+                this.intervalList = response.data.list || []
+                this.intervalListLoading = false
+            }).catch(()=>{
+                this.intervalListLoading = true
+            })
+        },
+        selectInterval(item) {
+            this.rebookForm.performTimeId = item.performTimeId
+        },
+        formatDate(date) {
+            const year = date.getFullYear()
+            const month = String(date.getMonth() + 1).padStart(2, '0')
+            const day = String(date.getDate()).padStart(2, '0')
+            return `${year}-${month}-${day}`
+        },
+        /**  提交表单 */
+        submitRebook() {
+            this.$refs.rebookForm.validate((valid) => {
+                if (valid) {
+                    this.orderInfoSubmitFun()
+                } else {
+                    return false;
+                }
+            });
+        },
+        /** 退出窗口 */
+        handleClose(done) {
+            // if(this.payStatus==8) {
+            //     this.$message.error('请daying');
+            //     return
+            // }
+            this.$confirm('确认关闭?')
+                .then(_ => {
+                    if(this.orderId){
+                        document.removeEventListener('keydown',this.keydownAdd);
+                        this.orderInfoCancelFun(true)
+                    }else {
+                        this.dialogVisible = false
+                    }
+                })
+                .catch(_ => {});
+        },
+        /**  取消订单   */
+        async orderInfoCancelFun(type){
+            // let payStatus = this.payStatus
+            // this.payStatus = null
+            try {
+                this.loading = true
+                this.loadingText = "取消订单中..."
+                orderInfoCancel({
+                    orderId: this.orderId
+                }).then((res)=>{
+                    if(res.code==200) {
+                        if(type){ // 关闭弹窗
+                            if(this.codeTime) {
+                                clearInterval(this.codeTime)
+                            }
+                            this.orderId = null
+                            this.payStatus = null
+                            this.$emit('clearDialogVisible')
+                            this.dialogVisible = false
+                        }else {
+                            this.payStatus = 9
+                            this.loading = false
+                        }
+                        
+                    }else {
+                        
+                    }
+                }).catch(()=>{
+                    this.$message.error('订单关闭失败!!!');
+                })
+            } catch (error) {
+                
+            }
+        },
+        /**  生成订单  */
+        async orderInfoSubmitFun(){
+            this.loading = true
+            try {
+                this.orderId = null
+                this.loadingText = "生成订单中..."
+                let res = await rebookApi({
+                    ...this.rebookForm
+                })
+                if(res.code == 200){
+                    this.orderId = res.data.orderId
+                    if(this.ruleForm.paymentType == 2) { // 现金支付
+                        this.gotoCashPayFun(this.orderId)
+                    }else if(this.ruleForm.paymentType == 3) { // 对公支付
+                        this.gotoCorporatePayFun(this.orderId)
+                    }else if(this.ruleForm.paymentType == 4){ // 账户余额
+                        this.gotoBalancePayFun(this.orderId)
+                    }else if(this.ruleForm.paymentType == 5){ // 授信余额
+                        this.gotoQuotaPayFun(this.orderId)
+                    }else {
+                        // 扫码支付
+                        this.loading = false
+                        this.payStatus = 2
+                    }
+                }else{
+                    this.$message.error('生成订单失败!!!');
+                    this.loading = false
+                    this.payStatus = 1
+                }
+            } catch (error) {
+                this.$message.error('生成订单失败!!!');
+                this.loading = false
+                this.payStatus = 1
+            }
+        },
+         /** 调取 订单支付码支付  */
+         async gotoMicroPayFun(orderId,code){
+            this.loading = true
+            try {
+                this.loadingText = "订单支付中..."
+                this.payStatus = ''
+                let res = await gotoMicroPay({
+                    "orderId": orderId, // 订单编号-提交订单返回
+                    "authCode": code // 微信扫码支付-支付码
+                })
+                if(res.code == 200){
+                    this.payTimeNum = 0
+                    this.websocketClear()
+                    if(this.payTime){
+                        clearInterval(this.payTime)
+                    }
+                    this.payTime = setInterval(()=>{
+                        this.payQueryFun(this.orderId)
+                    },1500)
+                }else{
+                    this.$message.error('支付失败!!!');
+                    this.payStatus = ''
+                    this.loading = false
+                    this.payStatus = 6
+                }
+            } catch (error) {
+                this.$message.error('支付失败!!!');
+                this.loading = false
+                this.payStatus = 6
+            }
+        },
+        /**  对公支付  */
+        async gotoCorporatePayFun(orderId) {
+            this.loading = true
+            try {
+                this.loadingText = "订单入库中..."
+                let res = await gotoCorporatePay({
+                    "orderId": orderId, // 订单编号-提交订单返回
+                    "payAmount": this.ruleForm.realPrice
+                })
+                if(res.code == 200){
+                    if(this.payTime){
+                        clearInterval(this.payTime)
+                    }
+                    this.payTimeNum = 0
+                    this.payTime = setInterval(()=>{
+                        this.payQueryFun(this.orderId)
+                    },1000)
+                }else{
+                    this.$message.error('订单入库中失败!!!');
+                    this.loading = false
+                    this.payStatus = 3
+                }
+            } catch (error) {
+                this.$message.error('订单入库中失败!!!');
+                this.loading = false
+                this.payStatus = 3
+            }
+        },
+        /**  授信额度支付  */
+        async gotoQuotaPayFun(orderId) {
+            this.loading = true
+            try {
+                this.loadingText = "订单入库中..."
+                let res = await gotoQuotaPay({
+                    "orderId": orderId, // 订单编号-提交订单返回
+                })
+                if(res.code == 200){
+                    if(this.payTime){
+                        clearInterval(this.payTime)
+                    }
+                    this.payTimeNum = 0
+                    this.payTime = setInterval(()=>{
+                        this.payQueryFun(this.orderId)
+                    },1000)
+                }else{
+                    this.$message.error('订单入库中失败!!!');
+                    this.loading = false
+                    this.payStatus = 3
+                }
+            } catch (error) {
+                this.$message.error('订单入库中失败!!!');
+                this.loading = false
+                this.payStatus = 3
+            }
+        },
+        /**  余额支付  */
+        async gotoBalancePayFun(orderId) {
+            this.loading = true
+            try {
+                this.loadingText = "订单入库中..."
+                let res = await gotoBalancePay({
+                    "orderId": orderId, // 订单编号-提交订单返回
+                })
+                if(res.code == 200){
+                    if(this.payTime){
+                        clearInterval(this.payTime)
+                    }
+                    this.payTimeNum = 0
+                    this.payTime = setInterval(()=>{
+                        this.payQueryFun(this.orderId)
+                    },1000)
+                }else{
+                    this.$message.error('订单入库中失败!!!');
+                    this.loading = false
+                    this.payStatus = 3
+                }
+            } catch (error) {
+                this.$message.error('订单入库中失败!!!');
+                this.loading = false
+                this.payStatus = 3
+            }
+        },
+         /**  订单现金支付  */
+         async gotoCashPayFun(orderId){
+            this.loading = true
+            try {
+                this.loadingText = "订单入库中..."
+                let res = await gotoCashPay({
+                    "orderId": orderId, // 订单编号-提交订单返回
+                    "payAmount": this.ruleForm.realPrice
+                })
+                if(res.code == 200){
+                    if(this.payTime){
+                        clearInterval(this.payTime)
+                    }
+                    this.payTimeNum = 0
+                    this.payTime = setInterval(()=>{
+                        this.payQueryFun(this.orderId)
+                    },1000)
+                }else{
+                    this.$message.error('订单入库中失败!!!');
+                    this.loading = false
+                    this.payStatus = 3
+                }
+            } catch (error) {
+                this.$message.error('订单入库中失败!!!');
+                this.loading = false
+                this.payStatus = 3
+            }
+        },
+        // 跳转取票界面
+        goTicketingCollections(){
+            this.$router.push({
+                path:"/windowTicketSales/ticketingCollections",
+                query:{
+                    orderId: this.orderId
+                }
+            })
+        },
+         /**  查看支付 状态  */
+         async payQueryFun(orderId){
+            this.loading = true
+            
+            try {
+                this.payTimeNum = this.payTimeNum + 1
+                if(this.payTimeNum==15){
+                    if(this.payTime){
+                        clearInterval(this.payTime)
+                    }
+                    this.orderInfoCancelFun()
+                    return
+                }
+                if(this.ruleForm.paymentType == 2){
+                    this.loadingText = "订单入库中..."
+                }else {
+                    this.loadingText = "订单支付中..."
+                }
+                this.payStatus = ''
+                let res = await payQuery({
+                    orderId: orderId
+                })
+                if(res.code == 200){
+                    if(res.data) {
+                        if(res.data.payStatus == 0) {
+                            if(this.payTime){
+                                clearInterval(this.payTime)
+                            }
+                            if(this.ruleForm.paymentType == 2){
+                                this.$message.error('"订单入库中失败"');
+                                this.loading = false
+                                this.payStatus = 3
+                            }else {
+                                if(res.data.orderStatus == 9 || res.data.orderStatus == 4 || res.data.orderStatus == 5){
+                                    this.$message.error('订单已关闭,请重新选择座位,再购买!!!');
+                                    this.loading = false
+                                    this.payStatus = 10
+                                }else {
+                                    this.$message.error('用户未支付!!!');
+                                    this.loading = false
+                                    this.payStatus = 7
+                                }
+                            }
+                            
+                        }else if(res.data.payStatus == 1) {
+                            if(this.payTime){
+                                clearInterval(this.payTime)
+                            }
+                            if(this.ruleForm.paymentType == 2){
+                                this.$message({
+                                    message: '订单入库成功',
+                                    type: 'success'
+                                });
+                                this.loading = false
+                                // this.payStatus = 8
+                                // this.getPrintListApi()
+                                this.goTicketingCollections()
+                                
+                            }else {
+                                this.$message({
+                                    message: '用户已支付成功,请打印门票',
+                                    type: 'success'
+                                });
+                                // 开始 打印
+                                this.loading = false
+                                // this.payStatus = 8
+                                // this.getPrintListApi()
+                                this.goTicketingCollections()
+                            }
+                            
+                            
+                        }else if(res.data.payStatus == 2) {
+
+                        }else if(res.data.payStatus == 3) {
+                            if(this.payTime){
+                                clearInterval(this.payTime)
+                            }
+                            if(this.ruleForm.paymentType == 2){
+                                this.$message.error('"订单入库中失败"');
+                                this.loading = false
+                                this.payStatus = 3
+                            }else {
+                                if(res.data.orderStatus == 9 || res.data.orderStatus == 4 || res.data.orderStatus == 5){
+                                    this.$message.error('订单已关闭,请重新选择座位,再购买!!!');
+                                    this.loading = false
+                                    this.payStatus = 10
+                                }else {
+                                    this.$message.error('用户支付失败!!!');
+                                    this.loading = false
+                                    this.payStatus = 7
+                                }
+                            }
+                        }else if(res.data.payStatus == 4) {
+                            if(this.payTime){
+                                clearInterval(this.payTime)
+                            }
+                            
+                            if(this.ruleForm.paymentType == 2){
+                                this.$message.error('"订单入库中失败"');
+                                this.loading = false
+                                this.payStatus = 3
+                            }else {
+                                if(res.data.orderStatus == 9 || res.data.orderStatus == 4 || res.data.orderStatus == 5){
+                                    this.$message.error('订单已关闭,请重新选择座位,再购买!!!');
+                                    this.loading = false
+                                    this.payStatus = 10
+                                }else {
+                                    this.$message.error('支付退款!!!');
+                                    this.loading = false
+                                    this.payStatus = 7
+                                }
+                            }
+                            
+                        }
+                    }
+                    
+                }else{
+                    this.$message.error('支付失败!!!');
+                    this.loading = false
+                    this.payStatus = 7
+                }
+                
+            } catch (error) {
+                this.$message.error('支付失败!!!');
+                this.loading = false
+                this.payStatus = 7
+            }
+        },
+
+        /**  连接VBarServer  */
+        vbar_open() {
+            this.loading = true
+            this.loadingText = "连接扫码盒子中!!!"
+            this.payStatus =  null
+            this.code = ''
+            this.websocketClear()
+            this.payStatus = 5 // 连接成功
+            document.addEventListener('keydown',this.keydownAdd);
+            this.loading = false
+        },  
+        /**  连接结果 */
+        websocket_open_state(message){
+            console.log("连接结果 ===== ",message)
+            this.codeTime = setInterval(()=>{
+                console.log("检测是否连接")
+                if(this.websocketData.readyState != WebSocket.OPEN) {
+                    this.payStatus = 6
+                }
+            },3000)
+            //document.getElementById('wsocket').value = "已连接";
+        },
+        // 拼接字符串
+        keydownAdd(e){
+            console.log("e=====",e)
+            console.log("this.code=====",this.code)
+            if( this.payStatus == 5 && e.key != 'Enter') {
+                this.code = this.code + e.key
+            }
+
+            if( e.key == 'Enter') {
+                document.removeEventListener('keydown',this.keydownAdd);
+                let codeCopy = this.code
+                this.payStatus == 5.5
+                this.code = ''
+                this.gotoMicroPayFun(this.orderId,codeCopy)
+            }
+        },
+        //接收扫码完整结果处理
+        websocket_decode(code){
+            console.log("orderId=========",this.orderId )
+            console.log("code=========",code)
+            if(this.orderId && this.payStatus == 5.5 &&  regex.test(code) ) {
+                this.payStatus = 5.6 // 支付中
+                let codeCopy = code.replace("%%%", "").replace("%%%", "")
+                this.gotoMicroPayFun(this.orderId,codeCopy)
+            }else if(!code){
+                this.payStatus = 5
+                this.code = ''
+            }
+        },
+        /** 关闭通讯 */
+        websocketClear(){
+            document.removeEventListener('keydown',this.keydownAdd);
+        },
+        /**  读取身份证 */
+        readCert(){
+            this.idcardLoading = true
+            var result = "";
+            try {
+                let xmlHttp = new XMLHttpRequest();
+                let Protocol = window.location.protocol.split(':')[0];
+                //获取当前协议,并且分割字符串,得到http或者https
+                if (Protocol === 'https'){
+                    //创建请求 第一个参数是代表以post方式发送;第二个是请求端口和地址;第三个表示是否异步
+                    xmlHttp.open("POST", "http://127.0.0.1:18889/api/readCert?ReadSN=" + 0, false);	  //readCert读卡,生成正反面仿复印件	
+                }else {
+                    //创建请求 第一个参数是代表以post方式发送;第二个是请求端口和地址;第三个表示是否异步
+                    xmlHttp.open("POST", "http://127.0.0.1:18889/api/readCert?ReadSN=" + 0, false);	  //readCert读卡,生成正反面仿复印件	
+                }
+                //发送请求
+                xmlHttp.send();
+                if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
+                    result = xmlHttp.responseText;
+                    xmlHttp.readyState = 1;
+                }
+            } catch (e) {
+                console.error("e====",e)
+            }
+            let obj = JSON.parse(result)
+            if(obj.resultContent && obj.resultContent.certNumber){
+                this.$set(this.tableForm,"idcard",obj.resultContent.certNumber)
+                this.$set(this.tableForm,"name",obj.resultContent.partyName)
+            }else {
+                this.$message.error('读取失败!!!');
+            }
+            
+            this.idcardLoading = false
+            //return result;
+             console.log(result,obj)
+        },
+        /** 查询打印机列表 */
+        getPrintListApi() {
+          getPrintListApi({deviceType:5,pageNum: 1,
+          pageSize: 999,})
+          .then(response => {
+              this.printList = response.data.rows;
+          }).catch((error)=>{
+            console.log("error===",error)
+          }
+          );
+        },
+        // 打印 
+        async print(list = []){
+            if(!this.printListId) {
+                this.$message.error('请选择打印机!!');
+                return
+            }
+            this.loading = true
+              this.loadingText = '打印中...'
+              this.payStatus = ''
+              try {
+                let res = await printApi({
+                  orderId: this.orderId,
+                  source: 2,
+                  deviceId: this.printListId
+                })
+                if(res.code == 200) {
+                  let url = res.data.linkIp
+                  let printInfo = res.data.printInfo
+                  this.connectPrint(url,printInfo)
+                }else {
+                  throw new Error(res)
+                }
+              } catch (error) {
+                this.loading = false
+                 this.payStatus = 8
+                console.error("error=====",error)
+              }
+          
+        },
+        /**  连接打印机  */
+        connectPrint(url,data){
+          // 创建忽略 SSL 的 axios 实例
+          const ignoreSSL = axios.create({
+            httpsAgent: new https.Agent({  
+              rejectUnauthorized: false
+            }),
+            withCredentials: true, // 跨域请求时发送Cookie
+            timeout: 60000, // 请求超时
+            headers: {
+              "Content-Type": "application/json; charset=UTF-8;"
+            }
+          });
+          ignoreSSL.post(url, 
+            { ...data }
+            ).then(()=>{
+            this.dialogVisible = false
+            this.loading = false
+          }).catch(()=>{
+            this.loading = false
+            this.payStatus = 8
+            // this.dialogVisible = false
+            // this.loading = false
+          })
+          // 在 axios 请求时,选择性忽略 SSL
+          // const agent = new https.Agent({  
+          //   rejectUnauthorized: false
+          // });
+          // axios.post(
+          //   url, 
+          //   { httpsAgent: agent,...data }
+          //   ).then(()=>{
+          //   this.dialogVisible = false
+          //   this.loading = false
+          // })
+          // .catch(()=>{
+          //   this.dialogVisible = false
+          //   this.loading = false
+          // })
+        },
+        /** 获取授信余额和账户余额  */
+        async selectMarketTeamBySourceFun(value) {
+            console.log("value===",value)
+            try {
+                if(!['10','11','13','14','18','19'].includes(value)) return
+                let res = await selectMarketTeamBySourceApi({
+                    source: value
+                })
+                this.balance = res.data.balance
+                if(res.data.grantQuota && res.data.grantUsed) {
+                    this.grantQuota = res.data.grantQuota - res.data.grantUsed
+                }else if(res.data.grantQuota) {
+                    this.grantQuota = res.data.grantQuota
+                }else {
+                    this.grantQuota = 0
+                }
+                
+            } catch (error) {
+                this.balance = null
+                this.grantQuota = null
+            }
+        }
+    }
+}
+</script>
+<style lang="scss" scoped>
+.rebook-dialog ::v-deep .el-dialog__body {
+    padding: 0 !important;
+}
+.rebook-box {
+    position: relative;
+    .rebook-from {
+        padding: 20px;
+    }
+}
+.increase-viewers-pay-status {
+    width: 100%;
+    height: 100%;
+    position: absolute;
+    z-index: 999;
+    background-color: rgba(0,0,0,0.3);
+    top: 0;
+    left: 0;
+    .increase-viewers-pay-status-info {
+        width: 100%;
+        height: 100%;
+        display: flex;
+        flex-direction: column;
+        justify-content: center;
+        align-items: center;
+        color: #fff;
+    } 
+} 
+</style>

+ 12 - 181
src/views/windowTicketSales/rebook.vue

@@ -11,7 +11,7 @@
 <template>
   <div class="app-container">
     <!-- 搜索区域 -->
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
+    <el-form :model="queryParams" ref="queryForm" :inline="true">
       <el-form-item label="订单号" prop="orderId">
         <el-input v-model="queryParams.orderId" placeholder="请输入订单号" clearable />
       </el-form-item>
@@ -80,110 +80,28 @@
       @pagination="getList"
     />
 
-    <!-- 改签对话框 -->
-    <el-dialog title="订单改签" :visible.sync="rebookDialog" width="500px" append-to-body @open="handleDialogOpen">
-      <div class="tip-box">
-        <p>温馨提示:每张票仅限改签一次,改签成功后原订单费用将原路返回退还给客户,请知悉。</p>
-      </div>
-      <el-form :model="rebookForm" label-width="80px">
-        <el-form-item label="选择日期">
-          <el-date-picker
-            v-model="rebookForm.performDate"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="选择日期"
-            @change="handleDateChange"
-          />
-        </el-form-item>
-        <el-form-item label="选择场次">
-          <div class="interval-list">
-            <el-button
-              v-for="item in intervalList"
-              :key="item.performTimeId"
-              :type="rebookForm.performTimeId === item.performTimeId ? 'primary' : ''"
-              @click="selectInterval(item)"
-            >
-              {{ item.performInterval }}
-            </el-button>
-          </div>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="rebookDialog = false">取 消</el-button>
-        <el-button type="primary" @click="submitRebook" :disabled="!rebookForm.performTimeId">确认改签</el-button>
-      </div>
-    </el-dialog>
-
-    <!-- 支付扫码对话框 -->
-    <el-dialog title="扫码支付" :visible.sync="payDialog" width="400px" append-to-body>
-      <div class="pay-status">
-        <p v-if="payStatus === 5">请扫描支付码</p>
-        <p v-if="payStatus === 5.5">正在处理...</p>
-        <p v-if="payStatus === 5.6">支付中...</p>
-        <p v-if="payStatus === 6">连接断开,请重试</p>
-      </div>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="cancelPay">取 消</el-button>
-      </div>
-    </el-dialog>
-
-    <!-- 改签成功提示 -->
-    <el-dialog title="改签成功" :visible.sync="successDialog" width="400px" append-to-body>
-      <div class="success-info">
-        <p>新订单号:{{ newOrderId }}</p>
-      </div>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="successDialog = false">关 闭</el-button>
-        <el-button type="primary" @click="goToTicketing">去取票</el-button>
-      </div>
-    </el-dialog>
+    <!-- 改签 -->
+     <rebookBox ref="rebookBox" @getList="getList" />
   </div>
 </template>
 
 <script>
-import { reSubmitPageList, getDateTimeAll, rebook } from '@/api/windowTicketSales/rebook'
-
+import { reSubmitPageList } from '@/api/windowTicketSales/rebook'
+import rebookBox from './model/rebookBox.vue';
 export default {
   name: 'Rebook',
   dicts: ['order_status_type', 'channel_type'],
+  components: { rebookBox },
   data() {
     return {
       loading: false,
-      showSearch: true,
       // 查询参数
       queryParams: {
-        orderId: undefined,
-        memberMobile: undefined,
-        idcard: undefined,
-        goodsName: undefined,
-        status: undefined,
         pageNum: 1,
         pageSize: 10
       },
       // 改签列表数据
       rebookList: [],
-      // 改签对话框
-      rebookDialog: false,
-      // 改签表单
-      rebookForm: {
-        orderId: undefined,
-        performDate: undefined,
-        performTimeId: undefined,
-        performInterval: undefined,
-        performId: undefined,
-        auditoriumId: undefined
-      },
-      // 场次列表
-      intervalList: [],
-      // 支付相关
-      payDialog: false,
-      payStatus: null,
-      code: '',
-      websocketData: null,
-      codeTime: null,
-      // 成功对话框
-      successDialog: false,
-      newOrderId: '',
       // 总条数
       total: 0
     }
@@ -205,105 +123,18 @@ export default {
     },
     resetQuery() {
       this.$refs.queryForm.resetFields()
-      this.queryParams.pageNum = 1  // 重置时将页码重置为1
+      this.queryParams = {
+        pageNum: 1,
+        pageSize: this.queryParams.pageSize
+      }  // 重置时将页码重置为1
       this.handleQuery()
     },
-    handleRebook(row) {
-        console.log('row.status',row.status);
-        
+    handleRebook(row){
       if (row.status !== 3) {  // 检查订单状态是否为3
         this.$modal.msgError('该票禁止改签请知悉')
         return
       }
-      
-      this.rebookForm = {
-        orderId: row.orderId,
-        performDate: undefined,
-        performTimeId: undefined,
-        performInterval: undefined,
-        performId: row.performId,
-        auditoriumId: row.auditoriumId
-      }
-      this.rebookDialog = true
-    },
-    handleDialogOpen() {
-      const today = new Date()
-      this.rebookForm.performDate = this.formatDate(today)
-      this.handleDateChange()
-    },
-    handleDateChange() {
-      if (!this.rebookForm.performDate) return
-      getDateTimeAll({
-        performDate: this.rebookForm.performDate,
-        orderId: this.rebookForm.orderId,
-        performId: this.rebookForm.performId,
-        auditoriumId: this.rebookForm.auditoriumId
-      }).then(response => {
-        this.intervalList = response.data.list || []
-        this.rebookForm.performTimeId = undefined
-        this.rebookForm.performInterval = undefined
-      })
-    },
-    selectInterval(item) {
-      this.rebookForm.performTimeId = item.performTimeId
-      this.rebookForm.performInterval = item.performInterval
-    },
-    formatDate(date) {
-      const year = date.getFullYear()
-      const month = String(date.getMonth() + 1).padStart(2, '0')
-      const day = String(date.getDate()).padStart(2, '0')
-      return `${year}-${month}-${day}`
-    },
-    submitRebook() {
-      this.rebookDialog = false
-      this.vbar_open()
-      this.payDialog = true
-    },
-    // 支付相关方法
-    vbar_open() {
-      this.loading = true
-      this.loadingText = "连接扫码盒子中!!!"
-      this.payStatus = null
-      this.code = ''
-      this.websocketClear()
-      this.payStatus = 5
-      document.addEventListener('keydown', this.keydownAdd)
-      this.loading = false
-    },
-    keydownAdd(e) {
-      if (this.payStatus == 5 && e.key != 'Enter') {
-        this.code = this.code + e.key
-      }
-      if (e.key == 'Enter') {
-        document.removeEventListener('keydown', this.keydownAdd)
-        let codeCopy = this.code
-        this.payStatus = 5.5
-        this.code = ''
-        this.gotoMicroPayFun(this.rebookForm.orderId, codeCopy)
-      }
-    },
-    websocketClear() {
-      document.removeEventListener('keydown', this.keydownAdd)
-    },
-    cancelPay() {
-      this.payDialog = false
-      this.websocketClear()
-    },
-    gotoMicroPayFun(orderId, code) {
-      rebook({
-        orderId: orderId,
-        code: code,
-        performDate: this.rebookForm.performDate,
-        performTimeId: this.rebookForm.performTimeId,
-        performInterval: this.rebookForm.performInterval
-      }).then(response => {
-        this.payDialog = false
-        this.newOrderId = response.data
-        this.successDialog = true
-      })
-    },
-    goToTicketing() {
-      this.$router.push('/windowTicketSales/ticketingCollection')
+      this.$refs.rebookBox.initData(row)
     }
   }
 }

src/views/appletMr/dialog/addAndEdit.vue → src/views/wxapp/appletMr/dialog/addAndEdit.vue


+ 1 - 1
src/views/appletMr/index.vue

@@ -145,7 +145,7 @@
 
 import { pageList, deleteById, saveAndEdit } from '@/api/appletMr/appletMr'
 import addAndEdit from "./dialog/addAndEdit.vue";
-import { parseTime } from '../../utils/ruoyi'
+import { parseTime } from '@/utils/ruoyi'
 
 export default {
   name: "agreement",

+ 319 - 0
src/views/wxapp/priceConfiguration/dialog/addAndEdit.vue

@@ -0,0 +1,319 @@
+<!--
+ * @Description: 新增/编辑弹框
+ * @Author: Sugar.
+ * @Date: 2023-11-24 13:55:00
+ * @LastEditors: Sugar.
+ * @LastEditTime: 2023-11-24 13:55:00
+ * @FilePath: \cattle_webui\src\views\venue\schedulingMr\dialog\AddOrEditDialog.vue
+ * @Copyright: Copyright (c) 2016~2023 by Sugar., All Rights Reserved.
+-->
+<template>
+  <el-dialog
+    :title="title"
+    :visible.sync="open"
+    width="70%"
+    class="text-dia-log-class"
+    append-to-body
+    :close-on-click-modal="false"
+    @close="cancel"
+  >
+    <div class="dialog">
+      <el-form :model="form" ref="form" :rules="rules" label-width="120px">
+        <el-form-item label="票务名称:" prop="goodsId">
+          <el-select
+            v-model="form.goodsId"
+            placeholder="票务名称"
+            clearable
+            style="width: 350px"
+          >
+            <el-option
+              v-for="dict in goodsPageListS"
+              :key="dict.id"
+              :value="dict.id"
+              :label="dict.status == 1 ? dict.goodsName + '(被禁用)': dict.goodsName"
+              :disabled="dict.status != 0"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="票档名称:" prop="seatTypeId">
+          <el-select
+            v-model="form.seatTypeId"
+            placeholder="票档名称"
+            clearable
+            style="width: 350px"
+          >
+            <el-option
+              v-for="dict in seatTypeListS"
+              :key="dict.id"
+              :value="dict.id"
+              :label="dict.name"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="日期范围:"  prop="performDate">
+          <el-date-picker
+            v-model="form.performDate"
+            type="daterange"
+            range-separator="至"
+            value-format="yyyy-MM-dd"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="星期:" prop="weekType">
+          <div>
+            <el-button 
+            @click="selectWeekType()"
+            :type="form.weekType == 1 ?'':'primary'">不限</el-button>
+            <el-button 
+            v-for="(item,index) in weekDayList"
+            :key="index"
+            @click="selectWeekDay(item)"
+            :type="form.weekName.includes(item.key)?'primary':''">{{ item.name }}</el-button>
+          </div>
+          <div style="font-size: 12px;">指定在选定区间内的周几价格进行调整,列如区间选择2018-01-01至2018-01-20,星期选择星期一,则这个区间内的星期一价格都进行调整</div>
+        </el-form-item>
+        <el-form-item label="划线价:" prop="originalAmount">
+          <el-input v-model="form.originalAmount"  style="width: 350px"></el-input>
+        </el-form-item>
+        <el-form-item label="销售价:" prop="saleAmount">
+          <el-input v-model="form.saleAmount"  style="width: 350px"></el-input>
+        </el-form-item>
+        <el-form-item label="备注:" prop="remark">
+          <el-input v-model="form.remark" type="textarea" maxlength="50" show-word-limit></el-input>
+        </el-form-item>
+      </el-form>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="cancel">取消</el-button>
+      <el-button
+        type="primary"
+        @click="submitForm"
+        v-loading.fullscreen.lock="loading"
+        element-loading-text="提交中..."
+        element-loading-spinner="el-icon-loading"
+        element-loading-background="rgba(0, 0, 0, 0.8)"
+      >
+        <span v-if="loading">提交中...</span>
+        <span v-else>保存</span>
+      </el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+import { saveAndEdit } from "@/api/priceConfiguration/index";
+import { pageList as goodsPageListApi } from '@/api/ticketMr/ticketMr'
+import { pageList as seatTypeListApi } from '@/api/seatTypeMr/seatTypeMr'
+import moment from "moment"
+export default {
+  name: "addAndEdit",
+  data() {
+    return {
+      title: "编辑",
+      model: "EDIT",
+      open: false,
+      loading: false,
+      tableType: false,
+      form: {
+        id: undefined,
+        weekName: [],
+        weekType: 0,
+      },
+      rules: {
+        performDate: [{ required: true, message: "请选择日期", trigger: ["change","blur"] }],
+        goodsId: [{ required: true, message: "请选择票务", trigger: ["change","blur"] }],
+        weekType: [{ required: true, message: "请选择星期", trigger: ["change","blur"] }],
+        seatTypeId: [{ required: true, message: "请选择票档名称", trigger: ["change","blur"] }],
+        originalAmount: [{ required: true, message: "请输入划线价", trigger: ["change","blur"] }],
+        saleAmount: [{ required: true, message: "请输入销售价", trigger: ["change","blur"] }],
+        remark: [{ required: false, message: "请输入备注", trigger: ["change","blur"] }],
+      },
+      editType: false,
+
+      goodsPageListS: [], // 票务
+      seatTypeListS: [], // 座位类型
+      weekDayList: [
+        {name: "星期一",key: "星期一"},
+        {name: "星期二",key: "星期二"},
+        {name: "星期三",key: "星期三"},
+        {name: "星期四",key: "星期四"},
+        {name: "星期五",key: "星期五"},
+        {name: "星期六",key: "星期六"},
+        {name: "星期日",key: "星期日"},
+      ],
+      inventoryTemplateList: []
+    };
+  },
+  created() {
+    this.goodsPageListFun()
+    this.seatTypeListFun()
+  },
+  methods: {
+    /**
+     * 打开弹框
+     * @date 2023-11-22
+     * @param {any} obj
+     * @returns {any}
+     */
+    async openDialog(title, obj, type) {
+      this.open = true;
+      this.editType = false;
+      if (obj){
+        this.title = "编辑价格配置";
+        if(obj.performId) {
+          await this.goodsPageListFun(obj.performId);
+        }
+        this.form = {
+          ...obj,
+          performDate: [obj.dateStart,obj.dateEnd],
+          goodsId: obj.goodsId ? obj.goodsId.split(','):[],
+          weekName: obj.weekName ? obj.weekName.split(','):[],
+          planSessionList: obj.planSessionList ? obj.planSessionList:[],
+          id: null
+        }
+      }else{
+        this.title = "新增价格配置";
+        this.form = {
+            weekName: [],
+            weekType: 0
+        };
+      }
+      this.$nextTick(() => {
+        this.$refs["form"].clearValidate();
+      });
+    },
+    // yyyy-mm-dd 转时时间戳
+    dateToTimestamp(year, month, day) {
+      const date = new Date(year, month - 1, day);
+      return date.getTime();
+    },
+    /**  票务信息  */
+    async goodsPageListFun(){
+      try {
+        let res = await goodsPageListApi({
+          pageNum: 1,
+          pageSize: 999,
+          goodsType: 2,
+          classifyId: 1,
+          channelType: "applet",
+        })
+        if(res.code == 200){
+          this.goodsPageListS = res.data.rows || []
+        }
+      } catch (error) {      
+      }
+    },
+    async seatTypeListFun() {
+      try {
+        let res = await seatTypeListApi({
+          pageNum: 1,
+          pageSize: 999,
+        })
+        if(res.code == 200){
+          this.seatTypeListS = res.data.rows || []
+        }
+      } catch (error) {      
+      }
+    },
+    /**
+     * 保存
+     * @date 2023-11-22
+     * @returns {any}
+     */
+    submitForm() {
+      this.$refs["form"].validate(async (valid) => {
+        if (valid) {
+          try {
+            let postEdit = JSON.parse(JSON.stringify(this.form))
+            postEdit['startDate'] = moment(postEdit.performDate[0]).format('YYYY-MM-DD')
+            postEdit['endDate'] = moment(postEdit.performDate[1]).format('YYYY-MM-DD')
+            postEdit.weekName = postEdit.weekName.join(','),
+            delete postEdit.performDate
+            this.loading = true;
+            const { code } = await saveAndEdit({ ...postEdit });
+            if (code === 200) {
+              this.$message.success("操作成功!");
+              this.$emit("getList");
+              this.cancel();
+            }
+          } catch (error) {
+            console.error("error====",error)
+          } finally {
+            this.loading = false;
+          }
+        }
+      });
+    },
+    /**
+     * 重置
+     * @date 2023-11-22
+     * @returns {any}
+     */
+    reset() {
+      
+    },
+    /**
+     * 关闭弹框
+     * @date 2023-11-22
+     * @returns {any}
+     */
+    cancel() {
+      this.reset();
+      this.open = false;
+    },
+    selectWeekDay(item){
+      let index = -1
+      this.form.weekName.forEach((item1,index1)=>{
+        if(item.key == item1) {
+          index = index1
+        }
+      })
+      if(index != -1) {
+        this.form.weekName.splice(index,1)
+      }else {
+        this.form.weekName.push(item.key)
+      }
+      if(this.form.weekName.length>0) {
+        this.form.weekType = 1
+      }else {
+        this.form.weekType = 0
+      }
+    },
+    selectWeekType() {
+      this.form.weekType = this.form.weekType == 1 ? 0 : 1
+      if(!this.form.weekType) {
+        this.form.weekName = []
+      }
+    }
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.dialog {
+  height: 65vh;
+  overflow-y: auto;
+}
+.dialog {
+  .upload-btn {
+    width: 100px;
+    height: 100px;
+    background-color: #fbfdff;
+    border: dashed 1px #c0ccda;
+    border-radius: 5px;
+    i {
+      font-size: 30px;
+      margin-top: 20px;
+    }
+    &-text {
+      margin-top: -10px;
+    }
+  }
+  .avatar {
+    cursor: pointer;
+  }
+}
+</style>

+ 219 - 0
src/views/wxapp/priceConfiguration/dialog/calendarBox.vue

@@ -0,0 +1,219 @@
+<!--
+ * @Description: 新增/编辑弹框
+ * @Author: Sugar.
+ * @Date: 2023-11-24 13:55:00
+ * @LastEditors: Sugar.
+ * @LastEditTime: 2023-11-24 13:55:00
+ * @FilePath: \cattle_webui\src\views\venue\schedulingMr\dialog\AddOrEditDialog.vue
+ * @Copyright: Copyright (c) 2016~2023 by Sugar., All Rights Reserved.
+-->
+<template>
+  <el-dialog
+    :visible.sync="open"
+    width="70%"
+    class="text-dia-log-class"
+    append-to-body
+    :close-on-click-modal="false"
+    @close="cancel"
+  >
+    <div class="dialog" v-loading="loading">
+      <el-calendar v-model="timeValue">
+        <template
+          slot="dateCell"
+          slot-scope="{date, data}">
+          <div>
+            <span>{{ data.day.split('-').slice(1).join('-') }}</span>
+            <div style="width: 100%; display: flex;flex-wrap: wrap;" >
+              <div 
+              :key="index"
+              v-for="(item,index) in getPerFormList(data)"
+              >
+              {{ item.title }}:{{ item.money }}
+              </div>
+            </div>
+            
+          </div>
+          
+        </template>
+      </el-calendar>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="cancel">返回</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+import { getSelectById,getCalendarList } from "@/api/priceConfiguration/index";
+export default {
+  name: "addAndEdit",
+  data() {
+    return {
+      title: "编辑",
+      loading: false,
+      model: "EDIT",
+      open: false,
+      loading: false,
+      timeValue: null,
+      perFormList: []
+    };
+  },
+  created() {
+
+  },
+  methods: {
+    /**
+     * 打开弹框
+     * @date 2023-11-22
+     * @param {any} obj
+     * @returns {any}
+     */
+    async openDialog(title, obj, type) {
+      this.open = true;
+      this.getSelectByIdFun({priceId: obj.id})
+    },
+    /** 查询日期列表 */
+    async getList(params) {
+      try {
+        this.loading = true;
+        let res = await getCalendarList(params)
+        if(res.code == 200) {
+          this.perFormList = res.rows || []
+          this.loading = false;
+        }
+        this.loading = false;
+      } catch (error) {
+        this.loading = false;
+      }
+    },
+    /** 查询详情 */
+    async getSelectByIdFun(params) {
+      try {
+        this.loading = true;
+        let res = await getCalendarList(params)
+        if(res.code == 200) {
+          this.loading = false;
+          if(res.rows && res.rows.length>0){
+            let date = new Date(res.rows[0].priceDate)
+            //this.timeValue = date
+            this.getRange(date)
+          }
+        }
+        this.loading = false;
+      } catch (error) {
+        this.loading = false;
+        console.error("error===",error)
+      }
+    },
+    getPerFormList(data) {
+      let list = []
+      this.perFormList.forEach((item,index)=>{
+        if(item.priceDate && item.priceDate.indexOf(data.day) != -1) {
+          list = [
+            { title: '划线价', money: item.originalAmount + '元'  },
+            { title: '销售价', money: item.saleAmount + '元' },
+          ]
+        }
+      })
+      return list
+    },
+    /**
+     * 关闭弹框
+     * @date 2023-11-22
+     * @returns {any}
+     */
+    cancel() {
+      this.open = false;
+    },
+    // 获取日历显示时间范围
+    getRange(date){
+      // 日历第一天
+      let firstDay = '';
+      // 日历最后一天
+      let lastDay = '';
+      // 今天
+      const today = date ? date : new Date()
+      // 上月
+      const m = today.getMonth()
+      // 本月
+      const cm = m + 1
+      // 下月
+      const lm = m + 2 > 12 ? 1 : m + 2
+      // 要显示的本月
+      const currentMonth = cm < 10 ? '0' + cm : cm
+      // 要显示的本本年
+      const currentYear = today.getFullYear()
+      // 要显示的上个月的年份,m = 0 则当前1月,上月则是去年12月
+      const prevYear = m == 0 ? currentYear - 1 : currentYear
+      const prevMonth = m == 0 ? 12 : m < 10 ? '0' + m : m
+      // 上个月天数
+      const pmd = new Date(prevYear, m, 0).getDate()
+      // 下个月的年份,当前12月,则需要加一年
+      const lastYear = cm + 1 > 12 ? currentYear + 1 : currentYear
+      const lastMonth = lm < 10 ? '0' + lm : lm
+      // 1号是周几
+      const firstWeek = new Date(today.setDate(1)).getDay()
+      // 如果是周日,则不需要显示上个月
+      if (firstWeek == 0) {
+        firstDay = `${currentYear}-${currentMonth}-01`
+      }
+      // 其他周几,对应用上个月的天数往前推算
+      else {
+        firstDay = `${prevYear}-${prevMonth}-${pmd - (firstWeek - 1)}`
+      }
+      // 这个月天数
+      const currentMonthDate = new Date(currentYear, cm, 0).getDate()
+      // 最后一天是周几
+      const lastWeek = new Date(today.setDate(currentMonthDate)).getDay()
+      // 周六显示当月最后一天
+      if (lastWeek == 6) {
+        lastDay = `${currentYear}-${currentMonth}-${currentMonthDate}`
+      }
+      // 其他周几,对应往后推算
+      else {
+        const day = ['06', '05', '04', '03', '02', '01']
+        lastDay = `${lastYear}-${lastMonth}-${day[lastWeek]}`
+      }
+      console.log('第一天', firstDay)
+      console.log('最后一天', lastDay)
+      this.getList({
+        beginPriceDate: firstDay,
+        endPriceDate: lastDay,
+      });
+    }
+  },
+  watch:{
+    timeValue(newValue,oldValue){
+      if (newValue.getFullYear() !== oldValue.getFullYear() || newValue.getMonth() !== oldValue.getMonth()) {
+        this.getRange(newValue)
+      }
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.dialog {
+  height: 70vh;
+  overflow-y: auto;
+}
+.dialog {
+  .upload-btn {
+    width: 100px;
+    height: 100px;
+    background-color: #fbfdff;
+    border: dashed 1px #c0ccda;
+    border-radius: 5px;
+    i {
+      font-size: 30px;
+      margin-top: 20px;
+    }
+    &-text {
+      margin-top: -10px;
+    }
+  }
+  .avatar {
+    cursor: pointer;
+  }
+}
+</style>

+ 227 - 0
src/views/wxapp/priceConfiguration/index.vue

@@ -0,0 +1,227 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="票务名称">
+        <el-input
+          v-model="queryParams.goodsName"
+          placeholder="请输入票务名称"
+          clearable
+          style="width: 200px;"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="票档名称">
+        <el-input
+          v-model="queryParams.seatTypeName"
+          placeholder="请输入票档名称"
+          clearable
+          style="width: 200px;"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button 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>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+              type="primary"
+              plain
+              icon="el-icon-plus"
+              size="mini"
+              @click="handleAdd"
+              v-hasPermi="['wxapp:priceConfiguration:add']"
+            >新增</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table ref="tables" v-loading="loading" :data="dataList" border>
+      <el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
+      <el-table-column label="票务名称" align="center" prop="goodsName" />
+      <el-table-column label="票档名称" align="center" prop="seatTypeName" />
+      <el-table-column label="划线价" align="center" prop="originalAmount" />
+      <el-table-column label="销售价" align="center" prop="saleAmount" />
+      <el-table-column label="创建人" align="center" prop="createBy" />
+      <el-table-column label="最后修改时间" align="center" prop="updateTime" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="状态" align="center">
+          <template slot-scope="scope">
+            <switchBoxVue  v-model="scope.row.priceStatus" @changeFun="ionlineApi(scope.row)" :active-value="1" />
+          </template>
+        </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <span v-hasPermi="['wxapp:priceConfiguration:deatils']" style="display: inline-block;">
+            <el-button
+              size="mini"
+              type="text"
+              style="margin-left: 10px;"
+              v-if="scope.row.onlineStatus != '1'"
+              @click="handleUpdate(scope.row)"
+            >价格日历</el-button>
+          </span>
+          
+          <span v-hasPermi="['wxapp:priceConfiguration:del']" style="display: inline-block;">
+            <el-button
+              size="mini"
+              type="text"
+              style="margin-left: 10px;"
+              v-if="scope.row.onlineStatus != '1'"
+              @click="handleDelete(scope.row,scope.index)"
+            >删除</el-button>
+          </span>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 新增/编辑弹框 -->
+    <add-and-edit
+      ref="addAndEdit"
+      :dict="dict"
+      @getList="getList"
+    />
+
+    <!--  日历价格  -->
+    <calendarBox ref="calendarBox" />
+  </div>
+</template>
+
+<script>
+
+import { pageList, deleteById, updateById } from '@/api/priceConfiguration/index'
+import addAndEdit from "./dialog/addAndEdit.vue";
+import calendarBox from './dialog/calendarBox.vue';
+import switchBoxVue from '@/components/switchBox.vue';
+export default {
+  name: "agreement",
+  dicts: ['agreement_type'],
+  components: { addAndEdit,calendarBox,switchBoxVue },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 用户表格数据
+      dataList: null,
+      // 弹出层标题
+      title: "",
+
+      // 是否显示弹出层
+      open: false,
+      // 日期范围
+      dateRange: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        type: undefined
+      },
+      statusList: [
+        {id: 1, name: '未上线', value: 0},
+        {id: 2, name: '己上线', value: 1}
+      ],
+      visibleStatus: false,
+      newObj: {},
+      visibleType: ''
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询列表 */
+    getList() {
+      this.loading = true;
+      pageList(this.addDateRange(this.queryParams, this.dateRange))
+      .then(response => {
+          this.dataList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        }
+      );
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.queryParams = {
+        pageNum: 1,
+        pageSize: this.queryParams.pageSize
+      }
+      this.handleQuery();
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.$refs["addAndEdit"].openDialog("新增数据", null);
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.$refs["calendarBox"].openDialog("修改数据", row);
+    },
+
+    /** 发布或者取消发布按钮操作 */
+    ionlineApi(row) {
+      this.$confirm("您确认要将该票的价格信息进行" + (row.priceStatus == 1 ? '禁用吗?' : '启用吗?'), '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        updateById({ id: row.id, priceStatus: row.priceStatus == 1 ? 0 : 1 }).then((res) => {
+          if (res.code == 200) {
+            this.$message({
+              type: 'success',
+              message: '操作成功!'
+            });
+            this.getList();
+          }
+        });
+      }).catch(() => {this.getList();});
+    },
+
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      this.$modal.confirm('您确认要将该票的价格信息进行删除吗?').then(function() {
+        return deleteById({id: row.id});
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 查看按钮操作 */
+    seeCenter(obj, type) {
+      this.visibleStatus = true
+      this.visibleType = type;
+      this.newObj = obj;
+    }
+  }
+};
+</script>