Procházet zdrojové kódy

pemantauan, pelaporan tuntas,pelaporan di tututp di tampilin di pemantauan

andi před 3 roky
rodič
revize
3ae9b7956c

+ 6 - 1
components/Main/DetailLaporan.js

@@ -125,7 +125,12 @@ function DetailLaporan({ data, noTitle = false, noStatus = false }) {
 						</Col>
 					</FormGroup>
 				) : (
-					""
+					<FormGroup row>
+						<Col md="4">Status:</Col>
+						<Col md="8">
+							<div className="badge badge-danger">Ditutup</div>
+						</Col>
+					</FormGroup>
 				)}
 				{/* <FormGroup row>
 					<Col md="4">Prioritas:</Col>

+ 0 - 197
components/Riwayat/TableRadar.js

@@ -1,197 +0,0 @@
-import React, { Component } from 'react';
-import ContentWrapper from '@/components/Layout/ContentWrapper';
-import { Row, Col, Card, CardHeader, CardBody, Table } from 'reactstrap';
-
-
-function TableRadar() {
-    return (
-        <Card className="card-default">
-            {/* <CardHeader>Context Classes</CardHeader> */}
-            <CardBody>
-                <Table responsive bordered>
-                    <thead>
-                        <tr>
-                            <th>Menu\Wilayah LLDikti</th>
-                            <th>I</th>
-                            <th>II</th>
-                            <th>III</th>
-                            <th>IV</th>
-                            <th>V</th>
-                            <th>VI</th>
-                            <th>VII</th>
-                            <th>VIII</th>
-                            <th>IX</th>
-                            <th>X</th>
-                            <th>XI</th>
-                            <th>XII</th>
-                            <th>XIII</th>
-                            <th>XIV</th>
-                            <th>XV</th>
-                            <th>XVI</th>
-                        </tr>
-                    </thead>
-                    <thead>
-                        <tr style={{
-                            backgroundColor: '#80b1ff',
-                            color: "black",
-                        }}>
-                            <th>Penjadwalan Evaluasi</th>
-                            <td>8</td>
-                            <td>5</td>
-                            <td>3</td>
-                            <td>4</td>
-                            <td>5</td>
-                            <td>1</td>
-                            <td>6</td>
-                            <td>8</td>
-                            <td>3</td>
-                            <td>9</td>
-                            <td>5</td>
-                            <td>2</td>
-                            <td>9</td>
-                            <td>6</td>
-                            <td>4</td>
-                            <td>2</td>
-                        </tr>
-                        <tr style={{
-                            backgroundColor: '#de8383',
-                            color: "black",
-                        }}>
-                            <th>Pemeriksaan</th>
-                            <td>2</td>
-                            <td>3</td>
-                            <td>4</td>
-                            <td>2</td>
-                            <td>5</td>
-                            <td>4</td>
-                            <td>3</td>
-                            <td>6</td>
-                            <td>7</td>
-                            <td>8</td>
-                            <td>6</td>
-                            <td>5</td>
-                            <td>4</td>
-                            <td>3</td>
-                            <td>2</td>
-                            <td>1</td>
-                        </tr>
-                        <tr style={{
-                            backgroundColor: '#fdda80',
-                            color: "black",
-                        }}>
-                            <th>Sanksi</th>
-                            <td>4</td>
-                            <td>6</td>
-                            <td>8</td>
-                            <td>5</td>
-                            <td>7</td>
-                            <td>5</td>
-                            <td>6</td>
-                            <td>8</td>
-                            <td>9</td>
-                            <td>4</td>
-                            <td>3</td>
-                            <td>2</td>
-                            <td>4</td>
-                            <td>5</td>
-                            <td>6</td>
-                            <td>7</td>
-
-                        </tr>
-                        <tr style={{
-                            backgroundColor: '#cfab80',
-                            color: "black",
-                        }}>
-                            <th>Keberatan</th>
-                            <td>8</td>
-                            <td>6</td>
-                            <td>8</td>
-                            <td>1</td>
-                            <td>2</td>
-                            <td>3</td>
-                            <td>4</td>
-                            <td>5</td>
-                            <td>6</td>
-                            <td>7</td>
-                            <td>8</td>
-                            <td>8</td>
-                            <td>7</td>
-                            <td>6</td>
-                            <td>5</td>
-                            <td>3</td>
-                        </tr>
-                        <tr style={{
-                            backgroundColor: '#ef90df',
-                            color: "black",
-                        }}>
-                            <th>Banding</th>
-                            <td>4</td>
-                            <td>6</td>
-                            <td>8</td>
-                            <td>9</td>
-                            <td>8</td>
-                            <td>7</td>
-                            <td>6</td>
-                            <td>5</td>
-                            <td>4</td>
-                            <td>3</td>
-                            <td>2</td>
-                            <td>1</td>
-                            <td>2</td>
-                            <td>3</td>
-                            <td>4</td>
-                            <td>4</td>
-                        </tr>
-                        <tr style={{
-                            backgroundColor: '#80df89',
-                            color: "black",
-                        }}>
-                            <th>Pemantauan perbaikan</th>
-                            <td>4</td>
-                            <td>6</td>
-                            <td>8</td>
-                            <td>4</td>
-                            <td>5</td>
-                            <td>6</td>
-                            <td>7</td>
-                            <td>8</td>
-                            <td>8</td>
-                            <td>9</td>
-                            <td>3</td>
-                            <td>4</td>
-                            <td>5</td>
-                            <td>6</td>
-                            <td>7</td>
-                            <td>3</td>
-                        </tr>
-                        <tr style={{
-                            backgroundColor: '#a3d4d1',
-                            color: "black",
-                        }}>
-                            <th>Pencabutan Sanksi</th>
-                            <td>4</td>
-                            <td>6</td>
-                            <td>6</td>
-                            <td>9</td>
-                            <td>8</td>
-                            <td>7</td>
-                            <td>6</td>
-                            <td>3</td>
-                            <td>2-</td>
-                            <td>1</td>
-                            <td>8</td>
-                            <td>5</td>
-                            <td>4</td>
-                            <td>3</td>
-                            <td>6</td>
-                            <td>7</td>
-                        </tr>
-                    </thead>
-                </Table>
-            </CardBody>
-        </Card>
-    )
-}
-
-export default TableRadar
-

