Browse Source

Merge branch 'master' of http://120.26.64.82:3000/BFFE/CABaggageData2.0

chenrui  2 years ago
parent
commit
0e857bc349

+ 29 - 80
src/views/baggageManagement/components/departure/index.vue

@@ -53,18 +53,7 @@
             />
           </el-form-item> -->
           <el-form-item prop="flightDate" label="航班日期">
-            <el-date-picker
-              v-model="formData.flightDate"
-              :clearable="false"
-              size="small"
-              style="width: 300px"
-              type="daterange"
-              value-format="yyyy-MM-dd"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              :picker-options="dateRangePickerOptions"
-              @change="dateChangeHandler"
-            />
+            <el-date-picker v-model="formData.flightDate" :clearable="false" size="small" style="width: 300px" type="daterange" value-format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="dateRangePickerOptions" @change="dateChangeHandler" />
           </el-form-item>
           <el-form-item>
             <div class="box-item">
@@ -82,18 +71,7 @@
           <el-form-item prop="search">
             <el-popover :value="popoverVisible" placement="bottom" trigger="manual">
               <span>请输入航班号(示例:CA1234)或行李牌号(示例:1234567890)</span>
-              <el-input
-                slot="reference"
-                v-model="formData.search"
-                class="input-shadow"
-                style="width: 240px; margin-left: 105px"
-                size="small"
-                placeholder="请输入内容"
-                prefix-icon="el-icon-search"
-                clearable
-                @focus="popoverVisible = true"
-                @blur="popoverVisible = false"
-              />
+              <el-input slot="reference" v-model="formData.search" class="input-shadow" style="width: 240px; margin-left: 105px" size="small" placeholder="请输入内容" prefix-icon="el-icon-search" clearable @focus="popoverVisible = true" @blur="popoverVisible = false" />
             </el-popover>
           </el-form-item>
           <el-form-item>
@@ -122,31 +100,11 @@
     </div>
     <!--表格-->
     <div v-loading="loading" class="terminal-table" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)">
-      <el-table
-        ref="table"
-        class="table"
-        :height="computedTableHeight"
-        :data="dealedTableData"
-        :header-cell-class-name="headerCellClass"
-        :row-class-name="tableRowClassName"
-        :cell-class-name="cellClass"
-        show-summary
-        :summary-method="summaryMethod"
-        border
-        stripe
-        fit
-        @cell-click="cellClickHandler"
-      >
+      <el-table ref="table" class="table" :height="computedTableHeight" :data="dealedTableData" :header-cell-class-name="headerCellClass" :row-class-name="tableRowClassName" :cell-class-name="cellClass" show-summary :summary-method="summaryMethod" border stripe fit @cell-click="cellClickHandler">
         <el-table-column v-for="col in tableColsCopy" :key="col.prop" :prop="col.prop" :label="col.label" :width="col.width" :fixed="col.fixed" :formatter="tableFormat">
           <template #header>
             <el-tooltip :content="col.desc || childCol.label" placement="top">
-              <TableHeaderCell
-                :label="col.label"
-                :filter-options="tableDataFilters[col.prop]"
-                :filter-values.sync="filterValues[col.prop]"
-                :sortable="col.sortable"
-                :sort-rule.sync="tableDataSortRules[col.prop]"
-              />
+              <TableHeaderCell :label="col.label" :filter-options="tableDataFilters[col.prop]" :filter-values.sync="filterValues[col.prop]" :sortable="col.sortable" :sort-rule.sync="tableDataSortRules[col.prop]" />
             </el-tooltip>
           </template>
         </el-table-column>
@@ -157,19 +115,10 @@
       <div class="dialog-wrapper">
         <div class="title">列设置</div>
         <div class="content">
-          <el-tree
-            :data="tableCols"
-            :class="colsCheckClass"
-            show-checkbox
-            node-key="index"
-            :default-expand-all="true"
-            :props="{
+          <el-tree :data="tableCols" :class="colsCheckClass" show-checkbox node-key="index" :default-expand-all="true" :props="{
               label: 'label',
               children: 'children',
-            }"
-            :default-checked-keys="checkedKeysTemp"
-            @check="handleCheck"
-          />
+            }" :default-checked-keys="checkedKeysTemp" @check="handleCheck" />
         </div>
         <div class="foot right t30">
           <el-button size="medium" class="r24" type="primary" @click="onCheck">确定</el-button>
