index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825
  1. <!--
  2. * @Author: zk
  3. * @Date: 2022-01-17 10:39:22
  4. * @LastEditTime: 2022-06-28 10:04:17
  5. * @LastEditors: your name
  6. * @Description: 中转进港
  7. -->
  8. <template>
  9. <div class="transfer-in">
  10. <!--功能区-表单-->
  11. <div ref="formWrap" class="terminal-form-wrap">
  12. <el-form ref="form" :inline="true" :model="formData" :rules="rules" class="form">
  13. <div class="form-left">
  14. <el-form-item prop="currentAirport">
  15. <!-- <el-cascader
  16. v-model="formData.currentAirport"
  17. style="width:144px;margin-left:10px"
  18. placeholder="全部机场"
  19. size="small"
  20. :options="currentAirportList"
  21. :props="currentAirportProps"
  22. collapse-tags
  23. clearable
  24. filterable
  25. @change="setCurrentAirport"
  26. /> -->
  27. <el-select v-model="formData.currentAirport" class="input-shadow" size="small" style="width: 100px;" filterable placeholder="请选择机场" @change="airPortChange">
  28. <el-option v-for="(item, index) in AirportList" :key="index" :label="item.planDepartureApt" :value="item.planDepartureApt" />
  29. </el-select>
  30. </el-form-item>
  31. <el-form-item prop="inboundCarrier">
  32. <el-cascader v-model="formData.inboundCarrier" class="input-shadow" style="width: 150px" size="small" :options="carrierProps" :props="optionProps" placeholder="进港承运航司" collapse-tags clearable filterable @change="resetLoopEvent" />
  33. </el-form-item>
  34. <el-form-item prop="outgoingAirline">
  35. <el-cascader v-model="formData.outgoingAirline" class="input-shadow" style="width: 150px" size="small" :options="carrierPropsop" :props="optionPropser" placeholder="离港承运航司" collapse-tags clearable filterable @change="resetLoopEvent" />
  36. </el-form-item>
  37. <!-- <el-form-item prop="startDate">
  38. <el-date-picker
  39. v-model="formData.startDate"
  40. class="input-shadow"
  41. style="width: 216px"
  42. size="small"
  43. type="date"
  44. value-format="yyyy-MM-dd"
  45. placeholder="开始时间"
  46. @change="startDateChangeHandler"
  47. />
  48. </el-form-item>
  49. <el-form-item prop="endDate">
  50. <el-date-picker
  51. v-model="formData.endDate"
  52. class="input-shadow"
  53. style="width: 216px"
  54. size="small"
  55. type="date"
  56. value-format="yyyy-MM-dd"
  57. placeholder="结束时间"
  58. @change="endDateChangeHandler"
  59. />
  60. </el-form-item> -->
  61. <el-form-item prop="flightDate" label="航班日期">
  62. <el-date-picker v-model="formData.flightDate" :clearable="false" size="small" style="width: 300px;" type="daterange" value-format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="dateRangePickerOptions" @change="dateChangeHandler" />
  63. </el-form-item>
  64. <el-form-item>
  65. <div class="box-item">
  66. <p>预计中转数:</p>
  67. <li v-for="(item, index) in orderNum" :key="index" :class="{ 'number-item': !isNaN(item), 'mark-item': isNaN(item) }">
  68. <span v-if="!isNaN(item)">
  69. <i ref="numberItem">0123456789</i>
  70. </span>
  71. <span v-else class="comma">{{ item }}</span>
  72. </li>
  73. </div>
  74. </el-form-item>
  75. </div>
  76. <div class="form-right" @keyup.enter="onSubmit(1)">
  77. <el-form-item prop="search">
  78. <el-popover :value="popoverVisible" placement="bottom" trigger="manual">
  79. <span>请输入航班号(示例:CA1234)或行李牌号(示例:1234567890)</span>
  80. <el-input slot="reference" v-model="formData.search" class="input-shadow" style="width: 240px;" size="small" placeholder="请输入内容" prefix-icon="el-icon-search" clearable @focus="popoverVisible = true" @blur="popoverVisible = false" />
  81. </el-popover>
  82. </el-form-item>
  83. <el-form-item>
  84. <el-button class="btn-shadow" size="mini" type="primary" @click="onSubmit(1)">搜索</el-button>
  85. </el-form-item>
  86. <el-form-item v-is="['ti_showTransit']">
  87. <el-button class="btn-shadow" size="mini" type="primary" @click="changeView">切换视角</el-button>
  88. </el-form-item>
  89. <el-form-item v-is="['ti_timeIcon']">
  90. <TimeZoneSelector />
  91. </el-form-item>
  92. <el-form-item v-is="['ti_columnSettings']">
  93. <img class="btn-img btn-shadow" src="../../../../assets/baggage/ic_setting.png" title="列设置" @click="show">
  94. </el-form-item>
  95. <el-form-item v-is="['dm_dt_columnSettings']">
  96. <img class="btn-img btn-shadow" src="../../../../assets/baggage/ic_export.png" title="导出" @click="exportHandler('table', '航站中转进港列表')">
  97. </el-form-item>
  98. </div>
  99. </el-form>
  100. </div>
  101. <!--表格-->
  102. <div v-loading="loading" class="terminal-table" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)">
  103. <el-table ref="table" class="table" :data="dealedTableData" :height="computedTableHeight" show-summary :summary-method="summaryMethod" :span-method="arraySpanMethod" :header-cell-class-name="headerCellClass" :row-class-name="tableRowClassName" :cell-class-name="cellClass" border stripe fit @cell-click="cellClickHandler">
  104. <el-table-column v-for="col in tableColsCopy" :key="col.prop" :prop="col.prop" :label="col.label" :width="col.width" :fixed="col.fixed">
  105. <el-table-column v-for="childCol in col.children" :key="childCol.prop" :prop="childCol.prop" :label="childCol.label" :width="childCol.width" :formatter="tableFormat">
  106. <template #header>
  107. <el-tooltip :content="childCol.desc || childCol.label" placement="top">
  108. <TableHeaderCell :label="childCol.label" :filter-options="tableDataFilters[childCol.prop]" :filter-values.sync="filterValues[childCol.prop]" :sortable="childCol.sortable" :sort-rule.sync="tableDataSortRules[childCol.prop]" />
  109. </el-tooltip>
  110. </template>
  111. </el-table-column>
  112. </el-table-column>
  113. </el-table>
  114. </div>
  115. <!--列设置-->
  116. <Dialog :flag="dialogFlag" class="dialog-check-group">
  117. <div class="dialog-wrapper">
  118. <div class="title">列设置</div>
  119. <div class="content">
  120. <el-tree :data="tableCols" :class="colsCheckClass" show-checkbox node-key="index" :default-expand-all="true" :props="{
  121. label: 'label',
  122. children: 'children',
  123. }" :default-checked-keys="checkedKeysTemp" @check="handleCheck" />
  124. </div>
  125. <div class="foot right t30">
  126. <el-button size="medium" class="r24" type="primary" @click="onCheck">确定</el-button>
  127. <el-button size="medium" @click="hide">取消</el-button>
  128. </div>
  129. </div>
  130. </Dialog>
  131. </div>
  132. </template>
  133. <script>
  134. import Dialog from '@/layout/components/Dialog'
  135. import TimeZoneSelector from '@/components/TimeZoneSelector'
  136. import terminalMixin from '../../mixins/terminal'
  137. import formMixin from '../../mixins/form'
  138. import tableColsMixin from '../../mixins/tableCols'
  139. import timeZoneMixin from '../../mixins/timeZone'
  140. import { getQuery } from '@/api/flight'
  141. import TableHeaderCell from '@/components/TableHeaderCell'
  142. import { setTableFilters, throttledExportToExcel } from '@/utils/table'
  143. export default {
  144. name: 'DepartureTerminalView',
  145. components: { Dialog, TimeZoneSelector, TableHeaderCell },
  146. mixins: [terminalMixin, formMixin, tableColsMixin, timeZoneMixin],
  147. data () {
  148. return {
  149. optionProps: {
  150. value: 'inAicompanyCode2',
  151. label: 'inAicompanyCode2'
  152. },
  153. optionPropser: {
  154. value: 'outAicompanyCode2',
  155. label: 'outAicompanyCode2'
  156. },
  157. popoverVisible: false,
  158. orderNum: ['0', '0', '0', '0', '0', '0'], // 默认总数
  159. // 初始表头
  160. tableCols: [
  161. {
  162. prop: 'arrivalInfo',
  163. label: '进港航班',
  164. width: 180,
  165. fixed: 'left',
  166. children: [
  167. {
  168. prop: 'preFlightNO',
  169. label: '航班号',
  170. desc: '进港航班编号',
  171. width: 80,
  172. filterable: true,
  173. sortable: true
  174. },
  175. {
  176. prop: 'preFlightDate',
  177. label: '航班日期',
  178. desc: '指航班计划起飞日期(不变的,机票上),不是预计起飞日期(预计起飞时间可能多个),也不是实际起飞日期(实际起飞等于最后预计)',
  179. width: 100
  180. },
  181. {
  182. prop: 'preAirport',
  183. label: '起飞航站',
  184. desc: '指进港航班的起飞机场三字码',
  185. width: 100,
  186. filterable: true,
  187. sortable: true
  188. },
  189. {
  190. prop: 'actualLandingTime',
  191. label: '降落时间',
  192. desc: '指航班预计到达时间,数据是变化的,仅显示最新结果',
  193. width: 100
  194. },
  195. {
  196. prop: 'landingBuild',
  197. label: '降落航站楼',
  198. desc: '指航班降落后位于机场的哪个航站楼',
  199. width: 98,
  200. filterable: true,
  201. sortable: true
  202. },
  203. {
  204. prop: 'carousel',
  205. label: '行李转盘',
  206. desc: '指航班到达后行李提取的地方,仅显示最新信息',
  207. width: 100,
  208. filterable: true,
  209. sortable: true
  210. },
  211. {
  212. prop: 'standForLanding',
  213. label: '降落停机位',
  214. desc: '指航班的停机位代码,数据是变化的,仅显示最新信息',
  215. width: 98,
  216. filterable: true,
  217. sortable: true
  218. },
  219. {
  220. prop: 'inTransferBaggageCount',
  221. label: '中转行李数',
  222. desc: '指航班在本航站预计需要中转至对应航班的行李数量'
  223. }
  224. ]
  225. },
  226. {
  227. prop: 'departureInfo',
  228. label: '离港航班',
  229. children: [
  230. {
  231. prop: 'inTransferredBaggageCount',
  232. label: '已中转行李数',
  233. desc: '指航班在本航站实际已经中转至对应航班的行李数量',
  234. width: 100
  235. },
  236. {
  237. prop: 'flightNO',
  238. label: '航班号',
  239. desc: '指航班编号',
  240. width: 80,
  241. filterable: true,
  242. sortable: true
  243. },
  244. {
  245. prop: 'flightDate',
  246. label: '航班日期',
  247. desc: '指航班计划起飞日期(不变的,机票上),不是预计起飞日期(预计起飞时间可能多个),也不是实际起飞日期(实际起飞等于最后预计)',
  248. width: 100
  249. },
  250. {
  251. prop: 'actualDepartureTime',
  252. label: '起飞时间',
  253. desc: '指航班预计起飞时间,数据是变化的,仅显示最新结果',
  254. width: 100
  255. },
  256. {
  257. prop: 'targetAirport',
  258. label: '目的站',
  259. desc: '指航班执飞航段的目的航站,以航站三字码+航站简称显示',
  260. filterable: true,
  261. sortable: true
  262. },
  263. {
  264. prop: 'departureBuild',
  265. label: '起飞航站楼',
  266. desc: '指航班执飞航段的起飞航站的航站楼',
  267. width: 98,
  268. filterable: true,
  269. sortable: true
  270. },
  271. {
  272. prop: 'bordingGate',
  273. label: '起飞登机口',
  274. desc: '指航班的登机口代码,数据是变化的,仅显示最新信息',
  275. width: 98,
  276. filterable: true,
  277. sortable: true
  278. },
  279. {
  280. prop: 'standForDepartrue',
  281. label: '起飞停机位',
  282. desc: '指航班的停机位代码,数据是变化的,仅显示最新信息',
  283. width: 98,
  284. filterable: true,
  285. sortable: true
  286. },
  287. // {
  288. // prop: 'outTransferBaggageCount',
  289. // label: '中转进行李数',
  290. // desc: '指其它航班预计中转至本航班的行李数量',
  291. // width: 100
  292. // },
  293. // {
  294. // prop: 'outTransferredBaggageCount',
  295. // label: '已中转进行李数',
  296. // desc: '指其它航班实际已中转至本航班的行李数量',
  297. // width: 120
  298. // },
  299. {
  300. prop: 'timeDifference',
  301. label: '转运时间',
  302. desc: '指中转动作完成时间'
  303. }
  304. ]
  305. }
  306. ],
  307. loading: false,
  308. AirportList: [],
  309. carrierProps: [],
  310. carrierPropsop: [],
  311. loopEvent: null,
  312. arrivalCount: 0,
  313. baggageCount: 0,
  314. hasSetTableScroll: false,
  315. spanArr: [],
  316. contactDot: 0,
  317. flag: 0,
  318. table: null
  319. }
  320. },
  321. computed: {
  322. singleDay () {
  323. return this.startDate === this.endDate
  324. }
  325. },
  326. watch: {
  327. dealedTableData: {
  328. handler (val) {
  329. this.spanArr = []
  330. let contactDot = this.contactDot
  331. val.forEach((item, index, arr) => {
  332. if (index === 0) {
  333. this.spanArr.push(1)
  334. } else {
  335. if (
  336. item['preFlightNO'] === arr[index - 1]['preFlightNO'] &&
  337. item['preFlightDate'] === arr[index - 1]['preFlightDate']
  338. ) {
  339. this.spanArr[contactDot] += 1
  340. this.spanArr.push(0)
  341. } else {
  342. this.spanArr.push(1)
  343. contactDot = index
  344. }
  345. }
  346. })
  347. },
  348. deep: true
  349. }
  350. },
  351. created () {
  352. // this.getAirPortData()
  353. },
  354. mounted () {
  355. this.$refs['form'].validateField('flightDate')
  356. this.getAirPortData()
  357. this.table = this.$refs.table.bodyWrapper
  358. const that = this
  359. this.table.addEventListener('scroll', () => {
  360. that.scrollTop = this.table.scrollTop
  361. })
  362. },
  363. activated () {
  364. this.table.scrollTop = this.scrollTop
  365. this.getTableData()
  366. const that = this
  367. this.loopEvent = setInterval(function () {
  368. that.getTableData()
  369. }, 3000)
  370. // const { startDate, endDate } = this.$route.query
  371. // Object.entries(this.$route.query).forEach(([key, value]) => {
  372. // if ((value ?? '') !== '' && JSON.stringify(value) !== '[]') {
  373. // this.formData[key] = value
  374. // }
  375. // })
  376. // if (startDate !== null && startDate !== undefined) {
  377. // this.formData.flightDate[0] = startDate
  378. // }
  379. // if (endDate !== null && endDate !== undefined) {
  380. // this.formData.flightDate[1] = endDate
  381. // }
  382. },
  383. deactivated () {
  384. if (this.loopEvent) {
  385. clearInterval(this.loopEvent)
  386. this.loopEvent = null
  387. }
  388. },
  389. beforeDestroy () {
  390. if (this.loopEvent) {
  391. clearInterval(this.loopEvent)
  392. this.loopEvent = null
  393. }
  394. },
  395. methods: {
  396. resetLoopEvent () {
  397. this.loading = true
  398. this.hasSetTableScroll = false
  399. if (this.loopEvent) {
  400. clearInterval(this.loopEvent)
  401. }
  402. this.getTableData()
  403. const that = this
  404. this.loopEvent = setInterval(function () {
  405. that.getTableData()
  406. }, 3000)
  407. },
  408. headerCellClass ({ row, column }) {
  409. const classes = []
  410. const rule = this.tableDataSortRules[column.property]
  411. if (rule) {
  412. classes.push(rule)
  413. }
  414. return classes.join(' ')
  415. },
  416. tableRowClassName ({ row, rowIndex }) {
  417. const classes = []
  418. if (row.hasArrived) {
  419. classes.push('bgl-hui')
  420. if (rowIndex === this.arrivalCount - 1) {
  421. classes.push('redBorder')
  422. }
  423. }
  424. return classes.join(' ')
  425. },
  426. changeView () {
  427. // const query = {
  428. // ...this.formData,
  429. // startDate: this.startDate,
  430. // endDate: this.endDate
  431. // }
  432. // delete query.flightDate
  433. // this.$router.replace({
  434. // path: '/transfer/departure',
  435. // query
  436. // })
  437. this.$router.push('/transfer/departure')
  438. },
  439. airPortChange () {
  440. this.getAviationData()
  441. this.upAviationData()
  442. this.resetLoopEvent()
  443. },
  444. dateChangeHandler () {
  445. this.getAviationData()
  446. this.upAviationData()
  447. this.resetLoopEvent()
  448. },
  449. // 选择机场
  450. async getAirPortData () {
  451. try {
  452. const res = await getQuery({
  453. id: DATACONTENT_ID.departureAirId,
  454. dataContent: []
  455. })
  456. if (Number(res.code) === 0) {
  457. this.AirportList = res.returnData.listValues
  458. this.formData.currentAirport = 'PEK'
  459. this.getAviationData()
  460. this.upAviationData()
  461. this.resetLoopEvent()
  462. } else {
  463. this.$message.error(res.message)
  464. }
  465. } catch (error) {
  466. console.log('出错了', error.message || error)
  467. }
  468. },
  469. // 选择航司
  470. async getAviationData () {
  471. try {
  472. const res = await getQuery({
  473. id: DATACONTENT_ID.departureAviJoinId,
  474. dataContent: [this.formData.currentAirport]
  475. })
  476. if (Number(res.code) === 0) {
  477. this.carrierProps = res.returnData.listValues
  478. } else {
  479. this.$message.error(res.message)
  480. }
  481. } catch (error) {
  482. console.log('出错了', error.message || error)
  483. }
  484. },
  485. // 选择航司
  486. async upAviationData () {
  487. try {
  488. const res = await getQuery({
  489. id: DATACONTENT_ID.departureAviLeaveId,
  490. dataContent: [this.formData.currentAirport]
  491. })
  492. if (Number(res.code) === 0) {
  493. this.carrierPropsop = res.returnData.listValues
  494. } else {
  495. this.$message.error(res.message)
  496. }
  497. } catch (error) {
  498. console.log('出错了', error.message || error)
  499. }
  500. },
  501. // 获取表单下拉框数据
  502. // getFormData(params) {
  503. // this.relatedAirportQuery({
  504. // ...params,
  505. // type: 'OUT'
  506. // })
  507. // this.outgoingAirlineQuery(params)
  508. // this.craftTypeQuery(params)
  509. // this.flightAttrQuery(params)
  510. // },
  511. // 获取表格数据
  512. async getTableData () {
  513. if (!this.formData.currentAirport || !this.startDate || !this.endDate) {
  514. return
  515. }
  516. const arrs1 = [this.formData.inboundCarrier.length === 0 ? '' : this.formData.inboundCarrier[0]]
  517. const arrs2 = [this.formData.outgoingAirline.length === 0 ? '' : this.formData.outgoingAirline[0]]
  518. const arr = [
  519. this.formData.currentAirport,
  520. this.startDate,
  521. this.endDate,
  522. ...arrs1,
  523. ...arrs1,
  524. ...arrs1,
  525. ...arrs2,
  526. ...arrs2,
  527. ...arrs2
  528. // this.formData.inboundCarrier,
  529. // this.formData.outgoingAirline,
  530. // JSON.stringify(this.formData.inboundCarrier),
  531. // JSON.stringify(this.formData.outgoingAirline),
  532. ]
  533. try {
  534. const res = await getQuery({
  535. id: DATACONTENT_ID.departureTableId,
  536. dataContent: [...arr]
  537. })
  538. if (Number(res.code) === 0) {
  539. this.initTableData(res.returnData.listValues)
  540. } else {
  541. console.log(res.message)
  542. }
  543. this.loading = false
  544. } catch (error) {
  545. if (this.loopEvent) {
  546. clearInterval(this.loopEvent)
  547. this.loopEvent = null
  548. }
  549. this.loading = false
  550. console.log('出错了', error.message || error)
  551. }
  552. },
  553. initTableData (tableData) {
  554. this.arrivalCount = 0
  555. this.baggageCount = 0
  556. tableData.forEach(item => {
  557. if (this.hasArrived(item)) {
  558. this.arrivalCount++
  559. }
  560. this.baggageCount = this.baggageCount + item.inTransferBaggageCount
  561. })
  562. this.tableData = this._.sortBy(tableData, ['actualLandingTime', 'preFlightNO', 'actualDepartureTime', 'flightNO'])
  563. setTableFilters(this.tableData, this.tableDataFilters)
  564. this.toOrderNum(this.baggageCount)
  565. this.$nextTick(() => {
  566. this.setTableScroll()
  567. })
  568. },
  569. hasArrived (flight) {
  570. if (flight.actualLandingTime) {
  571. const now = new Date()
  572. const actualLandingTime = new Date(flight.actualLandingTime.replace('T', ' '))
  573. flight['hasArrived'] = now > actualLandingTime && !flight['flightCanceled']
  574. } else {
  575. flight['hasArrived'] = false
  576. }
  577. return flight['hasArrived']
  578. },
  579. setTableScroll () {
  580. if (!this.singleDay || this.hasSetTableScroll || this.arrivalCount === 0) {
  581. return
  582. }
  583. const table = this.$refs['table'].$el
  584. const scrollParent = table.querySelector('.el-table__body-wrapper')
  585. if (scrollParent.scrollHeight <= scrollParent.offsetHeight) {
  586. return
  587. }
  588. const lastRow = table.querySelectorAll('.el-table__body tr')[this.arrivalCount - 1]
  589. setTimeout(() => {
  590. const scrollMid = lastRow.offsetTop + lastRow.offsetHeight - scrollParent.offsetHeight / 2
  591. const scrollMax = scrollParent.scrollHeight - scrollParent.offsetHeight
  592. if (scrollMid > 0) {
  593. const scrollHeight = Math.min(scrollMid, scrollMax)
  594. scrollParent.scrollTo(0, scrollHeight)
  595. }
  596. }, 0)
  597. this.hasSetTableScroll = true
  598. },
  599. setNumberTransform () {
  600. const numberItems = this.$refs.numberItem // 拿到数字的ref,计算元素数量
  601. const numberArr = this.orderNum.filter(item => !isNaN(item))
  602. // 结合CSS 对数字字符进行滚动,显示订单数量
  603. for (let index = 0; index < numberItems.length; index++) {
  604. const elem = numberItems[index]
  605. elem.style.transform = `translate(-50%, -${numberArr[index] * 10}%)`
  606. }
  607. },
  608. toOrderNum (num) {
  609. num = num.toString()
  610. if (num.length < 6) {
  611. num = '0' + num // 如未满八位数,添加"0"补位
  612. this.toOrderNum(num) // 递归添加"0"补位
  613. } else if (num.length >= 6) {
  614. this.orderNum = num.split('') // 将其便变成数据,渲染至滚动数组
  615. } else {
  616. // 订单总量数字超过八位显示异常
  617. this.$message.warning('总量数字过大')
  618. }
  619. this.setNumberTransform()
  620. },
  621. arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
  622. for (let i = 0; i < 7; i++) {
  623. if (columnIndex === i) {
  624. const _row = this.spanArr[rowIndex]
  625. const _col = _row > 0 ? 1 : 0
  626. return {
  627. rowspan: _row,
  628. colspan: _col
  629. }
  630. }
  631. }
  632. },
  633. exportHandler (refName, tableName) {
  634. if (this.loading) {
  635. return
  636. }
  637. const table = this.$refs[refName].$el.cloneNode(true)
  638. const fileName = `${tableName}-${this.currentAirport}-${this.startDate}-${this.endDate}.xlsx`
  639. throttledExportToExcel(table, tableName, fileName, 2)
  640. }
  641. }
  642. }
  643. </script>
  644. <style lang="scss" scoped>
  645. .terminal-form-wrap {
  646. padding-top: 11px;
  647. padding-left: 5px;
  648. ::v-deep .form {
  649. display: flex;
  650. justify-content: space-between;
  651. .form-left {
  652. flex: 1;
  653. }
  654. .form-right {
  655. flex: 0 1 auto;
  656. }
  657. .el-form-item {
  658. margin-bottom: 0px;
  659. margin-right: 8px;
  660. button,
  661. input,
  662. optgroup,
  663. select,
  664. textarea {
  665. font-family: Helvetica, "Microsoft YaHei";
  666. font-size: 14px;
  667. }
  668. .el-switch__label {
  669. color: #303133;
  670. }
  671. .el-form-item__error {
  672. z-index: 10;
  673. }
  674. }
  675. .btn-img {
  676. position: relative;
  677. top: 6px;
  678. }
  679. }
  680. .box-item {
  681. position: relative;
  682. height: 50px;
  683. font-size: 18px;
  684. line-height: 32px;
  685. text-align: center;
  686. list-style: none;
  687. color: #2d7cff;
  688. writing-mode: vertical-lr;
  689. text-orientation: upright;
  690. /*文字禁止编辑*/
  691. -moz-user-select: none; /*火狐*/
  692. -webkit-user-select: none; /*webkit浏览器*/
  693. -ms-user-select: none; /*IE10*/
  694. -khtml-user-select: none; /*早期浏览器*/
  695. user-select: none;
  696. /* overflow: hidden; */
  697. p {
  698. line-height: 32px;
  699. writing-mode: horizontal-tb !important;
  700. text-orientation: none !important;
  701. /*文字禁止编辑*/
  702. -moz-user-select: none; /*火狐*/
  703. -webkit-user-select: none; /*webkit浏览器*/
  704. -ms-user-select: none; /*IE10*/
  705. -khtml-user-select: none; /*早期浏览器*/
  706. user-select: none;
  707. margin-top: 5px;
  708. }
  709. }
  710. /* 默认逗号设置 */
  711. .mark-item {
  712. width: 10px;
  713. height: 32px;
  714. margin-right: 5px;
  715. line-height: 10px;
  716. font-size: 18px;
  717. position: relative;
  718. & > span {
  719. position: absolute;
  720. width: 100%;
  721. bottom: 0;
  722. writing-mode: vertical-rl;
  723. text-orientation: upright;
  724. }
  725. }
  726. /*滚动数字设置*/
  727. .number-item {
  728. width: 41px;
  729. height: 42px;
  730. /* 背景图片 */
  731. // background: url(/images/text-bg-blue.png) no-repeat center center;
  732. // background-size: 100% 100%;
  733. // background: #ccc;
  734. list-style: none;
  735. margin-right: 5px;
  736. // background:rgba(250,250,250,1);
  737. border-radius: 4px;
  738. border: 3px solid rgb(221, 221, 221);
  739. & > span {
  740. position: relative;
  741. display: inline-block;
  742. margin-right: 10px;
  743. width: 100%;
  744. height: 100%;
  745. writing-mode: vertical-rl;
  746. text-orientation: upright;
  747. overflow: hidden;
  748. & > i {
  749. font-style: normal;
  750. position: absolute;
  751. top: 11px;
  752. left: 50%;
  753. transform: translate(-50%, -1%);
  754. transition: transform 1s ease-in-out;
  755. letter-spacing: 10px;
  756. }
  757. }
  758. }
  759. .number-item:last-child {
  760. margin-right: 0;
  761. }
  762. }
  763. .terminal-table {
  764. width: 100%;
  765. ::v-deep .table {
  766. width: 100%;
  767. .cell {
  768. padding: 0;
  769. text-align: center;
  770. font-size: 14px;
  771. font-family: Helvetica, "Microsoft YaHei";
  772. letter-spacing: 0;
  773. }
  774. .cell-click {
  775. cursor: pointer;
  776. color: #2d7cff;
  777. &.cell-clicked {
  778. color: purple;
  779. }
  780. }
  781. .el-table__header-wrapper,
  782. .el-table__fixed-header-wrapper {
  783. .cell {
  784. font-weight: bold;
  785. color: #101116;
  786. }
  787. .has-gutter {
  788. tr {
  789. .bgl-huang {
  790. background: #fcf0b1;
  791. }
  792. }
  793. }
  794. }
  795. .el-table__body-wrapper,
  796. .el-table__fixed-body-wrapper {
  797. tr.bgl-hui {
  798. background: #d2d6df;
  799. td {
  800. background: #d2d6df;
  801. }
  802. &.redBorder {
  803. position: relative;
  804. &::after {
  805. content: "";
  806. position: absolute;
  807. left: 0;
  808. bottom: 0;
  809. width: 100%;
  810. height: 2px;
  811. background: #e83f82;
  812. }
  813. }
  814. }
  815. }
  816. .el-table__cell.is-hidden > * {
  817. visibility: visible;
  818. }
  819. }
  820. }
  821. </style>