index.vue 13 KB

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