MONSTER-ygh 1 سال پیش
والد
کامیت
e789163967

+ 968 - 0
src/views/officesale/model/increaseViewers.vue

@@ -0,0 +1,968 @@
+<template>
+    <el-dialog
+    title="添加观影人"
+    :visible.sync="dialogVisible"
+    width="50%"
+    :before-close="handleClose">
+    <div
+    v-loading="loading" 
+    :element-loading-text="loadingText"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+    class="increase-viewers-box">
+        <div class="increase-viewers-info">
+            <el-table
+            :data="viewerList"
+            border
+            style="width: 100%">
+                <el-table-column
+                label="序号"
+                type="index"
+                width="50">
+                </el-table-column>
+                <!-- <el-table-column
+                    label="姓名"
+                    width="180">
+                    <template slot-scope="scope">
+                        <div>
+                            <span v-if="actionIndex != scope.row.id">{{ scope.row.name }}</span>
+                            <el-input size="mini" v-else v-model="tableForm.name" placeholder="请输入姓名"></el-input>
+                        </div>
+                    </template>
+                </el-table-column> -->
+                <!-- <el-table-column
+                    label="身份证号"
+                    width="250">
+                    <template slot-scope="scope">
+                        <div>
+                            <span v-if="actionIndex != scope.row.id">{{ scope.row.idcard }}</span>
+                            <el-input
+                                size="mini"
+                                v-else
+                                v-model="tableForm.idcard"
+                                placeholder="请输入身份证号"
+                                clearable
+                                style="width: 230px;"
+                                @keyup.enter.native="handleQuery"
+                            >
+                                <el-button slot="append" :loading="idcardLoading" size="mini" type="primary" @click="readCert">{{ idcardLoading ? '识别中':'识别' }}</el-button>
+                            </el-input>
+                        </div>
+                    </template>
+                </el-table-column> -->
+                <el-table-column
+                    label="座位类型">
+                    <template slot-scope="scope">
+                        <span>{{ scope.row.seatTypeName }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column
+                    prop="date"
+                    label="座位号">
+                    <template slot-scope="scope">
+                        <span>{{ scope.row.seatName }}</span>
+                    </template>
+                </el-table-column>
+                <!-- <el-table-column
+                    prop="date"
+                    label="价格(元)">
+                    <template slot-scope="scope">
+                        <span>{{ scope.row.salePrice }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column
+                    label="人员类别"
+                    width="130">
+                    <template slot-scope="scope">
+                        <div>
+                            <span v-if="actionIndex != scope.row.id">{{ 
+                                scope.row.identity?
+                                personnelType.find((item)=>{
+                                    return item.id == scope.row.identity
+                                }).name : ''
+                             }}</span>
+                            <el-select
+                                size="mini"
+                                v-else
+                                v-model="tableForm.identity"
+                                placeholder="请选择人员类别"
+                                clearable
+                                style="width: 100%"
+                            >
+                                <el-option
+                                v-for="dict in personnelType"
+                                :key="dict.id"
+                                :label="dict.name"
+                                :value="dict.id"
+                                />
+                            </el-select>
+                        </div>
+                    </template>
+                </el-table-column>
+                <el-table-column
+                    label="应付金额(元)">
+                    <template slot-scope="scope">
+                        <div>
+                            <span v-if="actionIndex != scope.row.id">{{ scope.row.realPrice }}</span>
+                            <el-input-number size="mini" style="width: 120px;" v-else v-model="tableForm.realPrice" controls-position="right" label="请输入应付金额(元)"></el-input-number>
+                        </div>
+                    </template>
+                </el-table-column>
+                <el-table-column
+                    label="备注"
+                    width="180">
+                    <template slot-scope="scope">
+                        <div>
+                            <span v-if="actionIndex != scope.row.id">{{ scope.row.remark }}</span>
+                            <el-input size="mini" v-else v-model="tableForm.remark" placeholder="请输入备注"></el-input>
+                        </div>
+                    </template>
+                </el-table-column>
+                <el-table-column
+                    label="操作"
+                    width="80"
+                    >
+                    <template slot-scope="scope">
+                        <el-button
+                        size="mini"
+                        type="success"
+                        v-if="actionIndex == scope.row.id"
+                        @click="handleSeva(scope.$index, scope.row)">保存</el-button>
+                        <el-button
+                        :disabled="!!actionIndex"
+                        size="mini"
+                        type="primary"
+                        v-if="actionIndex != scope.row.id"
+                        @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
+                    </template>
+                </el-table-column> -->
+            </el-table>
+        </div>
+        <div style="padding: 10px 0 20px;">合计:l累计观影人员{{ viewerList.length }}人,应付总额¥{{ moneyAll }}(元)</div>
+        <!-- <div>
+            <el-form 
+            :model="ruleForm" 
+            :rules="rules" 
+            ref="ruleForm11" 
+            label-width="120px" 
+            class="demo-ruleForm"
+            size="mini"
+            >
+                
+                <el-form-item label="用户来源 :" prop="source">
+                    <el-radio-group v-model="ruleForm.source">
+                        <el-radio label="12">窗口赠票</el-radio>
+                    </el-radio-group>
+                </el-form-item>
+                <el-form-item v-if="ruleForm.source && ruleForm.source != 7" label="核销码/订单码" prop="orderIdOrQrCode">
+                    <el-input style="width: 400px;" v-model="ruleForm.orderIdOrQrCode"></el-input>
+                </el-form-item>
+                <el-form-item label="支付方式 :" prop="paymentType">
+                    <el-radio-group v-model="ruleForm.paymentType">
+                        <el-radio label="1">扫码</el-radio>
+                        <el-radio label="2">现金</el-radio>
+                    </el-radio-group>
+                </el-form-item>
+                <el-form-item label="应付金额 :">
+                    ¥{{ moneyAll }}元
+                </el-form-item>
+                <el-form-item v-if="ruleForm.paymentType == 2" label="实付金额 :" prop="realPrice">
+                    <el-input @input="setRealPrice" style="width: 200px;" v-model="ruleForm.realPrice"></el-input>
+                </el-form-item>
+                <el-form-item label="找零金额 :" v-if="ruleForm.paymentType == 2">
+                    ¥{{ ruleForm.small }}元
+                </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==6 ? '连接扫码器失败!!!' :
+                    payStatus==7 ? '用户支付失败或未支付,请重新连接支付!!!' :
+                    payStatus==8 ? '用户支付成功,请点击打印票!!!' :
+                    payStatus==9 ? '支付超时!!!' :
+                    payStatus==3 ? '现金支付记录入库失败,请重新提交' : '未知状态' }}
+                </span>
+                <!-- 重新生成订单 1  -->
+                <el-button v-if="payStatus==1" @click="orderInfoSubmitFun()" type="primary">重新生成订单</el-button>
+                <!-- 扫码支付 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>
+                <!-- 打印 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,index) 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>
+            </div>
+        </div>
+    </div>
+    
+    <span slot="footer" class="dialog-footer">
+        <el-button @click="handleClose()">取 消</el-button>
+        <el-button v-if="!orderId&&!payStatus" :loading="loading" type="primary" @click="submitFormTicket('ruleForm11')">确认打印</el-button>
+    </span>
+    </el-dialog>
+</template>
+<script>
+import { 
+  querySeatList,
+  merchantPerformTimeList,
+  orderInfoSubmit,
+  gotoMicroPay,
+  gotoCashPay,
+  payQuery,
+  selectRegion,
+  orderInfoCancel,
+  lockOrUnLock,
+  merchantTheatreAuditoriumList
+ } from '@/api/windowTicketSales/ticketingSales'
+ import { pageList as getPrintListApi } from "@/api/device/pda";
+ import { printApi } from '@/api/windowTicketSales/ticketingCollection'
+ const mathM = require('mathjs')
+ const https = require('https');
+ const axios = require('axios');
+  export default {
+    data() {
+      return {
+        loading: false,
+        loadingText: '',
+        dialogVisible: false,
+        actionIndex: false,
+        tableForm: {
+            name: '', // 姓名
+            mobile: '', // 电话
+            idcard: '', // 身份证
+            identity: '', // 观影人身份
+            remark: '', // 备注信息
+            salePrice: '', // 原价
+            realPrice: '', // 实付金额
+            seatId: '', // 座位ID
+            seatName: '', // 座位名称
+            seatType: '', // 座位类型
+        },
+        ruleForm: {
+            performId: "", // 剧目ID
+            retailId: "", // 分销ID
+            goodsList: [], // 商品列表
+            auditoriumId: "", // 演出厅ID
+            performTimeId: "1", // 场次时段ID
+            seatTypeId: "", // 座位类型ID
+            source: '', // 订单来源
+            purchaser: {},// 购票人信息
+            viewerList: [], // 观影人列表
+            orderIdOrQrCode: '',
+            paymentType: '', // 支付方式
+            small: '',// 找零
+            realPrice: '0', // 实付金额
+        },
+        viewerList: [], // 观影人列表
+        rules: {
+            source: [
+                { required: true, message: '请选择用户来源', trigger: ['blur','change']},
+            ],
+            orderIdOrQrCode: [
+                { required: true, message: '请输入核销码/订单码', trigger: ['blur','change']},
+            ],
+            paymentType: [
+                { required: true, message: '请选择支付方式', trigger: ['blur','change']},
+            ],
+            realPrice: [
+                { required: true, message: '请输入实付金额', trigger: ['blur','change']},
+            ],
+        },
+        moneyAll: '',
+        payment: '',
+        payStatus: null, // 支付状态
+        orderId: null,
+        websocket_connected: false, // 是否已连接
+        websocketCtrl: null,
+        websocketData: null,
+
+        idcardLoading: false,
+        personnelType: [
+            { id: "0" , name:'无' },
+            { id: "1", name:'现役军人' },
+            { id: "2" , name:'警察' },
+            { id: "3" , name:'消防员' },
+            { id: "4" , name:'残疾军人' }
+        ],
+        payTime: null, // 支付等待时间
+        payTimeNum: 0,
+        printListId: null,
+        printList: [],
+
+      };
+      
+    },
+    methods: {
+        async initData(list,params){
+            this.websocketClear()
+            this.idcardLoading = false
+            this.ruleForm = {
+                performId: "", // 剧目ID
+                retailId: "", // 分销ID
+                goodsList: [], // 商品列表
+                auditoriumId: "", // 演出厅ID
+                performTimeId: "", // 场次时段ID
+                seatTypeId: "", // 座位类型ID
+                source: '12', // 订单来源
+                purchaser: {},// 购票人信息
+                viewerList: [], // 观影人列表
+                orderIdOrQrCode: '',
+                paymentType: '2', // 支付方式
+                small: '',// 找零
+                realPrice: '0', // 实付金额
+            }
+            this.payStatus = null
+            this.orderId = null
+            this.websocket_connected = false
+            this.dialogVisible = true
+            this.loading = true
+            this.actionIndex = null
+            this.viewerList = []
+            let perform = await this.selectRegionFun(params)
+            console.log("perform===",perform)
+            // let perform = {
+            //     money: 1,
+            //     name: '普通票'
+            // }
+            let listCopy = []
+            let listCopy1 = []
+            list.forEach((item,index)=>{
+                listCopy.push({
+                    id: index+1,
+                    name: '赠票', // 姓名
+                    mobile: '', // 电话
+                    idcard: 'ticket_'+new Date().getTime()+"_"+index, // 身份证
+                    identity: null, // 观影人身份
+                    remark: '', // 备注信息
+                    salePrice: perform.money, // 原价
+                    realPrice: perform.money, // 实付金额
+                    seatId: item.id, // 座位ID
+                    seatName: item.name?item.name:'暂无命名', // 座位名称
+                    seatType: perform.seatTypeId, // 座位类型
+                    seatTypeId: perform.seatTypeId,
+                    seatTypeName: perform.seatTypeName,
+                })
+            })
+            //this.goodsList = 
+            this.viewerList = JSON.parse(JSON.stringify(listCopy))
+            this.setMoneyAll()
+            
+            console.log(this.viewerList)
+            this.loading = false
+            // this.$nextTick(()=>{
+            //     this.$refs.ruleForm11.clearValidate()
+            // })
+        },
+        /**  获取票务信息  */
+        async selectRegionFun(params){
+            try {
+                this.loadingText = "获取票务信息中..."
+                let res = await selectRegion({
+                    "auditoriumId": params.auditoriumId, // 演艺厅ID
+                    "goodsId": params.goodsId, // 商品ID
+                    "performId": params.performId, // 上一界面节目ID
+                    "performTimeId": params.timeId, // 时段ID
+                    "retailId": "" // 分销ID
+                })
+                if(res.code == 200) {
+                    if(res.data.regionPriceList &&res.data.regionPriceList.length>0){
+                        let obj = res.data.regionPriceList[0]
+                        this.ruleForm.performId = obj.performId
+                        this.ruleForm.goodsList = [
+                            {
+                                goodsId: obj.goodsId,
+                                salePeice: obj.salePrice,
+                                saleNum: 1,
+                            }
+                        ]
+                        this.ruleForm.auditoriumId = obj.auditoriumId
+                        this.ruleForm.performId = obj.performId
+                        this.ruleForm.performTimeId = res.data.performTimeId
+                        this.ruleForm.seatTypeId = obj.seatTypeId
+                        return {
+                            money: obj.salePrice,
+                            //name: obj.goodsName,
+                            seatTypeId: obj.seatTypeId,
+                            seatTypeName: obj.seatTypeName,
+                        }
+                    }else {
+                        this.$message.error('存在座位未设置价格,请选择其他票!!!');
+                        this.loading = false
+                        this.dialogVisible = false
+                    }
+                    console.log("res====",res)
+                }else {
+                    this.$message.error(res.msg);
+                    this.loading = false
+                    this.dialogVisible = false
+                }
+            } catch (error) {
+                console.error("error=====",error)
+                this.$message.error('价格查询出错');
+                this.loading = false
+                this.dialogVisible = false
+            }
+        },
+        /**  取消订单   */
+        async orderInfoCancelFun(type){
+            try {
+                this.loading = true
+                this.loadingText = "取消订单中..."
+                orderInfoCancel({
+                    orderId: this.orderId
+                }).then((res)=>{
+                    if(res.code==200) {
+                        if(type){ // 关闭弹窗
+                            this.$emit('clearDialogVisible')
+                            this.dialogVisible = false
+                        }else {
+                            this.payStatus = 9
+                            this.loading = false
+                        }
+                        
+                    }
+                }).catch(()=>{
+                    this.$message.error('订单关闭失败!!!');
+                })
+            } catch (error) {
+                
+            }
+        },
+        /** 退出窗口 */
+        handleClose(done) {
+            // if(this.payStatus==8) {
+            //     this.$message.error('请daying');
+            //     return
+            // }
+            this.$confirm('确认关闭?')
+                .then(_ => {
+                    if(this.orderId){
+                        this.orderInfoCancelFun(true)
+                    }else {
+                        this.dialogVisible = false
+                    }
+                })
+                .catch(_ => {});
+        },
+        handleSeva(index, row) {    
+            if(!this.tableForm.name){
+                this.$message.error('请输入姓名!!!');
+                return
+            }
+            if(!this.tableForm.idcard){
+                this.$message.error('请输入身份证号!!!');
+                return 
+            }
+            if(this.tableForm.identity && this.tableForm.identity != 0){
+                if(!this.tableForm.remark){
+                    this.$message.error('请输入备注!!!');
+                    return 
+                }
+            }
+            this.$set(this.viewerList,index,JSON.parse(JSON.stringify(this.tableForm)))
+            this.actionIndex = null
+            this.setMoneyAll()
+        },
+        handleEdit(index, row) {
+            this.actionIndex = row.id
+            this.tableForm = JSON.parse(JSON.stringify(row))
+            
+            console.log(index, row);
+        },
+        handleDelete(index, row) {
+            console.log(index, row);
+        },
+        setMoneyAll(){
+            let moneyAll = 0
+            this.viewerList.forEach((item,index) => {
+                console.log("item.realPrice====",item.realPrice)
+                if(item.realPrice && !isNaN(Number(item.realPrice))) {
+                    moneyAll = mathM.format(Number(moneyAll) + Number(item.realPrice),10) 
+                }
+            })
+            console.log("dsfsfdsf",moneyAll)
+            this.moneyAll = moneyAll? moneyAll: ''
+        },
+        setRealPrice(value) {
+            if(value && !isNaN(value)) {
+                this.$set(this.ruleForm,'small',mathM.format(Number(value) - Number(this.moneyAll),10) )
+            }
+        },
+        /**  检查是否存在空值 */
+        checkViewerList() {
+            let flog = false
+            for(let i = 0; i < this.viewerList.length; i++){
+                let obj = this.viewerList[i]
+                if(!obj.name){
+                    this.$message.error('请填写观影人姓名!!!');
+                    flog = true
+                    break;
+                }
+                if(!obj.idcard){
+                    this.$message.error('请填写观影人身份证号!!!');
+                    flog = true
+                    break; 
+                }
+                // if(this.tableForm.identity && this.tableForm.identity != 0){
+                //     if(!this.tableForm.remark){
+                //         this.$message.error('请填写观影人备注!!!');
+                //         flog = true
+                //         break; 
+                //     }
+                // }
+            }
+            return flog
+        },
+        /**  校验订单 */
+        submitForm(formName) {
+            this.$refs[formName].validate((valid) => {
+            if (valid) {
+                if(!this.checkViewerList()){
+                    this.orderInfoSubmitFun()
+                }
+            } else {
+                console.log('error submit!!');
+                return false;
+            }
+            });
+        },
+        resetForm(formName) {
+            this.$refs[formName].resetFields();
+        },
+
+        /**  跳过表单校验 */
+        submitFormTicket(){
+            if(!this.checkViewerList()){
+                this.orderInfoSubmitFun()
+            }else{
+                this.$message.error('请填写观影人备注!!!');
+            }
+        },
+        /**  生成订单  */
+        async orderInfoSubmitFun(){
+            this.loading = true
+            try {
+                this.orderId = null
+                this.loadingText = "生成订单中..."
+                let res = await orderInfoSubmit({
+                    ...this.ruleForm,
+                    viewerList: this.viewerList
+                })
+                if(res.code == 200){
+                    this.orderId = res.data.orderId
+                    if(this.ruleForm.paymentType == 2) {
+                        this.gotoCashPayFun(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 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 {
+                                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.error('"订单入库成功"');
+                                this.loading = false
+                                // this.payStatus = 8
+                                // this.getPrintListApi()
+                                this.goTicketingCollections()
+                                
+                            }else {
+                                this.$message('用户已支付!!!');
+                                // 开始 打印
+                                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 {
+                                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 {
+                                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.websocketClear()
+            console.log('sdfdsfsd')
+            if (!this.websocket_connected) {
+                var host = "ws://localhost:2693";
+                this.websocketCtrl = new WebSocket(host,'ctrl');
+                this.websocketData = new WebSocket(host,'data');
+                this.websocketData.onopen = (evt) => {
+                    console.log('sdasdasd====',evt)
+                    this.loading = false
+                    this.payStatus = 5
+                    this.websocket_connected = true;
+                    this.websocket_open_state(evt);
+                }
+                this.websocketData.onerror = (evt) => {
+                    console.log('sdasdasd11111====',evt)
+                    this.payStatus = 6
+                    //this.vbar_open()
+                }
+
+                this.websocketData.onmessage = (evt) => {
+                    console.log("接受消息====",evt)
+                    this.websocket_decode(evt.data);
+                }
+            }
+
+            //setTimeout(this.vbar_open(), 3000);
+        },
+        /**  连接结果 */
+        websocket_open_state(message){
+            //document.getElementById('wsocket').value = "已连接";
+        },
+        //接收扫码结果处理
+        websocket_decode(code){
+            console.log()
+            if(this.orderId && this.payStatus==5 &&code) {
+                this.gotoMicroPayFun(this.orderId,code)
+            }
+        },
+        /** 关闭通讯 */
+        websocketClear(){
+            if(this.websocketCtrl){
+                this.websocketCtrl.close()
+            }
+            if(this.websocketData){
+                this.websocketData.close()
+            }
+            this.websocket_connected = false
+        },
+        /**  读取身份证 */
+        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
+          // })
+        },
+    }
+}
+</script>
+<style scoped lang="scss">
+.increase-viewers-box {
+    width: 100%;
+    height: calc( 100vh - 250px );
+    box-sizing: border-box;
+    overflow: hidden;
+    overflow-y: auto;
+    position: relative;
+}
+.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>

+ 610 - 0
src/views/officesale/ticketingSales.vue

@@ -0,0 +1,610 @@
+<template>
+    <div class="app-container app-container-me">
+      <el-form 
+      :model="queryParams" 
+      ref="queryForm" 
+      size="small" 
+      :inline="true" 
+      :rules="rules"
+      label-width="80px">
+        <el-form-item label="演出厅" prop="auditoriumId">
+          <el-select
+            v-model="queryParams.auditoriumId"
+            placeholder="演出厅"
+            clearable
+            style="width: 100%"
+            @change="changeTime"
+          >
+            <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"
+            value-format="yyyy-MM-dd"
+            ></el-date-picker>
+        </el-form-item>
+        <el-form-item label="场次" prop="timeId">
+          <el-select
+            v-model="queryParams.timeId"
+            placeholder="场次"
+            clearable
+            style="width: 100%"
+            @change="changeTime"
+          >
+            <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 label="票务类型" prop="goodsId">
+          <el-select
+            v-model="queryParams.goodsId"
+            placeholder="票务类型"
+            clearable
+            style="width: 100%"
+            @change="changeTime"
+          >
+            <el-option
+              v-for="dict in goodsPageListS"
+              :key="dict.id"
+              :label="dict.goodsName"
+              :value="dict.id"
+              :disabled="dict.status==1 || dict.goodsPerform.channelWindow != 0"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button :loading="loading" type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+          <el-button :loading="loading" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        </el-form-item>
+      </el-form>
+      <div class="seat-tool-box">
+        <span class="demonstration">座位大小</span>
+        <div>
+            <el-slider v-model="scaleNum" :min="30" :max="100"></el-slider>
+        </div>
+        
+      </div>
+      <div class="seat-box" :style="{'--scaleNum': scaleNum/100}">
+        <!-- 选择座位  -->
+        <div class="seat-list-box">
+            <!--  座位排版  -->
+            <div v-loading="loading" class="dialog">
+                <div class="seat-box-class clearfix" v-if="seatMapList">
+                    <div
+                    class="seat-item-class-box" 
+                    v-for="(item1, index1) in Object.keys(seatMapList)" 
+                    :key="index1"
+                    >
+                        <div 
+                        class="seat-item-class" 
+                        :class="item.occupyStatus==0?'occupy-status': item.isDisabled || item.status == 2 ? 'disabled-class' : item.isSelect ? 'select-class' : ''"
+                         v-for="(item, index) in seatMapList[item1]" 
+                         @click.stop="seatClick(item)" 
+                         :key="index">
+                            <p class="text-class">{{ item.status == 2 ? '不可售':(item.name ? item.name : '暂未命名') }}</p>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div style="margin-top: 5px; margin-left: 30px;display: flex;">
+                <div style="flex-shrink: 0;">
+                    已勾选:{{ seatSelectList.length }}个座位
+                </div>
+                <div style="width: 100%;display: flex;justify-content: center;height: 30px;">
+                    <el-button size="mini" type="warning" :loading="lockOrUnLockLoading" @click="lockOrUnLockFun(seatSelectList,0)">锁定</el-button>
+                    <el-button size="mini" type="primary" @click="increaseViewersFun">预约</el-button>
+                </div>
+            </div>
+        </div>
+        <!-- <div class="seat-select-box">
+            <div class="seat-select-info">
+                <div 
+                class="seat-select-item"
+                :key="index" 
+                v-for="(item,index) in seatSelectList">
+                    <span>{{item.name ? item.name : '暂未命名'}}</span>
+                </div>
+            </div>
+        </div> -->
+      </div>
+      <!--  添加观影人  -->
+      <increaseViewers ref="increaseViewers" @clearDialogVisible="clearDialogVisible" />
+    </div>
+  </template>
+  
+  <script>
+  import { 
+  querySeatList,
+  merchantPerformTimeList,
+  lockOrUnLock,
+  merchantTheatreAuditoriumList,
+  goodsPageList,
+ } from '@/api/windowTicketSales/ticketingSales'
+ import increaseViewers from "./model/increaseViewers"
+  export default {
+    name: "distributionapplication",
+    components: {
+        increaseViewers
+    },
+    data() {
+      return {
+        // 遮罩层
+        loading: false,
+        // 查询参数
+        queryParams: {
+            timeId: null,
+            performDate: null,
+            auditoriumId: null,
+            goodsId: null,
+        },
+        rules: {
+            auditoriumId: [
+                { required: true, message: '请选择选择演出厅', trigger: ['blur','change'] }
+            ],
+            performDate: [
+                { required: true, message: '请选择时间', trigger: ['blur','change'] }
+            ],
+            timeId: [
+                { required: true, message: '请选择场次', trigger: ['blur','change'] }
+            ],
+            goodsId: [
+                { required: true, message: '请选择票务类型', trigger: ['blur','change'] }
+            ],
+        },
+        merchantTheatreAuditoriumListS: [], // 演出厅
+        merchantPerformTimeListS: [], // 场次
+        querySeatListS: [], // 座位
+        goodsPageListS: [], // 票务
+        setList: [],
+        seatMapList: [],
+        seatSelectList: [],
+
+        lockOrUnLockLoading: false,
+
+        performId: '',// 剧目ID
+        scaleNum: 30,
+      };
+    },
+    created() {
+        this.merchantTheatreAuditoriumListFun()
+        this.goodsPageListFun()
+    },
+    methods: {
+        /**  票务信息  */
+        async goodsPageListFun(){
+            try {
+                let res = await goodsPageList({
+                    pageNum: 1,
+                    pageSize: 999,
+                    classifyId: 1,
+                    goodsType: 2,
+                })
+                if(res.code == 200){
+                    this.goodsPageListS = res.data.rows
+                    // let list = []
+                    // res.data.rows.forEach((item,index)=>{
+                    //     if(item.status != 1) {
+                    //         list.push(item)
+                    //     }
+                    // })
+                    // this.goodsPageListS = list
+                }
+            } catch (error) {
+                
+            }
+        },
+        /**  获取演出厅  */
+        async merchantTheatreAuditoriumListFun(){
+            try {
+                let res = await merchantTheatreAuditoriumList({
+                    pageNum: 1,
+                    pageSize: 999
+                })
+                if(res.code == 200){
+                    this.merchantTheatreAuditoriumListS = res.data.rows
+                }
+            } catch (error) {
+                
+            }
+        },
+        /**  获取场次  */
+        async merchantPerformTimeListFun(){
+            try {
+                let res = await merchantPerformTimeList({
+                    ...this.queryParams
+                })
+                if(res.code == 200){
+                    this.merchantPerformTimeListS = res.data.rows
+                }
+            } catch (error) {
+                
+            }
+        },
+        /**  座位锁定/解锁  */
+        async lockOrUnLockFun(listS,type){
+            try {
+                this.lockOrUnLockLoading = true
+                let list = []
+                listS.forEach((item,index)=>{
+                    list.push({
+                        "auditoriumId": this.queryParams.auditoriumId,
+                        "seatId": item.id,
+                        "timeId": this.queryParams.timeId
+                    })
+                })
+                let res = await lockOrUnLock({
+                    type: type,
+                    seatList: list
+                })
+                this.lockOrUnLockLoading = false
+                if(res.code) {
+                    this.$message({
+                        showClose: true,
+                        message: res.msg,
+                        type: 'success'
+                    });
+                    this.querySeatListFun(true)
+                }
+                
+            } catch (error) {
+                this.lockOrUnLockLoading = false
+                this.$message({
+                        showClose: true,
+                        message: "操作失败!!!",
+                        type: 'error'
+                    });
+                console.error('error===',error)
+            }
+            
+        },
+        /**  获取座位  */
+        async querySeatListFun(type){
+            try {
+                this.loading = true
+                this.performId = ''
+                if(type) { // 是否清除已选
+                    this.seatSelectList = []
+                }
+                this.seatMapList = {}
+                this.seatList = []
+                let res = await querySeatList({
+                    ...this.queryParams
+                })
+                if(res.code == 200){
+                    this.querySeatListS = res.data;
+                    this.setList = res.data;
+                    if(this.setList && this.setList.length > 0) {
+                        this.setSeatMapList(this.setList);
+                    }
+                }
+                this.loading = false
+            } catch (error) {
+                this.loading = false
+                console.error("error===",error)
+            }
+        },
+        // 设置座位集合
+        setSeatMapList(list) {
+            if(list && list.length > 0) {
+                let listCopy = {}
+                let lisyCopy1 = {}
+                list.forEach(item => {
+                    item.isDisabled = (item.occupyStatus != null && (item.occupyStatus == 0 || item.occupyStatus == 1) ? true : false); // 座位是否已被选择
+                    item.isSelect = this.setIsSelect(item);
+                    if(item.rowNo){
+                        if(listCopy['my'+item.rowNo]){
+                            listCopy['my'+item.rowNo].push(item)
+                        }else {
+                            listCopy['my'+item.rowNo] = [item] 
+                        }
+                    }
+                })
+                // Object.keys(listCopy).forEach((item)=>{
+                //     lisyCopy[item]
+                // })
+                console.log("list====",listCopy)
+                this.seatMapList = JSON.parse(JSON.stringify(listCopy))
+            }
+        },
+        setIsSelect(item){
+            if(!this.seatSelectList||this.seatSelectList.length==0){
+                return false
+            }
+            let flog = false
+            this.seatSelectList.forEach((item1,index1)=>{
+                if(item.id == item1.id){
+                    flog = true
+                }
+            })
+            return flog
+        },
+        /**  选择演出时间  */
+        changeTime(value){
+            if(this.queryParam && this.queryParam.timeId) {
+                this.$set(this.queryParam,'timeId',null)
+            }
+            if(this.queryParams.auditoriumId&&this.queryParams.performDate){
+                this.merchantPerformTimeListFun()
+            }
+            this.performId = ''
+            this.seatSelectList = []
+            this.seatMapList = {}
+            this.seatList = []
+            this.handleQuery()
+            
+        },
+        /**  设置 场次 对应得剧目ID */
+        changePerformId(value){
+            console.log("value=====",value)
+            this.performId = ''
+            this.merchantPerformTimeListS.forEach((item,index)=>{
+                if(item.id == value){
+                    this.performId = item.performId
+                }
+            })
+        },
+        /** 搜索按钮操作 */
+        handleQuery() {
+            this.$refs.queryForm.validate((valid) => {
+            if (valid) {
+                this.querySeatListFun();
+            } else {
+                console.log('error submit!!');
+                return false;
+            }
+            });
+            
+        },
+        /** 重置按钮操作 */
+        resetQuery() {
+            this.$refs.queryForm.resetFields()
+            this.handleQuery();
+        },
+
+        // 座位点击事件
+        seatClick(row) {
+            console.log(row)
+            if(row.occupyStatus == 0){
+                console.log("weqwrwerewrer")
+                this.$confirm('此座已被锁定,请先解锁', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    this.lockOrUnLockFun([row],1)
+                }).catch((error) => {
+                    console.log("error====",error)
+                });
+            }else if(row.isDisabled || row.status == 2){
+                return false
+            }else {
+                let flog = false;
+                this.seatSelectList.forEach((item,index)=>{
+                    if(item.seatTypeId != row.seatTypeId ) {
+                        flog = true
+                    }
+                })
+                if(flog){
+                    this.$message.error('只能选同一类型得座位');
+                    return
+                }
+                row.isSelect = !row.isSelect
+                if(row.isSelect){
+                    this.seatSelectList.push(JSON.parse(JSON.stringify(row)))
+                }else {
+                    let list = JSON.parse(JSON.stringify(this.seatSelectList))
+                    list.forEach((item,index)=>{
+                        if(item.id == row.id) {
+                            this.seatSelectList.splice(index, 1)
+                        }
+                    })
+                }
+                this.$forceUpdate()
+            }
+            
+        },
+        increaseViewersFun(){
+            if(this.seatSelectList.length>0){
+                this.changePerformId(this.queryParams.timeId)
+                this.$refs.increaseViewers.initData(this.seatSelectList,{
+                    ...this.queryParams,
+                    performId:this.performId
+                })
+            }else {
+                this.$alert('请先选择座位!!!', '提示', {
+                    confirmButtonText: '确定',
+                    callback: action => {
+                        
+                    }
+                });
+            }
+            
+        },
+        /**  弹窗关闭 */
+        clearDialogVisible(){
+            //this.
+            this.querySeatListFun(true)
+        }
+    }   
+  };
+  </script>
+  <style lang="scss" scoped>
+  .app-container-me {
+    width: 100%;
+    height: calc( 100vh - 120px );
+  }
+  .seat-tool-box {
+    height: 20px;
+    box-sizing: border-box;
+    display: flex;
+    align-items: center;
+    span{
+        flex-shrink: 0;
+        font-size: 12px;
+    }
+    >div {
+        width: 100px;
+        margin-left: 10px;
+    }
+  }
+  .seat-box {
+    width: 100%;
+    height: calc( 100% - 100px ) ;
+    box-sizing: border-box;
+    display: flex;
+    position: relative;
+    .seat-list-box {
+        //width: calc(100% - 200px);
+        width: 100%;
+        height: 100%;
+        box-sizing: border-box;
+    }
+    .seat-select-box {
+        width: 200px;
+        height: 100%;
+        flex-shrink: 0;
+        box-sizing: border-box;
+        .seat-select-info {
+            width: 100%;
+            height: 100%;
+            overflow: hidden;
+            overflow-y: auto;
+            .seat-select-item {}
+        }
+    }
+  }
+
+  .seat-box::after {
+    content: "舞台";
+    position: absolute;
+    left: 50%;
+    transform: translateX(-50%);
+    width: 300px;
+    height: 30px;
+    background-color: rgb(204, 204, 204,0.3);
+    font-size: 18px;
+    font-weight: 600;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    border-radius: 0 0 20px 20px;
+  }
+  .dialog {
+    padding: 30px 10px 10px;
+    width: 100%;
+    height: 100%;
+    box-sizing: border-box;
+    overflow: auto;
+    border-radius: 10px;
+    border: 1px  solid #323333;
+    .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;
+    }
+    .title-class{
+      font-size: 16px;
+      font-weight: bold;
+      color: black;
+      margin-bottom: 20px;
+      margin-top: 20px;
+    }
+    .item-class{
+      margin-bottom: 20px;
+    }
+    .seat-box-class{
+      padding: 5px;
+      transform-origin: 50% 0;
+      transform: scale(var(--scaleNum));
+      box-sizing: border-box;
+      .disabled-class{
+        background-color: #aaabad;
+        user-select: none;
+        // pointer-events: none;
+        cursor: not-allowed !important;
+      }
+      .select-class{
+        //background-color: #e85353 !important;
+        border: 2px solid #1890ff !important;
+       // color: #eceaea !important;
+       position: relative;
+      }
+      .occupy-status:after{
+        content:"";
+        display:block;
+        position:absolute;
+        top:0;
+        left:0;
+        width:100%;
+        height:100%;
+        background-color:rgba(0,0,0,0.3);
+        z-index:-1;
+        background-image: url('../../assets/jinzhi.png');
+        background-size: 50% 50%;
+        background-position: 50% 50%;
+        background-repeat: no-repeat;
+        z-index: 99;
+    }
+      .occupy-status {
+        //pointer-events: none;
+      }
+      .seat-item-class-box {
+        width: 100%;
+        display: flex;
+        flex-wrap: nowrap;
+        justify-content: center;
+        text-align: center;
+      }
+      .seat-item-class{
+        flex-shrink: 0;
+        display: block;
+        float: left;
+        width: 60px;
+        height: 60px;
+        margin: 5px;
+        border: 1px solid #4c4d4d;
+        border-radius: 3px;
+        cursor: pointer;
+        position: relative;
+        user-select: none;
+        // transform-origin: 50% 50%;
+        // transform: scale(var(--scaleNum));
+        &:hover{
+          opacity: 0.6;
+        }
+  
+        .text-class{
+          font-size: 12px;
+          padding: 5px;
+          line-height: 16px;
+          margin: 0;
+        }
+      }
+    }
+  }
+  </style>

+ 7 - 5
src/views/windowTicketSales/model/increaseViewers.vue

@@ -278,7 +278,8 @@ import {
             viewerList: [], // 观影人列表
             orderIdOrQrCode: '',
             paymentType: '', // 支付方式
-            small: '',// 实付金额
+            small: '',// 找零
+            realPrice: '', // 实付金额
         },
         viewerList: [], // 观影人列表
         rules: {
@@ -336,6 +337,7 @@ import {
                 orderIdOrQrCode: '',
                 paymentType: '', // 支付方式
                 small: '',// 实付金额
+                realPrice: '', // 实付金额
             }
             this.payStatus = null
             this.orderId = null
@@ -519,18 +521,18 @@ import {
             let flog = false
             for(let i = 0; i < this.viewerList.length; i++){
                 let obj = this.viewerList[i]
-                if(!this.tableForm.name){
+                if(!obj.name){
                     this.$message.error('请填写观影人姓名!!!');
                     flog = true
                     break;
                 }
-                if(!this.tableForm.idcard){
+                if(!obj.idcard){
                     this.$message.error('请填写观影人身份证号!!!');
                     flog = true
                     break; 
                 }
-                if(this.tableForm.identity && this.tableForm.identity != 0){
-                    if(!this.tableForm.remark){
+                if(obj.identity && obj.identity != 0){
+                    if(!obj.remark){
                         this.$message.error('请填写观影人备注!!!');
                         flog = true
                         break;