|
@@ -15,23 +15,50 @@
|
|
|
</div>
|
|
|
<div class="goods-header-operate flex-wrap">
|
|
|
<Search @clear="clear" @search="search" />
|
|
|
- <el-button class="button-sqaure" :icon="Download" color="#ac014d" @click="downloadHandler" />
|
|
|
- <ColumnSet class="button-sqaure" :table-columns="tableColumns" @checked-submit="columnChecked" />
|
|
|
+ <el-button
|
|
|
+ class="button-sqaure"
|
|
|
+ :icon="Download"
|
|
|
+ color="#ac014d"
|
|
|
+ @click="downloadHandler"
|
|
|
+ />
|
|
|
+ <ColumnSet
|
|
|
+ class="button-sqaure"
|
|
|
+ :table-columns="tableColumns"
|
|
|
+ @checked-submit="columnChecked"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div :style="{
|
|
|
+ <div
|
|
|
+ :style="{
|
|
|
maxHeight: trackAirlines.length > 1 ? `${208 * 2 + 8}px` : '208px',
|
|
|
- }" class="goods-track">
|
|
|
+ }"
|
|
|
+ class="goods-track"
|
|
|
+ >
|
|
|
<el-scrollbar always>
|
|
|
<div class="goods-track-warpper">
|
|
|
- <div v-for="trackAirline in trackAirlines" :key="trackAirline.flightNO" class="goods-track-row">
|
|
|
- <div v-for="(trackAirport, index) in trackAirline.airports" :key="trackAirport.airport" class="goods-track-box" :style="trackBoxStyle(trackAirline.airports, index)">
|
|
|
+ <div
|
|
|
+ v-for="trackAirline in trackAirlines"
|
|
|
+ :key="trackAirline.flightNO"
|
|
|
+ class="goods-track-row"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ v-for="(trackAirport, index) in trackAirline.airports"
|
|
|
+ :key="trackAirport.airport"
|
|
|
+ class="goods-track-box"
|
|
|
+ :style="trackBoxStyle(trackAirline.airports, index)"
|
|
|
+ >
|
|
|
<div class="title flex-wrap">
|
|
|
- <span v-if="index === 0" class="title-span">航班号:{{ trackAirline.flightNO }}</span>
|
|
|
- <span class="title-span">{{ trackAirport.isDeparture ? '出港' : '进港' }}:{{
|
|
|
+ <span v-if="index === 0" class="title-span"
|
|
|
+ >航班号:{{ trackAirline.flightNO }}</span
|
|
|
+ >
|
|
|
+ <span class="title-span"
|
|
|
+ >{{ trackAirport.isDeparture ? '出港' : '进港' }}:{{
|
|
|
trackAirport.airport
|
|
|
- }}</span>
|
|
|
- <span class="title-span">日期:{{ trackAirline.flightDate }}</span>
|
|
|
+ }}</span
|
|
|
+ >
|
|
|
+ <span class="title-span"
|
|
|
+ >日期:{{ trackAirline.flightDate }}</span
|
|
|
+ >
|
|
|
</div>
|
|
|
<Steps :steps="trackAirport.trackSteps" />
|
|
|
</div>
|
|
@@ -40,7 +67,16 @@
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
|
<div class="goods-list">
|
|
|
- <SimpleTable ref="tableRef" :data="tableData" :columns="filteredColumns" scrollbar-always-on :row-class-name="rowClass" :cell-class-name="cellClass" :column-props="{ formatter }" @cell-click="cellClickHandler" />
|
|
|
+ <SimpleTable
|
|
|
+ ref="tableRef"
|
|
|
+ :data="tableData"
|
|
|
+ :columns="filteredColumns"
|
|
|
+ scrollbar-always-on
|
|
|
+ :row-class-name="rowClass"
|
|
|
+ :cell-class-name="cellClass"
|
|
|
+ :column-props="{ formatter }"
|
|
|
+ @cell-click="cellClickHandler"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -51,36 +87,36 @@ import Search from '@/components/search/index.vue'
|
|
|
import Steps from '@/components/steps/index.vue'
|
|
|
import ColumnSet from '../../components/ColumnSet/index.vue'
|
|
|
import SimpleTable from '@/components/SimpleTable/index.vue'
|
|
|
-import useTrackData from '../../hooks/useTrackData'
|
|
|
-import useTable from '../../hooks/useTable'
|
|
|
-import useTableColumnSet from '../../hooks/useTableColumnSet'
|
|
|
-import useTableExport from '../../hooks/useTableExport'
|
|
|
-import useTableStyle from '../../hooks/useTableStyle'
|
|
|
-import useTableCellClick from '../../hooks/useTableCellClick'
|
|
|
+import { useTrackData } from '../../hooks/useTrackData'
|
|
|
+import { useTable } from '../../hooks/useTable'
|
|
|
+import { useTableColumnSet } from '../../hooks/useTableColumnSet'
|
|
|
+import { useTableExport } from '../../hooks/useTableExport'
|
|
|
+import { useTableStyle } from '../../hooks/useTableStyle'
|
|
|
+import { useTableCellClick } from '../../hooks/useTableCellClick'
|
|
|
+import { useGoodsInfo } from './useGoodsInfo'
|
|
|
import { Query } from '@/api/webApi'
|
|
|
-import useGoodsInfo from './useGoodsInfo'
|
|
|
|
|
|
const props = defineProps({
|
|
|
name: {
|
|
|
type: String,
|
|
|
required: true,
|
|
|
},
|
|
|
-});
|
|
|
+})
|
|
|
|
|
|
-const route = useRoute();
|
|
|
-const { goodsNO, waybillNO } = route.query;
|
|
|
+const route = useRoute()
|
|
|
+const { goodsNO, waybillNO } = route.query
|
|
|
|
|
|
const { goodsInfoItems, goodsInfo } = useGoodsInfo(props.name, [
|
|
|
goodsNO as string,
|
|
|
])
|
|
|
|
|
|
interface Airline {
|
|
|
- C0: string; // 航班号
|
|
|
- C1: string; // 机场
|
|
|
- C2: string; // 航班日期
|
|
|
- C3: number; // 起飞/降落
|
|
|
+ C0: string // 航班号
|
|
|
+ C1: string // 机场
|
|
|
+ C2: string // 航班日期
|
|
|
+ C3: number // 起飞/降落
|
|
|
}
|
|
|
-const goodsAirlines = ref<Airline[]>([]);
|
|
|
+const goodsAirlines = ref<Airline[]>([])
|
|
|
const getGoodsAirlines = async () => {
|
|
|
try {
|
|
|
const {
|
|
@@ -90,15 +126,15 @@ const getGoodsAirlines = async () => {
|
|
|
} = await Query<Airline>({
|
|
|
id: DATACONTENT_ID.goodsAirline,
|
|
|
dataContent: [goodsNO],
|
|
|
- });
|
|
|
+ })
|
|
|
if (Number(code) !== 0) {
|
|
|
- throw new Error(message || "失败");
|
|
|
+ throw new Error(message || '失败')
|
|
|
}
|
|
|
- goodsAirlines.value = listValues;
|
|
|
+ goodsAirlines.value = listValues
|
|
|
} catch (error) {
|
|
|
- console.error(error);
|
|
|
+ console.error(error)
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
// onMounted(() => {
|
|
|
// getGoodsAirlines()
|
|
|
// })
|
|
@@ -111,34 +147,34 @@ const trackDataContentList = computed(() =>
|
|
|
isDeparture: C3,
|
|
|
dataContent: [waybillNO, goodsNO] as string[],
|
|
|
}))
|
|
|
-);
|
|
|
+)
|
|
|
const { trackAirlines, trackBoxStyle } = useTrackData(
|
|
|
props.name,
|
|
|
trackDataContentList
|
|
|
-);
|
|
|
+)
|
|
|
|
|
|
const dataContent = [waybillNO, goodsNO] as string[]
|
|
|
const { tableColumns, tableData } = useTable(`${props.name}Flight`, dataContent)
|
|
|
|
|
|
const search = (text: string) => {
|
|
|
- console.log(text);
|
|
|
-};
|
|
|
-const clear = () => {};
|
|
|
+ console.log(text)
|
|
|
+}
|
|
|
+const clear = () => {}
|
|
|
|
|
|
-const tableRef = ref<InstanceType<typeof SimpleTable> | null>(null);
|
|
|
-const { exportToExcel } = useTableExport();
|
|
|
+const tableRef = ref<InstanceType<typeof SimpleTable> | null>(null)
|
|
|
+const { exportToExcel } = useTableExport()
|
|
|
const downloadHandler = () => {
|
|
|
- const table = tableRef.value!.table!;
|
|
|
- exportToExcel({ table });
|
|
|
-};
|
|
|
+ const table = tableRef.value!.table!
|
|
|
+ exportToExcel({ table })
|
|
|
+}
|
|
|
const formatter = (row, column, cellValue, index) => {
|
|
|
- if (column.property === "C7") {
|
|
|
- return String(cellValue ?? "").replace(" ", "\n");
|
|
|
+ if (column.property === 'C7') {
|
|
|
+ return String(cellValue ?? '').replace(' ', '\n')
|
|
|
}
|
|
|
- return cellValue;
|
|
|
-};
|
|
|
+ return cellValue
|
|
|
+}
|
|
|
|
|
|
-const { filteredColumns, columnChecked } = useTableColumnSet(tableColumns);
|
|
|
+const { filteredColumns, columnChecked } = useTableColumnSet(tableColumns)
|
|
|
|
|
|
const { rowClass, cellClass } = useTableStyle(`${props.name}Flight`)
|
|
|
|