MONSTER-ygh 1 سال پیش
والد
کامیت
d1009c4961
2فایلهای تغییر یافته به همراه55 افزوده شده و 37 حذف شده
  1. 23 18
      src/views/officesale/model/increaseViewers.vue
  2. 32 19
      src/views/windowTicketSales/model/increaseViewers.vue

+ 23 - 18
src/views/officesale/model/increaseViewers.vue

@@ -339,7 +339,7 @@ import {
             this.loading = true
             this.actionIndex = null
             this.viewerList = []
-            let perform = await this.selectRegionFun(params)
+            let perform = await this.selectRegionFun(params,list[0].seatTypeId)
             console.log("perform===",perform)
             // let perform = {
             //     money: 1,
@@ -387,24 +387,29 @@ import {
                 })
                 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,
+                        if(JSON.stringify(obj) != '{}'){
+                            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,
                             }
-                        ]
-                        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
                         }
                     }else {
                         this.$message.error('存在座位未设置价格,请选择其他票!!!');

+ 32 - 19
src/views/windowTicketSales/model/increaseViewers.vue

@@ -346,7 +346,7 @@ import {
             this.loading = true
             this.actionIndex = null
             this.viewerList = []
-            let perform = await this.selectRegionFun(params)
+            let perform = await this.selectRegionFun(params,list[0].seatTypeId)
             console.log("perform===",perform)
             // let perform = {
             //     money: 1,
@@ -382,7 +382,7 @@ import {
             })
         },
         /**  获取票务信息  */
-        async selectRegionFun(params){
+        async selectRegionFun(params,seatTypeId){
             try {
                 this.loadingText = "获取票务信息中..."
                 let res = await selectRegion({
@@ -394,25 +394,38 @@ import {
                 })
                 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,
+                        //let obj = res.data.regionPriceList[0]
+                        let obj = {}
+                        res.data.regionPriceList.forEach((item,index)=>{
+                            if(seatTypeId == item.seatTypeId) {
+                                obj = item
                             }
-                        ]
-                        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,
+                        }) 
+                        if(JSON.stringify(obj) != '{}'){
+                            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
                         }
+                        
                     }else {
                         this.$message.error('存在座位未设置价格,请选择其他票!!!');
                         this.loading = false