Selaa lähdekoodia

运单查询条件修改

zhongxiaoyu 2 vuotta sitten
vanhempi
commit
be6edc69f1

+ 10 - 15
src/views/dataQuery/components/DataQueryView/index.vue

@@ -336,17 +336,10 @@ const rules = {
     },
   ],
 }
-const route = useRoute()
 const formRef = ref<FormInstance | null>()
-const { flightDate, stockCode } = route.query
 const dataQuery = () => {
   formRef.value?.validate(valid => {
     if (valid) {
-      if (stockCode) {
-        formData.keyWords = stockCode as string
-        formData.startDate = flightDate as string
-        formData.endDate = flightDate as string
-      }
       tableInit()
       getTableData()
       // load();
@@ -441,15 +434,16 @@ const cellClickHandler = (row, column, cell, event) => {
           if (
             !row.flightAllNO ||
             !row.flightDate ||
-            !['INT', 'DOM'].includes(row.DIType) ||
-            typeof row.FFID !== 'string' ||
-            !['A', 'D'].includes(row.FFID.at(-1))
+            !['INT', 'DOM'].includes(row.DIType)
           ) {
             ElMessage.error('航班信息缺失!')
             return
           }
           const viewName = `${row.DIType === 'DOM' ? '' : 'International'}${
-            row.FFID.at(-1) === 'D' ? 'Departure' : 'Arrival'
+            row.departureAirport === 'SZX' ||
+            (!row.departureAirport && row.arriveAirport !== 'SZX')
+              ? 'Departure'
+              : 'Arrival'
           }Flight`
           router.push({
             path: `/dataQuery/flightQuery/${viewName}`,
@@ -471,15 +465,16 @@ const cellClickHandler = (row, column, cell, event) => {
           if (
             !row.stockCode ||
             !row.flightDate ||
-            !['INT', 'DOM'].includes(row.DIType) ||
-            typeof row.FFID !== 'string' ||
-            !['A', 'D'].includes(row.FFID.at(-1))
+            !['INT', 'DOM'].includes(row.DIType)
           ) {
             ElMessage.error('运单信息缺失!')
             return
           }
           const viewName = `${row.DIType === 'DOM' ? '' : 'International'}${
-            row.FFID.at(-1) === 'D' ? 'Departure' : 'Arrival'
+            row.departureAirport === 'SZX' ||
+            (!row.departureAirport && row.arriveAirport !== 'SZX')
+              ? 'Departure'
+              : 'Arrival'
           }Waybill`
           router.push({
             path: `/dataQuery/waybillQuery/${viewName}`,

+ 6 - 3
src/views/dataQuery/components/DataQueryView/useTable.ts

@@ -231,9 +231,12 @@ export function useTable(
     //     ? [flightDate, flightDate, stockCode]
     //     : [null, null, null]
     // getTableData(defaultDataContent as CommonValue[])
-    if (tableName === 'waybill' && flightDate && stockCode) {
-      const queryDataContent = [flightDate, flightDate, stockCode] as string[]
-      getTableData(queryDataContent as CommonValue[])
+    if (tableName === 'waybill') {
+      formData.startDate = formData.endDate = null
+      if (stockCode) {
+        formData.keyWords = stockCode as string
+        getTableData()
+      }
     } else if (tableName === 'freight') {
       getTableData([null, null, null])
     }