ticketingSales copy.vue 37 KB

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