chenjun 2 жил өмнө
parent
commit
565cc87d2a

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

@@ -430,7 +430,7 @@ 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,name,grade,startDate,endDate,station } = this.$route.query
+    const { FlightNO, FlightDate,name,grade,startDate,endDate,station,destination } = this.$route.query
     if (FlightNO && FlightDate) {
       this.$router.replace(this.$route.path)
       const parsedTime = parseTime(new Date(FlightDate), '{y}-{m}-{d}')
@@ -463,6 +463,33 @@ export default {
       this.form['station'] = station
       this.onCheckGj()
     }
+
+    if(name&&startDate&&endDate&&destination){
+      this.timeStart = startDate;
+      this.timeEnd = endDate;
+      this.form['time'] = [startDate,endDate];
+      this.form['name'] = name;
+      this.form['destination'] = destination
+      this.onCheckGj()
+    }
+
+    if(grade&&startDate&&endDate&&destination){
+      this.timeStart = startDate;
+      this.timeEnd = endDate;
+      this.form['time'] = [startDate,endDate];
+      this.form['grade'] = grade;
+      this.form['destination'] = destination
+      this.onCheckGj()
+    }
+
+    if(FlightNO&&startDate&&endDate&&destination){
+      this.timeStart = startDate;
+      this.timeEnd = endDate;
+      this.form['time'] = [startDate,endDate];
+      this.form['flightNumber'] = FlightNO;
+      this.form['destination'] = destination
+      this.onCheckGj()
+    }
   },
   updated() {
     // table数据更新

+ 3 - 2
src/views/baggageManagement/components/arrival/index.vue

@@ -32,6 +32,7 @@
           <el-select
             v-model="formData.currentAirport"
             size="small"
+            filterable
             @change="airPortChange"
             placeholder="请选择机场"
           >
@@ -91,11 +92,11 @@
               prefix-icon="el-icon-search"
               clearable
               @clear="inputClear"
-              @keyup.enter="onSubmit"
+              @keyup.enter="onSubmit(1)"
             />
           </el-form-item>
           <el-form-item>
-            <el-button size="small" type="primary" @click="onSubmit"
+            <el-button size="small" type="primary" @click="onSubmit(1)"
               >搜索</el-button
             >
           </el-form-item>

+ 3 - 2
src/views/baggageManagement/components/departure/index.vue

@@ -32,6 +32,7 @@
           <el-select
             v-model="formData.currentAirport"
             size="small"
+            filterable
             @change="airPortChange"
             placeholder="请选择机场"
           >
@@ -89,14 +90,14 @@
               prefix-icon="el-icon-search"
               clearable
               @clear="inputClear"
-              @keyup.enter="onSubmit"
+              @keyup.enter="onSubmit(0)"
             />
           </el-form-item>
           <el-form-item>
             <el-button
               size="small"
               type="primary"
-              @click="onSubmit"
+              @click="onSubmit(0)"
             >搜索</el-button>
           </el-form-item>
           <el-form-item>

+ 19 - 28
src/views/baggageManagement/mixins/form.js

@@ -202,51 +202,42 @@ export default {
       }
     },
     // 搜索
-    onSubmit() {
+    onSubmit(data) {
       this.$refs['form'].validate(valid => {
         if (valid) {
           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]+$/
+          let queryData = {
+            startDate: this.formData.startDate,
+            endDate: this.formData.endDate,
+          }
+          if(data==1){
+            queryData['destination'] = this.formData.currentAirport
+          }
+          else{
+            queryData['station'] = this.formData.currentAirport
+          }
           // 纯字母则为旅客姓名
           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
-              }
-            })
+            queryData['name'] = this.formData.search
+
           }
           // 字母加数字且前两位为字母则为航班号
           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
-              }
-            })
+            queryData['FlightNO'] = this.formData.search
           }
           // 纯数字且位数等于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
-              }
-            })
+            queryData['grade'] = this.formData.search
           } else {
             // this.$message.error('请输入有效查询信息如航班号、旅客姓名首字母、行李牌号')
           }
+          this.$router.push({
+            path: '/advance',
+            query: queryData
+          })
         } else {
           return false
         }