@@ -197,7 +146,7 @@ export default {
   name: "DepartureTerminalView",
   components: { Dialog, TimeZoneSelector, TableHeaderCell },
   mixins: [terminalMixin, formMixin, tableColsMixin, timeZoneMixin],
-  data() {
+  data () {
     return {
       orderNum: ["0", "0", "0", "0", "0", "0"], // 默认总数
       popoverVisible: false,
@@ -347,12 +296,12 @@ export default {
     };
   },
   computed: {
-    singleDay() {
+    singleDay () {
       return this.startDate === this.endDate;
     },
     ...mapGetters(["timeZone"]),
   },
-  mounted() {
+  mounted () {
     this.getAirPortData();
     this.table = this.$refs.table.bodyWrapper;
     const that = this;
@@ -360,39 +309,39 @@ export default {
       that.scrollTop = this.table.scrollTop;
     });
   },
-  activated() {
+  activated () {
     this.table.scrollTop = this.scrollTop;
     this.getTableData();
     this.getWarningData();
     this.loopEvent = setInterval(this.getTableData, LOOP_INTERVAL.departureTable);
   },
-  deactivated() {
+  deactivated () {
     if (this.loopEvent) {
       clearInterval(this.loopEvent);
       this.loopEvent = null;
     }
   },
-  beforeDestroy() {
+  beforeDestroy () {
     if (this.loopEvent) {
       clearInterval(this.loopEvent);
       this.loopEvent = null;
     }
   },
   methods: {
-    resetLoopEvent() {
+    resetLoopEvent () {
       this.loading = true;
       this.hasSetTableScroll = false;
       this.loopEvent && clearInterval(this.loopEvent);
       this.getTableData();
       this.loopEvent = setInterval(this.getTableData, LOOP_INTERVAL.departureTable);
     },
-    airPortChange() {
+    airPortChange () {
       this.resetLoopEvent();
     },
-    dateChangeHandler() {
+    dateChangeHandler () {
       this.resetLoopEvent();
     },
-    async getAirPortData() {
+    async getAirPortData () {
       try {
         const res = await getQuery({
           id: DATACONTENT_ID.departureAirMainId,
@@ -409,7 +358,7 @@ export default {
         this.$message.error("失败");
       }
     },
-    async getWarningData() {
+    async getWarningData () {
       try {
         const res = await getQuery({
           id: DATACONTENT_ID.departureWarningId,
@@ -425,7 +374,7 @@ export default {
         this.$message.error("失败");
       }
     },
-    tableRowClassName({ row, rowIndex }) {
+    tableRowClassName ({ row, rowIndex }) {
       const classes = [];
       if (row.flightStatus === "DLY") {
         classes.push("bgl-delayed");
@@ -441,7 +390,7 @@ export default {
       }
       return classes.join(" ");
     },
-    headerCellClass({ row, column }) {
+    headerCellClass ({ row, column }) {
       const classes = [];
       if (["warning", "exceptions", "midIn"].includes(column.property)) {
         classes.push("bgl-huang");
@@ -463,7 +412,7 @@ export default {
     //   this.flightAttrQuery(params)
     // },
     // 获取表格数据
-    async getTableData() {
+    async getTableData () {
       if (!this.formData.currentAirport || !this.startDate || !this.endDate) {
         return;
       }
@@ -486,7 +435,7 @@ export default {
         this.loading = false;
       }
     },
-    initTableData(tableData) {
+    initTableData (tableData) {
       const currentTime = new Date();
       const curTime = this.formatTime(currentTime);
       this.leaveCount = 0;
@@ -505,7 +454,7 @@ export default {
             const planTime = this.formatTime(timeInZone((item.planDepartureTime ?? "").replace("T", " "), this.timeZone), 2);
             const capTime = Math.ceil((planTime - curTime) / (1000 * 60));
             if (Number(startTime) - Number(curTime) < 0 && Number(endTime) - Number(curTime) > 0) {
-              if (p.flightNO != "" && p.flightNO == item.flightNO) {
+              if (p.flightNO && p.flightNO == item.flightNO) {
                 if (capTime - p.warningDuration < 0 && capTime - p.alarmDuration > 0) {
                   item["warning"] = item["preLoad"] - Math.max(item.loadNumber, item.boardID);
                   item["warningState"] = 1;
@@ -518,7 +467,7 @@ export default {
                   const returnedTarget = Object.assign(item, p);
                   this.sendLog(returnedTarget);
                 }
-              } else if (p.flightNO == "" && p.IATACode != "") {
+              } else if (!p.flightNO && p.IATACode) {
                 if (item.flightNO.substring(0, 2) == p.IATACode) {
                   if (capTime - p.warningDuration < 0 && capTime - p.alarmDuration > 0) {
                     item["warning"] = item["preLoad"] - Math.max(item.loadNumber, item.boardID);
@@ -546,7 +495,7 @@ export default {
         this.setTableScroll();
       });
     },
-    formatTime(date, type = 1) {
+    formatTime (date, type = 1) {
       let time = null;
       if (type == 1) {
         time = parseTime(date, "{y}-{m}-{d} {h}:{i}:{s}");
@@ -556,7 +505,7 @@ export default {
       const newTimt = new Date(time);
       return newTimt.getTime();
     },
-    async sendLog(obj) {
+    async sendLog (obj) {
       try {
         const newObj = {
           logTime: parseTime(new Date(), "{y}-{m}-{d} {h}:{i}:{s}"),
@@ -575,7 +524,7 @@ export default {
         this.$message.error("失败");
       }
     },
-    setTableScroll() {
+    setTableScroll () {
       if (!this.singleDay || this.hasSetTableScroll || this.leaveCount === 0) {
         return;
       }
@@ -595,7 +544,7 @@ export default {
       }, 0);
       this.hasSetTableScroll = true;
     },
-    setNumberTransform() {
+    setNumberTransform () {
       const numberItems = this.$refs.numberItem; // 拿到数字的ref,计算元素数量
       const numberArr = this.orderNum.filter((item) => !isNaN(item));
       // 结合CSS 对数字字符进行滚动,显示订单数量
@@ -605,7 +554,7 @@ export default {
       }
     },
 
-    toOrderNum(num) {
+    toOrderNum (num) {
       num = num.toString();
       if (num.length < 6) {
         num = "0" + num; // 如未满八位数,添加"0"补位
@@ -618,7 +567,7 @@ export default {
       }
       this.setNumberTransform();
     },
-    exportHandler(refName, tableName) {
+    exportHandler (refName, tableName) {
       if (this.loading) {
         return;
       }

+ 1 - 1
src/views/baggageManagement/components/flight/index.vue

@@ -13,7 +13,7 @@
           <span class="manageTitle">
             <span>航班基本信息</span>
             <span class="btn-back"><i class="el-icon-arrow-left" />返回上一步</span>
-          </span>        
+          </span>
         </div>
         <div class="part1-wrapper">
           <div class="airline">{{ queryData.flightNO }}