index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. <template>
  2. <div class="newFlightView">
  3. <div class="newFlightView-left">
  4. <div class="newFlightView-left-top">
  5. <div class="newFlightView-left-top-top">
  6. <div class="newFlightView-left-top-top-title flex-wrap">
  7. <div class="newFlightView-left-top-top-title-info">航班基本信息</div>
  8. <div class="newFlightView-left-top-top-title-no">{{ flightObj.carrierFlights }}</div>
  9. </div>
  10. <div class="newFlightView-left-top-top-status">
  11. <el-scrollbar style="height: 100%">
  12. <el-checkbox-group @change="checkChange" class="flex-wrap" v-model="checkList">
  13. <Item v-for="(item,index) in checkStates" :key="index" :total="checkStates" :index="index+1" :item="item" />
  14. </el-checkbox-group>
  15. </el-scrollbar>
  16. </div>
  17. </div>
  18. <div class="newFlightView-left-top-list">
  19. <el-descriptions :column="2">
  20. <el-descriptions-item label="起飞机场简称">{{ infoObj.takeoff_airport_name }}</el-descriptions-item>
  21. <el-descriptions-item label="起飞机场三字码">{{ infoObj.outAirport }}</el-descriptions-item>
  22. <el-descriptions-item :span="2" label="日期">{{ formatTime(infoObj.actualTakeOffTime,infoObj.estimateTakeOffTime,infoObj.scheduleTakeOffTime) }}</el-descriptions-item>
  23. <el-descriptions-item label="登机口">{{ infoObj.gateCd }}</el-descriptions-item>
  24. <el-descriptions-item label="停机位"> {{ infoObj.depstandCd }}</el-descriptions-item>
  25. </el-descriptions>
  26. </div>
  27. <div class="newFlightView-left-top-list">
  28. <el-descriptions :column="2">
  29. <el-descriptions-item label="降落机场简称">{{ infoObj.target_airport_name }}</el-descriptions-item>
  30. <el-descriptions-item label="降落机场三字码">{{ infoObj.landAirport }}</el-descriptions-item>
  31. <el-descriptions-item :span="2" label="日期">{{ formatTime(infoObj.actualLandInTime,infoObj.estimateLandInTime,infoObj.scheduleLandInTime) }}</el-descriptions-item>
  32. <el-descriptions-item label="提取转盘">{{infoObj.arrcarouselCd}}</el-descriptions-item>
  33. <el-descriptions-item label="停机位"> {{ infoObj.arrstandCd }}</el-descriptions-item>
  34. </el-descriptions>
  35. </div>
  36. <div class="newFlightView-left-top-list">
  37. <el-descriptions :column="2">
  38. <el-descriptions-item label="航班状态">{{ infoObj.normalState }}</el-descriptions-item>
  39. <el-descriptions-item label="托运旅客数">{{ infoObj.checked_passengers_number }}</el-descriptions-item>
  40. <el-descriptions-item label="中转行李数">{{ infoObj.transfer_baggage_number }}</el-descriptions-item>
  41. <el-descriptions-item label="终点行李数">{{ infoObj.destination_bags_number }}</el-descriptions-item>
  42. </el-descriptions>
  43. </div>
  44. </div>
  45. <div class="newFlightView-left-bottom">
  46. <Table :tableTag="table1" tableName="容器列表" />
  47. </div>
  48. </div>
  49. <div class="newFlightView-right">
  50. <div class="newFlightView-right-top flex">
  51. <div class="newFlightView-right-top-left flex-wrap">
  52. <div class="manageTitle">航班行李列表</div>
  53. <div class="newFlightView-right-top-left-select">快捷筛选
  54. <el-cascader v-model="selectedFilter" :options="fastFilterOptions" :props="{ expandTrigger: 'hover', checkStrictly: true }" size="small" placeholder="无" clearable />
  55. </div>
  56. </div>
  57. <div class="newFlightView-right-top-right">
  58. <TimeZoneSelector />
  59. <img class="btn-img btn-shadow" src="@/assets/baggage/ic_export.png" title="导出" @click="exportHandler('table', '航班行李列表')" />
  60. </div>
  61. </div>
  62. <div class="newFlightView-right-bottom">
  63. <Table :tableTag="table2" ref="table" :fast-filter="fastFilter" :btnStyle="{top:'-52px'}" :istableCol="true" tableName="航班行李列表" @tableLoad="tableLoad" />
  64. </div>
  65. </div>
  66. </div>
  67. </template>
  68. <script>
  69. import Table from '@/views/newQuery/components/table.vue'
  70. import TimeZoneSelector from "@/components/TimeZoneSelector"
  71. import { exportToExcel } from "@/utils/table"
  72. import { combine } from '@/utils'
  73. import pf from '@/layout/mixin/publicFunc'
  74. import Item from './item.vue'
  75. export default {
  76. components: { Table, TimeZoneSelector, Item },
  77. mixins: [pf],
  78. data () {
  79. return {
  80. radio: '1',
  81. options: [],
  82. value: '',
  83. dataContent: {},
  84. flightObj: {},
  85. infoObj: {},
  86. checkList: [],
  87. checkStates: [],
  88. table1: {},
  89. table2: {},
  90. showObj: {},
  91. deArrs: [],
  92. deArrsNum: [],
  93. fastFilterOptions: [
  94. {
  95. label: '中转进航班',
  96. value: 'inflightNo',
  97. children: []
  98. },
  99. {
  100. label: '中转出航班',
  101. value: 'transferFlightNO',
  102. children: []
  103. }
  104. ],
  105. selectedFilter: [],
  106. }
  107. },
  108. computed: {
  109. fastFilter() {
  110. const [key, value] = this.selectedFilter
  111. if (!key) {
  112. return () => true
  113. }
  114. return row => {
  115. switch (key) {
  116. case 'inflightNo':
  117. case 'transferFlightNO':
  118. return value ? row[key] === value : (row[key] ?? '') !== ''
  119. default:
  120. return (row[key] ?? '') !== ''
  121. }
  122. }
  123. }
  124. },
  125. async created () {
  126. const checkDatas = []
  127. const query = this.$route.query
  128. const np = [
  129. {
  130. k1: 'inflightNo',
  131. k2: 'inflightDate'
  132. },
  133. {
  134. k1: 'transferFlightNO',
  135. k2: 'outflightDate'
  136. },
  137. {
  138. k1: 'Inbound_flight_number',
  139. k2: 'Inbound_flight_date'
  140. },
  141. {
  142. k1: 'departure_flights_number',
  143. k2: 'departure_flights_date'
  144. }
  145. ]
  146. const nq = this.formatParams(np, query)
  147. const filterMap = {
  148. Inbound_flight_number: 'inflightNo',
  149. departure_flights_number: 'transferFlightNO'
  150. }
  151. Object.entries(nq).forEach(([key, value]) => {
  152. if (
  153. ![
  154. 'carrierFlights',
  155. 'carrierFlightsDate',
  156. 'outAirport',
  157. 'landAirport',
  158. ].includes(key)
  159. ) {
  160. if (filterMap[key]) {
  161. this.selectedFilter = [filterMap[key], value]
  162. }
  163. delete nq[key]
  164. }
  165. })
  166. const { carrierFlights, carrierFlightsDate } = nq
  167. this.flightObj = nq
  168. this.dataContent = nq
  169. const res = await this.getViewInfo(nq)
  170. this.infoObj = res[0]
  171. const sts = await this.getViewInfo({ carrierFlights, carrierFlightsDate })
  172. if (sts && sts.length) {
  173. for (const p of sts) {
  174. const { outAirport, landAirport } = p
  175. this.deArrs.push({
  176. outAirport,
  177. landAirport
  178. })
  179. }
  180. }
  181. const newDatas = _.cloneDeep(this.deArrs)
  182. if (newDatas && newDatas.length) {
  183. const m = combine(newDatas, 'outAirport', 'landAirport')
  184. m.forEach((item, index) => {
  185. checkDatas.push(`${m[index]}-${m[index + 1]}`)
  186. const obj = {
  187. item,
  188. index
  189. }
  190. this.deArrsNum.push(obj)
  191. })
  192. this.checkStates = m
  193. const [a1, a2] = [m[0], m[m.length - 1]]
  194. const { outAirport, landAirport } = this.infoObj
  195. if (a1 == outAirport && a2 == landAirport) {
  196. this.checkList = checkDatas.splice(0, m.length - 1)
  197. } else {
  198. this.checkList = [`${outAirport}-${landAirport}`]
  199. }
  200. }
  201. },
  202. mounted () {
  203. this.table1 = this.dataContent
  204. this.table2 = this.dataContent
  205. },
  206. methods: {
  207. //格式化参数-航班号
  208. formatParams (arr = [], query = {}) {
  209. if (arr && arr.length) {
  210. for (let index = 0; index < arr.length; index++) {
  211. const { k1, k2 } = arr[index];
  212. if (query[k2]) {
  213. query.carrierFlights = query[k1]
  214. query.carrierFlightsDate = query[k2]
  215. delete query[k1]
  216. delete query[k2]
  217. }
  218. }
  219. }
  220. return query
  221. },
  222. // 获取基本信息
  223. async getViewInfo (dataContent = this.dataContent) {
  224. const { code, returnData } = await this.getQueryList(SERVICE_ID.bagViewId, dataContent)
  225. if (code == 0) {
  226. return returnData
  227. } else {
  228. return []
  229. }
  230. },
  231. // 显示日期
  232. formatTime (t1, t2, t3) {
  233. return t1 ? t1 : t2 ? t2 : t3 ? t3 : ''
  234. },
  235. // 导出
  236. exportHandler (refName, tableName) {
  237. const { carrierFlights, carrierFlightsDate, outAirport, landAirport } = this.flightObj
  238. const table = this.$refs[refName].$el.cloneNode(true);
  239. const fileName = `${tableName}-${carrierFlights}-${carrierFlightsDate}-${outAirport}-${landAirport}.xlsx`;
  240. exportToExcel(table, tableName, fileName);
  241. },
  242. // 选中
  243. async checkChange (arr) {
  244. const datas = []
  245. const result = [...arr]
  246. if (result && result.length) {
  247. const c1 = result.join('-')
  248. const c2 = c1.split('-')
  249. const c3 = _.uniq(c2)
  250. this.deArrsNum.forEach(item => {
  251. c3.forEach(p => {
  252. if (item.item == p) {
  253. const obj = {
  254. name: item.item,
  255. index: item.index
  256. }
  257. datas.push(obj)
  258. }
  259. })
  260. })
  261. const caps = datas.sort((a, b) => a.index - b.index)
  262. const c4 = caps[0].name //起飞
  263. const c5 = caps[caps.length - 1].name //降落
  264. const newPrams = _.cloneDeep(this.dataContent)
  265. newPrams.outAirport = c4
  266. newPrams.landAirport = c5
  267. this.table1 = newPrams
  268. this.table2 = newPrams
  269. const res = await this.getViewInfo(newPrams)
  270. if (res && res.length) {
  271. this.infoObj = res[0]
  272. }
  273. }
  274. },
  275. // 获取行李列表后设置快捷筛选
  276. tableLoad(tableData) {
  277. this.setFastFilterOptions(tableData)
  278. },
  279. setFastFilterOptions(tableData) {
  280. const inFlightNOList = new Set()
  281. const transferFlightNOList = new Set()
  282. tableData.forEach(item => {
  283. item['inflightNo'] && inFlightNOList.add(item['inflightNo'])
  284. item['transferFlightNO'] && transferFlightNOList.add(item['transferFlightNO'])
  285. })
  286. this.fastFilterOptions.splice(
  287. this.fastFilterOptions.length - 2,
  288. 2,
  289. {
  290. label: '中转进航班',
  291. value: 'inflightNo',
  292. children: [...inFlightNOList].map(value => ({
  293. label: value,
  294. value
  295. }))
  296. },
  297. {
  298. label: '中转出航班',
  299. value: 'transferFlightNO',
  300. children: [...transferFlightNOList].map(value => ({
  301. label: value,
  302. value
  303. }))
  304. }
  305. )
  306. }
  307. }
  308. }
  309. </script>
  310. <style lang="scss" scoped>
  311. .newFlightView {
  312. height: calc(100vh - 80px);
  313. padding: 8px;
  314. display: flex;
  315. flex-wrap: wrap;
  316. &-left {
  317. width: 408px;
  318. margin-right: 8px;
  319. &-top {
  320. height: 505px;
  321. background-color: #fff;
  322. &-top {
  323. padding: 25px 16px;
  324. border-bottom: 1px solid #c8cfdb;
  325. &-title {
  326. line-height: 23px;
  327. font-size: 20px;
  328. font-family: Microsoft YaHei;
  329. font-weight: bold;
  330. color: #101116;
  331. margin-bottom: 25px;
  332. &-info {
  333. margin-right: 16px;
  334. }
  335. }
  336. &-status {
  337. font-size: 18px;
  338. font-family: Microsoft YaHei;
  339. font-weight: bold;
  340. color: #101116;
  341. ::v-deep .el-checkbox-group {
  342. font-size: initial;
  343. .el-checkbox__inner {
  344. border-radius: 50%;
  345. }
  346. .el-checkbox__label {
  347. display: none;
  348. }
  349. }
  350. }
  351. }
  352. &-list {
  353. padding: 25px 16px 13px 16px;
  354. border-bottom: 1px solid #c8cfdb;
  355. &:last-child {
  356. border-bottom: none;
  357. }
  358. }
  359. }
  360. &-bottom {
  361. height: calc(100% - 515px);
  362. margin-top: 8px;
  363. }
  364. }
  365. &-right {
  366. flex: 1;
  367. height: 100%;
  368. width: calc(100% - 416px);
  369. &-top {
  370. padding: 18px 0;
  371. &-left {
  372. line-height: 30px;
  373. }
  374. &-right {
  375. padding-right: 70px;
  376. .btn-img {
  377. margin-left: 10px;
  378. }
  379. }
  380. }
  381. &-bottom {
  382. height: calc(100% - 68px);
  383. }
  384. }
  385. }
  386. </style>