advancedHome.vue 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305
  1. <template>
  2. <div class="advance">
  3. <div class="advance__head flex">
  4. <div class="flex-wrap interfaceLog_head_time">
  5. <div class="manageTitle">高级查询</div>
  6. <!-- <div class="interfaceLog_head_time_start mr10">
  7. <el-date-picker
  8. v-model="flightDate[0]"
  9. class="input-shadow"
  10. size="small"
  11. type="date"
  12. value-format="yyyy-MM-dd"
  13. placeholder="选择开始日期时间"
  14. @change="startDateChangeHandler"
  15. />
  16. </div>
  17. <div class="interfaceLog_head_time_end">
  18. <el-date-picker
  19. v-model="flightDate[1]"
  20. class="input-shadow"
  21. size="small"
  22. type="date"
  23. value-format="yyyy-MM-dd"
  24. placeholder="选择结束日期时间"
  25. @change="endDateChangeHandler"
  26. />
  27. </div> -->
  28. <el-date-picker
  29. v-model="flightDate"
  30. size="small"
  31. type="daterange"
  32. value-format="yyyy-MM-dd"
  33. start-placeholder="开始日期"
  34. end-placeholder="结束日期"
  35. :picker-options="dateRangePickerOptions"
  36. />
  37. </div>
  38. <Search
  39. ref="search"
  40. class="advanced-search"
  41. :is-title="false"
  42. :is-slot="true"
  43. :search-tooltip="'请输入航班号(示例:CA1234)或行李牌号(示例:1234567890)'"
  44. @getSearchData="getSearchData"
  45. @clearSearchData="clearSearchData"
  46. >
  47. <div class="flex-wrap">
  48. <button
  49. class="btnAn"
  50. @click="dialogShow"
  51. >高级查询</button>
  52. <!-- <div
  53. class="setting"
  54. @click="show"
  55. /> -->
  56. </div>
  57. </Search>
  58. </div>
  59. <!--表格-->
  60. <div
  61. v-loading="loading"
  62. element-loading-text="拼命加载中"
  63. element-loading-spinner="el-icon-loading"
  64. element-loading-background="rgba(0, 0, 0, 0.8)"
  65. class="advance__table"
  66. >
  67. <el-table
  68. ref="table"
  69. v-el-table-infinite-scroll="load"
  70. max-height="100%"
  71. class="table"
  72. :data="dealedTableData"
  73. border
  74. stripe
  75. fit
  76. height="calc(100vh - 158px)"
  77. style="width: 100%"
  78. show-summary
  79. :summary-method="summaryRow(tableData.length)"
  80. :header-cell-class-name="headerCellClass"
  81. :row-class-name="tableRowClassName"
  82. :cell-class-name="cellClass"
  83. :span-method="objectSpanMethod"
  84. @cell-click="cellClickHandler"
  85. >
  86. <el-table-column
  87. v-for="col in tableCols"
  88. :key="col.prop"
  89. :prop="col.prop"
  90. :label="col.label"
  91. :width="col.width"
  92. :fixed="col.fixed"
  93. :formatter="tableFormat"
  94. >
  95. <template #header>
  96. <el-tooltip
  97. :content="col.desc || col.label"
  98. placement="top"
  99. >
  100. <TableHeaderCell
  101. :label="col.label"
  102. :filter-options="tableDataFilters[col.prop]"
  103. :filter-values.sync="filterValues[col.prop]"
  104. :sortable="col.sortable"
  105. :sort-rule.sync="tableDataSortRules[col.prop]"
  106. />
  107. </el-tooltip>
  108. </template>
  109. </el-table-column>
  110. </el-table>
  111. </div>
  112. <!--列设置-->
  113. <!-- <Dialog
  114. :flag="dialogFlag"
  115. class="dialog-check-cols"
  116. >
  117. <div class="col-dialog">
  118. <div class="title">列设置</div>
  119. <div class="content">
  120. <el-tree
  121. :data="tableCols"
  122. :class="colsCheckClass"
  123. show-checkbox
  124. node-key="index"
  125. :default-expand-all="true"
  126. :props="{
  127. label: 'label',
  128. children: 'children'
  129. }"
  130. :default-checked-keys="checkedKeysTemp"
  131. @check="handleCheck"
  132. />
  133. </div>
  134. <div class="foot right t30">
  135. <el-button
  136. size="medium"
  137. class="r24"
  138. type="primary"
  139. @click="onCheck"
  140. >确定</el-button>
  141. <el-button
  142. size="medium"
  143. @click="hide"
  144. >取消</el-button>
  145. </div>
  146. </div>
  147. </Dialog> -->
  148. <!--高级查询-->
  149. <Dialog
  150. width="852px"
  151. :flag="gjFlag"
  152. >
  153. <div
  154. ref="dialog"
  155. class="rowDialog"
  156. :tabindex="0"
  157. @keyup.enter="onCheckGj(true)"
  158. @keyup.self.esc="gjFlag=false"
  159. >
  160. <div class="title">高级查询</div>
  161. <div class="content">
  162. <el-form
  163. ref="form"
  164. :model="form"
  165. :rules="rules"
  166. label-width="100px"
  167. >
  168. <el-row :gutter="20">
  169. <el-col
  170. v-for="item in formItems"
  171. :key="item.prop"
  172. :span="item.span || 8"
  173. >
  174. <el-form-item
  175. :label="item.label"
  176. :prop="item.prop"
  177. >
  178. <template v-if="item.prop === 'flightDate'">
  179. <el-date-picker
  180. v-model="flightDate"
  181. size="small"
  182. type="daterange"
  183. value-format="yyyy-MM-dd"
  184. start-placeholder="开始日期"
  185. end-placeholder="结束日期"
  186. :picker-options="dateRangePickerOptions"
  187. @keyup.esc.native="dialogFocus"
  188. />
  189. </template>
  190. <template v-else-if="item.prop === 'status'">
  191. <el-select
  192. v-model="form.status"
  193. size="small"
  194. filterable
  195. default-first-option
  196. clearable
  197. @keyup.esc.native="dialogFocus"
  198. >
  199. <el-option
  200. v-for="option in statusList"
  201. :key="option.ID"
  202. :label="option.StatusName"
  203. :value="option.StatusCode"
  204. />
  205. </el-select>
  206. </template>
  207. <template v-else-if="item.prop === 'specialType'">
  208. <el-select
  209. v-model="form.specialType"
  210. size="small"
  211. filterable
  212. allow-create
  213. default-first-option
  214. clearable
  215. @keyup.esc.native="dialogFocus"
  216. >
  217. <el-option
  218. v-for="option in baggageTypeList"
  219. :key="option.specialType"
  220. :label="option.specialType"
  221. :value="option.specialType"
  222. />
  223. </el-select>
  224. </template>
  225. <template v-else-if="item.prop === 'unLoad'">
  226. <el-select
  227. v-model="form.unLoad"
  228. size="small"
  229. clearable
  230. @keyup.esc.native="dialogFocus"
  231. >
  232. <el-option
  233. label="已翻减"
  234. :value="1"
  235. />
  236. <el-option
  237. label="待翻减"
  238. :value="0"
  239. />
  240. </el-select>
  241. </template>
  242. <template v-else-if="item.prop === 'checkIn'">
  243. <el-select
  244. v-model="form.checkIn"
  245. size="small"
  246. clearable
  247. @keyup.esc.native="dialogFocus"
  248. >
  249. <el-option
  250. label="是"
  251. :value="1"
  252. />
  253. <el-option
  254. label="否"
  255. :value="0"
  256. />
  257. </el-select>
  258. </template>
  259. <template v-else-if="item.prop === 'active'">
  260. <el-select
  261. v-model="form.active"
  262. size="small"
  263. clearable
  264. @keyup.esc.native="dialogFocus"
  265. >
  266. <el-option
  267. label="是"
  268. :value="1"
  269. />
  270. <el-option
  271. label="否"
  272. :value="0"
  273. />
  274. </el-select>
  275. </template>
  276. <template v-else-if="item.prop === 'transferIn'">
  277. <el-select
  278. v-model="form.transferIn"
  279. size="small"
  280. clearable
  281. @keyup.esc.native="dialogFocus"
  282. >
  283. <el-option
  284. label="是"
  285. :value="1"
  286. />
  287. <el-option
  288. label="否"
  289. :value="0"
  290. />
  291. </el-select>
  292. </template>
  293. <template v-else-if="item.prop === 'canceled'">
  294. <el-select
  295. v-model="form.canceled"
  296. size="small"
  297. clearable
  298. @keyup.esc.native="dialogFocus"
  299. >
  300. <el-option
  301. label="是"
  302. :value="1"
  303. />
  304. <el-option
  305. label="否"
  306. :value="0"
  307. />
  308. </el-select>
  309. </template>
  310. <template v-else-if="item.prop === 'noBSM'">
  311. <el-select
  312. v-model="form.noBSM"
  313. size="small"
  314. clearable
  315. @keyup.esc.native="dialogFocus"
  316. >
  317. <el-option
  318. label="是"
  319. :value="0"
  320. />
  321. <el-option
  322. label="否"
  323. :value="1"
  324. />
  325. </el-select>
  326. </template>
  327. <template v-else>
  328. <el-popover
  329. v-model="item.hintVisible"
  330. placement="right"
  331. trigger="manual"
  332. >
  333. <span>{{ item.hintText }}</span>
  334. <el-input
  335. :ref="'input-' + item.prop"
  336. slot="reference"
  337. v-model="form[item.prop]"
  338. size="small"
  339. @focus="item.hintVisible = true"
  340. @blur="item.hintVisible = false"
  341. @keyup.esc.native="dialogFocus"
  342. />
  343. </el-popover>
  344. </template>
  345. </el-form-item>
  346. </el-col>
  347. </el-row>
  348. </el-form>
  349. </div>
  350. <div class="foot right t30">
  351. <el-button
  352. size="medium"
  353. class="r24"
  354. type="primary"
  355. @click="onCheckGj(true)"
  356. >确定</el-button>
  357. <el-button
  358. size="medium"
  359. @click="closeCheckGj"
  360. >取消</el-button>
  361. </div>
  362. </div>
  363. </Dialog>
  364. </div>
  365. </template>
  366. <script>
  367. import Search from '@/components/SearchWithTooltip'
  368. import Dialog from '@/layout/components/Dialog'
  369. import { parseTime } from '@/utils/index'
  370. import { Query, myQuery } from '@/api/dataIntegration'
  371. import { mapGetters } from 'vuex'
  372. import TableHeaderCell from '@/components/TableHeaderCell'
  373. import { setTableFilters } from '@/utils/table'
  374. export default {
  375. name: 'AdvancedHome',
  376. components: { Search, Dialog, TableHeaderCell },
  377. data() {
  378. return {
  379. loading: false,
  380. colDialogFlag: false,
  381. gjFlag: false,
  382. tableData: [
  383. // {
  384. // flightNO: '',
  385. // flightDate: '',
  386. // sourceAirport: '',
  387. // targetAirport: '',
  388. // passengerNameUpcase: '',
  389. // bagSN: '',
  390. // specialType: '',
  391. // checkIn: '',
  392. // deleted: '',
  393. // activated: '',
  394. // bagWeight: '',
  395. // latestStatus: '',
  396. // bagLocation: '',
  397. // transferFlightNO: ''
  398. // }
  399. ],
  400. page: -1,
  401. noMore: false,
  402. checkList: [],
  403. tableCols: [
  404. {
  405. prop: 'flightNO',
  406. label: '航班号',
  407. desc: '指航班编号',
  408. fixed: 'left',
  409. filterable: true,
  410. sortable: true
  411. },
  412. {
  413. prop: 'flightDate',
  414. label: '航班日期',
  415. desc: '指航班计划起飞日期(机票上的静态数据)',
  416. fixed: 'left',
  417. width: 110,
  418. filterable: true,
  419. sortable: true
  420. },
  421. {
  422. prop: 'departureTime',
  423. label: '起飞时间',
  424. desc: '指航班预计起飞时间,动态数据,仅显示最新结果',
  425. width: 150
  426. },
  427. {
  428. prop: 'sourceAirport',
  429. label: '起飞站',
  430. desc: '指航班执飞航段的起飞航站,以航站英文三字码显示',
  431. filterable: true,
  432. sortable: true
  433. },
  434. {
  435. prop: 'targetAirport',
  436. label: '目的地',
  437. desc: '指航班执飞航段的目的航站,以航站英文三字码显示',
  438. filterable: true,
  439. sortable: true
  440. },
  441. {
  442. prop: 'passengerNameUpcase',
  443. label: '旅客姓名',
  444. desc: '指旅客姓名的拼音大写',
  445. width: 150,
  446. filterable: true,
  447. sortable: true
  448. },
  449. {
  450. prop: 'bagSN',
  451. label: '行李牌号',
  452. desc: '指行李的10位数字行李牌号码',
  453. width: 110,
  454. filterable: true,
  455. sortable: true
  456. },
  457. {
  458. prop: 'specialType',
  459. label: '特殊行李类型',
  460. desc: '指有别于普通托运行李的特殊行李分类,包括(装笼动物、机组行李、易碎行李、VIP行李等),参考BSM报文.E项说明',
  461. width: 115,
  462. filterable: true,
  463. sortable: true
  464. },
  465. {
  466. prop: 'deleted',
  467. label: '删除',
  468. desc: '指旅客是否取消值机托运,根据BSM报文状态是否有DEL判断,已删除的行李记录为斜体灰色字体',
  469. filterable: true,
  470. sortable: true
  471. },
  472. {
  473. prop: 'activated',
  474. label: '激活',
  475. desc: '指托运行李是否被激活,参照BSM报文.S项说明',
  476. filterable: true,
  477. sortable: true
  478. },
  479. {
  480. prop: 'bagWeight',
  481. label: '重量',
  482. desc: '指托运行李的重量,参照BSM报文.W项说明'
  483. },
  484. {
  485. prop: 'latestStatus',
  486. label: '最新状态',
  487. desc: '指托运行李的当前查询时间所在的节点状态',
  488. width: 110,
  489. filterable: true,
  490. sortable: true
  491. },
  492. {
  493. prop: 'bagLocation',
  494. label: '最新位置',
  495. desc: '指托运行李的当前查询时间所在的节点状态的识读位置代号',
  496. width: 110,
  497. filterable: true,
  498. sortable: true
  499. },
  500. {
  501. prop: 'U_Device_ID',
  502. label: '容器编号',
  503. desc: '指集装器ID信息',
  504. width: 110,
  505. filterable: true,
  506. sortable: true
  507. },
  508. {
  509. prop: 'preFlightNO',
  510. label: '中转进航班',
  511. desc: '指有中转行李转出的进港航班号',
  512. width: 110,
  513. filterable: true,
  514. sortable: true
  515. },
  516. {
  517. prop: 'transferFlightNO',
  518. label: '中转出航班',
  519. desc: '指有中转行李转入的离港航班号',
  520. width: 110,
  521. filterable: true,
  522. sortable: true
  523. }
  524. ],
  525. flightDate: [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')],
  526. dateRangePickerOptions: {
  527. onPick: this.dateRangePickHandler,
  528. disabledDate: this.dateRangeDisabled
  529. },
  530. form: {
  531. flightNO: '',
  532. destination: '',
  533. departureStation: '',
  534. baggageNO: '',
  535. specialType: '',
  536. U_Device_ID: '',
  537. passengerName: '',
  538. PNR: '',
  539. checkInSequence: '',
  540. transferArrival: '',
  541. transferDeparture: '',
  542. unLoad: '',
  543. checkIn: '',
  544. active: '',
  545. transferIn: '',
  546. canceled: '',
  547. status: '',
  548. noBSM: ''
  549. },
  550. formItems: [
  551. {
  552. prop: 'flightDate',
  553. label: '航班日期',
  554. span: 16
  555. },
  556. {
  557. prop: 'status',
  558. label: '当前状态'
  559. },
  560. {
  561. prop: 'flightNO',
  562. label: '航班号',
  563. hintText: '示例:CA1111',
  564. hintVisible: false
  565. },
  566. {
  567. prop: 'departureStation',
  568. label: '起飞站',
  569. hintText: '示例:PEK',
  570. hintVisible: false
  571. },
  572. {
  573. prop: 'destination',
  574. label: '目的地',
  575. hintText: '示例:CTU',
  576. hintVisible: false
  577. },
  578. {
  579. prop: 'baggageNO',
  580. label: '行李牌号',
  581. hintText: '示例:1234567890',
  582. hintVisible: false
  583. },
  584. {
  585. prop: 'specialType',
  586. label: '特殊行李类型'
  587. },
  588. {
  589. prop: 'U_Device_ID',
  590. label: '容器编号',
  591. hintText: '示例:AKE25810CA',
  592. hintVisible: false
  593. },
  594. {
  595. prop: 'passengerName',
  596. label: '旅客姓名',
  597. hintText: '示例:ZHAOWEI',
  598. hintVisible: false
  599. },
  600. {
  601. prop: 'PNR',
  602. label: 'PNR',
  603. hintText: '示例:PZR25X',
  604. hintVisible: false
  605. },
  606. {
  607. prop: 'checkInSequence',
  608. label: '值机序号',
  609. hintText: '示例:1',
  610. hintVisible: false
  611. },
  612. {
  613. prop: 'transferArrival',
  614. label: '中转进航班',
  615. hintText: '示例:CA1111',
  616. hintVisible: false
  617. },
  618. {
  619. prop: 'transferDeparture',
  620. label: '中转出航班',
  621. hintText: '示例:CA1111',
  622. hintVisible: false
  623. },
  624. {
  625. prop: 'unLoad',
  626. label: '翻减状态'
  627. },
  628. {
  629. prop: 'checkIn',
  630. label: '已值机'
  631. },
  632. {
  633. prop: 'active',
  634. label: '已激活'
  635. },
  636. {
  637. prop: 'transferIn',
  638. label: '中转行李'
  639. },
  640. {
  641. prop: 'canceled',
  642. label: '已取消'
  643. },
  644. {
  645. prop: 'noBSM',
  646. label: '无BSM'
  647. }
  648. ],
  649. statusList: [
  650. {
  651. ID: 0,
  652. StatusName: '安检',
  653. StatusCode: '安检'
  654. },
  655. {
  656. ID: 1,
  657. StatusName: '分拣',
  658. StatusCode: '分拣'
  659. },
  660. {
  661. ID: 2,
  662. StatusName: '装车',
  663. StatusCode: '装车'
  664. },
  665. {
  666. ID: 3,
  667. StatusName: '装机',
  668. StatusCode: '装机'
  669. },
  670. {
  671. ID: 4,
  672. StatusName: '到达',
  673. StatusCode: '到达'
  674. }
  675. ],
  676. baggageTypeList: [],
  677. dataContent: [],
  678. rules: {
  679. // 机器信息表单验证
  680. // flightNO: [
  681. // { required: true, message: "请输入有效航班号", trigger: "blur" },
  682. // ],
  683. },
  684. tableDataFilters: {},
  685. filterValues: {},
  686. tableDataSortRules: {},
  687. spanArr: [],
  688. contactDot: 0,
  689. scrollTop: 0,
  690. dom: null
  691. }
  692. },
  693. computed: {
  694. ...mapGetters(['clickedCells', 'queryForm']),
  695. dealedTableData() {
  696. const filtered = this.tableData.filter(item => {
  697. let flag = true
  698. Object.entries(this.filterValues).forEach(([key, arr]) => {
  699. if (arr.length && !arr.includes(item[key])) {
  700. flag = false
  701. }
  702. })
  703. return flag
  704. })
  705. const sortRules = Object.entries(this.tableDataSortRules).reduce(
  706. (pre, [key, value]) => {
  707. if (value) {
  708. pre[0].push(key)
  709. value = value === 'ascending' ? 'asc' : 'desc'
  710. pre[1].push(value)
  711. }
  712. return pre
  713. },
  714. [[], []]
  715. )
  716. return this._.orderBy(filtered, sortRules[0], sortRules[1])
  717. }
  718. },
  719. watch: {
  720. '$route.query': {
  721. handler(query) {
  722. let queryFlag = false
  723. const { startDate, endDate, singleJump } = query
  724. const queryEntries = Object.entries(query)
  725. if (queryEntries.length) {
  726. this.clearForm()
  727. }
  728. queryEntries.forEach(([key, value]) => {
  729. if (!['startDate', 'endDate', 'singleJump'].includes(key) && (value ?? '') !== '') {
  730. queryFlag = true
  731. this.form[key] = ['unLoad', 'checkIn', 'active', 'transferIn', 'canceled', 'noBSM'].includes(key)
  732. ? Number(value)
  733. : value
  734. }
  735. })
  736. if (startDate) {
  737. this.$set(this.flightDate, 0, startDate)
  738. }
  739. if (endDate) {
  740. this.$set(this.flightDate, 1, endDate)
  741. }
  742. if (queryFlag) {
  743. this.onCheckGj(singleJump)
  744. }
  745. },
  746. deep: true
  747. },
  748. flightDate: {
  749. handler(val) {
  750. if (val === null) {
  751. this.flightDate = ['', '']
  752. }
  753. },
  754. deep: true
  755. },
  756. dealedTableData: {
  757. handler(val) {
  758. this.spanArr = []
  759. let contactDot = this.contactDot
  760. val.forEach((item, index, arr) => {
  761. if (index === 0) {
  762. this.spanArr.push(1)
  763. } else {
  764. if (
  765. item['flightNO'] === arr[index - 1]['flightNO'] &&
  766. item['flightDate'] === arr[index - 1]['flightDate'] &&
  767. item['passengerNameUpcase'] === arr[index - 1]['passengerNameUpcase'] &&
  768. item['checkInNO'] === arr[index - 1]['checkInNO'] &&
  769. item['bagWeight'] === arr[index - 1]['bagWeight']
  770. ) {
  771. this.spanArr[contactDot] += 1
  772. this.spanArr.push(0)
  773. } else {
  774. this.spanArr.push(1)
  775. contactDot = index
  776. }
  777. }
  778. })
  779. },
  780. deep: true
  781. }
  782. },
  783. created() {
  784. Object.values(this.tableCols).forEach(({ prop, filterable, sortable }) => {
  785. if (filterable) {
  786. this.$set(this.tableDataFilters, prop, [])
  787. this.$set(this.filterValues, prop, [])
  788. }
  789. if (sortable) {
  790. this.$set(this.tableDataSortRules, prop, '')
  791. }
  792. })
  793. // console.log(this.$store.state.app.queryForm)
  794. // 参数顺序 【航班开始日期,航班结束日期,航班号,航班号,行李牌号,行李牌号,起飞站,起飞站,目的站,目的站,特殊行李类型,特殊 行李类型,旅客姓名大写拼音,旅客姓名大写拼音,PNR,PNR,值机号,值机号】
  795. // const dataContent = [this.time[0], this.time[1]]
  796. // for (let i = 0; i < 18; i++) {
  797. // dataContent.push(null)
  798. // }
  799. // this.statItemsQueryByStatMain(dataContent);
  800. },
  801. mounted() {
  802. this.baggageTypeQuery()
  803. const that = this
  804. this.dom = this.$refs.table.bodyWrapper
  805. this.dom.addEventListener('scroll', () => {
  806. that.scrollTop = this.dom.scrollTop
  807. })
  808. },
  809. activated() {
  810. this.dom.scrollTop = this.scrollTop
  811. // else if (this.queryForm) {
  812. // Object.keys(this.form).forEach(key => {
  813. // this.form[key] = this.queryForm[key]
  814. // })
  815. // this.flightDate = this.queryForm.flightDate
  816. // this.onCheckGj()
  817. // }
  818. },
  819. updated() {
  820. // table数据更新
  821. this.$nextTick(() => {
  822. this.$refs.table.doLayout()
  823. })
  824. },
  825. beforeDestroy() {
  826. // console.log(this.$route.matched.filter(item => item.name && item.meta.title))
  827. if (this.$route.matched.filter(item => item.name && item.meta.title).length > 1) {
  828. this.$store.dispatch('app/setQueryForm', {
  829. ...this.form,
  830. flightDate: this.flightDate
  831. })
  832. } else {
  833. this.$store.dispatch('app/setQueryForm', null)
  834. }
  835. },
  836. methods: {
  837. load() {
  838. if (this.noMore || this.loading || this.page < 0) {
  839. return
  840. }
  841. this.statItemsQueryByStatMain(this.dataContent)
  842. },
  843. resetTable() {
  844. this.page = 0
  845. this.noMore = false
  846. this.tableData = []
  847. },
  848. dialogShow() {
  849. this.gjFlag = true
  850. this.$nextTick(() => {
  851. this.dialogFocus()
  852. })
  853. },
  854. dialogFocus() {
  855. this.$refs['dialog'].focus()
  856. },
  857. // startDateChangeHandler(val) {
  858. // this.flightDate[0] = val ?? ''
  859. // if (!val || !this.flightDate[1]) {
  860. // return
  861. // }
  862. // const startDate = new Date(val)
  863. // const endDate = new Date(this.flightDate[1])
  864. // if (startDate > endDate) {
  865. // this.flightDate.splice(1, 1, '')
  866. // this.$message.info('结束时间不能早于开始时间,请重新选择')
  867. // } else if (endDate - startDate > 2 * 24 * 60 * 60 * 1000) {
  868. // this.flightDate.splice(1, 1, '')
  869. // this.$message.info('时间跨度不能超过三天,请重新选择')
  870. // }
  871. // },
  872. // endDateChangeHandler(val) {
  873. // this.flightDate[1] = val ?? ''
  874. // if (!val || !this.flightDate[0]) {
  875. // return
  876. // }
  877. // const startDate = new Date(this.flightDate[0])
  878. // const endDate = new Date(val)
  879. // if (startDate > endDate) {
  880. // this.flightDate.splice(0, 1, '')
  881. // this.$message.info('开始时间不能晚于结束时间,请重新选择')
  882. // } else if (endDate - startDate > 2 * 24 * 60 * 60 * 1000) {
  883. // this.flightDate.splice(0, 1, '')
  884. // this.$message.info('时间跨度不能超过三天,请重新选择')
  885. // }
  886. // },
  887. dateRangePickHandler({ maxDate, minDate }) {
  888. if (!maxDate) {
  889. this.pickedDate = minDate
  890. } else {
  891. this.pickedDate = null
  892. }
  893. },
  894. dateRangeDisabled(date) {
  895. return this.pickedDate ? Math.abs(date - this.pickedDate) > 2 * 24 * 60 * 60 * 1000 : false
  896. },
  897. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  898. if (['passengerNameUpcase', 'bagWeight'].includes(column.property)) {
  899. const _row = this.spanArr[rowIndex]
  900. const _col = _row > 0 ? 1 : 0
  901. return {
  902. rowspan: _row,
  903. colspan: _col
  904. }
  905. }
  906. },
  907. // 给表头单元格加上 ascending 或 descending 使用 element 自带的排序箭头变色
  908. headerCellClass({ row, column, rowIndex, columnIndex }) {
  909. const classes = []
  910. const rule = this.tableDataSortRules[column.property]
  911. if (rule) {
  912. classes.push(rule)
  913. }
  914. return classes.join(' ')
  915. },
  916. tableRowClassName({ row, rowIndex }) {
  917. const classes = []
  918. if (row.deleted === 'DEL') {
  919. classes.push('bgl-deleted')
  920. }
  921. return classes.join(' ')
  922. },
  923. cellClass({ row, column, rowIndex, columnIndex }) {
  924. const classes = []
  925. if (['flightNO', 'bagSN', 'preFlightNO', 'transferFlightNO'].includes(column.property) && row[column.property]) {
  926. classes.push('cell-click')
  927. if (
  928. this.clickedCells.some(
  929. cell =>
  930. cell.pageName === 'advance' &&
  931. Object.entries(cell.row).every(([key, value]) => row[key] === value) &&
  932. cell.columnProp === column.property
  933. )
  934. ) {
  935. classes.push('cell-clicked')
  936. }
  937. }
  938. return classes.join(' ')
  939. },
  940. cellClickHandler(row, column, cell, event) {
  941. if (['flightNO', 'bagSN', 'preFlightNO', 'transferFlightNO'].includes(column.property)) {
  942. this.$store.dispatch('keepAlive/addClickedCell', {
  943. row,
  944. columnProp: column.property,
  945. pageName: 'advance'
  946. })
  947. }
  948. switch (column.property) {
  949. case 'flightNO':
  950. this.$router.push({
  951. path: '/advance/flightView',
  952. query: {
  953. flightNO: row.flightNO,
  954. flightDate: row.flightDate
  955. }
  956. })
  957. break
  958. case 'bagSN':
  959. this.$router.push({
  960. path: '/advance/baggageView',
  961. query: {
  962. flightNO: row.flightNO,
  963. flightDate: row.flightDate,
  964. bagSN: row.bagSN
  965. }
  966. })
  967. break
  968. case 'transferFlightNO':
  969. this.$router.push({
  970. path: '/advance/flightView',
  971. query: {
  972. flightNO: row.transferFlightNO,
  973. flightDate: row.transferFlightDate
  974. }
  975. })
  976. break
  977. case 'preFlightNO':
  978. this.$router.push({
  979. path: '/advance/flightView',
  980. query: {
  981. flightNO: row.preFlightNO,
  982. flightDate: row.preFlightDate
  983. }
  984. })
  985. break
  986. default:
  987. break
  988. }
  989. },
  990. tableFormat(row, column, cellValue) {
  991. switch (column.property) {
  992. case 'departureTime':
  993. return (cellValue ?? '').replace('T', ' ')
  994. case 'deleted':
  995. return cellValue === 'DEL' ? cellValue : ''
  996. case 'activated':
  997. return cellValue === 1 ? '激活' : '未激活'
  998. default:
  999. return cellValue ?? ''
  1000. }
  1001. },
  1002. // 查询
  1003. getSearchData(val) {
  1004. this.clearForm()
  1005. if (this.flightDate[0] === '' || this.flightDate[1] === '' || val === '') {
  1006. this.$message.error('请先输入完整查询信息')
  1007. } else {
  1008. // 点击搜索后清除跳转携带的查询信息
  1009. this.$route.query && this.$router.replace(this.$route.path)
  1010. // let searchData = {dataContent:[this.time[0],this.time[1],val]}
  1011. const az = /^[a-zA-Z]+$/
  1012. const azNum = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]*$/
  1013. // const top2 = /^[a-zA-Z]{2}\w*$/
  1014. const top2 = /^([a-zA-Z][0-9])|([0-9][a-zA-Z])|([a-zA-Z]{2})/
  1015. const num = /^[0-9]+$/
  1016. const bagNo = /^[a-zA-Z]{2}[0-9]{6}$/
  1017. // 纯字母则为旅客姓名
  1018. if (az.test(val)) {
  1019. this.form['passengerName'] = val
  1020. this.onCheckGj(true)
  1021. } else if (azNum.test(val) && top2.test(val)) {
  1022. // 字母加数字且前两位为字母则为航班号
  1023. this.form['flightNO'] = val
  1024. this.onCheckGj(true)
  1025. } else if ((num.test(val) && val.length === 10) || bagNo.test(val)) {
  1026. // 纯数字且位数等于10则为行李牌号
  1027. this.form['baggageNO'] = val
  1028. this.onCheckGj(true)
  1029. } else {
  1030. this.$message.error('请先输入有效查询信息如航班号、旅客姓名首字母、行李牌号')
  1031. }
  1032. // this.sempleQueryByStatMain(searchData)
  1033. }
  1034. },
  1035. // 清除查询
  1036. clearSearchData() {
  1037. this.clearForm()
  1038. this.resetTable()
  1039. },
  1040. // 清除表单
  1041. clearForm() {
  1042. Object.keys(this.form).forEach(key => {
  1043. this.form[key] = ''
  1044. })
  1045. },
  1046. // 高级查询-确定
  1047. onCheckGj(singleJump) {
  1048. this.resetTable()
  1049. /* 参数顺序
  1050. 【航班开始日期,航班结束日期,航班号,航班号,行李牌号,行李牌号,起飞站,起飞站,目的站,目的站,特殊行李类型,特殊行李类型,旅客姓名大写拼音,旅客姓名大写拼音,
  1051. PNR,PNR,值机号,值机号,中转进航班,中转进航班,中转出航班,中转出航班,容器编号,容器编号,
  1052. 是否已翻减(null/OFF/其他),是否已翻减(null/OFF/其他),是否值机(null/0/1),是否值机(null/0/1),
  1053. 是否激活(null/0/1),是否激活(null/0/1),是否中转(null/0/1),是否中转(null/0/1),是否取消行李(null/0/1),是否取消行李(null/0/1)】 */
  1054. this.dataContent = []
  1055. const flightDate = this.flightDate
  1056. if (flightDate && flightDate.length) {
  1057. this.dataContent.push(flightDate[0])
  1058. this.dataContent.push(flightDate[1])
  1059. if (Object.values(this.form).every(value => value === '')) {
  1060. this.$message.error('请先输入查询信息')
  1061. } else {
  1062. const {
  1063. flightNO,
  1064. baggageNO,
  1065. departureStation,
  1066. destination,
  1067. specialType,
  1068. passengerName,
  1069. PNR,
  1070. checkInSequence,
  1071. transferArrival,
  1072. transferDeparture,
  1073. U_Device_ID,
  1074. unLoad,
  1075. checkIn,
  1076. active,
  1077. transferIn,
  1078. canceled,
  1079. status,
  1080. noBSM
  1081. } = this.form
  1082. this.setDataContent(
  1083. flightNO,
  1084. baggageNO,
  1085. departureStation,
  1086. destination,
  1087. specialType,
  1088. passengerName,
  1089. PNR,
  1090. checkInSequence,
  1091. transferArrival,
  1092. transferDeparture,
  1093. U_Device_ID,
  1094. unLoad,
  1095. checkIn,
  1096. active,
  1097. transferIn,
  1098. canceled,
  1099. status,
  1100. noBSM
  1101. )
  1102. this.statItemsQueryByStatMain(this.dataContent, singleJump)
  1103. this.gjFlag = false
  1104. }
  1105. } else {
  1106. this.$message.error('请先选择要查询的时间')
  1107. }
  1108. },
  1109. closeCheckGj() {
  1110. this.gjFlag = false
  1111. },
  1112. setDataContent(...dataContent) {
  1113. dataContent.forEach(target => {
  1114. target = typeof target === 'string' ? target.trim() : target
  1115. if ((target ?? '') !== '') {
  1116. this.dataContent.push(target, target)
  1117. } else {
  1118. this.dataContent.push(null, null)
  1119. }
  1120. })
  1121. },
  1122. // 数据查询
  1123. async statItemsQueryByStatMain(dataContent, singleJump) {
  1124. this.loading = true
  1125. try {
  1126. const {
  1127. code,
  1128. returnData: { listValues: result, needPage }
  1129. } = await Query({
  1130. id: DATACONTENT_ID.advacedQueryId,
  1131. needPage: ++this.page,
  1132. dataContent
  1133. })
  1134. if (Number(code) !== 0) {
  1135. this.page--
  1136. this.loading = false
  1137. this.$message.error('获取数据失败')
  1138. return
  1139. }
  1140. if (needPage === this.page && result.length) {
  1141. if (singleJump) {
  1142. if (result.length === 1) {
  1143. this.$router.push({
  1144. path: '/advance/baggageView',
  1145. query: {
  1146. bagSN: result[0].bagSN,
  1147. flightNO: result[0].flightNO,
  1148. flightDate: result[0].flightDate
  1149. }
  1150. })
  1151. } else {
  1152. const onlyFlight = result.reduce((pre, curr) => {
  1153. if (
  1154. pre === null ||
  1155. (curr.flightNO &&
  1156. curr.flightDate &&
  1157. curr.flightNO === pre.flightNO &&
  1158. curr.flightDate === pre.flightDate)
  1159. ) {
  1160. return {
  1161. flightNO: curr.flightNO,
  1162. flightDate: curr.flightDate
  1163. }
  1164. } else {
  1165. return {}
  1166. }
  1167. }, null)
  1168. if (onlyFlight.flightNO) {
  1169. this.$router.push({
  1170. path: '/advance/flightView',
  1171. query: onlyFlight
  1172. })
  1173. }
  1174. }
  1175. }
  1176. // const tableData = this._.sortBy(result, ['flightDate', 'departureTime', 'passengerNameUpcase', 'bagSN'])
  1177. this.tableData = [...this.tableData, ...result]
  1178. setTableFilters(this.tableData, this.tableDataFilters)
  1179. } else {
  1180. if (this.page === 1) {
  1181. this.$message.info('未查询到匹配结果')
  1182. }
  1183. this.page--
  1184. this.noMore = true
  1185. }
  1186. } catch (error) {
  1187. this.page--
  1188. console.log('出错了', error.message || error)
  1189. }
  1190. this.loading = false
  1191. },
  1192. // 特殊行李类型下拉选项查询
  1193. async baggageTypeQuery() {
  1194. try {
  1195. const result = await myQuery(DATACONTENT_ID.baggageTypeId)
  1196. this.baggageTypeList = result
  1197. } catch (error) {
  1198. console.log('出错了', error.message || error)
  1199. }
  1200. },
  1201. // 统计行数
  1202. summaryRow(num) {
  1203. return function () {
  1204. return ['合计', `共${num}件`]
  1205. }
  1206. }
  1207. }
  1208. }
  1209. </script>
  1210. <style lang="scss" scoped>
  1211. .advance {
  1212. padding: 8px;
  1213. &__head {
  1214. line-height: 32px;
  1215. margin-top: 8px;
  1216. margin-bottom: 16px;
  1217. .setting {
  1218. height: 32px;
  1219. width: 32px;
  1220. cursor: pointer;
  1221. background-size: 100% 100%;
  1222. background: url('../../../assets/baggage/ic_setting.png') no-repeat;
  1223. margin-left: 12px;
  1224. position: relative;
  1225. top: 2px;
  1226. }
  1227. .mr10 {
  1228. margin-right: 10px;
  1229. }
  1230. ::v-deep .interfaceLog_head_time {
  1231. .el-input__prefix {
  1232. left: 10px;
  1233. color: #101116;
  1234. }
  1235. .el-input--prefix .el-input__inner {
  1236. padding-left: 50px;
  1237. }
  1238. }
  1239. }
  1240. }
  1241. .advance__table {
  1242. width: 100%;
  1243. ::v-deep .table {
  1244. width: 100%;
  1245. .cell {
  1246. padding: 0;
  1247. text-align: center;
  1248. font-size: 14px;
  1249. font-family: Helvetica, 'Microsoft YaHei';
  1250. letter-spacing: 0;
  1251. }
  1252. .cell-click {
  1253. cursor: pointer;
  1254. color: #2d7cff;
  1255. &.cell-clicked {
  1256. color: purple;
  1257. }
  1258. }
  1259. .el-table__header-wrapper,
  1260. .el-table__fixed-header-wrapper {
  1261. .cell {
  1262. font-weight: bold;
  1263. color: #101116;
  1264. }
  1265. .has-gutter {
  1266. tr {
  1267. .bgl-huang {
  1268. background: #fcf0b1;
  1269. }
  1270. }
  1271. }
  1272. }
  1273. .el-table__body-wrapper,
  1274. .el-table__fixed-body-wrapper {
  1275. tr.bgl-deleted {
  1276. background: #d2d6df;
  1277. td {
  1278. background: #d2d6df;
  1279. font-style: italic;
  1280. }
  1281. }
  1282. }
  1283. }
  1284. }
  1285. .el-table tbody tr:hover > td {
  1286. background-color: red !important;
  1287. }
  1288. .el-table__body tr.hover-row.current-row > td,
  1289. .el-table__body tr.hover-row.el-table__row--striped.current-row > td,
  1290. .el-table__body tr.hover-row.el-table__row--striped > td,
  1291. .el-table__body tr.hover-row > td {
  1292. background-color: red;
  1293. }
  1294. .rowDialog::v-deep .el-form > .el-row > .el-col:nth-child(1) .el-date-editor {
  1295. width: 100%;
  1296. }
  1297. </style>