index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. <!--
  2. * @Author: zk
  3. * @Date: 2022-01-17 10:39:22
  4. * @LastEditTime: 2022-03-15 16:21:43
  5. * @LastEditors: your name
  6. * @Description: 离港01
  7. -->
  8. <template>
  9. <div class="departure-one">
  10. <!--功能区-表单-->
  11. <div class="departure-form">
  12. <el-form
  13. ref="form"
  14. :inline="true"
  15. :model="formData"
  16. :rules="rules"
  17. class="form"
  18. >
  19. <el-form-item prop="currentAirport">
  20. <el-cascader
  21. v-model="formData.currentAirport"
  22. style="width:144px;margin-left:10px"
  23. placeholder="全部机场"
  24. size="small"
  25. :options="currentAirportList"
  26. :props="currentAirportProps"
  27. collapse-tags
  28. clearable
  29. filterable
  30. @change="setCurrentAirport"
  31. />
  32. </el-form-item>
  33. <el-form-item prop="startDate">
  34. <el-date-picker
  35. v-model="formData.startDate"
  36. style="width:216px;"
  37. size="small"
  38. type="date"
  39. value-format="yyyy-MM-dd"
  40. placeholder="开始时间"
  41. @change="setStartDate"
  42. />
  43. </el-form-item>
  44. <el-form-item prop="endDate">
  45. <el-date-picker
  46. v-model="formData.endDate"
  47. style="width:216px;"
  48. size="small"
  49. type="date"
  50. value-format="yyyy-MM-dd"
  51. placeholder="结束时间"
  52. @change="setEndDate"
  53. />
  54. </el-form-item>
  55. <div style="float:right">
  56. <el-form-item prop="search">
  57. <el-input
  58. v-model="formData.search"
  59. style="width:240px;margin-left:105px;"
  60. size="small"
  61. placeholder="请输入内容"
  62. prefix-icon="el-icon-search"
  63. clearable
  64. @clear="inputClear"
  65. @keyup.enter="onSubmit"
  66. />
  67. </el-form-item>
  68. <el-form-item>
  69. <el-button
  70. size="small"
  71. type="primary"
  72. @click="onSubmit"
  73. >搜索</el-button>
  74. </el-form-item>
  75. <el-form-item>
  76. <el-switch
  77. v-model="formData.switch"
  78. style="margin-left:40px;"
  79. active-text="显示中转"
  80. />
  81. </el-form-item>
  82. <el-form-item v-is="['i_timeIcon']">
  83. <el-dropdown>
  84. <img
  85. class="checkTime msgImg"
  86. src="../../../../assets/departure/ic_time.png"
  87. >
  88. <el-dropdown-menu
  89. slot="dropdown"
  90. class="time-zone"
  91. >
  92. <el-dropdown-item>国内Local/国际UTC</el-dropdown-item>
  93. <el-dropdown-item>Local</el-dropdown-item>
  94. <el-dropdown-item>UTC</el-dropdown-item>
  95. </el-dropdown-menu>
  96. </el-dropdown>
  97. </el-form-item>
  98. <el-form-item v-is="['i_columnSettings']">
  99. <img
  100. class="msgImg"
  101. src="../../../../assets/departure/ic_setting.png"
  102. @click="show"
  103. >
  104. </el-form-item>
  105. </div>
  106. </el-form>
  107. </div>
  108. <!--表格-->
  109. <div
  110. v-loading="loading"
  111. class="departure-table"
  112. element-loading-text="拼命加载中"
  113. element-loading-spinner="el-icon-loading"
  114. element-loading-background="rgba(0, 0, 0, 0.8)"
  115. >
  116. <el-table
  117. ref="table"
  118. :data="tableData"
  119. class="table"
  120. :height="computedTableHeight"
  121. :header-cell-class-name="tableCellClassName"
  122. :row-class-name="tableRowClassName"
  123. show-summary
  124. :summary-method="summaryMethod"
  125. border
  126. stripe
  127. @row-click="rowClick"
  128. >
  129. <el-table-column
  130. v-for="(item,index) in tableColsCopy"
  131. :key="index"
  132. :prop="item.statCode"
  133. :label="item.statName"
  134. :width="item.width"
  135. :formatter="tableFormat"
  136. :filters="item.filters"
  137. :filter-method="item.filterMethod"
  138. />
  139. </el-table>
  140. </div>
  141. <!--列设置-->
  142. <Dialog
  143. :flag="dialogFlag"
  144. class="dialog-check-cols"
  145. >
  146. <div class="col-dialog">
  147. <div class="title">列设置</div>
  148. <div class="content">
  149. <el-tree
  150. :data="tableCols"
  151. :class="colsCheckClass"
  152. show-checkbox
  153. node-key="index"
  154. :default-expand-all="true"
  155. :props="{
  156. label: 'statName',
  157. children: 'children'
  158. }"
  159. :default-checked-keys="checkedKeysTemp"
  160. @check="handleCheck"
  161. />
  162. </div>
  163. <div class="foot right t30">
  164. <el-button
  165. size="medium"
  166. class="r24"
  167. type="primary"
  168. @click="onCheck"
  169. >确定</el-button>
  170. <el-button
  171. size="medium"
  172. @click="hide"
  173. >取消</el-button>
  174. </div>
  175. </div>
  176. </Dialog>
  177. </div>
  178. </template>
  179. <script>
  180. import Dialog from '@/layout/components/Dialog'
  181. import terminalMixin from '../../mixins/terminal'
  182. import formMixin from '../../mixins/form'
  183. import tableColsMixin from '../../mixins/tableCols'
  184. import { advancedInquiry, getQuery } from '@/api/flight'
  185. export default {
  186. name: 'DepartureTerminalView',
  187. components: { Dialog },
  188. mixins: [terminalMixin, formMixin, tableColsMixin],
  189. data() {
  190. return {
  191. // 初始表头
  192. tableCols: [
  193. {
  194. statCode: 'FlightNO',
  195. statName: '航班号',
  196. width: 132,
  197. filters:this.bagLocationItem,
  198. filterMethod:this.filterHandler
  199. },
  200. {
  201. statCode: 'FlightDate',
  202. statName: '执飞日期',
  203. width: 105,
  204. filters:this.FlightDateItemArr,
  205. filterMethod:this.filterHandler
  206. },
  207. {
  208. statCode: 'PlanDepartureTime',
  209. statName: '预计起飞时间',
  210. width: 115,
  211. filters:this.PlanDepartureTimeItemArr,
  212. filterMethod:this.filterHandler
  213. },
  214. {
  215. statCode: 'PlanLandingApt',
  216. statName: '目的站',
  217. width: 71,
  218. filters:this.PlanLandingAptItemArr,
  219. filterMethod:this.filterHandler
  220. },
  221. {
  222. statCode: 'DepartureBuild',
  223. statName: '航站楼',
  224. width: 65,
  225. filters:this.DepartureBuildItemArr,
  226. filterMethod:this.filterHandler
  227. },
  228. {
  229. statCode: 'BordingGate',
  230. statName: '登机口',
  231. width: 68,
  232. filters:this.BordingGateItemArr,
  233. filterMethod:this.filterHandler
  234. },
  235. {
  236. statCode: 'StandForDepartrue',
  237. statName: '停机位',
  238. width: 60,
  239. filters:this.StandForDepartrueItemArr,
  240. filterMethod:this.filterHandler
  241. },
  242. {
  243. statCode: 'passagernum',
  244. statName: '托运旅客',
  245. width: 88
  246. },
  247. {
  248. statCode: 'checkin',
  249. statName: '值机',
  250. width: 72
  251. },
  252. {
  253. statCode: 'not_actived',
  254. statName: '未激活',
  255. width: 76
  256. },
  257. {
  258. statCode: 'expect_load',
  259. statName: '预计装载',
  260. width: 101
  261. },
  262. {
  263. statCode: 'security_all',
  264. statName: '安检',
  265. width: 88
  266. },
  267. {
  268. statCode: 'fenj',
  269. statName: '分拣',
  270. width: 83
  271. },
  272. {
  273. statCode: 'loadcar',
  274. statName: '装车',
  275. width: 83
  276. },
  277. {
  278. statCode: 'loadflight',
  279. statName: '装机',
  280. width: 80
  281. },
  282. {
  283. statCode: 'waitfanj',
  284. statName: '待翻减',
  285. width: 79
  286. },
  287. {
  288. statCode: 'hasfanj',
  289. statName: '已翻减',
  290. width: 82
  291. },
  292. {
  293. statCode: 'delbag',
  294. statName: '取消托运',
  295. width: 89
  296. },
  297. {
  298. statCode: 'no_bsm',
  299. statName: '无BSM',
  300. width: 68
  301. },
  302. {
  303. statCode: 'riskWarning',
  304. statName: '风险预警',
  305. width: 75
  306. },
  307. {
  308. statCode: 'departureAnomaly',
  309. statName: '离港异常',
  310. width: 72
  311. },
  312. {
  313. statCode: 'transfer_all',
  314. statName: '中转进行李'
  315. }
  316. ],
  317. FlightNOItem: [],
  318. PlanDepartureTimeItemArr:[],
  319. PlanLandingAptItemArr:[],
  320. BordingGateItemArr:[],
  321. StandForDepartrueItemArr:[]
  322. }
  323. },
  324. created(){
  325. this.getAirPortData()
  326. },
  327. methods: {
  328. async getAirPortData(){
  329. try {
  330. const res = await getQuery({
  331. id: 65,
  332. dataContent:[]
  333. })
  334. if (res.code == 0) {
  335. console.log(res)
  336. } else {
  337. this.$message.error(res.message)
  338. }
  339. } catch (error) {
  340. console.log('出错了', error)
  341. }
  342. },
  343. tableRowClassName({ row, rowIndex }) {
  344. if (rowIndex < 5) {
  345. return 'bgl-hui'
  346. }
  347. },
  348. tableCellClassName({ row, column }) {
  349. if (
  350. column.property === 'transfer_all' ||
  351. column.property === 'departureAnomaly' ||
  352. column.property === 'riskWarning'
  353. ) {
  354. return 'bgl-huang'
  355. }
  356. },
  357. // 获取表单下拉框数据
  358. getFormData(params) {
  359. this.relatedAirportQuery({
  360. ...params,
  361. type: 'OUT'
  362. })
  363. this.outgoingAirlineQuery(params)
  364. this.craftTypeQuery(params)
  365. this.flightAttrQuery(params)
  366. },
  367. // 获取表格数据
  368. getTableData(params) {
  369. this.integratedQuery({
  370. ...params,
  371. type: 'OUT'
  372. })
  373. },
  374. initTableData(tableData) {
  375. tableData.forEach(item => {
  376. item['wantfanj'] = item['delbag'] - item['hasfanj']
  377. })
  378. this.tableData = this._.sortBy(tableData, ['FlightDate', 'PlanDepartureTime'])
  379. },
  380. filterHandler(value, row, column) {
  381. const property = column['property']
  382. return row[property] === value
  383. },
  384. }
  385. }
  386. </script>
  387. <style lang="scss" scoped>
  388. .departure-form {
  389. padding-top: 11px;
  390. ::v-deep .form {
  391. .el-form-item {
  392. margin-bottom: 0px;
  393. margin-right: 8px;
  394. button,
  395. input,
  396. optgroup,
  397. select,
  398. textarea {
  399. font-family: Helvetica, 'Microsoft YaHei';
  400. font-size: 14px;
  401. }
  402. .el-switch__label {
  403. color: #303133;
  404. }
  405. .el-form-item__error {
  406. z-index: 10;
  407. }
  408. }
  409. .checkTime {
  410. margin: 0 16px;
  411. }
  412. .msgImg {
  413. cursor: pointer;
  414. position: relative;
  415. top: 6px;
  416. }
  417. }
  418. }
  419. .departure-table {
  420. width: 100%;
  421. ::v-deep .table {
  422. width: 100%;
  423. .cell {
  424. padding: 0;
  425. text-align: center;
  426. font-size: 14px;
  427. font-family: Helvetica, 'Microsoft YaHei';
  428. letter-spacing: 0;
  429. }
  430. .el-table__header-wrapper {
  431. .cell {
  432. font-weight: bold;
  433. color: #101116;
  434. }
  435. .has-gutter {
  436. tr {
  437. .bgl-huang {
  438. background: #fcf0b1;
  439. }
  440. }
  441. }
  442. }
  443. .el-table__body-wrapper {
  444. tr.bgl-hui {
  445. background: #d2d6df;
  446. td {
  447. background: #d2d6df;
  448. }
  449. &:nth-child(5) {
  450. position: relative;
  451. &::after {
  452. content: '';
  453. position: absolute;
  454. left: 0;
  455. bottom: 0;
  456. width: 100%;
  457. height: 2px;
  458. background: #e83f82;
  459. }
  460. }
  461. }
  462. }
  463. }
  464. }
  465. ::v-deep .dialog-check-cols .el-tree {
  466. &.has-children .el-tree-node > .el-tree-node__children {
  467. display: flex;
  468. flex-wrap: wrap;
  469. }
  470. &.no-children {
  471. display: flex;
  472. flex-wrap: wrap;
  473. }
  474. }
  475. ::v-deep .time-zone .el-dropdown-menu__item {
  476. font-family: Helvetica, 'Microsoft YaHei';
  477. font-size: 12px;
  478. color: #101116;
  479. }
  480. </style>