index.vue 28 KB

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