applicationDetails.vue 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037
  1. <!--
  2. * @Description: 详情弹框
  3. * @Author: Sugar.
  4. * @Date: 2023-11-24 13:55:00
  5. * @LastEditors: Sugar.
  6. * @LastEditTime: 2023-11-24 13:55:00
  7. * @FilePath: \cattle_webui\src\views\team\applicationMr\applicationDetails.vue
  8. * @Copyright: Copyright (c) 2016~2023 by Sugar., All Rights Reserved.
  9. -->
  10. <template>
  11. <el-dialog
  12. :title="title"
  13. :visible.sync="open"
  14. :width="detailsType?'95%':'800px'"
  15. append-to-body
  16. :close-on-click-modal="false"
  17. @close="cancel"
  18. >
  19. <div v-loading="initLoading" class="dialog dialog-bbb" :style="{'--widdd': detailsType?'500px':'100%'}" v-if="form">
  20. <div>
  21. <!-- 基础信息 -->
  22. <div class="title-class" style="margin-top: 0">基础信息</div>
  23. <el-row>
  24. <el-col :span="12">
  25. <div class="grid-content bg-purple item-class">团队名称: <span>{{ details.teamName || ''}}</span></div>
  26. </el-col>
  27. <el-col :span="12">
  28. <div class="grid-content bg-purple item-class">团队类型: <span><dict-tag style="display: inline-block" :options="dict.type.team_type" :value="details.teamType"/></span></div>
  29. </el-col>
  30. <el-col :span="12">
  31. <div class="grid-content bg-purple item-class">预约场馆: <span>{{ details.theatreName || '' }}</span></div>
  32. </el-col>
  33. <el-col :span="12">
  34. <div class="grid-content bg-purple item-class">预约演出厅: <span>{{ details.auditoriumName || '' }}</span></div>
  35. </el-col>
  36. <el-col :span="12">
  37. <div class="grid-content bg-purple item-class">预约剧目: <span>{{ details.performName || '' }}</span></div>
  38. </el-col>
  39. <el-col :span="12">
  40. <div class="grid-content bg-purple item-class">票务名称: <span>{{ details.goodsName || '' }}</span></div>
  41. </el-col>
  42. <el-col :span="12">
  43. <div class="grid-content bg-purple item-class">座位类型: <span>{{ details.seatTypeName || '' }}</span></div>
  44. </el-col>
  45. <el-col :span="12">
  46. <div class="grid-content bg-purple item-class">团购单价: <span>¥{{ details.price || '' }}</span></div>
  47. </el-col>
  48. <el-col :span="12">
  49. <div class="grid-content bg-purple item-class">预约时间: <span>{{ details.performDate || '' }}日 {{ details.performTimeStart +' --' || '' }} {{ details.performTimeEnd || '' }}</span></div>
  50. </el-col>
  51. <el-col :span="12">
  52. <div class="grid-content bg-purple item-class">报名时间: <span>{{ details.createTime || '' }}</span></div>
  53. </el-col>
  54. <el-col :span="12">
  55. <div class="grid-content bg-purple item-class">负责人: <span>{{ details.teamContact || '' }}</span></div>
  56. </el-col>
  57. <el-col :span="12">
  58. <div class="grid-content bg-purple item-class">联系电话: <span>{{ details.teamMobile || '' }}</span></div>
  59. </el-col>
  60. <el-col :span="12" v-if="details.errReason">
  61. <div class="grid-content bg-purple item-class">驳回原因: <span style="color: red;">{{ details.errReason || '' }}</span></div>
  62. </el-col>
  63. </el-row>
  64. <!-- 观影人员信息 -->
  65. <div class="title-class">观影人员信息</div>
  66. <el-row>
  67. <el-col :span="24">
  68. <el-table size="mini" ref="tables" :data="details.viewersList" border>
  69. <el-table-column label="序号" align="center" type="index" width="60"></el-table-column>
  70. <el-table-column label="姓名" align="center" prop="name" />
  71. <el-table-column label="身份证号码" align="center" prop="cardId" />
  72. </el-table>
  73. </el-col>
  74. </el-row>
  75. </div>
  76. <div class="dialog-bbb_2" v-if="detailsType">
  77. <div class="seat-tool-box">
  78. <span class="demonstration">座位大小</span>
  79. <div class="seat-tool-box-slider">
  80. <el-slider
  81. v-model="scaleNum"
  82. :min="30"
  83. :max="100"
  84. @change="scaleNumChange"
  85. ></el-slider>
  86. </div>
  87. <div style="display: flex;margin-left: 20px;" v-if="seatMapList&&JSON.stringify(seatMapList) != '{}'">
  88. <div>座位余量:</div>
  89. <div
  90. :key="index"
  91. v-for="(item,index) in seatTypeList"
  92. style="margin-left: 10px;align-items: center;"
  93. >
  94. <span :style="{color: item.color?item.color:'none'}">{{item.name ? (item.name+'(剩余:'+ (item.num||0) +')') : '暂未命名'}}</span>
  95. </div>
  96. </div>
  97. </div>
  98. <div class="seat-box" :style="{'--scaleNum': scaleNum/100}">
  99. <!-- 选择座位 -->
  100. <div
  101. class="seat-list-box">
  102. <!-- 座位排版 -->
  103. <div
  104. id="sm-scroll-box_1"
  105. ref="seatbox"
  106. class="dialogss"
  107. @mousedown="mousedownFun"
  108. @mouseleave="mouseleaveFun"
  109. >
  110. <div class="dialogss-box" :style="{width: width*(scaleNum/100) + 'px', margin: justifyContent ? 'auto' : 'unset'}">
  111. <div
  112. style="width: 100%;position: absolute;"
  113. class="seat-box-class clearfix"
  114. v-if="seatMapList"
  115. >
  116. <div
  117. class="seat-item-class-box"
  118. v-for="(item1, index1) in seatMapListKey"
  119. :key="item1.key"
  120. >
  121. <!-- @click.stop="seatClick(item)" -->
  122. <div
  123. class="seat-item-class seat-item-class_1"
  124. :class="setSeatClass(item)"
  125. v-for="(item, index) in seatMapList[item1.key]"
  126. :style="{backgroundColor: item.color ? item.color : 'none'}"
  127. :dragSelectId="item.id"
  128. :index="item1.key +'_'+ index"
  129. :key="index">
  130. <p
  131. class="text-class"
  132. :dragSelectId="item.id"
  133. :index="item1.key +'_'+ index"
  134. >{{ item.status != 1 ? '不可售':(item.name ? item.name : '暂未命名') }}</p>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <!-- 鼠标拖拽出的遮罩 (定位为 position:absolute)-->
  140. <!-- 遮罩最好是在绑定了mouseover事件的元素内部,并且不要阻止遮罩的冒泡事件。这样鼠标移到了遮罩上面,依然可以利用冒泡执行父元素的mouseover事件,就不会出现遮罩只能扩大,不能缩小的情况了(亲自试过) -->
  141. <div id="moveSelected_1"></div>
  142. </div>
  143. <div style="margin-top: 5px; margin-left: 30px;display: flex;">
  144. <div style="flex-shrink: 0;">
  145. 已勾选:{{ seatSelectList.length }}个座位
  146. <el-button size="mini" type="warning" @click="clearSeatSelectListAll">清空已选座位</el-button>
  147. </div>
  148. </div>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. <span slot="footer" class="dialog-footer" v-if="!detailsType">
  154. <el-button type="primary" @click="cancel">关闭</el-button>
  155. </span>
  156. <span slot="footer" class="dialog-footer" v-if="detailsType">
  157. <!-- <el-button type="primary" @click="passOpenEven" style="margin-right: 20px">通过</el-button> -->
  158. <el-button
  159. type="primary"
  160. @click="submitPass"
  161. :loading="loading"
  162. >
  163. <span v-if="loading">提交中...</span>
  164. <span v-else>通过</span>
  165. </el-button>
  166. <el-button type="danger" @click="setRejectOpen" >驳回</el-button>
  167. </span>
  168. <!-- 审核驳回 -->
  169. <el-dialog
  170. title="审核驳回"
  171. :visible.sync="rejectOpen"
  172. width="700px"
  173. append-to-body
  174. :close-on-click-modal="false"
  175. @close="rejectOpen = false"
  176. >
  177. <div class="dialog">
  178. <el-form :model="rejectForm" ref="refRejectForm" :rules="rejectRules" label-width="90px">
  179. <el-form-item label="驳回原因:" prop="errReason">
  180. <el-input
  181. type="textarea"
  182. placeholder="请输入驳回原因"
  183. v-model="rejectForm.errReason"
  184. maxlength="300"
  185. show-word-limit
  186. >
  187. </el-input>
  188. </el-form-item>
  189. </el-form>
  190. </div>
  191. <span slot="footer" class="dialog-footer">
  192. <el-button @click="rejectOpen = false">取消</el-button>
  193. <el-button
  194. type="primary"
  195. @click="submitForm"
  196. v-loading.fullscreen.lock="loading"
  197. element-loading-text="提交中..."
  198. element-loading-spinner="el-icon-loading"
  199. element-loading-background="rgba(0, 0, 0, 0.8)"
  200. >
  201. <span v-if="loading">提交中...</span>
  202. <span v-else>保存</span>
  203. </el-button>
  204. </span>
  205. </el-dialog>
  206. <!-- 审核通过 -->
  207. <el-dialog
  208. title="选择座位"
  209. :visible.sync="passOpen"
  210. width="910px"
  211. append-to-body
  212. :close-on-click-modal="false"
  213. @close="passOpen = false"
  214. >
  215. <!-- 座位排版 -->
  216. <div class="dialog">
  217. <div class="seat-box-class1 clearfix" v-if="seatMapList && seatMapList.length > 0">
  218. <div class="seat-item-class" :class="item.isDisabled ? 'disabled-class' : item.isSelect ? 'select-class' : ''" v-for="(item, index) in seatMapList" @click="seatClick(item)" :key="index">
  219. <p class="text-class">{{item.name ? item.name : (item.rowNo + '排' + item.columnNo + '座')}}</p>
  220. </div>
  221. </div>
  222. </div>
  223. <div style="margin-top: 5px; margin-left: 30px">已勾选:{{ seatSelectList.length }}个座位</div>
  224. <span slot="footer" class="dialog-footer">
  225. <el-button @click="passOpen = false">取消</el-button>
  226. <el-button
  227. type="primary"
  228. @click="submitPass"
  229. v-loading.fullscreen.lock="passLoading"
  230. element-loading-text="提交中..."
  231. element-loading-spinner="el-icon-loading"
  232. element-loading-background="rgba(0, 0, 0, 0.8)"
  233. >
  234. <span v-if="passLoading">提交中...</span>
  235. <span v-else>保存</span>
  236. </el-button>
  237. </span>
  238. </el-dialog>
  239. </el-dialog>
  240. </template>
  241. <script>
  242. import { getSelectById, teamApplyAudit, querySeatList } from '@/api/team/applicationMr'
  243. import { updateStatus } from '@/api/team/ticketMr'
  244. import { pageList as getSeatType } from '@/api/seatTypeMr/seatTypeMr'
  245. import selectListMixin from "../mixins/selectList"
  246. export default {
  247. name: "applicationDetails",
  248. props: {
  249. dict: {
  250. type: Object,
  251. default: () => [],
  252. },
  253. },
  254. mixins: [selectListMixin],
  255. data() {
  256. return {
  257. title: "编辑",
  258. model: "EDIT",
  259. open: false,
  260. rejectOpen: false,
  261. passOpen: false,
  262. initLoading: false,
  263. loading: false,
  264. passLoading: false,
  265. form: {
  266. id: undefined,
  267. },
  268. details: {},
  269. performerVisible: false,
  270. performerList: [],
  271. refund: false,
  272. rejectRules: {
  273. errReason: [{ required: true, message: "请输入驳回原因", trigger: ["change","blur"] }],
  274. },
  275. dataList: [],
  276. rejectForm: {
  277. status: 2
  278. },
  279. detailsType: false,
  280. //seatMapList: [], // 座位集合
  281. applyId: '', // 申请单id
  282. applyMap: {},
  283. //setList: [],
  284. seatSelectList: [],
  285. merchantTheatreAuditoriumListS: [], // 演出厅
  286. merchantPerformTimeListS: [], // 场次
  287. querySeatListS: [], // 座位
  288. goodsPageListS: [], // 票务
  289. goodsPageListSAll: [], // 票务全部
  290. setList: [],
  291. seatMapList: {},
  292. seatMapListKey: [], // key
  293. seatSelectList: [],
  294. lockOrUnLockLoading: false,
  295. performId: '',// 剧目ID
  296. scaleNum: 30,
  297. width: 0,
  298. justifyContent: false,
  299. activeName: 'first',
  300. seatTypeList: [],
  301. };
  302. },
  303. created() {
  304. this.getSeatTypeList()
  305. },
  306. methods: {
  307. /**
  308. * 打开弹框
  309. * @date 2023-11-22
  310. * @param {any} obj
  311. * @returns {any}
  312. */
  313. openDialog(title, obj, type) {
  314. this.initLoading = true
  315. this.open = true;
  316. this.rejectOpen = false;
  317. this.passOpen = false;
  318. this.applyId = obj.id;
  319. this.applyMap = obj;
  320. this.querySeatListS = [];
  321. this.setList = [];
  322. this.seatSelectList = [];
  323. this.flag = false
  324. this.isMousemovs = false
  325. if(type) {
  326. this.detailsType = true
  327. this.title = '审核'
  328. } else {
  329. this.detailsType = false
  330. this.title = '详情'
  331. }
  332. this.getSelectByIdApi(obj);
  333. },
  334. /** 获取详情 */
  335. async getSelectByIdApi(row) {
  336. try {
  337. const id = row.id
  338. let res = await getSelectById(id)
  339. this.details = {}
  340. this.details = res.data;
  341. if(this.detailsType){
  342. let res1 = await querySeatList({
  343. auditoriumId: this.applyMap.auditoriumId,
  344. //seatTypeId: this.applyMap.seatTypeId,
  345. timeId: this.applyMap.performTimeId,
  346. })
  347. this.querySeatListS = res1.data;
  348. this.setList = res1.data;
  349. if(this.setList && this.setList.length > 0) {
  350. this.setSeatMapListCopy(this.setList);
  351. }
  352. this.$nextTick(()=>{
  353. this.scaleNumChange()
  354. })
  355. }
  356. this.initLoading = false
  357. } catch (error) {
  358. this.initLoading = false
  359. }
  360. },
  361. /** 获取座位信息 */
  362. getSeatApi(row) {
  363. let map = {
  364. auditoriumId: this.applyMap.auditoriumId,
  365. seatTypeId: this.applyMap.seatTypeId,
  366. timeId: this.applyMap.performTimeId,
  367. }
  368. querySeatList(map).then(response => {
  369. this.setList = response.data;
  370. if(this.setList && this.setList.length > 0) {
  371. this.setSeatMapList(this.setList);
  372. }
  373. });
  374. },
  375. // 设置座位集合
  376. setSeatMapList(list) {
  377. if(list && list.length > 0) {
  378. let listCopy = {}
  379. list.forEach(item => {
  380. item.isDisabled = item.status!=1||((item.occupyStatus != null && (item.occupyStatus == 0 || item.occupyStatus == 1)) ? true : false); // 座位是否已被选择
  381. item.isSelect = false;
  382. if(!listCopy['key_'+item.rowNo]) {
  383. listCopy['key_'+item.rowNo] = [item]
  384. }else {
  385. listCopy['key_'+item.rowNo].push(item)
  386. }
  387. //this.seatMapList.push(item)
  388. })
  389. let listCopy2 = Object.keys(listCopy)
  390. let listCopy3 = []
  391. listCopy2.forEach((item)=>{
  392. listCopy3.push({
  393. key: item,
  394. sort: Number(item.replace('key_',''))
  395. })
  396. })
  397. listCopy3.sort((a,b)=>{
  398. return a.sort - b.sort
  399. })
  400. let listCopy1 = []
  401. listCopy3.forEach((item,index)=>{
  402. listCopy1 = listCopy1.concat(listCopy[item.key])
  403. })
  404. this.seatMapList = [].concat(listCopy1)
  405. }
  406. },
  407. // 座位点击事件
  408. seatClickCopy(rowCopy) {
  409. let row = JSON.parse(JSON.stringify(rowCopy))
  410. console.log("row111===",row)
  411. if(row.occupyStatus == 0){
  412. console.log("weqwrwerewrer")
  413. this.$confirm('此座已被锁定,请先解锁', '提示', {
  414. confirmButtonText: '关闭',
  415. cancelButtonText: '取消',
  416. type: 'warning'
  417. }).then(() => {
  418. //this.lockOrUnLockFun([row],1)
  419. }).catch((error) => {
  420. console.log("error====",error)
  421. });
  422. }else if(row.isDisabled || row.status == 2){
  423. return false
  424. }else {
  425. if(this.applyMap.seatTypeId != row.seatTypeId){
  426. this.$message.error('只能选同一类型的座位');
  427. return false
  428. }
  429. row.isSelect = !row.isSelect
  430. if(row.isSelect){
  431. if(this.seatSelectList.length >= this.details.viewersList.length ){
  432. this.$message.error("观影人数限制" + this.details.viewersList.length + "人!");
  433. return false
  434. }
  435. this.seatSelectList.push(JSON.parse(JSON.stringify(row)))
  436. }else {
  437. let indexs = null;
  438. this.seatSelectList.forEach((item, index) =>{
  439. if(item.id == row.id){
  440. indexs = index;
  441. }
  442. })
  443. if(indexs != null) {
  444. this.seatSelectList.splice(indexs, 1)
  445. }
  446. }
  447. //this.seatSelectList = this.setList.filter(item => item.isSelect);
  448. console.log("this.seatSelectList===",this.seatSelectList)
  449. //this.$forceUpdate()
  450. return true
  451. }
  452. },
  453. seatClick(row) {
  454. console.log("row===",row)
  455. if(row.occupyStatus == 0){
  456. console.log("weqwrwerewrer")
  457. this.$confirm('此座已被锁定,请先解锁', '提示', {
  458. confirmButtonText: '关闭',
  459. cancelButtonText: '取消',
  460. type: 'warning'
  461. }).then(() => {
  462. //this.lockOrUnLockFun([row],1)
  463. }).catch((error) => {
  464. console.log("error====",error)
  465. });
  466. }else if(row.isDisabled || row.status == 2){
  467. return false
  468. }else {
  469. if(this.applyMap.seatTypeId != row.seatTypeId){
  470. this.$message.error('只能选同一类型的座位');
  471. return
  472. }
  473. if(this.seatSelectList.length >= this.details.viewersList.length ){
  474. if(row.isSelect) {
  475. let indexs = null;
  476. this.seatSelectList.forEach((item, index) =>{
  477. if(item.id == row.id){
  478. indexs = index;
  479. }
  480. })
  481. if(indexs != null) {
  482. row.isSelect = !row.isSelect;
  483. this.seatSelectList.splice(indexs, 1)
  484. }
  485. } else {
  486. this.$message.error("观影人数限制" + this.details.viewersList.length + "人!");
  487. }
  488. return false
  489. }
  490. row.isSelect = !row.isSelect
  491. if(row.isSelect){
  492. this.seatSelectList.push(JSON.parse(JSON.stringify(row)))
  493. }else {
  494. let indexs = null;
  495. this.seatSelectList.forEach((item, index) =>{
  496. if(item.id == row.id){
  497. indexs = index;
  498. }
  499. })
  500. if(indexs != null) {
  501. this.seatSelectList.splice(indexs, 1)
  502. }
  503. }
  504. //this.seatSelectList = this.setList.filter(item => item.isSelect);
  505. console.log("this.seatSelectList===",this.seatSelectList)
  506. this.$forceUpdate()
  507. }
  508. },
  509. // 审核通过
  510. passOpenEven() {
  511. this.passOpen = true;
  512. this.seatMapList = [];
  513. this.seatSelectList = [];
  514. this.getSeatApi();
  515. //this.setSeatMapList()
  516. },
  517. /**
  518. * 保存
  519. * @date 2023-11-22
  520. * @returns {any}
  521. */
  522. submitForm() {
  523. this.$refs["refRejectForm"].validate(async (valid) => {
  524. if (valid) {
  525. try {
  526. this.loading = true;
  527. setTimeout(() => {
  528. this.loading = false;
  529. }, 3000)
  530. this.rejectForm.applyId = this.details.id || this.applyId;
  531. const { code } = await teamApplyAudit({ ...this.rejectForm });
  532. if (code === 200) {
  533. this.loading = false;
  534. this.rejectOpen = false;
  535. this.$message.success("操作成功!");
  536. this.$emit("getList");
  537. this.cancel();
  538. }
  539. } catch (error) {
  540. this.loading = false;
  541. } finally {
  542. }
  543. }
  544. });
  545. },
  546. // 审核通过 - 座位选择保存
  547. submitPass() {
  548. try {
  549. // this.passLoading = true;
  550. //let seatList = this.setList.filter(item => item.isSelect);
  551. let seatList = this.seatSelectList
  552. if(seatList && seatList.length > 0 && this.seatSelectList.length == this.details.viewersList.length ) {
  553. this.passLoading = true;
  554. let postMap = {
  555. applyId: this.details.id || this.applyId,
  556. status: 1,
  557. seatList: seatList
  558. }
  559. teamApplyAudit(postMap).then((res) => {
  560. this.passLoading = false;
  561. if (res.code == 200) {
  562. this.$message.success("操作成功!");
  563. this.passOpen = false;
  564. this.$emit("getList");
  565. this.cancel();
  566. }
  567. }).catch(()=>{
  568. this.passLoading = false;
  569. })
  570. } else {
  571. this.$message.error("请选择座位!");
  572. }
  573. } catch (error) {
  574. this.passLoading = false;
  575. } finally {
  576. }
  577. },
  578. /**
  579. * 关闭弹框
  580. * @date 2023-11-22
  581. * @returns {any}
  582. */
  583. cancel() {
  584. this.open = false;
  585. },
  586. setRejectOpen() {
  587. this.rejectOpen = true
  588. this.$set(this.rejectForm,'errReason','')
  589. this.$nextTick(()=>{
  590. this.$refs.refRejectForm.clearValidate('errReason')
  591. })
  592. },
  593. // 设置座位集合
  594. setSeatMapListCopy(list) {
  595. if(list && list.length > 0) {
  596. let listCopy = {}
  597. let lisyCopy1 = {}
  598. let listNum = JSON.parse(JSON.stringify(this.seatTypeList))
  599. listNum.forEach((item,index)=>{
  600. listNum[index]['num'] = 0
  601. })
  602. list.forEach(item => {
  603. item.isDisabled = (item.occupyStatus != null && (item.occupyStatus == 0 || item.occupyStatus == 1) ? true : false); // 座位是否已被选择
  604. item.isSelect = this.setIsSelect(item);
  605. if(item.rowNo){
  606. listNum.forEach((item1,index)=>{
  607. if(item1.id == item.seatTypeId && item.status ==1 && !item.occupyStatus) {
  608. listNum[index]['num'] = listNum[index]['num'] + 1
  609. }
  610. })
  611. if(listCopy['my'+item.rowNo]){
  612. listCopy['my'+item.rowNo].push(item)
  613. }else {
  614. listCopy['my'+item.rowNo] = [item]
  615. }
  616. }
  617. })
  618. this.seatTypeList = JSON.parse(JSON.stringify(listNum))
  619. let width = 0
  620. let flog = 0
  621. let seatMapListKey = []
  622. Object.keys(listCopy).forEach((item)=>{
  623. if(listCopy[item].length>flog) {
  624. flog = listCopy[item].length
  625. }
  626. seatMapListKey.push({
  627. key: item,
  628. sort: Number(item.replace('my',''))
  629. })
  630. })
  631. seatMapListKey.sort((a,b)=>{
  632. return a.sort - b.sort
  633. })
  634. this.seatMapListKey = seatMapListKey
  635. console.log("seatMapListKey=====",seatMapListKey)
  636. this.width = 70*flog
  637. this.$nextTick(()=>{
  638. if(this.$refs.seatbox) {
  639. var ele = this.$refs.seatbox
  640. console.log(ele.getBoundingClientRect().width); // 100
  641. if(this.width<ele.getBoundingClientRect().width) {
  642. this.justifyContent = true
  643. }else {
  644. //this.justifyContent = false
  645. this.justifyContent = true
  646. }
  647. //this.$refs.seatbox.scrollTo(this.width/4,0)
  648. }
  649. })
  650. console.log("list====",listCopy)
  651. this.seatMapList = JSON.parse(JSON.stringify(listCopy))
  652. }
  653. },
  654. setIsSelect(item){
  655. if(!this.seatSelectList||this.seatSelectList.length==0){
  656. return false
  657. }
  658. let flog = false
  659. this.seatSelectList.forEach((item1,index1)=>{
  660. if(item.id == item1.id){
  661. flog = true
  662. }
  663. })
  664. return flog
  665. },
  666. /** 获取座位类型 说明 */
  667. getSeatTypeList() {
  668. getSeatType({
  669. pageNum: 1,
  670. pageSize: 999,
  671. })
  672. .then(response => {
  673. this.seatTypeList = response.data.rows;
  674. });
  675. },
  676. /** 座位状态 展示 */
  677. setSeatClass(item){
  678. let srt =
  679. item.occupyStatus == 0 ? 'occupy-status' :
  680. item.occupyStatus == 1 ? 'occupy-status-no' :
  681. item.isDisabled || item.status != 1 ? 'disabled-class' :
  682. item.isSelect ? 'select-class' :
  683. item.seatTypeId != this.applyMap.seatTypeId?'disabled-class':''
  684. return srt
  685. }
  686. },
  687. };
  688. </script>
  689. <style lang="scss" scoped>
  690. .dialog {
  691. width: 100%;
  692. height: 70vh;
  693. }
  694. .dialog-bbb {
  695. width: 100%;
  696. display: flex;
  697. >div:first-child {
  698. width: var(--widdd);
  699. flex-shrink: 0;
  700. overflow-y: auto;
  701. padding: 0 0 10px 0;
  702. margin-right: 10px;
  703. }
  704. .dialog-bbb_2 {
  705. width: calc( 100% - var(--widdd) );
  706. height: 100%;
  707. }
  708. }
  709. .dialog {
  710. .upload-btn {
  711. width: 100px;
  712. height: 100px;
  713. background-color: #fbfdff;
  714. border: dashed 1px #c0ccda;
  715. border-radius: 5px;
  716. i {
  717. font-size: 30px;
  718. margin-top: 20px;
  719. }
  720. &-text {
  721. margin-top: -10px;
  722. }
  723. }
  724. .avatar {
  725. cursor: pointer;
  726. }
  727. .title-class{
  728. font-size: 16px;
  729. font-weight: bold;
  730. color: black;
  731. margin-bottom: 20px;
  732. margin-top: 20px;
  733. }
  734. .item-class{
  735. margin-bottom: 20px;
  736. }
  737. .seat-box-class1{
  738. width: 800px;
  739. height: auto;
  740. padding: 5px;
  741. border-radius: 10px;
  742. border: 1px solid #323333;
  743. .disabled-class{
  744. background-color: #aaabad;
  745. }
  746. .select-class{
  747. background-color: #e85353 !important;
  748. color: #eceaea !important;
  749. }
  750. .seat-item-class{
  751. display: block;
  752. float: left;
  753. width: 60px;
  754. height: 60px;
  755. margin: 5px;
  756. border: 1px solid #4c4d4d;
  757. border-radius: 3px;
  758. cursor: pointer;
  759. position: relative;
  760. &:hover{
  761. opacity: 0.6;
  762. }
  763. .text-class{
  764. font-size: 12px;
  765. padding: 5px;
  766. line-height: 16px;
  767. margin: 0;
  768. }
  769. }
  770. }
  771. }
  772. .dialog-bbb_2 {
  773. .seat-tool-box {
  774. height: 20px;
  775. box-sizing: border-box;
  776. display: flex;
  777. align-items: center;
  778. white-space: nowrap;
  779. span{
  780. flex-shrink: 0;
  781. font-size: 12px;
  782. white-space: nowrap;
  783. }
  784. .seat-tool-box-slider {
  785. width: 100px;
  786. margin-left: 10px;
  787. }
  788. }
  789. .seat-box {
  790. width: 100%;
  791. height: calc( 100% - 50px );
  792. box-sizing: border-box;
  793. display: flex;
  794. position: relative;
  795. .seat-list-box {
  796. width: 100%;
  797. height: 100%;
  798. box-sizing: border-box;
  799. position: relative;
  800. }
  801. .seat-select-box {
  802. width: 200px;
  803. height: 100%;
  804. flex-shrink: 0;
  805. box-sizing: border-box;
  806. padding: 0 5px;
  807. margin-left: 10px;
  808. border: 1px solid #ccc;
  809. border-radius: 10px;
  810. .seat-select-info {
  811. width: 100%;
  812. height: calc( 100% - 60px );
  813. overflow: hidden;
  814. overflow-y: auto;
  815. .seat-select-item {
  816. border: 1px solid #ccc;
  817. margin-bottom: 5px;
  818. padding: 5px;
  819. border-radius: 5px;
  820. display: flex;
  821. justify-content: space-between;
  822. align-items: center;
  823. font-size: 12px;
  824. >div:first-child {
  825. display: flex;
  826. flex-direction: column;
  827. span:first-child {
  828. font-weight: 600;
  829. }
  830. }
  831. >div:last-child {
  832. span:first-child {
  833. color: #f56c6c;
  834. cursor: pointer;
  835. }
  836. }
  837. }
  838. .seat-select-color-item {
  839. display: flex;
  840. align-items: center;
  841. margin-bottom: 5px;
  842. >span:first-child {
  843. width: 20px;
  844. height: 20px;
  845. flex-shrink: 0;
  846. }
  847. >span:last-child {
  848. font-size: 16px;
  849. font-weight: 600;
  850. margin-left: 10px;
  851. }
  852. }
  853. }
  854. }
  855. }
  856. .seat-list-box::before {
  857. content: "舞台";
  858. position: absolute;
  859. left: 50%;
  860. transform: translateX(-50%);
  861. width: 300px;
  862. height: 30px;
  863. background-color: rgb(204, 204, 204,0.5);
  864. font-size: 18px;
  865. font-weight: 600;
  866. display: flex;
  867. align-items: center;
  868. justify-content: center;
  869. border-radius: 0 0 20px 20px;
  870. z-index: 99;
  871. }
  872. .dialogss {
  873. padding: 30px 10px 10px;
  874. width: 100%;
  875. height: 100%;
  876. box-sizing: border-box;
  877. overflow: auto;
  878. border-radius: 10px;
  879. border: 1px solid #323333;
  880. position: relative;
  881. .dialogss-box {
  882. position: relative;
  883. }
  884. .upload-btn {
  885. width: 100px;
  886. height: 100px;
  887. background-color: #fbfdff;
  888. border: dashed 1px #c0ccda;
  889. border-radius: 5px;
  890. i {
  891. font-size: 30px;
  892. margin-top: 20px;
  893. }
  894. &-text {
  895. margin-top: -10px;
  896. }
  897. }
  898. .avatar {
  899. cursor: pointer;
  900. }
  901. .title-class{
  902. font-size: 16px;
  903. font-weight: bold;
  904. color: black;
  905. margin-bottom: 20px;
  906. margin-top: 20px;
  907. }
  908. .item-class{
  909. margin-bottom: 20px;
  910. }
  911. .seat-box-class{
  912. padding: 5px;
  913. transform-origin: 50% 0;
  914. transform: scale(var(--scaleNum));
  915. box-sizing: border-box;
  916. .disabled-class{
  917. background-color: #aaabad;
  918. user-select: none;
  919. // pointer-events: none;
  920. cursor: not-allowed !important;
  921. }
  922. .select-class{
  923. //background-color: #e85353 !important;
  924. border: 5px solid #1890ff !important;
  925. // color: #eceaea !important;
  926. position: relative;
  927. }
  928. .occupy-status:after{
  929. content:"";
  930. display:block;
  931. position:absolute;
  932. top:0;
  933. left:0;
  934. width:100%;
  935. height:100%;
  936. background-color:rgba(0,0,0,0.3);
  937. z-index:-1;
  938. background-image: url('../../../../assets/jinzhi.png');
  939. background-size: 50% 50%;
  940. background-position: 50% 50%;
  941. background-repeat: no-repeat;
  942. z-index: 99;
  943. }
  944. .occupy-status {
  945. //pointer-events: none;
  946. }
  947. .occupy-status-no {
  948. background-color: #f56c6c !important;
  949. user-select: none;
  950. // pointer-events: none;
  951. cursor: not-allowed !important;
  952. }
  953. .seat-item-class-box {
  954. width: 100%;
  955. display: flex;
  956. flex-wrap: nowrap;
  957. justify-content: center;
  958. margin: auto 0;
  959. text-align: center;
  960. }
  961. .seat-item-class{
  962. flex-shrink: 0;
  963. display: block;
  964. float: left;
  965. width: 60px;
  966. height: 60px;
  967. margin: 5px;
  968. border: 1px solid #4c4d4d;
  969. border-radius: 3px;
  970. cursor: pointer;
  971. position: relative;
  972. user-select: none;
  973. // transform-origin: 50% 50%;
  974. // transform: scale(var(--scaleNum));
  975. &:hover{
  976. opacity: 0.6;
  977. }
  978. .text-class{
  979. font-size: 12px;
  980. padding: 5px;
  981. line-height: 16px;
  982. margin: 0;
  983. color: #000;
  984. }
  985. }
  986. }
  987. }
  988. }
  989. #moveSelected_1{
  990. position:absolute;
  991. background-color: blue;
  992. opacity:0.3;
  993. border:1px dashed #d9d9d9;
  994. top:0;
  995. left:0;
  996. }
  997. </style>