This commit is contained in:
zlwu committed 2026-07-05 10:07:24 +08:00
1 parent 33c038b8d9
commit 54b27a3f0e
253 files changed
+30060 -14298

No files matched your search

+148 -10
View File
@@ -1,7 +1,7 @@
<template>
<PublicMobileShell>
<div class="public-pl-site-page">
<van-nav-bar title="运输现场" :border="false" />
<van-nav-bar title="运输现场" :border="false" class="site-nav-bar" />
<van-loading v-if="loading" vertical class="page-loading">加载中...</van-loading>
<van-empty v-else-if="errorMessage" :description="errorMessage" />
@@ -11,11 +11,70 @@
<van-cell title="业务类型" :value="page.businessType || '—'" />
<van-cell title="日期" :value="page.date || '—'" />
<van-cell title="往来单位" :value="page.partnerCompany || '—'" />
<van-cell title="产品" :value="productDisplay" class="product-cell" />
<van-cell title="数量(吨)" :value="String(page.quantity ?? '—')" />
<van-cell title="车牌" :value="page.vehicleNo || '—'" />
<van-cell title="计划号" :value="page.planNo || '—'" />
<van-cell v-if="page.remark" title="备注" :value="page.remark" class="remark-cell" />
<van-cell v-if="page.remark" title="备注" :value="page.remark" class="multiline-cell" />
</van-cell-group>
<van-cell-group inset class="section-card" title="取货信息">
<van-cell title="取货地址" class="address-cell multiline-cell">
<template #value>
<div class="address-cell__content">
<span class="address-cell__text">{{ page.pickupAddress || '—' }}</span>
<van-button
v-if="pickupNavUrl"
size="mini"
type="primary"
round
class="address-nav-btn"
@click="openNavigation(pickupNavUrl)"
>
导航
</van-button>
</div>
</template>
</van-cell>
<van-cell title="取货时间" :value="formatDateTime(page.pickupTime)" />
<van-cell
title="注意事项"
:value="page.pickupNotes || '—'"
class="multiline-cell"
/>
</van-cell-group>
<van-cell-group inset class="section-card" title="送货信息">
<van-cell title="送货地址" class="address-cell multiline-cell">
<template #value>
<div class="address-cell__content">
<span class="address-cell__text">{{ deliveryAddressDisplay }}</span>
<van-button
v-if="destinationNavUrl"
size="mini"
type="primary"
round
class="address-nav-btn"
@click="openNavigation(destinationNavUrl)"
>
导航
</van-button>
</div>
</template>
</van-cell>
<van-cell title="送达时间" :value="formatDateTime(page.deliveryTime)" />
<van-cell
title="注意事项"
:value="page.destinationNotes || '—'"
class="multiline-cell"
/>
</van-cell-group>
<van-cell-group v-if="page.products.length" inset class="section-card" title="产品明细">
<van-cell
v-for="(item, idx) in page.products"
:key="idx"
:title="formatPublicTransportProductLine(item)"
class="product-cell"
/>
</van-cell-group>
<van-cell-group inset class="section-card" title="回执上传">
@@ -61,6 +120,8 @@
import { showFailToast, showSuccessToast } from 'vant'
import { publicPlSiteApi, type PublicTransportSitePage } from '@/api/pl/public-site'
import PublicMobileShell from '@/layouts/PublicMobileShell.vue'
import { buildAmapNavigationUrl } from '@/utils/amap/navigation'
import { formatPublicTransportProductLine } from '@/utils/pl-display'
import 'vant/es/toast/style'
import '@/styles/public-mobile-vant.scss'
@@ -76,12 +137,39 @@
const feedbackImages = ref<string[]>([])
const uploaderFiles = ref<UploaderFileListItem[]>([])
const productDisplay = computed(() => {
const deliveryAddressDisplay = computed(() => {
if (!page.value) return '—'
const spec = page.value.specification?.trim()
return spec ? `${page.value.product}(${spec})` : page.value.product
return page.value.destinationAddress || page.value.destinationName || '—'
})
const pickupNavUrl = computed(() => {
if (!page.value) return null
return buildAmapNavigationUrl(
page.value.pickupLng,
page.value.pickupLat,
page.value.pickupAddress || '取货点'
)
})
const destinationNavUrl = computed(() => {
if (!page.value) return null
return buildAmapNavigationUrl(
page.value.destinationLng,
page.value.destinationLat,
page.value.destinationAddress || page.value.destinationName || '送货点'
)
})
function openNavigation(url: string) {
window.location.href = url
}
function formatDateTime(value?: string) {
if (!value) return '—'
const normalized = value.replace('T', ' ')
return normalized.length > 16 ? normalized.slice(0, 16) : normalized
}
function resolveFileUrl(url: string) {
if (!url) return ''
if (/^https?:\/\//i.test(url)) return url
@@ -169,15 +257,65 @@
padding: 48px 0;
}
.site-nav-bar {
margin: -12px -16px 12px;
border-radius: 0 0 12px 12px;
overflow: hidden;
:deep(.van-nav-bar) {
background: #059669;
}
:deep(.van-nav-bar__title) {
color: #fff;
font-weight: 600;
}
}
.section-card {
margin-bottom: 12px;
margin-bottom: 10px;
}
.uploader-wrap {
padding: 12px 16px 16px;
padding: 8px 14px 12px;
}
.remark-cell :deep(.van-cell__value) {
.multiline-cell :deep(.van-cell__value) {
text-align: left;
line-height: 1.35;
white-space: normal;
}
.address-cell__content {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 4px 8px;
justify-content: flex-start;
}
.address-cell__text {
line-height: 1.35;
color: #1e293b;
font-weight: 600;
}
.address-nav-btn {
flex-shrink: 0;
height: 22px;
padding: 0 8px;
font-size: 11px;
line-height: 22px;
}
.product-cell :deep(.van-cell__title) {
color: #1e293b;
font-weight: 600;
line-height: 1.35;
white-space: normal;
}
.product-cell :deep(.van-cell__value) {
display: none;
}
</style>
+147 -47
View File
@@ -1,7 +1,7 @@
<template>
<PublicMobileShell>
<div class="public-pl-transport-page">
<van-nav-bar title="运输计划" :border="false" />
<van-nav-bar title="运输计划" :border="false" class="transport-nav-bar" />
<van-loading v-if="loading" vertical class="page-loading">加载中...</van-loading>
<van-empty v-else-if="errorMessage" :description="errorMessage" />
@@ -12,43 +12,79 @@
<van-cell title="计划日期" :value="page.planDate || '—'" />
<van-cell title="车牌" :value="page.licensePlate || '—'" />
<van-cell title="司机" :value="driverDisplay" />
<van-cell title="路线" :value="routeDisplay" class="route-cell" />
</van-cell-group>
<van-cell-group
v-if="pickupNavUrl || destinationNavUrl"
v-if="otherPersonnelDisplay.length"
inset
class="section-card nav-card"
title="导航"
class="section-card"
title="其他人员"
>
<div class="nav-actions">
<van-button
v-if="pickupNavUrl"
type="primary"
block
round
@click="openNavigation(pickupNavUrl)"
>
导航到取货点
</van-button>
<van-button
v-if="destinationNavUrl"
type="primary"
plain
block
round
@click="openNavigation(destinationNavUrl)"
>
导航到送货点
</van-button>
</div>
<van-cell
v-for="(person, idx) in otherPersonnelDisplay"
:key="`${person.personnelName}-${idx}`"
:title="formatPersonnelLine(person)"
class="personnel-cell"
/>
</van-cell-group>
<van-cell-group inset class="section-card" title="取货信息">
<van-cell title="取货地址" class="address-cell multiline-cell">
<template #value>
<div class="address-cell__content">
<span class="address-cell__text">{{ page.pickupAddress || '—' }}</span>
<van-button
v-if="pickupNavUrl"
size="mini"
type="primary"
round
class="address-nav-btn"
@click="openNavigation(pickupNavUrl)"
>
导航
</van-button>
</div>
</template>
</van-cell>
<van-cell title="取货时间" :value="formatDateTime(page.pickupTime)" />
<van-cell
title="注意事项"
:value="page.pickupNotes || '—'"
class="multiline-cell"
/>
</van-cell-group>
<van-cell-group inset class="section-card" title="送货信息">
<van-cell title="送货地址" class="address-cell multiline-cell">
<template #value>
<div class="address-cell__content">
<span class="address-cell__text">{{ deliveryAddressDisplay }}</span>
<van-button
v-if="destinationNavUrl"
size="mini"
type="primary"
round
class="address-nav-btn"
@click="openNavigation(destinationNavUrl)"
>
导航
</van-button>
</div>
</template>
</van-cell>
<van-cell title="送达时间" :value="formatDateTime(page.deliveryTime)" />
<van-cell
title="注意事项"
:value="page.destinationNotes || '—'"
class="multiline-cell"
/>
</van-cell-group>
<van-cell-group v-if="page.products.length" inset class="section-card" title="产品明细">
<van-cell
v-for="(item, idx) in page.products"
:key="idx"
:title="formatProductLine(item)"
:title="formatPublicTransportProductLine(item)"
class="product-cell"
/>
</van-cell-group>
@@ -98,10 +134,11 @@
import {
publicTransportApi,
type PublicTransportPage,
type PublicTransportProduct
type PublicTransportPersonnel
} from '@/api/pl/public-transport'
import PublicMobileShell from '@/layouts/PublicMobileShell.vue'
import { buildAmapNavigationUrl } from '@/utils/amap/navigation'
import { formatPublicTransportProductLine } from '@/utils/pl-display'
import 'vant/es/toast/style'
import '@/styles/public-mobile-vant.scss'
@@ -117,6 +154,11 @@
const feedbackImages = ref<string[]>([])
const uploaderFiles = ref<UploaderFileListItem[]>([])
const roleLabelMap: Record<string, string> = {
driver: '司机',
escort: '押运员'
}
const driverDisplay = computed(() => {
if (!page.value) return '—'
const name = page.value.driverName || '—'
@@ -124,9 +166,11 @@
return `${name}${phone}`.trim()
})
const routeDisplay = computed(() => {
const otherPersonnelDisplay = computed(() => page.value?.otherPersonnel || [])
const deliveryAddressDisplay = computed(() => {
if (!page.value) return '—'
return `${page.value.pickupAddress || '—'} → ${page.value.destinationAddress || '—'}`
return page.value.destinationAddress || page.value.destinationName || '—'
})
const pickupNavUrl = computed(() => {
@@ -143,7 +187,7 @@
return buildAmapNavigationUrl(
page.value.destinationLng,
page.value.destinationLat,
page.value.destinationAddress || '送货点'
page.value.destinationAddress || page.value.destinationName || '送货点'
)
})
@@ -151,18 +195,16 @@
window.location.href = url
}
function formatProductQuantity(value?: number) {
if (value == null || Number.isNaN(Number(value))) return '—'
const num = Number(value)
return Number.isInteger(num) ? String(num) : String(num)
function formatDateTime(value?: string) {
if (!value) return '—'
const normalized = value.replace('T', ' ')
return normalized.length > 16 ? normalized.slice(0, 16) : normalized
}
function formatProductLine(item: PublicTransportProduct) {
const name = item.productName?.trim() || '—'
const spec = (item.model || item.packageSpec || '—').trim() || '—'
const qty = formatProductQuantity(item.quantity)
const unit = item.unit || '吨'
return `${name}(${spec},${qty} ${unit})`
function formatPersonnelLine(person: PublicTransportPersonnel) {
const role = roleLabelMap[person.role || ''] || person.role || '人员'
const phone = person.phoneNo ? ` ${person.phoneNo}` : ''
return `${person.personnelName || '—'}(${role})${phone}`.trim()
}
function resolveFileUrl(url: string) {
@@ -252,18 +294,76 @@
padding: 48px 0;
}
.transport-nav-bar {
margin: -12px -16px 12px;
border-radius: 0 0 12px 12px;
overflow: hidden;
:deep(.van-nav-bar) {
background: #059669;
}
:deep(.van-nav-bar__title) {
color: #fff;
font-weight: 600;
}
}
.section-card {
margin-bottom: 12px;
margin-bottom: 10px;
}
.uploader-wrap {
padding: 12px 16px 16px;
padding: 8px 14px 12px;
}
.nav-actions {
.multiline-cell :deep(.van-cell__value) {
text-align: left;
line-height: 1.35;
white-space: normal;
}
.address-cell__content {
display: flex;
flex-direction: column;
gap: 10px;
padding: 12px 16px 16px;
flex-wrap: wrap;
align-items: center;
gap: 4px 8px;
justify-content: flex-start;
}
.address-cell__text {
line-height: 1.35;
color: #1e293b;
font-weight: 600;
}
.address-nav-btn {
flex-shrink: 0;
height: 22px;
padding: 0 8px;
font-size: 11px;
line-height: 22px;
}
.personnel-cell :deep(.van-cell__title) {
color: #1e293b;
font-weight: 600;
line-height: 1.35;
white-space: normal;
}
.personnel-cell :deep(.van-cell__value) {
display: none;
}
.product-cell :deep(.van-cell__title) {
color: #1e293b;
font-weight: 600;
line-height: 1.35;
white-space: normal;
}
.product-cell :deep(.van-cell__value) {
display: none;
}
</style>