TicketList.vue 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051
  1. <template>
  2. <div
  3. class="ticket-list-wrap"
  4. :class="{focusFlash:isFocus}">
  5. <div
  6. v-if="!isPeriodTicket"
  7. class="select-date">
  8. <div class="choose-date d-flex">
  9. <div class="top-title">
  10. 游玩日期
  11. </div>
  12. <div class="date-list">
  13. <el-button
  14. v-for="(item,index) in quickDateList"
  15. :key="index"
  16. :type="playDate === item.value ? 'primary' : 'default'"
  17. :class="{ active: item.value === playDate}"
  18. @click="handleDateChange(item.value)">
  19. {{ item.label }}
  20. </el-button>
  21. </div>
  22. </div>
  23. <div class="select-date d-flex" style="margin-left: 90px">
  24. <div class="other-title">其他日期</div>
  25. <el-date-picker
  26. :clearable="false"
  27. :picker-options="dateOption"
  28. v-model="playDate"
  29. type="date"
  30. placeholder="选择日期时间"
  31. @change="handleDateChange"
  32. >
  33. </el-date-picker>
  34. </div>
  35. </div>
  36. <div
  37. v-if="category === 'batch'"
  38. class="select-batch">
  39. <div class="top-title">选择场次</div>
  40. <!-- <div
  41. class="noData"
  42. v-if="!batchList.length">
  43. 暂无数据
  44. </div>
  45. <div class="list-content">
  46. <div
  47. class="list-item"
  48. :class="{
  49. active: currentBatch && currentBatch.batchConfigId === item.batchConfigId,
  50. disabled: item && item.leftNums === 0
  51. }"
  52. v-for="(item, index) in batchList"
  53. :key="`batch-${index}`"
  54. @click="handleBatchChange(item)"
  55. >
  56. <div
  57. class="badge"
  58. v-if="item && item.leftNums === 0">
  59. 停售
  60. </div>
  61. <div class="title">
  62. <span class="name">{{ item.name }}</span>
  63. <span class="time">{{ removeSecond(item.startTime) }}-{{ removeSecond(item.endTime) }}</span>
  64. </div>
  65. <div class="left-count">
  66. 余票:{{ getLeftNums(item) }}
  67. </div>
  68. </div>
  69. </div> -->
  70. <el-table
  71. ref="singleTable"
  72. max-height="200px"
  73. :data="batchList"
  74. :row-key="row => row.id"
  75. highlight-current-row
  76. @current-change="handleBatchChange"
  77. border
  78. stripe>
  79. <el-table-column
  80. prop="name"
  81. label="场次名称"
  82. >
  83. </el-table-column>
  84. <el-table-column
  85. prop="startTime"
  86. label="开始时间"
  87. width="70px"
  88. >
  89. </el-table-column>
  90. <el-table-column
  91. prop="endTime"
  92. label="结束时间"
  93. width="70px"
  94. >
  95. </el-table-column>
  96. <el-table-column
  97. prop="leftNums"
  98. label="剩余数量"
  99. width="70px"
  100. >
  101. <template slot-scope="scope">
  102. <span class="num">{{ scope.row.leftNums === '-1' ? '不限' : scope.row.leftNums }}</span>
  103. </template>
  104. </el-table-column>
  105. </el-table>
  106. </div>
  107. <div class="select-ticket">
  108. <div class="search-ticket d-flex align-center">
  109. <div class="top-title">选择票种</div>
  110. <el-input
  111. ref="quickSearch"
  112. id="quick-search"
  113. clearable
  114. class="search-input"
  115. placeholder="按F2 快速筛选"
  116. v-model="keyword">
  117. <i
  118. class="el-icon-search el-input__icon"
  119. slot="suffix">
  120. </i>
  121. </el-input>
  122. <el-button
  123. v-if="category !== 'batch'"
  124. size="small"
  125. class="sort-btn"
  126. icon="el-icon-sort"
  127. title="票种排序"
  128. @click="openSortDialog">
  129. </el-button>
  130. </div>
  131. <div
  132. :class="['ticket-list', category === 'batch' && 'list-batch']"
  133. v-loading="loading">
  134. <div
  135. class="noData"
  136. v-if="!filterTableData.length">
  137. 暂无数据
  138. </div>
  139. <div class="list-content">
  140. <div
  141. class="list-item"
  142. :class="{
  143. active: currentTicket && currentTicket.id === item.id,
  144. active2: item.isTop && currentTicket && currentTicket.id !== item.id,
  145. disabled: item && item.isSale === 0
  146. }"
  147. v-for="(item, index) in filterTableData"
  148. :key="`ticket-${index}`"
  149. @click="changeTicket(item)"
  150. @contextmenu.prevent="showTopBtn(item)">
  151. <div class="badge" v-if="item && item.isSale === 0">
  152. 停售
  153. </div>
  154. <div class="title">
  155. <el-tooltip
  156. :content="getTicketTip(item)"
  157. placement="top"
  158. effect="dark">
  159. <span @click.stop="showTicketInfo(item)">
  160. {{ item.name }}
  161. </span>
  162. </el-tooltip>
  163. </div>
  164. <span
  165. class="price"
  166. v-if="item.price">
  167. <span class="num">{{ item.price }}</span> 元
  168. </span>
  169. <span
  170. class="price"
  171. v-else>
  172. 无今日价格
  173. </span>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. <ElDialog
  179. :title="ticketDetail.name"
  180. width="650px"
  181. v-model="ticketInfoVisible">
  182. <TicketInfo :data="ticketDetail"></TicketInfo>
  183. </ElDialog>
  184. <!-- 票种排序弹框 -->
  185. <native-dialog
  186. title="票种排序"
  187. :visible.sync="sortDialogVisible"
  188. width="600px"
  189. :close-on-click-modal="false">
  190. <div v-loading="sortLoading">
  191. <draggable
  192. v-model="sortList"
  193. handle=".sort-item"
  194. animation="200">
  195. <div
  196. class="sort-item"
  197. v-for="item in sortList"
  198. :key="item.ticketTypeId">
  199. <span class="sort-name">{{ item.name }}</span>
  200. <el-tag
  201. size="small"
  202. :type="item.isSale !== 0 ? 'success' : 'info'">
  203. {{ item.isSale !== 0 ? '已激活' : '已禁用' }}
  204. </el-tag>
  205. </div>
  206. </draggable>
  207. </div>
  208. <span
  209. slot="footer"
  210. class="dialog-footer">
  211. <el-button @click="sortDialogVisible = false">取 消</el-button>
  212. <el-button
  213. type="primary"
  214. @click="saveSortList">确 定</el-button>
  215. </span>
  216. </native-dialog>
  217. </div>
  218. </template>
  219. <script>
  220. import { getTicketTypeList, getTicketTypeByDate, saveTicketTypeSort } from '@/api/ticketType'
  221. import draggable from 'vuedraggable'
  222. import { getBatchList } from '@/api/batch'
  223. import moment from 'moment'
  224. import ElDialog from '@/components/Dialog'
  225. import { Dialog as NativeDialog } from 'element-ui'
  226. import TicketInfo from './TicketInfo'
  227. import { EventBus } from '@/utils/eventBus'
  228. // import TagSelector from './TagSelector.vue'
  229. export default {
  230. props: {
  231. typeId: {
  232. type: String,
  233. default: ''
  234. },
  235. value: {
  236. type: Object,
  237. default: () => {
  238. return {}
  239. }
  240. }
  241. },
  242. components: {
  243. ElDialog,
  244. NativeDialog,
  245. TicketInfo,
  246. draggable
  247. },
  248. data () {
  249. return {
  250. keyControl: 1, // 键盘控制:1,2,3标识选中顺序
  251. isFocus: false, // 组件是否是选中状态
  252. loading: false,
  253. keyword: '',
  254. tableData: [],
  255. currentTicket: {},
  256. playDate: moment().format('YYYY-MM-DD'),
  257. showTopBtnId: -1,
  258. ticketDetail: {},
  259. ticketInfoVisible: false,
  260. topIds: [],
  261. selectedScenic: [],
  262. ticketTagList: [],
  263. selectedTag: '',
  264. dateOption: {
  265. // 日历禁用日期
  266. disabledDate () {
  267. return false
  268. }
  269. },
  270. quickDateList: [
  271. { label: '今天', value: moment().format('YYYY-MM-DD') },
  272. { label: '明天', value: moment().add(1, 'days').format('YYYY-MM-DD') },
  273. { label: '后天', value: moment().add(2, 'days').format('YYYY-MM-DD') }
  274. ],
  275. allBatchList: [],
  276. currentBatch: {},
  277. sortDialogVisible: false,
  278. sortLoading: false,
  279. sortList: []
  280. }
  281. },
  282. computed: {
  283. category () {
  284. return this.$route.meta.category || 'ticket'
  285. },
  286. sortType () {
  287. const category = this.$route.meta.category || 'ticket'
  288. const type = this.$route.meta.type
  289. if (category === 'batch') return 'batch'
  290. if (category === 'member') return 'member'
  291. if (type === 'team') return 'team'
  292. return 'single'
  293. },
  294. userScenic () {
  295. return this.$store.state.app.account.managerScenicMatrix ? this.$store.state.app.account.managerScenicMatrix.map(i => i.id) : []
  296. },
  297. scenicList () {
  298. return this.$store.state.app.scenicList
  299. },
  300. filterTableData () {
  301. let result = this.tableData.filter(item => {
  302. if (
  303. ((item.name).toLowerCase().indexOf(this.keyword.toLowerCase()) > -1 ||
  304. (item.pinyin).toLowerCase().indexOf(this.keyword.toLowerCase()) > -1 ||
  305. (item.shorthand).toLowerCase().indexOf(this.keyword.toLowerCase()) > -1)
  306. ) {
  307. return true
  308. }
  309. })
  310. let topList = []
  311. for (let i = 0; i < this.topIds.length; i++) {
  312. let topItem = result.find(item => item.id === this.topIds[i])
  313. if (topItem) {
  314. topItem.isTop = true
  315. topList.push(topItem)
  316. }
  317. }
  318. let downList = result.filter(item => topList.indexOf(item) === -1)
  319. .map(item => {
  320. item.isTop = false
  321. return item
  322. })
  323. return [...topList, ...downList]
  324. },
  325. ticketType () {
  326. return this.$route.meta.category || 'ticket'
  327. },
  328. batchList () {
  329. if (this.category !== 'batch') {
  330. return this.currentTicket?.batchConfigList || []
  331. } else {
  332. return this.allBatchList
  333. }
  334. },
  335. // 是否期票
  336. isPeriodTicket () {
  337. const category = this.$route.meta.category || 'ticket'
  338. const { useDateType } = this.currentTicket || {}
  339. return category === 'ticket' && useDateType === 2
  340. },
  341. ticketListMaxHeight () {
  342. return this.this.category === 'batch' ? '300px' : '500px'
  343. },
  344. isTeam () {
  345. return this.category === 'ticket' && this.$route.meta.type === 'team'
  346. }
  347. },
  348. watch: {
  349. value: {
  350. handler (val) {
  351. if (!val || !val.id) {
  352. this.currentTicket = {}
  353. return
  354. }
  355. this.currentTicket = val
  356. },
  357. immediate: true
  358. },
  359. // 当数据变化时,默认不选择票种
  360. filterTableData (val) {
  361. // 默认不选中票种
  362. },
  363. selectedTag (val) {
  364. this.getTicketTypeList()
  365. },
  366. userScenic: {
  367. handler (val) {
  368. this.selectedScenic = val
  369. },
  370. immediate: true
  371. },
  372. currentTicket (val, oldVal) {
  373. if (val?.id && !oldVal?.id) {
  374. this.getTicketTypeInfo()
  375. }
  376. }
  377. },
  378. created () {
  379. if (this.category === 'batch') {
  380. this.getBatchList()
  381. } else {
  382. this.getTicketTypeList()
  383. }
  384. },
  385. mounted () {
  386. document.getElementById('quick-search').focus()
  387. // this.getTicketTagList()
  388. this.getTopIds()
  389. EventBus.$on('orderCreated', () => {
  390. if (this.category === 'batch') {
  391. this.getBatchList()
  392. } else {
  393. // this.changeTicket(this.currentTicket)
  394. }
  395. this.currentTicket = {}
  396. this.$emit('update', null)
  397. })
  398. },
  399. methods: {
  400. // 按enter,移动组件焦点
  401. // handleEnter (keyBind) {
  402. // keyBind.currentIndex++
  403. // keyBind.setFocus()
  404. // },
  405. removeSecond (time) {
  406. return time ? time.slice(0, 5) : ''
  407. },
  408. getTicketTip (item) {
  409. let tip = ''
  410. if (item.useDateType === 2 || item.memberUseDateType === 2) {
  411. tip += '有效期:' + item.useDateStart + '至' + item.useDateEnd
  412. } else if (item.useDateType === 1 || item.memberUseDateType === 1) {
  413. tip += item.useDays ? `使用天数:${item.useDays}天` : ''
  414. } else {
  415. }
  416. return tip
  417. },
  418. getTicketTypeList () {
  419. this.loading = true
  420. const params = {
  421. pageNum: 1,
  422. isSale: 1,
  423. pageSize: 1000,
  424. ticketTypeName: '',
  425. orderBy: true,
  426. category: this.ticketType
  427. }
  428. // 根据售票类型筛选团散票种:(散客)筛选0和1,(团队)筛选0和2
  429. if (this.ticketType === 'ticket') {
  430. params.teamIndividualList = this.isTeam ? [0, 2] : [0, 1]
  431. }
  432. getTicketTypeList(params).then(res => {
  433. this.tableData = res.data.records.map(item => {
  434. // 添加拼音首字母
  435. item.pinyin = pinyinUtil.getFirstLetter(item.name)
  436. return item
  437. })
  438. }).finally(() => {
  439. this.loading = false
  440. })
  441. },
  442. getBatchList () {
  443. getBatchList({
  444. batchDateStart: this.playDate,
  445. batchDateEnd: this.playDate
  446. }).then(res => {
  447. if (res.code === '200') {
  448. console.log('获取场次数据成功', res.data)
  449. this.allBatchList = (res.data || []).map(item => {
  450. return {
  451. ...item,
  452. name: item.batchName,
  453. ...(item.batchResponseList?.[0] || {})
  454. }
  455. })
  456. if (this.allBatchList && this.allBatchList[0]) {
  457. this.currentBatch = this.allBatchList[0]
  458. this.$refs.singleTable.setCurrentRow(this.allBatchList[0])
  459. this.tableData = (this.currentBatch?.ticketTypes || []).map(item => {
  460. return {
  461. ...item,
  462. batchConfigId: this.currentBatch.batchConfigId
  463. }
  464. })
  465. // this.changeTicket(this.tableData[0])
  466. this.$emit('set-batch', this.currentBatch)
  467. }
  468. }
  469. })
  470. },
  471. async handleDateChange (val) {
  472. this.playDate = moment(val).format('YYYY-MM-DD')
  473. if (this.category === 'batch') {
  474. this.getBatchList()
  475. } else {
  476. this.getTicketTypeInfo()
  477. }
  478. },
  479. async getTicketTypeInfo () {
  480. if (!this.currentTicket || !this.currentTicket.id) {
  481. this.$message.warning('未选择票种')
  482. return
  483. }
  484. const playDate = moment(this.playDate).format('YYYY-MM-DD')
  485. this.$emit('changePlayDate', playDate)
  486. const res = await getTicketTypeByDate({
  487. ticketTypeId: this.currentTicket.id,
  488. playDateBegin: playDate
  489. })
  490. if (res.code === '200') {
  491. console.log(playDate, '获取票种数据成功', res.data)
  492. this.currentTicket = res.data
  493. this.currentTicket.playDate = playDate
  494. this.$emit('update', this.currentTicket)
  495. this.$emit('input', this.currentTicket)
  496. this.tableData.forEach(item => {
  497. if (item.id === this.currentTicket.id) {
  498. item.price = this.currentTicket.price
  499. item.isSale = this.currentTicket.isSale
  500. }
  501. })
  502. }
  503. },
  504. async changeTicket (ticket) {
  505. if (!ticket) {
  506. return
  507. }
  508. const playDate = moment(this.playDate).format('YYYY-MM-DD')
  509. this.$emit('changePlayDate', playDate)
  510. const res = await getTicketTypeByDate({
  511. ticketTypeId: ticket.id,
  512. playDateBegin: playDate
  513. })
  514. if (res.code === '200') {
  515. console.log(playDate, '获取票种数据成功', res.data)
  516. this.currentTicket = res.data
  517. } else {
  518. this.currentTicket = ticket
  519. }
  520. this.currentTicket.playDate = playDate
  521. // 设置不可选日期
  522. this.dateOption.disabledDate = (date) => {
  523. let beforeToday = moment().subtract(1, 'days').isAfter(date)
  524. let beforeStart = moment(ticket.useDateStart).isAfter(date)
  525. let afterEnd = moment(ticket.useDateEnd).isBefore(date)
  526. return beforeToday || beforeStart || afterEnd
  527. }
  528. this.$emit('update', this.currentTicket)
  529. this.$emit('input', this.currentTicket)
  530. this.tableData.forEach(item => {
  531. if (item.id === this.currentTicket.id) {
  532. item.price = this.currentTicket.price
  533. item.isSale = this.currentTicket.isSale
  534. }
  535. })
  536. EventBus.$emit('ticketChanged', this.currentTicket)
  537. },
  538. handleBatchChange (row) {
  539. console.log('当前选择的场次', row)
  540. if (!row || this.currentBatch?.batchConfigId === row.batchConfigId) {
  541. return
  542. }
  543. if (row.leftNums === 0) {
  544. this.$message.error('该场次已售完')
  545. return
  546. }
  547. this.currentBatch = row
  548. this.tableData = (this.currentBatch?.ticketTypes || []).map(item => {
  549. return {
  550. ...item,
  551. batchConfigId: row.batchConfigId
  552. }
  553. })
  554. this.$emit('set-batch', row)
  555. },
  556. formatDate (input) {
  557. return moment(input).format('YYYY-MM-DD')
  558. },
  559. showTicketInfo (data) {
  560. data.scenics = data.ticketTypeScenic?.map(s => s.scenic)
  561. this.ticketInfoVisible = true
  562. this.ticketDetail = data
  563. },
  564. setFocus () {
  565. this.$refs.quickSearch.focus()
  566. this.keyword = ''
  567. },
  568. arrowUp () {
  569. this.arrowCtrl(-1)
  570. },
  571. arrowDown () {
  572. this.arrowCtrl(1)
  573. },
  574. arrowCtrl (n) {
  575. let currentIndex = this.filterTableData.findIndex(item => item.id === this.currentTicket.id)
  576. let i = currentIndex + n
  577. if (this.filterTableData[i]) {
  578. this.changeTicket(this.filterTableData[i])
  579. }
  580. },
  581. showTopBtn (item) {
  582. this.showTopBtnId = item.id
  583. },
  584. getTopIds () {
  585. let arr = this.$localStore.get('topIds')
  586. if (!arr) arr = []
  587. this.topIds = arr
  588. // console.log('置顶', this.topIds)
  589. },
  590. setTop (item) {
  591. let arr = this.$localStore.get('topIds')
  592. if (!arr) arr = []
  593. if (arr.indexOf(item.id) !== -1) {
  594. arr.splice(arr.indexOf(item.id), 1)
  595. }
  596. arr.unshift(item.id)
  597. this.$localStore.set({
  598. 'topIds': arr
  599. })
  600. this.getTopIds()
  601. this.showTopBtnId = -1
  602. },
  603. cancelTop (item) {
  604. let arr = this.$localStore.get('topIds')
  605. if (!arr) arr = []
  606. if (arr.indexOf(item.id) !== -1) {
  607. arr.splice(arr.indexOf(item.id), 1)
  608. }
  609. this.$localStore.set({
  610. 'topIds': arr
  611. })
  612. this.getTopIds()
  613. this.showTopBtnId = -1
  614. },
  615. getLeftNums (item) {
  616. return item.leftNums <= -1 ? '不限' : item.leftNums
  617. },
  618. // 打开票种排序弹框
  619. async openSortDialog () {
  620. this.sortDialogVisible = true
  621. this.sortLoading = true
  622. try {
  623. // const sortRes = await getTicketTypeSort(this.sortType)
  624. // const sortData = sortRes?.data || []
  625. // 用排序接口的顺序排列 tableData
  626. const sortMap = new Map(this.tableData.map(s => [s.ticketTypeId, s.sort]))
  627. this.sortList = [...this.tableData]
  628. .map(item => ({
  629. ticketTypeId: item.id,
  630. name: item.name,
  631. isSale: item.isSale,
  632. sort: sortMap.has(item.id) ? sortMap.get(item.id) : 9999
  633. }))
  634. .sort((a, b) => a.sort - b.sort)
  635. } catch (e) {
  636. this.sortList = this.tableData.map((item, index) => ({
  637. ticketTypeId: item.id,
  638. name: item.name,
  639. isSale: item.isSale,
  640. sort: index
  641. }))
  642. } finally {
  643. this.sortLoading = false
  644. }
  645. },
  646. // 保存票种排序
  647. async saveSortList () {
  648. const sorts = this.sortList.map((item, index) => ({
  649. ticketTypeId: item.ticketTypeId,
  650. sort: index + 1
  651. }))
  652. const data = {
  653. type: this.sortType,
  654. sorts
  655. }
  656. try {
  657. await saveTicketTypeSort(data)
  658. this.$message.success('排序保存成功')
  659. this.sortDialogVisible = false
  660. // 按新排序更新 tableData
  661. const sortMap = new Map(sorts.map(s => [s.ticketTypeId, s.sort]))
  662. this.tableData.sort((a, b) => {
  663. return (sortMap.get(a.id) || 9999) - (sortMap.get(b.id) || 9999)
  664. })
  665. } catch (e) {
  666. this.$message.error('排序保存失败')
  667. }
  668. }
  669. },
  670. beforeDestroy () {
  671. EventBus.$off('orderCreated')
  672. }
  673. }
  674. </script>
  675. <style lang="scss">
  676. .d-flex {
  677. display: flex;
  678. }
  679. .align-center {
  680. align-items: center;
  681. }
  682. .el-table tr.current-row>td {
  683. background-color: #ccd5de !important;
  684. color: #0075ff !important;
  685. }
  686. </style>
  687. <style lang="scss" scoped>
  688. .el-radio {
  689. margin-right: 0;
  690. }
  691. .noData {
  692. width: 100px;
  693. padding: 10px;
  694. font-size: 14px;
  695. color: #666;
  696. text-align: center;
  697. }
  698. .price b {
  699. font-weight: 600;
  700. }
  701. .top-title {
  702. display: flex;
  703. padding: 10px 10px;
  704. font-size: 16px;
  705. line-height: 1.4;
  706. color: #333;
  707. background: #fff;
  708. justify-content: space-between;
  709. align-items: center;
  710. font-weight: 600;
  711. .right-btn {
  712. display: flex;
  713. }
  714. }
  715. .ticket-list-wrap {
  716. display: flex;
  717. padding: 20px 10px;
  718. height: 100%;
  719. box-sizing: border-box;
  720. flex-direction: column;
  721. background: #fff;
  722. border: 1px solid #ddd;
  723. border-radius: 4px;
  724. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
  725. .select-date {
  726. margin-bottom: 5px;
  727. align-items: center;
  728. .date-list {
  729. display: inline-flex;
  730. align-items: center;
  731. .el-button {
  732. height: 32px;
  733. }
  734. .other-title {
  735. margin-left: 20px;
  736. }
  737. }
  738. .el-date-editor {
  739. margin: 0 10px;
  740. width: 140px;
  741. }
  742. }
  743. .select-ticket {
  744. margin-bottom: 10px;
  745. margin-top: 10px;
  746. align-items: center;
  747. .search-input {
  748. width: calc(100% - 130px);
  749. }
  750. .sort-btn {
  751. margin-left: 2px;
  752. }
  753. .ticket-list {
  754. width: 100%;
  755. .list-content {
  756. margin: 5px 10px;
  757. width: calc(100% - 20px);
  758. max-height: 650px;
  759. overflow-y: auto;
  760. .list-item {
  761. position: relative;
  762. margin-bottom: 3px;
  763. flex-shrink: 0;
  764. width: auto;
  765. height: 32px;
  766. display: flex;
  767. color: #333;
  768. cursor: pointer;
  769. background: #F2F6FF;
  770. border: 2px solid #f0f0f0;
  771. transition: all .3s;
  772. justify-content: space-between;
  773. align-items: center;
  774. border-radius: 6px;
  775. padding: 0 10px;
  776. .title {
  777. width: calc(100% - 80px);
  778. margin-top: 4px;
  779. span {
  780. overflow: hidden;
  781. white-space: nowrap;
  782. text-overflow: ellipsis;
  783. display: inline-block;
  784. max-width: 100%;
  785. }
  786. }
  787. .price {
  788. margin-left: 10px;
  789. .num {
  790. font-size: 18px;
  791. font-weight: bold;
  792. }
  793. }
  794. &:hover {
  795. z-index: 1;
  796. background: rgba(216, 225, 253, .3);
  797. border: 2px solid darken($blue, 1%);
  798. }
  799. &.active {
  800. z-index: 2;
  801. background: $blue;
  802. color: #fff;
  803. border: 2px solid darken($blue, 1%);
  804. .price {
  805. color: #fff;
  806. }
  807. }
  808. &.disabled {
  809. cursor: not-allowed;
  810. // background: $darkgray !important;
  811. border: 2px solid darken($darkgray, 8%);
  812. overflow: hidden;
  813. .badge {
  814. position: absolute;
  815. background: $darkgray;
  816. z-index: 1;
  817. width: 55px;
  818. text-align: center;
  819. height: 40px;
  820. line-height: 50px;
  821. border-radius: 3px;
  822. color: #fff;
  823. font-size: 12px !important;
  824. padding: 2px 4px 0;
  825. top: -14px;
  826. right: -23px;
  827. -ms-transform: rotate(45deg);
  828. -webkit-transform: rotate(45deg);
  829. transform: rotate(45deg);
  830. -webkit-transition: 0 0.1s ease-in;
  831. -moz-transition: 0 0.1s ease-in;
  832. -o-transition: 0 0.1s ease-in;
  833. transition: transform 0.1s ease-in;
  834. }
  835. }
  836. }
  837. }
  838. &.list-batch {
  839. .list-content {
  840. max-height: 450px;
  841. }
  842. }
  843. }
  844. }
  845. .select-batch {
  846. // display: flex;
  847. align-content: top;
  848. .list-content {
  849. display: flex;
  850. .list-item {
  851. position: relative;
  852. color: #333;
  853. cursor: pointer;
  854. background: #F2F6FF;
  855. border: 2px solid #f0f0f0;
  856. transition: all .3s;
  857. justify-content: space-between;
  858. align-items: center;
  859. border-radius: 6px;
  860. padding: 10px;
  861. margin-right: 10px;
  862. text-align: center;
  863. .title {
  864. .name {
  865. margin-right: 10px;
  866. }
  867. }
  868. .left-count {
  869. margin-top : 10px;
  870. font-size: 16px;
  871. }
  872. &:hover {
  873. z-index: 1;
  874. background: rgba(216, 225, 253, .3);
  875. border: 2px solid darken($blue, 1%);
  876. .goTop {
  877. i {
  878. display: inline-block;
  879. }
  880. }
  881. }
  882. &.active {
  883. z-index: 2;
  884. background: $blue;
  885. color: #fff;
  886. border: 2px solid darken($blue, 1%);
  887. .price {
  888. color: #fff;
  889. }
  890. }
  891. &.disabled {
  892. cursor: not-allowed;
  893. // background: $darkgray !important;
  894. border: 2px solid darken($darkgray, 8%);
  895. overflow: hidden;
  896. .badge {
  897. position: absolute;
  898. background: $darkgray;
  899. z-index: 1;
  900. width: 55px;
  901. text-align: center;
  902. height: 40px;
  903. line-height: 50px;
  904. border-radius: 3px;
  905. color: #fff;
  906. font-size: 12px !important;
  907. padding: 2px 4px 0;
  908. top: -14px;
  909. right: -23px;
  910. -ms-transform: rotate(45deg);
  911. -webkit-transform: rotate(45deg);
  912. transform: rotate(45deg);
  913. -webkit-transition: 0 0.1s ease-in;
  914. -moz-transition: 0 0.1s ease-in;
  915. -o-transition: 0 0.1s ease-in;
  916. transition: transform 0.1s ease-in;
  917. }
  918. }
  919. // &.active2 {
  920. // border-color: rgb(67, 125, 233);
  921. // }
  922. .top-sign {
  923. position: absolute;
  924. top: 0;
  925. right: 0;
  926. width: 0;
  927. height: 0;
  928. border: 5px solid red;
  929. border-bottom-color: transparent;
  930. border-left-color: transparent;
  931. }
  932. }
  933. }
  934. }
  935. }
  936. .mutipleTag {
  937. position: absolute;
  938. top: 0;
  939. left: 0;
  940. width: 0;
  941. height: 0;
  942. color: #fff;
  943. pointer-events: none;
  944. border: 14px solid rgb(255, 94, 0);
  945. border-right-color: transparent;
  946. border-bottom-color: transparent;
  947. i {
  948. position: absolute;
  949. font-size: 12px;
  950. transform: translate(-12px, -12px);
  951. }
  952. }
  953. .list-wrap-batch {
  954. max-height: calc(100vh - 400px);
  955. flex: 1;
  956. }
  957. .sort-item {
  958. display: flex;
  959. align-items: center;
  960. justify-content: space-between;
  961. padding: 12px 16px;
  962. border-bottom: 1px solid #eee;
  963. cursor: grab;
  964. background: #fff;
  965. transition: background 0.2s;
  966. &:hover {
  967. background: #f5f7fa;
  968. }
  969. &:active {
  970. cursor: grabbing;
  971. }
  972. .sort-name {
  973. font-size: 14px;
  974. color: #333;
  975. }
  976. }
  977. </style>