fix
This commit is contained in:
parent
8968e134c3
commit
4e1d63b6ee
@ -366,9 +366,10 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
'engineVolume',
|
||||
'engineType',
|
||||
'leaseObjectMotorPower',
|
||||
'model',
|
||||
]),
|
||||
async ({ leaseObjectType: leaseObjectTypeId }) => {
|
||||
if (!leaseObjectTypeId) {
|
||||
async ({ leaseObjectType: leaseObjectTypeId, model: modelId }) => {
|
||||
if (!leaseObjectTypeId || !modelId) {
|
||||
$calculation.element('selectEngineType').unblock();
|
||||
$calculation.element('tbxEngineVolume').unblock();
|
||||
$calculation.element('tbxLeaseObjectMotorPower').unblock();
|
||||
@ -385,8 +386,6 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
},
|
||||
});
|
||||
|
||||
const modelId = $calculation.element('selectModel').getValue();
|
||||
if (!modelId) return;
|
||||
const {
|
||||
data: { evo_model },
|
||||
} = await apolloClient.query({
|
||||
|
||||
@ -29,7 +29,7 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
maxMass,
|
||||
leaseObjectCategory,
|
||||
brand,
|
||||
model,
|
||||
model: modelId,
|
||||
leaseObjectUseFor,
|
||||
configuration,
|
||||
},
|
||||
@ -51,7 +51,7 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
});
|
||||
}
|
||||
|
||||
if (!model) {
|
||||
if (!modelId) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: 'Не заполнено поле',
|
||||
@ -59,12 +59,12 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
});
|
||||
}
|
||||
|
||||
if (model && !configuration) {
|
||||
if (modelId && !configuration) {
|
||||
const {
|
||||
data: { evo_equipments },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetConfigurationsDocument,
|
||||
variables: { modelId: model },
|
||||
variables: { modelId },
|
||||
});
|
||||
|
||||
if (evo_equipments?.length) {
|
||||
@ -94,13 +94,13 @@ export function createValidationSchema({ apolloClient }: ValidationContext) {
|
||||
},
|
||||
});
|
||||
|
||||
if (model) {
|
||||
if (modelId) {
|
||||
const {
|
||||
data: { evo_model },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetModelDocument,
|
||||
variables: {
|
||||
modelId: model,
|
||||
modelId,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user