Sfoglia il codice sorgente

1. 优化选座问题

MONSTER-ygh 2 mesi fa
parent
commit
7eaa3e98d4

+ 20 - 10
src/components/seatBox/index.vue

@@ -309,6 +309,10 @@
         // 座位点击事件
         seatClick(row) {
             console.log("是的发给我大是个的风格====",row,this.seatTypeLimit)
+            if(!row.seatTypeId){
+                this.$message.error('未设置的座位不可售卖!!!');
+                return
+            }
             if(row.isDisabled || row.status == 2){
                 return false
             }
@@ -426,27 +430,33 @@
 
         /**  设置显示状态  */
         setShowStatus(item1,item) {
-            if(item.isSame) {
-                return 'seat_is_same'
-            }
-
-            if(item.channelType && item.channelType != 'window') {
-                return 'seat_channel_type'
-            }
+            let str = ''
             /**
-             * key == my_column 序号位置
+             * key == my_column 排和列的 序号位置
              * 
-             * occupyStatus 0 
+             * occupyStatus  null-表示未占用,0-锁定 1-占用
              * 
              * occupyOrderId  // 订单待支付锁定 
              * 
+             * status 0-初始(该状态下不C端显示) 1-可用 2-不可用
+             * 
              */
-            return  item1.key == 'my_column'?'seat-item-class-column':
+            str =  item1.key == 'my_column'?'seat-item-class-column':
                     item.occupyStatus===0?item.occupyOrderId?'order-occupy-status':
                     item.occupyStatus===0&&item.isSelect?'occupy-status-select occupy-status':
                     'occupy-status': item.occupyStatus==1?'occupy-status-no':
                     item.isDisabled || item.status != 1 ? 'disabled-class' :
                     item.isSelect ? 'select-class' : ''
+            if(!str) {
+                if(item.isSame) { // 是否为可选的座位类型
+                    str = 'seat_is_same'
+                }
+
+                if(item.channelType && item.channelType != 'window') { // 是否属于窗口售卖座位
+                    str = 'seat_channel_type'
+                }
+            }
+            return str  
         }
     }   
   };

+ 28 - 1
src/components/seatBox/mixins/selectList.js

@@ -134,7 +134,11 @@ export default {
             this.moveSelected.style.right='0px';
         },
 
-        /**  批量判断元素的位置  */
+        /**  
+         * 批量判断元素的位置
+         * 
+         * 拖动选择多个座位
+         * */
         getSelectItem(){
             let list = document.getElementsByClassName('seat-item-class')
             let listCopy = []
@@ -176,6 +180,17 @@ export default {
                     flog = true
                     break;
                 }
+
+                if(!row.seatTypeId){
+                    this.$message.error('未设置的座位不可售卖!!!');
+                    flog = true
+                    return
+                }
+
+                if(this.seatTypeLimit['seatNum_'+row.seatTypeId].isNoSelect){
+                    this.$message.error('该座位类型不可选!!!');
+                    return
+                }
             }
             if(flog){
                 return
@@ -191,6 +206,7 @@ export default {
                     }
                 }
             }
+
             if(flog){
                 return
             }
@@ -218,6 +234,7 @@ export default {
                     }
                 }
             })
