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

+ 10 - 0
src/api/windowTicketSales/ticketingSales.js

@@ -1,4 +1,5 @@
 import request from '@/utils/request'
+import { param } from 'jquery'
 
 // 座位列表
 export const querySeatList = (query) => {
@@ -121,4 +122,13 @@ export const factorAuth = (query) => {
     method: 'post',
     data: query
   })
+}
+
+// 获取票务限购参数
+export const getGoodsPerformApi = (query) => {
+  return request({
+    url: '/goods/goodsPerform/selectByGoodsId',
+    method: 'get',
+    params: query
+  })
 }

+ 25 - 6
src/views/windowTicketSales/model/increaseViewers.vue

@@ -97,8 +97,8 @@
                 <el-table-column
                     label="应付金额(元)">
                     <template slot-scope="scope">
-                        <!-- <span>{{ scope.row.realPrice }}</span> -->
-                        <div>
+                        <span v-if="(scope.$index!=0 && oneMany ==1 && personnelNum != 0)">{{ scope.row.realPrice }}</span>
+                        <div v-else>
                             <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>
@@ -118,7 +118,7 @@
                     label="操作"
                     width="80"
                     >
-                    <template slot-scope="scope">
+                    <template slot-scope="scope" v-if="(scope.$index != 0 && oneMany!=2) || scope.$index == 0">
                         <el-button
                         size="mini"
                         type="success"
@@ -326,12 +326,21 @@ import {
 
         // 身份证校验 loading
         factorAuthLoading: false,
+
+        ifRealUser: 0,  // 散客是否实名:0-否 1-是
+        ifRealTeam: 0,   // 团购是否实名:0否 1-是
+        oneMany: 1,   // 证件要求: 1一证一票,2一证多票
+        personnelNum: 0,   // 人员要求:0-表示不限制 其他数字表示限制人数
       };
       
     },
     methods: {
         async initData(list,params){
             try {
+                this.ifRealUser = params.ifRealUser  // 散客是否实名:0-否 1-是
+                this.ifRealTeam = params.ifRealTeam   // 团购是否实名:0否 1-是
+                this.oneMany = params.oneMany   // 证件要求: 1一证一票,2一证多票
+                this.personnelNum = params.personnelNum   // 人员要求:0-表示不限制 其他数字表示限制人数
                 this.websocketClear()
                 this.idcardLoading = false
                 this.ruleForm = {
@@ -374,8 +383,8 @@ import {
                         idcard: '', // 身份证
                         identity: '', // 观影人身份
                         remark: '', // 备注信息
-                        salePrice: perform.money, // 原价
-                        realPrice: perform.money, // 实付金额
+                        salePrice: this.oneMany == 2 || (this.oneMany == 1 && this.personnelNum != 0)  ? index == 0 ? perform.money  : 0 : perform.money, // 原价
+                        realPrice: this.oneMany == 2 || (this.oneMany == 1 && this.personnelNum != 0)  ? index == 0 ? perform.money  : 0 : perform.money, // 实付金额
                         seatId: item.id, // 座位ID
                         seatName: item.name?item.name:'暂无命名', // 座位名称
                         seatType: perform.seatTypeId, // 座位类型
@@ -519,7 +528,17 @@ import {
             }
         
             //this.factorAuthFun(index,this.tableForm)
-            this.$set(this.viewerList,index,JSON.parse(JSON.stringify(this.tableForm)))
+            if(this.oneMany == 2 && index==0) {
+                this.$set(this.viewerList,index,JSON.parse(JSON.stringify(this.tableForm)))
+                let list = JSON.parse(JSON.stringify(this.viewerList))
+                list.forEach((item,index)=>{
+                    item.name = this.tableForm.name
+                    item.idcard = this.tableForm.idcard
+                })
+                this.viewerList = list
+            }else {
+                this.$set(this.viewerList,index,JSON.parse(JSON.stringify(this.tableForm)))
+            }
             this.actionIndex = null
             this.setMoneyAll()
         },

+ 55 - 4
src/views/windowTicketSales/ticketingSales.vue

@@ -199,6 +199,7 @@
   lockOrUnLock,
   merchantTheatreAuditoriumList,
   goodsPageList,
+  getGoodsPerformApi
  } from '@/api/windowTicketSales/ticketingSales'
  import increaseViewers from "./model/increaseViewers"
  import moment from "moment"
@@ -253,8 +254,13 @@
         width: 0,
         justifyContent: false,
         activeName: 'first',
-        seatTypeList: [],
+        seatTypeList: [],   
         
+        // 限购条件
+        ifRealUser: 0,// 散客是否实名:0-否 1-是
+        ifRealTeam: 0,// 团购是否实名:0否 1-是
+        oneMany: 0,// 证件要求: 1一证一票,2一证多票
+        personnelNum: 0,// 人员要求:0-表示不限制 其他数字表示限制人数
       };
     },
     created() {
@@ -494,8 +500,6 @@
                     this.goodsPageListS = []
                 }
             }
