index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  1. <!--
  2. * @Author: zk
  3. * @Date: 2022-01-17 10:39:22
  4. * @LastEditTime: 2022-05-07 16:55:50
  5. * @LastEditors: your name
  6. * @Description: 离港01
  7. -->
  8. <template>
  9. <div class="departure-one">
  10. <!--功能区-表单-->
  11. <div class="departure-form">
  12. <el-form
  13. ref="form"
  14. :inline="true"
  15. :model="formData"
  16. :rules="rules"
  17. class="form"
  18. >
  19. <el-form-item prop="currentAirport">
  20. <!-- <el-cascader
  21. v-model="formData.currentAirport"
  22. style="width:144px;margin-left:10px"
  23. placeholder="全部机场"
  24. size="small"
  25. :options="currentAirportList"
  26. :props="currentAirportProps"
  27. collapse-tags
  28. clearable
  29. filterable
  30. @change="setCurrentAirport"
  31. /> -->
  32. <el-select
  33. v-model="formData.currentAirport"
  34. size="small"
  35. @change="airPortChange"
  36. placeholder="请选择机场"
  37. >
  38. <el-option
  39. v-for="(item, index) in AirportList"
  40. :key="index"
  41. :label="item.PlanDepartureApt"
  42. :value="item.PlanDepartureApt"
  43. >
  44. </el-option>
  45. </el-select>
  46. </el-form-item>
  47. <el-form-item prop="inboundCarrier">
  48. <el-cascader
  49. v-model="formData.inboundCarrier"
  50. style="width: 164px"
  51. size="small"
  52. :options="carrierList"
  53. :props="inAicompanyCode2"
  54. placeholder="进港承运航司"
  55. collapse-tags
  56. clearable
  57. filterable
  58. @change="onSubmit"
  59. />
  60. </el-form-item>
  61. <el-form-item prop="outgoingAirline">
  62. <el-cascader
  63. v-model="formData.outgoingAirline"
  64. style="width: 164px"
  65. size="small"
  66. :options="carrierList"
  67. :props="outAicompanyCode2"
  68. placeholder="离港承运航司"
  69. collapse-tags
  70. clearable
  71. filterable
  72. @change="onSubmit"
  73. />
  74. </el-form-item>
  75. <el-form-item prop="startDate">
  76. <el-date-picker
  77. v-model="formData.startDate"
  78. style="width: 216px"
  79. size="small"
  80. type="date"
  81. value-format="yyyy-MM-dd"
  82. placeholder="开始时间"
  83. @change="setStartDate"
  84. />
  85. </el-form-item>
  86. <el-form-item prop="endDate">
  87. <el-date-picker
  88. v-model="formData.endDate"
  89. style="width: 216px"
  90. size="small"
  91. type="date"
  92. value-format="yyyy-MM-dd"
  93. placeholder="结束时间"
  94. @change="setEndDate"
  95. />
  96. </el-form-item>
  97. <!-- <el-form-item>
  98. <div class="box-item">
  99. <p>预计装载总数:</p>
  100. <li
  101. :class="{ 'number-item': !isNaN(item), 'mark-item': isNaN(item) }"
  102. v-for="(item, index) in orderNum"
  103. :key="index"
  104. >
  105. <span v-if="!isNaN(item)">
  106. <i ref="numberItem">0123456789</i>
  107. </span>
  108. <span class="comma" v-else>{{ item }}</span>
  109. </li>
  110. </div>
  111. </el-form-item> -->
  112. <div style="float: right">
  113. <el-form-item prop="search">
  114. <el-input
  115. v-model="formData.search"
  116. style="width: 240px; margin-left: 105px"
  117. size="small"
  118. placeholder="请输入内容"
  119. prefix-icon="el-icon-search"
  120. clearable
  121. @clear="inputClear"
  122. @keyup.enter="onSubmit"
  123. />
  124. </el-form-item>
  125. <el-form-item>
  126. <el-button size="small" type="primary" @click="onSubmit"
  127. >搜索</el-button
  128. >
  129. </el-form-item>
  130. <el-form-item>
  131. <el-switch
  132. v-model="formData.switch"
  133. style="margin-left: 40px"
  134. active-text="显示中转"
  135. />
  136. </el-form-item>
  137. <el-form-item v-is="['i_timeIcon']">
  138. <el-dropdown>
  139. <img
  140. class="checkTime msgImg"
  141. src="../../../../assets/departure/ic_time.png"
  142. />
  143. <el-dropdown-menu slot="dropdown" class="time-zone">
  144. <el-dropdown-item>国内Local/国际UTC</el-dropdown-item>
  145. <el-dropdown-item>Local</el-dropdown-item>
  146. <el-dropdown-item>UTC</el-dropdown-item>
  147. </el-dropdown-menu>
  148. </el-dropdown>
  149. </el-form-item>
  150. <el-form-item>
  151. <img
  152. class="msgImg"
  153. src="../../../../assets/departure/ic_setting.png"
  154. @click="show"
  155. />
  156. </el-form-item>
  157. <el-form-item>
  158. <el-button
  159. class="btn-square setBtn"
  160. type="primary"
  161. icon="el-icon-s-tools"
  162. size="mini"
  163. @click="show"
  164. />
  165. </el-form-item>
  166. </div>
  167. </el-form>
  168. </div>
  169. <!--表格-->
  170. <div
  171. v-loading="loading"
  172. class="departure-table"
  173. element-loading-text="拼命加载中"
  174. element-loading-spinner="el-icon-loading"
  175. element-loading-background="rgba(0, 0, 0, 0.8)"
  176. >
  177. <el-table
  178. ref="table"
  179. :data="tableData"
  180. class="table"
  181. max-height="100%"
  182. :height="computedTableHeight"
  183. :span-method="tableSpanMethod"
  184. show-summary
  185. :summary-method="summaryMethod"
  186. border
  187. stripe
  188. @row-click="rowClick"
  189. >
  190. <el-table-column
  191. v-for="(item, index) in tableColsCopy"
  192. :key="index"
  193. :prop="item.statCode"
  194. :label="item.statName"
  195. >
  196. <el-table-column
  197. v-for="(p, i) in item.children"
  198. :key="i"
  199. :prop="p.statCode"
  200. :label="p.statName"
  201. :formatter="tableFormat"
  202. />
  203. </el-table-column>
  204. </el-table>
  205. </div>
  206. <!--列设置-->
  207. <Dialog :flag="dialogFlag" class="dialog-check-cols">
  208. <div class="col-dialog">
  209. <div class="title">列设置</div>
  210. <div class="content">
  211. <el-tree
  212. :data="tableCols"
  213. :class="colsCheckClass"
  214. show-checkbox
  215. node-key="index"
  216. :default-expand-all="true"
  217. :props="{
  218. label: 'statName',
  219. children: 'children',
  220. }"
  221. :default-checked-keys="checkedKeysTemp"
  222. @check="handleCheck"
  223. />
  224. </div>
  225. <div class="foot right t30">
  226. <el-button size="medium" class="r24" type="primary" @click="onCheck"
  227. >确定</el-button
  228. >
  229. <el-button size="medium" @click="hide">取消</el-button>
  230. </div>
  231. </div>
  232. </Dialog>
  233. </div>
  234. </template>
  235. <script>
  236. import Dialog from "@/layout/components/Dialog";
  237. import terminalMixin from "../../mixins/terminal";
  238. import formMixin from "../../mixins/form";
  239. import tableColsMixin from "../../mixins/tableCols";
  240. import { getQuery } from "@/api/flight";
  241. export default {
  242. name: "DepartureTerminalView",
  243. components: { Dialog },
  244. mixins: [terminalMixin, formMixin, tableColsMixin],
  245. data() {
  246. return {
  247. orderNum: ["0", "0", "0", "0"], // 默认总数
  248. // 初始表头
  249. tableCols: [
  250. {
  251. statCode: "arrivalInfo",
  252. statName: "进港航班",
  253. children: [
  254. {
  255. statCode: "PreFlightNO",
  256. statName: "航班号",
  257. width: 122,
  258. },
  259. {
  260. statCode: "PreFlightDate",
  261. statName: "航班日期",
  262. width: 83,
  263. },
  264. {
  265. statCode: "PreAirport",
  266. statName: "起飞机场",
  267. width: 79,
  268. },
  269. {
  270. statCode: "ActualLandingTime",
  271. statName: "降落时间",
  272. width: 79,
  273. },
  274. {
  275. statCode: "LandingBuild",
  276. statName: "降落航站楼",
  277. width: 79,
  278. },
  279. {
  280. statCode: "Carousel",
  281. statName: "行李转盘",
  282. width: 79,
  283. },
  284. {
  285. statCode: "StandForLanding",
  286. statName: "降落停机位",
  287. width: 79,
  288. },
  289. {
  290. statCode: "inTransferBaggageCount",
  291. statName: "中转行李数",
  292. width: 58,
  293. },
  294. {
  295. statCode: "inTransferredBaggageCount",
  296. statName: "已中转行李数",
  297. width: 63,
  298. },
  299. ],
  300. },
  301. {
  302. statCode: "departureInfo",
  303. statName: "离港航班",
  304. children: [
  305. {
  306. statCode: "FlightNO",
  307. statName: "航班号",
  308. width: 81,
  309. },
  310. {
  311. statCode: "FlightDate",
  312. statName: "航班日期",
  313. width: 100,
  314. },
  315. {
  316. statCode: "ActualDepartureTime",
  317. statName: "起飞时间",
  318. width: 100,
  319. },
  320. {
  321. statCode: "TargetAirport",
  322. statName: "目的站",
  323. width: 93,
  324. },
  325. {
  326. statCode: "DepartureBuild",
  327. statName: "起飞航站楼",
  328. width: 81,
  329. },
  330. {
  331. statCode: "BordingGate",
  332. statName: "起飞登机口",
  333. width: 81,
  334. },
  335. {
  336. statCode: "StandForDepartrue",
  337. statName: "起飞停机位",
  338. width: 81,
  339. },
  340. {
  341. statCode: "outTransferBaggageCount",
  342. statName: "中转进行李数",
  343. width: 93,
  344. },
  345. {
  346. statCode: "outTransferredBaggageCount",
  347. statName: "已中转进行李数",
  348. width: 120,
  349. },
  350. {
  351. statCode: "timeDifference",
  352. statName: "转运时间",
  353. width: 93,
  354. },
  355. ],
  356. },
  357. ],
  358. AirportList: [],
  359. carrierProps: [],
  360. carrierPropsop: [],
  361. flightBaggageTableFilters: {
  362. FlightNO: [],
  363. FlightDate: [],
  364. PlanDepartureTime: [],
  365. TargetAirport: [],
  366. BordingGate: [],
  367. StandForDepartrue: [],
  368. DepartureBuild: [],
  369. },
  370. loopEvent: null,
  371. leaveCount: 0,
  372. baggageCount: 0,
  373. };
  374. },
  375. created() {
  376. this.getAirPortData();
  377. this.getAviationData();
  378. this.upAviationData();
  379. },
  380. methods: {
  381. airPortChange() {
  382. this.getTableData();
  383. },
  384. //选择机场
  385. async getAirPortData() {
  386. try {
  387. const res = await getQuery({
  388. id: 72,
  389. dataContent: [],
  390. });
  391. if (res.code == 0) {
  392. this.AirportList = res.returnData;
  393. this.formData.currentAirport = "PEK";
  394. this.getTableData();
  395. } else {
  396. this.$message.error(res.message);
  397. }
  398. } catch (error) {
  399. console.log("出错了", error);
  400. }
  401. },
  402. //选择航司
  403. async getAviationData() {
  404. try {
  405. const res = await getQuery({
  406. id: 71,
  407. dataContent: [this.formData.currentAirport],
  408. });
  409. if (res.code == 0) {
  410. this.carrierProps = res.returnData;
  411. this.formData.inboundCarrier = "PEK";
  412. this.getTableData();
  413. } else {
  414. this.$message.error(res.message);
  415. }
  416. } catch (error) {
  417. console.log("出错了", error);
  418. }
  419. },
  420. //选择航司
  421. async upAviationData() {
  422. try {
  423. const res = await getQuery({
  424. id: 74,
  425. dataContent: [this.formData.currentAirport],
  426. });
  427. if (res.code == 0) {
  428. this.carrierPropsop = res.returnData;
  429. this.formData.outgoingAirline = "PEK";
  430. this.getTableData();
  431. } else {
  432. this.$message.error(res.message);
  433. }
  434. } catch (error) {
  435. console.log("出错了", error);
  436. }
  437. },
  438. tableRowClassName({ row, rowIndex }) {
  439. if (row.hasTakenOff == 0) {
  440. if (rowIndex == this.leaveCount - 1) {
  441. return "bgl-hui redBorder";
  442. } else {
  443. return "bgl-hui";
  444. }
  445. }
  446. },
  447. tableCellClassName({ row, column }) {
  448. if (
  449. column.property === "transfer_all" ||
  450. column.property === "departureAnomaly" ||
  451. column.property === "riskWarning"
  452. ) {
  453. return "bgl-huang";
  454. }
  455. },
  456. // 获取表单下拉框数据
  457. // getFormData(params) {
  458. // this.relatedAirportQuery({
  459. // ...params,
  460. // type: 'OUT'
  461. // })
  462. // this.outgoingAirlineQuery(params)
  463. // this.craftTypeQuery(params)
  464. // this.flightAttrQuery(params)
  465. // },
  466. // 获取表格数据
  467. async getTableData() {
  468. let arr = [
  469. this.formData.currentAirport,
  470. this.formData.startDate,
  471. this.formData.endDate,
  472. this.formData.inboundCarrier,
  473. this.formData.outgoingAirline,
  474. ];
  475. try {
  476. const res = await getQuery({
  477. id: 69,
  478. dataContent: [...arr, ...arr, ...arr],
  479. });
  480. if (res.code == 0) {
  481. this.initTableData(res.returnData);
  482. } else {
  483. console.log(res.message);
  484. }
  485. } catch (error) {
  486. clearInterval(this.loopEvent);
  487. console.log("出错了", error);
  488. }
  489. },
  490. initTableData(tableData) {
  491. this.leaveCount = 0;
  492. this.baggageCount = 0;
  493. tableData.forEach((item) => {
  494. if (item.hasTakenOff == 0) {
  495. this.leaveCount++;
  496. }
  497. // item["waitfanj"] = item["noCheckInNumber"] - item["unLoad"];
  498. this.baggageCount = this.baggageCount + item.preLoad;
  499. });
  500. this.tableData = this._.sortBy(tableData, [
  501. "FlightDate",
  502. "PlanDepartureTime",
  503. ]);
  504. this.setTableFilters();
  505. this.toOrderNum(this.baggageCount);
  506. // setInterval(() => {
  507. // this.baggageCount = this.baggageCount+1;
  508. // // 这里输入数字即可调用
  509. // }, 2000);
  510. },
  511. // 表格添加过滤条件
  512. setTableFilters() {
  513. this.tableData.forEach((item) => {
  514. Object.keys(this.flightBaggageTableFilters).forEach((key) => {
  515. if (
  516. (item[key] ?? "") !== "" &&
  517. this.flightBaggageTableFilters[key].every(
  518. (obj) => obj.value !== item[key]
  519. )
  520. ) {
  521. this.flightBaggageTableFilters[key].push({
  522. text: item[key],
  523. value: item[key],
  524. });
  525. }
  526. this.flightBaggageTableFilters[key] = this._.sortBy(
  527. this.flightBaggageTableFilters[key],
  528. ["value"]
  529. );
  530. });
  531. });
  532. },
  533. filterHandler(value, row, column) {
  534. const property = column["property"];
  535. return row[property] === value;
  536. },
  537. setNumberTransform() {
  538. const numberItems = this.$refs.numberItem; // 拿到数字的ref,计算元素数量
  539. const numberArr = this.orderNum.filter((item) => !isNaN(item));
  540. // 结合CSS 对数字字符进行滚动,显示订单数量
  541. for (let index = 0; index < numberItems.length; index++) {
  542. const elem = numberItems[index];
  543. elem.style.transform = `translate(-50%, -${numberArr[index] * 10}%)`;
  544. }
  545. },
  546. toOrderNum(num) {
  547. num = num.toString();
  548. if (num.length < 4) {
  549. num = "0" + num; // 如未满八位数,添加"0"补位
  550. this.toOrderNum(num); // 递归添加"0"补位
  551. } else if (num.length === 4) {
  552. this.orderNum = num.split(""); // 将其便变成数据,渲染至滚动数组
  553. } else {
  554. // 订单总量数字超过八位显示异常
  555. this.$message.warning("总量数字过大");
  556. }
  557. this.setNumberTransform();
  558. },
  559. tableSpanMethod({ row, column, rowIndex, columnIndex }) {
  560. if (
  561. [
  562. "FlightNO",
  563. "FlightDate",
  564. "PlanLandingTime",
  565. "PlanDepartureApt",
  566. "LandingBuild",
  567. "Carousel",
  568. "StandForLanding",
  569. "positionDistribution",
  570. "expect_load",
  571. "loadflight",
  572. ].includes(column["property"])
  573. ) {
  574. const _row = this.spanArr[rowIndex];
  575. const _col = _row > 0 ? 1 : 0;
  576. return {
  577. rowspan: _row,
  578. colspan: _col,
  579. };
  580. }
  581. },
  582. },
  583. mounted() {
  584. let that = this;
  585. this.loopEvent = setInterval(function () {
  586. that.getTableData();
  587. }, 3000);
  588. },
  589. beforeDestroy() {
  590. clearInterval(this.loopEvent);
  591. },
  592. };
  593. </script>
  594. <style lang="scss" scoped>
  595. .departure-form {
  596. padding-top: 11px;
  597. padding-left: 5px;
  598. ::v-deep .form {
  599. .el-form-item {
  600. margin-bottom: 0px;
  601. margin-right: 8px;
  602. button,
  603. input,
  604. optgroup,
  605. select,
  606. textarea {
  607. font-family: Helvetica, "Microsoft YaHei";
  608. font-size: 14px;
  609. }
  610. .el-switch__label {
  611. color: #303133;
  612. }
  613. .el-form-item__error {
  614. z-index: 10;
  615. }
  616. .el-button {
  617. &.btn-square {
  618. width: 30px;
  619. height: 30px;
  620. display: flex;
  621. align-items: center;
  622. justify-content: center;
  623. margin-top: 5px;
  624. }
  625. }
  626. }
  627. .checkTime {
  628. margin: 0 16px;
  629. }
  630. .msgImg {
  631. cursor: pointer;
  632. position: relative;
  633. top: 6px;
  634. }
  635. }
  636. .box-item {
  637. position: relative;
  638. height: 32px;
  639. font-size: 18px;
  640. line-height: 32px;
  641. text-align: center;
  642. list-style: none;
  643. color: #2d7cff;
  644. writing-mode: vertical-lr;
  645. text-orientation: upright;
  646. /*文字禁止编辑*/
  647. -moz-user-select: none; /*火狐*/
  648. -webkit-user-select: none; /*webkit浏览器*/
  649. -ms-user-select: none; /*IE10*/
  650. -khtml-user-select: none; /*早期浏览器*/
  651. user-select: none;
  652. /* overflow: hidden; */
  653. p {
  654. line-height: 32px;
  655. writing-mode: horizontal-tb !important;
  656. text-orientation: none !important;
  657. /*文字禁止编辑*/
  658. -moz-user-select: none; /*火狐*/
  659. -webkit-user-select: none; /*webkit浏览器*/
  660. -ms-user-select: none; /*IE10*/
  661. -khtml-user-select: none; /*早期浏览器*/
  662. user-select: none;
  663. margin-top: 5px;
  664. }
  665. }
  666. /* 默认逗号设置 */
  667. .mark-item {
  668. width: 10px;
  669. height: 32px;
  670. margin-right: 5px;
  671. line-height: 10px;
  672. font-size: 18px;
  673. position: relative;
  674. & > span {
  675. position: absolute;
  676. width: 100%;
  677. bottom: 0;
  678. writing-mode: vertical-rl;
  679. text-orientation: upright;
  680. }
  681. }
  682. /*滚动数字设置*/
  683. .number-item {
  684. width: 41px;
  685. height: 42px;
  686. /* 背景图片 */
  687. background: url(/images/text-bg-blue.png) no-repeat center center;
  688. background-size: 100% 100%;
  689. // background: #ccc;
  690. list-style: none;
  691. margin-right: 5px;
  692. // background:rgba(250,250,250,1);
  693. border-radius: 4px;
  694. border: 3px solid rgb(221, 221, 221);
  695. & > span {
  696. position: relative;
  697. display: inline-block;
  698. margin-right: 10px;
  699. width: 100%;
  700. height: 100%;
  701. writing-mode: vertical-rl;
  702. text-orientation: upright;
  703. overflow: hidden;
  704. & > i {
  705. font-style: normal;
  706. position: absolute;
  707. top: 11px;
  708. left: 50%;
  709. transform: translate(-50%, -1%);
  710. transition: transform 1s ease-in-out;
  711. letter-spacing: 10px;
  712. }
  713. }
  714. }
  715. .number-item:last-child {
  716. margin-right: 0;
  717. }
  718. }
  719. .departure-table {
  720. width: 100%;
  721. ::v-deep .table {
  722. width: 100%;
  723. .cell {
  724. padding: 0;
  725. text-align: center;
  726. font-size: 14px;
  727. font-family: Helvetica, "Microsoft YaHei";
  728. letter-spacing: 0;
  729. }
  730. .el-table__header-wrapper {
  731. .cell {
  732. font-weight: bold;
  733. color: #101116;
  734. }
  735. .has-gutter {
  736. tr {
  737. .bgl-huang {
  738. background: #fcf0b1;
  739. }
  740. }
  741. }
  742. }
  743. .el-table__body-wrapper {
  744. tr.bgl-hui {
  745. background: #d2d6df;
  746. td {
  747. background: #d2d6df;
  748. }
  749. &.redBorder {
  750. position: relative;
  751. &::after {
  752. content: "";
  753. position: absolute;
  754. left: 0;
  755. bottom: 0;
  756. width: 100%;
  757. height: 2px;
  758. background: #e83f82;
  759. }
  760. }
  761. }
  762. }
  763. }
  764. }
  765. </style>