MONSTER-ygh 2 сар өмнө
parent
commit
39451602d5

+ 43 - 6
src/views/ticket/schedulingConfiguration/dialog/addAndEdit.vue

@@ -48,6 +48,7 @@
             placeholder="选择演出厅"
             clearable
             style="width: 100%"
+            @change="getInventoryTemplate"
           >
             <el-option
               v-for="dict in merchantList"
@@ -237,7 +238,7 @@ export default {
     /**  获取票务  */
     this.goodsPageList(); // 剧目列表
     this.merchantPageList('') // 演出厅
-    this.getInventoryTemplate()
+    //this.getInventoryTemplate()
   },
   methods: {
     /**
@@ -342,16 +343,29 @@ export default {
       }
     },
     /**  获取模板  */
-    async getInventoryTemplate(){
+    async getInventoryTemplate(value){
       try {
+        if(this.form.planSessionList && this.form.planSessionList.length > 0) {
+          let list = JSON.parse(JSON.stringify(this.form.planSessionList))
+          list.forEach((item,index)=>{
+            list[index].stockTmpId = null
+          })
+          this.$set(this.form,'planSessionList',list)
+        }
+        if(!value) {
+          this.inventoryTemplateList = []
+          return 
+        } 
         let res = await getInventoryTemplateApi({
-        pageNum: 1,
-        pageSize: 1000,
-      })
+          auditoriumId: value,
+          pageNum: 1,
+          pageSize: 1000,
+        })
         if(res.code == 200){
           this.inventoryTemplateList = res.data.rows
         }
-      } catch (error) {      
+      } catch (error) {   
+        console.error("error===",error)   
       }
     },
     /**
@@ -369,6 +383,10 @@ export default {
             postEdit.goodsIds = postEdit.goodsIds.join(',')
             postEdit.weekDay = postEdit.weekDay.join(','),
             delete postEdit.performDate
+            if(this.checkList(this.form.planSessionList)) {
+              this.$message.error("请完善场次信息!");
+              return
+            }
             this.loading = true;
             const { code } = await saveAndEdit({ ...postEdit });
             if (code === 200) {
@@ -384,6 +402,25 @@ export default {
         }
       });
     },
+    checkList(list){
+      let flog = false
+      if(list&&list.length>0) {
+        for (let index = 0; index < list.length; index++) {
+          let list2 = ['name', 'startInterval', 'endInterval', 'stockTmpId']
+          for (let i = 0; i < list2.length; i++) {
+            if(list[index].hasOwnProperty(list2[i]) && !list[index][list2[i]]) {
+              console.log(list[index].hasOwnProperty(list2[i]),list[index][list2[i]])
+              flog = true
+              break
+            }
+          }
+          if(flog) {
+            break
+          }
+        }
+      }
+      return flog
+    },
     /**
      * 重置
      * @date 2023-11-22

+ 1 - 0
src/views/windowTicketSales/rebook.vue

@@ -58,6 +58,7 @@
             <el-table-column label="剧目名称" align="center" prop="performName" />
             <el-table-column label="票务名称" align="center" prop="goodsName" />
             <el-table-column label="票档" align="center" prop="seatTypeName" />
+            <!-- <el-table-column label="座位信息" align="center" prop="seatTypeName1" /> -->
             <el-table-column label="日期" align="center" prop="performDate" />
             <el-table-column label="场次" align="center" prop="performInterval" />
             <el-table-column label="下单时间" align="center" prop="createTime" />