Browse Source

1. 优化

MONSTER-ygh 1 year ago
parent
commit
1c3b5f9be8

+ 2 - 1
package.json

@@ -81,7 +81,8 @@
     "vue-quill-editor": "^3.0.6",
     "vue-router": "3.4.9",
     "vuedraggable": "2.24.3",
-    "vuex": "3.6.0"
+    "vuex": "3.6.0",
+    "mathjs": "^12.2.1"
   },
   "devDependencies": {
     "@vue/cli-plugin-babel": "4.4.6",

+ 1 - 1
src/views/ticket/ticketMr/dialog/FreightMgrIndexMi.js

@@ -50,7 +50,7 @@ export default {
         },
         /** 关闭弹窗  */
         selectDeliveryAreaDialogCancel(){
-            this.selectDeliveryAreaDialogOpe = false;
+            this.selectDeliveryAreaDialogOpen = false;
         },
         /**  确认弹窗  */
         selectDeliveryAreaDialogSubmitForm(){

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

@@ -116,9 +116,9 @@
             <el-form-item label="可售区域:" label-width="100px">
               <span @click="deliverableAreaDialogCancel(form.saleArea)" style="cursor: pointer;color: #1890ff;">请选择(点击这里进行选择)</span>
               <span style="margin-left: 10px;color: red;cursor: pointer;" @click="form.saleArea=''">全部清除</span>
-              <div style="width: 100%;height: 100px;overflow: hidden;overflow-y: auto;background-color: #ccc;padding: 5px;box-sizing: border-box;border-radius: 10px;">
+              <div style="width: 100%;height: 100px;overflow: hidden;overflow-y: auto;background-color: rgba(204, 204, 204,0.3);padding: 5px;box-sizing: border-box;border-radius: 10px;">
                 <div v-if="form.saleArea">
-                  <el-tag :key="index" v-for="(item,index) in form.saleArea" >{{ item }}</el-tag>
+                  <el-tag :key="index" style="margin-left: 5px;margin-bottom: 5px;" v-for="(item,index) in form.saleArea" >{{ item }}</el-tag>
                 </div>
                 
               </div>

+ 10 - 1
src/views/ticket/ticketMr/dialog/details.vue

@@ -53,9 +53,18 @@
             <span v-if="form.goodsPerform.buyAstrict > -1">每个账号在每个场次限购{{ form.goodsPerform.buyAstrict }}</span>
           </div>
         </el-col>
-        <el-col :span="12" v-if="form.goodsPerform">
+        <el-col :span="24" v-if="form.goodsPerform">
           <div class="grid-content bg-purple item-class">售票渠道: <span>{{ (form.goodsPerform.channelWx == 0 ? '小程序' : '') + ' ' + (form.goodsPerform.channelWindow == 0 ? '窗口' : '')}}</span></div>
         </el-col>
+        <el-col :span="24" v-if="form.goodsPerform">
+          
+          <div style="width: 100%;height: 100px;overflow: hidden;overflow-y: auto;background-color: rgba(204, 204, 204,0.3);padding: 5px;box-sizing: border-box;border-radius: 10px;">
+            <div style="padding: 0 10px;" class="grid-content bg-purple item-class">可售渠道: </div>
+            <div v-if="form.saleArea">
+              <el-tag :key="index" style="margin-left: 5px;margin-bottom: 5px;" v-for="(item,index) in form.saleArea" >{{ item }}</el-tag>
+            </div>  
+          </div>
+        </el-col>
       </el-row>
 
       <!--   观影须知   -->

+ 124 - 50
src/views/windowTicketSales/model/increaseViewers.vue

@@ -16,6 +16,7 @@
             border
             style="width: 100%">
                 <el-table-column
+                label="序号"
                 type="index"
                 width="50">
                 </el-table-column>
@@ -25,22 +26,23 @@
                     <template slot-scope="scope">
                         <div>
                             <span v-if="actionIndex != scope.row.id">{{ scope.row.name }}</span>
-                            <el-input v-else v-model="tableForm.name" placeholder="请输入姓名"></el-input>
+                            <el-input size="mini" v-else v-model="tableForm.name" placeholder="请输入姓名"></el-input>
                         </div>
                     </template>
                 </el-table-column>
                 <el-table-column
                     label="身份证号"
-                    width="240">
+                    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: 240px;"
+                                style="width: 230px;"
                                 @keyup.enter.native="handleQuery"
                             >
                                 <el-button slot="append" :loading="idcardLoading" size="mini" type="primary" @click="readCert">{{ idcardLoading ? '识别中':'识别' }}</el-button>
@@ -70,11 +72,17 @@
                 </el-table-column>
                 <el-table-column
                     label="人员类别"
-                    width="180">
+                    width="130">
                     <template slot-scope="scope">
                         <div>
-                            <span v-if="actionIndex != scope.row.id">{{ scope.row.identity }}</span>
+                            <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="请选择人员类别"
@@ -94,11 +102,11 @@
                 <el-table-column
                     label="应付金额(元)">
                     <template slot-scope="scope">
-                        <span>{{ scope.row.realPrice }}</span>
-                        <!-- <div>
+                        <!-- <span>{{ scope.row.realPrice }}</span> -->
+                        <div>
                             <span v-if="actionIndex != scope.row.id">{{ scope.row.realPrice }}</span>
-                            <el-input v-else v-model="tableForm.realPrice" placeholder="请输入应付金额(元)"></el-input>
-                        </div> -->
+                            <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
@@ -107,27 +115,30 @@
                     <template slot-scope="scope">
                         <div>
                             <span v-if="actionIndex != scope.row.id">{{ scope.row.remark }}</span>
-                            <el-input v-else v-model="tableForm.remark" placeholder="请输入备注"></el-input>
+                            <el-input size="mini" v-else v-model="tableForm.remark" placeholder="请输入备注"></el-input>
                         </div>
                     </template>
                 </el-table-column>
                 <el-table-column
                     label="操作"
-                    width="180">
+                    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>
-                        <el-button
+                        <!-- <el-button
                         size="mini"
                         type="danger"
-                        @click="handleDelete(scope.$index, scope.row)">删除</el-button>
+                        @click="handleDelete(scope.$index, scope.row)">删除</el-button> -->
                     </template>
                 </el-table-column>
             </el-table>
@@ -138,34 +149,34 @@
             :model="ruleForm" 
             :rules="rules" 
             ref="ruleForm11" 
-            label-width="100px" 
+            label-width="120px" 
             class="demo-ruleForm"
             size="mini"
             >
                 
-                <el-form-item label="用户来源:" prop="source">
+                <el-form-item label="用户来源 :" prop="source">
                     <el-radio-group v-model="ruleForm.source">
                         <el-radio label="7">窗口</el-radio>
                         <el-radio label="2">美团</el-radio>
                         <el-radio label="3">携程</el-radio>
                     </el-radio-group>
                 </el-form-item>
-                <el-form-item v-if="ruleForm.resource && ruleForm.resource != 1" label="核销码/订单码" prop="orderIdOrQrCode">
-                    <el-input style="width: 200px;" v-model="ruleForm.orderIdOrQrCode"></el-input>
+                <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-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="应付金额:">
+                <el-form-item label="应付金额 :">
                     ¥{{ moneyAll }}元
                 </el-form-item>
-                <el-form-item v-if="ruleForm.paymentType == 2" label="实付金额:" prop="realPrice">
+                <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">
+                <el-form-item label="找零金额 :" v-if="ruleForm.paymentType == 2">
                     ¥{{ ruleForm.small }}元
                 </el-form-item>
             </el-form>
@@ -173,8 +184,8 @@
         <!--  支付过程 控制  -->
         <div v-if="payStatus" class="increase-viewers-pay-status">
             <div class="increase-viewers-pay-status-info">
-                <span>提示</span>
-                <span>
+                <span style="font-weight: 600;font-size: 20px;">提示</span>
+                <span style="padding: 10px 0;">
                     {{ payStatus==1 ? '生成订单失败!!!' : 
                     payStatus==2 ? '生成订单生成成功,请点击调取扫码盒子' : 
                     payStatus==4 ? '扫码支付失败!!!' :
@@ -182,7 +193,7 @@
                     payStatus==6 ? '连接扫码器失败!!!' :
                     payStatus==7 ? '用户支付失败或未支付,请重新连接支付!!!' :
                     payStatus==8 ? '用户支付成功,请点击打印票!!!' :
-                    payStatus==3 ? '' : '未知状态' }}
+                    payStatus==3 ? '现金支付记录入库失败,请重新提交' : '未知状态' }}
                 </span>
                 <!-- 重新生成订单 1  -->
                 <el-button v-if="payStatus==1" @click="orderInfoSubmitFun()" type="primary">重新生成订单</el-button>