+
             if(flog && this.isOccupyStatus){
                 this.$message.error('只能选同一类型的座位');
                 return
@@ -234,6 +251,16 @@ export default {
                 return
             }
 
+            /** 
+             * 
+             * 
+             * 
+            */
+            if( listCopy1.length > this.seatTypeLimit['seatNum_'+listCopy1[0].seatTypeId].stockTotal-this.seatTypeLimit['seatNum_'+listCopy1[0].seatTypeId].stockYes ) {
+                this.$message.error('选择的座位类型已超过库存!!!');
+                return
+            }
+
             listCopy.forEach((item,index)=>{
                 this.seatMapListKey.forEach((item1,index1)=>{
                     this.seatMapList[item1.key].forEach((item,index)=>{

+ 145 - 659
src/views/team/applicationMr/dialog/applicationDetails.vue

@@ -64,7 +64,7 @@
 
 
         <!--   观影人员信息   -->
-        <div class="title-class">观影人员信息</div>
+        <div class="title-class">观影人员信息-{{ details.viewersList.length }}人</div>
         <el-row>
           <el-col :span="24">
             <el-table size="mini" ref="tables" :data="details.viewersList" border>
@@ -76,86 +76,12 @@
         </el-row>
       </div>
       <div class="dialog-bbb_2" v-if="detailsType">
-        <div class="seat-tool-box">
-          <span class="demonstration">座位大小</span>
-          <div class="seat-tool-box-slider">
-              <el-slider 
-              v-model="scaleNum" 
-              :min="30" 
-              :max="100"
-              @change="scaleNumChange"
-              ></el-slider>
-          </div>
-          <div style="display: flex;margin-left: 20px;" v-if="seatMapList&&JSON.stringify(seatMapList) != '{}'">
-              <div>座位余量:</div>
-              <div
-              :key="index" 
-              v-for="(item,index) in seatTypeList"
-              style="margin-left: 10px;align-items: center;"
-              >
-                  <span :style="{color: item.color?item.color:'none'}">{{item.name ? (item.name+'(剩余:'+ (item.num||0) +')') : '暂未命名'}}</span>
-              </div>
-          </div>
-        </div>
-        <div class="seat-box" :style="{'--scaleNum': scaleNum/100}">
-          <!-- 选择座位  -->
-          <div 
-          class="seat-list-box">
-              <!--  座位排版  -->
-              <div  
-              id="sm-scroll-box_1" 
-              ref="seatbox" 
-              class="dialogss"
-              @mousedown="mousedownFun"
-              @mouseleave="mouseleaveFun"
-              >
-                  <div class="dialogss-box" :style="{width: width*(scaleNum/100) + 'px', margin: justifyContent ? 'auto' : 'unset'}">
-                      <div 
-                      style="width: 100%;position: absolute;"
-                      class="seat-box-class clearfix" 
-                      v-if="seatMapList"
-                      >
-                              <div
-                            
-                              class="seat-item-class-box" 
-                              v-for="(item1, index1) in seatMapListKey" 
-                              :key="item1.key"
-                              >
-                                  <!-- @click.stop="seatClick(item)"   -->
-                                  <div 
-                                  class="seat-item-class seat-item-class_1" 
-                                  :class="setSeatClass(item)"
-                                  v-for="(item, index) in seatMapList[item1.key]" 
-                                  :style="{backgroundColor: item.color ? item.color : 'none'}"
-                                  :dragSelectId="item.id"
-                                  :index="item1.key +'_'+ index"
-                                   
-                                  :key="index">
-                                      <p 
-                                      class="text-class"
-                                      :dragSelectId="item.id"
-                                      :index="item1.key +'_'+ index"
-                                      >{{ item.status != 1 ? '不可售':(item.name ? item.name : '暂未命名') }}</p>
-                                  </div>
-                              </div>
-                      </div>
-                  </div>
-                  
-
-                  <!-- 鼠标拖拽出的遮罩 (定位为 position:absolute)-->
-                <!-- 遮罩最好是在绑定了mouseover事件的元素内部,并且不要阻止遮罩的冒泡事件。这样鼠标移到了遮罩上面,依然可以利用冒泡执行父元素的mouseover事件,就不会出现遮罩只能扩大,不能缩小的情况了(亲自试过) -->
-                <div id="moveSelected_1"></div>
-              </div>
-              <div style="margin-top: 5px; margin-left: 30px;display: flex;">
-                  <div style="flex-shrink: 0;">
-                      已勾选:{{ seatSelectList.length }}个座位
-                      <el-button size="mini" type="warning"  @click="clearSeatSelectListAll">清空已选座位</el-button>
-                  </div>
-              </div>
-
-              
-          </div>
-        </div>
+        <seatBox 
+          ref="seatBox" 
+          :seatTypeLimit="configStockNumObj"
+          @selectSeat="selectSeat"
+          height="100%"
+          />
       </div>
     </div>
 
@@ -164,7 +90,6 @@
     </span>
 
     <span slot="footer" class="dialog-footer" v-if="detailsType">
-      <!-- <el-button type="primary" @click="passOpenEven" style="margin-right: 20px">通过</el-button> -->
       <el-button
         type="primary"
         @click="submitPass"
@@ -215,65 +140,34 @@
       </el-button>
     </span>
     </el-dialog>
-
-    <!--  审核通过  -->
-    <el-dialog
-      title="选择座位"
-      :visible.sync="passOpen"
-      width="910px"
-      append-to-body
-      :close-on-click-modal="false"
-      @close="passOpen = false"
-    >
-      <!--  座位排版  -->
-      <div class="dialog">
-        <div class="seat-box-class1 clearfix" v-if="seatMapList && seatMapList.length > 0">
-          <div class="seat-item-class" :class="item.isDisabled ? 'disabled-class' : item.isSelect ? 'select-class' : ''" v-for="(item, index) in seatMapList" @click="seatClick(item)" :key="index">
-            <p class="text-class">{{item.name ? item.name : (item.rowNo + '排' + item.columnNo + '座')}}</p>
-          </div>
-        </div>
-      </div>
-      <div style="margin-top: 5px; margin-left: 30px">已勾选:{{ seatSelectList.length }}个座位</div>
-      <span slot="footer" class="dialog-footer">
-      <el-button @click="passOpen = false">取消</el-button>
-      <el-button
-        type="primary"
-        @click="submitPass"
-        v-loading.fullscreen.lock="passLoading"
-        element-loading-text="提交中..."
-        element-loading-spinner="el-icon-loading"
-        element-loading-background="rgba(0, 0, 0, 0.8)"
-      >
-        <span v-if="passLoading">提交中...</span>
-        <span v-else>保存</span>
-      </el-button>
-    </span>
-    </el-dialog>
-
   </el-dialog>
 </template>
 
 <script>
 import { getSelectById, teamApplyAudit, querySeatList } from '@/api/team/applicationMr'
-import { updateStatus } from '@/api/team/ticketMr'
+import { 
+  querySeatListNew,
+ } from '@/api/windowTicketSales/ticketingSales'
+import { countBySeatTyp } from '@/api/ticketMr/InventoryTemplate'
 import { pageList as getSeatType } from '@/api/seatTypeMr/seatTypeMr'
-import selectListMixin from "../mixins/selectList"
+import seatBox from '@/components/seatBox/index.vue';
 export default {
   name: "applicationDetails",
+  components: {
+    seatBox
+  },
   props: {
     dict: {
       type: Object,
       default: () => [],
     },
   },
-  mixins: [selectListMixin],
   data() {
     return {
       title: "编辑",
       model: "EDIT",
       open: false,
-      rejectOpen: false,
-      passOpen: false,
+      
       initLoading: false,
       loading: false,
       passLoading: false,
@@ -284,15 +178,17 @@ export default {
       performerVisible: false,
       performerList: [],
       refund: false,
+      // 驳回表单
+      rejectOpen: false,
       rejectRules: {
         errReason: [{ required: true, message: "请输入驳回原因", trigger: ["change","blur"] }],
       },
-      dataList: [],
       rejectForm: {
         status: 2
       },
       detailsType: false,
-      //seatMapList: [], // 座位集合
+
+
       applyId: '', // 申请单id
       applyMap: {},
       //setList: [],
@@ -317,6 +213,12 @@ export default {
         justifyContent: false,
         activeName: 'first',
         seatTypeList: [],
+      
+        configStockNumObj: {},
+        countBySeatTypList:[],
+        seatTypeListAll: [],
+        seatLoading: false,
+        seatLoadText: '获取座位中...',
     };
   },
   created() {
@@ -329,28 +231,68 @@ export default {
      * @param {any} obj
      * @returns {any}
      */
-    openDialog(title, obj, type) {
-      this.initLoading = true
-      this.open = true;
-      this.rejectOpen = false;
-      this.passOpen = false;
-      this.applyId = obj.id;
-      this.applyMap = obj;
-      this.querySeatListS = [];
-      this.setList = [];
-      this.seatSelectList = [];
-      this.flag = false
-      this.isMousemovs = false
-      if(type) {
-        this.detailsType = true
-        this.title = '审核'
-        
-      } else {
-        this.detailsType = false
-        this.title = '详情'
+    async openDialog(title, obj, type) {
+      try {
+        this.initLoading = true
+        this.open = true;
+        this.rejectOpen = false;
+        this.applyId = obj.id;
+        this.applyMap = obj;
+        this.querySeatListS = [];
+        this.setList = [];
+        this.seatSelectList = [];
+        this.flag = false
+        this.isMousemovs = false
+        if(type) {
+          this.detailsType = true
+          this.title = '审核'
+          
+        } else {
+          this.detailsType = false
+          this.title = '详情'
+        }
+        await this.countBySeatTypFun(obj.auditoriumId)
+        await this.getSelectByIdApi(obj);
+        this.initLoading = false
+      } catch (error) {
+        this.initLoading = false
       }
       
-      this.getSelectByIdApi(obj);
+    },
+    /** 获取全部座位类型 */
+    getSeatTypeList() {
+      getSeatType({
+        pageNum: 1,
+        pageSize: 999,
+      })
+      .then(response => {
+        this.seatTypeList = response.data.rows;
+      });
+    },
+    /** 获取剧目的座位类型  */
+    async countBySeatTypFun(value) {
+      try {
+        if(!value) return
+        let res = await countBySeatTyp({auditoriumId: value})
+        this.countBySeatTypList = res.data ? res.data : []
+        let obj = {}
+        this.countBySeatTypList.forEach((item,index)=>{
+          obj['seatNum_'+item.seatTypeId] = {
+            stockTotal: item.stock,
+            stockSelect: item.stock,
+            stockYes: item.stock,
+            stockNo: 0,
+            isNoSelect: true,
+          }
+          if(item.seatTypeId == this.applyMap.seatTypeId){
+            obj['seatNum_'+item.seatTypeId].stockYes = item.stock-this.applyMap.viewerNum
+            obj['seatNum_'+item.seatTypeId].isNoSelect = false
+          }
+        })
+        this.configStockNumObj = obj
+      } catch (error) {
+        console.error("error1====",error)
+      }
     },
     /** 获取详情 */
     async getSelectByIdApi(row) {
@@ -360,23 +302,35 @@ export default {
         this.details = {}
         this.details = res.data;
         if(this.detailsType){
-          let res1 = await querySeatList({
+          let res1 = await querySeatListNew({
             auditoriumId: this.applyMap.auditoriumId,
-            //seatTypeId: this.applyMap.seatTypeId,
             timeId: this.applyMap.performTimeId,
+            goodsId: this.applyMap.goodsId,
           })
-          this.querySeatListS = res1.data;
-          this.setList = res1.data;
-          if(this.setList && this.setList.length > 0) {
-            this.setSeatMapListCopy(this.setList);
-          }
-          this.$nextTick(()=>{
-            this.scaleNumChange()
+          let list1 = []
+          res1.data.forEach((item,index)=>{
+            list1.push({
+              ...item,
+              isSame: item.seatTypeId != this.applyMap.seatTypeId
+            })
+          })
+          this.setList = list1;
+          let list = []
+          let list3 = []
+          this.countBySeatTypList.forEach((item,index)=>{
+            list3.push(item.seatTypeId)
+          })
+          let list4 = []
+          this.seatTypeList.forEach((item,index)=>{
+            if(list3.includes(item.id)) {
+              list4.push({...item})
+            }
+          })
+          this.$nextTick(() =>{
+            this.$refs.seatBox.querySeatListFun(true,this.setList,list,list4)
           })
         }
-        this.initLoading = false
       } catch (error) {
-        this.initLoading = false
       }
       
     },
@@ -394,158 +348,12 @@ export default {
         }
       });
     },
-    // 设置座位集合
-    setSeatMapList(list) {
-      if(list && list.length > 0) {
-        let listCopy = {}
-        list.forEach(item => {
-          item.isDisabled = item.status!=1||((item.occupyStatus != null && (item.occupyStatus == 0 || item.occupyStatus == 1)) ? true : false); // 座位是否已被选择
-          item.isSelect = false;
-          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)
-      }
-    },
-    // 座位点击事件
-    seatClickCopy(rowCopy) {
-      let row = JSON.parse(JSON.stringify(rowCopy))
-      console.log("row111===",row)
-            if(row.occupyStatus == 0){
-                console.log("weqwrwerewrer")
-                this.$confirm('此座已被锁定,请先解锁', '提示', {
-                    confirmButtonText: '关闭',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    //this.lockOrUnLockFun([row],1)
-                }).catch((error) => {
-                    console.log("error====",error)
-                });
-            }else if(row.isDisabled || row.status == 2){
-                return false
-            }else {
-                if(this.applyMap.seatTypeId != row.seatTypeId){
-                    this.$message.error('只能选同一类型的座位');
-                    return false
-                }
-                row.isSelect = !row.isSelect
-                if(row.isSelect){
-                  if(this.seatSelectList.length >= this.details.viewersList.length ){
-                    this.$message.error("观影人数限制" + this.details.viewersList.length + "人!");
-                    return false
-                  }
-                  this.seatSelectList.push(JSON.parse(JSON.stringify(row)))
-                }else {
-                  let indexs = null;
-                    this.seatSelectList.forEach((item, index) =>{
-                      if(item.id == row.id){
-                        indexs = index;
-                      }
-                    })
-                    if(indexs != null) {
-                      this.seatSelectList.splice(indexs, 1)
-                    }
-                }
-                
-                //this.seatSelectList = this.setList.filter(item => item.isSelect);
-                console.log("this.seatSelectList===",this.seatSelectList)
-                //this.$forceUpdate()
-                return true
-            }
-            
-    },
-    seatClick(row) {
-            console.log("row===",row)
-            if(row.occupyStatus == 0){
-                console.log("weqwrwerewrer")
-                this.$confirm('此座已被锁定,请先解锁', '提示', {
-                    confirmButtonText: '关闭',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    //this.lockOrUnLockFun([row],1)
-                }).catch((error) => {
-                    console.log("error====",error)
-                });
-            }else if(row.isDisabled || row.status == 2){
-                return false
-            }else {
-                if(this.applyMap.seatTypeId != row.seatTypeId){
-                    this.$message.error('只能选同一类型的座位');
-                    return
-                }
-                if(this.seatSelectList.length >= this.details.viewersList.length ){
-                  if(row.isSelect) {
-                    let indexs = null;
-                    this.seatSelectList.forEach((item, index) =>{
-                      if(item.id == row.id){
-                        indexs = index;
-                      }
-                    })
-                    if(indexs != null) {
-                      row.isSelect = !row.isSelect;
-                      this.seatSelectList.splice(indexs, 1)
-                    }
-                  } else {
-                    this.$message.error("观影人数限制" + this.details.viewersList.length + "人!");
-                  }
-                  return false
-                }
-                row.isSelect = !row.isSelect
-                if(row.isSelect){
-                  this.seatSelectList.push(JSON.parse(JSON.stringify(row)))
-                }else {
-                  let indexs = null;
-                    this.seatSelectList.forEach((item, index) =>{
-                      if(item.id == row.id){
-                        indexs = index;
-                      }
-                    })
-                    if(indexs != null) {
-                      this.seatSelectList.splice(indexs, 1)
-                    }
-                }
-                //this.seatSelectList = this.setList.filter(item => item.isSelect);
-                console.log("this.seatSelectList===",this.seatSelectList)
-                this.$forceUpdate()
-            }
-            
-        },
-    // 审核通过
-    passOpenEven() {
-      this.passOpen = true;
-      this.seatMapList = [];
-      this.seatSelectList = [];
-      this.getSeatApi();
-      //this.setSeatMapList()
-    },
     /**
-     * 保存
+     * 驳回提交
      * @date 2023-11-22
      * @returns {any}
      */
-    submitForm() {
+     submitForm() {
       this.$refs["refRejectForm"].validate(async (valid) => {
         if (valid) {
           try {
@@ -572,30 +380,27 @@ export default {
     // 审核通过 - 座位选择保存
     submitPass() {
       try {
-        // this.passLoading = true;
-        //let seatList = this.setList.filter(item => item.isSelect);
-        let seatList = this.seatSelectList
-        if(seatList && seatList.length > 0 && this.seatSelectList.length == this.details.viewersList.length ) {
-          this.passLoading = true;
-          let postMap = {
-            applyId: this.details.id || this.applyId,
-            status: 1,
-            seatList: seatList
-          }
-          teamApplyAudit(postMap).then((res) => {
-            this.passLoading = false;
-            if (res.code == 200) {
-              this.$message.success("操作成功!");
-              this.passOpen = false;
-              this.$emit("getList");
-              this.cancel();
-            }
-          }).catch(()=>{
-            this.passLoading = false;
-          })
-        } else {
-          this.$message.error("请选择座位!");
+      let seatList = this.seatSelectList
+      if(!seatList || this.seatSelectList.length < this.details.viewersList.length ) {
+        this.$message.error(`请选择 ${ this.details.viewersList.length } 座位!`);
+        return
+      } 
+      this.passLoading = true;
+        let postMap = {
+          applyId: this.details.id || this.applyId,
+          status: 1,
+          seatList: seatList
         }
+        teamApplyAudit(postMap).then((res) => {
+          this.passLoading = false;
+          if (res.code == 200) {
+            this.$message.success("操作成功!");
+            this.$emit("getList");
+            this.cancel();
+          }
+        }).catch(()=>{
+          this.passLoading = false;
+        })
       } catch (error) {
         this.passLoading = false;
       } finally {
@@ -609,6 +414,10 @@ export default {
     cancel() {
       this.open = false;
     },
+    /**
+     * 打开驳回表单 
+     * 
+     */
     setRejectOpen() {
       this.rejectOpen = true
       this.$set(this.rejectForm,'errReason','')
@@ -617,102 +426,18 @@ export default {
       })
     },
 
-    // 设置座位集合
-    setSeatMapListCopy(list) {
-            if(list && list.length > 0) {
-                let listCopy = {}
-                let lisyCopy1 = {}
-                let listNum = JSON.parse(JSON.stringify(this.seatTypeList))
-                listNum.forEach((item,index)=>{
-                    listNum[index]['num'] = 0 
-                })
-                list.forEach(item => {
-                    item.isDisabled = (item.occupyStatus != null && (item.occupyStatus == 0 || item.occupyStatus == 1) ? true : false); // 座位是否已被选择
-                    item.isSelect = this.setIsSelect(item);
-                    if(item.rowNo){
-                        listNum.forEach((item1,index)=>{
-                            if(item1.id == item.seatTypeId && item.status ==1 && !item.occupyStatus && item.occupyStatus !=0) {
-                                listNum[index]['num'] = listNum[index]['num'] + 1 
-                            }
-                        })
-                        if(listCopy['my'+item.rowNo]){
-                            listCopy['my'+item.rowNo].push(item)
-                        }else {
-                            listCopy['my'+item.rowNo] = [item] 
-                        }
-                    }
-                })
-                this.seatTypeList = JSON.parse(JSON.stringify(listNum))
-                let width = 0
-                let flog = 0
-                let seatMapListKey = []
-                Object.keys(listCopy).forEach((item)=>{
-                    if(listCopy[item].length>flog) {
-                        flog = listCopy[item].length
-                    }
-                    seatMapListKey.push({
-                        key: item,
-                        sort: Number(item.replace('my',''))
-                    })
-                })
-                seatMapListKey.sort((a,b)=>{
-                    return a.sort - b.sort
-                })
-                this.seatMapListKey = seatMapListKey
-                console.log("seatMapListKey=====",seatMapListKey)
-                this.width = 70*flog
-                this.$nextTick(()=>{
-                    if(this.$refs.seatbox) {
-                      var ele = this.$refs.seatbox
-                        console.log(ele.getBoundingClientRect().width); // 100
-                        if(this.width<ele.getBoundingClientRect().width) {
-                            this.justifyContent = true
-                        }else {
-                            //this.justifyContent = false
-                            this.justifyContent = true
-                        }
-                        //this.$refs.seatbox.scrollTo(this.width/4,0)
-                    }
-                })
-                
-                console.log("list====",listCopy)
-                this.seatMapList = JSON.parse(JSON.stringify(listCopy))
-            }
-        },
-        setIsSelect(item){
-            if(!this.seatSelectList||this.seatSelectList.length==0){
-                return false
-            }
-            let flog = false
-            this.seatSelectList.forEach((item1,index1)=>{
-                if(item.id == item1.id){
-                    flog = true
-                }
-            })
-            return flog
-        },
-    /** 获取座位类型 说明 */
-    getSeatTypeList() {
-      getSeatType({
-        pageNum: 1,
-        pageSize: 999,
+     /** 选择座位  */
+    selectSeat(list) {
+      let list1 = []
+      list.forEach((item)=>{
+        list1.push({
+          seatId: item.id,
+          seatName: item.name
+        })
       })
-      .then(response => {
-        this.seatTypeList = response.data.rows;
-      });
+      this.seatSelectList = list1
+      console.log("已选择的====",list)
     },
-     /** 座位状态 展示  */
-     setSeatClass(item){
-      let srt =
-      item.occupyStatus == 0 ? 
-      item.occupyOrderId?'order-occupy-status':
-      'occupy-status' : 
-      item.occupyStatus == 1 ? 'occupy-status-no' : 
-      item.isDisabled || item.status != 1 ? 'disabled-class' : 
-      item.isSelect ? 'select-class' : 
-      item.seatTypeId != this.applyMap.seatTypeId?'disabled-class':''
-      return srt
-    }
   },
 };
 </script>
@@ -806,246 +531,7 @@ export default {
 }
 
 .dialog-bbb_2 {
-  .seat-tool-box {
-    height: 20px;
-    box-sizing: border-box;
-    display: flex;
-    align-items: center;
-    white-space: nowrap;
-    span{
-        flex-shrink: 0;
-        font-size: 12px;
-        white-space: nowrap;
-    }
-    .seat-tool-box-slider {
-        width: 100px;
-        margin-left: 10px;
-    }
-  }
-
-  .seat-box {
-    width: 100%;
-    height: calc( 100% - 50px );
-    box-sizing: border-box;
-    display: flex;
-    position: relative;
-    .seat-list-box {
-        width: 100%;
-        height: 100%;
-        box-sizing: border-box;
-        position: relative;
-    }
-    .seat-select-box {
-        width: 200px;
-        height: 100%;
-        flex-shrink: 0;
-        box-sizing: border-box;
-        padding: 0 5px;
-        margin-left: 10px;
-        border: 1px solid #ccc;
-        border-radius: 10px;
-        .seat-select-info {
-            width: 100%;
-            height: calc( 100% - 60px );
-            overflow: hidden;
-            overflow-y: auto;
-            .seat-select-item {
-                border: 1px solid #ccc;
-                margin-bottom: 5px;
-                padding: 5px;
-                border-radius: 5px;
-                display: flex;
-                justify-content: space-between;
-                align-items: center;
-                font-size: 12px;
-                >div:first-child {
-                    display: flex;
-                    flex-direction: column;
-                    span:first-child {
-                        font-weight: 600;
-                    }
-                }
-                >div:last-child {
-                    span:first-child {
-                        color: #f56c6c;
-                        cursor: pointer;
-                    }
-                }
-            }
-
-            .seat-select-color-item {
-                display: flex;
-                align-items: center;
-                margin-bottom: 5px;
-                >span:first-child {
-                    width: 20px;
-                    height: 20px;
-                    flex-shrink: 0;
-                }
-                >span:last-child {
-                    font-size: 16px;
-                    font-weight: 600;
-                    margin-left: 10px;
-                }
-            }
-        }
-    }
-  }
-
-  .seat-list-box::before {
-    content: "舞台";
-    position: absolute;
-    left: 50%;
-    transform: translateX(-50%);
-    width: 300px;
-    height: 30px;
-    background-color: rgb(204, 204, 204,0.5);
-    font-size: 18px;
-    font-weight: 600;
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    border-radius: 0 0 20px 20px;
-    z-index: 99;
-  }
-
-  .dialogss {
-    padding: 30px 10px 10px;
-    width: 100%;
-    height: 100%;
-    box-sizing: border-box;
-    overflow: auto;
-    border-radius: 10px;
-    border: 1px  solid #323333;
-    position: relative;
-    .dialogss-box {
-        position: relative;
-    }
-    .upload-btn {
-      width: 100px;
-      height: 100px;
-      background-color: #fbfdff;
-      border: dashed 1px #c0ccda;
-      border-radius: 5px;
-      i {
-        font-size: 30px;
-        margin-top: 20px;
-      }
-      &-text {
-        margin-top: -10px;
-      }
-    }
-    .avatar {
-      cursor: pointer;
-    }
-    .title-class{
-      font-size: 16px;
-      font-weight: bold;
-      color: black;
-      margin-bottom: 20px;
-      margin-top: 20px;
-    }
-    .item-class{
-      margin-bottom: 20px;
-    }
-    .seat-box-class{
-      padding: 5px;
-      transform-origin: 50% 0;
-      transform: scale(var(--scaleNum));
-      box-sizing: border-box;
-      .disabled-class{
-        background-color: #aaabad;
-        user-select: none;
-        // pointer-events: none;
-        cursor: not-allowed !important;
-      }
-      .select-class{
-        //background-color: #e85353 !important;
-        border: 5px solid #1890ff !important;
-       // color: #eceaea !important;
-       position: relative;
-      }
-      .occupy-status:after{
-        content:"";
-        display:block;
-        position:absolute;
-        top:0;
-        left:0;
-        width:100%;
-        height:100%;
-        background-color:rgba(0,0,0,0.3);
-        z-index:-1;
-        background-image: url('../../../../assets/jinzhi_1.png');
-        background-size: 50% 50%;
-        background-position: 50% 50%;
-        background-repeat: no-repeat;
-        z-index: 99;
-    }
-      .occupy-status {
-        //pointer-events: none;
-      }
-      /** 订单待支付锁定 */
-      .order-occupy-status {
-
-        }
-        .order-occupy-status:after{
-          content:"";
-          display:block;
-          position:absolute;
-          top:0;
-          left:0;
-          width:100%;
-          height:100%;
-          background-color:rgba(0,0,0,0.3);
-          z-index:-1;
-          background-image: url('../../../../assets/jinzhi.png');
-          background-size: 50% 50%;
-          background-position: 50% 50%;
-          background-repeat: no-repeat;
-          z-index: 99;
-        }
-      .occupy-status-no {
-        background-color: #f56c6c !important;
-        user-select: none;
-        // pointer-events: none;
-        cursor: not-allowed !important;
-      }
-      .seat-item-class-box {
-        width: 100%;
-        display: flex;
-        flex-wrap: nowrap;
-        justify-content: center;
-        margin: auto 0;
-        text-align: center;
-      }
-      .seat-item-class{
-        flex-shrink: 0;
-        display: block;
-        float: left;
-        width: 60px;
-        height: 60px;
-        margin: 5px;
-        border: 1px solid #4c4d4d;
-        border-radius: 3px;
-        cursor: pointer;
-        position: relative;
-        user-select: none;
-        // transform-origin: 50% 50%;
-        // transform: scale(var(--scaleNum));
-        &:hover{
-          opacity: 0.6;
-        }
   
-        .text-class{
-          font-size: 12px;
-          padding: 5px;
-          line-height: 16px;
-          margin: 0;
-          color: #000;
-        }
-      }
-    }
-  }
 }
 
 #moveSelected_1{

+ 0 - 288
src/views/team/applicationMr/mixins/selectList.js

@@ -1,288 +0,0 @@
-export default {
-    data() {
-        return {
-            /**  多选  */
-            selectList: [],
-            selectTabelList: [],
-            multipleSelection_1: [],
-
-            moveSelected: null,
-            moveSelected1: null,
-            flag: false,//是搜开启拖拽的标志
-            oldLeft: 0,//鼠标按下时的left,top
-            oldTop: 0,
-            selectedList: [],//拖拽多选选中的块集合
-
-            isToLeft: true,
-            isToTop: true,
-
-            startX: 0,
-            startY: 0,
-            endX: 0,
-            endY: 0,
-            isMousemovs: false,
-            xNum: 1,
-            yNum: 1,
-
-            scrollTop: 0,
-            scrollLeft: 0,
-            scrollTopAll: 0,
-            scrollLeftAll: 0,
-        }
-    },
-    mounted() {
-        
-    },
-    methods: {
-        // 鼠标按下时开启拖拽多选,将遮罩定位并展现
-        mousedownFun(event) {
-           
-            this.screenTop = this.$refs.seatbox.scrollTop
-            this.scrollLeft = this.$refs.seatbox.scrollLeft
-
-            this.moveSelected = document.getElementById('moveSelected_1')
-            this.moveSelected1 = document.getElementById('sm-scroll-box_1')
-            console.log("鼠标按下!!!====",window.scrollX,window.scrollY)
-            if(event.button != 0) return
-            //this.selectedList = []
-           // this.selectList = []
-            
-            this.flag=true;
-            let offsetTop = this.moveSelected1.getBoundingClientRect().y
-            let offsetLeft = this.moveSelected1.getBoundingClientRect().x 
-            console.log("鼠标按下!!!",offsetTop,offsetLeft)
-            this.moveSelected.style.top=(event.pageY-offsetTop - 10 + this.screenTop)+'px';
-            this.moveSelected.style.left=(event.pageX-offsetLeft - 10 + this.scrollLeft )+'px';
-            this.oldLeft=event.pageX;
-            this.oldTop=event.pageY;
-
-            this.startX=event.pageX;
-            this.startY=event.pageY;
-            event.preventDefault(); // 阻止默认行为
-            event.stopPropagation(); // 阻止事件冒泡
-        },
-        // 鼠标移动时计算遮罩的位置,宽 高
-        mousemoveFun(event) {
-            if(!this.flag) return;//只有开启了拖拽,才进行mouseover操作
-            console.log("鼠标移动!!!")
-            this.endX=event.pageX;
-            this.endY=event.pageY;
-            
-            
-            if( Math.abs(this.startX - this.endX) > 10 || Math.abs(this.startY - this.endY) > 10){
-                this.isMousemovs = true
-                let offsetTop = this.moveSelected1.getBoundingClientRect().y
-                let offsetLeft = this.moveSelected1.getBoundingClientRect().x 
-                if(event.pageX<this.oldLeft){//向左拖
-                this.isToLeft = true
-                this.moveSelected.style.left=(event.pageX-offsetLeft - this.xNum  + this.scrollLeft )+'px';
-                this.moveSelected.style.width=(this.oldLeft-event.pageX)+'px';
-                }else{
-                    this.isToLeft = false
-                this.moveSelected.style.width=(event.pageX-this.oldLeft)+'px';
-                }
-                if(event.pageY<this.oldTop){//向上
-                this.isToTop = true
-                this.moveSelected.style.top=(event.pageY-offsetTop - this.yNum + this.screenTop)+'px';
-                this.moveSelected.style.height=(this.oldTop-event.pageY)+'px';
-                }else{
-                    this.isToTop = false
-                this.moveSelected.style.height=(event.pageY-this.oldTop)+'px';
-                }
-            }
-            event.preventDefault(); // 阻止默认行为
-            event.stopPropagation(); // 阻止事件冒泡
-        },
-        //鼠标抬起时计算遮罩的right 和 bottom,找出遮罩覆盖的块,关闭拖拽选中开关,清除遮罩数据
-        mouseupFun(event) {
-            console.log("鼠标抬起!!!",this.isMousemovs)
-            if(event.button != 0) return
-            this.moveSelected.style.bottom=Number(this.moveSelected.style.top.split('px')[0])+Number(this.moveSelected.style.height.split('px')[0]) + 'px';
-            this.moveSelected.style.right=Number(this.moveSelected.style.left.split('px')[0])+Number(this.moveSelected.style.width.split('px')[0])+'px';
-            this.flag=false;
-            if(this.isMousemovs){
-                this.getSelectItem()
-            }else {
-                let id = event.srcElement.getAttribute('dragSelectId')
-                console.log("id===",id,event.srcElement)
-                if(id){
-                    this.seatMapListKey.forEach((item1,index1)=>{
-                        this.seatMapList[item1.key].forEach((item,index)=>{
-                            if(id == item.id){
-                               
-                                let aaa = this.seatClickCopy(this.seatMapList[item1.key][index])
-                                console.log("id===",id,item.id,aaa)
-                                if(!aaa) {
-                                    this.seatMapList[item1.key][index].isSelect = false
-                                }else {
-                                    this.seatMapList[item1.key][index].isSelect = !this.seatMapList[item1.key][index].isSelect
-                                }
-                                
-                                
-                            }
-                        })
-                    })
-                    this.$forceUpdate()
-                }
-            }
-            this.isMousemovs = false
-            this.clearDragData();
-            event.preventDefault(); // 阻止默认行为
-            event.stopPropagation(); // 阻止事件冒泡
-        },
-        mouseleaveFun(event) {
-            this.moveSelected = document.getElementById('moveSelected_1')
-            this.moveSelected1 = document.getElementById('sm-scroll-box_1')
-            this.flag=false;
-            this.moveSelected.style.width='0px';
-            this.moveSelected.style.height='0px';
-            this.moveSelected.style.top='0px';
-            this.moveSelected.style.left='0px';
-            event.preventDefault(); // 阻止默认行为
-            event.stopPropagation(); // 阻止事件冒泡
-        },
-
-        clearDragData(){
-            this.moveSelected.style.width='0px';
-            this.moveSelected.style.height='0px';
-            this.moveSelected.style.top='0px';
-            this.moveSelected.style.left='0px';
-            this.moveSelected.style.bottom='0px';
-            this.moveSelected.style.right='0px';
-        },
-
-        /**  批量判断元素的位置  */
-        getSelectItem(){
-            let list = document.getElementsByClassName('seat-item-class_1')
-            let listCopy = []
-            let drawDialog = document.getElementById("moveSelected_1");
-            // 获取div元素的坐标点
-            let rect = drawDialog.getBoundingClientRect();
-            for(let i = 0; i < list.length; i++) {
-                let rect_div = list[i].getBoundingClientRect();
-                //console.log("rect===",list[i].getAttribute('index'),rect_div.top,rect_div.left)
-                if(rect.top < (rect_div.top + rect_div.height) && rect.bottom > (rect_div.bottom - rect_div.height) &&
-                  rect.left < (rect_div.left + rect_div.width) && rect.right > (rect_div.right - rect_div.width)) {
-                    listCopy.push(list[i].getAttribute("dragSelectId"));
-                }
-            }
-            let listCopy1 = []
-            listCopy.forEach((item,index)=>{
-                this.setList.forEach((item1,index1)=>{
-                    if(item == item1.id) {
-                        listCopy1.push(item1)
-                    }
-                })
-            })
-            let flog = false;
-            let seatTypeId = null
-            for(let i = 0; i<listCopy1.length; i++) {
-                let row = listCopy1[i]
-                if(row.occupyStatus == 0) {
-                    this.$message.error('不能选择已锁定的座位');
-                    flog = true
-                    break;
-                }
-                if(row.isDisabled || row.status == 2) {
-                    this.$message.error('不能选择已售或不可售座位');
-                    flog = true
-                    break;
-                }
-            }
-            if(flog){
-                return
-            }
-            listCopy1.forEach((item,index)=>{
-                if(index == 0) {
-                    seatTypeId = item.seatTypeId
-                }else {
-                    if(item.seatTypeId != seatTypeId || this.applyMap.seatTypeId != item.seatTypeId ) {
-                        flog = true
-                    }
-                }
-            })
-            if(flog){
-                this.$message.error('只能选同一类型的座位');
-                return
-            }
-            listCopy1.forEach((item,index)=>{
-                this.seatSelectList.forEach((item1,index1)=>{
-                    if(item.seatTypeId != item1.seatTypeId) {
-                        flog = true
-                    }
-                })
-            })
-            
-            if(flog){
-                this.$message.error('只能选同一类型的座位');
-                return
-            }
-            if((this.seatSelectList.length + listCopy1.length) > this.details.viewersList.length||this.seatSelectList.length==this.details.viewersList.length) {
-                this.$message.error("观影人数限制" + this.details.viewersList.length + "人!");
-                return
-            }
-            listCopy.forEach((item,index)=>{
-                this.seatMapListKey.forEach((item1,index1)=>{
-                    this.seatMapList[item1.key].forEach((item,index)=>{
-                        if(listCopy.includes(item.id)){
-                            this.seatMapList[item1.key][index].isSelect = true
-                        }
-                    })
-                })
-            })
-            let listCopy2 = []
-            listCopy1.forEach((item,index)=>{
-                let flag1 = false
-                this.seatSelectList.forEach((item1,index1)=>{
-                    if(item.id == item1.id) {
-                        flag1 = true
-                    }
-                })
-                if(!flag1){
-                    listCopy2.push(item)
-                }
-            })
-            this.seatSelectList = this.seatSelectList.concat(listCopy2)
-            this.$forceUpdate()
-            console.log("listCopy===",listCopy)
-            console.log("listCopy1===",listCopy1)
-        },
-        /**  清除全部已选 */
-        clearSeatSelectListAll () {
-            this.seatMapListKey.forEach((item1,index1)=>{
-                this.seatMapList[item1.key].forEach((item,index)=>{
-                    this.seatMapList[item1.key][index].isSelect = false
-                })
-            })
-            this.seatSelectList = [] 
-            this.$forceUpdate()
-        },
-
-        /** 座位大小 拖动变化是  */
-        scaleNumInput() {
-            console.log("sfasdfsfd===")
-            this.$refs.seatbox.removeEventListener('mousemove', this.mousemoveFun);
-            this.$refs.seatbox.removeEventListener('mouseup', this.mouseupFun);
-        },
-        scaleNumChange() {
-            console.log("sfasdfsfd11111===")
-            this.$refs.seatbox.removeEventListener('mousemove', this.mousemoveFun);
-            this.$refs.seatbox.removeEventListener('mouseup', this.mouseupFun);
-            setTimeout(()=>{
-                this.$refs.seatbox.addEventListener('mousemove', this.mousemoveFun);
-                this.$refs.seatbox.addEventListener('mouseup', this.mouseupFun);
-            },500)
-        }
-    },
-    watch: {
-        scaleNum(){
-            this.scaleNumInput()
-        }
-    },
-    destroyed() {
-        if(this.$refs.seatbox) {
-            this.$refs.seatbox.removeEventListener('mousemove', this.mousemoveFun);
-            this.$refs.seatbox.removeEventListener('mouseup', this.mouseupFun);
-        }
-    },
-}