index.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941
  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 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="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 default-first-option @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 default-first-option @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>
  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>
  93. <TimeZoneSelector />
  94. </el-form-item>
  95. <!-- <el-form-item v-is="['ti_columnSettings']">
  96. <img class="btn-img btn-shadow" src="@/assets/baggage/ic_setting.png" title="列设置" @click="show" />
  97. </el-form-item> -->
  98. <el-form-item>
  99. <img class="btn-img btn-shadow" src="@/assets/baggage/ic_setting.png" title="列设置" @click="show" />
  100. </el-form-item>
  101. <!-- <el-form-item v-is="['dm_dt_columnSettings']">
  102. <img class="btn-img btn-shadow" src="@/assets/baggage/ic_export.png" title="导出" @click="exportHandler('table', '航站中转进港列表')" />
  103. </el-form-item> -->
  104. <el-form-item>
  105. <img class="btn-img btn-shadow" src="@/assets/baggage/ic_export.png" title="导出" @click="exportHandler('table', '航站中转进港列表')" />
  106. </el-form-item>
  107. </div>
  108. </el-form>
  109. </div>
  110. <!--表格-->
  111. <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)">
  112. <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">
  113. <el-table-column v-for="col in tableColsCopy" :key="col.prop" :prop="col.prop" :label="col.label" :width="col.width" :fixed="col.fixed">
  114. <el-table-column v-for="childCol in col.children" :key="childCol.prop" :prop="childCol.prop" :label="childCol.label" :width="childCol.width" :formatter="tableFormat">
  115. <template #header>
  116. <el-tooltip :content="childCol.desc || childCol.label" placement="top">
  117. <TableHeaderCell :label="childCol.label" :filter-options="tableDataFilters[childCol.prop]" :filter-values.sync="filterValues[childCol.prop]" :sortable="childCol.sortable" :sort-rule.sync="tableDataSortRules[childCol.prop]" />
  118. </el-tooltip>
  119. </template>
  120. </el-table-column>
  121. </el-table-column>
  122. </el-table>
  123. </div>
  124. <!--列设置-->
  125. <Dialog :flag="dialogFlag" class="dialog-check-group">
  126. <div class="dialog-wrapper">
  127. <div class="title">列设置</div>
  128. <div class="content">
  129. <el-tree :data="tableCols" :class="colsCheckClass" show-checkbox node-key="index" :default-expand-all="true" :props="{
  130. label: 'label',
  131. children: 'children',
  132. }" :default-checked-keys="checkedKeysTemp" @check="handleCheck" />
  133. </div>
  134. <div class="foot right t30">
  135. <el-button size="medium" class="r24" type="primary" @click="onCheck">确定</el-button>
  136. <el-button size="medium" @click="hide">取消</el-button>
  137. </div>
  138. </div>
  139. </Dialog>
  140. </div>
  141. </template>
  142. <script>
  143. import Dialog from "@/layout/components/Dialog";
  144. import TimeZoneSelector from "@/components/TimeZoneSelector";
  145. import terminalMixin from "../../mixins/terminal";
  146. import formMixin from "../../mixins/form";
  147. import tableColsMixin from "../../mixins/tableCols";
  148. import timeZoneMixin from "../../mixins/timeZone";
  149. import { getQuery } from "@/api/flight";
  150. import TableHeaderCell from "@/components/TableHeaderCell";
  151. import { setTableFilters, throttledExportToExcel, timeInZone } from "@/utils/table";
  152. import { GeneralDataReception } from "@/api/dataIntegration";
  153. import { parseTime } from "@/utils/index";
  154. import { mapGetters } from "vuex";
  155. export default {
  156. name: "DepartureTerminalView",
  157. components: { Dialog, TimeZoneSelector, TableHeaderCell },
  158. mixins: [terminalMixin, formMixin, tableColsMixin, timeZoneMixin],
  159. data () {
  160. return {
  161. optionProps: {
  162. value: "inAicompanyCode2",
  163. label: "inAicompanyCode2",
  164. },
  165. optionPropser: {
  166. value: "outAicompanyCode2",
  167. label: "outAicompanyCode2",
  168. },
  169. popoverVisible: false,
  170. orderNum: ["0", "0", "0", "0", "0", "0"], // 默认总数
  171. // 初始表头
  172. tableCols: [
  173. {
  174. prop: "arrivalInfo",
  175. label: "进港航班",
  176. width: 180,
  177. fixed: "left",
  178. children: [
  179. {
  180. prop: "preFlightNO",
  181. label: "航班号",
  182. desc: "进港航班编号",
  183. width: 80,
  184. filterable: true,
  185. sortable: true,
  186. },
  187. {
  188. prop: "preFlightDate",
  189. label: "航班日期",
  190. desc: "指航班计划起飞日期(不变的,机票上),不是预计起飞日期(预计起飞时间可能多个),也不是实际起飞日期(实际起飞等于最后预计)",
  191. width: 100,
  192. },
  193. {
  194. prop: "preAirport",
  195. label: "起飞航站",
  196. desc: "指进港航班的起飞机场三字码",
  197. width: 100,
  198. filterable: true,
  199. sortable: true,
  200. },
  201. {
  202. prop: "actualLandingTime",
  203. label: "降落时间",
  204. desc: "根据优先级别显示时间。优先级别:1.实际降落时间,2.预计降落时间,3.计划降落时间",
  205. width: 100,
  206. },
  207. {
  208. prop: "landingBuild",
  209. label: "降落航站楼",
  210. desc: "指航班降落后位于机场的哪个航站楼",
  211. width: 98,
  212. filterable: true,
  213. sortable: true,
  214. },
  215. {
  216. prop: "carousel",
  217. label: "行李转盘",
  218. desc: "指航班到达后行李提取的地方,仅显示最新信息",
  219. width: 100,
  220. filterable: true,
  221. sortable: true,
  222. },
  223. {
  224. prop: "standForLanding",
  225. label: "降落停机位",
  226. desc: "指航班的停机位代码,数据是变化的,仅显示最新信息",
  227. width: 98,
  228. filterable: true,
  229. sortable: true,
  230. },
  231. {
  232. prop: "inTransferBaggageCount",
  233. label: "中转行李数",
  234. desc: "指航班在本航站预计需要中转至对应航班的行李数量",
  235. },
  236. ],
  237. },
  238. {
  239. prop: "departureInfo",
  240. label: "离港航班",
  241. children: [
  242. {
  243. prop: "inTransferredBaggageCount",
  244. label: "已中转行李数",
  245. desc: "指航班在本航站实际已经中转至对应航班的行李数量",
  246. width: 100,
  247. },
  248. {
  249. prop: "flightNO",
  250. label: "航班号",
  251. desc: "指航班编号",
  252. width: 80,
  253. filterable: true,
  254. sortable: true,
  255. },
  256. {
  257. prop: "flightDate",
  258. label: "航班日期",
  259. desc: "指航班计划起飞日期(不变的,机票上),不是预计起飞日期(预计起飞时间可能多个),也不是实际起飞日期(实际起飞等于最后预计)",
  260. width: 100,
  261. },
  262. {
  263. prop: "actualDepartureTime",
  264. label: "起飞时间",
  265. desc: "指航班预计起飞时间,数据是变化的,仅显示最新结果",
  266. width: 100,
  267. },
  268. {
  269. prop: "targetAirport",
  270. label: "目的站",
  271. desc: "指航班执飞航段的目的航站,以航站三字码+航站简称显示",
  272. filterable: true,
  273. sortable: true,
  274. },
  275. {
  276. prop: "departureBuild",
  277. label: "起飞航站楼",
  278. desc: "指航班执飞航段的起飞航站的航站楼",
  279. width: 98,
  280. filterable: true,
  281. sortable: true,
  282. },
  283. {
  284. prop: "bordingGate",
  285. label: "起飞登机口",
  286. desc: "指航班的登机口代码,数据是变化的,仅显示最新信息",
  287. width: 98,
  288. filterable: true,
  289. sortable: true,
  290. },
  291. {
  292. prop: "standForDepartrue",
  293. label: "起飞停机位",
  294. desc: "指航班的停机位代码,数据是变化的,仅显示最新信息",
  295. width: 98,
  296. filterable: true,
  297. sortable: true,
  298. },
  299. // {
  300. // prop: 'outTransferBaggageCount',
  301. // label: '中转进行李数',
  302. // desc: '指其它航班预计中转至本航班的行李数量',
  303. // width: 100
  304. // },
  305. // {
  306. // prop: 'outTransferredBaggageCount',
  307. // label: '已中转进行李数',
  308. // desc: '指其它航班实际已中转至本航班的行李数量',
  309. // width: 120
  310. // },
  311. {
  312. prop: "timeDifference",
  313. label: "转运时间",
  314. desc: "指中转动作完成时间",
  315. },
  316. ],
  317. },
  318. ],
  319. loading: false,
  320. AirportList: [],
  321. carrierProps: [],
  322. carrierPropsop: [],
  323. loopEvent: null,
  324. arrivalCount: 0,
  325. baggageCount: 0,
  326. hasSetTableScroll: false,
  327. spanArr: [],
  328. contactDot: 0,
  329. flag: 0,
  330. table: null,
  331. WarningData: [],
  332. };
  333. },
  334. computed: {
  335. singleDay () {
  336. return this.startDate === this.endDate;
  337. },
  338. ...mapGetters(["timeZone"]),
  339. },
  340. watch: {
  341. dealedTableData: {
  342. handler (val) {
  343. this.spanArr = [];
  344. let contactDot = this.contactDot;
  345. val.forEach((item, index, arr) => {
  346. if (index === 0) {
  347. this.spanArr.push(1);
  348. } else {
  349. if (item["preFlightNO"] === arr[index - 1]["preFlightNO"] && item["preFlightDate"] === arr[index - 1]["preFlightDate"]) {
  350. this.spanArr[contactDot] += 1;
  351. this.spanArr.push(0);
  352. } else {
  353. this.spanArr.push(1);
  354. contactDot = index;
  355. }
  356. }
  357. });
  358. },
  359. deep: true,
  360. },
  361. },
  362. created () {
  363. // this.getAirPortData()
  364. },
  365. mounted () {
  366. this.$refs["form"].validateField("flightDate");
  367. this.getAirPortData();
  368. this.table = this.$refs.table.bodyWrapper;
  369. const that = this;
  370. this.table.addEventListener("scroll", () => {
  371. that.scrollTop = this.table.scrollTop;
  372. });
  373. },
  374. activated () {
  375. this.table.scrollTop = this.scrollTop;
  376. this.getTableData();
  377. this.getWarningData();
  378. this.loopEvent = setInterval(this.getTableData, LOOP_INTERVAL.transferArrivalTable);
  379. // const { startDate, endDate } = this.$route.query
  380. // Object.entries(this.$route.query).forEach(([key, value]) => {
  381. // if ((value ?? '') !== '' && JSON.stringify(value) !== '[]') {
  382. // this.formData[key] = value
  383. // }
  384. // })
  385. // if (startDate !== null && startDate !== undefined) {
  386. // this.formData.flightDate[0] = startDate
  387. // }
  388. // if (endDate !== null && endDate !== undefined) {
  389. // this.formData.flightDate[1] = endDate
  390. // }
  391. },
  392. deactivated () {
  393. if (this.loopEvent) {
  394. clearInterval(this.loopEvent);
  395. this.loopEvent = null;
  396. }
  397. },
  398. beforeDestroy () {
  399. if (this.loopEvent) {
  400. clearInterval(this.loopEvent);
  401. this.loopEvent = null;
  402. }
  403. },
  404. methods: {
  405. async getWarningData () {
  406. try {
  407. const res = await getQuery({
  408. id: DATACONTENT_ID.departureWarningId,
  409. dataContent: [],
  410. });
  411. if (Number(res.code) === 0) {
  412. const { listValues } = res.returnData;
  413. this.WarningData = listValues;
  414. } else {
  415. this.$message.error(res.message);
  416. }
  417. } catch (error) {
  418. this.$message.error("失败");
  419. }
  420. },
  421. resetLoopEvent () {
  422. this.loading = true;
  423. this.hasSetTableScroll = false;
  424. this.loopEvent && clearInterval(this.loopEvent);
  425. this.getTableData();
  426. this.loopEvent = setInterval(this.getTableData, LOOP_INTERVAL.transferArrivalTable);
  427. },
  428. headerCellClass ({ row, column }) {
  429. const classes = [];
  430. const rule = this.tableDataSortRules[column.property];
  431. if (rule) {
  432. classes.push(rule);
  433. }
  434. return classes.join(" ");
  435. },
  436. tableRowClassName ({ row, rowIndex }) {
  437. const classes = [];
  438. if (row.hasArrived) {
  439. classes.push("bgl-hui");
  440. if (rowIndex === this.arrivalCount - 1) {
  441. classes.push("redBorder");
  442. }
  443. }
  444. return classes.join(" ");
  445. },
  446. changeView () {
  447. // const query = {
  448. // ...this.formData,
  449. // startDate: this.startDate,
  450. // endDate: this.endDate
  451. // }
  452. // delete query.flightDate
  453. // this.$router.replace({
  454. // path: '/transfer/departure',
  455. // query
  456. // })
  457. this.$router.push("/transfer/departure");
  458. },
  459. airPortChange () {
  460. this.getAviationData();
  461. this.upAviationData();
  462. this.resetLoopEvent();
  463. },
  464. dateChangeHandler () {
  465. this.getAviationData();
  466. this.upAviationData();
  467. this.resetLoopEvent();
  468. },
  469. // 选择机场
  470. async getAirPortData () {
  471. try {
  472. const res = await getQuery({
  473. id: DATACONTENT_ID.departureAirId,
  474. dataContent: [],
  475. });
  476. if (Number(res.code) === 0) {
  477. this.AirportList = res.returnData.listValues;
  478. this.formData.currentAirport = "PEK";
  479. this.getAviationData();
  480. this.upAviationData();
  481. this.resetLoopEvent();
  482. } else {
  483. this.$message.error(res.message);
  484. }
  485. } catch (error) {
  486. this.$message.error("失败");
  487. }
  488. },
  489. // 选择航司
  490. async getAviationData () {
  491. try {
  492. const res = await getQuery({
  493. id: DATACONTENT_ID.departureAviJoinId,
  494. dataContent: [this.formData.currentAirport],
  495. });
  496. if (Number(res.code) === 0) {
  497. this.carrierProps = res.returnData.listValues;
  498. } else {
  499. this.$message.error(res.message);
  500. }
  501. } catch (error) {
  502. this.$message.error("失败");
  503. }
  504. },
  505. // 选择航司
  506. async upAviationData () {
  507. try {
  508. const res = await getQuery({
  509. id: DATACONTENT_ID.departureAviLeaveId,
  510. dataContent: [this.formData.currentAirport],
  511. });
  512. if (Number(res.code) === 0) {
  513. this.carrierPropsop = res.returnData.listValues;
  514. } else {
  515. this.$message.error(res.message);
  516. }
  517. } catch (error) {
  518. this.$message.error("失败");
  519. }
  520. },
  521. // 获取表单下拉框数据
  522. // getFormData(params) {
  523. // this.relatedAirportQuery({
  524. // ...params,
  525. // type: 'OUT'
  526. // })
  527. // this.outgoingAirlineQuery(params)
  528. // this.craftTypeQuery(params)
  529. // this.flightAttrQuery(params)
  530. // },
  531. // 获取表格数据
  532. async getTableData () {
  533. if (!this.formData.currentAirport || !this.startDate || !this.endDate) {
  534. return;
  535. }
  536. const arrs1 = [this.formData.inboundCarrier.length === 0 ? "" : this.formData.inboundCarrier[0]];
  537. const arrs2 = [this.formData.outgoingAirline.length === 0 ? "" : this.formData.outgoingAirline[0]];
  538. const arr = [
  539. this.formData.currentAirport,
  540. this.startDate,
  541. this.endDate,
  542. ...arrs1,
  543. ...arrs1,
  544. ...arrs1,
  545. ...arrs2,
  546. ...arrs2,
  547. ...arrs2,
  548. // this.formData.inboundCarrier,
  549. // this.formData.outgoingAirline,
  550. // JSON.stringify(this.formData.inboundCarrier),
  551. // JSON.stringify(this.formData.outgoingAirline),
  552. ];
  553. try {
  554. const res = await getQuery({
  555. id: DATACONTENT_ID.departureTableId,
  556. dataContent: [...arr],
  557. });
  558. if (Number(res.code) === 0) {
  559. this.initTableData(res.returnData.listValues);
  560. } else {
  561. }
  562. this.loading = false;
  563. } catch (error) {
  564. if (this.loopEvent) {
  565. clearInterval(this.loopEvent);
  566. this.loopEvent = null;
  567. }
  568. this.loading = false;
  569. }
  570. },
  571. initTableData (tableData) {
  572. const currentTime = new Date();
  573. const curTime = this.formatTime(currentTime);
  574. this.arrivalCount = 0;
  575. this.baggageCount = 0;
  576. tableData.forEach((item) => {
  577. const o1 = item["inTransferBaggageCount"];
  578. const o2 = item["inTransferredBaggageCount"];
  579. const out1 = o1 != undefined || o1 != null ? o1 : 0;
  580. const out2 = o2 != undefined || o2 != null ? o2 : 0;
  581. if (this.hasArrived(item)) {
  582. this.arrivalCount++;
  583. }
  584. if (item["hasArrived"] && out1 - out2 > 0) {
  585. this.WarningData.forEach((p) => {
  586. const startTime = this.formatTime(timeInZone((p.startDate ?? "").replace("T", " "), this.timeZone), 2);
  587. const endTime = this.formatTime(timeInZone((p.endDate ?? "").replace("T", " "), this.timeZone), 2);
  588. const planTime = this.formatTime(timeInZone((item.actualDepartureTime ?? "").replace("T", " "), this.timeZone), 2);
  589. const capTime = Math.ceil((planTime - curTime) / (1000 * 60));
  590. if (Number(startTime) - Number(curTime) < 0 && Number(endTime) - Number(curTime) > 0) {
  591. const newItem = _.cloneDeep(item);
  592. if (p.flightNO != "" && p.flightNO == item.flightNO) {
  593. if (p.warningDuration && capTime - p.warningDuration < 0 && capTime - p.alarmDuration > 0) {
  594. item["warningState"] = 1;
  595. const returnedTarget = Object.assign(newItem, p);
  596. this.sendLog(returnedTarget);
  597. }
  598. if (p.alarmDuration && capTime - p.alarmDuration < 0) {
  599. item["warningState"] = 2;
  600. const returnedTarget = Object.assign(newItem, p);
  601. this.sendLog(returnedTarget);
  602. }
  603. } else if (p.flightNO == "" && p.IATACode != "") {
  604. if (item.flightNO.substring(0, 2) == p.IATACode) {
  605. if (p.warningDuration && capTime - p.warningDuration < 0 && capTime - p.alarmDuration > 0) {
  606. item["warningState"] = 1;
  607. const returnedTarget = Object.assign(newItem, p);
  608. this.sendLog(returnedTarget);
  609. }
  610. if (p.alarmDuration && capTime - p.alarmDuration < 0) {
  611. item["warningState"] = 2;
  612. const returnedTarget = Object.assign(newItem, p);
  613. this.sendLog(returnedTarget);
  614. }
  615. }
  616. }
  617. }
  618. });
  619. }
  620. this.baggageCount = this.baggageCount + item.inTransferBaggageCount;
  621. });
  622. this.tableData = this._.sortBy(tableData, ["actualLandingTime", "preFlightNO", "actualDepartureTime", "flightNO"]);
  623. setTableFilters(this.tableData, this.tableDataFilters);
  624. this.toOrderNum(this.baggageCount);
  625. this.$nextTick(() => {
  626. this.setTableScroll();
  627. });
  628. },
  629. formatTime (date, type = 1) {
  630. let time = null;
  631. if (type == 1) {
  632. time = parseTime(date, "{y}-{m}-{d} {h}:{i}:{s}");
  633. } else {
  634. time = date;
  635. }
  636. const newTimt = new Date(time);
  637. return newTimt.getTime();
  638. },
  639. async sendLog (obj) {
  640. try {
  641. const newObj = {
  642. logTime: parseTime(new Date(), "{y}-{m}-{d} {h}:{i}:{s}"),
  643. logInfo: JSON.stringify(obj),
  644. flightNO: obj.flightNO,
  645. flightDate: obj.flightDate,
  646. luggageSN: "",
  647. strategyUseID: obj.alarmStrategyID,
  648. event: 1,
  649. };
  650. await GeneralDataReception({
  651. serviceId: SERVICE_ID.departureScId,
  652. dataContent: JSON.stringify(newObj),
  653. });
  654. } catch (error) {
  655. this.$message.error("失败");
  656. }
  657. },
  658. hasArrived (flight) {
  659. if (flight.actualLandingTime) {
  660. const now = new Date();
  661. const actualLandingTime = new Date(flight.actualLandingTime.replace("T", " "));
  662. flight["hasArrived"] = now > actualLandingTime && !flight["flightCanceled"];
  663. } else {
  664. flight["hasArrived"] = false;
  665. }
  666. return flight["hasArrived"];
  667. },
  668. setTableScroll () {
  669. if (!this.singleDay || this.hasSetTableScroll || this.arrivalCount === 0) {
  670. return;
  671. }
  672. const table = this.$refs["table"].$el;
  673. const scrollParent = table.querySelector(".el-table__body-wrapper");
  674. if (scrollParent.scrollHeight <= scrollParent.offsetHeight) {
  675. return;
  676. }
  677. const lastRow = table.querySelectorAll(".el-table__body tr")[this.arrivalCount - 1];
  678. setTimeout(() => {
  679. const scrollMid = lastRow.offsetTop + lastRow.offsetHeight - scrollParent.offsetHeight / 2;
  680. const scrollMax = scrollParent.scrollHeight - scrollParent.offsetHeight;
  681. if (scrollMid > 0) {
  682. const scrollHeight = Math.min(scrollMid, scrollMax);
  683. scrollParent.scrollTo(0, scrollHeight);
  684. }
  685. }, 0);
  686. this.hasSetTableScroll = true;
  687. },
  688. setNumberTransform () {
  689. const numberItems = this.$refs.numberItem; // 拿到数字的ref,计算元素数量
  690. const numberArr = this.orderNum.filter((item) => !isNaN(item));
  691. // 结合CSS 对数字字符进行滚动,显示订单数量
  692. for (let index = 0; index < numberItems.length; index++) {
  693. const elem = numberItems[index];
  694. elem.style.transform = `translate(-50%, -${numberArr[index] * 10}%)`;
  695. }
  696. },
  697. toOrderNum (num) {
  698. num = num.toString();
  699. if (num.length < 6) {
  700. num = "0" + num; // 如未满八位数,添加"0"补位
  701. this.toOrderNum(num); // 递归添加"0"补位
  702. } else if (num.length >= 6) {
  703. this.orderNum = num.split(""); // 将其便变成数据,渲染至滚动数组
  704. } else {
  705. // 订单总量数字超过八位显示异常
  706. this.$message.warning("总量数字过大");
  707. }
  708. this.setNumberTransform();
  709. },
  710. arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
  711. for (let i = 0; i < 7; i++) {
  712. if (columnIndex === i) {
  713. const _row = this.spanArr[rowIndex];
  714. const _col = _row > 0 ? 1 : 0;
  715. return {
  716. rowspan: _row,
  717. colspan: _col,
  718. };
  719. }
  720. }
  721. },
  722. exportHandler (refName, tableName) {
  723. if (this.loading) {
  724. return;
  725. }
  726. const table = this.$refs[refName].$el.cloneNode(true);
  727. const fileName = `${tableName}-${this.currentAirport}-${this.startDate}-${this.endDate}.xlsx`;
  728. throttledExportToExcel(table, tableName, fileName, 2);
  729. },
  730. },
  731. };
  732. </script>
  733. <style lang="scss" scoped>
  734. .terminal-form-wrap {
  735. padding-top: 11px;
  736. padding-left: 5px;
  737. ::v-deep .form {
  738. display: flex;
  739. justify-content: space-between;
  740. .form-left {
  741. flex: 1;
  742. }
  743. .form-right {
  744. flex: 0 1 auto;
  745. }
  746. .el-form-item {
  747. margin-bottom: 0px;
  748. margin-right: 8px;
  749. button,
  750. input,
  751. optgroup,
  752. select,
  753. textarea {
  754. font-family: Helvetica, "Microsoft YaHei";
  755. font-size: 14px;
  756. }
  757. .el-switch__label {
  758. color: #303133;
  759. }
  760. .el-form-item__error {
  761. z-index: 10;
  762. }
  763. }
  764. .btn-img {
  765. position: relative;
  766. top: 6px;
  767. }
  768. }
  769. .box-item {
  770. position: relative;
  771. height: 50px;
  772. font-size: 18px;
  773. line-height: 32px;
  774. text-align: center;
  775. list-style: none;
  776. color: #2d7cff;
  777. writing-mode: vertical-lr;
  778. text-orientation: upright;
  779. /*文字禁止编辑*/
  780. -moz-user-select: none; /*火狐*/
  781. -webkit-user-select: none; /*webkit浏览器*/
  782. -ms-user-select: none; /*IE10*/
  783. -khtml-user-select: none; /*早期浏览器*/
  784. user-select: none;
  785. /* overflow: hidden; */
  786. p {
  787. line-height: 32px;
  788. writing-mode: horizontal-tb !important;
  789. text-orientation: none !important;
  790. /*文字禁止编辑*/
  791. -moz-user-select: none; /*火狐*/
  792. -webkit-user-select: none; /*webkit浏览器*/
  793. -ms-user-select: none; /*IE10*/
  794. -khtml-user-select: none; /*早期浏览器*/
  795. user-select: none;
  796. margin-top: 5px;
  797. }
  798. }
  799. /* 默认逗号设置 */
  800. .mark-item {
  801. width: 10px;
  802. height: 32px;
  803. margin-right: 5px;
  804. line-height: 10px;
  805. font-size: 18px;
  806. position: relative;
  807. & > span {
  808. position: absolute;
  809. width: 100%;
  810. bottom: 0;
  811. writing-mode: vertical-rl;
  812. text-orientation: upright;
  813. }
  814. }
  815. /*滚动数字设置*/
  816. .number-item {
  817. width: 41px;
  818. height: 42px;
  819. /* 背景图片 */
  820. // background: url(/images/text-bg-blue.png) no-repeat center center;
  821. // background-size: 100% 100%;
  822. // background: #ccc;
  823. list-style: none;
  824. margin-right: 5px;
  825. // background:rgba(250,250,250,1);
  826. border-radius: 4px;
  827. border: 3px solid rgb(221, 221, 221);
  828. & > span {
  829. position: relative;
  830. display: inline-block;
  831. margin-right: 10px;
  832. width: 100%;
  833. height: 100%;
  834. writing-mode: vertical-rl;
  835. text-orientation: upright;
  836. overflow: hidden;
  837. & > i {
  838. font-style: normal;
  839. position: absolute;
  840. top: 11px;
  841. left: 50%;
  842. transform: translate(-50%, -1%);
  843. transition: transform 1s ease-in-out;
  844. letter-spacing: 10px;
  845. }
  846. }
  847. }
  848. .number-item:last-child {
  849. margin-right: 0;
  850. }
  851. }
  852. .terminal-table {
  853. width: 100%;
  854. ::v-deep .table {
  855. width: 100%;
  856. .cell {
  857. padding: 0;
  858. text-align: center;
  859. font-size: 14px;
  860. font-family: Helvetica, "Microsoft YaHei";
  861. letter-spacing: 0;
  862. }
  863. .cell-click {
  864. cursor: pointer;
  865. color: #2d7cff;
  866. &.cell-clicked {
  867. color: purple;
  868. }
  869. }
  870. .el-table__header-wrapper,
  871. .el-table__fixed-header-wrapper {
  872. .cell {
  873. font-weight: bold;
  874. color: #101116;
  875. }
  876. .has-gutter {
  877. tr {
  878. .bgl-huang {
  879. background: #fcf0b1;
  880. }
  881. }
  882. }
  883. }
  884. .el-table__body-wrapper,
  885. .el-table__fixed-body-wrapper {
  886. tr.bgl-hui {
  887. background: #d2d6df;
  888. td {
  889. background: #d2d6df;
  890. }
  891. &.redBorder {
  892. position: relative;
  893. &::after {
  894. content: "";
  895. position: absolute;
  896. left: 0;
  897. bottom: 0;
  898. width: 100%;
  899. height: 2px;
  900. background: #e83f82;
  901. }
  902. }
  903. }
  904. }
  905. td.cell-tounLoad {
  906. background: lightcoral !important;
  907. position: relative;
  908. &::after {
  909. content: "";
  910. display: block;
  911. width: 100%;
  912. height: 100%;
  913. position: absolute;
  914. top: 0;
  915. left: 0;
  916. border: 2px dashed red;
  917. }
  918. }
  919. td.cell-tounLoadNew {
  920. background: #fcf0b1 !important;
  921. position: relative;
  922. &::after {
  923. content: "";
  924. display: block;
  925. width: 100%;
  926. height: 100%;
  927. position: absolute;
  928. top: 0;
  929. left: 0;
  930. border: 2px dashed #e28913;
  931. }
  932. }
  933. .el-table__cell.is-hidden > * {
  934. visibility: visible;
  935. }
  936. }
  937. }
  938. </style>