|
|
@@ -11,6 +11,7 @@ import ContentWrapper from "@/components/Layout/ContentWrapper";
|
|
|
import { Row, Col, Card, CardBody, FormGroup, Button, Input } from "reactstrap";
|
|
|
import { connect } from "react-redux";
|
|
|
import { notifDocPerbaikan } from "@/actions/notifikasi";
|
|
|
+import Loader from "@/components/Common/Loader";
|
|
|
|
|
|
let Dropzone = null;
|
|
|
class DropzoneWrapper extends Component {
|
|
|
@@ -119,64 +120,65 @@ class DetailPerbaikanDoc extends Component {
|
|
|
</div>
|
|
|
</div>
|
|
|
<Row>
|
|
|
- <Col xl="9">
|
|
|
- <Card className="card-default">
|
|
|
- <CardBody>
|
|
|
- <Row>
|
|
|
- <Col lg={12}>
|
|
|
- {sanksi?.data && <DetailSanksi data={sanksi.data[0]} />}
|
|
|
- <p className="lead bb">Dokumen Perbaikan</p>
|
|
|
- <form className="form-horizontal" method="get" action="/" onSubmit={this.onSubmit}>
|
|
|
- <FormGroup>
|
|
|
- <label className="row-form-label">Keterangan:</label>
|
|
|
- <div className="row-md-10">
|
|
|
- <Input type="textarea" value={this.state.keterangan} onChange={(e) => this.setState({ keterangan: e.target.value })} required />
|
|
|
- {/* <span className="form-text">Deskripsi pelaporan minimum karakter 50 maksimum 200 karakter</span> */}
|
|
|
- </div>
|
|
|
- </FormGroup>
|
|
|
- <FormGroup>
|
|
|
- <label className="row-form-label">Upload Dokumen:</label>
|
|
|
- <div className="row-md-10">
|
|
|
- <DropzoneWrapper className="" onDrop={this.onDrop}>
|
|
|
- {({ getRootProps, getInputProps, isDragActive }) => {
|
|
|
- return (
|
|
|
- <div {...getRootProps()} className={"dropzone card p-3 " + (isDragActive ? "dropzone-drag-active" : "")}>
|
|
|
- <input {...getInputProps()} />
|
|
|
- <div className="dropzone-previews flex">
|
|
|
- {this.state.files.length > 0 ? <Row>{thumbs}</Row> : <div className="text-center dz-default dz-message">Drop files here to upload</div>}
|
|
|
+ {sanksi?.data ? (
|
|
|
+ <Col xl="9">
|
|
|
+ <Card className="card-default">
|
|
|
+ <CardBody>
|
|
|
+ <Row>
|
|
|
+ <Col lg={12}>
|
|
|
+ <DetailSanksi data={sanksi.data[0]} />
|
|
|
+ <p className="lead bb">Dokumen Perbaikan</p>
|
|
|
+ <form className="form-horizontal" method="get" action="/" onSubmit={this.onSubmit}>
|
|
|
+ <FormGroup>
|
|
|
+ <label className="row-form-label">Keterangan:</label>
|
|
|
+ <div className="row-md-10">
|
|
|
+ <Input type="textarea" value={this.state.keterangan} onChange={(e) => this.setState({ keterangan: e.target.value })} required />
|
|
|
+ </div>
|
|
|
+ </FormGroup>
|
|
|
+ <FormGroup>
|
|
|
+ <label className="row-form-label">Upload Dokumen:</label>
|
|
|
+ <div className="row-md-10">
|
|
|
+ <DropzoneWrapper className="" onDrop={this.onDrop}>
|
|
|
+ {({ getRootProps, getInputProps, isDragActive }) => {
|
|
|
+ return (
|
|
|
+ <div {...getRootProps()} className={"dropzone card p-3 " + (isDragActive ? "dropzone-drag-active" : "")}>
|
|
|
+ <input {...getInputProps()} />
|
|
|
+ <div className="dropzone-previews flex">
|
|
|
+ {this.state.files.length > 0 ? <Row>{thumbs}</Row> : <div className="text-center dz-default dz-message">Drop files here to upload</div>}
|
|
|
+ </div>
|
|
|
+ <div className="d-flex align-items-center">
|
|
|
+ <small className="ml-auto">
|
|
|
+ <button type="button" className="btn btn-link" onClick={this.clearFiles}>
|
|
|
+ Clear files
|
|
|
+ </button>
|
|
|
+ </small>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div className="d-flex align-items-center">
|
|
|
- <small className="ml-auto">
|
|
|
- <button type="button" className="btn btn-link" onClick={this.clearFiles}>
|
|
|
- Clear files
|
|
|
- </button>
|
|
|
- </small>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- );
|
|
|
- }}
|
|
|
- </DropzoneWrapper>
|
|
|
- </div>
|
|
|
- </FormGroup>
|
|
|
- <FormGroup>
|
|
|
- <div className="row-xl-10">
|
|
|
- <Button color="primary" onClick={this.handleKirim} type="submit">
|
|
|
- Kirim
|
|
|
- </Button>
|
|
|
- </div>
|
|
|
- </FormGroup>
|
|
|
- </form>
|
|
|
- </Col>
|
|
|
- </Row>
|
|
|
- </CardBody>
|
|
|
- </Card>
|
|
|
- </Col>
|
|
|
+ );
|
|
|
+ }}
|
|
|
+ </DropzoneWrapper>
|
|
|
+ </div>
|
|
|
+ </FormGroup>
|
|
|
+ <FormGroup>
|
|
|
+ <div className="row-xl-10">
|
|
|
+ <Button color="primary" onClick={this.handleKirim} type="submit">
|
|
|
+ Kirim
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </FormGroup>
|
|
|
+ </form>
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ </CardBody>
|
|
|
+ </Card>
|
|
|
+ </Col>
|
|
|
+ ) : (
|
|
|
+ <Loader />
|
|
|
+ )}
|
|
|
<Col xl="3">{this.props.pt && <DetailPT data={this.props.pt[0]} />}</Col>
|
|
|
</Row>
|
|
|
<Row>
|
|
|
- <Col>
|
|
|
- <Riwayat data={sanksi?.data && sanksi.data[0].sanksi.doc_perbaikan} />
|
|
|
- </Col>
|
|
|
+ <Col>{sanksi?.data && <Riwayat data={sanksi.data[0].sanksi.doc_perbaikan} />}</Col>
|
|
|
</Row>
|
|
|
</div>
|
|
|
</ContentWrapper>
|