+ 1 - 1
pages/app/laporan-delegasi/detail.js

@@ -29,7 +29,7 @@ class DetailPelaporan extends Component {
 	componentDidMount = async () => {
 		const { token, query } = this.props;
 		const pelaporan = await getOneLaporan(this.props.token, query.id + "?delegasi=true&?aktif=false");
-		// await createLog(token, { aktivitas: `Mengakses halaman detail Laporan Delegasi dengan No. Laporan ${pelaporan.data.no_laporan}`, menu: "Laporan Delegasi" });
+		await createLog(token, { aktivitas: `Mengakses halaman detail Laporan Delegasi dengan No. Laporan ${pelaporan.data.no_laporan}`, menu: "Laporan Delegasi" });
 		const pemantauan = await getLog(this.props.token, query.id + "?delegasi=true&asc=true");
 		pemantauan.data = pemantauan.data.filter((e) => e.action != "CREATE LAPORAN");
 		this.setState({ pelaporan, pemantauan });

+ 49 - 14
pages/app/pemantauan/index.js

@@ -15,6 +15,7 @@ class Search extends Component {
 		pembina: [],
 		selectedOptionMulti: [],
 		data: [],
+		nodata: false,
 	};
 
 	componentDidMount = async () => {
@@ -53,27 +54,44 @@ class Search extends Component {
 	};
 
 	fetchData = async () => {
-		const pembina = this.props.user.role.id === 2021 ? null : this.state.selectedOptionMulti.map((e) => e.value).join(",");
+		const pembina = this.props.user.role.id === 2021 ? null : this.state.selectedOptionMulti?.map((e) => e.value).join(",");
 		const searchValue = document.getElementById("searchInput").value;
 		const jsonData = await getPT(this.props.token, { search: searchValue, pembina });
 		this.setState({ data: jsonData.data ? jsonData.data : [] });
+		// console.log(this.state.data)
 	};
 
-	handleApplyClick = () => {
-		this.fetchData();
-		if (this.state.data && this.state.data.length) {
-			this.renderTableData();
-		}
-	};
+	// handleApplyClick = () => {
+	// 	this.fetchData();
+	// 	if (this.state.data && this.state.data.length > 0) {
+	// 		this.renderTableData();
+	// 		this.setState({ noData: true });
+	// 		// this.setState({ noData: false });
+
+	// 	}
+	// 	this.checknodata();
+	// 	// else {
+	// 	// 	this.setState({ noData: true })
+	// 	// }
+	// };
+
+	// handleSearchClick = () => {
+	// 	this.fetchData();
+	// 	if (this.state.data && this.state.data.length) {
+	// 		this.renderTableData();
+	// 		this.setState({ noData: true });
+	// 		// this.setState({ noData: false });
+	// 	}
+	// 	else {
+	// 		// this.setState({ noData: true });
+
+	// 		this.checknodata();
+	// 	}
+	// };
 
-	handleSearchClick = () => {
-		this.fetchData();
-		if (this.state.data && this.state.data.length) {
-			this.renderTableData();
-		}
-	};
 
 	renderTableData() {
+		console.log(this.state.data)
 		return (
 			this.state.data &&
 			this.state.data.map((pt, index) => {
@@ -112,6 +130,22 @@ class Search extends Component {
 		);
 	}
 
+	handleApplyClick = () => {
+		this.fetchData();
+		if (this.state.data && this.state.data.length > 0) {
+			this.renderTableData();
+			this.setState({ noData: true });
+		}
+	};
+
+	handleSearchClick = () => {
+		this.fetchData();
+		if (this.state.data && this.state.data.length) {
+			this.renderTableData();
+			this.setState({ noData: true });
+		}
+	};
+
 	render() {
 		const { selectedOptionMulti, pembina } = this.state;
 		return (
@@ -133,6 +167,7 @@ class Search extends Component {
 								onKeyPress={(e) => {
 									if (e.key === "Enter") {
 										this.handleApplyClick();
+										this.handleSearchClick();
 									}
 								}}
 							/>
@@ -158,7 +193,7 @@ class Search extends Component {
 							</Table>
 							{/* END table-responsive */}
 							<div className="card-footer">
-								<div className="d-flex"></div>
+								<div >{!this.state.data.length > 0 && this.state.noData && (<h3 className=" text-center">Data tidak ditemukan</h3>)}</div>
 							</div>
 						</div>
 						{/* END card */}

+ 2 - 2
pages/app/pemantauan/timeline.js

@@ -32,7 +32,7 @@ class Pemantauan extends Component {
 	componentDidMount = async () => {
 		const { query, token } = this.props;
 		const ptId = query.ptId;
-		const pelaporan = await getPelaporan(token, { pt_id: ptId, all: true });
+		const pelaporan = await getPelaporan(token, { pt_id: ptId, all: true, aktif: false });
 		const pt = await getOnePT(token, ptId);
 		this.setState({ pelaporan, pt });
 	};
@@ -40,7 +40,7 @@ class Pemantauan extends Component {
 	handleLihatPemantaun = async (e, id_laporan) => {
 		const { token } = this.props;
 		const log = await getLog(token, id_laporan);
-		const detailLaporanPt = await getOneLaporan(token, id_laporan, { all: true });
+		const detailLaporanPt = await getOneLaporan(token, id_laporan, { all: true, aktif: false });
 		this.setState({ detailLaporanPt, log });
 	};
 

+ 1 - 1
pages/app/tuntas/detail.js

@@ -24,7 +24,7 @@ class DetailPelaporan extends Component {
 
 	componentDidMount = async () => {
 		const { token, query } = this.props;
-		const pelaporan = await getOneLaporan(this.props.token, query.id);
+		const pelaporan = await getOneLaporan(this.props.token, query.id + "?aktif=false");
 		await createLog(token, { aktivitas: `Mengakses halaman detail Pelaporan Tuntas dengan No. Laporan ${pelaporan.data.no_laporan}`, menu: "Pelaporan" });
 		this.setState({ pelaporan });
 	};