updates for appeal request, fines

This commit is contained in:
merelendor 2022-09-13 10:52:25 +03:00
parent 963bd4cdb0
commit 640da80de4
4 changed files with 50 additions and 23 deletions

View File

@ -325,14 +325,28 @@ class SumSelector extends React.Component
_handle_onMin = () =>
{
const { onOption } = this.props;
const { min } = this.state;
this.setState({ value: min });
const value = parseFloat(min).toFixed(2);
this.setState({ value }, () =>
{
onOption(value, false);
});
}
_handle_onMax = () =>
{
const { onOption } = this.props;
const { max } = this.state;
this.setState({ value: max });
const value = parseFloat(max).toFixed(2);
this.setState({ value }, () =>
{
onOption(value, false);
});
}
_handle_onMobileHelp = () =>

View File

@ -174,7 +174,7 @@ class InnerMenu extends React.Component
{
for(let i in contract_fines[number])
{
if(contract_fines[number][i].status_code === "NotPaid")
if(contract_fines[number][i].status_code === "NotPaid" || contract_fines[number][i].status_code === "PaidEvolution")
{
c++;
}

View File

@ -119,7 +119,7 @@ class ContractFinesPage extends React.Component
const status = {
NotPaid: "danger",
PaidEvolution: "success",
PaidEvolution: "danger",
PaidIndependently: "success",
};

View File

@ -26,43 +26,48 @@ import {
sendAppealAttachments
} from "../../actions";
const LIMIT = 10000000;
class FileDropzone extends React.Component
{
constructor(props)
{
super(props);
this.state = {}
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: "#A8026B", textDecoration: "underline", cursor: "pointer" }} onClick={ () => onDeleteFile(file.name) }>[ удалить ]</small></p>
)) }
<p><b>Приложенные файлы ({ files.length }/5)</b></p>
{ files.map((file, index) => (
<p key={ index }>{ file.size > LIMIT && (<span style={{ color: "#A8026B", }}>Ошибка, превышен допустимый размер файла в 10 мб.</span>) } { file.name } - { parseFloat(file.size / 1000000).toFixed(file.size < 100000 ? 3 : 2) } мб. <small style={{ color: "#A8026B", 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>
{ files.length < 5 && (
<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>
<input { ...getInputProps() } />
</div>
) }
</Dropzone>
) }
</Dropzone>
) }
</>
)
}
@ -346,12 +351,20 @@ class SupportRequestPage extends React.Component
_checkDisabled = () =>
{
const { phone, email, question, } = this.state;
const { phone, email, question, files } = this.state;
if(phone === "" || email === "" || question === "")
{
return true;
}
for(let i in files)
{
if(files[i].size > LIMIT)
{
return true;
}
}
return false;
}