fix(web-admin): keep cancelled plan stop feedback and refresh plan detail from API
作废/取消计划仍展示已有分段回传;打开计划详情始终回源,避免列表 seed 滞后。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
85f5f29895
commit
53987bdf22
3 files changed
+52
-10
No files matched your search
@@ -452,9 +452,15 @@
|
||||
resolveStopProductsForView(mapLoadFromApi(plan.value?.load).products, productRows.value)
|
||||
)
|
||||
|
||||
const showStopFeedback = computed(
|
||||
() => plan.value?.transportStatus === 'arranged' && plan.value?.followStatus !== 'cancelled'
|
||||
)
|
||||
const showStopFeedback = computed(() => {
|
||||
const hasStopFeedback = Boolean(
|
||||
(transport.value?.driverStopFeedbacks || []).length ||
|
||||
(transport.value?.siteStopFeedbacks || []).length
|
||||
)
|
||||
// 作废/取消单仍展示已有分段回传;无数据时仅在已安排且未取消时显示空态入口
|
||||
if (hasStopFeedback) return true
|
||||
return plan.value?.transportStatus === 'arranged' && plan.value?.followStatus !== 'cancelled'
|
||||
})
|
||||
|
||||
const summaryCarrierName = computed(
|
||||
() => transport.value?.carrierName || vehicleBundle.value?.detail?.carrierName || ''
|
||||
|
||||
@@ -133,10 +133,13 @@
|
||||
prefetchedArrange.value = null
|
||||
bootstrappedPlan.value = null
|
||||
|
||||
let data: Plan | null = props.seedPlan?.id === props.planId ? (props.seedPlan as Plan) : null
|
||||
if (!data) {
|
||||
// 打开详情始终回源,避免列表 seed 数量/装卸段滞后于库内已修正数据
|
||||
let data: Plan | null = null
|
||||
try {
|
||||
const res = await planApi.get(props.planId)
|
||||
data = pickBxData<Plan>(res) || ((res as { data?: Plan }).data ?? null)
|
||||
} catch {
|
||||
data = props.seedPlan?.id === props.planId ? (props.seedPlan as Plan) : null
|
||||
}
|
||||
if (!data) {
|
||||
throw new Error('运输计划数据无效')
|
||||
|
||||
@@ -779,7 +779,14 @@
|
||||
transport.value?.feedbackRemark ||
|
||||
feedbackImageList.value.length ||
|
||||
transport.value?.feedbackQty != null ||
|
||||
(transport.value?.driverProductFeedbacks || []).length
|
||||
(transport.value?.driverProductFeedbacks || []).length ||
|
||||
(transport.value?.driverStopFeedbacks || []).some(
|
||||
(row) =>
|
||||
(row.attachmentUrls && row.attachmentUrls.length > 0) ||
|
||||
row.remark ||
|
||||
row.feedbackTime ||
|
||||
(row.products && row.products.length > 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1406,9 +1413,15 @@
|
||||
)
|
||||
}
|
||||
|
||||
const showStopFeedback = computed(
|
||||
() => plan.value?.transportStatus === 'arranged' && plan.value?.followStatus !== 'cancelled'
|
||||
)
|
||||
const showStopFeedback = computed(() => {
|
||||
const hasStopFeedback = Boolean(
|
||||
(transport.value?.driverStopFeedbacks || []).length ||
|
||||
(transport.value?.siteStopFeedbacks || []).length
|
||||
)
|
||||
// 作废/取消单仍展示已有分段回传;无数据时仅在已安排且未取消时显示空态入口
|
||||
if (hasStopFeedback) return true
|
||||
return plan.value?.transportStatus === 'arranged' && plan.value?.followStatus !== 'cancelled'
|
||||
})
|
||||
|
||||
const feedbackBlocksBind = computed(() => ({
|
||||
feedbackEditable: props.feedbackEditable,
|
||||
@@ -1435,7 +1448,27 @@
|
||||
ioOrderViewFields: ioOrderViewFields.value,
|
||||
ioOrderImageCsv: ioOrderImageCsv.value,
|
||||
siteFeedbackTableRows: siteFeedbackTableRows.value,
|
||||
dibangPlanRows: dibangPlanRows.value
|
||||
dibangPlanRows: dibangPlanRows.value,
|
||||
driverStopFeedbacks: (transport.value?.driverStopFeedbacks || []).map((row) => ({
|
||||
stopType: row.stopType,
|
||||
stopId: row.stopId,
|
||||
label: row.label,
|
||||
customerName: row.customerName,
|
||||
attachmentUrls: row.attachmentUrls,
|
||||
remark: row.remark,
|
||||
feedbackTime: row.feedbackTime
|
||||
})),
|
||||
siteStopFeedbacks: (transport.value?.siteStopFeedbacks || []).map((row) => ({
|
||||
stopType: row.stopType,
|
||||
stopId: row.stopId,
|
||||
label: row.label,
|
||||
customerName: row.customerName,
|
||||
businessType: row.businessType,
|
||||
quantity: row.quantity != null ? Number(row.quantity) : undefined,
|
||||
attachmentUrls: row.attachmentUrls,
|
||||
remark: row.remark,
|
||||
feedbackTime: row.feedbackTime
|
||||
}))
|
||||
}))
|
||||
|
||||
const feedbackBlocksOn = {
|
||||
|
||||
Reference in new issue
Block a user