ticketingSales.vue 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186
  1. <template>
  2. <div class="app-container app-container-me">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. size="small"
  7. :inline="true"
  8. :rules="rules"
  9. label-width="80px">
  10. <el-form-item label="演出厅" prop="auditoriumId">
  11. <el-select
  12. v-model="queryParams.auditoriumId"
  13. placeholder="演出厅"
  14. clearable
  15. style="width: 100%"
  16. @change="changeTime($event,'auditoriumId')"
  17. >
  18. <el-option
  19. v-for="dict in merchantTheatreAuditoriumListS"
  20. :key="dict.id"
  21. :label="dict.name"
  22. :value="dict.id"
  23. />
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item label="场次时间" prop="performDate">
  27. <el-date-picker
  28. type="date"
  29. placeholder="选择场次时间"
  30. v-model="queryParams.performDate"
  31. @change="changeTime($event,'performDate')"
  32. value-format="yyyy-MM-dd"
  33. ></el-date-picker>
  34. </el-form-item>
  35. <el-form-item label="场次" prop="timeId">
  36. <el-select
  37. v-model="queryParams.timeId"
  38. placeholder="场次"
  39. clearable
  40. style="width: 100%"
  41. @change="changeTime($event,'timeId')"
  42. >
  43. <el-option
  44. v-for="dict in merchantPerformTimeListS"
  45. :key="dict.id"
  46. :label="dict.timeSnapshot+'('+dict.performTimeStart+'-'+dict.performTimeEnd+')'"
  47. :value="dict.id"
  48. />
  49. </el-select>
  50. </el-form-item>
  51. <el-form-item label="票务类型" prop="goodsId">
  52. <el-select
  53. v-model="queryParams.goodsId"
  54. placeholder="票务类型"
  55. clearable
  56. style="width: 100%"
  57. @change="changeTime($event,'goodsId')"
  58. >
  59. <el-option
  60. v-for="dict in goodsPageListS"
  61. :key="dict.id"
  62. :label="dict.goodsName"
  63. :value="dict.id"
  64. :disabled="dict.status==1 || dict.goodsPerform.channelWindow != 0"
  65. />
  66. </el-select>
  67. </el-form-item>
  68. <el-form-item>
  69. <el-button :loading="loading" type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  70. <el-button :loading="loading" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  71. </el-form-item>
  72. </el-form>
  73. <div class="seat-tool-box">
  74. <span class="demonstration">座位大小</span>
  75. <div class="seat-tool-box-slider">
  76. <el-slider
  77. v-model="scaleNum"
  78. :min="30"
  79. :max="100"
  80. @change="scaleNumChange"
  81. ></el-slider>
  82. </div>
  83. <div style="display: flex;margin-left: 20px;" v-if="seatMapList&&JSON.stringify(seatMapList) != '{}'">
  84. <div>各类型座位的剩余数量:</div>
  85. <div
  86. :key="index"
  87. v-for="(item,index) in seatTypeList"
  88. style="margin-left: 10px;align-items: center;"
  89. >
  90. <span :style="{color: item.color?item.color:'none'}">{{item.name ? (item.name+'(剩余:'+ (item.num||0) +')') : '暂未命名'}}</span>
  91. </div>
  92. </div>
  93. </div>
  94. <div class="seat-box" :style="{'--scaleNum': scaleNum/100}">
  95. <!-- 选择座位 -->
  96. <div
  97. class="seat-list-box"
  98. v-loading="loading">
  99. <!-- 座位排版 -->
  100. <div
  101. id="sm-scroll-box"
  102. ref="seatbox"
  103. class="dialog"
  104. @mousedown="mousedownFun"
  105. @mouseleave="mouseleaveFun"
  106. @scroll="scrollFun"
  107. >
  108. <div
  109. class="dialog-box"
  110. :style="{width: width*(scaleNum/100) + 'px', margin: justifyContent ? 'auto' : 'unset'}"
  111. >
  112. <div
  113. style="width: 100%;position: absolute;"
  114. class="seat-box-class clearfix"
  115. v-if="seatMapList"
  116. >
  117. <div
  118. class="seat-item-class-box"
  119. v-for="(item1, index1) in seatMapListKey"
  120. :key="item1.key"
  121. >
  122. <div class="seat-item-class seat-box-class-row" style="">{{ index1 != 0 ?((index1) + '排') :'' }}</div>
  123. <div
  124. :class="[
  125. 'seat-item-class',
  126. item1.key == 'my_column'?'seat-item-class-column':
  127. 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' : ''
  128. ]"
  129. v-for="(item, index) in seatMapList[item1.key]"
  130. :style="{backgroundColor: item.color && !(item.isDisabled || item.status != 1) ? item.color : 'none'}"
  131. @click.stop="seatClick(item)"
  132. @mouseenter="lockOrUnLockDeatilFun($event,item)"
  133. @mouseleave="lockOrUnLockDeatilFun1"
  134. :dragSelectId="item.id"
  135. :index="item1.key +'_'+ index"
  136. :key="index">
  137. <p
  138. v-if="item1.key != 'my_column'"
  139. class="text-class"
  140. >{{ item.status != 1 ? '不可售':(item.name ? item.name : '暂未命名') }}</p>
  141. <p v-else>{{ (index+1) + '号' }}</p>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. <!-- 鼠标拖拽出的遮罩 (定位为 position:absolute)-->
  147. <!-- 遮罩最好是在绑定了mouseover事件的元素内部,并且不要阻止遮罩的冒泡事件。这样鼠标移到了遮罩上面,依然可以利用冒泡执行父元素的mouseover事件,就不会出现遮罩只能扩大,不能缩小的情况了(亲自试过) -->
  148. <div id="moveSelected"></div>
  149. </div>
  150. <div style="margin-top: 5px; margin-left: 30px;display: flex;">
  151. <div style="flex-shrink: 0;">
  152. <span>已勾选可售座位:{{ seatSelectList.length }}</span>
  153. <span>已勾选锁定座位:{{ seatSelectListNo.length }}</span>
  154. <el-button size="mini" type="warning" @click="clearSeatSelectListAll">清空已选座位</el-button>
  155. </div>
  156. <div style="width: 100%;display: flex;justify-content: center;height: 30px;">
  157. <el-button size="mini" v-hasPermi="['officesale:ticketingSales:lock']" type="warning" :loading="lockOrUnLockLoading" @click="lockOrUnLockFun(0)">{{ seatSelectListNo.length>0?'解锁':'锁定' }}</el-button>
  158. <el-button size="mini" v-hasPermi="['officesale:ticketingSales:buy']" type="primary" @click="increaseViewersFun">预约</el-button>
  159. </div>
  160. </div>
  161. </div>
  162. <div class="seat-select-box">
  163. <div class="seat-select-box-top">
  164. <el-tabs v-model="activeName" @tab-click="handleClickTab">
  165. <el-tab-pane label="已选座位" name="first"></el-tab-pane>
  166. <!-- <el-tab-pane label="座位图例" name="second"></el-tab-pane> -->
  167. </el-tabs>
  168. </div>
  169. <div class="seat-select-info" v-if="activeName=='first'">
  170. <div
  171. class="seat-select-item"
  172. :key="index"
  173. v-for="(item,index) in seatSelectList">
  174. <div>
  175. <span>{{item.name ? item.name : '暂未命名'}}</span>
  176. <span>{{ setSeatTypeShow(item.seatTypeId) }}</span>
  177. </div>
  178. <div>
  179. <span @click="delSeatSelect(item)">删除</span>
  180. </div>
  181. </div>
  182. </div>
  183. <div class="seat-select-info" v-if="activeName=='second'">
  184. <div
  185. class="seat-select-color-item"
  186. :key="index"
  187. v-for="(item,index) in seatTypeList">
  188. <span :style="{backgroundColor: item.color?item.color:'none'}"></span>
  189. <span>{{item.name ? item.name : '暂未命名'}}</span>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. <!-- 锁座备注 -->
  195. <lock-seat ref="lockSeat" @querySeatListFun="querySeatListFun" />
  196. <!-- 添加观影人 -->
  197. <increaseViewers ref="increaseViewers" @clearDialogVisible="clearDialogVisible" />
  198. <!-- 提示信息 -->
  199. <div :style="lockStyle" v-if="isLcokShow" class="lock-style-box">
  200. <div><span>锁定人:</span><span>{{ lockObj.auth }}</span></div>
  201. <div><span>锁定原因:</span><span>{{ lockObj.remark }}</span></div>
  202. </div>
  203. </div>
  204. </template>
  205. <script>
  206. import {
  207. querySeatList,
  208. merchantPerformTimeList,
  209. lockOrUnLock,
  210. merchantTheatreAuditoriumList,
  211. goodsPageList,
  212. getGoodsPerformApi,
  213. lockOrUnLockApi
  214. } from '@/api/windowTicketSales/ticketingSales'
  215. //import increaseViewers from "./model/increaseViewers"
  216. import increaseViewers from "./model/increaseViewers"
  217. import moment from "moment"
  218. import { pageList as getSeatType } from '@/api/seatTypeMr/seatTypeMr'
  219. import selectListMixin from "./mixins/selectList"
  220. import LockSeat from './model/lockSeat.vue'
  221. export default {
  222. name: "TicketingSales1",
  223. components: {
  224. increaseViewers,
  225. LockSeat
  226. },
  227. mixins: [selectListMixin],
  228. data() {
  229. return {
  230. // 遮罩层
  231. loading: false,
  232. // 查询参数
  233. queryParams: {
  234. timeId: '',
  235. performDate: null,
  236. auditoriumId: null,
  237. goodsId: null,
  238. },
  239. rules: {
  240. auditoriumId: [
  241. { required: true, message: '请选择演出厅', trigger: ['blur','change'] }
  242. ],
  243. performDate: [
  244. { required: true, message: '请选择时间', trigger: ['blur','change'] }
  245. ],
  246. timeId: [
  247. { required: true, message: '请选择场次', trigger: ['blur','change'] }
  248. ],
  249. goodsId: [
  250. { required: true, message: '请选择票务类型', trigger: ['blur','change'] }
  251. ],
  252. },
  253. merchantTheatreAuditoriumListS: [], // 演出厅
  254. merchantPerformTimeListS: [], // 场次
  255. querySeatListS: [], // 座位
  256. goodsPageListS: [], // 票务
  257. goodsPageListSAll: [], // 票务全部
  258. setList: [],
  259. seatMapList: {},
  260. seatMapListKey: [], // key
  261. seatSelectList: [],
  262. seatSelectListNo: [], // 锁定的座位
  263. lockOrUnLockLoading: false,
  264. performId: '',// 剧目ID
  265. scaleNum: 30,
  266. width: 0,
  267. justifyContent: false,
  268. activeName: 'first',
  269. seatTypeList: [],
  270. // 限购条件
  271. ifRealUser: 0,// 散客是否实名:0-否 1-是
  272. ifRealTeam: 0,// 团购是否实名:0否 1-是
  273. oneMany: 0,// 证件要求: 1一证一票,2一证多票
  274. personnelNum: 0,// 人员要求:0-表示不限制 其他数字表示限制人数
  275. isLcokShow: false,
  276. lckTime: null,
  277. seatId: null,
  278. lockStyle: {
  279. },
  280. lockObj: {
  281. auth: '',
  282. remark: ''
  283. }
  284. };
  285. },
  286. created() {
  287. this.merchantTheatreAuditoriumListFun()
  288. this.goodsPageListFun()
  289. this.getSeatTypeList()
  290. },
  291. mounted() {
  292. this.$set(this.queryParams,'performDate',moment().format("yyyy-MM-DD"))
  293. },
  294. methods: {
  295. moment,
  296. /** 票务信息 */
  297. async goodsPageListFun(){
  298. try {
  299. let res = await goodsPageList({
  300. pageNum: 1,
  301. pageSize: 999,
  302. classifyId: 1,
  303. goodsType: 2,
  304. })
  305. if(res.code == 200){
  306. this.goodsPageListSAll = res.data.rows
  307. // let list = []
  308. // res.data.rows.forEach((item,index)=>{
  309. // if(item.status != 1) {
  310. // list.push(item)
  311. // }
  312. // })
  313. // this.goodsPageListS = list
  314. }
  315. } catch (error) {
  316. }
  317. },
  318. /** 获取演出厅 */
  319. async merchantTheatreAuditoriumListFun(){
  320. try {
  321. let res = await merchantTheatreAuditoriumList({
  322. pageNum: 1,
  323. pageSize: 999
  324. })
  325. if(res.code == 200){
  326. this.merchantTheatreAuditoriumListS = res.data.rows
  327. if(this.merchantTheatreAuditoriumListS.length>0){
  328. this.$set(this.queryParams,'auditoriumId',this.merchantTheatreAuditoriumListS[0].id)
  329. this.changeTime(this.queryParams.auditoriumId,'auditoriumId')
  330. }
  331. }
  332. } catch (error) {
  333. }
  334. },
  335. /** 获取场次 */
  336. async merchantPerformTimeListFun(){
  337. try {
  338. let param = this.queryParams;
  339. param.status = 1;
  340. let res = await merchantPerformTimeList(param)
  341. if(res.code == 200){
  342. console.log('merchantPerformTimeListS',res.data.rows);
  343. this.merchantPerformTimeListS = res.data.rows
  344. }
  345. } catch (error) {
  346. }
  347. },
  348. /** 座位锁定/解锁 */
  349. async lockOrUnLockFun(type){
  350. try {
  351. let listS = this.seatSelectListNo.length>0 ? this.seatSelectListNo : this.seatSelectList
  352. if(listS.length<=0) {
  353. this.$message.error(`请选择锁定的座位!!!`);
  354. return
  355. }
  356. if(this.seatSelectListNo.length == 0) {
  357. this.$refs.lockSeat.open(this.seatSelectListNo,this.seatSelectList,this.queryParams.auditoriumId,this.queryParams.timeId)
  358. }else {
  359. this.lockOrUnLockLoading = true
  360. let list = []
  361. listS.forEach((item,index)=>{
  362. list.push({
  363. "auditoriumId": this.queryParams.auditoriumId,
  364. "seatId": item.id,
  365. "timeId": this.queryParams.timeId
  366. })
  367. })
  368. let res = await lockOrUnLock({
  369. type: this.seatSelectListNo.length>0 ? 1 : 0,
  370. seatList: list
  371. })
  372. this.lockOrUnLockLoading = false
  373. if(res.code) {
  374. this.$message({
  375. showClose: true,
  376. message: res.msg,
  377. type: 'success'
  378. });
  379. this.querySeatListFun(true)
  380. }
  381. }
  382. } catch (error) {
  383. this.lockOrUnLockLoading = false
  384. this.$message({
  385. showClose: true,
  386. message: "操作失败!!!",
  387. type: 'error'
  388. });
  389. console.error('error===',error)
  390. }
  391. },
  392. /** 获取座位 */
  393. async querySeatListFun(type){
  394. try {
  395. this.loading = true
  396. this.performId = ''
  397. this.screenTop = 0
  398. this.scrollLeft = 0
  399. if(type) { // 是否清除已选
  400. this.seatSelectList = []
  401. this.seatSelectListNo = []
  402. }
  403. this.seatMapList = {}
  404. this.seatList = []
  405. let res = await querySeatList({
  406. ...this.queryParams
  407. })
  408. if(res.code == 200){
  409. this.querySeatListS = res.data;
  410. this.setList = res.data;
  411. if(this.setList && this.setList.length > 0) {
  412. this.setSeatMapList(this.setList);
  413. }
  414. }
  415. this.loading = false
  416. } catch (error) {
  417. this.loading = false
  418. console.error("error===",error)
  419. }
  420. },
  421. // 设置座位集合
  422. setSeatMapList(list) {
  423. if(list && list.length > 0) {
  424. let listCopy = {}
  425. let lisyCopy1 = {}
  426. let listNum = JSON.parse(JSON.stringify(this.seatTypeList))
  427. listNum.forEach((item,index)=>{
  428. listNum[index]['num'] = 0
  429. })
  430. list.forEach(item => {
  431. item.isDisabled = item.occupyStatus == 1 || (item.occupyStatus==0 && item.occupyOrderId) ? true : false //(item.occupyStatus != null && (item.occupyStatus == 0 || item.occupyStatus == 1) ? true : false); // 座位是否已被选择
  432. item.isSelect = this.setIsSelect(item);
  433. if(item.rowNo){
  434. listNum.forEach((item1,index)=>{
  435. if(item1.id == item.seatTypeId && item.status ==1 && !item.occupyStatus && item.occupyStatus !=0 ) {
  436. listNum[index]['num'] = listNum[index]['num'] + 1
  437. }
  438. })
  439. if(listCopy['my'+item.rowNo]){
  440. listCopy['my'+item.rowNo].push(item)
  441. }else {
  442. listCopy['my'+item.rowNo] = [item]
  443. }
  444. }
  445. })
  446. this.seatTypeList = JSON.parse(JSON.stringify(listNum))
  447. let width = 0
  448. let flog = 0
  449. let seatMapListKey = []
  450. Object.keys(listCopy).forEach((item)=>{
  451. if(listCopy[item].length>flog) {
  452. flog = listCopy[item].length
  453. }
  454. seatMapListKey.push({
  455. key: item,
  456. sort: Number(item.replace('my',''))
  457. })
  458. })
  459. seatMapListKey.sort((a,b)=>{
  460. return a.sort - b.sort
  461. })
  462. this.seatMapListKey = seatMapListKey
  463. console.log("seatMapListKey=====",seatMapListKey)
  464. this.width = 70*(flog + 1)
  465. this.$nextTick(()=>{
  466. if(this.$refs.seatbox) {
  467. var ele = this.$refs.seatbox
  468. console.log(ele.getBoundingClientRect().width); // 100
  469. if(this.width<ele.getBoundingClientRect().width) {
  470. this.justifyContent = true
  471. }else {
  472. //this.justifyContent = false
  473. this.justifyContent = true
  474. }
  475. //this.$refs.seatbox.scrollTo(this.width/4,0)
  476. }
  477. })
  478. console.log("list====",listCopy)
  479. let columnList = []
  480. listCopy[seatMapListKey[0].key].forEach((item,index)=>{
  481. columnList.push({
  482. ...item,
  483. occupyStatus: 2,
  484. isDisabled: true,
  485. status: 0
  486. })
  487. })
  488. this.seatMapListKey.unshift({
  489. key: "my_column",
  490. sort: -99
  491. })
  492. listCopy['my_column'] = columnList
  493. this.seatMapList = JSON.parse(JSON.stringify(listCopy))
  494. }
  495. },
  496. setIsSelect(item){
  497. if(!this.seatSelectList||this.seatSelectList.length==0){
  498. return false
  499. }
  500. let flog = false
  501. this.seatSelectList.forEach((item1,index1)=>{
  502. if(item.id == item1.id){
  503. flog = true
  504. }
  505. })
  506. return flog
  507. },
  508. /** 选择场次时间 */
  509. changeTime(value,type){
  510. console.log("fsdfsdf----",value,type)
  511. if(type == 'timeId') {
  512. this.$set(this.queryParams,'goodsId','')
  513. if(value) {
  514. let flog = false
  515. let list2 = []
  516. this.merchantPerformTimeListS.forEach((item,index)=>{
  517. if(item.id==value) {
  518. let list = item.goodsIds ? item.goodsIds.split(','): []
  519. list.forEach((item,index)=>{
  520. this.goodsPageListSAll.forEach((item1,index1)=>{
  521. if(item1.id == item) {
  522. flog = true
  523. list2.push({
  524. ...item1
  525. })
  526. }
  527. })
  528. })
  529. }
  530. })
  531. if(flog) {
  532. this.goodsPageListS = JSON.parse(JSON.stringify(list2))
  533. }else {
  534. this.goodsPageListS = JSON.parse(JSON.stringify(this.goodsPageListSAll))
  535. }
  536. }else {
  537. this.goodsPageListS = []
  538. }
  539. }
  540. this.changeTimeCheck(value,type)
  541. },
  542. /** 选择场次时间 */
  543. changeTimeCheck(value,type){
  544. console.log("fsdfsdf")
  545. if(this.queryParams && this.queryParams.timeId && type != 'timeId' && type != 'goodsId') {
  546. console.log('sdfsdfsdf',this.queryParams)
  547. this.$set(this.queryParams,'timeId','')
  548. this.$set(this.queryParams,'goodsId','')
  549. this.merchantPerformTimeListS = []
  550. this.goodsPageListS = []
  551. }
  552. if(this.queryParams.auditoriumId&&this.queryParams.performDate){
  553. // 获取场次
  554. this.merchantPerformTimeListFun()
  555. }
  556. if(type == 'goodsId'){
  557. if(value) {
  558. this.getGoodsPerformFun(value)
  559. }
  560. }else {
  561. this.ifRealUser = 0 // 散客是否实名:0-否 1-是
  562. this.ifRealTeam = 0 // 团购是否实名:0否 1-是
  563. this.oneMany = 1 // 证件要求: 1一证一票,2一证多票
  564. this.personnelNum = 0 // 人员要求:0-表示不限制 其他数字表示限制人数
  565. }
  566. this.seatMapListKey = {}
  567. this.performId = ''
  568. this.seatSelectList = []
  569. this.seatSelectListNo = []
  570. this.seatMapList = {}
  571. this.seatList = []
  572. this.handleQuery()
  573. },
  574. /** 设置 场次 对应得剧目ID */
  575. changePerformId(value){
  576. console.log("value=====",value)
  577. this.performId = ''
  578. this.merchantPerformTimeListS.forEach((item,index)=>{
  579. if(item.id == value){
  580. this.performId = item.performId
  581. }
  582. })
  583. },
  584. /** 搜索按钮操作 */
  585. handleQuery() {
  586. this.$refs.queryForm.validate((valid) => {
  587. if (valid) {
  588. this.querySeatListFun(true);
  589. } else {
  590. console.log('error submit!!');
  591. return false;
  592. }
  593. });
  594. },
  595. /** 重置按钮操作 */
  596. resetQuery() {
  597. this.$refs.queryForm.resetFields()
  598. this.performId = ''
  599. this.seatSelectList = []
  600. this.seatSelectListNo = []
  601. this.seatMapList = {}
  602. this.seatList = []
  603. this.handleQuery();
  604. },
  605. // 座位点击事件
  606. seatClick(row) {
  607. console.log("是的发给我大是个的风格====",row)
  608. if(row.isDisabled || row.status == 2){
  609. return false
  610. }
  611. if(this.seatSelectListNo.length>0 && row.occupyStatus != 0) {
  612. this.$message.error('你已选择锁定座位,只能再选择被锁定的座位!!!');
  613. return
  614. }
  615. if(this.seatSelectList.length > 0 && row.occupyStatus == 0){
  616. this.$message.error('此座已被锁定,请先解锁!!!');
  617. return
  618. }
  619. if(row.occupyStatus == 0){
  620. // console.log("weqwrwerewrer")
  621. // this.$confirm('此座已被锁定,请先解锁', '提示', {
  622. // confirmButtonText: '确定',
  623. // cancelButtonText: '取消',
  624. // type: 'warning'
  625. // }).then(() => {
  626. // this.lockOrUnLockFun([row],1)
  627. // }).catch((error) => {
  628. // console.log("error====",error)
  629. // });
  630. row.isSelect = !row.isSelect
  631. if(row.isSelect){
  632. this.seatSelectListNo.push(JSON.parse(JSON.stringify(row)))
  633. }else {
  634. let list = JSON.parse(JSON.stringify(this.seatSelectListNo))
  635. list.forEach((item,index)=>{
  636. if(item.id == row.id) {
  637. this.seatSelectListNo.splice(index, 1)
  638. }
  639. })
  640. }
  641. }else if(row.isDisabled || row.status == 2){
  642. return false
  643. }else {
  644. let flog = false;
  645. this.seatSelectList.forEach((item,index)=>{
  646. if(item.seatTypeId != row.seatTypeId ) {
  647. flog = true
  648. }
  649. })
  650. if(flog){
  651. this.$message.error('只能选同一类型的座位');
  652. return
  653. }
  654. row.isSelect = !row.isSelect
  655. if(row.isSelect){
  656. this.seatSelectList.push(JSON.parse(JSON.stringify(row)))
  657. }else {
  658. let list = JSON.parse(JSON.stringify(this.seatSelectList))
  659. list.forEach((item,index)=>{
  660. if(item.id == row.id) {
  661. this.seatSelectList.splice(index, 1)
  662. }
  663. })
  664. }
  665. //this.$forceUpdate()
  666. }
  667. },
  668. /** 删除已选座位 */
  669. delSeatSelect(row){
  670. // row.isSelect = !row.isSelect
  671. // if(row.isSelect){
  672. // this.seatSelectList.push(JSON.parse(JSON.stringify(row)))
  673. // }else {
  674. // let list = JSON.parse(JSON.stringify(this.seatSelectList))
  675. // list.forEach((item,index)=>{
  676. // if(item.id == row.id) {
  677. // this.seatSelectList.splice(index, 1)
  678. // }
  679. // })
  680. // }
  681. let list = JSON.parse(JSON.stringify(this.seatSelectList))
  682. list.forEach((item,index)=>{
  683. if(item.id == row.id) {
  684. this.seatSelectList.splice(index, 1)
  685. }
  686. })
  687. Object.keys(this.seatMapList).forEach((item1,index)=>{
  688. this.seatMapList[item1].forEach((item,index)=>{
  689. if(item.id == row.id) {
  690. item.isSelect = !item.isSelect
  691. }
  692. })
  693. })
  694. this.$forceUpdate()
  695. },
  696. increaseViewersFun(){
  697. if(this.seatSelectList.length>0){
  698. // if(this.ifRealUser != 0 || this.ifRealTeam != 0 ) {
  699. // if(this.personnelNum != 0) {
  700. // if( this.seatSelectList.length != this.personnelNum ) {
  701. // this.$message.error(`票务类型设置了实名要求,选择人数为${ this.personnelNum }人`);
  702. // return
  703. // }
  704. // }
  705. // }
  706. if(this.personnelNum != 0) {
  707. if( this.seatSelectList.length != this.personnelNum ) {
  708. this.$message.error(`票务类型设置了实名要求,选择人数为${ this.personnelNum }人`);
  709. return
  710. }
  711. }
  712. this.changePerformId(this.queryParams.timeId)
  713. this.$refs.increaseViewers.initData(this.seatSelectList,{
  714. ...this.queryParams,
  715. performId:this.performId,
  716. ifRealUser: this.ifRealUser, // 散客是否实名:0-否 1-是
  717. ifRealTeam: this.ifRealTeam, // 团购是否实名:0否 1-是
  718. oneMany: this.oneMany, // 证件要求: 1一证一票,2一证多票
  719. personnelNum: this.personnelNum, // 人员要求:0-表示不限制 其他数字表示限制人数
  720. })
  721. }else {
  722. this.$alert('请先选择座位!!!', '提示', {
  723. confirmButtonText: '确定',
  724. callback: action => {
  725. }
  726. });
  727. }
  728. },
  729. /** 弹窗关闭 */
  730. clearDialogVisible(){
  731. //this.
  732. this.querySeatListFun(true)
  733. },
  734. /** 选择tab */
  735. handleClickTab(){
  736. },
  737. /** 获取座位类型 说明 */
  738. getSeatTypeList() {
  739. getSeatType({
  740. pageNum: 1,
  741. pageSize: 999,
  742. })
  743. .then(response => {
  744. this.seatTypeList = response.data.rows;
  745. }
  746. );
  747. },
  748. /** 显示座位类型 */
  749. setSeatTypeShow(value){
  750. let srt = ''
  751. this.seatTypeList.forEach((item,index)=>{
  752. if(value == item.id) {
  753. srt = item.name
  754. }
  755. })
  756. return srt
  757. },
  758. // 获取限购标准
  759. async getGoodsPerformFun(id){
  760. try {
  761. let res = await getGoodsPerformApi({
  762. goodsId: id
  763. })
  764. if(res.code == 200) {
  765. this.ifRealUser = res.data.ifRealUser // 散客是否实名:0-否 1-是
  766. this.ifRealTeam = res.data.ifRealTeam // 团购是否实名:0否 1-是
  767. this.oneMany = res.data.oneMany // 证件要求: 1一证一票,2一证多票
  768. this.personnelNum = res.data.personnelNum // 人员要求:0-表示不限制 其他数字表示限制人数
  769. }else {
  770. this.ifRealUser = 0 // 散客是否实名:0-否 1-是
  771. this.ifRealTeam = 0 // 团购是否实名:0否 1-是
  772. this.oneMany = 1 // 证件要求: 1一证一票,2一证多票
  773. this.personnelNum = 0 // 人员要求:0-表示不限制 其他数字表示限制人数
  774. }
  775. } catch (error) {
  776. this.ifRealUser = 0 // 散客是否实名:0-否 1-是
  777. this.ifRealTeam = 0 // 团购是否实名:0否 1-是
  778. this.oneMany = 1 // 证件要求: 1一证一票,2一证多票
  779. this.personnelNum = 0 // 人员要求:0-表示不限制 其他数字表示限制人数
  780. }
  781. },
  782. /** 获取锁定人和锁定备注 */
  783. async lockOrUnLockDeatilFun(e,item) {
  784. try {
  785. if(this.lckTime) {
  786. clearTimeout(this.lckTime)
  787. }
  788. if(item.occupyStatus !== 0) {
  789. this.isLcokShow = false
  790. return
  791. }
  792. if(item.id == this.seatId){ return }
  793. this.seatId = item.id
  794. this.isLcokShow = false
  795. this.lckTime = setTimeout(async ()=>{
  796. let res = await lockOrUnLockApi({
  797. auditoriumId: this.queryParams.auditoriumId,
  798. timeId: this.queryParams.timeId,
  799. seatId: item.id
  800. })
  801. if (res.code == 200) {
  802. this.isLcokShow = true
  803. this.lockObj = {
  804. remark: res.data.remark,
  805. auth: res.data.createBy
  806. }
  807. this.lockStyle = {
  808. position: "fixed",
  809. top: (e.y + 10) + 'px',
  810. left: (e.x + 10)+ 'px',
  811. zIndex: 999999
  812. }
  813. } else {
  814. this.handleClose()
  815. }
  816. },500)
  817. } catch (error) {
  818. this.handleClose()
  819. }
  820. },
  821. lockOrUnLockDeatilFun1() {
  822. this.isLcokShow = false
  823. this.seatId = null
  824. }
  825. }
  826. };
  827. </script>
  828. <style>
  829. .lock-style-box {
  830. padding: 10px;
  831. border-radius: 10px;
  832. position: fixed;
  833. z-index: 99999;
  834. background-color: rgba(0,0,0,0.5);
  835. color: #fff;
  836. font-size: 12px;
  837. }
  838. </style>
  839. <style lang="scss" scoped>
  840. .app-container-me {
  841. width: 100%;
  842. height: calc( 100vh - 120px );
  843. }
  844. .seat-tool-box {
  845. height: 20px;
  846. box-sizing: border-box;
  847. display: flex;
  848. align-items: center;
  849. span{
  850. flex-shrink: 0;
  851. font-size: 12px;
  852. }
  853. .seat-tool-box-slider {
  854. width: 100px;
  855. margin-left: 10px;
  856. }
  857. }
  858. .seat-box {
  859. width: 100%;
  860. height: calc( 100% - 100px ) ;
  861. box-sizing: border-box;
  862. display: flex;
  863. position: relative;
  864. .seat-list-box {
  865. width: calc(100% - 210px);
  866. //width: 100%;
  867. height: 100%;
  868. box-sizing: border-box;
  869. position: relative;
  870. }
  871. .seat-select-box {
  872. width: 200px;
  873. height: 100%;
  874. flex-shrink: 0;
  875. box-sizing: border-box;
  876. padding: 0 5px;
  877. margin-left: 10px;
  878. border: 1px solid #ccc;
  879. border-radius: 10px;
  880. .seat-select-info {
  881. width: 100%;
  882. height: calc( 100% - 60px );
  883. overflow: hidden;
  884. overflow-y: auto;
  885. .seat-select-item {
  886. border: 1px solid #ccc;
  887. margin-bottom: 5px;
  888. padding: 5px;
  889. border-radius: 5px;
  890. display: flex;
  891. justify-content: space-between;
  892. align-items: center;
  893. font-size: 12px;
  894. >div:first-child {
  895. display: flex;
  896. flex-direction: column;
  897. span:first-child {
  898. font-weight: 600;
  899. }
  900. }
  901. >div:last-child {
  902. span:first-child {
  903. color: #f56c6c;
  904. cursor: pointer;
  905. }
  906. }
  907. }
  908. .seat-select-color-item {
  909. display: flex;
  910. align-items: center;
  911. margin-bottom: 5px;
  912. >span:first-child {
  913. width: 20px;
  914. height: 20px;
  915. flex-shrink: 0;
  916. }
  917. >span:last-child {
  918. font-size: 16px;
  919. font-weight: 600;
  920. margin-left: 10px;
  921. }
  922. }
  923. }
  924. }
  925. }
  926. .seat-list-box::before {
  927. content: "舞台";
  928. position: absolute;
  929. left: 50%;
  930. transform: translateX(-50%);
  931. width: 300px;
  932. height: 30px;
  933. background-color: rgb(204, 204, 204,0.5);
  934. font-size: 18px;
  935. font-weight: 600;
  936. display: flex;
  937. align-items: center;
  938. justify-content: center;
  939. border-radius: 0 0 20px 20px;
  940. z-index: 99;
  941. }
  942. .dialog {
  943. padding: 30px 10px 10px;
  944. width: 100%;
  945. height: 100%;
  946. box-sizing: border-box;
  947. overflow: auto;
  948. border-radius: 10px;
  949. border: 1px solid #323333;
  950. position: relative;
  951. .dialog-box {
  952. position: relative;
  953. }
  954. .upload-btn {
  955. width: 100px;
  956. height: 100px;
  957. background-color: #fbfdff;
  958. border: dashed 1px #c0ccda;
  959. border-radius: 5px;
  960. i {
  961. font-size: 30px;
  962. margin-top: 20px;
  963. }
  964. &-text {
  965. margin-top: -10px;
  966. }
  967. }
  968. .avatar {
  969. cursor: pointer;
  970. }
  971. .title-class{
  972. font-size: 16px;
  973. font-weight: bold;
  974. color: black;
  975. margin-bottom: 20px;
  976. margin-top: 20px;
  977. }
  978. .item-class{
  979. margin-bottom: 20px;
  980. }
  981. .seat-box-class{
  982. padding: 5px;
  983. transform-origin: 50% 0;
  984. transform: scale(var(--scaleNum));
  985. box-sizing: border-box;
  986. .disabled-class{
  987. background-color: #ffffff;
  988. border: none !important;
  989. user-select: none;
  990. // pointer-events: none;
  991. cursor: not-allowed !important;
  992. .text-class {
  993. color: #fff !important;
  994. }
  995. }
  996. .select-class{
  997. //background-color: #e85353 !important;
  998. border: 5px solid #1890ff !important;
  999. // color: #eceaea !important;
  1000. position: relative;
  1001. }
  1002. /** 手动锁定 */
  1003. .occupy-status:after{
  1004. content:"";
  1005. display:block;
  1006. position:absolute;
  1007. top:0;
  1008. left:0;
  1009. width:100%;
  1010. height:100%;
  1011. background-color:rgba(0,0,0,0.3);
  1012. z-index:-1;
  1013. background-image: url('../../assets/jinzhi_1.png');
  1014. background-size: 50% 50%;
  1015. background-position: 50% 50%;
  1016. background-repeat: no-repeat;
  1017. z-index: 99;
  1018. }
  1019. .occupy-status {
  1020. //pointer-events: none;
  1021. }
  1022. /** 锁定被选择 */
  1023. .occupy-status-select {
  1024. border: 5px solid #ff182f !important;
  1025. }
  1026. /** 订单待支付锁定 */
  1027. .order-occupy-status {
  1028. }
  1029. .order-occupy-status:after{
  1030. content:"";
  1031. display:block;
  1032. position:absolute;
  1033. top:0;
  1034. left:0;
  1035. width:100%;
  1036. height:100%;
  1037. background-color:rgba(0,0,0,0.3);
  1038. z-index:-1;
  1039. background-image: url('../../assets/jinzhi.png');
  1040. background-size: 50% 50%;
  1041. background-position: 50% 50%;
  1042. background-repeat: no-repeat;
  1043. z-index: 99;
  1044. }
  1045. .occupy-status-no {
  1046. background-color: #f56c6c !important;
  1047. user-select: none;
  1048. // pointer-events: none;
  1049. cursor: not-allowed !important;
  1050. position: relative;
  1051. }
  1052. /* .occupy-status-no:after{
  1053. content:"";
  1054. display:block;
  1055. position:absolute;
  1056. top:0;
  1057. left:0;
  1058. width:100%;
  1059. height:100%;
  1060. background-color:rgba(0,0,0,0.3);
  1061. z-index:-1;
  1062. background-image: url('../../assets/jinzhi_1.png');
  1063. background-size: 50% 50%;
  1064. background-position: 50% 50%;
  1065. background-repeat: no-repeat;
  1066. z-index: 99;
  1067. } */
  1068. .seat-item-class-box {
  1069. width: 100%;
  1070. display: flex;
  1071. flex-wrap: nowrap;
  1072. justify-content: center;
  1073. margin: auto 0;
  1074. text-align: center;
  1075. }
  1076. .seat-item-class{
  1077. flex-shrink: 0;
  1078. display: block;
  1079. float: left;
  1080. width: 60px;
  1081. height: 60px;
  1082. margin: 5px;
  1083. border: 1px solid #4c4d4d;
  1084. border-radius: 3px;
  1085. cursor: pointer;
  1086. position: relative;
  1087. user-select: none;
  1088. // transform-origin: 50% 50%;
  1089. // transform: scale(var(--scaleNum));
  1090. z-index: 999;
  1091. &:hover{
  1092. opacity: 0.6;
  1093. }
  1094. .text-class{
  1095. font-size: 12px;
  1096. padding: 5px;
  1097. line-height: 16px;
  1098. margin: 0;
  1099. color: #000;
  1100. }
  1101. }
  1102. }
  1103. .seat-box-class-row {
  1104. display: flex !important;
  1105. align-items: center;
  1106. user-select: none;
  1107. cursor: not-allowed !important;
  1108. border: none !important;
  1109. font-weight: 600;
  1110. font-size: 24px;
  1111. }
  1112. .seat-item-class-column {
  1113. display: flex !important;
  1114. align-items: center;
  1115. justify-content: center;
  1116. user-select: none;
  1117. cursor: not-allowed !important;
  1118. border: none !important;
  1119. font-weight: 600;
  1120. font-size: 24px;
  1121. }
  1122. }
  1123. .dialog::-webkit-scrollbar {
  1124. width: 10x !important;
  1125. height: 10px !important;
  1126. }
  1127. .dialog::-webkit-scrollbar {
  1128. width: 10px;
  1129. height: 10px;
  1130. opacity: 0.5;
  1131. }
  1132. .dialog::-webkit-scrollbar-thumb {
  1133. border-radius: 15px;
  1134. //background-color: #0257aa;
  1135. }
  1136. #moveSelected{
  1137. position:absolute;
  1138. background-color: blue;
  1139. opacity:0.3;
  1140. border:1px dashed #d9d9d9;
  1141. top:0;
  1142. left:0;
  1143. }
  1144. </style>