chenrui  2 жил өмнө
parent
commit
93fde1a68e

+ 609 - 327
src/views/baggageManagement/components/transferArrival/index.vue

@@ -1,174 +1,178 @@
 <!--
- * @Author: Badguy
- * @Date: 2022-02-09 16:35:57
- * @LastEditTime: 2022-05-07 14:21:28
+ * @Author: zk
+ * @Date: 2022-01-17 10:39:22
+ * @LastEditTime: 2022-05-07 16:55:50
  * @LastEditors: your name
- * @Description: 中转01-进港
- * have a nice day!
+ * @Description: 离港01
 -->
-
 <template>
-  <div class="terminal-arrival">
-    <div class="terminal-header">
-      <!--功能区-表单-->
-      <div class="terminal-form">
-        <el-form
-          ref="form"
-          :inline="true"
-          :model="formData"
-          :rules="rules"
-          class="form"
-        >
-          <el-form-item prop="currentAirport">
-            <el-cascader
-              v-model="formData.currentAirport"
-              style="width: 144px;"
-              placeholder="航站"
-              size="small"
-              :options="currentAirportList"
-              :props="currentAirportProps"
-              collapse-tags
-              clearable
-              filterable
-              @change="setCurrentAirport"
-            />
-          </el-form-item>
-          <el-form-item prop="inboundCarrier">
-            <el-cascader
-              v-model="formData.inboundCarrier"
-              style="width: 164px;"
-              size="small"
-              :options="carrierList"
-              :props="carrierProps"
-              placeholder="进港承运航司"
-              collapse-tags
-              clearable
-              filterable
-              @change="onSubmit"
-            />
-          </el-form-item>
-          <el-form-item prop="outgoingAirline">
-            <el-cascader
-              v-model="formData.outgoingAirline"
-              style="width: 164px;"
-              size="small"
-              :options="carrierList"
-              :props="carrierProps"
-              placeholder="离港承运航司"
-              collapse-tags
-              clearable
-              filterable
-              @change="onSubmit"
-            />
-          </el-form-item>
-          <el-form-item prop="craftType">
-            <el-cascader
-              v-model="formData.craftType"
-              style="width: 120px;"
-              size="small"
-              :options="craftTypeList"
-              :props="craftTypeProps"
-              placeholder="选择机型"
-              collapse-tags
-              clearable
-              filterable
-              @change="onSubmit"
-            />
-          </el-form-item>
-          <el-form-item prop="flightAttr">
-            <el-cascader
-              v-model="formData.flightAttr"
-              style="width: 120px;"
-              size="small"
-              :options="flightAttrList"
-              :props="flightAttrProps"
-              placeholder="航班类型"
-              collapse-tags
-              clearable
-              filterable
-              @change="onSubmit"
-            />
-          </el-form-item>
-          <el-form-item prop="startDate">
-            <el-date-picker
-              v-model="formData.startDate"
-              style="width: 216px;"
-              size="small"
-              type="date"
-              value-format="yyyy-MM-dd"
-              placeholder="开始时间"
-              @change="setStartDate"
-            />
-          </el-form-item>
-          <el-form-item prop="endDate">
-            <el-date-picker
-              v-model="formData.endDate"
-              style="width: 216px; margin-right: 104px"
-              size="small"
-              type="date"
-              value-format="yyyy-MM-dd"
-              placeholder="结束时间"
-              @change="setEndDate"
-            />
-          </el-form-item>
+  <div class="departure-one">
+    <!--功能区-表单-->
+    <div class="departure-form">
+      <el-form
+        ref="form"
+        :inline="true"
+        :model="formData"
+        :rules="rules"
+        class="form"
+      >
+        <el-form-item prop="currentAirport">
+          <!-- <el-cascader
+            v-model="formData.currentAirport"
+            style="width:144px;margin-left:10px"
+            placeholder="全部机场"
+            size="small"
+            :options="currentAirportList"
+            :props="currentAirportProps"
+            collapse-tags
+            clearable
+            filterable
+            @change="setCurrentAirport"
+          /> -->
+          <el-select
+            v-model="formData.currentAirport"
+            size="small"
+            @change="airPortChange"
+            placeholder="请选择机场"
+          >
+            <el-option
+              v-for="(item, index) in AirportList"
+              :key="index"
+              :label="item.PlanDepartureApt"
+              :value="item.PlanDepartureApt"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item prop="inboundCarrier">
+          <el-cascader
+            v-model="formData.inboundCarrier"
+            style="width: 164px"
+            size="small"
+            :options="carrierList"
+            :props="carrierProps"
+            placeholder="进港承运航司"
+            collapse-tags
+            clearable
+            filterable
+            @change="onSubmit"
+          />
+        </el-form-item>
+        <el-form-item prop="outgoingAirline">
+          <el-cascader
+            v-model="formData.outgoingAirline"
+            style="width: 164px"
+            size="small"
+            :options="carrierList"
+            :props="carrierPropsop"
+            placeholder="离港承运航司"
+            collapse-tags
+            clearable
+            filterable
+            @change="onSubmit"
+          />
+        </el-form-item>
+        <el-form-item prop="startDate">
+          <el-date-picker
+            v-model="formData.startDate"
+            style="width: 216px"
+            size="small"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="开始时间"
+            @change="setStartDate"
+          />
+        </el-form-item>
+        <el-form-item prop="endDate">
+          <el-date-picker
+            v-model="formData.endDate"
+            style="width: 216px"
+            size="small"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="结束时间"
+            @change="setEndDate"
+          />
+        </el-form-item>
+        <!-- <el-form-item>
+          <div class="box-item">
+            <p>预计装载总数:</p>
+            <li
+              :class="{ 'number-item': !isNaN(item), 'mark-item': isNaN(item) }"
+              v-for="(item, index) in orderNum"
+              :key="index"
+            >
+              <span v-if="!isNaN(item)">
+                <i ref="numberItem">0123456789</i>
+              </span>
+              <span class="comma" v-else>{{ item }}</span>
+            </li>
+          </div>
+        </el-form-item> -->
+        <div style="float: right">
           <el-form-item prop="search">
             <el-input
               v-model="formData.search"
-              style="width: 240px; margin-right: 4px"
+              style="width: 240px; margin-left: 105px"
               size="small"
               placeholder="请输入内容"
               prefix-icon="el-icon-search"
+              clearable
+              @clear="inputClear"
               @keyup.enter="onSubmit"
             />
           </el-form-item>
           <el-form-item>
-            <el-button
-              size="small"
-              type="primary"
-              class="btn-search"
-              @click="onSubmit"
-            >搜索</el-button>
+            <el-button size="small" type="primary" @click="onSubmit"
+              >搜索</el-button
+            >
           </el-form-item>
-          <el-form-item v-is="['ti_showTransit']">
-            <el-button
-              size="small"
-              type="primary"
-              @click="changeView"
-            >切换视角</el-button>
+          <el-form-item>
+            <el-switch
+              v-model="formData.switch"
+              style="margin-left: 40px"
+              active-text="显示中转"
+            />
           </el-form-item>
-          <el-form-item v-is="['ti_timeIcon']">
+          <el-form-item v-is="['i_timeIcon']">
             <el-dropdown>
               <img
                 class="checkTime msgImg"
