@@ -2904,10 +2904,33 @@ export default {
|
||||
buildRequestParams(params = {}) {
|
||||
return this.settlementType ? { ...params, settlementType: this.settlementType } : params;
|
||||
},
|
||||
syncBillingPlanOptions(contractId) {
|
||||
syncBillingPlanOptions(contractId, counterpartyName = '') {
|
||||
const contracts = [...this.updateContractOptions, ...this.contractOptions];
|
||||
const contract = contracts.find(item => String(item.id) === String(contractId));
|
||||
const plans = this.parseJson(contract?.billingPlanJson);
|
||||
let plans = this.parseJson(contract?.billingPlanJson);
|
||||
const targetName = String(
|
||||
counterpartyName ||
|
||||
this.updateFeeForm?.counterpartyName ||
|
||||
this.generateQuery?.counterpartyName ||
|
||||
this.currentDetail?.counterpartyName ||
|
||||
this.currentDetail?.carrierName ||
|
||||
this.currentDetail?.customerName ||
|
||||
''
|
||||
).trim();
|
||||
if (targetName) {
|
||||
const matched = plans.filter(
|
||||
item =>
|
||||
String(item.customerName || '').trim() === targetName ||
|
||||
String(item.partyRowId || '') ===
|
||||
String(this.updateFeeForm?.carrierPartyId || this.generateQuery?.carrierPartyId || '')
|
||||
);
|
||||
const hasBinding = plans.some(
|
||||
item => item.customerName || item.customerId || item.partyRowId
|
||||
);
|
||||
if (matched.length || hasBinding) {
|
||||
plans = matched;
|
||||
}
|
||||
}
|
||||
this.billingPlanOptions = plans.map((item, index) => ({
|
||||
id:
|
||||
item.id ||
|
||||
@@ -2916,11 +2939,16 @@ export default {
|
||||
item.planName ||
|
||||
item.billingPlanName ||
|
||||
`plan-${index}`,
|
||||
name: item.name || item.planName || item.billingPlanName || `计费方案${index + 1}`,
|
||||
name: [
|
||||
item.name || item.planName || item.billingPlanName || `计费方案${index + 1}`,
|
||||
item.customerName ? `(${item.customerName})` : '',
|
||||
].join(''),
|
||||
defaultPlan:
|
||||
item.defaultPlan === true ||
|
||||
item.defaultPlan === 1 ||
|
||||
['true', '1'].includes(String(item.defaultPlan).toLowerCase()),
|
||||
customerName: item.customerName || '',
|
||||
partyRowId: item.partyRowId || '',
|
||||
}));
|
||||
return this.billingPlanOptions;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user