浏览代码

1. 修复排序问题

MONSTER-ygh 1 年之前
父节点
当前提交
6e8bf0b2b1

+ 11 - 0
src/views/team/applicationMr/dialog/addAndEdit.vue

@@ -320,6 +320,11 @@ export default {
           this.$set(this.form, 'teamName', item.name)
         }
       })
+      this.$set(this.form, 'goodsId', '')
+      this.$set(this.form, 'goodsName', '')
+      this.$set(this.form, 'seatTypeId', '')
+      this.$set(this.form, 'price', '')
+      this.selectRegionFun()
     },
     /** 场馆选择 */
     changeTheatre(id) {
@@ -331,6 +336,7 @@ export default {
       this.$set(this.form, 'auditoriumId', '')
       this.$set(this.form, 'performId', '')
       this.$set(this.form, 'goodsId', '')
+      this.$set(this.form, 'goodsName', '')
       this.$set(this.form, 'seatTypeId', '')
       this.$set(this.form, 'price', '')
       this.$set(this.form, 'performDate', '');
@@ -475,6 +481,7 @@ export default {
     /** 选择场次 */ 
     performTimeIdEven(val){
       this.$set(this.form, 'goodsId', '');
+      this.$set(this.form, 'goodsName', '')
       this.$set(this.form, 'seatTypeId', '');
       this.$set(this.form, 'price', '')
 
@@ -616,7 +623,11 @@ export default {
     },
     async selectRegionFun(){
       try {
+        if(!this.form.teamId||!this.form.auditoriumId||!this.form.performId||!this.form.performTimeId){
+          return
+        }
         let res = await selectRegionApi({
+          "teamId": this.form.teamId,
           "auditoriumId": this.form.auditoriumId,
           "performId": this.form.performId,
           "performTimeId": this.form.performTimeId,

+ 25 - 2
src/views/team/applicationMr/dialog/applicationDetails.vue

@@ -250,11 +250,34 @@ export default {
     // 设置座位集合
     setSeatMapList(list) {
       if(list && list.length > 0) {
+        let listCopy = {}
         list.forEach(item => {
           item.isDisabled = (item.occupyStatus != null && (item.occupyStatus == 0 || item.occupyStatus == 1) ? true : false); // 座位是否已被选择
           item.isSelect = false;
-          this.seatMapList.push(item)
+          if(!listCopy['key_'+item.rowNo]) {
+            listCopy['key_'+item.rowNo] = [item]
+          }else {
+            listCopy['key_'+item.rowNo].push(item)
+          }
+          
+          //this.seatMapList.push(item)
+        })
+        let listCopy2 = Object.keys(listCopy)
+        let listCopy3 = []
+        listCopy2.forEach((item)=>{
+          listCopy3.push({
+            key: item,
+            sort: Number(item.replace('key_',''))
+          })
+        })
+        listCopy3.sort((a,b)=>{
+          return a.sort - b.sort
+        })
+        let listCopy1 = []
+        listCopy3.forEach((item,index)=>{
+          listCopy1 = listCopy1.concat(listCopy[item.key])
         })
+        this.seatMapList = [].concat(listCopy1)
       }
     },
     // 座位点击事件
@@ -289,7 +312,7 @@ export default {
       this.seatMapList = [];
       this.seatSelectList = [];
       this.getSeatApi();
-      this.setSeatMapList()
+      //this.setSeatMapList()
     },
     /**
      * 保存