ticketingSales.vue 37 KB

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