-                src="@/assets/departure/ic_time.png"
-              >
-              <el-dropdown-menu
-                slot="dropdown"
-                class="time-zone"
-              >
+                src="../../../../assets/departure/ic_time.png"
+              />
+              <el-dropdown-menu slot="dropdown" class="time-zone">
                 <el-dropdown-item>国内Local/国际UTC</el-dropdown-item>
                 <el-dropdown-item>Local</el-dropdown-item>
                 <el-dropdown-item>UTC</el-dropdown-item>
               </el-dropdown-menu>
             </el-dropdown>
           </el-form-item>
-          <el-form-item v-is="['ti_columnSettings']">
+          <el-form-item>
             <img
               class="msgImg"
-              src="@/assets/departure/ic_setting.png"
+              src="../../../../assets/departure/ic_setting.png"
               @click="show"
-            >
+            />
           </el-form-item>
-        </el-form>
-      </div>
+          <el-form-item>
+            <el-button
+              class="btn-square setBtn"
+              type="primary"
+              icon="el-icon-s-tools"
+              size="mini"
+              @click="show"
+            />
+          </el-form-item>
+        </div>
+      </el-form>
     </div>
     <!--表格-->
     <div
       v-loading="loading"
+      class="departure-table"
       element-loading-text="拼命加载中"
       element-loading-spinner="el-icon-loading"
       element-loading-background="rgba(0, 0, 0, 0.8)"
-      class="terminal-table"
     >
       <el-table
         ref="table"
@@ -184,13 +188,13 @@
         @row-click="rowClick"
       >
         <el-table-column
-          v-for="(item,index) in tableColsCopy"
+          v-for="(item, index) in tableColsCopy"
           :key="index"
           :prop="item.statCode"
           :label="item.statName"
         >
           <el-table-column
-            v-for="(p,i) in item.children"
+            v-for="(p, i) in item.children"
             :key="i"
             :prop="p.statCode"
             :label="p.statName"
@@ -200,11 +204,8 @@
       </el-table>
     </div>
     <!--列设置-->
-    <Dialog
-      :flag="dialogFlag"
-      class="dialog-check-cols"
-    >
-      <div class="colDialog">
+    <Dialog :flag="dialogFlag" class="dialog-check-cols">
+      <div class="col-dialog">
         <div class="title">列设置</div>
         <div class="content">
           <el-tree
@@ -215,23 +216,17 @@
             :default-expand-all="true"
             :props="{
               label: 'statName',
-              children: 'children'
+              children: 'children',
             }"
             :default-checked-keys="checkedKeysTemp"
             @check="handleCheck"
           />
         </div>
         <div class="foot right t30">
-          <el-button
-            size="medium"
-            class="r24"
-            type="primary"
-            @click="onCheck"
-          >确定</el-button>
-          <el-button
-            size="medium"
-            @click="hide"
-          >取消</el-button>
+          <el-button size="medium" class="r24" type="primary" @click="onCheck"
+            >确定</el-button
+          >
+          <el-button size="medium" @click="hide">取消</el-button>
         </div>
       </div>
     </Dialog>
@@ -239,249 +234,536 @@
 </template>
 
 <script>
