浏览代码

1. 调整票务的限制

MONSTER-ygh 1 年之前
父节点
当前提交
67a3cba4ef
共有 2 个文件被更改,包括 107 次插入46 次删除
  1. 9 0
      src/api/team/applicationMr.js
  2. 98 46
      src/views/team/applicationMr/dialog/addAndEdit.vue

+ 9 - 0
src/api/team/applicationMr.js

@@ -94,4 +94,13 @@ export function downloadModel(query) {
     responseType: 'blob',
     params: query
   })
+}
+
+// 选择区域
+export const selectRegionApi = (data) => {
+  return request({
+    url: '/merchant/merchantTheatreAuditorium/selectRegion',
+    method: 'post',
+    data: data
+  })
 }

+ 98 - 46
src/views/team/applicationMr/dialog/addAndEdit.vue

@@ -17,7 +17,7 @@
     @close="cancel"
   >
     <div class="dialog">
-      <el-form :model="form" ref="form" :rules="rules" label-width="120px">
+      <el-form :model="form" ref="form" size="mini" :rules="rules" label-width="120px">
         <el-form-item label="选择团队:" prop="teamId">
           <el-select
             v-model="form.teamId"
@@ -83,6 +83,32 @@
             />
           </el-select>
         </el-form-item>
+
+        <el-form-item label="选择日期"  prop="performDate">
+          <el-date-picker
+            v-model="form.performDate"
+            type="date"
+            @change="performDateEven"
+            value-format="yyyy-MM-dd"
+            placeholder="选择日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="预约场次:" prop="performTimeId">
+          <el-select
+            v-model="form.performTimeId"
+            placeholder="预约场次"
+            clearable
+            style="width: 100%;"
+            @change="performTimeIdEven"
+          >
+            <el-option
+              v-for="dict in performTimeList"
+              :key="dict.id"
+              :label="dict.timeSnapshot + '场次: ' + dict.performDate + ' 开始时间' + dict.performTimeStart + ', 结束时间' + dict.performTimeEnd"
+              :value="dict.id"
+            />
+          </el-select>
+        </el-form-item>
         <el-form-item label="票务管理:" prop="goodsId">
           <el-select
             v-model="form.goodsId"
@@ -95,7 +121,7 @@
               v-for="dict in ticketList"
               :key="dict.id"
               :label="dict.goodsName"
-              :value="dict.goodsId"
+              :value="dict.id"
             />
           </el-select>
         </el-form-item>
@@ -128,30 +154,7 @@
             <template slot="append">元/人</template>
           </el-input>
         </el-form-item>
-        <el-form-item label="选择日期"  prop="performDate">
-          <el-date-picker
-            v-model="form.performDate"
-            type="date"
-            @change="performDateEven"
-            value-format="yyyy-MM-dd"
-            placeholder="选择日期">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="预约场次:" prop="performTimeId">
-          <el-select
-            v-model="form.performTimeId"
-            placeholder="预约场次"
-            clearable
-            style="width: 100%;"
-          >
-            <el-option
-              v-for="dict in performTimeList"
-              :key="dict.id"
-              :label="dict.timeSnapshot + '场次: ' + dict.performDate + ' 开始时间' + dict.performTimeStart + ', 结束时间' + dict.performTimeEnd"
-              :value="dict.id"
-            />
-          </el-select>
-        </el-form-item>
+        
         <el-form-item label="观影人员:" prop="viewerList">
           <el-upload
             class="upload-demo"
@@ -196,7 +199,7 @@
 </template>
 
 <script>
-import { saveAndEdit, getSelectById, uploadExcel, queryPrice,downloadModel } from "@/api/team/applicationMr";
+import { saveAndEdit, getSelectById, uploadExcel, queryPrice,downloadModel,selectRegionApi } from "@/api/team/applicationMr";
 import { pagePerformTimeList } from '@/api/schedulingMr/schedulingMr'
 import Editor from "@/components/Editor";
 import { getToken } from "@/utils/auth";
