Эх сурвалжийг харах

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

zhongxiaoyu 2 жил өмнө
parent
commit
604a6fe3f8

+ 28 - 1
src/views/advancedQuery/views/advancedHome.vue

@@ -449,13 +449,39 @@ export default {
     document.querySelector('.interfaceLog_head_time_start .el-input__prefix').innerHTML = '开始:'
     document.querySelector('.interfaceLog_head_time_end .el-input__prefix i').remove()
     document.querySelector('.interfaceLog_head_time_end .el-input__prefix').innerHTML = '结束:'
-    const { FlightNO, FlightDate } = this.$route.query
+    const { FlightNO, FlightDate,name,grade,startDate,endDate,station } = this.$route.query
     if (FlightNO && FlightDate) {
       this.$router.replace(this.$route.path)
       const parsedTime = parseTime(new Date(FlightDate), '{y}-{m}-{d}')
       this.timeStart = this.timeEnd = parsedTime
       this.$refs['search'].setSearch(FlightNO)
     }
+    if(name&&startDate&&endDate&&station){
+      this.timeStart = startDate;
+      this.timeEnd = endDate;
+      this.form['time'] = [startDate,endDate];
+      this.form['name'] = name;
+      this.form['station'] = station
+      this.onCheckGj()
+    }
+
+    if(grade&&startDate&&endDate&&station){
+      this.timeStart = startDate;
+      this.timeEnd = endDate;
+      this.form['time'] = [startDate,endDate];
+      this.form['grade'] = grade;
+      this.form['station'] = station
+      this.onCheckGj()
+    }
+
+    if(FlightNO&&startDate&&endDate&&station){
+      this.timeStart = startDate;
+      this.timeEnd = endDate;
+      this.form['time'] = [startDate,endDate];
+      this.form['flightNumber'] = FlightNO;
+      this.form['station'] = station
+      this.onCheckGj()
+    }
   },
   updated() {
     // table数据更新
@@ -466,6 +492,7 @@ export default {
   methods: {
     // 查询
     getSearchData(val) {
+      alert(111)
       this.form = {
         time: '',
         status: '',

+ 19 - 6
src/views/baggageManagement/components/departure/index.vue

@@ -29,7 +29,7 @@
             filterable
             @change="setCurrentAirport"
           /> -->
-          <el-select v-model="formData.currentAirport" clearable  @change="airPortChange" placeholder="请选择机场">
+          <el-select v-model="formData.currentAirport"  @change="airPortChange" placeholder="请选择机场">
             <el-option
               v-for="(item,index) in AirportList"
               :key="index"
@@ -145,6 +145,7 @@
           :filters="flightBaggageTableFilters[item.statCode]"
           :filter-method="flightBaggageTableFilters[item.statCode] && filterHandler"
         />
+
       </el-table>
     </div>
     <!--列设置-->
@@ -318,8 +319,10 @@ export default {
         PlanDepartureTime:[],
         TargetAirport:[],
         BordingGate:[],
-        StandForDepartrue:[]
-      }
+        StandForDepartrue:[],
+        DepartureBuild:[]
+      },
+      loopEvent:null
 
     }
   },
@@ -377,15 +380,15 @@ export default {
       try {
         const res = await getQuery({
           id: 66,
-          dataContent:[...arr,...arr,...arr,...arr]
+          dataContent:[...arr,...arr,...arr]
         })
         if (res.code == 0) {
-         console.log(res)
          this.initTableData(res.returnData);
         } else {
-          this.$message.error(res.message)
+         console.log(res.message)
         }
       } catch (error) {
+        clearInterval(this.loopEvent);
         console.log('出错了', error)
       }
     },
@@ -406,6 +409,7 @@ export default {
               value: item[key]
             })
           }
+          this.flightBaggageTableFilters[key] = this._.sortBy(this.flightBaggageTableFilters[key],['value'])
         })
       })
     },
@@ -413,6 +417,15 @@ export default {
       const property = column['property']
       return row[property] === value
     },
+  },
+  mounted(){
+    let that = this;
+    this.loopEvent = setInterval(function(){
+      that.getTableData();
+    },3000)
+  },
+  beforeDestroy(){
+    clearInterval(this.loopEvent);
   }
 }
 </script>

+ 42 - 12
src/views/baggageManagement/mixins/form.js

@@ -205,18 +205,48 @@ export default {
     onSubmit() {
       this.$refs['form'].validate(valid => {
         if (valid) {
-          const { search } = this.formData
-          const params = {
-            currentAirport: this.currentAirport,
-            relatedAirport: this.relatedAirport,
-            inboundCarrier: this.inboundCarrier,
-            craftType: this.craftType,
-            flightAttr: this.flightAttr,
-            startDate: this.startDate,
-            endDate: this.endDate,
-            world: search
-          }
-          this.getTableData(params)
+          let az = /^[a-zA-Z]+$/
+        let azNum = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]*$/
+        let top2 = /^[a-zA-Z]{2}\w*$/
+        let num = /^[0-9]+$/
+        // 纯字母则为旅客姓名
+        if (az.test(this.formData.search)) {
+          this.$router.push({
+            path: '/advance',
+            query: {
+              name: this.formData.search,
+              startDate: this.formData.startDate,
+              endDate: this.formData.endDate,
+              station:this.formData.currentAirport
+            }
+          })
+        }
+        // 字母加数字且前两位为字母则为航班号
+        else if (azNum.test(this.formData.search) && top2.test(this.formData.search)) {
+          this.$router.push({
+            path: '/advance',
+            query: {
+              FlightNO: this.formData.search,
+              startDate: this.formData.startDate,
+              endDate: this.formData.endDate,
+              station:this.formData.currentAirport
+            }
+          })
+        }
+        // 纯数字且位数等于10则为行李牌号
+        else if (num.test(this.formData.search) && this.formData.search.length == 10) {
+          this.$router.push({
+            path: '/advance',
+            query: {
+              grade: this.formData.search,
+              startDate: this.formData.startDate,
+              endDate: this.formData.endDate,
+              station:this.formData.currentAirport
+            }
+          })
+        } else {
+          this.$message.error('请输入有效查询信息如航班号、旅客姓名首字母、行李牌号')
+        }
         } else {
           return false
         }