Commit 0a84ab31 by linjinhong

添加物流轨迹

parent eac2d845
...@@ -553,3 +553,7 @@ export function completeDeliveryApi(params: { ...@@ -553,3 +553,7 @@ export function completeDeliveryApi(params: {
params, params,
) )
} }
// 物流轨迹
export function get17TrackInfoApi(params: { id: string | number }) {
return axios.get(`factory/podJomallOrderUs/get17TrackInfo`, { params })
}
...@@ -519,6 +519,7 @@ ...@@ -519,6 +519,7 @@
<ElButton type="warning" @click="arrangeFinish">排单完成</ElButton> <ElButton type="warning" @click="arrangeFinish">排单完成</ElButton>
</span> </span>
</ElFormItem> </ElFormItem>
<ElFormItem <ElFormItem
v-if="status !== 'BATCH_DOWNLOAD' && status !== 'WAIT_SHIPMENT'" v-if="status !== 'BATCH_DOWNLOAD' && status !== 'WAIT_SHIPMENT'"
> >
...@@ -1530,6 +1531,14 @@ ...@@ -1530,6 +1531,14 @@
刷新地址 刷新地址
</ElButton> </ElButton>
</span> </span>
<span
v-if="status === 'IN_TRANSIT' || status === 'COMPLETE'"
class="operate-item"
>
<ElButton link type="primary" @click="logTrajectory(row)"
>物流轨迹</ElButton
>
</span>
</div> </div>
</template> </template>
</TableView> </TableView>
...@@ -2278,6 +2287,21 @@ ...@@ -2278,6 +2287,21 @@
<el-dialog v-model="dialogVisible" width="35%"> <el-dialog v-model="dialogVisible" width="35%">
<img :src="dialogImageUrl" alt="商品预览图片" /> <img :src="dialogImageUrl" alt="商品预览图片" />
</el-dialog> </el-dialog>
<el-dialog title="物流轨迹" v-model="timeLineVisible" width="1000px">
<el-timeline>
<el-timeline-item
v-for="(item, index) in timeLine"
:key="index"
:timestamp="item.time_utc"
placement="top"
:type="index == 0 ? 'primary' : ''"
>
<el-card>
{{ item.description }}
</el-card>
</el-timeline-item>
</el-timeline>
</el-dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getUserMarkList } from '@/api/common' import { getUserMarkList } from '@/api/common'
...@@ -2345,6 +2369,7 @@ import { ...@@ -2345,6 +2369,7 @@ import {
rejectToApi, rejectToApi,
statusPushApi, statusPushApi,
completeDeliveryApi, completeDeliveryApi,
get17TrackInfoApi,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api' import { BaseRespData } from '@/types/api'
...@@ -3852,6 +3877,24 @@ const arrangeFinish = async () => { ...@@ -3852,6 +3877,24 @@ const arrangeFinish = async () => {
loading.close() loading.close()
} }
} }
interface timeLineType {
time_iso?: string
time_utc?: string
description?: string
}
const timeLineVisible = ref(false)
const timeLine = ref<timeLineType[]>([])
const logTrajectory = async (row: { id: string }) => {
const { data } = await get17TrackInfoApi({ id: row.id })
const res = data.accepted[0]?.track_info?.tracking
timeLine.value = res?.providers[0]?.events
// if (data.rejected?.length) {
// console.log(data.rejected[0].error.message)
// throw Error(data.rejected[0].error.message)
// }
timeLineVisible.value = true
}
const logList = ref<LogListData[]>([]) const logList = ref<LogListData[]>([])
const logVisible = ref(false) const logVisible = ref(false)
const operationLog = async (id: number, e: MouseEvent | null) => { const operationLog = async (id: number, e: MouseEvent | null) => {
...@@ -5316,6 +5359,11 @@ useRouter().beforeEach((to, from, next) => { ...@@ -5316,6 +5359,11 @@ useRouter().beforeEach((to, from, next) => {
} }
.el-timeline-item__wrapper { .el-timeline-item__wrapper {
padding-left: 15px; padding-left: 15px;
top: -6px; top: -4px;
}
.el-timeline
> .el-timeline-item:first-child
.el-timeline-item__timestamp.is-top {
color: #409eff;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment