ticketingSales.vue 43 KB

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