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

1.0航站视图-默认航站修改

zhongxiaoyu 1 жил өмнө
parent
commit
1a1f55d430

+ 6 - 5
src/views/baggageManagementTemp/components/arrival/index.vue

@@ -387,15 +387,16 @@ export default {
     // 选择机场
     async getAirPortData () {
       try {
-        // const res = await TempQuery({
-        //   id: SERVICE_ID.arrivalAirId,
-        //   dataContent: []
-        // })
         const res = await this.getQueryListAuth(SERVICE_ID.arrivalAirId, {}, 1, 9999, 278)
         if (Number(res.code) === 0) {
           if (res.returnData?.listValues?.length) {
+            const defaultAirport = 'PEK'
+            let currentAirport = res.returnData.listValues[0].planDepartureApt
             this.AirportList = this._.orderBy(res.returnData.listValues, o => o.planDepartureApt)
-            this.formData.currentAirport = res.returnData.listValues[0].planDepartureApt
+            if (res.returnData.listValues.some(item => item.planDepartureApt === defaultAirport)) {
+              currentAirport = defaultAirport
+            }
+            this.formData.currentAirport = currentAirport
             this.resetLoopEvent()
           } else {
             this.$message.warning('无航站数据权限')

+ 6 - 5
src/views/baggageManagementTemp/components/departure/index.vue

@@ -345,15 +345,16 @@ export default {
     // 选择机场
     async getAirPortData () {
       try {
-        // const res = await TempQuery({
-        //   id: SERVICE_ID.departureAirMainId,
-        //   dataContent: []
-        // })
         const res = await this.getQueryListAuth(SERVICE_ID.departureAirMainId, {}, 1, 9999, 276)
         if (Number(res.code) === 0) {
           if (res.returnData?.listValues?.length) {
+            const defaultAirport = 'PEK'
+            let currentAirport = res.returnData.listValues[0].planDepartureApt
             this.AirportList = this._.orderBy(res.returnData.listValues, o => o.planDepartureApt)
-            this.formData.currentAirport = res.returnData.listValues[0].planDepartureApt
+            if (res.returnData.listValues.some(item => item.planDepartureApt === defaultAirport)) {
+              currentAirport = defaultAirport
+            }
+            this.formData.currentAirport = currentAirport
             this.resetLoopEvent()
           } else {
             this.$message.warning('无航站数据权限')

+ 7 - 6
src/views/baggageManagementTemp/components/transferArrival/index.vue

@@ -649,17 +649,18 @@ export default {
     // 选择机场
     async getAirPortData() {
       try {
-        // const res = await TempQuery({
-        //   id: SERVICE_ID.departureAirId,
-        //   dataContent: []
-        // })
         const res = await this.getQueryListAuth(SERVICE_ID.departureAirId, {}, 1, 9999, 280)
         if (Number(res.code) === 0) {
           if (res.returnData?.listValues?.length) {
+            this.AirportList = this._.orderBy(res.returnData.listValues, o => o.planDepartureApt)
             if (!this.formData.currentAirport) {
-              this.formData.currentAirport = res.returnData.listValues[0].planDepartureApt
+              const defaultAirport = 'PEK'
+              let currentAirport = res.returnData.listValues[0].planDepartureApt
+              if (res.returnData.listValues.some(item => item.planDepartureApt === defaultAirport)) {
+                currentAirport = defaultAirport
+              }
+              this.formData.currentAirport = currentAirport
             }
-            this.AirportList = this._.orderBy(res.returnData.listValues, o => o.planDepartureApt)
             this.getAviationData()
             this.upAviationData()
             this.resetLoopEvent()

+ 7 - 2
src/views/baggageManagementTemp/components/transferDeparture/index.vue

@@ -453,10 +453,15 @@ export default {
         const res = await this.getQueryListAuth(SERVICE_ID.departureAirLtId, {}, 1, 9999, 280)
         if (Number(res.code) === 0) {
           if (res.returnData?.listValues?.length) {
+            this.AirportList = this._.orderBy(res.returnData.listValues, o => o.planDepartureApt)
             if (!this.formData.currentAirport) {
-              this.formData.currentAirport = res.returnData.listValues[0].planDepartureApt
+              const defaultAirport = 'PEK'
+              let currentAirport = res.returnData.listValues[0].planDepartureApt
+              if (res.returnData.listValues.some(item => item.planDepartureApt === defaultAirport)) {
+                currentAirport = defaultAirport
+              }
+              this.formData.currentAirport = currentAirport
             }
-            this.AirportList = this._.orderBy(res.returnData.listValues, o => o.planDepartureApt)
             this.getAviationData()
             this.upAviationData()
             this.resetLoopEvent()