123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890 |
- <!--
- * @Author: zk
- * @Date: 2022-01-17 10:39:22
- * @LastEditTime: 2022-05-31 09:26:51
- * @LastEditors: your name
- * @Description: 中转进港
- -->
- <template>
- <div class="transfer-in">
- <!--功能区-表单-->
- <div
- ref="formWrap"
- class="terminal-form-wrap"
- >
- <el-form
- ref="form"
- :inline="true"
- :model="formData"
- :rules="rules"
- class="form"
- >
- <div class="form-left">
- <el-form-item prop="currentAirport">
- <!-- <el-cascader
- v-model="formData.currentAirport"
- style="width:144px;margin-left:10px"
- placeholder="全部机场"
- size="small"
- :options="currentAirportList"
- :props="currentAirportProps"
- collapse-tags
- clearable
- filterable
- @change="setCurrentAirport"
- /> -->
- <el-select
- v-model="formData.currentAirport"
- class="input-shadow"
- size="small"
- filterable
- placeholder="请选择机场"
- @change="airPortChange"
- >
- <el-option
- v-for="(item, index) in AirportList"
- :key="index"
- :label="item.PlanDepartureApt"
- :value="item.PlanDepartureApt"
- />
- </el-select>
- </el-form-item>
- <el-form-item prop="inboundCarrier">
- <el-cascader
- v-model="formData.inboundCarrier"
- class="input-shadow"
- style="width: 164px"
- size="small"
- :options="carrierProps"
- :props="optionProps"
- placeholder="进港承运航司"
- collapse-tags
- clearable
- filterable
- @change="getTableData"
- />
- </el-form-item>
- <el-form-item prop="outgoingAirline">
- <el-cascader
- v-model="formData.outgoingAirline"
- class="input-shadow"
- style="width: 164px"
- size="small"
- :options="carrierPropsop"
- :props="optionPropser"
- placeholder="离港承运航司"
- collapse-tags
- clearable
- filterable
- @change="getTableData"
- />
- </el-form-item>
- <el-form-item prop="startDate">
- <el-date-picker
- v-model="formData.startDate"
- class="input-shadow"
- style="width: 216px"
- size="small"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="开始时间"
- @change="setStartDate"
- />
- </el-form-item>
- <el-form-item prop="endDate">
- <el-date-picker
- v-model="formData.endDate"
- class="input-shadow"
- style="width: 216px"
- size="small"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="结束时间"
- @change="setEndDate"
- />
- </el-form-item>
- </div>
- <!-- <el-form-item>
- <div class="box-item">
- <p>预计装载总数:</p>
- <li
- :class="{ 'number-item': !isNaN(item), 'mark-item': isNaN(item) }"
- v-for="(item, index) in orderNum"
- :key="index"
- >
- <span v-if="!isNaN(item)">
- <i ref="numberItem">0123456789</i>
- </span>
- <span class="comma" v-else>{{ item }}</span>
- </li>
- </div>
- </el-form-item> -->
- <div
- class="form-right"
- @keyup.enter="onSubmit(1)"
- >
- <el-form-item prop="search">
- <el-popover
- :value="popoverVisible"
- placement="bottom"
- trigger="manual"
- >
- <span>请输入航班号(示例:CA1234)或行李牌号(示例:1234567890)</span>
- <el-input
- slot="reference"
- v-model="formData.search"
- class="input-shadow"
- style="width: 240px;"
- size="small"
- placeholder="请输入内容"
- prefix-icon="el-icon-search"
- clearable
- @clear="inputClear"
- @focus="popoverVisible = true"
- @blur="popoverVisible = false"
- />
- </el-popover>
- <!-- <el-input
- v-model="formData.search"
- style="width: 240px; margin-left: 105px"
- size="small"
- placeholder="请输入内容"
- prefix-icon="el-icon-search"
- clearable
- @clear="inputClear"
- /> -->
- </el-form-item>
- <el-form-item>
- <el-button
- class="btn-shadow"
- size="mini"
- type="primary"
- @click="onSubmit(1)"
- >搜索</el-button>
- </el-form-item>
- <el-form-item v-is="['ti_showTransit']">
- <el-button
- class="btn-shadow"
- size="mini"
- type="primary"
- @click="changeView"
- >切换视角</el-button>
- </el-form-item>
- <el-form-item v-is="['i_timeIcon']">
- <TimeZoneSelector />
- </el-form-item>
- <el-form-item>
- <img
- class="btn-img btn-shadow"
- src="../../../../assets/baggage/ic_setting.png"
- @click="show"
- >
- </el-form-item>
- </div>
- </el-form>
- </div>
- <!--表格-->
- <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)"
- >
- <el-table
- ref="table"
- class="table"
- :data="dealedTableData"
- :height="computedTableHeight"
- show-summary
- :summary-method="summaryMethod"
- :span-method="arraySpanMethod"
- :header-cell-class-name="headerCellClass"
- :cell-class-name="cellClass"
- border
- stripe
- fit
- @cell-click="cellClickHandler"
- >
- <el-table-column
- v-for="col in tableColsCopy"
- :key="col.prop"
- :prop="col.prop"
- :label="col.label"
- :width="col.width"
- :fixed="col.fixed"
- >
- <el-table-column
- v-for="childCol in col.children"
- :key="childCol.prop"
- :prop="childCol.prop"
- :label="childCol.label"
- :width="childCol.width"
- :formatter="tableFormat"
- >
- <template #header>
- <el-tooltip
- :content="childCol.label"
- placement="top"
- >
- <TableHeaderCell
- :label="childCol.label"
- :filter-options="tableDataFilters[childCol.prop]"
- :filter-values.sync="filterValues[childCol.prop]"
- :sortable="childCol.sortable"
- :sort-rule.sync="tableDataSortRules[childCol.prop]"
- />
- </el-tooltip>
- </template>
- </el-table-column>
- </el-table-column>
- </el-table>
- </div>
- <!--列设置-->
- <Dialog
- :flag="dialogFlag"
- class="dialog-check-cols"
- >
- <div class="col-dialog">
- <div class="title">列设置</div>
- <div class="content">
- <el-tree
- :data="tableCols"
- :class="colsCheckClass"
- show-checkbox
- node-key="index"
- :default-expand-all="true"
- :props="{
- label: 'label',
- children: 'children',
- }"
- :default-checked-keys="checkedKeysTemp"
- @check="handleCheck"
- />
- </div>
- <div class="foot right t30">
- <el-button
- size="medium"
- class="r24"
- type="primary"
- @click="onCheck"
- >确定</el-button>
- <el-button
- size="medium"
- @click="hide"
- >取消</el-button>
- </div>
- </div>
- </Dialog>
- </div>
- </template>
- <script>
- import Dialog from '@/layout/components/Dialog'
- import TimeZoneSelector from '@/components/TimeZoneSelector'
- import terminalMixin from '../../mixins/terminal'
- import formMixin from '../../mixins/form'
- import tableColsMixin from '../../mixins/tableCols'
- import timeZoneMixin from '../../mixins/timeZone'
- import { getQuery } from '@/api/flight'
- import TableHeaderCell from '@/components/TableHeaderCell'
- import { setTableFilters } from '@/utils/table'
- export default {
- name: 'DepartureTerminalView',
- components: { Dialog, TimeZoneSelector, TableHeaderCell },
- mixins: [terminalMixin, formMixin, tableColsMixin, timeZoneMixin],
- data() {
- return {
- optionProps: {
- value: 'inAicompanyCode2',
- label: 'inAicompanyCode2'
- },
- optionPropser: {
- value: 'outAicompanyCode2',
- label: 'outAicompanyCode2'
- },
- popoverVisible: false,
- orderNum: ['0', '0', '0', '0', '0', '0'], // 默认总数
- // 初始表头
- tableCols: [
- {
- prop: 'arrivalInfo',
- label: '进港航班',
- width: 180,
- fixed: 'left',
- children: [
- {
- prop: 'PreFlightNO',
- label: '航班号',
- width: 80,
- filterable: true,
- sortable: true
- },
- {
- prop: 'PreFlightDate',
- label: '航班日期',
- width: 100
- },
- {
- prop: 'PreAirport',
- label: '起飞航站',
- width: 100,
- filterable: true,
- sortable: true
- },
- {
- prop: 'ActualLandingTime',
- label: '降落时间',
- width: 100
- },
- {
- prop: 'LandingBuild',
- label: '降落航站楼',
- width: 98,
- filterable: true,
- sortable: true
- },
- {
- prop: 'Carousel',
- label: '行李转盘',
- width: 100,
- filterable: true,
- sortable: true
- },
- {
- prop: 'StandForLanding',
- label: '降落停机位',
- width: 98,
- filterable: true,
- sortable: true
- },
- {
- prop: 'inTransferBaggageCount',
- label: '中转行李数'
- },
- {
- prop: 'inTransferredBaggageCount',
- label: '已中转行李数',
- width: 100
- }
- ]
- },
- {
- prop: 'departureInfo',
- label: '离港航班',
- children: [
- {
- prop: 'FlightNO',
- label: '航班号',
- width: 80,
- filterable: true,
- sortable: true
- },
- {
- prop: 'FlightDate',
- label: '航班日期',
- width: 100
- },
- {
- prop: 'ActualDepartureTime',
- label: '起飞时间',
- width: 100
- },
- {
- prop: 'TargetAirport',
- label: '目的站',
- filterable: true,
- sortable: true
- },
- {
- prop: 'DepartureBuild',
- label: '起飞航站楼',
- width: 98,
- filterable: true,
- sortable: true
- },
- {
- prop: 'BordingGate',
- label: '起飞登机口',
- width: 98,
- filterable: true,
- sortable: true
- },
- {
- prop: 'StandForDepartrue',
- label: '起飞停机位',
- width: 98,
- filterable: true,
- sortable: true
- },
- {
- prop: 'outTransferBaggageCount',
- label: '中转进行李数',
- width: 100
- },
- {
- prop: 'outTransferredBaggageCount',
- label: '已中转进行李数',
- width: 120
- },
- {
- prop: 'timeDifference',
- label: '转运时间'
- }
- ]
- }
- ],
- AirportList: [],
- carrierProps: [],
- carrierPropsop: [],
- loopEvent: null,
- leaveCount: 0,
- baggageCount: 0,
- spanArr: [],
- contactDot: 0,
- flag: 0
- }
- },
- created() {
- this.getAirPortData()
- Object.entries(this.$route.query).forEach(([key, value]) => {
- if ((value ?? '') !== '' && JSON.stringify(value) !== '[]') {
- this.formData[key] = value
- }
- })
- },
- mounted() {
- const that = this
- this.loopEvent = setInterval(function () {
- that.getTableData()
- }, 3000)
- },
- beforeDestroy() {
- clearInterval(this.loopEvent)
- },
- methods: {
- headerCellClass({ row, column }) {
- const classes = []
- const rule = this.tableDataSortRules[column.property]
- if (rule) {
- classes.push(rule)
- }
- return classes.join(' ')
- },
- changeView() {
- this.$router.replace({
- path: '/transfer/departure',
- query: this.formData
- })
- },
- airPortChange() {
- this.getAviationData()
- this.upAviationData()
- // this.getTableData();
- },
- // 选择机场
- async getAirPortData() {
- try {
- const res = await getQuery({
- id: 72,
- dataContent: []
- })
- if (Number(res.code) === 0) {
- this.AirportList = res.returnData
- this.formData.currentAirport = 'PEK'
- this.getAviationData()
- this.upAviationData()
- this.getTableData()
- } else {
- this.$message.error(res.message)
- }
- } catch (error) {
- console.log('出错了', error)
- }
- },
- // 选择航司
- async getAviationData() {
- try {
- const res = await getQuery({
- id: 71,
- dataContent: [this.formData.currentAirport]
- })
- if (Number(res.code) === 0) {
- this.carrierProps = res.returnData
- // this.getTableData();
- } else {
- this.$message.error(res.message)
- }
- } catch (error) {
- console.log('出错了', error)
- }
- },
- // 选择航司
- async upAviationData() {
- try {
- const res = await getQuery({
- id: 74,
- dataContent: [this.formData.currentAirport]
- })
- if (Number(res.code) === 0) {
- this.carrierPropsop = res.returnData
- // this.getTableData();
- } else {
- this.$message.error(res.message)
- }
- } catch (error) {
- console.log('出错了', error)
- }
- },
- tableRowClassName({ row, rowIndex }) {
- if (row.hasTakenOff === 0) {
- if (rowIndex === this.leaveCount - 1) {
- return 'bgl-hui redBorder'
- } else {
- return 'bgl-hui'
- }
- }
- },
- tableCellClassName({ row, column }) {
- if (
- column.property === 'transfer_all' ||
- column.property === 'departureAnomaly' ||
- column.property === 'riskWarning'
- ) {
- return 'bgl-huang'
- }
- },
- // 获取表单下拉框数据
- // getFormData(params) {
- // this.relatedAirportQuery({
- // ...params,
- // type: 'OUT'
- // })
- // this.outgoingAirlineQuery(params)
- // this.craftTypeQuery(params)
- // this.flightAttrQuery(params)
- // },
- // 获取表格数据
- async getTableData() {
- const arrs1 = [this.formData.inboundCarrier.length === 0 ? '' : this.formData.inboundCarrier[0]]
- const arrs2 = [this.formData.outgoingAirline.length === 0 ? '' : this.formData.outgoingAirline[0]]
- const arr = [
- this.formData.currentAirport,
- this.formData.startDate,
- this.formData.endDate,
- ...arrs1,
- ...arrs1,
- ...arrs1,
- ...arrs2,
- ...arrs2,
- ...arrs2
- // this.formData.inboundCarrier,
- // this.formData.outgoingAirline,
- // JSON.stringify(this.formData.inboundCarrier),
- // JSON.stringify(this.formData.outgoingAirline),
- ]
- try {
- const res = await getQuery({
- id: 69,
- dataContent: [...arr]
- })
- if (Number(res.code) === 0) {
- // this.tableData = this._.sortBy(res.returnData, [
- // "FlightDate",
- // "PlanDepartureTime",
- // ]);
- this.initTableData(res.returnData)
- } else {
- console.log(res.message)
- }
- } catch (error) {
- clearInterval(this.loopEvent)
- console.log('出错了', error)
- }
- },
- initTableData(tableData) {
- // this.leaveCount = 0
- // this.baggageCount = 0
- // tableData.forEach(item => {
- // if (item.hasTakenOff === 0) {
- // this.leaveCount++
- // }
- // this.baggageCount = this.baggageCount + item.preLoad
- // })
- this.tableData = this._.sortBy(tableData, [
- 'PreFlightDate',
- 'ActualLandingTime',
- 'FlightDate',
- 'ActualDepartureTime'
- ])
- setTableFilters(this.tableData, this.tableDataFilters)
- // this.toOrderNum(this.baggageCount);
- // setInterval(() => {
- // this.baggageCount = this.baggageCount+1;
- // // 这里输入数字即可调用
- // }, 2000);
- },
- setNumberTransform() {
- const numberItems = this.$refs.numberItem // 拿到数字的ref,计算元素数量
- const numberArr = this.orderNum.filter(item => !isNaN(item))
- // 结合CSS 对数字字符进行滚动,显示订单数量
- for (let index = 0; index < numberItems.length; index++) {
- const elem = numberItems[index]
- elem.style.transform = `translate(-50%, -${numberArr[index] * 10}%)`
- }
- },
- toOrderNum(num) {
- num = num.toString()
- if (num.length < 6) {
- num = '0' + num // 如未满八位数,添加"0"补位
- this.toOrderNum(num) // 递归添加"0"补位
- } else if (num.length >= 6) {
- this.orderNum = num.split('') // 将其便变成数据,渲染至滚动数组
- } else {
- // 订单总量数字超过八位显示异常
- this.$message.warning('总量数字过大')
- }
- this.setNumberTransform()
- },
- tableSpanMethod({ row, column, rowIndex, columnIndex }) {
- if (
- [
- 'PreFlightNO',
- 'PreFlightDate',
- 'PreAirport',
- 'ActualLandingTime',
- 'LandingBuild',
- 'Carousel',
- 'StandForLanding'
- // 'inTransferBaggageCount',
- // 'inTransferredBaggageCount',
- // 'FlightNO',
- // 'FlightDate',
- // 'ActualDepartureTime',
- // 'TargetAirport',
- // 'DepartureBuild',
- // 'BordingGate',
- // 'StandForDepartrue',
- // 'outTransferBaggageCount',
- // 'outTransferredBaggageCount',
- // 'timeDifference'
- ].includes(column['property'])
- ) {
- const _row = this.spanArr[rowIndex]
- const _col = _row > 0 ? 1 : 0
- return {
- rowspan: _row,
- colspan: _col
- }
- }
- },
- arraySpanMethod({ row, column, rowIndex, columnIndex }) {
- for (let i = 0; i < 7; i++) {
- if (columnIndex === i) {
- const _row = this.spanArr[rowIndex]
- const _col = _row > 0 ? 1 : 0
- return {
- rowspan: _row,
- colspan: _col
- }
- }
- }
- // if (columnIndex === 0) {
- // if (rowIndex == 0) {
- // return [3, 1];
- // } else if (rowIndex >= 3) {
- // return [1, 2];
- // } else {
- // return [0, 0];
- // }
- // } else if (columnIndex == 1) {
- // // 第二列的大于3行的清除,避免影响样式
- // if (rowIndex >= 3) {
- // return [0, 0];
- // }
- // }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .terminal-form-wrap {
- padding-top: 11px;
- padding-left: 5px;
- ::v-deep .form {
- display: flex;
- justify-content: space-between;
- .form-left {
- flex: 1;
- }
- .form-right {
- flex: 0 1 490px;
- }
- .el-form-item {
- margin-bottom: 0px;
- margin-right: 8px;
- button,
- input,
- optgroup,
- select,
- textarea {
- font-family: Helvetica, 'Microsoft YaHei';
- font-size: 14px;
- }
- .el-switch__label {
- color: #303133;
- }
- .el-form-item__error {
- z-index: 10;
- }
- }
- .btn-img {
- position: relative;
- top: 6px;
- }
- }
- .box-item {
- position: relative;
- height: 32px;
- font-size: 18px;
- line-height: 32px;
- text-align: center;
- list-style: none;
- color: #2d7cff;
- writing-mode: vertical-lr;
- text-orientation: upright;
- /*文字禁止编辑*/
- -moz-user-select: none; /*火狐*/
- -webkit-user-select: none; /*webkit浏览器*/
- -ms-user-select: none; /*IE10*/
- -khtml-user-select: none; /*早期浏览器*/
- user-select: none;
- /* overflow: hidden; */
- p {
- line-height: 32px;
- writing-mode: horizontal-tb !important;
- text-orientation: none !important;
- /*文字禁止编辑*/
- -moz-user-select: none; /*火狐*/
- -webkit-user-select: none; /*webkit浏览器*/
- -ms-user-select: none; /*IE10*/
- -khtml-user-select: none; /*早期浏览器*/
- user-select: none;
- margin-top: 5px;
- }
- }
- /* 默认逗号设置 */
- .mark-item {
- width: 10px;
- height: 32px;
- margin-right: 5px;
- line-height: 10px;
- font-size: 18px;
- position: relative;
- & > span {
- position: absolute;
- width: 100%;
- bottom: 0;
- writing-mode: vertical-rl;
- text-orientation: upright;
- }
- }
- /*滚动数字设置*/
- .number-item {
- width: 41px;
- height: 42px;
- /* 背景图片 */
- background: url(/images/text-bg-blue.png) no-repeat center center;
- background-size: 100% 100%;
- // background: #ccc;
- list-style: none;
- margin-right: 5px;
- // background:rgba(250,250,250,1);
- border-radius: 4px;
- border: 3px solid rgb(221, 221, 221);
- & > span {
- position: relative;
- display: inline-block;
- margin-right: 10px;
- width: 100%;
- height: 100%;
- writing-mode: vertical-rl;
- text-orientation: upright;
- overflow: hidden;
- & > i {
- font-style: normal;
- position: absolute;
- top: 11px;
- left: 50%;
- transform: translate(-50%, -1%);
- transition: transform 1s ease-in-out;
- letter-spacing: 10px;
- }
- }
- }
- .number-item:last-child {
- margin-right: 0;
- }
- }
- .terminal-table {
- width: 100%;
- ::v-deep .table {
- width: 100%;
- .cell {
- padding: 0;
- text-align: center;
- font-size: 14px;
- font-family: Helvetica, 'Microsoft YaHei';
- letter-spacing: 0;
- }
- .cell-click {
- cursor: pointer;
- color: #2d7cff;
- &.cell-clicked {
- color: purple;
- }
- }
- .el-table__header-wrapper,
- .el-table__fixed-header-wrapper {
- .cell {
- font-weight: bold;
- color: #101116;
- }
- .has-gutter {
- tr {
- .bgl-huang {
- background: #fcf0b1;
- }
- }
- }
- }
- .el-table__body-wrapper {
- tr.bgl-hui {
- background: #d2d6df;
- td {
- background: #d2d6df;
- }
- &.redBorder {
- position: relative;
- &::after {
- content: '';
- position: absolute;
- left: 0;
- bottom: 0;
- width: 100%;
- height: 2px;
- background: #e83f82;
- }
- }
- }
- }
- .el-table__cell.is-hidden > * {
- visibility: visible;
- }
- }
- }
- </style>
|