chenjun 2 years ago
parent
commit
b89a4625b4

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

@@ -429,13 +429,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数据更新
@@ -446,6 +472,7 @@ export default {
   methods: {
     // 查询
     getSearchData(val) {
+      alert(111)
       this.form = {
         time: '',
         status: '',

+ 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
         }