TicketList.vue 27 KB

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