diff --git a/src/views/business/components/billing-plan-editor.vue b/src/views/business/components/billing-plan-editor.vue index 19f4b17..6f68b6a 100644 --- a/src/views/business/components/billing-plan-editor.vue +++ b/src/views/business/components/billing-plan-editor.vue @@ -12,6 +12,9 @@ {{ displayValue(draft.planName) }} + {{ + displayValue(draft.customerName || partyOptionLabel(draft.partyRowId)) + }} {{ transportModeLabel(draft.transportMode) }} @@ -37,6 +40,20 @@ :disabled="readonly" /> + [] }, }, emits: ['update:modelValue', 'save'], data() { @@ -476,6 +494,7 @@ export default { cargoRequest: null, formRules: { planName: [{ required: true, message: '请输入方案名称', trigger: 'blur' }], + partyRowId: [{ required: true, message: '请选择适用客商', trigger: 'change' }], transportMode: [{ required: true, message: '请选择运输方式', trigger: 'change' }], }, }; @@ -549,6 +568,10 @@ export default { normalizePlan(value = {}) { const plan = { planName: '', + partyRowId: '', + partyRole: '', + customerId: '', + customerName: '', transportMode: '', transportModeLabel: '', defaultPlan: false, @@ -560,6 +583,21 @@ export default { ); return plan; }, + partyOptionLabel(partyRowId) { + const matched = (this.partyOptions || []).find( + item => String(item.value) === String(partyRowId) + ); + return matched?.label || ''; + }, + handlePartyChange(partyRowId) { + const matched = (this.partyOptions || []).find( + item => String(item.value) === String(partyRowId) + ); + this.draft.partyRowId = matched?.partyRowId || matched?.value || ''; + this.draft.partyRole = matched?.partyRole || ''; + this.draft.customerId = matched?.customerId || ''; + this.draft.customerName = matched?.customerName || ''; + }, normalizeRule(rule = {}) { const next = { ...defaultRule(), ...clone(rule) }; if (next.billingType === '阶梯单价' && next.minimumBillingWeight === '') { @@ -1032,6 +1070,11 @@ export default { this.$refs.formRef.validate(valid => { if (!valid || !this.validateRules()) return; const plan = clone(this.draft); + this.handlePartyChange(plan.partyRowId); + plan.partyRowId = this.draft.partyRowId; + plan.partyRole = this.draft.partyRole; + plan.customerId = this.draft.customerId; + plan.customerName = this.draft.customerName; const transportMode = this.transportModeOptions.find( item => String(item.value) === String(plan.transportMode) ); diff --git a/src/views/business/components/master-order-dispatch.vue b/src/views/business/components/master-order-dispatch.vue index 40dd8a3..b08c4bc 100644 --- a/src/views/business/components/master-order-dispatch.vue +++ b/src/views/business/components/master-order-dispatch.vue @@ -195,7 +195,7 @@