feat(web-admin): show brand qty on transport tab and highlight supplement actions
Expose driver per-product feedback on transport read, display site/driver brand summaries in the transport tab, move supplement buttons to section headers with primary highlight, and wire brand chips into IO/driver edit. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
b7236329c2
commit
5c323f32c2
7 files changed
+510
-118
No files matched your search
@@ -125,7 +125,8 @@ import {
|
||||
planApi,
|
||||
type Plan,
|
||||
type PlanDriverFeedbackUpdateBody,
|
||||
type PlanProduct
|
||||
type PlanProduct,
|
||||
type TransportDriverProductFeedback
|
||||
} from '@/api/pl'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { pickBxData } from '@/utils/http/bx'
|
||||
@@ -152,6 +153,7 @@ const props = defineProps<{
|
||||
feedbackImages?: string | string[] | null
|
||||
feedbackTime?: string | null
|
||||
feedbackQty?: number | null
|
||||
driverProductFeedbacks?: TransportDriverProductFeedback[] | null
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -212,23 +214,40 @@ function resolveUnitLabel(unit?: string) {
|
||||
function mapBrandQtyRows(
|
||||
prod: PlanProduct,
|
||||
brandOptions: BrandOption[],
|
||||
seedActualQty: number
|
||||
seedActualQty: number,
|
||||
savedBrandQtys?: Array<{ brandId: string; brandName?: string; qty: number }> | null
|
||||
): BrandQtyRow[] {
|
||||
const savedPositive = (savedBrandQtys || [])
|
||||
.filter(r => Number(r.qty) > 0)
|
||||
.map(r => ({
|
||||
brandId: r.brandId,
|
||||
brandName: r.brandName || '',
|
||||
qty: Number(r.qty)
|
||||
}))
|
||||
if (prod.brandMode === 'required') {
|
||||
const brandId = prod.brandId || brandOptions[0]?.brandId || ''
|
||||
const brandName =
|
||||
prod.brandName ||
|
||||
brandOptions.find(o => o.brandId === brandId)?.brandName ||
|
||||
'指定品牌'
|
||||
return brandId ? [{ brandId, brandName, qty: seedActualQty }] : []
|
||||
if (!brandId) return []
|
||||
const saved = savedPositive.find(r => r.brandId === brandId)
|
||||
return [{ brandId, brandName, qty: saved ? saved.qty : seedActualQty }]
|
||||
}
|
||||
if (prod.brandMode === 'any') {
|
||||
const qtyMap = new Map(savedPositive.map(r => [r.brandId, r.qty]))
|
||||
const rows = brandOptions.map(opt => ({
|
||||
brandId: opt.brandId,
|
||||
brandName: opt.brandName,
|
||||
qty: 0
|
||||
qty: qtyMap.get(opt.brandId) ?? 0
|
||||
}))
|
||||
if (rows.length === 1) {
|
||||
// 保存过但不在 options 里的品牌也补回
|
||||
for (const saved of savedPositive) {
|
||||
if (!rows.some(r => r.brandId === saved.brandId)) {
|
||||
rows.push(saved)
|
||||
}
|
||||
}
|
||||
if (!savedPositive.length && rows.length === 1) {
|
||||
rows[0].qty = seedActualQty
|
||||
}
|
||||
return rows
|
||||
@@ -255,8 +274,10 @@ async function loadBrandOptions(productId: string): Promise<BrandOption[]> {
|
||||
function resolveSeedActualQty(
|
||||
prod: PlanProduct,
|
||||
transportFeedbackQty: number | null | undefined,
|
||||
productCount: number
|
||||
productCount: number,
|
||||
savedFeedback?: TransportDriverProductFeedback | null
|
||||
) {
|
||||
if (savedFeedback?.actualQty != null) return Number(savedFeedback.actualQty)
|
||||
if (prod.actualQty != null) return Number(prod.actualQty)
|
||||
if (productCount === 1 && transportFeedbackQty != null) {
|
||||
return Number(transportFeedbackQty)
|
||||
@@ -266,6 +287,9 @@ function resolveSeedActualQty(
|
||||
|
||||
async function buildProductRows(plan: Plan, transportFeedbackQty?: number | null) {
|
||||
const products = Array.isArray(plan.products) ? plan.products : []
|
||||
const savedByPlanProductId = new Map(
|
||||
(props.driverProductFeedbacks || []).map(item => [item.planProductId, item])
|
||||
)
|
||||
const brandOptionMap = new Map<string, BrandOption[]>()
|
||||
|
||||
await Promise.all(
|
||||
@@ -283,8 +307,19 @@ async function buildProductRows(plan: Plan, transportFeedbackQty?: number | null
|
||||
: prod.brandId
|
||||
? [{ brandId: prod.brandId, brandName: prod.brandName || '指定品牌' }]
|
||||
: []
|
||||
const seedActualQty = resolveSeedActualQty(prod, transportFeedbackQty, products.length)
|
||||
const brandQtyRows = mapBrandQtyRows(prod, brandOptions, seedActualQty)
|
||||
const savedFeedback = savedByPlanProductId.get(prod.id) || null
|
||||
const seedActualQty = resolveSeedActualQty(
|
||||
prod,
|
||||
transportFeedbackQty,
|
||||
products.length,
|
||||
savedFeedback
|
||||
)
|
||||
const brandQtyRows = mapBrandQtyRows(
|
||||
prod,
|
||||
brandOptions,
|
||||
seedActualQty,
|
||||
savedFeedback?.brandQtys
|
||||
)
|
||||
const actualQty = prod.brandMode
|
||||
? Number(brandQtySum(brandQtyRows).toFixed(3))
|
||||
: seedActualQty
|
||||
|
||||
@@ -119,58 +119,81 @@
|
||||
<section class="pl-plan-form-section pl-plan-form-section--plain">
|
||||
<div class="pl-plan-form-section-head">
|
||||
<h3 class="pl-plan-form-section-title">司机回传信息</h3>
|
||||
<el-button
|
||||
v-if="feedbackEditable"
|
||||
class="btn-op-item"
|
||||
:disabled="!canEditDriverFeedback"
|
||||
@click="openDriverFeedbackDialog"
|
||||
>
|
||||
<el-icon><Edit /></el-icon>
|
||||
{{ hasDriverFeedback ? '编辑' : '补充' }}
|
||||
</el-button>
|
||||
<div v-if="feedbackEditable" class="pl-plan-form-section-actions">
|
||||
<el-button
|
||||
type="primary"
|
||||
class="btn-op-item"
|
||||
:disabled="!canEditDriverFeedback"
|
||||
@click="openDriverFeedbackDialog"
|
||||
>
|
||||
<el-icon><Edit /></el-icon>
|
||||
{{ hasDriverFeedback ? '编辑' : '补充' }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="arrangeDriverUrl"
|
||||
class="btn-op-item"
|
||||
@click="copyArrangeDriverUrl"
|
||||
>
|
||||
<el-icon><CopyDocument /></el-icon>
|
||||
复制司机链接
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="!hasDriverFeedback" class="pl-plan-form-empty-hint">暂无司机回传</p>
|
||||
<div v-else class="view-subtable-wrap">
|
||||
<el-table :data="driverFeedbackTableRows" class="view-subtable list-table" stripe>
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="feedbackTime"
|
||||
label="回传时间"
|
||||
min-width="160"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="feedbackQty"
|
||||
label="回传数量"
|
||||
min-width="100"
|
||||
align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
{{ row.feedbackQty ?? '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="feedbackRemark"
|
||||
label="回传备注"
|
||||
min-width="180"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="回传附件" min-width="140" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<div v-if="row.feedbackImages" class="pl-plan-feedback-table__attachment">
|
||||
<AttachmentUploadField :model-value="row.feedbackImages" disabled compact />
|
||||
</div>
|
||||
<span v-else class="pl-plan-feedback-table__empty-cell">—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<template v-else>
|
||||
<div class="view-subtable-wrap">
|
||||
<el-table :data="driverFeedbackTableRows" class="view-subtable list-table" stripe>
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="productName"
|
||||
label="产品"
|
||||
min-width="140"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="actualQty"
|
||||
label="回传数量"
|
||||
min-width="100"
|
||||
align="right"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
{{ row.actualQty ?? '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="品牌数量" min-width="180" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{ row.brandSummary || '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="pl-plan-io-site-meta">
|
||||
<div class="pl-plan-io-site-meta__item">
|
||||
<p class="pl-plan-form-empty-hint" style="margin-bottom: 6px">回传时间</p>
|
||||
<p class="pl-plan-view-remark">{{ displayFeedbackTime }}</p>
|
||||
</div>
|
||||
<div class="pl-plan-io-site-meta__item">
|
||||
<p class="pl-plan-form-empty-hint" style="margin-bottom: 6px">回传备注</p>
|
||||
<p class="pl-plan-view-remark">{{ transport?.feedbackRemark || '—' }}</p>
|
||||
</div>
|
||||
<div class="pl-plan-io-site-meta__item">
|
||||
<p class="pl-plan-form-empty-hint" style="margin-bottom: 6px">回传附件</p>
|
||||
<AttachmentUploadField
|
||||
v-if="feedbackImageCsv"
|
||||
:model-value="feedbackImageCsv"
|
||||
disabled
|
||||
compact
|
||||
/>
|
||||
<span v-else class="pl-plan-feedback-table__empty-cell">—</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</section>
|
||||
|
||||
<section class="pl-plan-form-section pl-plan-form-section--plain">
|
||||
@@ -178,14 +201,25 @@
|
||||
<h3 class="pl-plan-form-section-title">
|
||||
{{ ioOrder ? (ioOrder.kind === 'inbound' ? '入库单回传' : '出库单回传') : '现场回传信息' }}
|
||||
</h3>
|
||||
<el-button
|
||||
v-if="ioOrder?.siteUrl"
|
||||
class="btn-op-item"
|
||||
@click="copyArrangeSiteUrl(ioOrder.siteUrl)"
|
||||
>
|
||||
<el-icon><CopyDocument /></el-icon>
|
||||
复制现场链接
|
||||
</el-button>
|
||||
<div v-if="ioOrder" class="pl-plan-form-section-actions">
|
||||
<el-button
|
||||
v-if="feedbackEditable && ioOrder.status !== 'voided'"
|
||||
type="primary"
|
||||
class="btn-op-item"
|
||||
@click="openIoOrderEditDialog"
|
||||
>
|
||||
<el-icon><Edit /></el-icon>
|
||||
{{ ioOrderHasFeedback ? '编辑' : '补充' }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="ioOrder.siteUrl"
|
||||
class="btn-op-item"
|
||||
@click="copyArrangeSiteUrl(ioOrder.siteUrl)"
|
||||
>
|
||||
<el-icon><CopyDocument /></el-icon>
|
||||
复制现场链接
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 新链路:入库/出库单权威展示 -->
|
||||
<template v-if="ioOrder">
|
||||
@@ -201,6 +235,11 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="planQty" label="计划数量" min-width="100" align="right" />
|
||||
<el-table-column prop="actualQty" label="实际数量" min-width="100" align="right" />
|
||||
<el-table-column label="品牌数量" min-width="180" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{ resolveSiteBrandSummary(row) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="packageSpec" label="包装规格" min-width="110" show-overflow-tooltip />
|
||||
<el-table-column prop="remark" label="备注" min-width="120" show-overflow-tooltip />
|
||||
</el-table>
|
||||
@@ -221,12 +260,6 @@
|
||||
<span v-else class="pl-plan-feedback-table__empty-cell">—</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="feedbackEditable && ioOrder.status !== 'voided'" style="margin-top: 12px">
|
||||
<el-button @click="openIoOrderEditDialog">
|
||||
<el-icon><Edit /></el-icon>
|
||||
{{ ioOrderHasFeedback ? '编辑' : '补充' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 旧链路:按产品现场 link -->
|
||||
<template v-else>
|
||||
@@ -474,6 +507,7 @@
|
||||
:feedback-images="transport?.feedbackImages"
|
||||
:feedback-time="transport?.feedbackTime"
|
||||
:feedback-qty="transport?.feedbackQty"
|
||||
:driver-product-feedbacks="transport?.driverProductFeedbacks"
|
||||
@success="handleFeedbackSaved"
|
||||
/>
|
||||
<PlPlanSiteFeedbackDialog
|
||||
@@ -499,22 +533,49 @@
|
||||
>
|
||||
<el-form v-if="ioOrderEditForm" label-position="top">
|
||||
<el-form-item label="产品实际数量">
|
||||
<el-table :data="ioOrderEditForm.items || []" size="small" border>
|
||||
<el-table-column prop="productNo" label="产品编码" min-width="110" show-overflow-tooltip />
|
||||
<el-table-column prop="productName" label="产品名称" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="specification" label="型号/规格" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="单位" min-width="72" align="center">
|
||||
<template #default="{ row }">{{ row.unitLabel || row.unit || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="planQty" label="计划数量" min-width="100" align="right" />
|
||||
<el-table-column label="实际数量" min-width="120">
|
||||
<template #default="{ row }">
|
||||
<el-input-number v-model="row.actualQty" :min="0" :precision="3" :controls="false" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="packageSpec" label="包装规格" min-width="110" show-overflow-tooltip />
|
||||
<el-table-column prop="remark" label="备注" min-width="120" show-overflow-tooltip />
|
||||
</el-table>
|
||||
<div
|
||||
v-for="(row, idx) in ioOrderEditForm.items || []"
|
||||
:key="row.id"
|
||||
class="pl-io-order-edit-item"
|
||||
>
|
||||
<div class="pl-io-order-edit-item__head">
|
||||
<span class="pl-io-order-edit-item__name">{{ row.productName || '产品' }}</span>
|
||||
<span class="pl-io-order-edit-item__badge">
|
||||
产品 {{ idx + 1 }}/{{ ioOrderEditForm.items?.length || 0 }}
|
||||
</span>
|
||||
</div>
|
||||
<el-table :data="[row]" size="small" border class="pl-io-order-edit-item__table">
|
||||
<el-table-column prop="productNo" label="产品编码" min-width="110" show-overflow-tooltip />
|
||||
<el-table-column prop="specification" label="型号/规格" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="单位" min-width="72" align="center">
|
||||
<template #default="{ row: itemRow }">{{ itemRow.unitLabel || itemRow.unit || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="planQty" label="计划数量" min-width="100" align="right" />
|
||||
<el-table-column label="实际数量" min-width="120">
|
||||
<template #default="{ row: itemRow }">
|
||||
<el-input-number
|
||||
v-model="itemRow.actualQty"
|
||||
:min="0"
|
||||
:precision="3"
|
||||
:controls="false"
|
||||
:disabled="Boolean(itemRow.brandMode)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="packageSpec" label="包装规格" min-width="110" show-overflow-tooltip />
|
||||
</el-table>
|
||||
<BrandQtyChipsField
|
||||
v-if="row.brandMode"
|
||||
v-model="row.brandQtyRows"
|
||||
:brand-mode="ioBrandModeForField(row)"
|
||||
:required-brand-id="row.brandId"
|
||||
:brand-options="row.brandOptions || []"
|
||||
:unit="row.unitLabel || row.unit || '吨'"
|
||||
variant="admin"
|
||||
:actual-qty="Number(row.actualQty ?? 0)"
|
||||
@update:actual-qty="(val) => syncIoRowActualQty(row, val)"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="现场备注">
|
||||
<el-input v-model="ioOrderEditForm.siteFeedbackRemark" type="textarea" :rows="3" maxlength="500" />
|
||||
@@ -539,6 +600,9 @@
|
||||
<script setup lang="ts">
|
||||
import { CopyDocument, Edit, View } from '@element-plus/icons-vue'
|
||||
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
|
||||
import BrandQtyChipsField, {
|
||||
type BrandQtyRow
|
||||
} from '@/components/business/brand-qty-chips-field/index.vue'
|
||||
import PlPlanDriverFeedbackDialog from '@/components/business/pl-plan-driver-feedback-dialog/index.vue'
|
||||
import PlPlanFormProductTable from '@/components/business/pl-plan-form-dialog/PlPlanFormProductTable.vue'
|
||||
import PlPlanHazardCertViewTable from '@/components/business/pl-plan-hazard-cert-view-table/index.vue'
|
||||
@@ -571,15 +635,17 @@
|
||||
} from '@/utils/db-site-summary'
|
||||
import {
|
||||
formatPlanProductListText,
|
||||
formatBrandQtySummary,
|
||||
getPlFreightTypeLabel,
|
||||
getPlHasInvoiceLabelFromSettlement,
|
||||
getPlPlanCompanyLabel,
|
||||
getPlPlanTypeLabel,
|
||||
getPlYesNoLabel,
|
||||
parsePlFeedbackImages
|
||||
parsePlFeedbackImages,
|
||||
resolveSiteBrandSummary
|
||||
} from '@/utils/pl-display'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
import type { Transport } from '@/api/pl'
|
||||
import type { Transport, TransportDriverProductFeedback } from '@/api/pl'
|
||||
|
||||
const ContractDetailDialog = defineAsyncComponent(
|
||||
() => import('@/views/crm/contract/components/ContractDetailDialog.vue')
|
||||
@@ -676,11 +742,64 @@
|
||||
]
|
||||
})
|
||||
|
||||
type IoOrderEditItem = PlIoOrder['items'][number] & {
|
||||
brandQtyRows?: BrandQtyRow[]
|
||||
}
|
||||
|
||||
function ioBrandModeForField(row: { brandMode?: string | null }): 'any' | 'required' | null {
|
||||
if (row.brandMode === 'any' || row.brandMode === 'required') return row.brandMode
|
||||
return null
|
||||
}
|
||||
|
||||
function syncIoRowActualQty(row: IoOrderEditItem, val: number) {
|
||||
row.actualQty = Number(val)
|
||||
}
|
||||
|
||||
function mapIoItemBrandQtyRows(it: PlIoOrder['items'][number]): BrandQtyRow[] {
|
||||
const saved = (it.brandQtys || [])
|
||||
.filter(r => Number(r.qty) > 0)
|
||||
.map(r => ({
|
||||
brandId: r.brandId,
|
||||
brandName: r.brandName || '',
|
||||
qty: Number(r.qty)
|
||||
}))
|
||||
if (saved.length) return saved
|
||||
if (it.brandMode === 'required' && it.brandId) {
|
||||
return [
|
||||
{
|
||||
brandId: it.brandId,
|
||||
brandName: it.brandName || '指定品牌',
|
||||
qty: Number(it.actualQty ?? 0)
|
||||
}
|
||||
]
|
||||
}
|
||||
if (it.brandMode === 'any') {
|
||||
return (it.brandOptions || []).map(opt => ({
|
||||
brandId: opt.brandId,
|
||||
brandName: opt.brandName || '',
|
||||
qty: 0
|
||||
}))
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
function openIoOrderEditDialog() {
|
||||
if (!ioOrder.value) return
|
||||
ioOrderEditForm.value = {
|
||||
...ioOrder.value,
|
||||
items: (ioOrder.value.items || []).map(it => ({ ...it }))
|
||||
items: (ioOrder.value.items || []).map(it => {
|
||||
const brandQtyRows = mapIoItemBrandQtyRows(it)
|
||||
const actualQty = it.brandMode
|
||||
? Number(
|
||||
brandQtyRows.reduce((sum, r) => sum + Number(r.qty || 0), 0).toFixed(3)
|
||||
)
|
||||
: it.actualQty
|
||||
return {
|
||||
...it,
|
||||
brandQtyRows,
|
||||
actualQty
|
||||
}
|
||||
})
|
||||
}
|
||||
ioOrderEditImagesCsv.value = ioOrderImageCsv.value
|
||||
ioOrderEditVisible.value = true
|
||||
@@ -688,6 +807,21 @@
|
||||
|
||||
async function saveIoOrderEdit() {
|
||||
if (!ioOrderEditForm.value) return
|
||||
const items = (ioOrderEditForm.value.items || []) as IoOrderEditItem[]
|
||||
for (const it of items) {
|
||||
if (!it.brandMode) continue
|
||||
const rows = it.brandQtyRows || []
|
||||
const positive = rows.filter(r => Number(r.qty) > 0)
|
||||
if (!positive.length) {
|
||||
ElMessage.warning(`「${it.productName || '产品'}」请至少填写一个品牌数量`)
|
||||
return
|
||||
}
|
||||
const total = Number(positive.reduce((s, r) => s + Number(r.qty || 0), 0).toFixed(3))
|
||||
if (Math.abs(total - Number(it.actualQty ?? 0)) >= 0.0005) {
|
||||
ElMessage.warning(`「${it.productName || '产品'}」品牌数量合计须等于实际数量`)
|
||||
return
|
||||
}
|
||||
}
|
||||
const api = ioOrderEditForm.value.kind === 'inbound' ? inboundOrderApi : outboundOrderApi
|
||||
ioOrderSaving.value = true
|
||||
try {
|
||||
@@ -697,9 +831,18 @@
|
||||
await api.patch(ioOrderEditForm.value.id, {
|
||||
siteFeedbackRemark: ioOrderEditForm.value.siteFeedbackRemark,
|
||||
siteFeedbackImages: images,
|
||||
items: (ioOrderEditForm.value.items || []).map(it => ({
|
||||
items: items.map(it => ({
|
||||
id: it.id,
|
||||
actualQty: it.actualQty
|
||||
actualQty: Number(it.actualQty ?? 0),
|
||||
brandQtys: it.brandMode
|
||||
? (it.brandQtyRows || [])
|
||||
.filter(r => Number(r.qty) > 0)
|
||||
.map(r => ({
|
||||
brandId: r.brandId,
|
||||
brandName: r.brandName,
|
||||
qty: Number(r.qty)
|
||||
}))
|
||||
: undefined
|
||||
}))
|
||||
})
|
||||
ElMessage.success('保存成功')
|
||||
@@ -721,7 +864,8 @@
|
||||
transport.value?.feedbackTime ||
|
||||
transport.value?.feedbackRemark ||
|
||||
feedbackImageList.value.length ||
|
||||
transport.value?.feedbackQty != null
|
||||
transport.value?.feedbackQty != null ||
|
||||
(transport.value?.driverProductFeedbacks || []).length
|
||||
)
|
||||
)
|
||||
|
||||
@@ -731,13 +875,21 @@
|
||||
}
|
||||
|
||||
const driverFeedbackTableRows = computed(() => {
|
||||
const rows = transport.value?.driverProductFeedbacks || []
|
||||
if (rows.length) {
|
||||
return rows.map((row: TransportDriverProductFeedback) => ({
|
||||
productName: row.productName || '—',
|
||||
actualQty: row.actualQty,
|
||||
brandSummary: row.brandSummary || formatBrandQtySummary(row.brandQtys) || '—'
|
||||
}))
|
||||
}
|
||||
if (!hasDriverFeedback.value) return []
|
||||
// 兼容旧数据:仅有运输单总量、无按产品明细
|
||||
return [
|
||||
{
|
||||
feedbackTime: displayFeedbackTime.value,
|
||||
feedbackQty: transport.value?.feedbackQty,
|
||||
feedbackRemark: transport.value?.feedbackRemark || '—',
|
||||
feedbackImages: feedbackImageCsv.value
|
||||
productName: '(合计)',
|
||||
actualQty: transport.value?.feedbackQty,
|
||||
brandSummary: '—'
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user