-
-
             this.changeTimeCheck(value,type)
 
         },
@@ -513,6 +517,14 @@
                 //  获取场次
                 this.merchantPerformTimeListFun()
             }
+            if(type == 'goodsId'){
+                this.getGoodsPerformFun(value)
+            }else {
+                this.ifRealUser = 0  // 散客是否实名:0-否 1-是
+                this.ifRealTeam = 0   // 团购是否实名:0否 1-是
+                this.oneMany = 1   // 证件要求: 1一证一票,2一证多票
+                this.personnelNum = 0   // 人员要求:0-表示不限制 其他数字表示限制人数
+            }
             this.performId = ''
             this.seatSelectList = []
             this.seatMapList = {}
@@ -626,10 +638,23 @@
         },
         increaseViewersFun(){
             if(this.seatSelectList.length>0){
+                if(this.ifRealUser != 0 || this.ifRealTeam != 0 ) {
+                    if(this.personnelNum != 0) {
+                        if( this.seatSelectList.length != this.personnelNum ) {
+                            this.$message.error(`票务类型设置了实名要求,选择人数为${ this.personnelNum }人`);
+                            return
+                        }
+                    }
+                }
+
                 this.changePerformId(this.queryParams.timeId)
                 this.$refs.increaseViewers.initData(this.seatSelectList,{
                     ...this.queryParams,
-                    performId:this.performId
+                    performId:this.performId,
+                    ifRealUser: this.ifRealUser,  // 散客是否实名:0-否 1-是
+                    ifRealTeam: this.ifRealTeam,   // 团购是否实名:0否 1-是
+                    oneMany: this.oneMany,   // 证件要求: 1一证一票,2一证多票
+                    personnelNum: this.personnelNum,   // 人员要求:0-表示不限制 其他数字表示限制人数
                 })
             }else {
                 this.$alert('请先选择座位!!!', '提示', {
@@ -672,6 +697,32 @@
 
             return srt
         },
+
+        //  获取限购标准
+        async getGoodsPerformFun(id){
+            try {
+                let res = await getGoodsPerformApi({
+                    goodsId: id
+                })
+                if(res.code == 200) {
+                    this.ifRealUser = res.data.ifRealUser  // 散客是否实名:0-否 1-是
+                    this.ifRealTeam = res.data.ifRealTeam   // 团购是否实名:0否 1-是
+                    this.oneMany = res.data.oneMany   // 证件要求: 1一证一票,2一证多票
+                    this.personnelNum = res.data.personnelNum   // 人员要求:0-表示不限制 其他数字表示限制人数
+                }else {
+                    this.ifRealUser = 0  // 散客是否实名:0-否 1-是
+                    this.ifRealTeam = 0   // 团购是否实名:0否 1-是
+                    this.oneMany = 1   // 证件要求: 1一证一票,2一证多票
+                    this.personnelNum = 0   // 人员要求:0-表示不限制 其他数字表示限制人数 
+                }
+                
+            } catch (error) {
+                this.ifRealUser = 0  // 散客是否实名:0-否 1-是
+                this.ifRealTeam = 0   // 团购是否实名:0否 1-是
+                this.oneMany = 1   // 证件要求: 1一证一票,2一证多票
+                this.personnelNum = 0   // 人员要求:0-表示不限制 其他数字表示限制人数
+            }
+        }
     }   
   };
   </script>