-import Dialog from '@/layout/components/Dialog'
-import terminalMixin from '../../mixins/terminal'
-import formMixin from '../../mixins/form'
-import tableColsMixin from '../../mixins/tableCols'
+import Dialog from "@/layout/components/Dialog";
+import terminalMixin from "../../mixins/terminal";
+import formMixin from "../../mixins/form";
+import tableColsMixin from "../../mixins/tableCols";
+import { getQuery } from "@/api/flight";
 
 export default {
-  name: 'TransferArrivalTerminalView',
-  components: {
-    Dialog
-  },
+  name: "DepartureTerminalView",
+  components: { Dialog },
   mixins: [terminalMixin, formMixin, tableColsMixin],
   data() {
     return {
+      orderNum: ["0", "0", "0", "0"], // 默认总数
       // 初始表头
       tableCols: [
         {
-          statCode: 'arrivalInfo',
-          statName: '进港航班',
+          statCode: "arrivalInfo",
+          statName: "进港航班",
           children: [
             {
-              statCode: 'FlightNO',
-              statName: '航班号',
-              width: 122
+              statCode: "PreFlightNO",
+              statName: "航班号",
+              width: 122,
             },
             {
-              statCode: 'FlightDate',
-              statName: '航班日期',
-              width: 83
+              statCode: "PreFlightDate",
+              statName: "航班日期",
+              width: 83,
             },
             {
-              statCode: 'PlanLandingTime',
-              statName: '进港时间',
-              width: 79
+              statCode: "PreAirport",
+              statName: "起飞机场",
+              width: 79,
             },
             {
-              statCode: 'PlanDepartureApt',
-              statName: '始飞站',
-              width: 58
+              statCode: "ActualLandingTime",
+              statName: "降落时间",
+              width: 79,
             },
             {
-              statCode: 'LandingBuild',
-              statName: '航站楼',
-              width: 63
+              statCode: "LandingBuild",
+              statName: "降落航站楼",
+              width: 79,
             },
             {
-              statCode: 'Carousel',
-              statName: '行李转盘',
-              width: 84
+              statCode: "Carousel",
+              statName: "行李转盘",
+              width: 79,
             },
             {
-              statCode: 'StandForLanding',
-              statName: '停机位',
-              width: 63
+              statCode: "StandForLanding",
+              statName: "降落停机位",
+              width: 79,
             },
             {
-              statCode: 'positionDistribution',
-              statName: '仓位分布',
-              width: 98
+              statCode: "inTransferBaggageCount",
+              statName: "中转行李数",
+              width: 58,
             },
             {
-              statCode: 'expect_load',
-              statName: '转运数',
-              width: 103
+              statCode: "inTransferredBaggageCount",
+              statName: "已中转行李数",
+              width: 63,
             },
-            {
-              statCode: 'loadflight',
-              statName: '已装载',
-              width: 81
-            }
-          ]
+          ],
         },
         {
-          statCode: 'transferInfo',
-          statName: '转运信息',
+          statCode: "departureInfo",
+          statName: "离港航班",
           children: [
             {
-              statCode: 'transfer_time',
-              statName: '转运时间',
-              width: 92
+              statCode: "FlightNO",
+              statName: "航班号",
+              width: 81,
             },
             {
-              statCode: 'transfer_status',
-              statName: '状态',
-              width: 108
-            }
-          ]
-        },
-        {
-          statCode: 'departureInfo',
-          statName: '离港航班',
-          children: [
-            {
-              statCode: 'transfer_number',
-              statName: '转运数',
-              width: 81
+              statCode: "FlightDate",
+              statName: "航班日期",
+              width: 100,
             },
             {
-              statCode: 'transfer_loaded',
-              statName: '已装载',
-              width: 100
+              statCode: "ActualDepartureTime",
+              statName: "起飞时间",
+              width: 100,
             },
             {
-              statCode: 'TransferFlightPlanDepartureTime',
-              statName: '离港时间',
-              width: 93
+              statCode: "TargetAirport",
+              statName: "目的站",
+              width: 93,
             },
             {
-              statCode: 'TransferFlightNO',
-              statName: '航班号',
-              width: 106
+              statCode: "DepartureBuild",
+              statName: "起飞航站楼",
+              width: 81,
             },
             {
-              statCode: 'TransferFlightDate',
-              statName: '航班日期',
-              width: 107
+              statCode: "BordingGate",
+              statName: "起飞登机口",
+              width: 81,
             },
             {
-              statCode: 'TransferFlightPlanLandingApt',
-              statName: '目的站',
-              width: 85
+              statCode: "StandForDepartrue",
+              statName: "起飞停机位",
+              width: 81,
             },
             {
-              statCode: 'TransferDepartureBuild',
-              statName: '航站楼',
-              width: 78
+              statCode: "outTransferBaggageCount",
+              statName: "中转进行李数",
+              width: 93,
             },
             {
-              statCode: 'TransferBordingGate',
-              statName: '登机口',
-              width: 73
+              statCode: "outTransferredBaggageCount",
+              statName: "已中转进行李数",
+              width: 120,
             },
             {
-              statCode: 'TransferStandForDepartrue',
-              statName: '停机位',
-              width: 83
-            }
-          ]
-        }
-      ]
-    }
+              statCode: "timeDifference",
+              statName: "转运时间",
+              width: 93,
+            },
+          ],
+        },
+      ],
+      AirportList: [],
+      carrierProps: [],
+      carrierPropsop: [],
+      flightBaggageTableFilters: {
+        FlightNO: [],
+        FlightDate: [],
+        PlanDepartureTime: [],
+        TargetAirport: [],
+        BordingGate: [],
+        StandForDepartrue: [],
+        DepartureBuild: [],
+      },
+      loopEvent: null,
+      leaveCount: 0,
+      baggageCount: 0,
+    };
+  },
+  created() {
+    this.getAirPortData();
+    this.getAviationData();
+    this.upAviationData();
   },
   methods: {
-    // 获取表单下拉框数据
-    getFormData(params) {
-      this.inboundCarrierQuery(params)
-      this.outgoingAirlineQuery(params)
-      this.craftTypeQuery(params)
-      this.flightAttrQuery(params)
+    airPortChange() {
+      this.getTableData();
     },
-    // 获取表格数据
-    getTableData(params) {
-      this.integratedQueryTransfer({
-        ...params,
-        type: 'IN'
-      })
+    //选择机场
+    async getAirPortData() {
+      try {
+        const res = await getQuery({
+          id: 72,
+          dataContent: [],
+        });
+        if (res.code == 0) {
+          this.AirportList = res.returnData;
+          this.formData.currentAirport = "PEK";
+          this.getTableData();
+        } else {
+          this.$message.error(res.message);
+        }
+      } catch (error) {
+        console.log("出错了", error);
+      }
+    },
+    //选择航司
+    async getAviationData() {
+      try {
+        const res = await getQuery({
+          id: 71,
+          dataContent: [this.formData.currentAirport],
+        });
+        if (res.code == 0) {
+          this.carrierProps = res.returnData;
+          this.formData.inboundCarrier = "PEK";
+          this.getTableData();
+        } else {
+          this.$message.error(res.message);
+        }
+      } catch (error) {
+        console.log("出错了", error);
+      }
+    },
+    //选择航司
+    async upAviationData() {
+      try {
+        const res = await getQuery({
+          id: 74,
+          dataContent: [this.formData.currentAirport],
+        });
+        if (res.code == 0) {
+          this.carrierPropsop = res.returnData;
+          this.formData.outgoingAirline = "PEK";
+          this.getTableData();
+        } else {
+          this.$message.error(res.message);
+        }
+      } catch (error) {
+        console.log("出错了", error);
+      }
     },
-    changeView() {
-      this.$router.replace({
-        path: '/transfer/departure'
-      })
+    tableRowClassName({ row, rowIndex }) {
+      if (row.hasTakenOff == 0) {
+        if (rowIndex == this.leaveCount - 1) {
+          return "bgl-hui redBorder";
+        } else {
+          return "bgl-hui";
+        }
+      }
+    },
+    tableCellClassName({ row, column }) {
+      if (
+        column.property === "transfer_all" ||
+        column.property === "departureAnomaly" ||
+        column.property === "riskWarning"
+      ) {
+        return "bgl-huang";
+      }
     },
-    // 行合并
-    // initTableData(tableData) {
-    //   this.tableData = mergeTableRow({
-    //     data: this._.sortBy(tableData, ['FlightDate', 'PlanLandingTime']),
-    //     mergeColNames: [
-    //       'FlightNO',
-    //       'FlightDate',
-    //       'PlanLandingTime',
-    //       'PlanDepartureApt',
-    //       'LandingBuild',
-    //       'Carousel',
-    //       'StandForLanding',
-    //       'positionDistribution',
-    //       'expect_load',
-    //       'loadflight'
-    //     ],
-    //     firstMergeColNames: [
-    //       'FlightDate',
-    //       'PlanLandingTime',
-    //       'PlanDepartureApt',
-    //       'LandingBuild',
-    //       'Carousel',
-    //       'StandForLanding',
-    //       'positionDistribution',
-    //       'expect_load',
-    //       'loadflight'
-    //     ],
-    //     firstMerge: 'FlightNO'
+    // 获取表单下拉框数据
+    // getFormData(params) {
+    //   this.relatedAirportQuery({
+    //     ...params,
+    //     type: 'OUT'
     //   })
+    //   this.outgoingAirlineQuery(params)
+    //   this.craftTypeQuery(params)
+    //   this.flightAttrQuery(params)
     // },
-    initTableData(tableData) {
-      const spanArr = []
-      let pos = 0
-      tableData = this._.sortBy(tableData, [
-        'FlightDate',
-        'PlanLandingTime',
-        'TransferFlightDate',
-        'TransferFlightPlanDepartureTime'
-      ])
-      for (let i = 0; i < tableData.length; i++) {
-        if (i === 0) {
-          spanArr.push(1)
+    // 获取表格数据
+    async getTableData() {
+      let arr = [
+        this.formData.currentAirport,
+        this.formData.startDate,
+        this.formData.endDate,
+        this.formData.inboundCarrier,
+        this.formData.outgoingAirline,
+      ];
+      try {
+        const res = await getQuery({
+          id: 68,
+          dataContent: [...arr, ...arr, ...arr],
+        });
+        if (res.code == 0) {
+          this.initTableData(res.returnData);
         } else {
-          if (tableData[i]['FlightNO'] === tableData[i - 1]['FlightNO']) {
-            spanArr[pos] += 1
-            spanArr.push(0)
-          } else {
-            spanArr.push(1)
-            pos = i
-          }
+          console.log(res.message);
         }
+      } catch (error) {
+        clearInterval(this.loopEvent);
+        console.log("出错了", error);
       }
-      this.spanArr = spanArr
-      this.pos = pos
+    },
+    initTableData(tableData) {
+      this.leaveCount = 0;
+      this.baggageCount = 0;
+      tableData.forEach((item) => {
+        if (item.hasTakenOff == 0) {
+          this.leaveCount++;
+        }
+        // item["waitfanj"] = item["noCheckInNumber"] - item["unLoad"];
+        this.baggageCount = this.baggageCount + item.preLoad;
+      });
+      // this.tableData = this._.sortBy(tableData, [
+      //   "FlightDate",
+      //   "PlanDepartureTime",
+      // ]);
+      this.setTableFilters();
+      this.toOrderNum(this.baggageCount);
+      // setInterval(() => {
+      //   this.baggageCount = this.baggageCount+1;
+      //    // 这里输入数字即可调用
+      // }, 2000);
+    },
+    // 表格添加过滤条件
+    setTableFilters() {
+      this.tableData.forEach((item) => {
+        Object.keys(this.flightBaggageTableFilters).forEach((key) => {
+          if (
+            (item[key] ?? "") !== "" &&
+            this.flightBaggageTableFilters[key].every(
+              (obj) => obj.value !== item[key]
+            )
+          ) {
+            this.flightBaggageTableFilters[key].push({
+              text: item[key],
+              value: item[key],
+            });
+          }
+          this.flightBaggageTableFilters[key] = this._.sortBy(
+            this.flightBaggageTableFilters[key],
+            ["value"]
+          );
+        });
+      });
+    },
+    filterHandler(value, row, column) {
+      const property = column["property"];
+      return row[property] === value;
+    },
+    setNumberTransform() {
+      const numberItems = this.$refs.numberItem; // 拿到数字的ref,计算元素数量
+      const numberArr = this.orderNum.filter((item) => !isNaN(item));
+      // 结合CSS 对数字字符进行滚动,显示订单数量
+      for (let index = 0; index < numberItems.length; index++) {
+        const elem = numberItems[index];
+        elem.style.transform = `translate(-50%, -${numberArr[index] * 10}%)`;
+      }
+    },
+
+    toOrderNum(num) {
+      num = num.toString();
+      if (num.length < 4) {
+        num = "0" + num; // 如未满八位数,添加"0"补位
+        this.toOrderNum(num); // 递归添加"0"补位
+      } else if (num.length === 4) {
+        this.orderNum = num.split(""); // 将其便变成数据,渲染至滚动数组
+      } else {
+        // 订单总量数字超过八位显示异常
+        this.$message.warning("总量数字过大");
+      }
+      this.setNumberTransform();
     },
     tableSpanMethod({ row, column, rowIndex, columnIndex }) {
       if (
         [
-          'FlightNO',
-          'FlightDate',
-          'PlanLandingTime',
-          'PlanDepartureApt',
-          'LandingBuild',
-          'Carousel',
-          'StandForLanding',
-          'positionDistribution',
-          'expect_load',
-          'loadflight'
-        ].includes(column['property'])
+          "FlightNO",
+          "FlightDate",
+          "PlanLandingTime",
+          "PlanDepartureApt",
+          "LandingBuild",
+          "Carousel",
+          "StandForLanding",
+          "positionDistribution",
+          "expect_load",
+          "loadflight",
+        ].includes(column["property"])
       ) {
-        const _row = this.spanArr[rowIndex]
-        const _col = _row > 0 ? 1 : 0
+        const _row = this.spanArr[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
         return {
           rowspan: _row,
-          colspan: _col
+          colspan: _col,
+        };
+      }
+    },
+  },
+  mounted() {
+    let that = this;
+    this.loopEvent = setInterval(function () {
+      that.getTableData();
+    }, 3000);
+  },
+  beforeDestroy() {
+    clearInterval(this.loopEvent);
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.departure-form {
+  padding-top: 11px;
+  padding-left: 5px;
+  ::v-deep .form {
+    .el-form-item {
+      margin-bottom: 0px;
+      margin-right: 8px;
+      button,
+      input,
+      optgroup,
+      select,
+      textarea {
+        font-family: Helvetica, "Microsoft YaHei";
+        font-size: 14px;
+      }
+      .el-switch__label {
+        color: #303133;
+      }
+      .el-form-item__error {
+        z-index: 10;
+      }
+      .el-button {
+        &.btn-square {
+          width: 30px;
+          height: 30px;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+          margin-top: 5px;
+        }
+      }
+    }
+    .checkTime {
+      margin: 0 16px;
+    }
+    .msgImg {
+      cursor: pointer;
+      position: relative;
+      top: 6px;
+    }
+  }
+  .box-item {
+    position: relative;
+    height: 32px;
+    font-size: 18px;
+    line-height: 32px;
+    text-align: center;
+    list-style: none;
+    color: #2d7cff;
+    writing-mode: vertical-lr;
+    text-orientation: upright;
+    /*文字禁止编辑*/
+    -moz-user-select: none; /*火狐*/
+    -webkit-user-select: none; /*webkit浏览器*/
+    -ms-user-select: none; /*IE10*/
+    -khtml-user-select: none; /*早期浏览器*/
+    user-select: none;
+    /* overflow: hidden; */
+    p {
+      line-height: 32px;
+      writing-mode: horizontal-tb !important;
+      text-orientation: none !important;
+      /*文字禁止编辑*/
+      -moz-user-select: none; /*火狐*/
+      -webkit-user-select: none; /*webkit浏览器*/
+      -ms-user-select: none; /*IE10*/
+      -khtml-user-select: none; /*早期浏览器*/
+      user-select: none;
+      margin-top: 5px;
+    }
+  }
+  /* 默认逗号设置 */
+  .mark-item {
+    width: 10px;
+    height: 32px;
+    margin-right: 5px;
+    line-height: 10px;
+    font-size: 18px;
+    position: relative;
+    & > span {
+      position: absolute;
+      width: 100%;
+      bottom: 0;
+      writing-mode: vertical-rl;
+      text-orientation: upright;
+    }
+  }
+  /*滚动数字设置*/
+  .number-item {
+    width: 41px;
+    height: 42px;
+    /* 背景图片 */
+    background: url(/images/text-bg-blue.png) no-repeat center center;
+    background-size: 100% 100%;
+    // background: #ccc;
+    list-style: none;
+    margin-right: 5px;
+    // background:rgba(250,250,250,1);
+    border-radius: 4px;
+    border: 3px solid rgb(221, 221, 221);
+    & > span {
+      position: relative;
+      display: inline-block;
+      margin-right: 10px;
+      width: 100%;
+      height: 100%;
+      writing-mode: vertical-rl;
+      text-orientation: upright;
+      overflow: hidden;
+      & > i {
+        font-style: normal;
+        position: absolute;
+        top: 11px;
+        left: 50%;
+        transform: translate(-50%, -1%);
+        transition: transform 1s ease-in-out;
+        letter-spacing: 10px;
+      }
+    }
+  }
+  .number-item:last-child {
+    margin-right: 0;
+  }
+}
+.departure-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;
+    }
+    .el-table__header-wrapper {
+      .cell {
+        font-weight: bold;
+        color: #101116;
+      }
+      .has-gutter {
+        tr {
+          .bgl-huang {
+            background: #fcf0b1;
+          }
+        }
+      }
+    }
+    .el-table__body-wrapper {
+      tr.bgl-hui {
+        background: #d2d6df;
+        td {
+          background: #d2d6df;
+        }
+        &.redBorder {
+          position: relative;
+          &::after {
+            content: "";
+            position: absolute;
+            left: 0;
+            bottom: 0;
+            width: 100%;
+            height: 2px;
+            background: #e83f82;
+          }
         }
       }
     }
   }
 }
-</script>
-
-<style lang="scss" scoped>
-@import '../../style/transfer.scss';
 </style>

+ 610 - 324
src/views/baggageManagement/components/transferDeparture/index.vue

@@ -1,181 +1,185 @@
 <!--
- * @Author: Badguy
- * @Date: 2022-02-09 16:36:40
- * @LastEditTime: 2022-05-05 17:37:20
+ * @Author: zk
+ * @Date: 2022-01-17 10:39:22
+ * @LastEditTime: 2022-05-07 16:55:50
  * @LastEditors: your name
- * @Description: 中转01-出港
- * have a nice day!
+ * @Description: 离港01
 -->
-
 <template>
-  <div class="terminal-departure">
-    <div class="terminal-header">
-      <!--功能区-表单-->
-      <div class="terminal-form">
-        <el-form
-          ref="form"
-          :inline="true"
-          :model="formData"
-          :rules="rules"
-          class="form"
-        >
-          <el-form-item prop="currentAirport">
-            <el-cascader
-              v-model="formData.currentAirport"
-              style="width: 144px;"
-              placeholder="航站"
-              size="small"
-              :options="currentAirportList"
-              :props="currentAirportProps"
-              collapse-tags
-              clearable
-              filterable
-              @change="setCurrentAirport"
-            />
-          </el-form-item>
-          <el-form-item prop="outgoingAirline">
-            <el-cascader
-              v-model="formData.outgoingAirline"
-              style="width: 164px;"
-              size="small"
-              :options="carrierList"
-              :props="carrierProps"
-              placeholder="离港承运航司"
-              collapse-tags
-              clearable
-              filterable
-              @change="onSubmit"
-            />
-          </el-form-item>
-          <el-form-item prop="inboundCarrier">
-            <el-cascader
-              v-model="formData.inboundCarrier"
-              style="width: 164px;"
-              size="small"
-              :options="carrierList"
-              :props="carrierProps"
-              placeholder="进港承运航司"
-              collapse-tags
-              clearable
-              filterable
-              @change="onSubmit"
-            />
-          </el-form-item>
-          <el-form-item prop="craftType">
-            <el-cascader
-              v-model="formData.craftType"
-              style="width: 120px;"
-              size="small"
-              :options="craftTypeList"
-              :props="craftTypeProps"
-              placeholder="选择机型"
-              collapse-tags
-              clearable
-              filterable
-              @change="onSubmit"
-            />
-          </el-form-item>
-          <el-form-item prop="flightAttr">
-            <el-cascader
-              v-model="formData.flightAttr"
-              style="width: 120px;"
-              size="small"
-              :options="flightAttrList"
-              :props="flightAttrProps"
-              placeholder="航班类型"
-              collapse-tags
-              clearable
-              filterable
-              @change="onSubmit"
-            />
-          </el-form-item>
-          <el-form-item prop="startDate">
-            <el-date-picker
-              v-model="formData.startDate"
-              style="width: 216px;"
-              size="small"
-              type="date"
-              value-format="yyyy-MM-dd"
-              placeholder="开始时间"
-              @change="setStartDate"
-            />
-          </el-form-item>
-          <el-form-item prop="endDate">
-            <el-date-picker
-              v-model="formData.endDate"
-              style="width: 216px;  margin-right: 104px"
-              size="small"
-              type="date"
-              value-format="yyyy-MM-dd"
-              placeholder="结束时间"
-              @change="setEndDate"
-            />
-          </el-form-item>
+  <div class="departure-one">
+    <!--功能区-表单-->
+    <div class="departure-form">
+      <el-form
+        ref="form"
+        :inline="true"
+        :model="formData"
+        :rules="rules"
+        class="form"
+      >
+        <el-form-item prop="currentAirport">
+          <!-- <el-cascader
+            v-model="formData.currentAirport"
+            style="width:144px;margin-left:10px"
+            placeholder="全部机场"
+            size="small"
+            :options="currentAirportList"
+            :props="currentAirportProps"
+            collapse-tags
+            clearable
+            filterable
+            @change="setCurrentAirport"
+          /> -->
+          <el-select
+            v-model="formData.currentAirport"
+            size="small"
+            @change="airPortChange"
+            placeholder="请选择机场"
+          >
+            <el-option
+              v-for="(item, index) in AirportList"
+              :key="index"
+              :label="item.PlanDepartureApt"
+              :value="item.PlanDepartureApt"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item prop="inboundCarrier">
+          <el-cascader
+            v-model="formData.inboundCarrier"
+            style="width: 164px"
+            size="small"
+            :options="carrierList"
+            :props="carrierProps"
+            placeholder="进港承运航司"
+            collapse-tags
+            clearable
+            filterable
+            @change="onSubmit"
+          />
+        </el-form-item>
+        <el-form-item prop="outgoingAirline">
+          <el-cascader
+            v-model="formData.outgoingAirline"
+            style="width: 164px"
+            size="small"
+            :options="carrierList"
+            :props="carrierPropsop"
+            placeholder="离港承运航司"
+            collapse-tags
+            clearable
+            filterable
+            @change="onSubmit"
+          />
+        </el-form-item>
+        <el-form-item prop="startDate">
+          <el-date-picker
+            v-model="formData.startDate"
+            style="width: 216px"
+            size="small"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="开始时间"
+            @change="setStartDate"
+          />
+        </el-form-item>
+        <el-form-item prop="endDate">
+          <el-date-picker
+            v-model="formData.endDate"
+            style="width: 216px"
+            size="small"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="结束时间"
+            @change="setEndDate"
+          />
+        </el-form-item>
+        <!-- <el-form-item>
+          <div class="box-item">
+            <p>预计装载总数:</p>
+            <li
+              :class="{ 'number-item': !isNaN(item), 'mark-item': isNaN(item) }"
+              v-for="(item, index) in orderNum"
+              :key="index"
+            >
+              <span v-if="!isNaN(item)">
+                <i ref="numberItem">0123456789</i>
+              </span>
+              <span class="comma" v-else>{{ item }}</span>
+            </li>
+          </div>
+        </el-form-item> -->
+        <div style="float: right">
           <el-form-item prop="search">
             <el-input
               v-model="formData.search"
-              style="width: 240px; margin-right: 4px"
+              style="width: 240px; margin-left: 105px"
               size="small"
               placeholder="请输入内容"
               prefix-icon="el-icon-search"
+              clearable
+              @clear="inputClear"
               @keyup.enter="onSubmit"
             />
           </el-form-item>
           <el-form-item>
-            <el-button
-              size="small"
-              type="primary"
-              class="btn-search"
-              @click="onSubmit"
-            >搜索</el-button>
+            <el-button size="small" type="primary" @click="onSubmit"
+              >搜索</el-button
+            >
           </el-form-item>
-          <el-form-item v-is="['td_showTransit']">
-            <el-button
-              size="small"
-              type="primary"
-              @click="changeView"
-            >切换视角</el-button>
+          <el-form-item>
+            <el-switch
+              v-model="formData.switch"
+              style="margin-left: 40px"
+              active-text="显示中转"
+            />
           </el-form-item>
-          <el-form-item v-is="['td_timeIcon']">
+          <el-form-item v-is="['i_timeIcon']">
             <el-dropdown>
               <img
                 class="checkTime msgImg"
-                src="@/assets/departure/ic_time.png"
-              >
-              <el-dropdown-menu
-                slot="dropdown"
-                class="time-zone"
-              >
+                src="../../../../assets/departure/ic_time.png"
+              />
+              <el-dropdown-menu slot="dropdown" class="time-zone">
                 <el-dropdown-item>国内Local/国际UTC</el-dropdown-item>
                 <el-dropdown-item>Local</el-dropdown-item>
                 <el-dropdown-item>UTC</el-dropdown-item>
               </el-dropdown-menu>
             </el-dropdown>
           </el-form-item>
-          <el-form-item v-is="['td_columnSettings']">
+          <el-form-item>
             <img
               class="msgImg"
-              src="@/assets/departure/ic_setting.png"
+              src="../../../../assets/departure/ic_setting.png"
               @click="show"
-            >
+            />
           </el-form-item>
-        </el-form>
-      </div>
+          <el-form-item>
+            <el-button
+              class="btn-square setBtn"
+              type="primary"
+              icon="el-icon-s-tools"
+              size="mini"
+              @click="show"
+            />
+          </el-form-item>
+        </div>
+      </el-form>
     </div>
     <!--表格-->
     <div
       v-loading="loading"
+      class="departure-table"
       element-loading-text="拼命加载中"
       element-loading-spinner="el-icon-loading"
       element-loading-background="rgba(0, 0, 0, 0.8)"
-      class="terminal-table"
     >
       <el-table
         ref="table"
         :data="tableData"
         class="table"
-        :height="computedTableHeight"
         max-height="100%"
+        :height="computedTableHeight"
         :span-method="tableSpanMethod"
         show-summary
         :summary-method="summaryMethod"
@@ -184,13 +188,13 @@
         @row-click="rowClick"
       >
         <el-table-column
-          v-for="(item,index) in tableColsCopy"
+          v-for="(item, index) in tableColsCopy"
           :key="index"
           :prop="item.statCode"
           :label="item.statName"
         >
           <el-table-column
-            v-for="(p,i) in item.children"
+            v-for="(p, i) in item.children"
             :key="i"
             :prop="p.statCode"
             :label="p.statName"
@@ -200,11 +204,8 @@
       </el-table>
     </div>
     <!--列设置-->
-    <Dialog
-      :flag="dialogFlag"
-      class="dialog-check-cols"
-    >
-      <div class="colDialog">
+    <Dialog :flag="dialogFlag" class="dialog-check-cols">
+      <div class="col-dialog">
         <div class="title">列设置</div>
         <div class="content">
           <el-tree
@@ -215,23 +216,17 @@
             :default-expand-all="true"
             :props="{
               label: 'statName',
-              children: 'children'
+              children: 'children',
             }"
             :default-checked-keys="checkedKeysTemp"
             @check="handleCheck"
           />
         </div>
         <div class="foot right t30">
-          <el-button
-            size="medium"
-            class="r24"
-            type="primary"
-            @click="onCheck"
-          >确定</el-button>
-          <el-button
-            size="medium"
-            @click="hide"
-          >取消</el-button>
+          <el-button size="medium" class="r24" type="primary" @click="onCheck"
+            >确定</el-button
+          >
+          <el-button size="medium" @click="hide">取消</el-button>
         </div>
       </div>
     </Dialog>
@@ -239,245 +234,536 @@
 </template>
 
 <script>
-import Dialog from '@/layout/components/Dialog'
-// import { mergeTableRow } from '@/utils/table'
-import terminalMixin from '../../mixins/terminal'
-import formMixin from '../../mixins/form'
-import tableColsMixin from '../../mixins/tableCols'
+import Dialog from "@/layout/components/Dialog";
+import terminalMixin from "../../mixins/terminal";
+import formMixin from "../../mixins/form";
+import tableColsMixin from "../../mixins/tableCols";
+import { getQuery } from "@/api/flight";
 
 export default {
-  name: 'TransferDepartureTerminalView',
-  components: {
-    Dialog
-  },
+  name: "DepartureTerminalView",
+  components: { Dialog },
   mixins: [terminalMixin, formMixin, tableColsMixin],
   data() {
     return {
+      orderNum: ["0", "0", "0", "0"], // 默认总数
       // 初始表头
       tableCols: [
         {
-          statCode: 'departureInfo',
-          statName: '离港航班',
+          statCode: "arrivalInfo",
+          statName: "进港航班",
           children: [
             {
-              statCode: 'FlightNO',
-              statName: '航班号',
-              width: 105
+              statCode: "PreFlightNO",
+              statName: "航班号",
+              width: 122,
             },
             {
-              statCode: 'FlightDate',
-              statName: '航班日期',
-              width: 88
+              statCode: "PreFlightDate",
+              statName: "航班日期",
+              width: 83,
             },
             {
-              statCode: 'PlanDepartureTime',
-              statName: '离港时间',
-              width: 83
+              statCode: "PreAirport",
+              statName: "起飞机场",
+              width: 79,
             },
             {
-              statCode: 'PlanLandingApt',
-              statName: '目的站',
-              width: 57
+              statCode: "ActualLandingTime",
+              statName: "降落时间",
+              width: 79,
             },
             {
-              statCode: 'DepartureBuild',
-              statName: '航站楼',
-              width: 68
+              statCode: "LandingBuild",
+              statName: "降落航站楼",
+              width: 79,
             },
             {
-              statCode: 'Carousel',
-              statName: '行李转盘',
-              width: 84
+              statCode: "Carousel",
+              statName: "行李转盘",
+              width: 79,
             },
             {
-              statCode: 'StandForDepartrue',
-              statName: '停机位',
-              width: 67
+              statCode: "StandForLanding",
+              statName: "降落停机位",
+              width: 79,
             },
             {
-              statCode: 'positionDistribution',
-              statName: '仓位分布',
-              width: 98
+              statCode: "inTransferBaggageCount",
+              statName: "中转行李数",
+              width: 58,
             },
             {
-              statCode: 'expect_load',
-              statName: '转运数',
-              width: 103
+              statCode: "inTransferredBaggageCount",
+              statName: "已中转行李数",
+              width: 63,
             },
-            {
-              statCode: 'loadflight',
-              statName: '已装载',
-              width: 81
-            }
-          ]
+          ],
         },
         {
-          statCode: 'transferInfo',
-          statName: '转运信息',
+          statCode: "departureInfo",
+          statName: "离港航班",
           children: [
             {
-              statCode: 'transfer_time',
-              statName: '转运时间',
-              width: 92
+              statCode: "FlightNO",
+              statName: "航班号",
+              width: 81,
             },
             {
-              statCode: 'transfer_status',
-              statName: '状态',
-              width: 108
-            }
-          ]
-        },
-        {
-          statCode: 'arrivalInfo',
-          statName: '进港航班',
-          children: [
-            {
-              statCode: 'transfer_number',
-              statName: '转运数',
-              width: 81
+              statCode: "FlightDate",
+              statName: "航班日期",
+              width: 100,
             },
             {
-              statCode: 'transfer_loaded',
-              statName: '已装载',
-              width: 100
+              statCode: "ActualDepartureTime",
+              statName: "起飞时间",
+              width: 100,
             },
             {
-              statCode: 'PrePlanLandingTime',
-              statName: '进港时间',
-              width: 93
+              statCode: "TargetAirport",
+              statName: "目的站",
+              width: 93,
             },
             {
-              statCode: 'PreFlightNO',
-              statName: '航班号',
-              width: 106
+              statCode: "DepartureBuild",
+              statName: "起飞航站楼",
+              width: 81,
             },
             {
-              statCode: 'PreFlightDate',
-              statName: '航班日期',
-              width: 107
+              statCode: "BordingGate",
+              statName: "起飞登机口",
+              width: 81,
             },
             {
-              statCode: 'PrePlanDepartureApt',
-              statName: '始飞站',
-              width: 70
+              statCode: "StandForDepartrue",
+              statName: "起飞停机位",
+              width: 81,
             },
             {
-              statCode: 'PrePlanLandingBuild',
-              statName: '航站楼',
-              width: 70
+              statCode: "outTransferBaggageCount",
+              statName: "中转进行李数",
+              width: 93,
             },
             {
-              statCode: 'PreBoardingGate',
-              statName: '登机口',
-              width: 71
+              statCode: "outTransferredBaggageCount",
+              statName: "已中转进行李数",
+              width: 120,
             },
             {
-              statCode: 'PreStandForLanding',
-              statName: '停机位'
-            }
-          ]
-        }
-      ]
-    }
+              statCode: "timeDifference",
+              statName: "转运时间",
+              width: 93,
+            },
+          ],
+        },
+      ],
+      AirportList: [],
+      carrierProps: [],
+      carrierPropsop: [],
+      flightBaggageTableFilters: {
+        FlightNO: [],
+        FlightDate: [],
+        PlanDepartureTime: [],
+        TargetAirport: [],
+        BordingGate: [],
+        StandForDepartrue: [],
+        DepartureBuild: [],
+      },
+      loopEvent: null,
+      leaveCount: 0,
+      baggageCount: 0,
+    };
+  },
+  created() {
+    this.getAirPortData();
+    this.getAviationData();
+    this.upAviationData();
   },
   methods: {
-    // 获取表单下拉框数据
-    getFormData(params) {
-      this.inboundCarrierQuery(params)
-      this.outgoingAirlineQuery(params)
-      this.craftTypeQuery(params)
-      this.flightAttrQuery(params)
+    airPortChange() {
+      this.getTableData();
     },
-    // 获取表格数据
-    getTableData(params) {
-      this.integratedQueryTransfer({
-        ...params,
-        type: 'OUT'
-      })
+    //选择机场
+    async getAirPortData() {
+      try {
+        const res = await getQuery({
+          id: 72,
+          dataContent: [],
+        });
+        if (res.code == 0) {
+          this.AirportList = res.returnData;
+          this.formData.currentAirport = "PEK";
+          this.getTableData();
+        } else {
+          this.$message.error(res.message);
+        }
+      } catch (error) {
+        console.log("出错了", error);
+      }
+    },
+    //选择航司
+    async getAviationData() {
+      try {
+        const res = await getQuery({
+          id: 71,
+          dataContent: [this.formData.currentAirport],
+        });
+        if (res.code == 0) {
+          this.carrierProps = res.returnData;
+          this.formData.inboundCarrier = "PEK";
+          this.getTableData();
+        } else {
+          this.$message.error(res.message);
+        }
+      } catch (error) {
+        console.log("出错了", error);
+      }
+    },
+    //选择航司
+    async upAviationData() {
+      try {
+        const res = await getQuery({
+          id: 74,
+          dataContent: [this.formData.currentAirport],
+        });
+        if (res.code == 0) {
+          this.carrierPropsop = res.returnData;
+          this.formData.outgoingAirline = "PEK";
+          this.getTableData();
+        } else {
+          this.$message.error(res.message);
+        }
+      } catch (error) {
+        console.log("出错了", error);
+      }
     },
-    changeView() {
-      this.$router.replace({
-        path: '/transfer/arrival'
-      })
+    tableRowClassName({ row, rowIndex }) {
+      if (row.hasTakenOff == 0) {
+        if (rowIndex == this.leaveCount - 1) {
+          return "bgl-hui redBorder";
+        } else {
+          return "bgl-hui";
+        }
+      }
+    },
+    tableCellClassName({ row, column }) {
+      if (
+        column.property === "transfer_all" ||
+        column.property === "departureAnomaly" ||
+        column.property === "riskWarning"
+      ) {
+        return "bgl-huang";
+      }
     },
-    // 行合并
-    // initTableData() {
-    //   this.tableData = mergeTableRow({
-    //     data: this.tableData,
-    //     mergeColNames: [
-    //       'departureFlight',
-    //       'departureDate',
-    //       'departureTime',
-    //       'destinationStation',
-    //       'departureTerminal',
-    //       'baggageTurntable',
-    //       'departurePosition',
-    //       'cabin',
-    //       'departureExpectedLoad',
-    //       'departureAlreadyLoad'
-    //     ],
-    //     firstMergeColNames: [
-    //       'departureDate',
-    //       'departureTime',
-    //       'destinationStation',
-    //       'departureTerminal',
-    //       'baggageTurntable',
-    //       'departurePosition',
-    //       'cabin',
-    //       'departureExpectedLoad',
-    //       'departureAlreadyLoad'
-    //     ],
-    //     firstMerge: 'departureFlight'
+    // 获取表单下拉框数据
+    // getFormData(params) {
+    //   this.relatedAirportQuery({
+    //     ...params,
+    //     type: 'OUT'
     //   })
+    //   this.outgoingAirlineQuery(params)
+    //   this.craftTypeQuery(params)
+    //   this.flightAttrQuery(params)
     // },
-    initTableData(tableData) {
-      const spanArr = []
-      let pos = 0
-      tableData = this._.sortBy(tableData, ['FlightDate', 'PlanDepartureTime', 'PreFlightDate', 'PrePlanLandingTime'])
-      for (let i = 0; i < tableData.length; i++) {
-        if (i === 0) {
-          spanArr.push(1)
+    // 获取表格数据
+    async getTableData() {
+      let arr = [
+        this.formData.currentAirport,
+        this.formData.startDate,
+        this.formData.endDate,
+        this.formData.inboundCarrier,
+        this.formData.outgoingAirline,
+      ];
+      try {
+        const res = await getQuery({
+          id: 69,
+          dataContent: [...arr, ...arr, ...arr],
+        });
+        if (res.code == 0) {
+          this.initTableData(res.returnData);
         } else {
-          if (tableData[i]['FlightNO'] === tableData[i - 1]['FlightNO']) {
-            spanArr[pos] += 1
-            spanArr.push(0)
-          } else {
-            spanArr.push(1)
-            pos = i
-          }
+          console.log(res.message);
+        }
+      } catch (error) {
+        clearInterval(this.loopEvent);
+        console.log("出错了", error);
+      }
+    },
+    initTableData(tableData) {
+      this.leaveCount = 0;
+      this.baggageCount = 0;
+      tableData.forEach((item) => {
+        if (item.hasTakenOff == 0) {
+          this.leaveCount++;
         }
+        // item["waitfanj"] = item["noCheckInNumber"] - item["unLoad"];
+        this.baggageCount = this.baggageCount + item.preLoad;
+      });
+      // this.tableData = this._.sortBy(tableData, [
+      //   "FlightDate",
+      //   "PlanDepartureTime",
+      // ]);
+      this.setTableFilters();
+      this.toOrderNum(this.baggageCount);
+      // setInterval(() => {
+      //   this.baggageCount = this.baggageCount+1;
+      //    // 这里输入数字即可调用
+      // }, 2000);
+    },
+    // 表格添加过滤条件
+    setTableFilters() {
+      this.tableData.forEach((item) => {
+        Object.keys(this.flightBaggageTableFilters).forEach((key) => {
+          if (
+            (item[key] ?? "") !== "" &&
+            this.flightBaggageTableFilters[key].every(
+              (obj) => obj.value !== item[key]
+            )
+          ) {
+            this.flightBaggageTableFilters[key].push({
+              text: item[key],
+              value: item[key],
+            });
+          }
+          this.flightBaggageTableFilters[key] = this._.sortBy(
+            this.flightBaggageTableFilters[key],
+            ["value"]
+          );
+        });
+      });
+    },
+    filterHandler(value, row, column) {
+      const property = column["property"];
+      return row[property] === value;
+    },
+    setNumberTransform() {
+      const numberItems = this.$refs.numberItem; // 拿到数字的ref,计算元素数量
+      const numberArr = this.orderNum.filter((item) => !isNaN(item));
+      // 结合CSS 对数字字符进行滚动,显示订单数量
+      for (let index = 0; index < numberItems.length; index++) {
+        const elem = numberItems[index];
+        elem.style.transform = `translate(-50%, -${numberArr[index] * 10}%)`;
       }
-      this.spanArr = spanArr
-      this.pos = pos
-      this.tableData = tableData
+    },
+
+    toOrderNum(num) {
+      num = num.toString();
+      if (num.length < 4) {
+        num = "0" + num; // 如未满八位数,添加"0"补位
+        this.toOrderNum(num); // 递归添加"0"补位
+      } else if (num.length === 4) {
+        this.orderNum = num.split(""); // 将其便变成数据,渲染至滚动数组
+      } else {
+        // 订单总量数字超过八位显示异常
+        this.$message.warning("总量数字过大");
+      }
+      this.setNumberTransform();
     },
     tableSpanMethod({ row, column, rowIndex, columnIndex }) {
       if (
         [
-          'FlightNO',
-          'FlightDate',
-          'PlanDepartureTime',
-          'PlanLandingApt',
-          'DepartureBuild',
-          'Carousel',
-          'StandForDepartrue',
-          'positionDistribution',
-          'expect_load',
-          'loadflight'
-        ].includes(column['property'])
+          "FlightNO",
+          "FlightDate",
+          "PlanLandingTime",
+          "PlanDepartureApt",
+          "LandingBuild",
+          "Carousel",
+          "StandForLanding",
+          "positionDistribution",
+          "expect_load",
+          "loadflight",
+        ].includes(column["property"])
       ) {
-        const _row = this.spanArr[rowIndex]
-        const _col = _row > 0 ? 1 : 0
+        const _row = this.spanArr[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
         return {
           rowspan: _row,
-          colspan: _col
+          colspan: _col,
+        };
+      }
+    },
+  },
+  mounted() {
+    let that = this;
+    this.loopEvent = setInterval(function () {
+      that.getTableData();
+    }, 3000);
+  },
+  beforeDestroy() {
+    clearInterval(this.loopEvent);
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.departure-form {
+  padding-top: 11px;
+  padding-left: 5px;
+  ::v-deep .form {
+    .el-form-item {
+      margin-bottom: 0px;
+      margin-right: 8px;
+      button,
+      input,
+      optgroup,
+      select,
+      textarea {
+        font-family: Helvetica, "Microsoft YaHei";
+        font-size: 14px;
+      }
+      .el-switch__label {
+        color: #303133;
+      }
+      .el-form-item__error {
+        z-index: 10;
+      }
+      .el-button {
+        &.btn-square {
+          width: 30px;
+          height: 30px;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+          margin-top: 5px;
+        }
+      }
+    }
+    .checkTime {
+      margin: 0 16px;
+    }
+    .msgImg {
+      cursor: pointer;
+      position: relative;
+      top: 6px;
+    }
+  }
+  .box-item {
+    position: relative;
+    height: 32px;
+    font-size: 18px;
+    line-height: 32px;
+    text-align: center;
+    list-style: none;
+    color: #2d7cff;
+    writing-mode: vertical-lr;
+    text-orientation: upright;
+    /*文字禁止编辑*/
+    -moz-user-select: none; /*火狐*/
+    -webkit-user-select: none; /*webkit浏览器*/
+    -ms-user-select: none; /*IE10*/
+    -khtml-user-select: none; /*早期浏览器*/
+    user-select: none;
+    /* overflow: hidden; */
+    p {
+      line-height: 32px;
+      writing-mode: horizontal-tb !important;
+      text-orientation: none !important;
+      /*文字禁止编辑*/
+      -moz-user-select: none; /*火狐*/
+      -webkit-user-select: none; /*webkit浏览器*/
+      -ms-user-select: none; /*IE10*/
+      -khtml-user-select: none; /*早期浏览器*/
+      user-select: none;
+      margin-top: 5px;
+    }
+  }
+  /* 默认逗号设置 */
+  .mark-item {
+    width: 10px;
+    height: 32px;
+    margin-right: 5px;
+    line-height: 10px;
+    font-size: 18px;
+    position: relative;
+    & > span {
+      position: absolute;
+      width: 100%;
+      bottom: 0;
+      writing-mode: vertical-rl;
+      text-orientation: upright;
+    }
+  }
+  /*滚动数字设置*/
+  .number-item {
+    width: 41px;
+    height: 42px;
+    /* 背景图片 */
+    background: url(/images/text-bg-blue.png) no-repeat center center;
+    background-size: 100% 100%;
+    // background: #ccc;
+    list-style: none;
+    margin-right: 5px;
+    // background:rgba(250,250,250,1);
+    border-radius: 4px;
+    border: 3px solid rgb(221, 221, 221);
+    & > span {
+      position: relative;
+      display: inline-block;
+      margin-right: 10px;
+      width: 100%;
+      height: 100%;
+      writing-mode: vertical-rl;
+      text-orientation: upright;
+      overflow: hidden;
+      & > i {
+        font-style: normal;
+        position: absolute;
+        top: 11px;
+        left: 50%;
+        transform: translate(-50%, -1%);
+        transition: transform 1s ease-in-out;
+        letter-spacing: 10px;
+      }
+    }
+  }
+  .number-item:last-child {
+    margin-right: 0;
+  }
+}
+.departure-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;
+    }
+    .el-table__header-wrapper {
+      .cell {
+        font-weight: bold;
+        color: #101116;
+      }
+      .has-gutter {
+        tr {
+          .bgl-huang {
+            background: #fcf0b1;
+          }
+        }
+      }
+    }
+    .el-table__body-wrapper {
+      tr.bgl-hui {
+        background: #d2d6df;
+        td {
+          background: #d2d6df;
+        }
+        &.redBorder {
+          position: relative;
+          &::after {
+            content: "";
+            position: absolute;
+            left: 0;
+            bottom: 0;
+            width: 100%;
+            height: 2px;
+            background: #e83f82;
+          }
         }
       }
     }
   }
 }
-</script>
-
-<style lang="scss" scoped>
-@import '../../style/transfer.scss';
 </style>