обновление cbxSupplierFinancing
This commit is contained in:
parent
87e4783dd5
commit
e0be27a5b9
@ -7,7 +7,7 @@ export const rows: FormTabRows = [
|
||||
[['selectProduct'], { gridTemplateColumns: '1fr' }],
|
||||
[['tbxLeaseObjectPrice', 'tbxVATInLeaseObjectPrice', 'tbxLeaseObjectPriceWthtVAT']],
|
||||
[['selectSupplierCurrency', 'tbxSupplierDiscountRub', 'tbxSupplierDiscountPerc']],
|
||||
[['tbxFirstPaymentPerc', 'tbxFirstPaymentRub', 'cbxSupplierFinancing']],
|
||||
[['tbxFirstPaymentPerc', 'tbxFirstPaymentRub']],
|
||||
[['tbxLeasingPeriod', 'tbxSaleBonus']],
|
||||
[['selectSubsidy', 'tbxSubsidySum'], { gridTemplateColumns: '2fr 1fr' }],
|
||||
[['selectImportProgram', 'tbxImportProgramSum', 'tbxAddEquipmentPrice']],
|
||||
|
||||
@ -9,4 +9,5 @@ export const rows: FormTabRows = [
|
||||
[['tbxMinPriceChange', 'tbxMaxPriceChange']],
|
||||
[['tbxImporterRewardPerc', 'tbxImporterRewardRub']],
|
||||
[['tbxBonusCoefficient', 'tbxComissionRub', 'tbxComissionPerc']],
|
||||
[['cbxSupplierFinancing']],
|
||||
];
|
||||
|
||||
@ -158,10 +158,9 @@ export function common({ store, apolloClient }: ProcessContext) {
|
||||
);
|
||||
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['product', 'dealerPerson']),
|
||||
async ({ product: productId, dealerPerson: dealerPersonId }) => {
|
||||
() => $calculation.$values.getValues(['product']),
|
||||
async ({ product: productId }) => {
|
||||
let evo_baseproduct: CRMTypes.GetProductQuery['evo_baseproduct'] = null;
|
||||
let dealerPerson: CRMTypes.GetDealerPersonQuery['account'] = null;
|
||||
|
||||
if (productId) {
|
||||
const { data } = await apolloClient.query({
|
||||
@ -172,23 +171,9 @@ export function common({ store, apolloClient }: ProcessContext) {
|
||||
({ evo_baseproduct } = data);
|
||||
}
|
||||
|
||||
if (dealerPersonId) {
|
||||
const { data } = await apolloClient.query({
|
||||
query: CRMTypes.GetDealerPersonDocument,
|
||||
variables: { dealerPersonId },
|
||||
});
|
||||
|
||||
({ account: dealerPerson } = data);
|
||||
}
|
||||
|
||||
if (
|
||||
evo_baseproduct?.evo_supplier_financing_accept &&
|
||||
dealerPerson?.evo_supplier_financing_accept
|
||||
) {
|
||||
$calculation.element('cbxSupplierFinancing').unblock();
|
||||
} else {
|
||||
$calculation.element('cbxSupplierFinancing').setValue(false).block();
|
||||
}
|
||||
$calculation
|
||||
.element('cbxSupplierFinancing')
|
||||
.setValue(Boolean(evo_baseproduct?.evo_supplier_financing_accept));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user