ticketingSales.vue 43 KB

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