123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305 |
- <template>
- <div class="advance">
- <div class="advance__head flex">
- <div class="flex-wrap interfaceLog_head_time">
- <div class="manageTitle">高级查询</div>
-
- <el-date-picker
- v-model="flightDate"
- size="small"
- type="daterange"
- value-format="yyyy-MM-dd"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :picker-options="dateRangePickerOptions"
- />
- </div>
- <Search
- ref="search"
- class="advanced-search"
- :is-title="false"
- :is-slot="true"
- :search-tooltip="'请输入航班号(示例:CA1234)或行李牌号(示例:1234567890)'"
- @getSearchData="getSearchData"
- @clearSearchData="clearSearchData"
- >
- <div class="flex-wrap">
- <button
- class="btnAn"
- @click="dialogShow"
- >高级查询</button>
-
- </div>
- </Search>
- </div>
-
- <div
- v-loading="loading"
- element-loading-text="拼命加载中"
- element-loading-spinner="el-icon-loading"
- element-loading-background="rgba(0, 0, 0, 0.8)"
- class="advance__table"
- >
- <el-table
- ref="table"
- v-el-table-infinite-scroll="load"
- max-height="100%"
- class="table"
- :data="dealedTableData"
- border
- stripe
- fit
- height="calc(100vh - 158px)"
- style="width: 100%"
- show-summary
- :summary-method="summaryRow(tableData.length)"
- :header-cell-class-name="headerCellClass"
- :row-class-name="tableRowClassName"
- :cell-class-name="cellClass"
- :span-method="objectSpanMethod"
- @cell-click="cellClickHandler"
- >
- <el-table-column
- v-for="col in tableCols"
- :key="col.prop"
- :prop="col.prop"
- :label="col.label"
- :width="col.width"
- :fixed="col.fixed"
- :formatter="tableFormat"
- >
- <template #header>
- <el-tooltip
- :content="col.desc || col.label"
- placement="top"
- >
- <TableHeaderCell
- :label="col.label"
- :filter-options="tableDataFilters[col.prop]"
- :filter-values.sync="filterValues[col.prop]"
- :sortable="col.sortable"
- :sort-rule.sync="tableDataSortRules[col.prop]"
- />
- </el-tooltip>
- </template>
- </el-table-column>
- </el-table>
- </div>
-
-
-
- <Dialog
- width="852px"
- :flag="gjFlag"
- >
- <div
- ref="dialog"
- class="rowDialog"
- :tabindex="0"
- @keyup.enter="onCheckGj(true)"
- @keyup.self.esc="gjFlag=false"
- >
- <div class="title">高级查询</div>
- <div class="content">
- <el-form
- ref="form"
- :model="form"
- :rules="rules"
- label-width="100px"
- >
- <el-row :gutter="20">
- <el-col
- v-for="item in formItems"
- :key="item.prop"
- :span="item.span || 8"
- >
- <el-form-item
- :label="item.label"
- :prop="item.prop"
- >
- <template v-if="item.prop === 'flightDate'">
- <el-date-picker
- v-model="flightDate"
- size="small"
- type="daterange"
- value-format="yyyy-MM-dd"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :picker-options="dateRangePickerOptions"
- @keyup.esc.native="dialogFocus"
- />
- </template>
- <template v-else-if="item.prop === 'status'">
- <el-select
- v-model="form.status"
- size="small"
- filterable
- default-first-option
- clearable
- @keyup.esc.native="dialogFocus"
- >
- <el-option
- v-for="option in statusList"
- :key="option.ID"
- :label="option.StatusName"
- :value="option.StatusCode"
- />
- </el-select>
- </template>
- <template v-else-if="item.prop === 'specialType'">
- <el-select
- v-model="form.specialType"
- size="small"
- filterable
- allow-create
- default-first-option
- clearable
- @keyup.esc.native="dialogFocus"
- >
- <el-option
- v-for="option in baggageTypeList"
- :key="option.specialType"
- :label="option.specialType"
- :value="option.specialType"
- />
- </el-select>
- </template>
- <template v-else-if="item.prop === 'unLoad'">
- <el-select
- v-model="form.unLoad"
- size="small"
- clearable
- @keyup.esc.native="dialogFocus"
- >
- <el-option
- label="已翻减"
- :value="1"
- />
- <el-option
- label="待翻减"
- :value="0"
- />
- </el-select>
- </template>
- <template v-else-if="item.prop === 'checkIn'">
- <el-select
- v-model="form.checkIn"
- size="small"
- clearable
- @keyup.esc.native="dialogFocus"
- >
- <el-option
- label="是"
- :value="1"
- />
- <el-option
- label="否"
- :value="0"
- />
- </el-select>
- </template>
- <template v-else-if="item.prop === 'active'">
- <el-select
- v-model="form.active"
- size="small"
- clearable
- @keyup.esc.native="dialogFocus"
- >
- <el-option
- label="是"
- :value="1"
- />
- <el-option
- label="否"
- :value="0"
- />
- </el-select>
- </template>
- <template v-else-if="item.prop === 'transferIn'">
- <el-select
- v-model="form.transferIn"
- size="small"
- clearable
- @keyup.esc.native="dialogFocus"
- >
- <el-option
- label="是"
- :value="1"
- />
- <el-option
- label="否"
- :value="0"
- />
- </el-select>
- </template>
- <template v-else-if="item.prop === 'canceled'">
- <el-select
- v-model="form.canceled"
- size="small"
- clearable
- @keyup.esc.native="dialogFocus"
- >
- <el-option
- label="是"
- :value="1"
- />
- <el-option
- label="否"
- :value="0"
- />
- </el-select>
- </template>
- <template v-else-if="item.prop === 'noBSM'">
- <el-select
- v-model="form.noBSM"
- size="small"
- clearable
- @keyup.esc.native="dialogFocus"
- >
- <el-option
- label="是"
- :value="0"
- />
- <el-option
- label="否"
- :value="1"
- />
- </el-select>
- </template>
- <template v-else>
- <el-popover
- v-model="item.hintVisible"
- placement="right"
- trigger="manual"
- >
- <span>{{ item.hintText }}</span>
- <el-input
- :ref="'input-' + item.prop"
- slot="reference"
- v-model="form[item.prop]"
- size="small"
- @focus="item.hintVisible = true"
- @blur="item.hintVisible = false"
- @keyup.esc.native="dialogFocus"
- />
- </el-popover>
- </template>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <div class="foot right t30">
- <el-button
- size="medium"
- class="r24"
- type="primary"
- @click="onCheckGj(true)"
- >确定</el-button>
- <el-button
- size="medium"
- @click="closeCheckGj"
- >取消</el-button>
- </div>
- </div>
- </Dialog>
- </div>
- </template>
- <script>
- import Search from '@/components/SearchWithTooltip'
- import Dialog from '@/layout/components/Dialog'
- import { parseTime } from '@/utils/index'
- import { Query, myQuery } from '@/api/dataIntegration'
- import { mapGetters } from 'vuex'
- import TableHeaderCell from '@/components/TableHeaderCell'
- import { setTableFilters } from '@/utils/table'
- export default {
- name: 'AdvancedHome',
- components: { Search, Dialog, TableHeaderCell },
- data() {
- return {
- loading: false,
- colDialogFlag: false,
- gjFlag: false,
- tableData: [
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ],
- page: -1,
- noMore: false,
- checkList: [],
- tableCols: [
- {
- prop: 'flightNO',
- label: '航班号',
- desc: '指航班编号',
- fixed: 'left',
- filterable: true,
- sortable: true
- },
- {
- prop: 'flightDate',
- label: '航班日期',
- desc: '指航班计划起飞日期(机票上的静态数据)',
- fixed: 'left',
- width: 110,
- filterable: true,
- sortable: true
- },
- {
- prop: 'departureTime',
- label: '起飞时间',
- desc: '指航班预计起飞时间,动态数据,仅显示最新结果',
- width: 150
- },
- {
- prop: 'sourceAirport',
- label: '起飞站',
- desc: '指航班执飞航段的起飞航站,以航站英文三字码显示',
- filterable: true,
- sortable: true
- },
- {
- prop: 'targetAirport',
- label: '目的地',
- desc: '指航班执飞航段的目的航站,以航站英文三字码显示',
- filterable: true,
- sortable: true
- },
- {
- prop: 'passengerNameUpcase',
- label: '旅客姓名',
- desc: '指旅客姓名的拼音大写',
- width: 150,
- filterable: true,
- sortable: true
- },
- {
- prop: 'bagSN',
- label: '行李牌号',
- desc: '指行李的10位数字行李牌号码',
- width: 110,
- filterable: true,
- sortable: true
- },
- {
- prop: 'specialType',
- label: '特殊行李类型',
- desc: '指有别于普通托运行李的特殊行李分类,包括(装笼动物、机组行李、易碎行李、VIP行李等),参考BSM报文.E项说明',
- width: 115,
- filterable: true,
- sortable: true
- },
- {
- prop: 'deleted',
- label: '删除',
- desc: '指旅客是否取消值机托运,根据BSM报文状态是否有DEL判断,已删除的行李记录为斜体灰色字体',
- filterable: true,
- sortable: true
- },
- {
- prop: 'activated',
- label: '激活',
- desc: '指托运行李是否被激活,参照BSM报文.S项说明',
- filterable: true,
- sortable: true
- },
- {
- prop: 'bagWeight',
- label: '重量',
- desc: '指托运行李的重量,参照BSM报文.W项说明'
- },
- {
- prop: 'latestStatus',
- label: '最新状态',
- desc: '指托运行李的当前查询时间所在的节点状态',
- width: 110,
- filterable: true,
- sortable: true
- },
- {
- prop: 'bagLocation',
- label: '最新位置',
- desc: '指托运行李的当前查询时间所在的节点状态的识读位置代号',
- width: 110,
- filterable: true,
- sortable: true
- },
- {
- prop: 'U_Device_ID',
- label: '容器编号',
- desc: '指集装器ID信息',
- width: 110,
- filterable: true,
- sortable: true
- },
- {
- prop: 'preFlightNO',
- label: '中转进航班',
- desc: '指有中转行李转出的进港航班号',
- width: 110,
- filterable: true,
- sortable: true
- },
- {
- prop: 'transferFlightNO',
- label: '中转出航班',
- desc: '指有中转行李转入的离港航班号',
- width: 110,
- filterable: true,
- sortable: true
- }
- ],
- flightDate: [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')],
- dateRangePickerOptions: {
- onPick: this.dateRangePickHandler,
- disabledDate: this.dateRangeDisabled
- },
- form: {
- flightNO: '',
- destination: '',
- departureStation: '',
- baggageNO: '',
- specialType: '',
- U_Device_ID: '',
- passengerName: '',
- PNR: '',
- checkInSequence: '',
- transferArrival: '',
- transferDeparture: '',
- unLoad: '',
- checkIn: '',
- active: '',
- transferIn: '',
- canceled: '',
- status: '',
- noBSM: ''
- },
- formItems: [
- {
- prop: 'flightDate',
- label: '航班日期',
- span: 16
- },
- {
- prop: 'status',
- label: '当前状态'
- },
- {
- prop: 'flightNO',
- label: '航班号',
- hintText: '示例:CA1111',
- hintVisible: false
- },
- {
- prop: 'departureStation',
- label: '起飞站',
- hintText: '示例:PEK',
- hintVisible: false
- },
- {
- prop: 'destination',
- label: '目的地',
- hintText: '示例:CTU',
- hintVisible: false
- },
- {
- prop: 'baggageNO',
- label: '行李牌号',
- hintText: '示例:1234567890',
- hintVisible: false
- },
- {
- prop: 'specialType',
- label: '特殊行李类型'
- },
- {
- prop: 'U_Device_ID',
- label: '容器编号',
- hintText: '示例:AKE25810CA',
- hintVisible: false
- },
- {
- prop: 'passengerName',
- label: '旅客姓名',
- hintText: '示例:ZHAOWEI',
- hintVisible: false
- },
- {
- prop: 'PNR',
- label: 'PNR',
- hintText: '示例:PZR25X',
- hintVisible: false
- },
- {
- prop: 'checkInSequence',
- label: '值机序号',
- hintText: '示例:1',
- hintVisible: false
- },
- {
- prop: 'transferArrival',
- label: '中转进航班',
- hintText: '示例:CA1111',
- hintVisible: false
- },
- {
- prop: 'transferDeparture',
- label: '中转出航班',
- hintText: '示例:CA1111',
- hintVisible: false
- },
- {
- prop: 'unLoad',
- label: '翻减状态'
- },
- {
- prop: 'checkIn',
- label: '已值机'
- },
- {
- prop: 'active',
- label: '已激活'
- },
- {
- prop: 'transferIn',
- label: '中转行李'
- },
- {
- prop: 'canceled',
- label: '已取消'
- },
- {
- prop: 'noBSM',
- label: '无BSM'
- }
- ],
- statusList: [
- {
- ID: 0,
- StatusName: '安检',
- StatusCode: '安检'
- },
- {
- ID: 1,
- StatusName: '分拣',
- StatusCode: '分拣'
- },
- {
- ID: 2,
- StatusName: '装车',
- StatusCode: '装车'
- },
- {
- ID: 3,
- StatusName: '装机',
- StatusCode: '装机'
- },
- {
- ID: 4,
- StatusName: '到达',
- StatusCode: '到达'
- }
- ],
- baggageTypeList: [],
- dataContent: [],
- rules: {
-
-
-
-
- },
- tableDataFilters: {},
- filterValues: {},
- tableDataSortRules: {},
- spanArr: [],
- contactDot: 0,
- scrollTop: 0,
- dom: null
- }
- },
- computed: {
- ...mapGetters(['clickedCells', 'queryForm']),
- dealedTableData() {
- const filtered = this.tableData.filter(item => {
- let flag = true
- Object.entries(this.filterValues).forEach(([key, arr]) => {
- if (arr.length && !arr.includes(item[key])) {
- flag = false
- }
- })
- return flag
- })
- const sortRules = Object.entries(this.tableDataSortRules).reduce(
- (pre, [key, value]) => {
- if (value) {
- pre[0].push(key)
- value = value === 'ascending' ? 'asc' : 'desc'
- pre[1].push(value)
- }
- return pre
- },
- [[], []]
- )
- return this._.orderBy(filtered, sortRules[0], sortRules[1])
- }
- },
- watch: {
- '$route.query': {
- handler(query) {
- let queryFlag = false
- const { startDate, endDate, singleJump } = query
- const queryEntries = Object.entries(query)
- if (queryEntries.length) {
- this.clearForm()
- }
- queryEntries.forEach(([key, value]) => {
- if (!['startDate', 'endDate', 'singleJump'].includes(key) && (value ?? '') !== '') {
- queryFlag = true
- this.form[key] = ['unLoad', 'checkIn', 'active', 'transferIn', 'canceled', 'noBSM'].includes(key)
- ? Number(value)
- : value
- }
- })
- if (startDate) {
- this.$set(this.flightDate, 0, startDate)
- }
- if (endDate) {
- this.$set(this.flightDate, 1, endDate)
- }
- if (queryFlag) {
- this.onCheckGj(singleJump)
- }
- },
- deep: true
- },
- flightDate: {
- handler(val) {
- if (val === null) {
- this.flightDate = ['', '']
- }
- },
- deep: true
- },
- dealedTableData: {
- handler(val) {
- this.spanArr = []
- let contactDot = this.contactDot
- val.forEach((item, index, arr) => {
- if (index === 0) {
- this.spanArr.push(1)
- } else {
- if (
- item['flightNO'] === arr[index - 1]['flightNO'] &&
- item['flightDate'] === arr[index - 1]['flightDate'] &&
- item['passengerNameUpcase'] === arr[index - 1]['passengerNameUpcase'] &&
- item['checkInNO'] === arr[index - 1]['checkInNO'] &&
- item['bagWeight'] === arr[index - 1]['bagWeight']
- ) {
- this.spanArr[contactDot] += 1
- this.spanArr.push(0)
- } else {
- this.spanArr.push(1)
- contactDot = index
- }
- }
- })
- },
- deep: true
- }
- },
- created() {
- Object.values(this.tableCols).forEach(({ prop, filterable, sortable }) => {
- if (filterable) {
- this.$set(this.tableDataFilters, prop, [])
- this.$set(this.filterValues, prop, [])
- }
- if (sortable) {
- this.$set(this.tableDataSortRules, prop, '')
- }
- })
- // console.log(this.$store.state.app.queryForm)
- // 参数顺序 【航班开始日期,航班结束日期,航班号,航班号,行李牌号,行李牌号,起飞站,起飞站,目的站,目的站,特殊行李类型,特殊 行李类型,旅客姓名大写拼音,旅客姓名大写拼音,PNR,PNR,值机号,值机号】
- // const dataContent = [this.time[0], this.time[1]]
- // for (let i = 0; i < 18; i++) {
-
-
-
- },
- mounted() {
- this.baggageTypeQuery()
- const that = this
- this.dom = this.$refs.table.bodyWrapper
- this.dom.addEventListener('scroll', () => {
- that.scrollTop = this.dom.scrollTop
- })
- },
- activated() {
- this.dom.scrollTop = this.scrollTop
-
-
-
-
-
-
-
- },
- updated() {
-
- this.$nextTick(() => {
- this.$refs.table.doLayout()
- })
- },
- beforeDestroy() {
-
- if (this.$route.matched.filter(item => item.name && item.meta.title).length > 1) {
- this.$store.dispatch('app/setQueryForm', {
- ...this.form,
- flightDate: this.flightDate
- })
- } else {
- this.$store.dispatch('app/setQueryForm', null)
- }
- },
- methods: {
- load() {
- if (this.noMore || this.loading || this.page < 0) {
- return
- }
- this.statItemsQueryByStatMain(this.dataContent)
- },
- resetTable() {
- this.page = 0
- this.noMore = false
- this.tableData = []
- },
- dialogShow() {
- this.gjFlag = true
- this.$nextTick(() => {
- this.dialogFocus()
- })
- },
- dialogFocus() {
- this.$refs['dialog'].focus()
- },
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- dateRangePickHandler({ maxDate, minDate }) {
- if (!maxDate) {
- this.pickedDate = minDate
- } else {
- this.pickedDate = null
- }
- },
- dateRangeDisabled(date) {
- return this.pickedDate ? Math.abs(date - this.pickedDate) > 2 * 24 * 60 * 60 * 1000 : false
- },
- objectSpanMethod({ row, column, rowIndex, columnIndex }) {
- if (['passengerNameUpcase', 'bagWeight'].includes(column.property)) {
- const _row = this.spanArr[rowIndex]
- const _col = _row > 0 ? 1 : 0
- return {
- rowspan: _row,
- colspan: _col
- }
- }
- },
-
- headerCellClass({ row, column, rowIndex, columnIndex }) {
- const classes = []
- const rule = this.tableDataSortRules[column.property]
- if (rule) {
- classes.push(rule)
- }
- return classes.join(' ')
- },
- tableRowClassName({ row, rowIndex }) {
- const classes = []
- if (row.deleted === 'DEL') {
- classes.push('bgl-deleted')
- }
- return classes.join(' ')
- },
- cellClass({ row, column, rowIndex, columnIndex }) {
- const classes = []
- if (['flightNO', 'bagSN', 'preFlightNO', 'transferFlightNO'].includes(column.property) && row[column.property]) {
- classes.push('cell-click')
- if (
- this.clickedCells.some(
- cell =>
- cell.pageName === 'advance' &&
- Object.entries(cell.row).every(([key, value]) => row[key] === value) &&
- cell.columnProp === column.property
- )
- ) {
- classes.push('cell-clicked')
- }
- }
- return classes.join(' ')
- },
- cellClickHandler(row, column, cell, event) {
- if (['flightNO', 'bagSN', 'preFlightNO', 'transferFlightNO'].includes(column.property)) {
- this.$store.dispatch('keepAlive/addClickedCell', {
- row,
- columnProp: column.property,
- pageName: 'advance'
- })
- }
- switch (column.property) {
- case 'flightNO':
- this.$router.push({
- path: '/advance/flightView',
- query: {
- flightNO: row.flightNO,
- flightDate: row.flightDate
- }
- })
- break
- case 'bagSN':
- this.$router.push({
- path: '/advance/baggageView',
- query: {
- flightNO: row.flightNO,
- flightDate: row.flightDate,
- bagSN: row.bagSN
- }
- })
- break
- case 'transferFlightNO':
- this.$router.push({
- path: '/advance/flightView',
- query: {
- flightNO: row.transferFlightNO,
- flightDate: row.transferFlightDate
- }
- })
- break
- case 'preFlightNO':
- this.$router.push({
- path: '/advance/flightView',
- query: {
- flightNO: row.preFlightNO,
- flightDate: row.preFlightDate
- }
- })
- break
- default:
- break
- }
- },
- tableFormat(row, column, cellValue) {
- switch (column.property) {
- case 'departureTime':
- return (cellValue ?? '').replace('T', ' ')
- case 'deleted':
- return cellValue === 'DEL' ? cellValue : ''
- case 'activated':
- return cellValue === 1 ? '激活' : '未激活'
- default:
- return cellValue ?? ''
- }
- },
-
- getSearchData(val) {
- this.clearForm()
- if (this.flightDate[0] === '' || this.flightDate[1] === '' || val === '') {
- this.$message.error('请先输入完整查询信息')
- } else {
-
- this.$route.query && this.$router.replace(this.$route.path)
-
- const az = /^[a-zA-Z]+$/
- const azNum = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]*$/
-
- const top2 = /^([a-zA-Z][0-9])|([0-9][a-zA-Z])|([a-zA-Z]{2})/
- const num = /^[0-9]+$/
- const bagNo = /^[a-zA-Z]{2}[0-9]{6}$/
-
- if (az.test(val)) {
- this.form['passengerName'] = val
- this.onCheckGj(true)
- } else if (azNum.test(val) && top2.test(val)) {
-
- this.form['flightNO'] = val
- this.onCheckGj(true)
- } else if ((num.test(val) && val.length === 10) || bagNo.test(val)) {
-
- this.form['baggageNO'] = val
- this.onCheckGj(true)
- } else {
- this.$message.error('请先输入有效查询信息如航班号、旅客姓名首字母、行李牌号')
- }
-
- }
- },
-
- clearSearchData() {
- this.clearForm()
- this.resetTable()
- },
-
- clearForm() {
- Object.keys(this.form).forEach(key => {
- this.form[key] = ''
- })
- },
-
- onCheckGj(singleJump) {
- this.resetTable()
-
- this.dataContent = []
- const flightDate = this.flightDate
- if (flightDate && flightDate.length) {
- this.dataContent.push(flightDate[0])
- this.dataContent.push(flightDate[1])
- if (Object.values(this.form).every(value => value === '')) {
- this.$message.error('请先输入查询信息')
- } else {
- const {
- flightNO,
- baggageNO,
- departureStation,
- destination,
- specialType,
- passengerName,
- PNR,
- checkInSequence,
- transferArrival,
- transferDeparture,
- U_Device_ID,
- unLoad,
- checkIn,
- active,
- transferIn,
- canceled,
- status,
- noBSM
- } = this.form
- this.setDataContent(
- flightNO,
- baggageNO,
- departureStation,
- destination,
- specialType,
- passengerName,
- PNR,
- checkInSequence,
- transferArrival,
- transferDeparture,
- U_Device_ID,
- unLoad,
- checkIn,
- active,
- transferIn,
- canceled,
- status,
- noBSM
- )
- this.statItemsQueryByStatMain(this.dataContent, singleJump)
- this.gjFlag = false
- }
- } else {
- this.$message.error('请先选择要查询的时间')
- }
- },
- closeCheckGj() {
- this.gjFlag = false
- },
- setDataContent(...dataContent) {
- dataContent.forEach(target => {
- target = typeof target === 'string' ? target.trim() : target
- if ((target ?? '') !== '') {
- this.dataContent.push(target, target)
- } else {
- this.dataContent.push(null, null)
- }
- })
- },
-
- async statItemsQueryByStatMain(dataContent, singleJump) {
- this.loading = true
- try {
- const {
- code,
- returnData: { listValues: result, needPage }
- } = await Query({
- id: DATACONTENT_ID.advacedQueryId,
- needPage: ++this.page,
- dataContent
- })
- if (Number(code) !== 0) {
- this.page--
- this.loading = false
- this.$message.error('获取数据失败')
- return
- }
- if (needPage === this.page && result.length) {
- if (singleJump) {
- if (result.length === 1) {
- this.$router.push({
- path: '/advance/baggageView',
- query: {
- bagSN: result[0].bagSN,
- flightNO: result[0].flightNO,
- flightDate: result[0].flightDate
- }
- })
- } else {
- const onlyFlight = result.reduce((pre, curr) => {
- if (
- pre === null ||
- (curr.flightNO &&
- curr.flightDate &&
- curr.flightNO === pre.flightNO &&
- curr.flightDate === pre.flightDate)
- ) {
- return {
- flightNO: curr.flightNO,
- flightDate: curr.flightDate
- }
- } else {
- return {}
- }
- }, null)
- if (onlyFlight.flightNO) {
- this.$router.push({
- path: '/advance/flightView',
- query: onlyFlight
- })
- }
- }
- }
-
- this.tableData = [...this.tableData, ...result]
- setTableFilters(this.tableData, this.tableDataFilters)
- } else {
- if (this.page === 1) {
- this.$message.info('未查询到匹配结果')
- }
- this.page--
- this.noMore = true
- }
- } catch (error) {
- this.page--
- console.log('出错了', error.message || error)
- }
- this.loading = false
- },
-
- async baggageTypeQuery() {
- try {
- const result = await myQuery(DATACONTENT_ID.baggageTypeId)
- this.baggageTypeList = result
- } catch (error) {
- console.log('出错了', error.message || error)
- }
- },
-
- summaryRow(num) {
- return function () {
- return ['合计', `共${num}件`]
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .advance {
- padding: 8px;
- &__head {
- line-height: 32px;
- margin-top: 8px;
- margin-bottom: 16px;
- .setting {
- height: 32px;
- width: 32px;
- cursor: pointer;
- background-size: 100% 100%;
- background: url('../../../assets/baggage/ic_setting.png') no-repeat;
- margin-left: 12px;
- position: relative;
- top: 2px;
- }
- .mr10 {
- margin-right: 10px;
- }
- ::v-deep .interfaceLog_head_time {
- .el-input__prefix {
- left: 10px;
- color: #101116;
- }
- .el-input--prefix .el-input__inner {
- padding-left: 50px;
- }
- }
- }
- }
- .advance__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,
- .el-table__fixed-body-wrapper {
- tr.bgl-deleted {
- background: #d2d6df;
- td {
- background: #d2d6df;
- font-style: italic;
- }
- }
- }
- }
- }
- .el-table tbody tr:hover > td {
- background-color: red !important;
- }
- .el-table__body tr.hover-row.current-row > td,
- .el-table__body tr.hover-row.el-table__row--striped.current-row > td,
- .el-table__body tr.hover-row.el-table__row--striped > td,
- .el-table__body tr.hover-row > td {
- background-color: red;
- }
- .rowDialog::v-deep .el-form > .el-row > .el-col:nth-child(1) .el-date-editor {
- width: 100%;
- }
- </style>
|