detail.js 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. import React, { Component } from "react";
  2. import Router from "next/router";
  3. import Link from "next/link";
  4. import Select from "react-select";
  5. import Scrollable from "@/components/Common/Scrollable";
  6. import ContentWrapper from "@/components/Layout/ContentWrapper";
  7. import {
  8. Row,
  9. Col,
  10. Card,
  11. CardHeader,
  12. CardBody,
  13. FormGroup,
  14. FormFeedback,
  15. FormText,
  16. Label,
  17. InputGroup,
  18. InputGroupAddon,
  19. InputGroupButtonDropdown,
  20. InputGroupText,
  21. Input,
  22. Button,
  23. DropdownToggle,
  24. DropdownMenu,
  25. CustomInput,
  26. DropdownItem,
  27. } from "reactstrap";
  28. let Dropzone = null;
  29. class DropzoneWrapper extends Component {
  30. state = {
  31. isClient: false,
  32. };
  33. componentDidMount = () => {
  34. Dropzone = require("react-dropzone").default;
  35. this.setState({ isClient: true });
  36. };
  37. render() {
  38. return Dropzone ? <Dropzone {...this.props}>{this.props.children}</Dropzone> : null;
  39. }
  40. }
  41. const styleHeaderText = {
  42. color: "brown",
  43. };
  44. const selectInstanceId = 1;
  45. class JawabanBanding extends Component {
  46. constructor(props) {
  47. super(props);
  48. this.state = {
  49. selectedOption: null,
  50. files: [],
  51. };
  52. }
  53. handleChangeSelect = (selectedOption) => {
  54. this.setState({ selectedOption });
  55. };
  56. onDrop = (files) => {
  57. this.setState({
  58. files: files.map((file) =>
  59. Object.assign(file, {
  60. preview: URL.createObjectURL(file),
  61. })
  62. ),
  63. stat: "Added " + files.length + " file(s)",
  64. });
  65. };
  66. uploadFiles = (e) => {
  67. e.preventDefault();
  68. e.stopPropagation();
  69. this.setState({
  70. stat: this.state.files.length ? "Dropzone ready to upload " + this.state.files.length + " file(s)" : "No files added.",
  71. });
  72. };
  73. clearFiles = (e) => {
  74. e.preventDefault();
  75. e.stopPropagation();
  76. this.setState({
  77. stat: this.state.files.length ? this.state.files.length + " file(s) cleared." : "No files to clear.",
  78. });
  79. this.setState({
  80. files: [],
  81. });
  82. };
  83. render() {
  84. const { files } = this.state;
  85. const thumbs = files.map((file, index) => (
  86. <Col md={3} key={index}>
  87. <img className="img-fluid mb-2" src={file.preview} alt="Item" />
  88. </Col>
  89. ));
  90. return (
  91. <ContentWrapper unwrap>
  92. <div className="bg-cover" style={{ backgroundImage: "url(/static/img/profile-bg.png)" }}>
  93. <div className="p-4 text-center" style={styleHeaderText}>
  94. <img className="img-thumbnail rounded-circle thumb128" src="/static/img/univ-avatar.png" alt="Avatar" />
  95. <h3 className="m-0">Universitas Satyagama</h3>
  96. <p>0742/O/1990</p>
  97. <p>Jalan Kamal Raya No 2-A Cengkareng</p>
  98. </div>
  99. </div>
  100. <div className="p-3">
  101. <div className="content-heading">
  102. <div>
  103. Permohonan Banding
  104. {/* <small>Form pembuatan laporan baru v.0.1</small> */}
  105. </div>
  106. <div className="ml-auto">
  107. <Link href="/app/pt/keberatan">
  108. <button className="btn btn-sm btn-secondary text-sm">&lt; back</button>
  109. </Link>
  110. </div>
  111. </div>
  112. <Row>
  113. <Col xl="9">
  114. <Card className="card-default">
  115. {/* <CardHeader>
  116. <label>Informasi Dokumen</label>
  117. </CardHeader> */}
  118. <CardBody>
  119. <Row>
  120. <Col lg="6">
  121. <p className="lead bb">Detail</p>
  122. <form className="form-horizontal">
  123. <FormGroup row>
  124. <Col md="4">Order ID:</Col>
  125. <Col md="8">
  126. <strong>987654</strong>
  127. </Col>
  128. </FormGroup>
  129. <FormGroup row>
  130. <Col md="4">Purchased On:</Col>
  131. <Col md="8">
  132. <strong>03/11/2015 10:10</strong>
  133. </Col>
  134. </FormGroup>
  135. <FormGroup row>
  136. <Col md="4">Client Name:</Col>
  137. <Col md="8">
  138. <strong>Addison Nichols</strong>
  139. </Col>
  140. </FormGroup>
  141. <FormGroup row>
  142. <Col md="4">Items:</Col>
  143. <Col md="8">
  144. <strong>547</strong>
  145. </Col>
  146. </FormGroup>
  147. <FormGroup row>
  148. <Col md="4">Amount:</Col>
  149. <Col md="8">
  150. <strong>$515.20</strong>
  151. </Col>
  152. </FormGroup>
  153. <FormGroup row>
  154. <Col md="4">Shipment:</Col>
  155. <Col md="8">
  156. <strong>04/10/2015</strong>
  157. </Col>
  158. </FormGroup>
  159. <FormGroup row>
  160. <Col md="4">Status</Col>
  161. <Col md="8">
  162. <div className="badge badge-info">Shipped</div>
  163. </Col>
  164. </FormGroup>
  165. <FormGroup row>
  166. <Col md="4">File Pendukung</Col>
  167. <Col md="8">
  168. <Scrollable height="120px" className="list-group">
  169. <table className="table table-bordered bg-transparent">
  170. <tbody>
  171. <tr>
  172. <td>
  173. <em className="fa-lg far fa-file-code"></em>
  174. </td>
  175. <td>
  176. <a className="text-muted" href="">
  177. database.controller.js
  178. </a>
  179. </td>
  180. </tr>
  181. <tr>
  182. <td>
  183. <em className="fa-lg far fa-file-image"></em>
  184. </td>
  185. <td>
  186. <a className="text-muted" href="">
  187. baground-lg.png
  188. </a>
  189. </td>
  190. </tr>
  191. <tr>
  192. <td>
  193. <em className="fa-lg far fa-file-code"></em>
  194. </td>
  195. <td>
  196. <a className="text-muted" href="">
  197. picture.controller.js
  198. </a>
  199. </td>
  200. </tr>
  201. <tr>
  202. <td>
  203. <em className="fa-lg far fa-file-word"></em>
  204. </td>
  205. <td>
  206. <a className="text-muted" href="">
  207. applicat-diagrams.docx
  208. </a>
  209. </td>
  210. </tr>
  211. <tr>
  212. <td>
  213. <em className="fa-lg far fa-file-code"></em>
  214. </td>
  215. <td>
  216. <a className="text-muted" href="">
  217. database.controller.js
  218. </a>
  219. </td>
  220. </tr>
  221. <tr>
  222. <td>
  223. <em className="fa-lg far fa-file-code"></em>
  224. </td>
  225. <td>
  226. <a className="text-muted" href="">
  227. database.controller.js
  228. </a>
  229. </td>
  230. </tr>
  231. </tbody>
  232. </table>
  233. </Scrollable>
  234. </Col>
  235. </FormGroup>
  236. </form>
  237. </Col>
  238. <Col lg={6}>
  239. <p className="lead bb">Jawaban</p>
  240. <form className="form-horizontal" method="get" action="/" onSubmit={this.onSubmit}>
  241. <FormGroup>
  242. <label className="row-form-label">Status</label>
  243. <div className="row-md-10">
  244. <Select
  245. instanceId={selectInstanceId + 1}
  246. value={this.state.selectedOption}
  247. onChange={this.handleChangeSelect}
  248. options={[
  249. { value: "diterima", label: "Diterima", className: "State-ACT" },
  250. { value: "ditolak", label: "Ditolak", className: "State-ACT" },
  251. ]}
  252. required
  253. />
  254. {/* <span className="form-text">Pilih Jenis Pelanggaran</span> */}
  255. </div>
  256. </FormGroup>
  257. <FormGroup>
  258. <label className="row-form-label">Upload Dokumen Jawaban</label>
  259. <div className="row-md-10">
  260. <DropzoneWrapper className="" onDrop={this.onDrop}>
  261. {({ getRootProps, getInputProps, isDragActive }) => {
  262. return (
  263. <div {...getRootProps()} className={"dropzone card p-3 " + (isDragActive ? "dropzone-drag-active" : "")}>
  264. <input {...getInputProps()} />
  265. <div className="dropzone-previews flex">
  266. {this.state.files.length > 0 ? <Row>{thumbs}</Row> : <div className="text-center dz-default dz-message">Drop files here to upload</div>}
  267. </div>
  268. <div className="d-flex align-items-center">
  269. <small className="ml-auto">
  270. <button type="button" className="btn btn-link" onClick={this.clearFiles}>
  271. Clear files
  272. </button>
  273. </small>
  274. </div>
  275. </div>
  276. );
  277. }}
  278. </DropzoneWrapper>
  279. </div>
  280. </FormGroup>
  281. <FormGroup>
  282. <div className="row-xl-10">
  283. <button className="btn btn-sm btn-primary" type="submit">
  284. Simpan
  285. </button>
  286. </div>
  287. </FormGroup>
  288. </form>
  289. </Col>
  290. </Row>
  291. </CardBody>
  292. </Card>
  293. {/* END card */}
  294. </Col>
  295. <Col xl="3">
  296. <div className="card card-default">
  297. <div className="card-body">
  298. <div className="text-center">
  299. <h3 className="mt-0">Universitas Satyagama</h3>
  300. <p>0742/O/1990</p>
  301. </div>
  302. <hr />
  303. <ul className="list-unstyled px-4">
  304. <li>
  305. <em className="fa fa-globe fa-fw mr-3"></em>www.satyagama.ac.id
  306. </li>
  307. <li>
  308. <em className="fa fa-graduation-cap fa-fw mr-3"></em>Status Pelanggaran : Tidak Ada
  309. </li>
  310. </ul>
  311. </div>
  312. </div>
  313. </Col>
  314. </Row>
  315. </div>
  316. </ContentWrapper>
  317. );
  318. }
  319. }
  320. export default JawabanBanding;