handle order actions
This commit is contained in:
@@ -31,10 +31,10 @@ class CustomerAcceptance extends Component {
|
||||
fileHandler.download(fileUrl, fileName);
|
||||
}
|
||||
|
||||
uploadFile(idEntry, acceptedFiles, rejectedFiles) {
|
||||
uploadFile(idOrder, acceptedFiles, rejectedFiles) {
|
||||
if(acceptedFiles && acceptedFiles.length){
|
||||
const file = acceptedFiles[0];
|
||||
this.props.dispatch(uploadAcceptance(idEntry, file));
|
||||
this.props.dispatch(uploadAcceptance(idOrder, file));
|
||||
}
|
||||
|
||||
if(rejectedFiles && rejectedFiles.length) {
|
||||
@@ -59,9 +59,9 @@ class CustomerAcceptance extends Component {
|
||||
}
|
||||
|
||||
acceptDeclineInstallation() {
|
||||
const {idProcess} = this.props.step;
|
||||
const {idOrder} = this.props.step;
|
||||
const {actionType, reason} = this.state;
|
||||
this.props.dispatch(acceptDeclineInstallation(idProcess, actionType, reason));
|
||||
this.props.dispatch(acceptDeclineInstallation(idOrder, actionType, reason));
|
||||
this.setState({reason: ''});
|
||||
}
|
||||
|
||||
@@ -107,8 +107,8 @@ class CustomerAcceptance extends Component {
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
const {idProcess} = this.props.step;
|
||||
this.props.dispatch(fetchCustomerAcceptance(idProcess));
|
||||
const {idOrder} = this.props.step;
|
||||
this.props.dispatch(fetchCustomerAcceptance(idOrder));
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -137,7 +137,7 @@ class CustomerAcceptance extends Component {
|
||||
multiple={false}
|
||||
accept=".pdf,.docx,.doc,.xlsx,.xls,.odt,.ods,.jpg,.png,.jpeg"
|
||||
activeClassName="upload-file-accept"
|
||||
onDrop={(acceptedFiles, rejectedFiles)=>{this.uploadFile(step.idProcess, acceptedFiles, rejectedFiles)}}>
|
||||
onDrop={(acceptedFiles, rejectedFiles)=>{this.uploadFile(step.idOrder, acceptedFiles, rejectedFiles)}}>
|
||||
<h5 className="drop-zone-text">{orderTexts.labels.UPLOAD_ACCEPTANCE_LABEL}</h5>
|
||||
</Dropzone>
|
||||
</Col>
|
||||
@@ -148,7 +148,7 @@ class CustomerAcceptance extends Component {
|
||||
{
|
||||
customerAcceptance.documents.map((document, index) => <div key={'acceptance-documnet-' + index}>
|
||||
<span className="document-link">
|
||||
<i className={'fa fa-file'}></i> <a target="_blank" href={document.url}> {document.name} ({document.extension}) </a>
|
||||
<i className={'fa fa-file'}></i> <a target="_blank" href={document.url}> {document.name} </a>
|
||||
</span>
|
||||
<span className="document-status">
|
||||
{document.validation} <div className={'status-icon ' + document.validation}></div>
|
||||
|
||||
@@ -23,8 +23,8 @@ class ValidateQuestionnaire extends Component {
|
||||
return (
|
||||
<div id="validate-questionnaire" className="validate-questionnaire">
|
||||
{
|
||||
customerQuestionnaires && customerQuestionnaires.actions &&
|
||||
customerQuestionnaires.actions.map((customerQuestionnaryAction) =>
|
||||
customerQuestionnaires &&
|
||||
customerQuestionnaires.map((customerQuestionnaryAction) =>
|
||||
<ValidateQuestionnaireItem
|
||||
action={customerQuestionnaryAction}
|
||||
key={'validate-questionnaire-' + customerQuestionnaryAction.action_id}
|
||||
|
||||
@@ -47,9 +47,8 @@ class ValidateQuestionnaireItem extends Component {
|
||||
<Col xl="7" lg="8">
|
||||
<div>
|
||||
|
||||
<span className="document-link"
|
||||
onClick={() => {this.downloadDocument(document)}}>
|
||||
<i className={'fa fa-file'}></i> {document.version}
|
||||
<span className="document-link">
|
||||
<i className={'fa fa-file'}></i> <a target="_blank" href={document.url}> {document.name} </a>
|
||||
</span>
|
||||
<br />
|
||||
<span className="document-status">
|
||||
@@ -60,8 +59,7 @@ class ValidateQuestionnaireItem extends Component {
|
||||
(action.comments && action.comments.length > 0) &&
|
||||
<div>
|
||||
{action.comments.map((comment, key) => <div key={'step-comment-' + document.idDocument + '-' + key} className="step-comment">
|
||||
<div>{comment.user} - {comment.addDate}</div>
|
||||
<div>{comment.comment}</div>
|
||||
<div>{comment}</div>
|
||||
</div>)}
|
||||
</div>
|
||||
}
|
||||
@@ -80,9 +78,8 @@ class ValidateQuestionnaireItem extends Component {
|
||||
: <div className="package-document">
|
||||
<Row>
|
||||
<Col>
|
||||
<span className="document-link"
|
||||
onClick={() => {this.downloadDocument(document)}}>
|
||||
<i className={'fa fa-file'}></i> {document.version}
|
||||
<span className="document-link">
|
||||
<i className={'fa fa-file'}></i> <a target="_blank" href={document.url}> {document.name} </a>
|
||||
</span>
|
||||
<br />
|
||||
<span className="document-status">
|
||||
|
||||
Reference in New Issue
Block a user