@@ -191,7 +202,7 @@
                 <!-- 扫码支付 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>
+                <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  -->
@@ -207,7 +218,7 @@
     
     <span slot="footer" class="dialog-footer">
         <el-button @click="handleClose()">取 消</el-button>
-        <el-button v-if="!orderId" :loading="loading" type="primary" @click="submitForm('ruleForm11')">确定支付</el-button>
+        <el-button v-if="!orderId&&!payStatus" :loading="loading" type="primary" @click="submitForm('ruleForm11')">确定支付</el-button>
     </span>
     </el-dialog>
 </template>
@@ -226,6 +237,7 @@ import {
  } 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 {
@@ -273,7 +285,7 @@ import {
                 { required: true, message: '请选择支付方式', trigger: ['blur','change']},
             ],
             realPrice: [
-                { required: true, message: '请输入核销码/订单码', trigger: ['blur','change']},
+                { required: true, message: '请输入实付金额', trigger: ['blur','change']},
             ],
         },
         moneyAll: '',
@@ -442,7 +454,7 @@ import {
                 this.$message.error('请输入身份证号!!!');
                 return 
             }
-            if(this.tableForm.identity){
+            if(this.tableForm.identity && this.tableForm.identity != 0){
                 if(!this.tableForm.remark){
                     this.$message.error('请输入备注!!!');
                     return 
@@ -466,7 +478,7 @@ import {
             this.viewerList.forEach((item,index) => {
                 console.log("item.realPrice====",item.realPrice)
                 if(item.realPrice && !isNaN(Number(item.realPrice))) {
-                    moneyAll = moneyAll + Number(item.realPrice)
+                    moneyAll = mathM.format(Number(moneyAll) + Number(item.realPrice),10) 
                 }
             })
             console.log("dsfsfdsf",moneyAll)
@@ -474,13 +486,40 @@ import {
         },
         setRealPrice(value) {
             if(value && !isNaN(value)) {
-                this.$set(this.ruleForm,'small',Number(value) - this.moneyAll )
+                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(!this.tableForm.name){
+                    this.$message.error('请填写观影人姓名!!!');
+                    flog = true
+                    break;
+                }
+                if(!this.tableForm.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) {
-                this.orderInfoSubmitFun()
+                if(!this.checkViewerList()){
+                    this.orderInfoSubmitFun()
+                }
             } else {
                 console.log('error submit!!');
                 return false;
@@ -503,8 +542,9 @@ import {
                 if(res.code == 200){
                     this.orderId = res.data.orderId
                     if(this.ruleForm.paymentType == 2) {
-                        this.gotoCashPayFun()
+                        this.gotoCashPayFun(this.orderId)
                     }else {
+                        // 扫码支付
                         this.loading = false
                         this.payStatus = 2
                     }
@@ -555,7 +595,7 @@ import {
          async gotoCashPayFun(orderId){
             this.loading = true
             try {
-                this.loadingText = "订单支付中..."
+                this.loadingText = "订单入库中..."
                 let res = await gotoCashPay({
                     "orderId": orderId // 订单编号-提交订单返回
                 })
@@ -567,12 +607,12 @@ import {
                         this.payQueryFun(this.orderId)
                     },1500)
                 }else{
-                    this.$message.error('支付失败!!!');
+                    this.$message.error('订单入库中失败!!!');
                     this.loading = false
                     this.payStatus = 3
                 }
             } catch (error) {
-                this.$message.error('支付失败!!!');
+                this.$message.error('订单入库中失败!!!');
                 this.loading = false
                 this.payStatus = 3
             }
@@ -582,7 +622,11 @@ import {
          async payQueryFun(orderId){
             this.loading = true
             try {
-                this.loadingText = "订单支付中..."
+                if(this.ruleForm.paymentType == 2){
+                    this.loadingText = "订单入库中..."
+                }else {
+                    this.loadingText = "订单支付中..."
+                }
                 this.payStatus = ''
                 let res = await payQuery({
                     orderId: orderId
@@ -593,34 +637,64 @@ import {
                             if(this.payTime){
                                 clearInterval(this.payTime)
                             }
-                            this.$message.error('用户未支付!!!');
-                            this.loading = false
-                            this.payStatus = 7
+                            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)
                             }
-                            this.$message('用户已支付!!!');
-                            // 开始 打印
-                            this.loading = false
-                            this.payStatus = 8
-                            this.getPrintListApi()
+                            if(this.ruleForm.paymentType == 2){
+                                this.$message.error('"订单入库中成功"');
+                                this.loading = false
+                                this.payStatus = 8
+                                this.getPrintListApi()
+                            }else {
+                                this.$message('用户已支付!!!');
+                                // 开始 打印
+                                this.loading = false
+                                this.payStatus = 8
+                                this.getPrintListApi()
+                            }
+                            
+                            
                         }else if(res.data.payStatus == 2) {
 
                         }else if(res.data.payStatus == 3) {
                             if(this.payTime){
                                 clearInterval(this.payTime)
                             }
-                            this.$message.error('用户支付失败!!!');
-                            this.loading = false
-                            this.payStatus = 7
+                            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)
                             }
-                            this.$message.error('支付退款!!!');
-                            this.loading = false
-                            this.payStatus = 7
+                            
+                            if(this.ruleForm.paymentType == 2){
+                                this.$message.error('"订单入库中失败"');
+                                this.loading = false
+                                this.payStatus = 3
+                            }else {
+                                this.$message.error('支付退款!!!');
+                                this.loading = false
+                                this.payStatus = 7
+                            }
+                            
                         }
                     }
                     

+ 52 - 8
src/views/windowTicketSales/ticketingSales.vue

@@ -70,8 +70,14 @@
           <el-button :loading="loading" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
         </el-form-item>
       </el-form>
-
-      <div class="seat-box">
+      <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">
             <!--  座位排版  -->
@@ -88,7 +94,7 @@
                          v-for="(item, index) in seatMapList[item1]" 
                          @click.stop="seatClick(item)" 
                          :key="index">
-                            <p class="text-class">{{item.name ? item.name : '暂未命名'}}</p>
+                            <p class="text-class">{{ item.status == 2 ? '不可售':(item.name ? item.name : '暂未命名') }}</p>
                         </div>
                     </div>
                 </div>
@@ -169,6 +175,7 @@
         lockOrUnLockLoading: false,
 
         performId: '',// 剧目ID
+        scaleNum: 30,
       };
     },
     created() {
@@ -381,7 +388,7 @@
                 }).catch((error) => {
                     console.log("error====",error)
                 });
-            }else if(row.isDisabled){
+            }else if(row.isDisabled || row.status == 2){
                 return false
             }else {
                 let flog = false;
@@ -439,11 +446,26 @@
     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% - 80px ) ;
+    height: calc( 100% - 100px ) ;
     box-sizing: border-box;
     display: flex;
+    position: relative;
     .seat-list-box {
         //width: calc(100% - 200px);
         width: 100%;
@@ -464,8 +486,24 @@
         }
     }
   }
+
+  .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: 0 30px;
+    padding: 30px 10px 10px;
     width: 100%;
     height: 100%;
     box-sizing: border-box;
@@ -501,12 +539,14 @@
     }
     .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;
+        // pointer-events: none;
+        cursor: not-allowed !important;
       }
       .select-class{
         //background-color: #e85353 !important;
@@ -537,6 +577,8 @@
         width: 100%;
         display: flex;
         flex-wrap: nowrap;
+        justify-content: center;
+        text-align: center;
       }
       .seat-item-class{
         flex-shrink: 0;
@@ -550,6 +592,8 @@
         cursor: pointer;
         position: relative;
         user-select: none;
+        // transform-origin: 50% 50%;
+        // transform: scale(var(--scaleNum));
         &:hover{
           opacity: 0.6;
         }