ticketingSales.vue 39 KB

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