ticketingSales.vue 46 KB

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