@@ -238,6 +241,7 @@ export default {
         teamPersonNum: [{ required: true, message: "请输入人数", trigger: ["change","blur"] }],
         performTimeId: [{ required: true, message: "请选择预约场次", trigger: ["change","blur"] }],
         viewerList: [{ required: true, message: "请上传观影人员excel", trigger: ["change","blur"] }],
+        performDate: [{ required: true, message: "请选择日期", trigger: ["change","blur"] }]
       },
       uploadObj: {
         url: process.env.VUE_APP_UPLOAD_FILE_API + "/upload/single/minio",
@@ -319,7 +323,6 @@ export default {
     },
     /** 场馆选择 */
     changeTheatre(id) {
-      this.merchantPageList(id)
       this.theatreList.forEach(item => {
         if(id == item.id){
           this.$set(this.form, 'theatreName', item.name)
@@ -332,6 +335,13 @@ export default {
       this.$set(this.form, 'price', '')
       this.$set(this.form, 'performDate', '');
       this.$set(this.form, 'performTimeId', '');
+
+      this.merchantList = [] // 演出厅
+      //this.goodsList = [] // 剧目
+      this.performTimeList = [] // 场次
+      this.ticketList = [] // 票务
+      this.seatList = [] // 座位类型
+      this.merchantPageList(id) // 获取演出厅
     },
     /** 演出厅选择 */
     auditoriumChange(id) {
@@ -346,7 +356,12 @@ export default {
           this.$set(this.form, 'auditoriumName', item.name)
         }
       })
-      this.getPerformTimeList();
+
+      // this.goodsList = [] // 剧目
+      this.performTimeList = [] // 场次
+      this.ticketList = [] // 票务
+      this.seatList = [] // 座位类型
+      //this.getPerformTimeList();
     },
     /** 演出厅列表查询 */
     merchantPageList(id) {
@@ -426,7 +441,7 @@ export default {
         return false
       }
     },
-    // 剧目改变事件
+    /**  剧目改变事件  */ 
     performChangeEven(val) {
       this.seatList = [];
       this.ticketList = [];
@@ -440,37 +455,60 @@ export default {
           this.$set(this.form, 'performName', item.name)
         }
       })
-      this.ticketListApi(val);
-      this.getPerformTimeList()
+      // this.ticketListApi(val); // 获取票务
+      // this.getPerformTimeList(); // 场次
     },
-    // 票务改变事件
-    goodsChangeEven(id) {
-      this.seatList = [];
+   
+    // 预约时间
+    performDateEven() {
+      console.log("获取场次====")
+      this.$set(this.form, 'performTimeId', '')
+
+      this.$set(this.form, 'goodsId', '');
+      this.$set(this.form, 'seatTypeId', '');
+      this.$set(this.form, 'price', '')
+      this.performTimeList = [] // 场次
+      this.ticketList = [] // 票务
+      this.seatList = [] // 座位类型
+      this.getPerformTimeList(); // 获取场次
+    },
+    /** 选择场次 */ 
+    performTimeIdEven(val){
+      this.$set(this.form, 'goodsId', '');
+      this.$set(this.form, 'seatTypeId', '');
+      this.$set(this.form, 'price', '')
+
+      this.ticketList = [] // 票务
+      this.seatList = [] // 座位类型
+
+      this.selectRegionFun()
+    },
+     // 票务改变事件
+     goodsChangeEven(id) {
+      let list = []
       this.ticketList.forEach(item => {
-        if(item.goodsId == id){
+        if(item.id == id){ // item.goodsId == id
           this.$set(this.form, 'goodsName', item.goodsName)
+          list = item.regionList
         }
       })
       this.$set(this.form, 'price', '');
       this.$set(this.form, 'seatTypeId', '');
-
-      let selectMap = {goodsId: this.form.goodsId, performId: this.form.performId}
-      this.getSeatTypeList(selectMap);
+      this.seatList = [];
+      console.log("ffffffffff=====",list)
+      //let selectMap = {goodsId: this.form.goodsId, performId: this.form.performId}
+      //this.getSeatTypeList(selectMap); 获取走位
+      this.seatList = [].concat(list)
     },
     // 座位类型改变事件
     seatChangeEven(val) {
       this.seatList.forEach(item =>{
         if(item.seatTypeId == val){
           this.$set(this.form, 'seatTypeName', item.seatTypeName);
-          this.$set(this.form, 'price', item.priceAmount);
+          this.$set(this.form, 'price', item.salePrice);
         }
       })
-      this.queryPriceApi();
-    },
-    // 预约时间
-    performDateEven() {
-      this.$set(this.form, 'performTimeId', '')
-      this.getPerformTimeList();
+      //this.queryPriceApi();
     },
     /**
      * 保存
@@ -574,6 +612,20 @@ export default {
 
       } catch (error) {
         
+      }
+    },
+    async selectRegionFun(){
+      try {
+        let res = await selectRegionApi({
+          "auditoriumId": this.form.auditoriumId,
+          "performId": this.form.performId,
+          "performTimeId": this.form.performTimeId,
+        })
+        if( res.code == 200 ) {
+          this.ticketList = res.data.goodsList
+        }
+      } catch (error) {
+        
       }
     }
   },