Merge branch 'master' of https://github.com/merelendor/evoleasing-account
Conflicts: package.json yarn.lock
This commit is contained in:
commit
2c7ec05f1d
@ -397,8 +397,9 @@ export const getContractGraphicChangeSignatories = ({ dispatch, number }) =>
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "getContractGraphicChangeSignatories", "error");
|
||||
console.error(error);
|
||||
reject();
|
||||
console.error(error.response.data);
|
||||
|
||||
reject(error.response.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -425,8 +426,9 @@ export const getContractGraphicChangeVariants = ({ dispatch, number, variants =
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "getContractGraphicChangeVariants", "error");
|
||||
console.error(error);
|
||||
reject();
|
||||
console.error(error.response.data);
|
||||
|
||||
reject(error.response.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -451,8 +453,9 @@ export const getContractGraphicChangeCalculationsList = ({ dispatch, number }) =
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "getContractGraphicChangeCalculationsList", "error");
|
||||
console.error(error);
|
||||
reject();
|
||||
console.error(error.response.data);
|
||||
|
||||
reject(error.response.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -479,15 +482,16 @@ export const getContractGraphicChangeOptions = ({ dispatch, number, variants })
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "getContractGraphicChangeOptions", "error");
|
||||
console.error(error);
|
||||
reject();
|
||||
console.error(error.response.data);
|
||||
|
||||
reject(error.response.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export const getContractGraphicChangeCalculate = (calculation) =>
|
||||
{
|
||||
console.log("ACTION", "getContractGraphicChangeCurrent", calculation);
|
||||
console.log("ACTION", "getContractGraphicChangeCalculate", calculation);
|
||||
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
@ -498,14 +502,15 @@ export const getContractGraphicChangeCalculate = (calculation) =>
|
||||
})
|
||||
.then(async (response) =>
|
||||
{
|
||||
console.log("ACTION", "getContractGraphicChangeCurrent", "response.data", response.data);
|
||||
console.log("ACTION", "getContractGraphicChangeCalculate", "response.data", response.data);
|
||||
resolve(response.data);
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "getContractGraphicChangeCurrent", "error");
|
||||
console.error(error);
|
||||
reject();
|
||||
console.error("ACTION", "getContractGraphicChangeCalculate", "error");
|
||||
console.error(error.response.data);
|
||||
|
||||
reject(error.response.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -530,8 +535,9 @@ export const getContractGraphicChangeGetCurrent = ({ dispatch, number }) =>
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "getContractGraphicChangeGetCurrent", "error");
|
||||
console.error(error);
|
||||
reject();
|
||||
console.error(error.response.data);
|
||||
|
||||
reject(error.response.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -556,8 +562,9 @@ export const getContractGraphicChangeGetCalculated = ({ dispatch, calculation })
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "getContractGraphicChangeGetCalculated", "error");
|
||||
console.error(error);
|
||||
reject();
|
||||
console.error(error.response.data);
|
||||
|
||||
reject(error.response.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -580,8 +587,9 @@ export const signContractGraphicChange = (params) =>
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("ACTION", "signContractGraphicChange", "error");
|
||||
console.error(error);
|
||||
reject();
|
||||
console.error(error.response.data);
|
||||
|
||||
reject(error.response.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -99,30 +99,24 @@ export const getSupportThemes = ({ dispatch, query, }) =>
|
||||
});
|
||||
}
|
||||
|
||||
export const sendNewAppeal = ({ name, phone, email, company }) =>
|
||||
export const sendNewAppeal = (appeal) =>
|
||||
{
|
||||
console.log("ACTION", "support", "sendNewAppeal", appeal);
|
||||
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
var formData = new FormData();
|
||||
formData.append("form", "FORM_LEASING_REQUESTS");
|
||||
formData.append("FORM_FIELD_FIO", name);
|
||||
formData.append("FORM_FIELD_PHONE", phone);
|
||||
formData.append("FORM_FIELD_EMAIL", email);
|
||||
formData.append("FORM_FIELD_COMPANY", company);
|
||||
formData.append("FORM_FIELD_PAGE_NAME", document.title);
|
||||
formData.append("FORM_FIELD_PAGE_URL", window.location.href);
|
||||
|
||||
axios.post(`${ process.env.NEXT_PUBLIC_API_HOST }/api/forms/`, formData)
|
||||
.then((response) =>
|
||||
axios.post(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/support/request`, {
|
||||
query
|
||||
},
|
||||
{
|
||||
if(response.data.status === "complete")
|
||||
withCredentials: true,
|
||||
})
|
||||
.then(async (response) =>
|
||||
{
|
||||
console.log("sendNewAppeal", "response.data", response.data);
|
||||
resolve();
|
||||
}
|
||||
else
|
||||
{
|
||||
reject();
|
||||
}
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
@ -130,4 +124,5 @@ export const sendNewAppeal = ({ name, phone, email, company }) =>
|
||||
reject();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -611,3 +611,31 @@ ul.custom-dots {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Multi Select
|
||||
.custom-multi-select {
|
||||
.custom-select__control {
|
||||
min-height: 40px;
|
||||
border-radius: 0;
|
||||
border: 1px solid rgba(0,16,61,0.12) !important;
|
||||
background: #fff;
|
||||
box-shadow: unset !important;
|
||||
|
||||
.custom-select__control {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.custom-select__value-container {
|
||||
padding: 2px 12px;
|
||||
}
|
||||
|
||||
.custom-select__input-container {
|
||||
margin-top: 0;
|
||||
min-height: 38px;
|
||||
}
|
||||
|
||||
.custom-select__multi-value {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
1076
css/forms/style.css
1076
css/forms/style.css
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -397,6 +397,10 @@
|
||||
&.recovery {
|
||||
max-width: 815px;
|
||||
|
||||
p {
|
||||
width :100%;
|
||||
}
|
||||
|
||||
.message {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
@ -52,13 +52,16 @@ export default async function CRMRequestGet(req, res, path, params)
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error(error);
|
||||
res.status(500);
|
||||
console.error("-".repeat(30), "error.response.data:");
|
||||
console.error(error.response.data);
|
||||
|
||||
res.status(500).json(error.response.data);
|
||||
});
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
console.error(e);
|
||||
res.status(500);
|
||||
res.status(500).send(e);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -51,13 +51,16 @@ export default async function CRMRequestPost(req, res, path, params)
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error(error);
|
||||
res.status(500);
|
||||
console.error("-".repeat(30), "error.response.data:");
|
||||
console.error(error.response.data);
|
||||
|
||||
res.status(500).json(error.response.data);
|
||||
});
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
console.error(e);
|
||||
res.status(500);
|
||||
res.status(500).send(e);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
278
package-lock.json
generated
278
package-lock.json
generated
@ -12,11 +12,41 @@
|
||||
"@babel/highlight": "^7.10.4"
|
||||
}
|
||||
},
|
||||
"@babel/helper-module-imports": {
|
||||
"version": "7.18.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz",
|
||||
"integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==",
|
||||
"requires": {
|
||||
"@babel/types": "^7.18.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/helper-validator-identifier": {
|
||||
"version": "7.18.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz",
|
||||
"integrity": "sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g=="
|
||||
},
|
||||
"@babel/types": {
|
||||
"version": "7.18.10",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.10.tgz",
|
||||
"integrity": "sha512-MJvnbEiiNkpjo+LknnmRrqbY1GPUUggjv+wQVjetM/AONoupqRALB7I6jGqNUAZsKcRIEu2J6FRFvsczljjsaQ==",
|
||||
"requires": {
|
||||
"@babel/helper-string-parser": "^7.18.10",
|
||||
"@babel/helper-validator-identifier": "^7.18.6",
|
||||
"to-fast-properties": "^2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@babel/helper-plugin-utils": {
|
||||
"version": "7.14.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz",
|
||||
"integrity": "sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ=="
|
||||
},
|
||||
"@babel/helper-string-parser": {
|
||||
"version": "7.18.10",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz",
|
||||
"integrity": "sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw=="
|
||||
},
|
||||
"@babel/helper-validator-identifier": {
|
||||
"version": "7.15.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz",
|
||||
@ -67,6 +97,148 @@
|
||||
"to-fast-properties": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"@emotion/babel-plugin": {
|
||||
"version": "11.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.10.0.tgz",
|
||||
"integrity": "sha512-xVnpDAAbtxL1dsuSelU5A7BnY/lftws0wUexNJZTPsvX/1tM4GZJbclgODhvW4E+NH7E5VFcH0bBn30NvniPJA==",
|
||||
"requires": {
|
||||
"@babel/helper-module-imports": "^7.16.7",
|
||||
"@babel/plugin-syntax-jsx": "^7.17.12",
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@emotion/hash": "^0.9.0",
|
||||
"@emotion/memoize": "^0.8.0",
|
||||
"@emotion/serialize": "^1.1.0",
|
||||
"babel-plugin-macros": "^3.1.0",
|
||||
"convert-source-map": "^1.5.0",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"find-root": "^1.1.0",
|
||||
"source-map": "^0.5.7",
|
||||
"stylis": "4.0.13"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": {
|
||||
"version": "7.18.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz",
|
||||
"integrity": "sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w=="
|
||||
},
|
||||
"@babel/plugin-syntax-jsx": {
|
||||
"version": "7.18.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz",
|
||||
"integrity": "sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==",
|
||||
"requires": {
|
||||
"@babel/helper-plugin-utils": "^7.18.6"
|
||||
}
|
||||
},
|
||||
"@babel/runtime": {
|
||||
"version": "7.18.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.9.tgz",
|
||||
"integrity": "sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==",
|
||||
"requires": {
|
||||
"regenerator-runtime": "^0.13.4"
|
||||
}
|
||||
},
|
||||
"escape-string-regexp": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
|
||||
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.5.7",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
|
||||
"integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="
|
||||
},
|
||||
"stylis": {
|
||||
"version": "4.0.13",
|
||||
"resolved": "https://registry.npmjs.org/stylis/-/stylis-4.0.13.tgz",
|
||||
"integrity": "sha512-xGPXiFVl4YED9Jh7Euv2V220mriG9u4B2TA6Ybjc1catrstKD2PpIdU3U0RKpkVBC2EhmL/F0sPCr9vrFTNRag=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@emotion/cache": {
|
||||
"version": "11.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.10.1.tgz",
|
||||
"integrity": "sha512-uZTj3Yz5D69GE25iFZcIQtibnVCFsc/6+XIozyL3ycgWvEdif2uEw9wlUt6umjLr4Keg9K6xRPHmD8LGi+6p1A==",
|
||||
"requires": {
|
||||
"@emotion/memoize": "^0.8.0",
|
||||
"@emotion/sheet": "^1.2.0",
|
||||
"@emotion/utils": "^1.2.0",
|
||||
"@emotion/weak-memoize": "^0.3.0",
|
||||
"stylis": "4.0.13"
|
||||
},
|
||||
"dependencies": {
|
||||
"stylis": {
|
||||
"version": "4.0.13",
|
||||
"resolved": "https://registry.npmjs.org/stylis/-/stylis-4.0.13.tgz",
|
||||
"integrity": "sha512-xGPXiFVl4YED9Jh7Euv2V220mriG9u4B2TA6Ybjc1catrstKD2PpIdU3U0RKpkVBC2EhmL/F0sPCr9vrFTNRag=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@emotion/hash": {
|
||||
"version": "0.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.0.tgz",
|
||||
"integrity": "sha512-14FtKiHhy2QoPIzdTcvh//8OyBlknNs2nXRwIhG904opCby3l+9Xaf/wuPvICBF0rc1ZCNBd3nKe9cd2mecVkQ=="
|
||||
},
|
||||
"@emotion/memoize": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.0.tgz",
|
||||
"integrity": "sha512-G/YwXTkv7Den9mXDO7AhLWkE3q+I92B+VqAE+dYG4NGPaHZGvt3G8Q0p9vmE+sq7rTGphUbAvmQ9YpbfMQGGlA=="
|
||||
},
|
||||
"@emotion/react": {
|
||||
"version": "11.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.10.0.tgz",
|
||||
"integrity": "sha512-K6z9zlHxxBXwN8TcpwBKcEsBsOw4JWCCmR+BeeOWgqp8GIU1yA2Odd41bwdAAr0ssbQrbJbVnndvv7oiv1bZeQ==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@emotion/babel-plugin": "^11.10.0",
|
||||
"@emotion/cache": "^11.10.0",
|
||||
"@emotion/serialize": "^1.1.0",
|
||||
"@emotion/utils": "^1.2.0",
|
||||
"@emotion/weak-memoize": "^0.3.0",
|
||||
"hoist-non-react-statics": "^3.3.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": {
|
||||
"version": "7.18.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.9.tgz",
|
||||
"integrity": "sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==",
|
||||
"requires": {
|
||||
"regenerator-runtime": "^0.13.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@emotion/serialize": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.1.0.tgz",
|
||||
"integrity": "sha512-F1ZZZW51T/fx+wKbVlwsfchr5q97iW8brAnXmsskz4d0hVB4O3M/SiA3SaeH06x02lSNzkkQv+n3AX3kCXKSFA==",
|
||||
"requires": {
|
||||
"@emotion/hash": "^0.9.0",
|
||||
"@emotion/memoize": "^0.8.0",
|
||||
"@emotion/unitless": "^0.8.0",
|
||||
"@emotion/utils": "^1.2.0",
|
||||
"csstype": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"@emotion/sheet": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.0.tgz",
|
||||
"integrity": "sha512-OiTkRgpxescko+M51tZsMq7Puu/KP55wMT8BgpcXVG2hqXc0Vo0mfymJ/Uj24Hp0i083ji/o0aLddh08UEjq8w=="
|
||||
},
|
||||
"@emotion/unitless": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.0.tgz",
|
||||
"integrity": "sha512-VINS5vEYAscRl2ZUDiT3uMPlrFQupiKgHz5AA4bCH1miKBg4qtwkim1qPmJj/4WG6TreYMY111rEFsjupcOKHw=="
|
||||
},
|
||||
"@emotion/utils": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.0.tgz",
|
||||
"integrity": "sha512-sn3WH53Kzpw8oQ5mgMmIzzyAaH2ZqFEbozVVBSYp538E06OSE6ytOp7pRAjNQR+Q/orwqdQYJSe2m3hCOeznkw=="
|
||||
},
|
||||
"@emotion/weak-memoize": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.0.tgz",
|
||||
"integrity": "sha512-AHPmaAx+RYfZz0eYu6Gviiagpmiyw98ySSlQvCUhVGDRtDFe4DBS0x1bSjdF3gqUDYOczB+yYvBTtEylYSdRhg=="
|
||||
},
|
||||
"@eslint/eslintrc": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz",
|
||||
@ -405,6 +577,11 @@
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz",
|
||||
"integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w=="
|
||||
},
|
||||
"@types/parse-json": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
|
||||
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA=="
|
||||
},
|
||||
"@types/prop-types": {
|
||||
"version": "15.7.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.4.tgz",
|
||||
@ -736,6 +913,16 @@
|
||||
"integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==",
|
||||
"dev": true
|
||||
},
|
||||
"babel-plugin-macros": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz",
|
||||
"integrity": "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"cosmiconfig": "^7.0.0",
|
||||
"resolve": "^1.19.0"
|
||||
}
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
@ -905,8 +1092,7 @@
|
||||
"callsites": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
||||
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
|
||||
},
|
||||
"caniuse-lite": {
|
||||
"version": "1.0.30001271",
|
||||
@ -1063,6 +1249,18 @@
|
||||
"vary": "^1"
|
||||
}
|
||||
},
|
||||
"cosmiconfig": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz",
|
||||
"integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==",
|
||||
"requires": {
|
||||
"@types/parse-json": "^4.0.0",
|
||||
"import-fresh": "^3.2.1",
|
||||
"parse-json": "^5.0.0",
|
||||
"path-type": "^4.0.0",
|
||||
"yaml": "^1.10.0"
|
||||
}
|
||||
},
|
||||
"create-ecdh": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz",
|
||||
@ -1333,6 +1531,14 @@
|
||||
"resolved": "https://registry.npmjs.org/enquire.js/-/enquire.js-2.1.6.tgz",
|
||||
"integrity": "sha512-/KujNpO+PT63F7Hlpu4h3pE3TokKRHN26JYmQpPyjkRD/N57R7bPDNojMXdi7uveAKjYB7yQnartCxZnFWr0Xw=="
|
||||
},
|
||||
"error-ex": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
|
||||
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
|
||||
"requires": {
|
||||
"is-arrayish": "^0.2.1"
|
||||
}
|
||||
},
|
||||
"es-abstract": {
|
||||
"version": "1.19.1",
|
||||
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz",
|
||||
@ -1988,6 +2194,11 @@
|
||||
"array-back": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"find-root": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz",
|
||||
"integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng=="
|
||||
},
|
||||
"find-up": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
|
||||
@ -2272,7 +2483,6 @@
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
|
||||
"integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"parent-module": "^1.0.0",
|
||||
"resolve-from": "^4.0.0"
|
||||
@ -2359,6 +2569,11 @@
|
||||
"has-tostringtag": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"is-arrayish": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
|
||||
"integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="
|
||||
},
|
||||
"is-bigint": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz",
|
||||
@ -2398,7 +2613,6 @@
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz",
|
||||
"integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has": "^1.0.3"
|
||||
}
|
||||
@ -2577,6 +2791,11 @@
|
||||
"argparse": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"json-parse-even-better-errors": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
|
||||
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="
|
||||
},
|
||||
"json-schema-traverse": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
|
||||
@ -2697,6 +2916,11 @@
|
||||
"type-check": "~0.4.0"
|
||||
}
|
||||
},
|
||||
"lines-and-columns": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
|
||||
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="
|
||||
},
|
||||
"loader-utils": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz",
|
||||
@ -2832,6 +3056,11 @@
|
||||
"safe-buffer": "^5.1.2"
|
||||
}
|
||||
},
|
||||
"memoize-one": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz",
|
||||
"integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q=="
|
||||
},
|
||||
"merge-stream": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
|
||||
@ -3370,7 +3599,6 @@
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
|
||||
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"callsites": "^3.0.0"
|
||||
}
|
||||
@ -3387,6 +3615,17 @@
|
||||
"safe-buffer": "^5.1.1"
|
||||
}
|
||||
},
|
||||
"parse-json": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
|
||||
"integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"error-ex": "^1.3.1",
|
||||
"json-parse-even-better-errors": "^2.3.0",
|
||||
"lines-and-columns": "^1.1.6"
|
||||
}
|
||||
},
|
||||
"path-browserify": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
|
||||
@ -3412,14 +3651,12 @@
|
||||
"path-parse": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
|
||||
},
|
||||
"path-type": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
|
||||
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="
|
||||
},
|
||||
"pbkdf2": {
|
||||
"version": "3.1.2",
|
||||
@ -3692,6 +3929,20 @@
|
||||
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.8.3.tgz",
|
||||
"integrity": "sha512-X8jZHc7nCMjaCqoU+V2I0cOhNW+QMBwSUkeXnTi8IPe6zaRWfn60ZzvFDZqWPfmSJfjub7dDW1SP0jaHWLu/hg=="
|
||||
},
|
||||
"react-select": {
|
||||
"version": "5.4.0",
|
||||
"resolved": "https://registry.npmjs.org/react-select/-/react-select-5.4.0.tgz",
|
||||
"integrity": "sha512-CjE9RFLUvChd5SdlfG4vqxZd55AZJRrLrHzkQyTYeHlpOztqcgnyftYAolJ0SGsBev6zAs6qFrjm6KU3eo2hzg==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.12.0",
|
||||
"@emotion/cache": "^11.4.0",
|
||||
"@emotion/react": "^11.8.1",
|
||||
"@types/react-transition-group": "^4.4.0",
|
||||
"memoize-one": "^5.0.0",
|
||||
"prop-types": "^15.6.0",
|
||||
"react-transition-group": "^4.3.0"
|
||||
}
|
||||
},
|
||||
"react-slick": {
|
||||
"version": "0.29.0",
|
||||
"resolved": "https://registry.npmjs.org/react-slick/-/react-slick-0.29.0.tgz",
|
||||
@ -3823,7 +4074,6 @@
|
||||
"version": "1.20.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
|
||||
"integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-core-module": "^2.2.0",
|
||||
"path-parse": "^1.0.6"
|
||||
@ -3832,8 +4082,7 @@
|
||||
"resolve-from": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
|
||||
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
|
||||
"dev": true
|
||||
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="
|
||||
},
|
||||
"reusify": {
|
||||
"version": "1.0.4",
|
||||
@ -4479,6 +4728,11 @@
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"dev": true
|
||||
},
|
||||
"yaml": {
|
||||
"version": "1.10.2",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
|
||||
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg=="
|
||||
},
|
||||
"yocto-queue": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
|
||||
|
||||
@ -32,7 +32,9 @@
|
||||
"react-cookie": "^4.1.1",
|
||||
"react-dom": "17.0.2",
|
||||
"react-google-recaptcha-v3": "^1.10.0",
|
||||
"react-dropzone": "^14.2.2",
|
||||
"react-redux": "^7.2.6",
|
||||
"react-select": "^5.4.0",
|
||||
"react-slick": "^0.29.0",
|
||||
"react-widgets": "^5.5.1",
|
||||
"redux": "^4.1.2",
|
||||
|
||||
@ -3,7 +3,9 @@ import CRMRequestPost from '../../../../../lib/CRMRequestPost';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("WTF BODY");
|
||||
console.log("API", "contract", "change", "graphic", "calculate");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
await CRMRequestPost(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/CreateCalculation?contract_number=${ req.body.contract_number }`, req.body);
|
||||
}
|
||||
@ -3,5 +3,9 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "contract", "change", "graphic", "calculation");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/GetPreCalculationGraph`, { addcontract_number: req.body.calculation });
|
||||
}
|
||||
@ -3,5 +3,9 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "contract", "change", "graphic", "current");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/GetCurrentGraph`, { contract_number: req.body.number });
|
||||
}
|
||||
@ -3,5 +3,9 @@ import CRMRequestPost from '../../../../../lib/CRMRequestPost';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "contract", "change", "graphic", "sign");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
await CRMRequestPost(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/Signing?addcontract_number=${ req.body.addcontract_number }`, req.body);
|
||||
}
|
||||
@ -3,9 +3,8 @@ import CRMRequestGet from '../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("-".repeat(50));
|
||||
console.log("API", "contract", "change", "options", "req.body.variants");
|
||||
console.log(req.body.variants);
|
||||
console.log("API", "contract", "change", "options");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/GetTypeOptions`, { ...{ contract_number: req.body.number }, ...req.body.variants });
|
||||
|
||||
@ -3,8 +3,8 @@ import CRMRequestGet from '../../../../lib/CRMRequestGet';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("req.body.variantsreq.body.variantsreq.body.variantsreq.body.variants");
|
||||
console.log(req.body.variants);
|
||||
console.log("API", "contract", "change", "variants");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
await CRMRequestGet(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/GetAvaliableGraphChangeTypes`, { ...{ contract_number: req.body.number }, ...req.body.variants });
|
||||
|
||||
55
pages/api/support/attachment.js
Normal file
55
pages/api/support/attachment.js
Normal file
@ -0,0 +1,55 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
import axios from 'axios';
|
||||
import { Cookies } from 'react-cookie';
|
||||
import cookie from 'cookie';
|
||||
import moment from 'moment';
|
||||
import jwt from 'jsonwebtoken';
|
||||
import { cors } from '../../../lib/cors';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
await cors(req, res);
|
||||
|
||||
console.log("API", "support", "request");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
if(req.headers.cookie !== undefined)
|
||||
{
|
||||
const cookies = cookie.parse(req.headers?.cookie ? req.headers?.cookie : "");
|
||||
if(cookies.jwt !== undefined && cookies.jwt !== null)
|
||||
{
|
||||
if(jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT))
|
||||
{
|
||||
const response = await new Promise((resolve, reject) =>
|
||||
{
|
||||
axios.post(`${ process.env.CRM_API_HOST }/lk/incident/UploadDocument`, req.body)
|
||||
.then((api_response) =>
|
||||
{
|
||||
console.log("RESPONSE");
|
||||
console.log(api_response.data);
|
||||
|
||||
resolve(api_response.data);
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.log("error");
|
||||
console.error(error);
|
||||
|
||||
reject([]);
|
||||
});
|
||||
});
|
||||
|
||||
res.status(200).json(response);
|
||||
}
|
||||
else
|
||||
{
|
||||
res.status(403);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
res.status(403);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
pages/api/support/request.js
Normal file
11
pages/api/support/request.js
Normal file
@ -0,0 +1,11 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
import CRMRequestPost from '../../../lib/CRMRequestPost';
|
||||
|
||||
export default async function handler(req, res)
|
||||
{
|
||||
console.log("API", "support", "request");
|
||||
console.log(req.body);
|
||||
console.log("-".repeat(50));
|
||||
|
||||
await CRMRequestPost(req, res, `${ process.env.CRM_API_HOST }/lk/incident/CreateRequestClient`, req.body);
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import Link from "next/link";
|
||||
|
||||
export default class Comparison extends React.Component
|
||||
export default class FinalMessage extends React.Component
|
||||
{
|
||||
constructor(props)
|
||||
{
|
||||
@ -548,14 +548,14 @@ export default class Options extends React.Component
|
||||
getContractGraphicChangeCalculate(payload)
|
||||
.then((calculation) =>
|
||||
{
|
||||
console.log("calculationcalculationcalculationcalculationcalculation");
|
||||
console.log(calculation);
|
||||
|
||||
onCalculate(calculation.addcontract_number);
|
||||
})
|
||||
.catch(() =>
|
||||
{
|
||||
this.setState({ sending: false, });
|
||||
this.setState({ sending: false, }, () =>
|
||||
{
|
||||
alert("К сожаление при расчете возникла ошибка.");
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ import SignatoriesList from "./components/SignatoriesList";
|
||||
import CalculationsList from "./components/CalculationsList";
|
||||
|
||||
import VariantsList from "./components/VariantsList";
|
||||
import Final from "./components/Final";
|
||||
import FinalMessage from "./components/FinalMessage";
|
||||
|
||||
import {
|
||||
getContractInfo,
|
||||
@ -225,7 +225,10 @@ class ChangeGraphicPage extends React.Component
|
||||
})
|
||||
.catch(() =>
|
||||
{
|
||||
this.setState({ loading: false, });
|
||||
this.setState({ loading: false, }, () =>
|
||||
{
|
||||
alert("К сожаление при формировании документа возникла ошибка.");
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -305,7 +308,7 @@ class ChangeGraphicPage extends React.Component
|
||||
<>
|
||||
{ mode_final ? (
|
||||
<div className="aside_container about">
|
||||
<Final number={ number } comment={ comment }/>
|
||||
<FinalMessage number={ number } comment={ comment }/>
|
||||
</div>
|
||||
) : (
|
||||
<div className="aside_container about">
|
||||
|
||||
@ -125,8 +125,8 @@ class IndexPage extends React.Component
|
||||
<div className="table_cell" data-title="ФИО пользователя">{ entry.name }</div>
|
||||
<div className="table_cell" data-title="Почта">{ user.email }</div>
|
||||
<div className="table_cell" data-title="Роль">Администратор</div>
|
||||
<div className="table_cell" data-title="Доступные организации">{ entry.companies.map((company, cindex) => (
|
||||
<p>{ company.title }</p>
|
||||
<div className="table_cell" data-title="Доступные организации">{ entry.companies.map((company, c_index) => (
|
||||
<p key={ c_index }>{ company.title }</p>
|
||||
)) }</div>
|
||||
<div className="table_cell" data-title="Статус">Активен</div>
|
||||
<div className="table_cell delete" style={{ position: 'relative' }}>
|
||||
|
||||
27
pages/support/components/SuccessMessage/index.js
Normal file
27
pages/support/components/SuccessMessage/index.js
Normal file
@ -0,0 +1,27 @@
|
||||
import React from "react";
|
||||
import Link from "next/link";
|
||||
|
||||
export default class SuccessMessage extends React.Component
|
||||
{
|
||||
constructor(props)
|
||||
{
|
||||
super(props);
|
||||
this.state = {
|
||||
};
|
||||
}
|
||||
|
||||
render()
|
||||
{
|
||||
const { number, comment } = this.props;
|
||||
|
||||
return (
|
||||
<article className="compare">
|
||||
<div className="compare_message">
|
||||
<p>{ comment }</p>
|
||||
<br/>
|
||||
<p>Перейти в раздел <Link href={`/contract/${ number }/agreement`}>«Документы по договору» </Link></p>
|
||||
</div>
|
||||
</article>
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -5,6 +5,8 @@ import { connect } from "react-redux";
|
||||
import { withRouter } from "next/router";
|
||||
import moment from "moment";
|
||||
import { SpinnerCircular } from "spinners-react";
|
||||
import Dropzone from 'react-dropzone';
|
||||
import Select from 'react-select'
|
||||
|
||||
import { reduxWrapper } from "../../store";
|
||||
|
||||
@ -12,12 +14,94 @@ import Header from "../components/Header";
|
||||
import Footer from "../components/Footer";
|
||||
import Company from "../components/Company";
|
||||
import InnerMenu from "./components/InnerMenu";
|
||||
import SuccessMessage from "./components/SuccessMessage";
|
||||
|
||||
import {
|
||||
getSupportThemes,
|
||||
getContractsList,
|
||||
getBitrixFile
|
||||
} from "../../actions";
|
||||
|
||||
class TemplateFile extends React.Component
|
||||
{
|
||||
constructor(props)
|
||||
{
|
||||
super(props);
|
||||
this.state = {
|
||||
downloading: false
|
||||
}
|
||||
}
|
||||
|
||||
_handle_onDownloadFile = () =>
|
||||
{
|
||||
const { filename, url } = this.props.template;
|
||||
const { downloading } = this.state;
|
||||
|
||||
if(!downloading)
|
||||
{
|
||||
this.setState({ downloading: true }, () =>
|
||||
{
|
||||
getBitrixFile({ url, filename })
|
||||
.then(() => { this.setState({ downloading: false }); })
|
||||
.catch(() => { this.setState({ downloading: false }); });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render()
|
||||
{
|
||||
const { template } = this.props;
|
||||
const { downloading } = this.state;
|
||||
|
||||
return (
|
||||
<div className="row interactive" onClick={ this._handle_onDownloadFile }>
|
||||
<p className="doc_name i-pdf extension" data-format={ template.extension }>{ template.filename }<span style={{ position: "relative", color: downloading ? "#8e94a780" : "#8e94a7" }}>Скачать шаблон{ downloading ? (<SpinnerCircular size={ 20 } thickness={ 100 } speed={ 100 } color="rgba(236, 239, 244, 1)" secondaryColor="rgba(28, 1, 169, 1)" style={{ position: "absolute", right: 0, marginRight: "-26px", top: 0, }} />) : null }</span></p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
class FileDropzone extends React.Component
|
||||
{
|
||||
constructor(props)
|
||||
{
|
||||
super(props);
|
||||
this.state = {}
|
||||
}
|
||||
|
||||
render()
|
||||
{
|
||||
const { files, onAddFile, onDeleteFile } = this.props;
|
||||
return (
|
||||
<>
|
||||
{ files.length > 0 && (
|
||||
<div className="column">
|
||||
<div className="column_text_block">
|
||||
<p><b>Приложенные файлы</b></p>
|
||||
{ files.map((file, index) => (
|
||||
<p key={ index }>{ file.name } <small style={{ color: "red", textDecoration: "underline", cursor: "pointer" }} onClick={ () => onDeleteFile(file.name) }>[ удалить ]</small></p>
|
||||
)) }
|
||||
</div>
|
||||
</div>
|
||||
) }
|
||||
<Dropzone onDrop={ (acceptedFiles) => onAddFile(acceptedFiles) }>
|
||||
{ ({getRootProps, getInputProps}) => (
|
||||
<div className="file_upload dropzone" { ...getRootProps() }>
|
||||
<div className="files"></div>
|
||||
<div>
|
||||
<p data-sm-text="Выберите файлы">
|
||||
<span>Перенесите файлы на экран для быстрой загрузки или выберите файл с компьютера </span>
|
||||
</p>
|
||||
<label htmlFor="" className="button button-blue">Загрузить файл</label>
|
||||
</div>
|
||||
<input { ...getInputProps() } />
|
||||
</div>
|
||||
) }
|
||||
</Dropzone>
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class SupportRequestPage extends React.Component
|
||||
{
|
||||
constructor(props) {
|
||||
@ -30,9 +114,12 @@ class SupportRequestPage extends React.Component
|
||||
phone: "",
|
||||
email: "",
|
||||
question: "",
|
||||
selected_contracts: [],
|
||||
file: null,
|
||||
files: [],
|
||||
opened_theme: 0,
|
||||
opened_question: 0,
|
||||
success: false,
|
||||
};
|
||||
}
|
||||
|
||||
@ -79,23 +166,87 @@ class SupportRequestPage extends React.Component
|
||||
this.setState({ opened_theme: index, opened_question: 0 });
|
||||
}
|
||||
|
||||
_handle_onSelectContracts = (event) =>
|
||||
_handle_onSendAppeal = () =>
|
||||
{
|
||||
const { name, phone, email, question, selected_contracts, } = this.state;
|
||||
|
||||
const appeal = {
|
||||
phone: phone,
|
||||
email: email,
|
||||
description: question,
|
||||
contract_numbers: selected_contracts
|
||||
}
|
||||
}
|
||||
|
||||
_handle_onContract = (options) =>
|
||||
{
|
||||
const selected_contracts = [];
|
||||
for(let i in options)
|
||||
{
|
||||
selected_contracts.push(options[i].value);
|
||||
this.setState({ selected_contracts });
|
||||
}
|
||||
}
|
||||
|
||||
_handle_onAddFile = (files) =>
|
||||
{
|
||||
console.log("_handle_onAdd", files);
|
||||
|
||||
const existed_files = [ ...this.state.files ];
|
||||
for(let nf in files)
|
||||
{
|
||||
let e = false;
|
||||
for(let ef in this.state.files)
|
||||
{
|
||||
if(this.state.files[ef].name === files[nf].name) { e = true; }
|
||||
}
|
||||
|
||||
if(!e)
|
||||
{
|
||||
existed_files.push(files[nf]);
|
||||
}
|
||||
}
|
||||
|
||||
this.setState({ files: existed_files });
|
||||
}
|
||||
|
||||
_handle_onDeleteFile = (file_name) =>
|
||||
{
|
||||
const files = [];
|
||||
for(let i in this.state.files)
|
||||
{
|
||||
if(this.state.files[i].name !== file_name)
|
||||
{
|
||||
files.push(this.state.files[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this.setState({ files });
|
||||
}
|
||||
|
||||
_renderForm = () =>
|
||||
{
|
||||
const { loading, contracts, themes, name, phone, email, question, file, opened_theme, opened_question } = this.state;
|
||||
const { loading, contracts, themes, name, phone, email, question, file, files, opened_theme, opened_question } = this.state;
|
||||
|
||||
const contracts_list = [];
|
||||
for(let i in contracts)
|
||||
{
|
||||
contracts_list.push({
|
||||
value: contracts[i].number, label: contracts[i].number
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<form>
|
||||
<div className="form_field">
|
||||
<select multiple={ false } onChange={ this._handle_onSelectContracts }>
|
||||
<option default selected disabled>Выберите договоры</option>
|
||||
{ contracts !== undefined && contracts !== null && contracts.map((contract, index) => (
|
||||
<option index={ index } value={ contract.number }>{ contract.number }</option>
|
||||
)) }
|
||||
</select>
|
||||
<Select
|
||||
options={ contracts_list }
|
||||
isMulti
|
||||
className="custom-multi-select form_field"
|
||||
classNamePrefix="custom-select"
|
||||
placeholder="Выберите договоры"
|
||||
onChange={ this._handle_onContract }
|
||||
/>
|
||||
</div>
|
||||
<div className="form_field">
|
||||
<input
|
||||
@ -111,18 +262,9 @@ class SupportRequestPage extends React.Component
|
||||
<input type="email" name="name" placeholder="Email" />
|
||||
</div>
|
||||
<div className="form_field">
|
||||
<textarea placeholder="Введите текст запроса"></textarea>
|
||||
</div>
|
||||
<div className="file_upload dropzone">
|
||||
<div className="files"></div>
|
||||
<div>
|
||||
<p data-sm-text="Выберите файлы">
|
||||
<span>Перенесите файлы на экран для быстрой загрузки или выберите файл с компьютера </span>
|
||||
</p>
|
||||
<label htmlFor="" className="button button-blue">Загрузить файл</label>
|
||||
</div>
|
||||
<input type="file" accept="" />
|
||||
<textarea placeholder="Введите текст запроса" style={{ resize: "none" }}></textarea>
|
||||
</div>
|
||||
<FileDropzone files={ files } onAddFile={ this._handle_onAddFile } onDeleteFile={ this._handle_onDeleteFile }/>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@ -130,7 +272,7 @@ class SupportRequestPage extends React.Component
|
||||
render()
|
||||
{
|
||||
const { number } = this.props;
|
||||
const { loading, themes, opened_theme, opened_question } = this.state;
|
||||
const { loading, success, themes, opened_theme, opened_question } = this.state;
|
||||
|
||||
const procedure = themes !== undefined && themes !== null ? themes[opened_theme].questions[opened_question] : undefined;
|
||||
|
||||
@ -153,6 +295,15 @@ class SupportRequestPage extends React.Component
|
||||
<Company { ...this.props }/>
|
||||
</div>
|
||||
<div className="aside_container about">
|
||||
{ loading ? (
|
||||
<div className="container" style={{ display: "flex", alignItems: "center", justifyContent: "center", }}>
|
||||
<SpinnerCircular size={ 90 } thickness={ 51 } speed={ 100 } color="rgba(28, 1, 169, 1)" secondaryColor="rgba(236, 239, 244, 1)" />
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
{ success ? (
|
||||
<SuccessMessage/>
|
||||
) : (
|
||||
<article className="full">
|
||||
<div className="new_appeal">
|
||||
<div className="column">
|
||||
@ -194,12 +345,7 @@ class SupportRequestPage extends React.Component
|
||||
<div className="column_text_block">
|
||||
<p><b>Документы</b></p>
|
||||
<div className="dosc_list medium-icon">
|
||||
{ procedure.templates.map((template, index) =>
|
||||
(
|
||||
<div className="row" key={ `template_${ index }` }>
|
||||
<p className="doc_name i-pdf extension" data-format={ template.extension }>{ template.filename }<span>Скачать шаблон</span></p>
|
||||
</div>
|
||||
)) }
|
||||
{ procedure.templates.map((template, index) => (<TemplateFile key={ `template_${ index }` } template={ template } />)) }
|
||||
</div>
|
||||
</div>
|
||||
) }
|
||||
@ -208,6 +354,9 @@ class SupportRequestPage extends React.Component
|
||||
) }
|
||||
</div>
|
||||
</article>
|
||||
) }
|
||||
</>
|
||||
) }
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user