rename Status->ElementStatus
This commit is contained in:
parent
5e6149e704
commit
06589c48ba
@ -1,13 +1,13 @@
|
||||
import { Button as AntButton } from 'antd';
|
||||
import { Status } from 'core/types/statuses';
|
||||
import { ElementStatus } from 'core/types/statuses';
|
||||
import React from 'react';
|
||||
|
||||
const Button = ({ status, action, text, ...props }) => {
|
||||
return (
|
||||
<AntButton
|
||||
{...props}
|
||||
disabled={status === Status.Disabled}
|
||||
loading={status === Status.Loading}
|
||||
disabled={status === ElementStatus.Disabled}
|
||||
loading={status === ElementStatus.Loading}
|
||||
onClick={() => {
|
||||
if (action) action();
|
||||
}}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Checkbox as AntCheckbox, Form } from 'antd';
|
||||
import { Status } from 'core/types/statuses';
|
||||
import { ElementStatus } from 'core/types/statuses';
|
||||
import React from 'react';
|
||||
|
||||
const Checkbox = ({ value, setCurrentValue, status, ...props }) => {
|
||||
@ -7,7 +7,7 @@ const Checkbox = ({ value, setCurrentValue, status, ...props }) => {
|
||||
<Form.Item>
|
||||
<AntCheckbox
|
||||
{...props}
|
||||
disabled={status === Status.Disabled}
|
||||
disabled={status === ElementStatus.Disabled}
|
||||
checked={value}
|
||||
onChange={e => setCurrentValue(e.target.checked)}
|
||||
/>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Form, Input as AntInput } from 'antd';
|
||||
import { Status } from 'core/types/statuses';
|
||||
import { ElementStatus } from 'core/types/statuses';
|
||||
import React from 'react';
|
||||
|
||||
const Input = ({
|
||||
@ -14,7 +14,7 @@ const Input = ({
|
||||
<Form.Item hasFeedback validateStatus={validateStatus} help={message}>
|
||||
<AntInput
|
||||
{...props}
|
||||
disabled={status === Status.Disabled}
|
||||
disabled={status === ElementStatus.Disabled}
|
||||
value={value}
|
||||
onChange={e => setCurrentValue(e.target.value)}
|
||||
/>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Form, InputNumber as AntInputNumber } from 'antd';
|
||||
import { Status } from 'core/types/statuses';
|
||||
import { ElementStatus } from 'core/types/statuses';
|
||||
import React from 'react';
|
||||
|
||||
const InputNumber = ({
|
||||
@ -14,7 +14,7 @@ const InputNumber = ({
|
||||
<Form.Item validateStatus={validateStatus} help={message}>
|
||||
<AntInputNumber
|
||||
{...props}
|
||||
disabled={status === Status.Disabled}
|
||||
disabled={status === ElementStatus.Disabled}
|
||||
style={styles}
|
||||
onChange={value => setCurrentValue(value)}
|
||||
value={value}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Form, Radio as AntRadio } from 'antd';
|
||||
import { Status } from 'core/types/statuses';
|
||||
import { ElementStatus } from 'core/types/statuses';
|
||||
import React from 'react';
|
||||
|
||||
const Radio = ({
|
||||
@ -16,7 +16,7 @@ const Radio = ({
|
||||
<Form.Item validateStatus={validateStatus} help={message}>
|
||||
<AntRadio.Group
|
||||
{...props}
|
||||
disabled={status === Status.Disabled}
|
||||
disabled={status === ElementStatus.Disabled}
|
||||
buttonStyle={style === 'button' && 'solid'}
|
||||
value={value}
|
||||
onChange={e => {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Form, Select as AntSelect } from 'antd';
|
||||
import { Status } from 'core/types/statuses';
|
||||
import { ElementStatus } from 'core/types/statuses';
|
||||
import React from 'react';
|
||||
|
||||
const Select = ({
|
||||
@ -15,8 +15,8 @@ const Select = ({
|
||||
<Form.Item validateStatus={validateStatus} help={message}>
|
||||
<AntSelect
|
||||
{...props}
|
||||
disabled={status === Status.Disabled}
|
||||
loading={status === Status.Loading}
|
||||
disabled={status === ElementStatus.Disabled}
|
||||
loading={status === ElementStatus.Loading}
|
||||
optionFilterProp="children"
|
||||
value={value}
|
||||
onChange={val => setCurrentValue(val)}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Form, Switch as AntSwitch } from 'antd';
|
||||
import { Status } from 'core/types/statuses';
|
||||
import { ElementStatus } from 'core/types/statuses';
|
||||
import React from 'react';
|
||||
|
||||
const Switch = ({
|
||||
@ -14,7 +14,7 @@ const Switch = ({
|
||||
<Form.Item validateStatus={validateStatus} help={message}>
|
||||
<AntSwitch
|
||||
{...props}
|
||||
disabled={status === Status.Disabled}
|
||||
disabled={status === ElementStatus.Disabled}
|
||||
checked={value}
|
||||
onChange={(checked, event) => {
|
||||
setCurrentValue(checked);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Form, Input as AntInput } from 'antd';
|
||||
import { Status } from 'core/types/statuses';
|
||||
import { ElementStatus } from 'core/types/statuses';
|
||||
import React from 'react';
|
||||
|
||||
const TextArea = ({
|
||||
@ -15,7 +15,7 @@ const TextArea = ({
|
||||
<AntInput.TextArea
|
||||
{...props}
|
||||
autoSize={{ minRows: 5, maxRows: 8 }}
|
||||
disabled={status === Status.Disabled}
|
||||
disabled={status === ElementStatus.Disabled}
|
||||
value={value}
|
||||
onChange={e => setCurrentValue(e.target.value)}
|
||||
/>
|
||||
|
||||
@ -2,7 +2,7 @@ import { message } from 'antd';
|
||||
import { openNotification } from 'client/Elements/Notification';
|
||||
import CalculationService from 'client/services/CalculationService';
|
||||
import { resultsValues } from 'core/types/Calculation/Store/values';
|
||||
import { Status } from 'core/types/statuses';
|
||||
import { ElementStatus } from 'core/types/statuses';
|
||||
import CalculationStore from '../..';
|
||||
import getAdditionalData from '../lib/additionalData';
|
||||
import checkValidation from '../lib/checkValidation';
|
||||
@ -19,16 +19,16 @@ const cleanResults = () => {
|
||||
const BUTTONS_TIMEOUT = 500;
|
||||
|
||||
function blockButtons() {
|
||||
CalculationStore.setStatus('btnCreateKP', Status.Loading);
|
||||
CalculationStore.setStatus('btnCalculate', Status.Loading);
|
||||
CalculationStore.setStatus('btnCreateKP', ElementStatus.Loading);
|
||||
CalculationStore.setStatus('btnCalculate', ElementStatus.Loading);
|
||||
}
|
||||
|
||||
function unlockButtons() {
|
||||
setTimeout(() => {
|
||||
CalculationStore.setStatus('btnCreateKP', Status.Default);
|
||||
CalculationStore.setStatus('btnCreateKP', ElementStatus.Default);
|
||||
}, BUTTONS_TIMEOUT);
|
||||
setTimeout(() => {
|
||||
CalculationStore.setStatus('btnCalculate', Status.Default);
|
||||
CalculationStore.setStatus('btnCalculate', ElementStatus.Default);
|
||||
}, BUTTONS_TIMEOUT);
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ import { currentDate } from 'client/tools/date';
|
||||
import { shift, shiftRight } from 'core/tools/array';
|
||||
import { IReactionEffect } from 'core/types/Calculation/Store/effect';
|
||||
import { ITableCell, TableProps } from 'core/types/Calculation/Store/tables';
|
||||
import { Status } from 'core/types/statuses';
|
||||
import { ElementStatus } from 'core/types/statuses';
|
||||
import { toJS } from 'mobx';
|
||||
import { calcPrice, calculatePerc, calculateRub } from './lib/tools';
|
||||
|
||||
@ -335,9 +335,9 @@ const reactionEffects: IReactionEffect[] = [
|
||||
},
|
||||
effect: agentid => {
|
||||
if (!agentid) {
|
||||
calculationStore.setStatus('selectDoubleAgent', Status.Disabled);
|
||||
calculationStore.setStatus('selectDoubleAgent', ElementStatus.Disabled);
|
||||
} else {
|
||||
calculationStore.setStatus('selectDoubleAgent', Status.Default);
|
||||
calculationStore.setStatus('selectDoubleAgent', ElementStatus.Default);
|
||||
}
|
||||
},
|
||||
}),
|
||||
@ -350,61 +350,61 @@ const reactionEffects: IReactionEffect[] = [
|
||||
effect: channel => {
|
||||
switch (channel) {
|
||||
case 100000000:
|
||||
calculationStore.setStatus('selectSupplier', Status.Default);
|
||||
calculationStore.setStatus('selectAgent', Status.Default);
|
||||
calculationStore.setStatus('selectSupplier', ElementStatus.Default);
|
||||
calculationStore.setStatus('selectAgent', ElementStatus.Default);
|
||||
|
||||
calculationStore.setStatus('selectFinDepartment', Status.Disabled);
|
||||
calculationStore.setStatus('selectFinDepartment', ElementStatus.Disabled);
|
||||
calculationStore.setValue('finDepartment', null);
|
||||
|
||||
calculationStore.setStatus('selectBroker', Status.Disabled);
|
||||
calculationStore.setStatus('selectBroker', ElementStatus.Disabled);
|
||||
calculationStore.setValue('broker', null);
|
||||
break;
|
||||
|
||||
case 100000001:
|
||||
calculationStore.setStatus('selectSupplier', Status.Default);
|
||||
calculationStore.setStatus('selectAgent', Status.Default);
|
||||
calculationStore.setStatus('selectSupplier', ElementStatus.Default);
|
||||
calculationStore.setStatus('selectAgent', ElementStatus.Default);
|
||||
|
||||
calculationStore.setStatus('selectFinDepartment', Status.Default);
|
||||
calculationStore.setStatus('selectFinDepartment', ElementStatus.Default);
|
||||
|
||||
calculationStore.setStatus('selectBroker', Status.Disabled);
|
||||
calculationStore.setStatus('selectBroker', ElementStatus.Disabled);
|
||||
calculationStore.setValue('broker', null);
|
||||
break;
|
||||
case 100000002:
|
||||
calculationStore.setStatus('selectSupplier', Status.Disabled);
|
||||
calculationStore.setStatus('selectSupplier', ElementStatus.Disabled);
|
||||
calculationStore.setValue('supplier', null);
|
||||
|
||||
calculationStore.setStatus('selectAgent', Status.Default);
|
||||
calculationStore.setStatus('selectAgent', ElementStatus.Default);
|
||||
|
||||
calculationStore.setStatus('selectFinDepartment', Status.Disabled);
|
||||
calculationStore.setStatus('selectFinDepartment', ElementStatus.Disabled);
|
||||
calculationStore.setValue('finDepartment', null);
|
||||
|
||||
calculationStore.setStatus('selectBroker', Status.Disabled);
|
||||
calculationStore.setStatus('selectBroker', ElementStatus.Disabled);
|
||||
calculationStore.setValue('broker', null);
|
||||
break;
|
||||
case 100000003:
|
||||
calculationStore.setStatus('selectSupplier', Status.Disabled);
|
||||
calculationStore.setStatus('selectSupplier', ElementStatus.Disabled);
|
||||
calculationStore.setValue('supplier', null);
|
||||
|
||||
calculationStore.setStatus('selectAgent', Status.Default);
|
||||
calculationStore.setStatus('selectAgent', ElementStatus.Default);
|
||||
calculationStore.setValue('agent', null);
|
||||
|
||||
calculationStore.setStatus('selectFinDepartment', Status.Disabled);
|
||||
calculationStore.setStatus('selectFinDepartment', ElementStatus.Disabled);
|
||||
calculationStore.setValue('finDepartment', null);
|
||||
|
||||
calculationStore.setStatus('selectBroker', Status.Default);
|
||||
calculationStore.setStatus('selectBroker', ElementStatus.Default);
|
||||
break;
|
||||
case 100000004:
|
||||
default:
|
||||
calculationStore.setStatus('selectSupplier', Status.Disabled);
|
||||
calculationStore.setStatus('selectSupplier', ElementStatus.Disabled);
|
||||
calculationStore.setValue('supplier', null);
|
||||
|
||||
calculationStore.setStatus('selectAgent', Status.Disabled);
|
||||
calculationStore.setStatus('selectAgent', ElementStatus.Disabled);
|
||||
calculationStore.setValue('agent', null);
|
||||
|
||||
calculationStore.setStatus('selectFinDepartment', Status.Disabled);
|
||||
calculationStore.setStatus('selectFinDepartment', ElementStatus.Disabled);
|
||||
calculationStore.setValue('finDepartment', null);
|
||||
|
||||
calculationStore.setStatus('selectBroker', Status.Disabled);
|
||||
calculationStore.setStatus('selectBroker', ElementStatus.Disabled);
|
||||
calculationStore.setValue('broker', null);
|
||||
break;
|
||||
}
|
||||
@ -423,11 +423,11 @@ const reactionEffects: IReactionEffect[] = [
|
||||
if (newClient && newClient.length > 0) {
|
||||
calculationStore.setValue('account', null);
|
||||
calculationStore.setValue('contactClient', null);
|
||||
calculationStore.setStatus('selectAccount', Status.Disabled);
|
||||
calculationStore.setStatus('selectContactClient', Status.Disabled);
|
||||
calculationStore.setStatus('selectAccount', ElementStatus.Disabled);
|
||||
calculationStore.setStatus('selectContactClient', ElementStatus.Disabled);
|
||||
} else {
|
||||
calculationStore.setStatus('selectAccount', Status.Default);
|
||||
calculationStore.setStatus('selectContactClient', Status.Default);
|
||||
calculationStore.setStatus('selectAccount', ElementStatus.Default);
|
||||
calculationStore.setStatus('selectContactClient', ElementStatus.Default);
|
||||
}
|
||||
},
|
||||
}),
|
||||
@ -439,10 +439,10 @@ const reactionEffects: IReactionEffect[] = [
|
||||
},
|
||||
effect: account => {
|
||||
if (account && account.length > 0) {
|
||||
calculationStore.setStatus('tbxNewClient', Status.Disabled);
|
||||
calculationStore.setStatus('tbxNewClient', ElementStatus.Disabled);
|
||||
calculationStore.setValue('newClient', null);
|
||||
} else {
|
||||
calculationStore.setStatus('tbxNewClient', Status.Default);
|
||||
calculationStore.setStatus('tbxNewClient', ElementStatus.Default);
|
||||
}
|
||||
},
|
||||
}),
|
||||
@ -457,13 +457,13 @@ const reactionEffects: IReactionEffect[] = [
|
||||
calculationStore.setValue('indAgentRewardCondition', null);
|
||||
calculationStore.setStatus(
|
||||
'selectIndAgentRewardCondition',
|
||||
Status.Disabled,
|
||||
ElementStatus.Disabled,
|
||||
);
|
||||
} else {
|
||||
calculationStore.setValue('indAgentRewardCondition', null);
|
||||
calculationStore.setStatus(
|
||||
'selectIndAgentRewardCondition',
|
||||
Status.Default,
|
||||
ElementStatus.Default,
|
||||
);
|
||||
|
||||
if (indAgentId)
|
||||
@ -518,13 +518,13 @@ const reactionEffects: IReactionEffect[] = [
|
||||
calculationStore.setValue('calcDoubleAgentRewardCondition', null);
|
||||
calculationStore.setStatus(
|
||||
'selectCalcDoubleAgentRewardCondition',
|
||||
Status.Disabled,
|
||||
ElementStatus.Disabled,
|
||||
);
|
||||
} else {
|
||||
calculationStore.setValue('calcDoubleAgentRewardCondition', null);
|
||||
calculationStore.setStatus(
|
||||
'selectCalcDoubleAgentRewardCondition',
|
||||
Status.Default,
|
||||
ElementStatus.Default,
|
||||
);
|
||||
|
||||
if (doubleAgentId)
|
||||
@ -578,13 +578,13 @@ const reactionEffects: IReactionEffect[] = [
|
||||
calculationStore.setValue('finDepartmentRewardCondtion', null);
|
||||
calculationStore.setStatus(
|
||||
'selectFinDepartmentRewardCondtion',
|
||||
Status.Disabled,
|
||||
ElementStatus.Disabled,
|
||||
);
|
||||
} else {
|
||||
calculationStore.setValue('finDepartmentRewardCondtion', null);
|
||||
calculationStore.setStatus(
|
||||
'selectFinDepartmentRewardCondtion',
|
||||
Status.Default,
|
||||
ElementStatus.Default,
|
||||
);
|
||||
if (calcFinDepartmentId)
|
||||
CrmService.crmgqlquery({
|
||||
@ -637,13 +637,13 @@ const reactionEffects: IReactionEffect[] = [
|
||||
calculationStore.setValue('calcBrokerRewardCondition', null);
|
||||
calculationStore.setStatus(
|
||||
'selectCalcBrokerRewardCondition',
|
||||
Status.Disabled,
|
||||
ElementStatus.Disabled,
|
||||
);
|
||||
} else {
|
||||
calculationStore.setValue('calcBrokerRewardCondition', null);
|
||||
calculationStore.setStatus(
|
||||
'selectCalcBrokerRewardCondition',
|
||||
Status.Default,
|
||||
ElementStatus.Default,
|
||||
);
|
||||
|
||||
if (calcBrokerId)
|
||||
@ -695,7 +695,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
effect: indAgentRewardConditionId => {
|
||||
if (!indAgentRewardConditionId) {
|
||||
calculationStore.setValue('indAgentRewardSumm', null);
|
||||
calculationStore.setStatus('tbxIndAgentRewardSumm', Status.Disabled);
|
||||
calculationStore.setStatus('tbxIndAgentRewardSumm', ElementStatus.Disabled);
|
||||
|
||||
const leadId = calculationStore.values.lead;
|
||||
if (leadId) {
|
||||
@ -706,7 +706,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
calculationStore.setValue('calcDoubleAgent', null);
|
||||
calculationStore.setStatus(
|
||||
'selectCalcDoubleAgent',
|
||||
Status.Disabled,
|
||||
ElementStatus.Disabled,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -719,9 +719,9 @@ const reactionEffects: IReactionEffect[] = [
|
||||
'indAgentRewardSumm',
|
||||
indAgentRewardCondition.evo_reward_summ || 0,
|
||||
);
|
||||
calculationStore.setStatus('tbxIndAgentRewardSumm', Status.Default);
|
||||
calculationStore.setStatus('tbxIndAgentRewardSumm', ElementStatus.Default);
|
||||
if (indAgentRewardCondition?.evo_double_agent_accountid) {
|
||||
calculationStore.setStatus('selectCalcDoubleAgent', Status.Default);
|
||||
calculationStore.setStatus('selectCalcDoubleAgent', ElementStatus.Default);
|
||||
const doubleAgent = calculationStore.options.selectCalcDoubleAgent?.find(
|
||||
x =>
|
||||
x.accountid ===
|
||||
@ -740,7 +740,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
calculationStore.setValue('calcDoubleAgent', null);
|
||||
calculationStore.setStatus(
|
||||
'selectCalcDoubleAgent',
|
||||
Status.Disabled,
|
||||
ElementStatus.Disabled,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -761,7 +761,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
calculationStore.setValue('calcDoubleAgentRewardSumm', 0);
|
||||
calculationStore.setStatus(
|
||||
'tbxCalcDoubleAgentRewardSumm',
|
||||
Status.Disabled,
|
||||
ElementStatus.Disabled,
|
||||
);
|
||||
} else {
|
||||
const calcDoubleAgentRewardCondition = calculationStore.options.selectCalcDoubleAgentRewardCondition?.find(
|
||||
@ -775,7 +775,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
);
|
||||
calculationStore.setStatus(
|
||||
'tbxCalcDoubleAgentRewardSumm',
|
||||
Status.Default,
|
||||
ElementStatus.Default,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -794,7 +794,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
effect: calcBrokerRewardConditionId => {
|
||||
if (!calcBrokerRewardConditionId) {
|
||||
calculationStore.setValue('calcBrokerRewardSum', 0);
|
||||
calculationStore.setStatus('tbxCalcBrokerRewardSum', Status.Disabled);
|
||||
calculationStore.setStatus('tbxCalcBrokerRewardSum', ElementStatus.Disabled);
|
||||
} else {
|
||||
const calcBrokerRewardCondition = calculationStore.options.selectCalcBrokerRewardCondition?.find(
|
||||
x => x.evo_reward_conditionid === calcBrokerRewardConditionId,
|
||||
@ -807,7 +807,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
);
|
||||
calculationStore.setStatus(
|
||||
'tbxCalcBrokerRewardSum',
|
||||
Status.Default,
|
||||
ElementStatus.Default,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -828,7 +828,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
calculationStore.setValue('finDepartmentRewardSumm', 0);
|
||||
calculationStore.setStatus(
|
||||
'tbxFinDepartmentRewardSumm',
|
||||
Status.Disabled,
|
||||
ElementStatus.Disabled,
|
||||
);
|
||||
} else {
|
||||
const finDepartmentRewardCondtion = calculationStore.options.selectFinDepartmentRewardCondtion?.find(
|
||||
@ -842,7 +842,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
);
|
||||
calculationStore.setStatus(
|
||||
'tbxFinDepartmentRewardSumm',
|
||||
Status.Default,
|
||||
ElementStatus.Default,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1080,9 +1080,9 @@ const reactionEffects: IReactionEffect[] = [
|
||||
effect: leaseObjectUsed => {
|
||||
if (leaseObjectUsed) {
|
||||
calculationStore.setValue('leaseObjectCount', 1);
|
||||
calculationStore.setStatus('tbxLeaseObjectCount', Status.Disabled);
|
||||
calculationStore.setStatus('tbxLeaseObjectCount', ElementStatus.Disabled);
|
||||
} else {
|
||||
calculationStore.setStatus('tbxLeaseObjectCount', Status.Default);
|
||||
calculationStore.setStatus('tbxLeaseObjectCount', ElementStatus.Default);
|
||||
}
|
||||
},
|
||||
options: {
|
||||
@ -1097,13 +1097,13 @@ const reactionEffects: IReactionEffect[] = [
|
||||
},
|
||||
effect: insUnlimitDrivers => {
|
||||
if (insUnlimitDrivers) {
|
||||
calculationStore.setStatus('tbxInsAgeDrivers', Status.Disabled);
|
||||
calculationStore.setStatus('tbxInsExpDrivers', Status.Disabled);
|
||||
calculationStore.setStatus('btnDriversApplication', Status.Disabled);
|
||||
calculationStore.setStatus('tbxInsAgeDrivers', ElementStatus.Disabled);
|
||||
calculationStore.setStatus('tbxInsExpDrivers', ElementStatus.Disabled);
|
||||
calculationStore.setStatus('btnDriversApplication', ElementStatus.Disabled);
|
||||
} else {
|
||||
calculationStore.setStatus('tbxInsAgeDrivers', Status.Default);
|
||||
calculationStore.setStatus('tbxInsExpDrivers', Status.Default);
|
||||
calculationStore.setStatus('btnDriversApplication', Status.Default);
|
||||
calculationStore.setStatus('tbxInsAgeDrivers', ElementStatus.Default);
|
||||
calculationStore.setStatus('tbxInsExpDrivers', ElementStatus.Default);
|
||||
calculationStore.setStatus('btnDriversApplication', ElementStatus.Default);
|
||||
}
|
||||
},
|
||||
options: {
|
||||
@ -1118,9 +1118,9 @@ const reactionEffects: IReactionEffect[] = [
|
||||
},
|
||||
effect: insFranchise => {
|
||||
if (!insFranchise || parseInt(insFranchise) === 0) {
|
||||
calculationStore.setStatus('btnFranschise', Status.Disabled);
|
||||
calculationStore.setStatus('btnFranschise', ElementStatus.Disabled);
|
||||
} else {
|
||||
calculationStore.setStatus('btnFranschise', Status.Default);
|
||||
calculationStore.setStatus('btnFranschise', ElementStatus.Default);
|
||||
}
|
||||
},
|
||||
options: {
|
||||
@ -1136,11 +1136,11 @@ const reactionEffects: IReactionEffect[] = [
|
||||
effect: lastPaymentRule => {
|
||||
if (lastPaymentRule) {
|
||||
if (lastPaymentRule === 100000000) {
|
||||
calculationStore.setStatus('tbxLastPaymentPerc', Status.Disabled);
|
||||
calculationStore.setStatus('tbxLastPaymentRub', Status.Default);
|
||||
calculationStore.setStatus('tbxLastPaymentPerc', ElementStatus.Disabled);
|
||||
calculationStore.setStatus('tbxLastPaymentRub', ElementStatus.Default);
|
||||
} else {
|
||||
calculationStore.setStatus('tbxLastPaymentPerc', Status.Default);
|
||||
calculationStore.setStatus('tbxLastPaymentRub', Status.Disabled);
|
||||
calculationStore.setStatus('tbxLastPaymentPerc', ElementStatus.Default);
|
||||
calculationStore.setStatus('tbxLastPaymentRub', ElementStatus.Disabled);
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1227,37 +1227,37 @@ const reactionEffects: IReactionEffect[] = [
|
||||
if (graphType) {
|
||||
switch (graphType) {
|
||||
case 100000002: {
|
||||
calculationStore.setStatus('radioSeasonType', Status.Disabled);
|
||||
calculationStore.setStatus('radioSeasonType', ElementStatus.Disabled);
|
||||
calculationStore.setStatus(
|
||||
'tbxParmentsDecreasePercent',
|
||||
Status.Default,
|
||||
ElementStatus.Default,
|
||||
);
|
||||
calculationStore.setStatus(
|
||||
'selectHighSeasonStart',
|
||||
Status.Disabled,
|
||||
ElementStatus.Disabled,
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
case 100000003: {
|
||||
calculationStore.setStatus('radioSeasonType', Status.Default);
|
||||
calculationStore.setStatus('radioSeasonType', ElementStatus.Default);
|
||||
calculationStore.setStatus(
|
||||
'tbxParmentsDecreasePercent',
|
||||
Status.Disabled,
|
||||
ElementStatus.Disabled,
|
||||
);
|
||||
calculationStore.setStatus('selectHighSeasonStart', Status.Default);
|
||||
calculationStore.setStatus('selectHighSeasonStart', ElementStatus.Default);
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
calculationStore.setStatus('radioSeasonType', Status.Disabled);
|
||||
calculationStore.setStatus('radioSeasonType', ElementStatus.Disabled);
|
||||
calculationStore.setStatus(
|
||||
'tbxParmentsDecreasePercent',
|
||||
Status.Disabled,
|
||||
ElementStatus.Disabled,
|
||||
);
|
||||
calculationStore.setStatus(
|
||||
'selectHighSeasonStart',
|
||||
Status.Disabled,
|
||||
ElementStatus.Disabled,
|
||||
);
|
||||
break;
|
||||
}
|
||||
@ -1305,13 +1305,13 @@ const reactionEffects: IReactionEffect[] = [
|
||||
effect: leasingPeriod => {
|
||||
if (leasingPeriod) {
|
||||
if (parseInt(leasingPeriod) < 12) {
|
||||
calculationStore.setStatus('radioBalanceHolder', Status.Disabled);
|
||||
calculationStore.setStatus('radioBalanceHolder', ElementStatus.Disabled);
|
||||
calculationStore.setValue('balanceHolder', 100000000);
|
||||
calculationStore.setValue('insNSIB', null);
|
||||
calculationStore.setStatus('selectInsNSIB', Status.Disabled);
|
||||
calculationStore.setStatus('selectInsNSIB', ElementStatus.Disabled);
|
||||
} else {
|
||||
calculationStore.setStatus('radioBalanceHolder', Status.Default);
|
||||
calculationStore.setStatus('selectInsNSIB', Status.Default);
|
||||
calculationStore.setStatus('radioBalanceHolder', ElementStatus.Default);
|
||||
calculationStore.setStatus('selectInsNSIB', ElementStatus.Default);
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1330,13 +1330,13 @@ const reactionEffects: IReactionEffect[] = [
|
||||
if (balanceHolder === 100000001) {
|
||||
calculationStore.setStatus(
|
||||
'cbxLastPaymentRedemption',
|
||||
Status.Disabled,
|
||||
ElementStatus.Disabled,
|
||||
);
|
||||
calculationStore.setValue('lastPaymentRedemption', true);
|
||||
} else {
|
||||
calculationStore.setStatus(
|
||||
'cbxLastPaymentRedemption',
|
||||
Status.Default,
|
||||
ElementStatus.Default,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1389,7 +1389,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
'dealerPerson',
|
||||
entities.account[0].accountid,
|
||||
);
|
||||
calculationStore.setStatus('selectDealerPerson', Status.Default);
|
||||
calculationStore.setStatus('selectDealerPerson', ElementStatus.Default);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -1397,7 +1397,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
|
||||
calculationStore.setOptions('selectDealerPerson', []);
|
||||
calculationStore.setValue('dealerPerson', null);
|
||||
calculationStore.setStatus('selectDealerPerson', Status.Disabled);
|
||||
calculationStore.setStatus('selectDealerPerson', ElementStatus.Disabled);
|
||||
},
|
||||
options: {
|
||||
fireImmediately: true,
|
||||
@ -1412,7 +1412,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
effect: dealerPersonId => {
|
||||
calculationStore.setOptions('selectDealerBroker', []);
|
||||
calculationStore.setValue('dealerBroker', null);
|
||||
calculationStore.setStatus('selectDealerBroker', Status.Disabled);
|
||||
calculationStore.setStatus('selectDealerBroker', ElementStatus.Disabled);
|
||||
if (dealerPersonId) {
|
||||
const dealerPerson = calculationStore.options.selectDealerPerson?.find(
|
||||
x => x.accountid === dealerPersonId,
|
||||
@ -1440,7 +1440,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
'dealerBroker',
|
||||
entities.account.accountid,
|
||||
);
|
||||
calculationStore.setStatus('selectDealerBroker', Status.Default);
|
||||
calculationStore.setStatus('selectDealerBroker', ElementStatus.Default);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -1464,7 +1464,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
if (dealerBroker) {
|
||||
calculationStore.setStatus(
|
||||
'selectDealerBrokerRewardCondition',
|
||||
Status.Default,
|
||||
ElementStatus.Default,
|
||||
);
|
||||
|
||||
CrmService.crmgqlquery({
|
||||
@ -1505,7 +1505,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
calculationStore.setValue('dealerBrokerRewardCondition', null);
|
||||
calculationStore.setStatus(
|
||||
'selectDealerBrokerRewardCondition',
|
||||
Status.Disabled,
|
||||
ElementStatus.Disabled,
|
||||
);
|
||||
}
|
||||
},
|
||||
@ -1523,7 +1523,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
if (dealerPersonId && !dealerBrokerId) {
|
||||
calculationStore.setStatus(
|
||||
'selectDealerRewardCondition',
|
||||
Status.Default,
|
||||
ElementStatus.Default,
|
||||
);
|
||||
|
||||
CrmService.crmgqlquery({
|
||||
@ -1563,7 +1563,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
calculationStore.setValue('dealerRewardCondition', null);
|
||||
calculationStore.setStatus(
|
||||
'selectDealerRewardCondition',
|
||||
Status.Disabled,
|
||||
ElementStatus.Disabled,
|
||||
);
|
||||
}
|
||||
},
|
||||
@ -1580,7 +1580,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
effect: dealerRewardConditionId => {
|
||||
if (!dealerRewardConditionId) {
|
||||
calculationStore.setValue('dealerRewardSumm', 0);
|
||||
calculationStore.setStatus('tbxDealerRewardSumm', Status.Disabled);
|
||||
calculationStore.setStatus('tbxDealerRewardSumm', ElementStatus.Disabled);
|
||||
} else {
|
||||
const dealerRewardContition = calculationStore.options.selectDealerRewardCondition?.find(
|
||||
x => x.evo_reward_conditionid === dealerRewardConditionId,
|
||||
@ -1591,7 +1591,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
'dealerRewardSumm',
|
||||
dealerRewardContition.evo_reward_summ,
|
||||
);
|
||||
calculationStore.setStatus('tbxDealerRewardSumm', Status.Default);
|
||||
calculationStore.setStatus('tbxDealerRewardSumm', ElementStatus.Default);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1611,7 +1611,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
calculationStore.setValue('dealerBrokerRewardSumm', 0);
|
||||
calculationStore.setStatus(
|
||||
'tbxDealerBrokerRewardSumm',
|
||||
Status.Disabled,
|
||||
ElementStatus.Disabled,
|
||||
);
|
||||
} else {
|
||||
const dealerBrokerRewardContition = calculationStore.options.selectDealerBrokerRewardCondition?.find(
|
||||
@ -1625,7 +1625,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
);
|
||||
calculationStore.setStatus(
|
||||
'tbxDealerBrokerRewardSumm',
|
||||
Status.Default,
|
||||
ElementStatus.Default,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1751,7 +1751,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
return brand;
|
||||
},
|
||||
effect: brandId => {
|
||||
calculationStore.setStatus('selectModel', Status.Disabled);
|
||||
calculationStore.setStatus('selectModel', ElementStatus.Disabled);
|
||||
calculationStore.setOptions('selectModel', []);
|
||||
calculationStore.setValue('model', null);
|
||||
|
||||
@ -1787,7 +1787,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
Array.isArray(entities.evo_model) &&
|
||||
entities.evo_model.length > 0
|
||||
) {
|
||||
calculationStore.setStatus('selectModel', Status.Default);
|
||||
calculationStore.setStatus('selectModel', ElementStatus.Default);
|
||||
calculationStore.setOptions('selectModel', entities.evo_model);
|
||||
calculationStore.setValue('model', null);
|
||||
}
|
||||
@ -1804,7 +1804,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
return model;
|
||||
},
|
||||
effect: modelId => {
|
||||
calculationStore.setStatus('selectConfiguration', Status.Disabled);
|
||||
calculationStore.setStatus('selectConfiguration', ElementStatus.Disabled);
|
||||
calculationStore.setOptions('selectConfiguration', []);
|
||||
calculationStore.setValue('configuration', null);
|
||||
|
||||
@ -1839,7 +1839,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
Array.isArray(entities.evo_equipment) &&
|
||||
entities.evo_equipment.length > 0
|
||||
) {
|
||||
calculationStore.setStatus('selectConfiguration', Status.Default);
|
||||
calculationStore.setStatus('selectConfiguration', ElementStatus.Default);
|
||||
calculationStore.setOptions(
|
||||
'selectConfiguration',
|
||||
entities.evo_equipment,
|
||||
@ -2187,13 +2187,13 @@ const reactionEffects: IReactionEffect[] = [
|
||||
},
|
||||
effect: recalcWithRevision => {
|
||||
if (recalcWithRevision === true) {
|
||||
calculationStore.setStatus('selectLead', Status.Disabled);
|
||||
calculationStore.setStatus('selectOpportunity', Status.Disabled);
|
||||
calculationStore.setStatus('selectQuote', Status.Disabled);
|
||||
calculationStore.setStatus('selectLead', ElementStatus.Disabled);
|
||||
calculationStore.setStatus('selectOpportunity', ElementStatus.Disabled);
|
||||
calculationStore.setStatus('selectQuote', ElementStatus.Disabled);
|
||||
} else {
|
||||
calculationStore.setStatus('selectLead', Status.Default);
|
||||
calculationStore.setStatus('selectOpportunity', Status.Default);
|
||||
calculationStore.setStatus('selectQuote', Status.Default);
|
||||
calculationStore.setStatus('selectLead', ElementStatus.Default);
|
||||
calculationStore.setStatus('selectOpportunity', ElementStatus.Default);
|
||||
calculationStore.setStatus('selectQuote', ElementStatus.Default);
|
||||
}
|
||||
},
|
||||
options: {
|
||||
@ -2253,9 +2253,9 @@ const reactionEffects: IReactionEffect[] = [
|
||||
effect: leaseObjectUsed => {
|
||||
if (leaseObjectUsed === true) {
|
||||
calculationStore.setValue('deliveryTime', 100000000);
|
||||
calculationStore.setStatus('radioDeliveryTime', Status.Disabled);
|
||||
calculationStore.setStatus('radioDeliveryTime', ElementStatus.Disabled);
|
||||
} else {
|
||||
calculationStore.setStatus('radioDeliveryTime', Status.Default);
|
||||
calculationStore.setStatus('radioDeliveryTime', ElementStatus.Default);
|
||||
}
|
||||
},
|
||||
options: {
|
||||
@ -2274,9 +2274,9 @@ const reactionEffects: IReactionEffect[] = [
|
||||
leaseObjectCategory === 100000001
|
||||
) {
|
||||
calculationStore.setValue('withTrailer', null);
|
||||
calculationStore.setStatus('selectWithTrailer', Status.Disabled);
|
||||
calculationStore.setStatus('selectWithTrailer', ElementStatus.Disabled);
|
||||
} else {
|
||||
calculationStore.setStatus('selectWithTrailer', Status.Default);
|
||||
calculationStore.setStatus('selectWithTrailer', ElementStatus.Default);
|
||||
}
|
||||
},
|
||||
options: {
|
||||
@ -2290,7 +2290,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
return quote;
|
||||
},
|
||||
effect: quoteId => {
|
||||
calculationStore.setStatus('cbxRecalcWithRevision', Status.Disabled);
|
||||
calculationStore.setStatus('cbxRecalcWithRevision', ElementStatus.Disabled);
|
||||
if (quoteId) {
|
||||
const quote = calculationStore.options.selectQuote?.find(
|
||||
x => x.quoteid === quoteId,
|
||||
@ -2300,7 +2300,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
if (quote.evo_statuscode?.evo_id === '2.3') {
|
||||
calculationStore.setStatus(
|
||||
'cbxRecalcWithRevision',
|
||||
Status.Default,
|
||||
ElementStatus.Default,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -2472,7 +2472,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
'tableInsurance',
|
||||
kaskoRowIndex,
|
||||
)({
|
||||
insured: { value: 100000001, status: Status.Disabled },
|
||||
insured: { value: 100000001, status: ElementStatus.Disabled },
|
||||
});
|
||||
} else {
|
||||
if (kaskoRowIndex >= 0)
|
||||
@ -2480,7 +2480,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
'tableInsurance',
|
||||
kaskoRowIndex,
|
||||
)({
|
||||
insured: { status: Status.Default },
|
||||
insured: { status: ElementStatus.Default },
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -2506,26 +2506,26 @@ const reactionEffects: IReactionEffect[] = [
|
||||
'tableInsurance',
|
||||
kaskoRowIndex,
|
||||
)({
|
||||
insured: { value: 100000000, status: Status.Disabled },
|
||||
insured: { value: 100000000, status: ElementStatus.Disabled },
|
||||
});
|
||||
calculationStore.setTableRow(
|
||||
'tableInsurance',
|
||||
osagoRowIndex,
|
||||
)({
|
||||
insured: { value: 100000000, status: Status.Disabled },
|
||||
insured: { value: 100000000, status: ElementStatus.Disabled },
|
||||
});
|
||||
} else {
|
||||
calculationStore.setTableRow(
|
||||
'tableInsurance',
|
||||
kaskoRowIndex,
|
||||
)({
|
||||
insured: { value: 100000000, status: Status.Default },
|
||||
insured: { value: 100000000, status: ElementStatus.Default },
|
||||
});
|
||||
calculationStore.setTableRow(
|
||||
'tableInsurance',
|
||||
osagoRowIndex,
|
||||
)({
|
||||
insured: { status: Status.Default },
|
||||
insured: { status: ElementStatus.Default },
|
||||
});
|
||||
}
|
||||
|
||||
@ -2534,7 +2534,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
'tableInsurance',
|
||||
kaskoRowIndex,
|
||||
)({
|
||||
insTerm: { value: 100000000, status: Status.Disabled },
|
||||
insTerm: { value: 100000000, status: ElementStatus.Disabled },
|
||||
});
|
||||
return;
|
||||
} else if (leasingPeriod > 12 && leasingPeriod < 16) {
|
||||
@ -2542,7 +2542,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
'tableInsurance',
|
||||
kaskoRowIndex,
|
||||
)({
|
||||
insTerm: { value: 100000001, status: Status.Disabled },
|
||||
insTerm: { value: 100000001, status: ElementStatus.Disabled },
|
||||
});
|
||||
return;
|
||||
} else {
|
||||
@ -2550,8 +2550,8 @@ const reactionEffects: IReactionEffect[] = [
|
||||
'tableInsurance',
|
||||
kaskoRowIndex,
|
||||
)({
|
||||
insured: { status: Status.Default },
|
||||
insTerm: { status: Status.Default },
|
||||
insured: { status: ElementStatus.Default },
|
||||
insTerm: { status: ElementStatus.Default },
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -2798,7 +2798,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
{
|
||||
paymentRelation: {
|
||||
value: firstPaymentPerc,
|
||||
status: Status.Disabled,
|
||||
status: ElementStatus.Disabled,
|
||||
},
|
||||
},
|
||||
];
|
||||
@ -2810,7 +2810,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
const middleRows = Array.from({ length: leasingPeriod - 2 }, () => ({
|
||||
paymentRelation: {
|
||||
value: 100,
|
||||
status: Status.Disabled,
|
||||
status: ElementStatus.Disabled,
|
||||
},
|
||||
}));
|
||||
payments = [...payments, ...middleRows];
|
||||
@ -2822,7 +2822,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
const middleRows = Array.from({ length: leasingPeriod - 3 }, () => ({
|
||||
paymentRelation: {
|
||||
value: 100,
|
||||
status: Status.Default,
|
||||
status: ElementStatus.Default,
|
||||
},
|
||||
}));
|
||||
payments = [
|
||||
@ -2830,7 +2830,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
{
|
||||
paymentRelation: {
|
||||
value: 100,
|
||||
status: Status.Disabled,
|
||||
status: ElementStatus.Disabled,
|
||||
},
|
||||
},
|
||||
...middleRows,
|
||||
@ -2845,7 +2845,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
(v, i) => ({
|
||||
paymentRelation: {
|
||||
value: 100,
|
||||
status: Status.Disabled,
|
||||
status: ElementStatus.Disabled,
|
||||
},
|
||||
}),
|
||||
);
|
||||
@ -2865,7 +2865,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
{
|
||||
paymentRelation: {
|
||||
value: 100,
|
||||
status: Status.Disabled,
|
||||
status: ElementStatus.Disabled,
|
||||
},
|
||||
},
|
||||
...middleRows,
|
||||
@ -2986,7 +2986,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
i - nextPeriodsNumber * Math.floor(i / nextPeriodsNumber)
|
||||
],
|
||||
status:
|
||||
i < nextPeriodsNumber ? Status.Default : Status.Disabled,
|
||||
i < nextPeriodsNumber ? ElementStatus.Default : ElementStatus.Disabled,
|
||||
},
|
||||
};
|
||||
},
|
||||
@ -3001,7 +3001,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
const middleRows = Array.from({ length: leasingPeriod - 5 }, () => ({
|
||||
paymentRelation: {
|
||||
value: 100,
|
||||
status: Status.Disabled,
|
||||
status: ElementStatus.Disabled,
|
||||
},
|
||||
}));
|
||||
|
||||
@ -3010,19 +3010,19 @@ const reactionEffects: IReactionEffect[] = [
|
||||
{
|
||||
paymentRelation: {
|
||||
value: 25,
|
||||
status: Status.Default,
|
||||
status: ElementStatus.Default,
|
||||
},
|
||||
},
|
||||
{
|
||||
paymentRelation: {
|
||||
value: 50,
|
||||
status: Status.Default,
|
||||
status: ElementStatus.Default,
|
||||
},
|
||||
},
|
||||
{
|
||||
paymentRelation: {
|
||||
value: 75,
|
||||
status: Status.Default,
|
||||
status: ElementStatus.Default,
|
||||
},
|
||||
},
|
||||
...middleRows,
|
||||
@ -3040,7 +3040,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
{
|
||||
paymentRelation: {
|
||||
value: lastPaymentPerc,
|
||||
status: Status.Disabled,
|
||||
status: ElementStatus.Disabled,
|
||||
},
|
||||
},
|
||||
];
|
||||
@ -3210,7 +3210,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
return GPSBrand;
|
||||
},
|
||||
effect: GPSBrandId => {
|
||||
calculationStore.setStatus('selectGPSModel', Status.Disabled);
|
||||
calculationStore.setStatus('selectGPSModel', ElementStatus.Disabled);
|
||||
calculationStore.setOptions('selectGPSModel', []);
|
||||
calculationStore.setValue('GPSModel', null);
|
||||
|
||||
@ -3242,7 +3242,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
Array.isArray(entities.evo_gps_model) &&
|
||||
entities.evo_gps_model.length > 0
|
||||
) {
|
||||
calculationStore.setStatus('selectGPSModel', Status.Default);
|
||||
calculationStore.setStatus('selectGPSModel', ElementStatus.Default);
|
||||
calculationStore.setOptions(
|
||||
'selectGPSModel',
|
||||
entities.evo_gps_model,
|
||||
@ -3262,7 +3262,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
return regionRegistration;
|
||||
},
|
||||
effect: regionRegistrationId => {
|
||||
calculationStore.setStatus('selectTownRegistration', Status.Disabled);
|
||||
calculationStore.setStatus('selectTownRegistration', ElementStatus.Disabled);
|
||||
calculationStore.setOptions('selectTownRegistration', []);
|
||||
calculationStore.setValue('townRegistration', null);
|
||||
|
||||
@ -3296,7 +3296,7 @@ const reactionEffects: IReactionEffect[] = [
|
||||
) {
|
||||
calculationStore.setStatus(
|
||||
'selectTownRegistration',
|
||||
Status.Default,
|
||||
ElementStatus.Default,
|
||||
);
|
||||
calculationStore.setOptions(
|
||||
'selectTownRegistration',
|
||||
|
||||
@ -1,43 +1,43 @@
|
||||
import { Status } from 'core/types/statuses';
|
||||
import { ElementStatus } from 'core/types/statuses';
|
||||
import { TElements } from 'core/types/Calculation/Store/elements';
|
||||
|
||||
const initialStatuses: TElements<Status> = {
|
||||
selectIndAgent: Status.Disabled,
|
||||
selectCalcBroker: Status.Disabled,
|
||||
selectCalcFinDepartment: Status.Disabled,
|
||||
selectDoubleAgent: Status.Disabled,
|
||||
selectCalcDoubleAgent: Status.Disabled,
|
||||
tbxInsKaskoPriceLeasePeriod: Status.Disabled,
|
||||
selectClientType: Status.Disabled,
|
||||
selectTelematic: Status.Disabled,
|
||||
selectTechnicalCard: Status.Disabled,
|
||||
tbxImporterRewardRub: Status.Disabled,
|
||||
tbxImporterRewardPerc: Status.Disabled,
|
||||
tbxMaxPriceChange: Status.Disabled,
|
||||
cbxInsDecentral: Status.Disabled,
|
||||
tbxCreditRate: Status.Disabled,
|
||||
selectRate: Status.Disabled,
|
||||
selectTarif: Status.Disabled,
|
||||
const initialStatuses: TElements<ElementStatus> = {
|
||||
selectIndAgent: ElementStatus.Disabled,
|
||||
selectCalcBroker: ElementStatus.Disabled,
|
||||
selectCalcFinDepartment: ElementStatus.Disabled,
|
||||
selectDoubleAgent: ElementStatus.Disabled,
|
||||
selectCalcDoubleAgent: ElementStatus.Disabled,
|
||||
tbxInsKaskoPriceLeasePeriod: ElementStatus.Disabled,
|
||||
selectClientType: ElementStatus.Disabled,
|
||||
selectTelematic: ElementStatus.Disabled,
|
||||
selectTechnicalCard: ElementStatus.Disabled,
|
||||
tbxImporterRewardRub: ElementStatus.Disabled,
|
||||
tbxImporterRewardPerc: ElementStatus.Disabled,
|
||||
tbxMaxPriceChange: ElementStatus.Disabled,
|
||||
cbxInsDecentral: ElementStatus.Disabled,
|
||||
tbxCreditRate: ElementStatus.Disabled,
|
||||
selectRate: ElementStatus.Disabled,
|
||||
selectTarif: ElementStatus.Disabled,
|
||||
|
||||
selectChannel: Status.Disabled,
|
||||
tbxNewClient: Status.Disabled,
|
||||
selectAccount: Status.Disabled,
|
||||
tbxINN: Status.Disabled,
|
||||
tbxKPP: Status.Disabled,
|
||||
selectContactClient: Status.Disabled,
|
||||
tbxContact: Status.Disabled,
|
||||
radioContactGender: Status.Disabled,
|
||||
tbxPhoneNumber: Status.Disabled,
|
||||
tbxEmailAddress: Status.Disabled,
|
||||
selectSupplier: Status.Disabled,
|
||||
selectFinDepartment: Status.Disabled,
|
||||
selectBroker: Status.Disabled,
|
||||
selectAgent: Status.Disabled,
|
||||
tbxCommentLead: Status.Disabled,
|
||||
btnCreateLead: Status.Disabled,
|
||||
selectChannel: ElementStatus.Disabled,
|
||||
tbxNewClient: ElementStatus.Disabled,
|
||||
selectAccount: ElementStatus.Disabled,
|
||||
tbxINN: ElementStatus.Disabled,
|
||||
tbxKPP: ElementStatus.Disabled,
|
||||
selectContactClient: ElementStatus.Disabled,
|
||||
tbxContact: ElementStatus.Disabled,
|
||||
radioContactGender: ElementStatus.Disabled,
|
||||
tbxPhoneNumber: ElementStatus.Disabled,
|
||||
tbxEmailAddress: ElementStatus.Disabled,
|
||||
selectSupplier: ElementStatus.Disabled,
|
||||
selectFinDepartment: ElementStatus.Disabled,
|
||||
selectBroker: ElementStatus.Disabled,
|
||||
selectAgent: ElementStatus.Disabled,
|
||||
tbxCommentLead: ElementStatus.Disabled,
|
||||
btnCreateLead: ElementStatus.Disabled,
|
||||
|
||||
selectRegistration: Status.Disabled,
|
||||
selectTracker: Status.Disabled,
|
||||
selectRegistration: ElementStatus.Disabled,
|
||||
selectTracker: ElementStatus.Disabled,
|
||||
};
|
||||
|
||||
export default initialStatuses;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { openNotification } from 'client/Elements/Notification';
|
||||
import { ITable } from 'core/types/Calculation/Store/tables';
|
||||
import { Status } from 'core/types/statuses';
|
||||
import { ElementStatus } from 'core/types/statuses';
|
||||
|
||||
const tableInsurance: ITable = {
|
||||
rows: [
|
||||
@ -25,7 +25,7 @@ const tableInsurance: ITable = {
|
||||
},
|
||||
insTerm: {
|
||||
value: 100000000,
|
||||
status: Status.Disabled,
|
||||
status: ElementStatus.Disabled,
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -49,7 +49,7 @@ const tableInsurance: ITable = {
|
||||
},
|
||||
insTerm: {
|
||||
value: null,
|
||||
status: Status.Disabled,
|
||||
status: ElementStatus.Disabled,
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -58,7 +58,7 @@ const tableInsurance: ITable = {
|
||||
},
|
||||
insuranceCompany: {
|
||||
value: null,
|
||||
status: Status.Disabled,
|
||||
status: ElementStatus.Disabled,
|
||||
filter: options =>
|
||||
options.filter(
|
||||
x =>
|
||||
@ -68,14 +68,14 @@ const tableInsurance: ITable = {
|
||||
},
|
||||
insured: {
|
||||
value: null,
|
||||
status: Status.Disabled,
|
||||
status: ElementStatus.Disabled,
|
||||
},
|
||||
insCost: {
|
||||
value: 0,
|
||||
},
|
||||
insTerm: {
|
||||
value: null,
|
||||
status: Status.Disabled,
|
||||
status: ElementStatus.Disabled,
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -84,7 +84,7 @@ const tableInsurance: ITable = {
|
||||
},
|
||||
insuranceCompany: {
|
||||
value: null,
|
||||
status: Status.Disabled,
|
||||
status: ElementStatus.Disabled,
|
||||
filter: options =>
|
||||
options.filter(
|
||||
x =>
|
||||
@ -94,14 +94,14 @@ const tableInsurance: ITable = {
|
||||
},
|
||||
insured: {
|
||||
value: null,
|
||||
status: Status.Disabled,
|
||||
status: ElementStatus.Disabled,
|
||||
},
|
||||
insCost: {
|
||||
value: 0,
|
||||
},
|
||||
insTerm: {
|
||||
value: null,
|
||||
status: Status.Disabled,
|
||||
status: ElementStatus.Disabled,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { CRMEntityNames } from '../../Entities/crmEntityNames';
|
||||
import { Status } from '../../statuses';
|
||||
import { ElementStatus } from '../../statuses';
|
||||
import { TCRMEntity } from '../../Entities/crmEntities';
|
||||
import { ElementsNames, TElements } from './elements';
|
||||
import { TElementFilter } from './filters';
|
||||
@ -43,9 +43,9 @@ interface ICalculationValues {
|
||||
newValue: TValue,
|
||||
) => void;
|
||||
|
||||
statuses: TElements<Status>;
|
||||
getStatus: (elementName: ElementsNames) => Status;
|
||||
setStatus: (elementName: ElementsNames, status: Status) => void;
|
||||
statuses: TElements<ElementStatus>;
|
||||
getStatus: (elementName: ElementsNames) => ElementStatus;
|
||||
setStatus: (elementName: ElementsNames, status: ElementStatus) => void;
|
||||
|
||||
validations: TElements<boolean>;
|
||||
getValidation: (elementName: ElementsNames) => boolean;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { TCRMEntity } from './../../Entities/crmEntities';
|
||||
import { Status } from '../../statuses';
|
||||
import { ElementStatus } from '../../statuses';
|
||||
import { ICalculationStore } from './';
|
||||
import { TElementFilter } from './filters';
|
||||
import { IBaseOption } from './options';
|
||||
@ -26,7 +26,7 @@ export type TCellCallback = (
|
||||
|
||||
export interface ITableCell {
|
||||
value?: any;
|
||||
status?: Status;
|
||||
status?: ElementStatus;
|
||||
validation?: boolean;
|
||||
filter?: TElementFilter;
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
export enum Status {
|
||||
export enum ElementStatus {
|
||||
Default,
|
||||
Disabled,
|
||||
Hidden,
|
||||
|
||||
Reference in New Issue
Block a user