@redneckz/wildless-cms-uni-blocks 0.14.1041 → 0.14.1043
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle.umd.js +22 -6
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
- package/bundle/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
- package/bundle/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
- package/dist/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
- package/dist/retail/components/DraftDialog/DraftDialog.js +3 -8
- package/dist/retail/components/DraftDialog/DraftDialog.js.map +1 -1
- package/dist/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
- package/dist/retail/components/DraftDialog/DraftDialogContent.js +11 -0
- package/dist/retail/components/DraftDialog/DraftDialogContent.js.map +1 -0
- package/dist/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
- package/dist/retail/components/DraftDialog/creditProgramCodes.js +17 -1
- package/dist/retail/components/DraftDialog/creditProgramCodes.js.map +1 -1
- package/lib/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
- package/lib/retail/components/DraftDialog/DraftDialog.js +5 -10
- package/lib/retail/components/DraftDialog/DraftDialog.js.map +1 -1
- package/lib/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
- package/lib/retail/components/DraftDialog/DraftDialogContent.js +9 -0
- package/lib/retail/components/DraftDialog/DraftDialogContent.js.map +1 -0
- package/lib/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
- package/lib/retail/components/DraftDialog/creditProgramCodes.js +15 -0
- package/lib/retail/components/DraftDialog/creditProgramCodes.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +22 -6
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
- package/mobile/bundle/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
- package/mobile/bundle/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
- package/mobile/dist/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
- package/mobile/dist/retail/components/DraftDialog/DraftDialog.js +3 -8
- package/mobile/dist/retail/components/DraftDialog/DraftDialog.js.map +1 -1
- package/mobile/dist/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
- package/mobile/dist/retail/components/DraftDialog/DraftDialogContent.js +11 -0
- package/mobile/dist/retail/components/DraftDialog/DraftDialogContent.js.map +1 -0
- package/mobile/dist/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
- package/mobile/dist/retail/components/DraftDialog/creditProgramCodes.js +17 -1
- package/mobile/dist/retail/components/DraftDialog/creditProgramCodes.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
- package/mobile/lib/retail/components/DraftDialog/DraftDialog.js +5 -10
- package/mobile/lib/retail/components/DraftDialog/DraftDialog.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
- package/mobile/lib/retail/components/DraftDialog/DraftDialogContent.js +9 -0
- package/mobile/lib/retail/components/DraftDialog/DraftDialogContent.js.map +1 -0
- package/mobile/lib/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
- package/mobile/lib/retail/components/DraftDialog/creditProgramCodes.js +15 -0
- package/mobile/lib/retail/components/DraftDialog/creditProgramCodes.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +5 -1
- package/mobile/src/retail/components/DraftDialog/DraftDialog.tsx +14 -39
- package/mobile/src/retail/components/DraftDialog/DraftDialogContent.tsx +49 -0
- package/mobile/src/retail/components/DraftDialog/creditProgramCodes.ts +24 -0
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationForm.example.json +5 -1
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +5 -1
- package/src/icons/IconName.ts +4 -4
- package/src/retail/components/DraftDialog/DraftDialog.tsx +14 -39
- package/src/retail/components/DraftDialog/DraftDialogContent.tsx +49 -0
- package/src/retail/components/DraftDialog/creditProgramCodes.ts +24 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type OnCloseProps } from '../../../model/OnCloseProps';
|
|
2
2
|
import { type Task } from '../../api/draftTasksKZO';
|
|
3
3
|
import { type DraftTaskType } from '../../model/DraftTaskType';
|
|
4
4
|
export interface DraftDialogProps extends OnCloseProps {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type OnCloseProps } from '../../../model/OnCloseProps';
|
|
2
|
+
import { type getProductData } from './utils';
|
|
3
|
+
export interface DraftDialogContentProps extends OnCloseProps {
|
|
4
|
+
createdDate: string;
|
|
5
|
+
productData: ReturnType<typeof getProductData>;
|
|
6
|
+
isFromLead: boolean;
|
|
7
|
+
handleGoToDraft: () => void;
|
|
8
|
+
handleGoToNewTask: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const DraftDialogContent: import("@redneckz/uni-jsx").UNIComponent<DraftDialogContentProps, any, any>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type DraftTaskType } from '../../model/DraftTaskType';
|
|
1
2
|
export declare const creditCodesToProgrammIdMap: {
|
|
2
3
|
credit_cash: string;
|
|
3
4
|
credit_cash_single_doc: string;
|
|
@@ -37,3 +38,4 @@ export declare const creditProgramCodeToProductIdMap: {
|
|
|
37
38
|
summer_cash: string;
|
|
38
39
|
summer_cash_pens: string;
|
|
39
40
|
};
|
|
41
|
+
export declare const getCreditProgramTaskType: (creditProgramCode?: string, isDebit?: boolean) => DraftTaskType | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type OnCloseProps } from '../../../model/OnCloseProps';
|
|
2
2
|
import { type Task } from '../../api/draftTasksKZO';
|
|
3
3
|
import { type DraftTaskType } from '../../model/DraftTaskType';
|
|
4
4
|
export interface DraftDialogProps extends OnCloseProps {
|
|
@@ -5,26 +5,21 @@ const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
|
5
5
|
const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
|
|
6
6
|
const locationNavigator_1 = require("../../../external/locationNavigator");
|
|
7
7
|
const Dialog_1 = require("../../../ui-kit/DialogManager/Dialog");
|
|
8
|
-
const Heading_1 = require("../../../ui-kit/Heading/Heading");
|
|
9
|
-
const formatDate_1 = require("../../../utils/formatDate");
|
|
10
8
|
const noop_1 = require("../../../utils/noop");
|
|
11
9
|
const sendMessage_1 = require("../../api/sendMessage");
|
|
12
10
|
const useRetailFormStore_1 = require("../../hooks/useRetailFormStore");
|
|
13
11
|
const checkNewMicroservice_1 = require("../../utils/checkNewMicroservice");
|
|
14
12
|
const creditProgramCodes_1 = require("./creditProgramCodes");
|
|
15
|
-
const
|
|
13
|
+
const DraftDialogContent_1 = require("./DraftDialogContent");
|
|
16
14
|
const parseDraftTask_1 = require("./parseDraftTask");
|
|
17
15
|
const utils_1 = require("./utils");
|
|
18
|
-
const getTaskTypeOrDebit = (taskType, isDebit) => {
|
|
19
|
-
return taskType || (isDebit ? 'debit' : undefined);
|
|
20
|
-
};
|
|
21
16
|
exports.DraftDialog = (0, uni_jsx_1.JSX)(function ({ task, taskType, isDebit, isFromLead = false, sendAspects = noop_1.noop, onClose = noop_1.noop, }) {
|
|
22
17
|
const retailFormStore = (0, useRetailFormStore_1.useRetailFormStore)();
|
|
23
18
|
const navigator = (0, locationNavigator_1.locationNavigator)();
|
|
24
19
|
const isNewMicroservice = (0, checkNewMicroservice_1.checkNewMicroservice)();
|
|
25
20
|
const { participants, participant, creditProgram, createdDate = '', id: taskId } = task;
|
|
26
21
|
const programmId = creditProgramCodes_1.creditProgramCodeToProductIdMap[creditProgram.code];
|
|
27
|
-
const productData = (0, utils_1.getProductData)(
|
|
22
|
+
const productData = (0, utils_1.getProductData)(taskType ?? (0, creditProgramCodes_1.getCreditProgramTaskType)(task.creditProgram.code, isDebit));
|
|
28
23
|
const currentParticipant = participant || participants?.[0];
|
|
29
24
|
const { id: participantId, profile } = currentParticipant || {};
|
|
30
25
|
const handleGoToDraft = (0, hooks_1.useCallback)(() => {
|
|
@@ -54,6 +49,6 @@ exports.DraftDialog = (0, uni_jsx_1.JSX)(function ({ task, taskType, isDebit, is
|
|
|
54
49
|
}
|
|
55
50
|
navigator.assign(productData.newTaskLink);
|
|
56
51
|
}, [task.id, productData.newTaskLink, isNewMicroservice]);
|
|
57
|
-
return ((0, jsx_runtime_1.jsx)(Dialog_1.Dialog, { onClose: onClose, children: (0, jsx_runtime_1.
|
|
52
|
+
return ((0, jsx_runtime_1.jsx)(Dialog_1.Dialog, { onClose: onClose, children: (0, jsx_runtime_1.jsx)(DraftDialogContent_1.DraftDialogContent, { createdDate: createdDate, productData: productData, isFromLead: isFromLead, handleGoToDraft: handleGoToDraft, handleGoToNewTask: handleGoToNewTask, onClose: onClose }) }));
|
|
58
53
|
});
|
|
59
54
|
//# sourceMappingURL=DraftDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DraftDialog.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/DraftDialog.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAA0D;AAC1D,2EAAwE;AAExE,iEAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"DraftDialog.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/DraftDialog.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAA0D;AAC1D,2EAAwE;AAExE,iEAA8D;AAC9D,8CAA2C;AAE3C,uDAAoD;AACpD,uEAAoE;AAEpE,2EAAwE;AACxE,6DAAiG;AACjG,6DAA0D;AAC1D,qDAAkD;AAClD,mCAAyC;AAU5B,QAAA,WAAW,GAAG,IAAA,aAAG,EAAmB,UAAU,EACzD,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,WAAI,EAClB,OA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CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,MAAM,iBAAiB,GAAG,IAAA,mBAAW,EAAC,KAAK,IAAI,EAAE;QAC/C,IAAI,iBAAiB,EAAE;YACrB,IAAI;gBACF,MAAM,IAAA,yBAAW,EAAC;oBAChB,WAAW,EAAE,4BAA4B;oBACzC,MAAM,EAAE,IAAI,CAAC,EAAE;iBAChB,CAAC,CAAC;aACJ;YAAC,OAAO,EAAE,EAAE;gBACX,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;aACnB;SACF;QACD,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE1D,OAAO,CACL,uBAAC,eAAM,IAAC,OAAO,EAAE,OAAO,YACtB,uBAAC,uCAAkB,IACjB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE,OAAO,GAChB,GACK,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type OnCloseProps } from '../../../model/OnCloseProps';
|
|
2
|
+
import { type getProductData } from './utils';
|
|
3
|
+
export interface DraftDialogContentProps extends OnCloseProps {
|
|
4
|
+
createdDate: string;
|
|
5
|
+
productData: ReturnType<typeof getProductData>;
|
|
6
|
+
isFromLead: boolean;
|
|
7
|
+
handleGoToDraft: () => void;
|
|
8
|
+
handleGoToNewTask: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const DraftDialogContent: import("@redneckz/uni-jsx").UNIComponent<DraftDialogContentProps, any, any>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.DraftDialogContent = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
+
const Heading_1 = require("../../../ui-kit/Heading/Heading");
|
|
6
|
+
const formatDate_1 = require("../../../utils/formatDate");
|
|
7
|
+
const DraftActionButton_1 = require("./DraftActionButton");
|
|
8
|
+
exports.DraftDialogContent = (0, uni_jsx_1.JSX)(function ({ createdDate, productData, isFromLead, handleGoToDraft, handleGoToNewTask, onClose, }) {
|
|
9
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-lg items-center mt-xs mx-6xl", children: [(0, jsx_runtime_1.jsx)(Heading_1.Heading, { className: "whitespace-pre-wrap text-center", title: "\u041D\u0430\u0448\u043B\u0438 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u0432\u0430\u0448\u0435\u0439 \u0437\u0430\u044F\u0432\u043A\u0438", headingType: "h5" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-m max-w-lg", children: [(0, jsx_runtime_1.jsx)(DraftActionButton_1.DraftActionButton, { title: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430", icon: "BankColorIcon", description: createdDate ? `Черновик от ${(0, formatDate_1.formatDate)(new Date(createdDate))}` : '', onClick: handleGoToDraft, name: "go-to-draft-button" }), (0, jsx_runtime_1.jsx)(DraftActionButton_1.DraftActionButton, { title: isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку', icon: "NewLoanIcon", description: productData.description, onClick: isFromLead ? onClose : handleGoToNewTask, name: "go-to-current-task-button" })] })] }));
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=DraftDialogContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DraftDialogContent.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/DraftDialogContent.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,6DAA0D;AAC1D,0DAAuD;AACvD,2DAAwD;AAW3C,QAAA,kBAAkB,GAAG,IAAA,aAAG,EAA0B,UAAU,EACvE,WAAW,EACX,WAAW,EACX,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,OAAO,GACR;IACC,OAAO,CACL,iCAAK,SAAS,EAAC,gDAAgD,aAC7D,uBAAC,iBAAO,IACN,SAAS,EAAC,iCAAiC,EAC3C,KAAK,EAAC,qJAA6B,EACnC,WAAW,EAAC,IAAI,GAChB,EACF,iCAAK,SAAS,EAAC,8BAA8B,aAC3C,uBAAC,qCAAiB,IAChB,KAAK,EAAC,kLAAiC,EACvC,IAAI,EAAC,eAAe,EACpB,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,eAAe,IAAA,uBAAU,EAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAClF,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,oBAAoB,GACzB,EACF,uBAAC,qCAAiB,IAChB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,sCAAsC,CAAC,CAAC,CAAC,sBAAsB,EACnF,IAAI,EAAC,aAAa,EAClB,WAAW,EAAE,WAAW,CAAC,WAAW,EACpC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,EACjD,IAAI,EAAC,2BAA2B,GAChC,IACE,IACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type DraftTaskType } from '../../model/DraftTaskType';
|
|
1
2
|
export declare const creditCodesToProgrammIdMap: {
|
|
2
3
|
credit_cash: string;
|
|
3
4
|
credit_cash_single_doc: string;
|
|
@@ -37,3 +38,4 @@ export declare const creditProgramCodeToProductIdMap: {
|
|
|
37
38
|
summer_cash: string;
|
|
38
39
|
summer_cash_pens: string;
|
|
39
40
|
};
|
|
41
|
+
export declare const getCreditProgramTaskType: (creditProgramCode?: string, isDebit?: boolean) => DraftTaskType | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable camelcase */
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.creditProgramCodeToProductIdMap = exports.creditCodesToProgrammIdMap = void 0;
|
|
3
|
+
exports.getCreditProgramTaskType = exports.creditProgramCodeToProductIdMap = exports.creditCodesToProgrammIdMap = void 0;
|
|
4
4
|
exports.creditCodesToProgrammIdMap = {
|
|
5
5
|
credit_cash: '10',
|
|
6
6
|
credit_cash_single_doc: '28',
|
|
@@ -36,4 +36,20 @@ exports.creditProgramCodeToProductIdMap = {
|
|
|
36
36
|
...cardCodesToProgrammIdMap,
|
|
37
37
|
...debitCardCodesToProgrammIdMap,
|
|
38
38
|
};
|
|
39
|
+
const getCreditProgramTaskType = (creditProgramCode, isDebit) => {
|
|
40
|
+
if (isDebit || (creditProgramCode && creditProgramCode in debitCardCodesToProgrammIdMap)) {
|
|
41
|
+
return 'debit';
|
|
42
|
+
}
|
|
43
|
+
if (!creditProgramCode) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
if (creditProgramCode in exports.creditCodesToProgrammIdMap) {
|
|
47
|
+
return 'credit';
|
|
48
|
+
}
|
|
49
|
+
if (creditProgramCode in cardCodesToProgrammIdMap) {
|
|
50
|
+
return 'card';
|
|
51
|
+
}
|
|
52
|
+
return undefined;
|
|
53
|
+
};
|
|
54
|
+
exports.getCreditProgramTaskType = getCreditProgramTaskType;
|
|
39
55
|
//# sourceMappingURL=creditProgramCodes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditProgramCodes.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/creditProgramCodes.ts"],"names":[],"mappings":"AAAA,8BAA8B;;;
|
|
1
|
+
{"version":3,"file":"creditProgramCodes.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/creditProgramCodes.ts"],"names":[],"mappings":"AAAA,8BAA8B;;;AAIjB,QAAA,0BAA0B,GAAG;IACxC,WAAW,EAAE,IAAI;IACjB,sBAAsB,EAAE,IAAI;IAC5B,UAAU,EAAE,IAAI;IAChB,mBAAmB,EAAE,IAAI;IACzB,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,IAAI;IAChB,qBAAqB,EAAE,IAAI;IAC3B,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEF,MAAM,6BAA6B,GAAG;IACpC,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,kBAAkB,EAAE,IAAI;IACxB,iBAAiB,EAAE,IAAI;IACvB,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI;IACpB,iBAAiB,EAAE,IAAI;IACvB,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,IAAI;IAC3B,0BAA0B,EAAE,IAAI;CACjC,CAAC;AAEF,MAAM,wBAAwB,GAAG;IAC/B,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;CAClB,CAAC;AAEW,QAAA,+BAA+B,GAAG;IAC7C,GAAG,kCAA0B;IAC7B,GAAG,wBAAwB;IAC3B,GAAG,6BAA6B;CACjC,CAAC;AAEK,MAAM,wBAAwB,GAAG,CACtC,iBAA0B,EAC1B,OAAiB,EACU,EAAE;IAC7B,IAAI,OAAO,IAAI,CAAC,iBAAiB,IAAI,iBAAiB,IAAI,6BAA6B,CAAC,EAAE;QACxF,OAAO,OAAO,CAAC;KAChB;IAED,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,iBAAiB,IAAI,kCAA0B,EAAE;QACnD,OAAO,QAAQ,CAAC;KACjB;IACD,IAAI,iBAAiB,IAAI,wBAAwB,EAAE;QACjD,OAAO,MAAM,CAAC;KACf;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AApBW,QAAA,wBAAwB,4BAoBnC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type OnCloseProps } from '../../../model/OnCloseProps';
|
|
2
2
|
import { type Task } from '../../api/draftTasksKZO';
|
|
3
3
|
import { type DraftTaskType } from '../../model/DraftTaskType';
|
|
4
4
|
export interface DraftDialogProps extends OnCloseProps {
|
|
@@ -1,28 +1,23 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
4
|
import { locationNavigator } from '../../../external/locationNavigator.js';
|
|
5
5
|
import { Dialog } from '../../../ui-kit/DialogManager/Dialog.js';
|
|
6
|
-
import { Heading } from '../../../ui-kit/Heading/Heading.js';
|
|
7
|
-
import { formatDate } from '../../../utils/formatDate.js';
|
|
8
6
|
import { noop } from '../../../utils/noop.js';
|
|
9
7
|
import { sendMessage } from '../../api/sendMessage.js';
|
|
10
8
|
import { useRetailFormStore } from '../../hooks/useRetailFormStore.js';
|
|
11
9
|
import { checkNewMicroservice } from '../../utils/checkNewMicroservice.js';
|
|
12
|
-
import { creditProgramCodeToProductIdMap } from './creditProgramCodes.js';
|
|
13
|
-
import {
|
|
10
|
+
import { creditProgramCodeToProductIdMap, getCreditProgramTaskType } from './creditProgramCodes.js';
|
|
11
|
+
import { DraftDialogContent } from './DraftDialogContent.js';
|
|
14
12
|
import { parseDraftTask } from './parseDraftTask.js';
|
|
15
13
|
import { getProductData } from './utils.js';
|
|
16
|
-
const getTaskTypeOrDebit = (taskType, isDebit) => {
|
|
17
|
-
return taskType || (isDebit ? 'debit' : undefined);
|
|
18
|
-
};
|
|
19
14
|
export const DraftDialog = JSX(function ({ task, taskType, isDebit, isFromLead = false, sendAspects = noop, onClose = noop, }) {
|
|
20
15
|
const retailFormStore = useRetailFormStore();
|
|
21
16
|
const navigator = locationNavigator();
|
|
22
17
|
const isNewMicroservice = checkNewMicroservice();
|
|
23
18
|
const { participants, participant, creditProgram, createdDate = '', id: taskId } = task;
|
|
24
19
|
const programmId = creditProgramCodeToProductIdMap[creditProgram.code];
|
|
25
|
-
const productData = getProductData(
|
|
20
|
+
const productData = getProductData(taskType ?? getCreditProgramTaskType(task.creditProgram.code, isDebit));
|
|
26
21
|
const currentParticipant = participant || participants?.[0];
|
|
27
22
|
const { id: participantId, profile } = currentParticipant || {};
|
|
28
23
|
const handleGoToDraft = useCallback(() => {
|
|
@@ -52,6 +47,6 @@ export const DraftDialog = JSX(function ({ task, taskType, isDebit, isFromLead =
|
|
|
52
47
|
}
|
|
53
48
|
navigator.assign(productData.newTaskLink);
|
|
54
49
|
}, [task.id, productData.newTaskLink, isNewMicroservice]);
|
|
55
|
-
return (_jsx(Dialog, { onClose: onClose, children:
|
|
50
|
+
return (_jsx(Dialog, { onClose: onClose, children: _jsx(DraftDialogContent, { createdDate: createdDate, productData: productData, isFromLead: isFromLead, handleGoToDraft: handleGoToDraft, handleGoToNewTask: handleGoToNewTask, onClose: onClose }) }));
|
|
56
51
|
});
|
|
57
52
|
//# sourceMappingURL=DraftDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DraftDialog.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/DraftDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAA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AAC,CAAC;aACnB;SACF;QACD,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE1D,OAAO,CACL,KAAC,MAAM,IAAC,OAAO,EAAE,OAAO,YACtB,KAAC,kBAAkB,IACjB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE,OAAO,GAChB,GACK,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type OnCloseProps } from '../../../model/OnCloseProps';
|
|
2
|
+
import { type getProductData } from './utils';
|
|
3
|
+
export interface DraftDialogContentProps extends OnCloseProps {
|
|
4
|
+
createdDate: string;
|
|
5
|
+
productData: ReturnType<typeof getProductData>;
|
|
6
|
+
isFromLead: boolean;
|
|
7
|
+
handleGoToDraft: () => void;
|
|
8
|
+
handleGoToNewTask: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const DraftDialogContent: import("@redneckz/uni-jsx").UNIComponent<DraftDialogContentProps, any, any>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { Heading } from '../../../ui-kit/Heading/Heading.js';
|
|
4
|
+
import { formatDate } from '../../../utils/formatDate.js';
|
|
5
|
+
import { DraftActionButton } from './DraftActionButton.js';
|
|
6
|
+
export const DraftDialogContent = JSX(function ({ createdDate, productData, isFromLead, handleGoToDraft, handleGoToNewTask, onClose, }) {
|
|
7
|
+
return (_jsxs("div", { className: "flex flex-col gap-lg items-center mt-xs mx-6xl", children: [_jsx(Heading, { className: "whitespace-pre-wrap text-center", title: "\u041D\u0430\u0448\u043B\u0438 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u0432\u0430\u0448\u0435\u0439 \u0437\u0430\u044F\u0432\u043A\u0438", headingType: "h5" }), _jsxs("div", { className: "flex flex-col gap-m max-w-lg", children: [_jsx(DraftActionButton, { title: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430", icon: "BankColorIcon", description: createdDate ? `Черновик от ${formatDate(new Date(createdDate))}` : '', onClick: handleGoToDraft, name: "go-to-draft-button" }), _jsx(DraftActionButton, { title: isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку', icon: "NewLoanIcon", description: productData.description, onClick: isFromLead ? onClose : handleGoToNewTask, name: "go-to-current-task-button" })] })] }));
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=DraftDialogContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DraftDialogContent.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/DraftDialogContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAWxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAA0B,UAAU,EACvE,WAAW,EACX,WAAW,EACX,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,OAAO,GACR;IACC,OAAO,CACL,eAAK,SAAS,EAAC,gDAAgD,aAC7D,KAAC,OAAO,IACN,SAAS,EAAC,iCAAiC,EAC3C,KAAK,EAAC,qJAA6B,EACnC,WAAW,EAAC,IAAI,GAChB,EACF,eAAK,SAAS,EAAC,8BAA8B,aAC3C,KAAC,iBAAiB,IAChB,KAAK,EAAC,kLAAiC,EACvC,IAAI,EAAC,eAAe,EACpB,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,eAAe,UAAU,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAClF,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,oBAAoB,GACzB,EACF,KAAC,iBAAiB,IAChB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,sCAAsC,CAAC,CAAC,CAAC,sBAAsB,EACnF,IAAI,EAAC,aAAa,EAClB,WAAW,EAAE,WAAW,CAAC,WAAW,EACpC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,EACjD,IAAI,EAAC,2BAA2B,GAChC,IACE,IACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type DraftTaskType } from '../../model/DraftTaskType';
|
|
1
2
|
export declare const creditCodesToProgrammIdMap: {
|
|
2
3
|
credit_cash: string;
|
|
3
4
|
credit_cash_single_doc: string;
|
|
@@ -37,3 +38,4 @@ export declare const creditProgramCodeToProductIdMap: {
|
|
|
37
38
|
summer_cash: string;
|
|
38
39
|
summer_cash_pens: string;
|
|
39
40
|
};
|
|
41
|
+
export declare const getCreditProgramTaskType: (creditProgramCode?: string, isDebit?: boolean) => DraftTaskType | undefined;
|
|
@@ -34,4 +34,19 @@ export const creditProgramCodeToProductIdMap = {
|
|
|
34
34
|
...cardCodesToProgrammIdMap,
|
|
35
35
|
...debitCardCodesToProgrammIdMap,
|
|
36
36
|
};
|
|
37
|
+
export const getCreditProgramTaskType = (creditProgramCode, isDebit) => {
|
|
38
|
+
if (isDebit || (creditProgramCode && creditProgramCode in debitCardCodesToProgrammIdMap)) {
|
|
39
|
+
return 'debit';
|
|
40
|
+
}
|
|
41
|
+
if (!creditProgramCode) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
if (creditProgramCode in creditCodesToProgrammIdMap) {
|
|
45
|
+
return 'credit';
|
|
46
|
+
}
|
|
47
|
+
if (creditProgramCode in cardCodesToProgrammIdMap) {
|
|
48
|
+
return 'card';
|
|
49
|
+
}
|
|
50
|
+
return undefined;
|
|
51
|
+
};
|
|
37
52
|
//# sourceMappingURL=creditProgramCodes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creditProgramCodes.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/creditProgramCodes.ts"],"names":[],"mappings":"AAAA,8BAA8B;
|
|
1
|
+
{"version":3,"file":"creditProgramCodes.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/creditProgramCodes.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAI9B,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,WAAW,EAAE,IAAI;IACjB,sBAAsB,EAAE,IAAI;IAC5B,UAAU,EAAE,IAAI;IAChB,mBAAmB,EAAE,IAAI;IACzB,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,IAAI;IAChB,qBAAqB,EAAE,IAAI;IAC3B,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEF,MAAM,6BAA6B,GAAG;IACpC,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,kBAAkB,EAAE,IAAI;IACxB,iBAAiB,EAAE,IAAI;IACvB,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI;IACpB,iBAAiB,EAAE,IAAI;IACvB,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,IAAI;IAC3B,0BAA0B,EAAE,IAAI;CACjC,CAAC;AAEF,MAAM,wBAAwB,GAAG;IAC/B,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,GAAG,0BAA0B;IAC7B,GAAG,wBAAwB;IAC3B,GAAG,6BAA6B;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,iBAA0B,EAC1B,OAAiB,EACU,EAAE;IAC7B,IAAI,OAAO,IAAI,CAAC,iBAAiB,IAAI,iBAAiB,IAAI,6BAA6B,CAAC,EAAE;QACxF,OAAO,OAAO,CAAC;KAChB;IAED,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,iBAAiB,IAAI,0BAA0B,EAAE;QACnD,OAAO,QAAQ,CAAC;KACjB;IACD,IAAI,iBAAiB,IAAI,wBAAwB,EAAE;QACjD,OAAO,MAAM,CAAC;KACf;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
|
|
@@ -1853,7 +1853,11 @@
|
|
|
1853
1853
|
"endpoint": "sendcorporatelead",
|
|
1854
1854
|
"sections": [
|
|
1855
1855
|
{
|
|
1856
|
-
"
|
|
1856
|
+
"columns": 2,
|
|
1857
|
+
"inputs": [
|
|
1858
|
+
{ "name": "fullName", "required": true, "label": "ФИО" },
|
|
1859
|
+
{ "name": "dadataPartyInnSelect", "required": true }
|
|
1860
|
+
]
|
|
1857
1861
|
},
|
|
1858
1862
|
{
|
|
1859
1863
|
"columns": 2,
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { locationNavigator } from '../../../external/locationNavigator';
|
|
4
|
-
import type
|
|
4
|
+
import { type OnCloseProps } from '../../../model/OnCloseProps';
|
|
5
5
|
import { Dialog } from '../../../ui-kit/DialogManager/Dialog';
|
|
6
|
-
import { Heading } from '../../../ui-kit/Heading/Heading';
|
|
7
|
-
import { formatDate } from '../../../utils/formatDate';
|
|
8
6
|
import { noop } from '../../../utils/noop';
|
|
9
7
|
import { type Task } from '../../api/draftTasksKZO';
|
|
10
8
|
import { sendMessage } from '../../api/sendMessage';
|
|
11
9
|
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
12
10
|
import { type DraftTaskType } from '../../model/DraftTaskType';
|
|
13
11
|
import { checkNewMicroservice } from '../../utils/checkNewMicroservice';
|
|
14
|
-
import { creditProgramCodeToProductIdMap } from './creditProgramCodes';
|
|
15
|
-
import {
|
|
12
|
+
import { creditProgramCodeToProductIdMap, getCreditProgramTaskType } from './creditProgramCodes';
|
|
13
|
+
import { DraftDialogContent } from './DraftDialogContent';
|
|
16
14
|
import { parseDraftTask } from './parseDraftTask';
|
|
17
15
|
import { getProductData } from './utils';
|
|
18
16
|
|
|
@@ -24,10 +22,6 @@ export interface DraftDialogProps extends OnCloseProps {
|
|
|
24
22
|
sendAspects?: (userId: number, taskId: number) => void;
|
|
25
23
|
}
|
|
26
24
|
|
|
27
|
-
const getTaskTypeOrDebit = (taskType?: DraftTaskType, isDebit?: boolean) => {
|
|
28
|
-
return taskType || (isDebit ? 'debit' : undefined);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
25
|
export const DraftDialog = JSX<DraftDialogProps>(function ({
|
|
32
26
|
task,
|
|
33
27
|
taskType,
|
|
@@ -39,15 +33,13 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
|
|
|
39
33
|
const retailFormStore = useRetailFormStore();
|
|
40
34
|
const navigator = locationNavigator();
|
|
41
35
|
const isNewMicroservice = checkNewMicroservice();
|
|
42
|
-
|
|
43
36
|
const { participants, participant, creditProgram, createdDate = '', id: taskId } = task;
|
|
44
|
-
|
|
45
37
|
const programmId: string = creditProgramCodeToProductIdMap[creditProgram.code];
|
|
46
|
-
const productData = getProductData(
|
|
47
|
-
|
|
38
|
+
const productData = getProductData(
|
|
39
|
+
taskType ?? getCreditProgramTaskType(task.creditProgram.code, isDebit),
|
|
40
|
+
);
|
|
48
41
|
const currentParticipant = participant || participants?.[0];
|
|
49
42
|
const { id: participantId, profile } = currentParticipant || {};
|
|
50
|
-
|
|
51
43
|
const handleGoToDraft = useCallback(() => {
|
|
52
44
|
const taskFromDraft = parseDraftTask(task);
|
|
53
45
|
retailFormStore.participantId = participantId ?? null;
|
|
@@ -56,13 +48,11 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
|
|
|
56
48
|
retailFormStore.userId = profile?.id ?? null;
|
|
57
49
|
retailFormStore.programId = programmId;
|
|
58
50
|
retailFormStore.leadForm = taskFromDraft;
|
|
59
|
-
|
|
60
51
|
if (profile?.id) {
|
|
61
52
|
sendAspects(profile.id, taskId);
|
|
62
53
|
}
|
|
63
54
|
navigator.assign(productData.nextStepLink);
|
|
64
55
|
}, []);
|
|
65
|
-
|
|
66
56
|
const handleGoToNewTask = useCallback(async () => {
|
|
67
57
|
if (isNewMicroservice) {
|
|
68
58
|
try {
|
|
@@ -79,29 +69,14 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
|
|
|
79
69
|
|
|
80
70
|
return (
|
|
81
71
|
<Dialog onClose={onClose}>
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
title="Продолжить заполнение черновика"
|
|
91
|
-
icon="BankColorIcon"
|
|
92
|
-
description={createdDate ? `Черновик от ${formatDate(new Date(createdDate))}` : ''}
|
|
93
|
-
onClick={handleGoToDraft}
|
|
94
|
-
name="go-to-draft-button"
|
|
95
|
-
/>
|
|
96
|
-
<DraftActionButton
|
|
97
|
-
title={isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку'}
|
|
98
|
-
icon="NewLoanIcon"
|
|
99
|
-
description={productData.description}
|
|
100
|
-
onClick={isFromLead ? onClose : handleGoToNewTask}
|
|
101
|
-
name="go-to-current-task-button"
|
|
102
|
-
/>
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
72
|
+
<DraftDialogContent
|
|
73
|
+
createdDate={createdDate}
|
|
74
|
+
productData={productData}
|
|
75
|
+
isFromLead={isFromLead}
|
|
76
|
+
handleGoToDraft={handleGoToDraft}
|
|
77
|
+
handleGoToNewTask={handleGoToNewTask}
|
|
78
|
+
onClose={onClose}
|
|
79
|
+
/>
|
|
105
80
|
</Dialog>
|
|
106
81
|
);
|
|
107
82
|
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { type OnCloseProps } from '../../../model/OnCloseProps';
|
|
3
|
+
import { Heading } from '../../../ui-kit/Heading/Heading';
|
|
4
|
+
import { formatDate } from '../../../utils/formatDate';
|
|
5
|
+
import { DraftActionButton } from './DraftActionButton';
|
|
6
|
+
import { type getProductData } from './utils';
|
|
7
|
+
|
|
8
|
+
export interface DraftDialogContentProps extends OnCloseProps {
|
|
9
|
+
createdDate: string;
|
|
10
|
+
productData: ReturnType<typeof getProductData>;
|
|
11
|
+
isFromLead: boolean;
|
|
12
|
+
handleGoToDraft: () => void;
|
|
13
|
+
handleGoToNewTask: () => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const DraftDialogContent = JSX<DraftDialogContentProps>(function ({
|
|
17
|
+
createdDate,
|
|
18
|
+
productData,
|
|
19
|
+
isFromLead,
|
|
20
|
+
handleGoToDraft,
|
|
21
|
+
handleGoToNewTask,
|
|
22
|
+
onClose,
|
|
23
|
+
}) {
|
|
24
|
+
return (
|
|
25
|
+
<div className="flex flex-col gap-lg items-center mt-xs mx-6xl">
|
|
26
|
+
<Heading
|
|
27
|
+
className="whitespace-pre-wrap text-center"
|
|
28
|
+
title="Нашли черновик вашей заявки"
|
|
29
|
+
headingType="h5"
|
|
30
|
+
/>
|
|
31
|
+
<div className="flex flex-col gap-m max-w-lg">
|
|
32
|
+
<DraftActionButton
|
|
33
|
+
title="Продолжить заполнение черновика"
|
|
34
|
+
icon="BankColorIcon"
|
|
35
|
+
description={createdDate ? `Черновик от ${formatDate(new Date(createdDate))}` : ''}
|
|
36
|
+
onClick={handleGoToDraft}
|
|
37
|
+
name="go-to-draft-button"
|
|
38
|
+
/>
|
|
39
|
+
<DraftActionButton
|
|
40
|
+
title={isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку'}
|
|
41
|
+
icon="NewLoanIcon"
|
|
42
|
+
description={productData.description}
|
|
43
|
+
onClick={isFromLead ? onClose : handleGoToNewTask}
|
|
44
|
+
name="go-to-current-task-button"
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
});
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* eslint-disable camelcase */
|
|
2
2
|
|
|
3
|
+
import { type DraftTaskType } from '../../model/DraftTaskType';
|
|
4
|
+
|
|
3
5
|
export const creditCodesToProgrammIdMap = {
|
|
4
6
|
credit_cash: '10',
|
|
5
7
|
credit_cash_single_doc: '28',
|
|
@@ -38,3 +40,25 @@ export const creditProgramCodeToProductIdMap = {
|
|
|
38
40
|
...cardCodesToProgrammIdMap,
|
|
39
41
|
...debitCardCodesToProgrammIdMap,
|
|
40
42
|
};
|
|
43
|
+
|
|
44
|
+
export const getCreditProgramTaskType = (
|
|
45
|
+
creditProgramCode?: string,
|
|
46
|
+
isDebit?: boolean,
|
|
47
|
+
): DraftTaskType | undefined => {
|
|
48
|
+
if (isDebit || (creditProgramCode && creditProgramCode in debitCardCodesToProgrammIdMap)) {
|
|
49
|
+
return 'debit';
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (!creditProgramCode) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (creditProgramCode in creditCodesToProgrammIdMap) {
|
|
57
|
+
return 'credit';
|
|
58
|
+
}
|
|
59
|
+
if (creditProgramCode in cardCodesToProgrammIdMap) {
|
|
60
|
+
return 'card';
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return undefined;
|
|
64
|
+
};
|
package/package.json
CHANGED
|
@@ -1853,7 +1853,11 @@
|
|
|
1853
1853
|
"endpoint": "sendcorporatelead",
|
|
1854
1854
|
"sections": [
|
|
1855
1855
|
{
|
|
1856
|
-
"
|
|
1856
|
+
"columns": 2,
|
|
1857
|
+
"inputs": [
|
|
1858
|
+
{ "name": "fullName", "required": true, "label": "ФИО" },
|
|
1859
|
+
{ "name": "dadataPartyInnSelect", "required": true }
|
|
1860
|
+
]
|
|
1857
1861
|
},
|
|
1858
1862
|
{
|
|
1859
1863
|
"columns": 2,
|
|
@@ -1166,7 +1166,11 @@ export default {
|
|
|
1166
1166
|
endpoint="sendcorporatelead"
|
|
1167
1167
|
sections={[
|
|
1168
1168
|
{
|
|
1169
|
-
|
|
1169
|
+
columns: 2,
|
|
1170
|
+
inputs: [
|
|
1171
|
+
{ name: 'fullName', required: true, label: 'ФИО' },
|
|
1172
|
+
{ name: 'dadataPartyInnSelect', required: true },
|
|
1173
|
+
],
|
|
1170
1174
|
},
|
|
1171
1175
|
{
|
|
1172
1176
|
columns: 2,
|