提交
This commit is contained in:
1 parent
67d37a1f0e
commit
54a1ba0c5c
21 files changed
+8646
-7577
No files matched your search
@@ -108,12 +108,15 @@
|
||||
<div class="pl-plan-dibang-row">
|
||||
<el-checkbox
|
||||
:model-value="modelValue.generateDibang === 1"
|
||||
disabled
|
||||
:disabled="readonly || !canManualDibang"
|
||||
@update:model-value="handleDibangToggle"
|
||||
>
|
||||
生成地磅单({{ dibangDirectionLabel }})
|
||||
</el-checkbox>
|
||||
<span v-if="isInternal" class="pl-plan-dibang-row__hint">本段客户为内部客户时默认勾选</span>
|
||||
<span v-if="canManualDibang" class="pl-plan-dibang-row__hint">
|
||||
该车辆地磅单可选,请自行勾选
|
||||
</span>
|
||||
<span v-else-if="isInternal" class="pl-plan-dibang-row__hint">本段客户为内部客户时默认勾选</span>
|
||||
<span v-else-if="modelValue.customerId" class="pl-plan-dibang-row__hint">
|
||||
仅安庆山峡/安徽云栋可生成地磅单
|
||||
</span>
|
||||
@@ -162,7 +165,11 @@
|
||||
import PlPlanContractMultiSelect from '@/components/business/pl-plan-contract-multi-select/index.vue'
|
||||
import PlPlanStopProductTable from '@/components/business/pl-plan-stop-product-table/index.vue'
|
||||
import { resolveAddressNotesFill } from '@/utils/pl-address-notes-fill'
|
||||
import { resolveStopDibangDefaults, type PlanLoadForm } from '@/utils/pl-plan-stop-form'
|
||||
import {
|
||||
canManualToggleStopDibang,
|
||||
resolveStopDibangDefaults,
|
||||
type PlanLoadForm
|
||||
} from '@/utils/pl-plan-stop-form'
|
||||
import { isPlInternalCustomerName } from '@/utils/pl-internal-customer'
|
||||
import { pickBxData } from '@/utils/http/bx'
|
||||
|
||||
@@ -173,11 +180,14 @@
|
||||
compactProducts?: boolean
|
||||
/** 编辑计划时排除本计划占用 */
|
||||
excludePlanId?: string
|
||||
/** 当前计划车牌(主牌),用于地磅可选车例外 */
|
||||
vehiclePlate?: string
|
||||
}>(),
|
||||
{
|
||||
readonly: false,
|
||||
compactProducts: true,
|
||||
excludePlanId: ''
|
||||
excludePlanId: '',
|
||||
vehiclePlate: ''
|
||||
}
|
||||
)
|
||||
|
||||
@@ -198,6 +208,9 @@
|
||||
const customerOptionsLoading = ref(false)
|
||||
|
||||
const isInternal = computed(() => isPlInternalCustomerName(props.modelValue.customerName))
|
||||
const canManualDibang = computed(() =>
|
||||
canManualToggleStopDibang(props.modelValue.customerName, props.vehiclePlate)
|
||||
)
|
||||
|
||||
const stopContractId = computed(() => {
|
||||
const id = String(props.modelValue.contracts?.[0]?.contractId || '').trim()
|
||||
@@ -365,7 +378,7 @@
|
||||
}
|
||||
const customer = customerOptions.value.find((item) => String(item.id) === String(customerId))
|
||||
const customerName = customer?.customerName || ''
|
||||
const defaults = resolveStopDibangDefaults(customerName, 'load')
|
||||
const defaults = resolveStopDibangDefaults(customerName, 'load', props.vehiclePlate)
|
||||
patch({
|
||||
customerId: String(customerId),
|
||||
customerName,
|
||||
@@ -403,9 +416,11 @@
|
||||
}
|
||||
|
||||
function handleDibangToggle(checked: boolean) {
|
||||
// 仅山峡/云栋可生成地磅单,且由客户类型自动决定,不允许手动勾选
|
||||
if (!isInternal.value) {
|
||||
patch({ generateDibang: 0, dibangDirection: 'none' })
|
||||
// 非可手动场景:外部客户强制不勾;内部非可选车由默认值锁定,忽略手动切换
|
||||
if (!canManualDibang.value) {
|
||||
if (!isInternal.value) {
|
||||
patch({ generateDibang: 0, dibangDirection: 'none' })
|
||||
}
|
||||
return
|
||||
}
|
||||
patch({
|
||||
|
||||
Reference in new issue
Block a user