Commit f36a701d by wusiyi

feat: 运输中添加延迟时间

parent fb5810eb
......@@ -81,6 +81,7 @@ export interface PodUsOrderListData {
logisticsWayName?: string
url?: string | null
tiffUrl?: string | null
lanshouAddress?: string | null
}
export interface ProductList {
id: number
......
......@@ -133,7 +133,7 @@
>
<el-option :value="1" label="创建时间"></el-option>
<el-option :value="2" label="确认时间"></el-option>
<el-option :value="3" label="完成时间"></el-option>
<el-option :value="3" label="发货时间"></el-option>
</el-select>
<el-date-picker
v-model="timeRange"
......@@ -1402,7 +1402,7 @@
{{ row.receiverPostCode }}
</span>
</div>
<div class="order-detail-item">
<!-- <div class="order-detail-item">
<span class="order-detail-item-label">收货地址:</span>
<span
class="order-detail-item-value"
......@@ -1410,7 +1410,7 @@
>
{{ row.lanshouAddress }}
</span>
</div>
</div> -->
</div>
</template>
<template #price="{ row }">
......@@ -1451,9 +1451,29 @@
<el-timeline-item
:color="row.finishTime ? '#67C23A' : ''"
:timestamp="row.finishTime"
>完成时间
>发货时间
</el-timeline-item>
<el-timeline-item
v-if="status === 'IN_TRANSIT'"
:color="row.finishTime ? '#F56C6C' : ''"
>
{{
`延迟${(() => {
if (!row.finishTime) return ''
const finishDate = new Date(row.finishTime)
const today = new Date()
const diffTime = today.getTime() - finishDate.getTime()
const diffDays = Math.floor(
diffTime / (1000 * 60 * 60 * 24),
)
return diffDays
})()}
天`
}}
</el-timeline-item>
</el-timeline>
<div v-if="status === 'IN_TRANSIT'" style="color: #f56c6c"></div>
<!-- <div class="order-time-box">
<div class="order-time-item">
<span class="order-time-item-label">创建时间:</span>
......@@ -1586,7 +1606,7 @@
<ElButton
link
type="primary"
@click="operationLog(row.id, null)"
@click="operationLog(row.id, null, row)"
>
操作日志
</ElButton>
......@@ -1751,7 +1771,7 @@
<Icon
name="caozuorizhi"
style="width: 28px; height: 28px"
@click="(e: MouseEvent) => operationLog(cardItem.podJomallOrderUsId, e)"
@click="(e: MouseEvent) => operationLog(cardItem.podJomallOrderUsId, e, row)"
>
<template #title>
<title>操作日志</title>
......@@ -2095,6 +2115,10 @@
</el-button>
</div>
</div>
<div style="margin-top: 10px; color: #606266">
<span>地址:</span>
<span>{{ currentItem?.lanshouAddress }}</span>
</div>
</template>
<LogList :log-list="logList" />
</el-dialog>
......@@ -2544,6 +2568,7 @@ const currentRow = ref<AddressInfo>({
receiverAddress2: '',
receiverPostCode: '',
})
const currentItem = ref<PodUsOrderListData | null>(null)
const exportLoading = ref(false)
const exportVisible = ref(false)
const exportForm = ref({
......@@ -2691,7 +2716,6 @@ const trackRegisterCount = ref<
>([])
const userMarkList = ref<string[]>([])
const selection = ref<PodUsOrderListData[]>([])
const currentItem = ref<PodUsOrderListData | null>(null)
const pickerOptions = {
shortcuts: [
{
......@@ -2972,7 +2996,7 @@ const tableColumns = computed(() => {
align: 'center',
},
{
label: '完成时间',
label: '发货时间',
width: 180,
prop: 'finishTime',
slot: 'finishTime',
......@@ -3073,11 +3097,6 @@ const tableColumns = computed(() => {
if (trackRegisterIndex >= 0) {
arr.splice(trackRegisterIndex, 1)
}
const track17Index = arr.findIndex((item) => item.prop === 'track17Status')
if (track17Index >= 0) {
arr.splice(track17Index, 1)
}
} else {
if (waitTrackStatus.value !== 1) {
const trackRegisterIndex = arr.findIndex(
......@@ -3150,7 +3169,7 @@ const asyncOrderAddress = async () => {
}
}
const changeTab = (item: Tab) => {
const changeTab = async (item: Tab) => {
status.value = item.status || ''
localStorage.setItem('podUsStatus', item.status as string)
......@@ -3158,6 +3177,12 @@ const changeTab = (item: Tab) => {
if (item.status === 'INTERCEPTED' && !interceptCurrent.value) {
interceptCurrent.value = 1
}
if (item.status === 'WAIT_TRACK') {
await getRegistData()
}
if (item.status === 'INTERCEPTED') {
await loadTabData()
}
selection.value = []
cardSelection.value = []
......@@ -3182,14 +3207,19 @@ const onCellClassName = ({ column }: { column: Column }) => {
}
}
// 获取注册列表tab信息
const getRegistData = async () => {
const res = await countTrackRegisterApi()
trackRegisterCount.value = res.data
}
// 获取Tab信息
const loadTabData = async () => {
try {
const res = await getOrderTabData()
tabsNav.value = res.data
if (status.value === 'WAIT_TRACK') {
const res = await countTrackRegisterApi()
trackRegisterCount.value = res.data
await getRegistData()
}
// 获取拦截数量
......@@ -4121,7 +4151,14 @@ const logTrajectory = async (row: { id: string }) => {
const logList = ref<LogListData[]>([])
const logVisible = ref(false)
const operationLog = async (id: number, e: MouseEvent | null) => {
const operationLog = async (
id: number,
e: MouseEvent | null,
row: PodUsOrderListData,
) => {
currentItem.value = row
console.log(currentItem.value)
e && e.stopPropagation()
try {
const res = await getOperationLogApi(id)
......
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