|
|
@@ -2,32 +2,15 @@ import React, { Component } from "react";
|
|
|
import Router from "next/router";
|
|
|
import Link from "next/link";
|
|
|
import Select from "react-select";
|
|
|
-import Datatable from "@/components/Tables/Datatable";
|
|
|
-import Scrollable from "@/components/Common/Scrollable";
|
|
|
-
|
|
|
+import DetailSanksi from "@/components/Main/DetailSanksi";
|
|
|
+import Header from "@/components/Main/Header";
|
|
|
+import DetailPT from "@/components/Main/DetailPT";
|
|
|
+import PermohonanPT from "@/components/Main/PermohonanPT";
|
|
|
+import Riwayat from "@/components/PencabutanSanksi/Riwayat";
|
|
|
+import { getSanksi } from "@/actions/sanksi";
|
|
|
+import { addJawabanCabutSanksi } from "@/actions/cabutSanksi";
|
|
|
import ContentWrapper from "@/components/Layout/ContentWrapper";
|
|
|
-import {
|
|
|
- Row,
|
|
|
- Col,
|
|
|
- Card,
|
|
|
- CardHeader,
|
|
|
- CardBody,
|
|
|
- CardTitle,
|
|
|
- FormGroup,
|
|
|
- FormFeedback,
|
|
|
- FormText,
|
|
|
- Label,
|
|
|
- InputGroup,
|
|
|
- InputGroupAddon,
|
|
|
- InputGroupButtonDropdown,
|
|
|
- InputGroupText,
|
|
|
- Input,
|
|
|
- Button,
|
|
|
- DropdownToggle,
|
|
|
- DropdownMenu,
|
|
|
- CustomInput,
|
|
|
- DropdownItem,
|
|
|
-} from "reactstrap";
|
|
|
+import { Row, Col, Card, CardBody, FormGroup, Button, Input } from "reactstrap";
|
|
|
|
|
|
let Dropzone = null;
|
|
|
class DropzoneWrapper extends Component {
|
|
|
@@ -43,10 +26,6 @@ class DropzoneWrapper extends Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const styleHeaderText = {
|
|
|
- color: "brown",
|
|
|
-};
|
|
|
-
|
|
|
const selectInstanceId = 1;
|
|
|
|
|
|
class JawabanPencabutanSanksi extends Component {
|
|
|
@@ -55,9 +34,15 @@ class JawabanPencabutanSanksi extends Component {
|
|
|
this.state = {
|
|
|
selectedOption: null,
|
|
|
files: [],
|
|
|
+ keterangan: "",
|
|
|
};
|
|
|
}
|
|
|
|
|
|
+ static getInitialProps = async ({ query }) => {
|
|
|
+ const sanksi = await getSanksi(query);
|
|
|
+ return { sanksi, query };
|
|
|
+ };
|
|
|
+
|
|
|
handleChangeSelect = (selectedOption) => {
|
|
|
this.setState({ selectedOption });
|
|
|
};
|
|
|
@@ -92,9 +77,35 @@ class JawabanPencabutanSanksi extends Component {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+ setKeterangan = (e) => {
|
|
|
+ this.setState({ keterangan: e.target.value });
|
|
|
+ };
|
|
|
+
|
|
|
+ handleSimpan = async (e) => {
|
|
|
+ e.preventDefault();
|
|
|
+ const { selectedOption, keterangan } = this.state;
|
|
|
+ const { noSanksi, ptId } = this.props.query;
|
|
|
+ const formdata = new FormData();
|
|
|
+ formdata.append("status", selectedOption.value);
|
|
|
+ formdata.append("description", keterangan);
|
|
|
+ if (this.state.files.length > 0) {
|
|
|
+ this.state.files.forEach((e) => {
|
|
|
+ formdata.append("files", e);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ const added = await addJawabanCabutSanksi({ noSanksi, ptId }, formdata);
|
|
|
+ // console.log(added);
|
|
|
+ if (added) {
|
|
|
+ Router.push({
|
|
|
+ pathname: "/app/pencabutan-sanksi",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
render() {
|
|
|
const { files, selectedOption } = this.state;
|
|
|
- console.log(this.state);
|
|
|
+ const { sanksi } = this.props;
|
|
|
|
|
|
const thumbs = files.map((file, index) => (
|
|
|
<Col md={3} key={index}>
|
|
|
@@ -104,22 +115,12 @@ class JawabanPencabutanSanksi extends Component {
|
|
|
|
|
|
return (
|
|
|
<ContentWrapper unwrap>
|
|
|
- <div className="bg-cover" style={{ backgroundImage: "url(/static/img/profile-bg.png)" }}>
|
|
|
- <div className="p-4 text-center" style={styleHeaderText}>
|
|
|
- <img className="img-thumbnail rounded-circle thumb128" src="/static/img/univ-avatar.png" alt="Avatar" />
|
|
|
- <h3 className="m-0">Universitas Satyagama</h3>
|
|
|
- <p>0742/O/1990</p>
|
|
|
- <p>Jalan Kamal Raya No 2-A Cengkareng</p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <Header />
|
|
|
<div className="p-3">
|
|
|
<div className="content-heading">
|
|
|
- <div>
|
|
|
- Permohonan Pencabutan Sanksi
|
|
|
- {/* <small>Form pembuatan laporan baru v.0.1</small> */}
|
|
|
- </div>
|
|
|
+ <div>Jawaban Permohonan Pencabutan Sanksi</div>
|
|
|
<div className="ml-auto">
|
|
|
- <Link href="/app/pt/keberatan">
|
|
|
+ <Link href="/app/pencabutan-sanksi">
|
|
|
<button className="btn btn-sm btn-secondary text-sm">< back</button>
|
|
|
</Link>
|
|
|
</div>
|
|
|
@@ -127,279 +128,94 @@ class JawabanPencabutanSanksi extends Component {
|
|
|
<Row>
|
|
|
<Col xl="9">
|
|
|
<Card className="card-default">
|
|
|
- {/* <CardHeader>
|
|
|
- <label>Informasi Dokumen</label>
|
|
|
- </CardHeader> */}
|
|
|
<CardBody>
|
|
|
<Row>
|
|
|
<Col lg="6">
|
|
|
- <p className="lead bb">Detail Laporan</p>
|
|
|
- <form className="form-horizontal">
|
|
|
- <FormGroup row>
|
|
|
- <Col md="4">Nomor Laporan:</Col>
|
|
|
- <Col md="8">
|
|
|
- <strong>987654</strong>
|
|
|
- </Col>
|
|
|
- </FormGroup>
|
|
|
- <FormGroup row>
|
|
|
- <Col md="4">Nama Perguruan Tinggi:</Col>
|
|
|
- <Col md="8">
|
|
|
- <strong>Universitas Satyagama</strong>
|
|
|
- </Col>
|
|
|
- </FormGroup>
|
|
|
- <FormGroup row>
|
|
|
- <Col md="4">Jenis Pelanggaran:</Col>
|
|
|
- <Col md="8">
|
|
|
- <Scrollable height="75px" className="list-group">
|
|
|
- <ul>
|
|
|
- <li>Lorem ipsum dolor sit amet.</li>
|
|
|
- <li>Lorem, ipsum dolor.</li>
|
|
|
- <li>Lorem ipsum dolor sit.</li>
|
|
|
- </ul>
|
|
|
- </Scrollable>
|
|
|
- </Col>
|
|
|
- </FormGroup>
|
|
|
- <FormGroup row>
|
|
|
- <Col md="4">Keterangan Laporan:</Col>
|
|
|
- <Col md="8">
|
|
|
- <Scrollable height="100px" className="list-group">
|
|
|
- <p>
|
|
|
- Lorem ipsum dolor sit, amet consectetur adipisicing elit. Amet dicta placeat enim illo aspernatur adipisci neque repellendus itaque blanditiis fugit. Quam obcaecati sed
|
|
|
- perferendis facere.
|
|
|
- </p>
|
|
|
- </Scrollable>
|
|
|
- </Col>
|
|
|
- </FormGroup>
|
|
|
- <FormGroup row>
|
|
|
- <Col md="4">Dibuat Pada:</Col>
|
|
|
- <Col md="8">
|
|
|
- <strong>23 Januari 2022</strong>
|
|
|
- </Col>
|
|
|
- </FormGroup>
|
|
|
- <FormGroup row>
|
|
|
- <Col md="4">Status</Col>
|
|
|
- <Col md="8">
|
|
|
- <div className="badge badge-info">Ditindaklanjuti</div>
|
|
|
- </Col>
|
|
|
- </FormGroup>
|
|
|
- <FormGroup row>
|
|
|
- <Col md="4">File Pendukung</Col>
|
|
|
- <Col md="8">
|
|
|
- <Scrollable height="120px" className="list-group">
|
|
|
- <table className="table table-bordered bg-transparent">
|
|
|
- <tbody>
|
|
|
- <tr>
|
|
|
- <td>
|
|
|
- <em className="fa-lg far fa-file-code"></em>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <a className="text-muted" href="">
|
|
|
- database.controller.js
|
|
|
- </a>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td>
|
|
|
- <em className="fa-lg far fa-file-image"></em>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <a className="text-muted" href="">
|
|
|
- baground-lg.png
|
|
|
- </a>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td>
|
|
|
- <em className="fa-lg far fa-file-code"></em>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <a className="text-muted" href="">
|
|
|
- picture.controller.js
|
|
|
- </a>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td>
|
|
|
- <em className="fa-lg far fa-file-word"></em>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <a className="text-muted" href="">
|
|
|
- applicat-diagrams.docx
|
|
|
- </a>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td>
|
|
|
- <em className="fa-lg far fa-file-code"></em>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <a className="text-muted" href="">
|
|
|
- database.controller.js
|
|
|
- </a>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td>
|
|
|
- <em className="fa-lg far fa-file-code"></em>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <a className="text-muted" href="">
|
|
|
- database.controller.js
|
|
|
- </a>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- </Scrollable>
|
|
|
- </Col>
|
|
|
- </FormGroup>
|
|
|
- </form>
|
|
|
+ <DetailSanksi data={sanksi.data[0]} />
|
|
|
</Col>
|
|
|
<Col lg={6}>
|
|
|
- <p className="lead bb">Jawaban</p>
|
|
|
- <form className="form-horizontal" method="get" action="/" onSubmit={this.onSubmit}>
|
|
|
- <FormGroup>
|
|
|
- <label className="row-form-label">Status:</label>
|
|
|
- <div className="row-md-10">
|
|
|
- <Select
|
|
|
- instanceId={selectInstanceId + 1}
|
|
|
- value={this.state.selectedOption}
|
|
|
- onChange={this.handleChangeSelect}
|
|
|
- options={[
|
|
|
- { value: "diterima", label: "Diterima", className: "State-ACT" },
|
|
|
- { value: "rekomendasi perbaikan", label: "Rekomendasi Perbaikan", className: "State-ACT" },
|
|
|
- ]}
|
|
|
- required
|
|
|
- />
|
|
|
- {/* <span className="form-text">Pilih Jenis Pelanggaran</span> */}
|
|
|
- </div>
|
|
|
- </FormGroup>
|
|
|
- {selectedOption && selectedOption.value === "rekomendasi perbaikan" ? (
|
|
|
- <FormGroup>
|
|
|
- <label className="row-form-label">Keterangan:</label>
|
|
|
- <div className="row-md-10">
|
|
|
- <Input type="textarea" value={this.state.keteranganLaporan} onChange={this.setKeteranganPelaporan} 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>}
|
|
|
- </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 className="btn btn-sm btn-primary" type="submit">
|
|
|
- Simpan
|
|
|
- </button>
|
|
|
- </div>
|
|
|
- </FormGroup>
|
|
|
- </form>
|
|
|
+ <Row>
|
|
|
+ <Col>
|
|
|
+ <PermohonanPT data={sanksi.data[0]} />
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ <Row>
|
|
|
+ <Col>
|
|
|
+ <p className="lead bb">Jawaban</p>
|
|
|
+ <form className="form-horizontal" method="get" action="/" onSubmit={this.onSubmit}>
|
|
|
+ <FormGroup>
|
|
|
+ <label className="row-form-label">Status:</label>
|
|
|
+ <div className="row-md-10">
|
|
|
+ <Select
|
|
|
+ instanceId={selectInstanceId + 1}
|
|
|
+ value={this.state.selectedOption}
|
|
|
+ onChange={this.handleChangeSelect}
|
|
|
+ options={[
|
|
|
+ { value: "diterima", label: "Diterima", className: "State-ACT" },
|
|
|
+ { value: "rekomendasi perbaikan", label: "Rekomendasi Perbaikan", className: "State-ACT" },
|
|
|
+ ]}
|
|
|
+ required
|
|
|
+ />
|
|
|
+ {/* <span className="form-text">Pilih Jenis Pelanggaran</span> */}
|
|
|
+ </div>
|
|
|
+ </FormGroup>
|
|
|
+ {selectedOption && selectedOption.value === "rekomendasi perbaikan" ? (
|
|
|
+ <FormGroup>
|
|
|
+ <label className="row-form-label">Keterangan:</label>
|
|
|
+ <div className="row-md-10">
|
|
|
+ <Input type="textarea" value={this.state.keterangan} onChange={this.setKeterangan} 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>}
|
|
|
+ </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.handleSimpan} type="submit">
|
|
|
+ Simpan
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </FormGroup>
|
|
|
+ </form>
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
</Col>
|
|
|
</Row>
|
|
|
</CardBody>
|
|
|
</Card>
|
|
|
- {/* END card */}
|
|
|
</Col>
|
|
|
<Col xl="3">
|
|
|
- <div className="card card-default">
|
|
|
- <div className="card-body">
|
|
|
- <div className="text-center">
|
|
|
- <h3 className="mt-0">Universitas Satyagama</h3>
|
|
|
- <p>0742/O/1990</p>
|
|
|
- </div>
|
|
|
- <hr />
|
|
|
- <ul className="list-unstyled px-4">
|
|
|
- <li>
|
|
|
- <em className="fa fa-globe fa-fw mr-3"></em>www.satyagama.ac.id
|
|
|
- </li>
|
|
|
- <li>
|
|
|
- <em className="fa fa-graduation-cap fa-fw mr-3"></em>Status Pelanggaran : Tidak Ada
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <DetailPT />
|
|
|
</Col>
|
|
|
</Row>
|
|
|
<Row>
|
|
|
<Col>
|
|
|
- <Card className="card-default">
|
|
|
- <CardHeader>
|
|
|
- <CardTitle>Riwayat</CardTitle>
|
|
|
- {/* <div className="text-sm">DataTables has most features enabled by default, so all you need to do to use it with your own tables is to call the construction function: $().DataTable();.</div> */}
|
|
|
- </CardHeader>
|
|
|
- <CardBody>
|
|
|
- <Datatable options={{ responsive: true }}>
|
|
|
- <table className="table table-striped my-4 w-100">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>Tanggal</th>
|
|
|
- <th>Status</th>
|
|
|
- <th>Keterangan</th>
|
|
|
- <th>Dokumen</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- <tr>
|
|
|
- <td>23/01/2022</td>
|
|
|
- <td>Rekomendasi Perbaikan</td>
|
|
|
- <td>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quos, maxime.</td>
|
|
|
- <td>
|
|
|
- <em className="fa-lg far fa-file-code"></em>
|
|
|
- <a className="text-muted" href="">
|
|
|
- database.controller.js
|
|
|
- </a>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td>23/01/2022</td>
|
|
|
- <td>Rekomendasi Perbaikan</td>
|
|
|
- <td>Lorem ipsum dolor sit amet consectetur adipisicing.</td>
|
|
|
- <td>
|
|
|
- <em className="fa-lg far fa-file-code"></em>
|
|
|
- <a className="text-muted" href="">
|
|
|
- database.controller.js
|
|
|
- </a>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td>23/01/2022</td>
|
|
|
- <td>Rekomendasi Perbaikan</td>
|
|
|
- <td>Lorem ipsum dolor sit.</td>
|
|
|
- <td>
|
|
|
- <em className="fa-lg far fa-file-code"></em>
|
|
|
- <a className="text-muted" href="">
|
|
|
- database.controller.js
|
|
|
- </a>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- </Datatable>
|
|
|
- </CardBody>
|
|
|
- </Card>
|
|
|
+ <Riwayat data={sanksi.data[0]} />
|
|
|
</Col>
|
|
|
</Row>
|
|
|
</div>
|