feat(web-admin): allow removing products on delivery stops

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-08-30 11:05:15 +08:00
1 parent 8777173fb7
commit 173e6cdf59
1 file changed
+17 -7
@@ -64,7 +64,7 @@
v-model="delivery.contracts"
:customer-id="delivery.customerId"
:disabled="!delivery.customerId || isPlInternalCustomerName(delivery.customerName)"
:required="false"
:required="!!delivery.customerId && !isPlInternalCustomerName(delivery.customerName)"
compact-summary
>
<template #toolbar="{ open, disabled, hint, hintWarn }">
@@ -99,7 +99,11 @@
</el-button>
</div>
</el-form-item>
<el-form-item label="送货合同" class="pl-plan-party-select-row__contract">
<el-form-item
v-if="!isPlInternalCustomerName(delivery.customerName)"
label="送货合同"
class="pl-plan-party-select-row__contract"
>
<div class="pl-plan-contract-trigger">
<el-button class="btn-ghost" :disabled="disabled" @click="open">
<el-icon><Search /></el-icon>选择合同
@@ -156,7 +160,7 @@
<div class="pl-plan-dibang-row">
<el-checkbox
:model-value="delivery.generateDibang === 1"
:disabled="isPlInternalCustomerName(delivery.customerName)"
disabled
@update:model-value="(checked) => handleDibangToggle(index, checked)"
>
生成地磅单({{ directionLabel(delivery.dibangDirection) }})
@@ -167,6 +171,9 @@
>
本段客户为内部客户时默认勾选
</span>
<span v-else-if="delivery.customerId" class="pl-plan-dibang-row__hint">
仅安庆山峡/安徽云栋可生成地磅单
</span>
</div>
</el-form-item>
</div>
@@ -192,7 +199,7 @@
:products="delivery.products"
:editable="!readonly"
:compact="compactProducts"
:allow-remove="false"
:allow-remove="!readonly"
:shared-readonly="true"
@remove="(productIndex) => removeStopProduct(index, productIndex)"
/>
@@ -515,11 +522,14 @@
function handleDibangToggle(index: number, checked: boolean) {
const delivery = props.modelValue[index]
const isInternal = isPlInternalCustomerName(delivery.customerName)
const direction = isInternal ? 'inbound' : delivery.dibangDirection || 'none'
// 仅山峡/云栋可生成地磅单,且由客户类型自动决定,不允许手动勾选
if (!isPlInternalCustomerName(delivery?.customerName)) {
patchDelivery(index, { generateDibang: 0, dibangDirection: 'none' })
return
}
patchDelivery(index, {
generateDibang: checked ? 1 : 0,
dibangDirection: checked ? direction : 'none'
dibangDirection: checked ? 'inbound' : 'none'
})
}