upd: report divisi
Deskripsi: blm bisa karena tidak ada package yg cocok - package input date No Issues
This commit is contained in:
@@ -7,30 +7,92 @@ import SelectForm from "@/components/selectForm";
|
|||||||
import Styles from "@/constants/Styles";
|
import Styles from "@/constants/Styles";
|
||||||
import { router, Stack } from "expo-router";
|
import { router, Stack } from "expo-router";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { SafeAreaView, ScrollView, View } from "react-native";
|
import { Button, SafeAreaView, ScrollView, View } from "react-native";
|
||||||
|
import DateTimePickerModal from "react-native-modal-datetime-picker";
|
||||||
|
|
||||||
export default function Report() {
|
export default function Report() {
|
||||||
const [chooseGroup, setChooseGroup] = useState({ val: '', label: '' })
|
const [chooseGroup, setChooseGroup] = useState({ val: "", label: "" });
|
||||||
|
const [error, setError] = useState({
|
||||||
|
group: false,
|
||||||
|
date: false,
|
||||||
|
dateEnd: false,
|
||||||
|
});
|
||||||
|
const [date, setDate] = useState("");
|
||||||
|
const [isDatePickerVisible, setDatePickerVisibility] = useState(false);
|
||||||
|
|
||||||
|
const showDatePicker = () => {
|
||||||
|
setDatePickerVisibility(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const hideDatePicker = () => {
|
||||||
|
setDatePickerVisibility(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleConfirm = (date: any) => {
|
||||||
|
setDate(date);
|
||||||
|
hideDatePicker();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
headerLeft: () => (
|
||||||
headerTitle: 'Laporan Divisi',
|
<ButtonBackHeader
|
||||||
headerTitleAlign: 'center',
|
onPress={() => {
|
||||||
|
router.back();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
headerTitle: "Laporan Divisi",
|
||||||
|
headerTitleAlign: "center",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ScrollView>
|
<ScrollView>
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
<SelectForm bg="white" label="Lembaga Desa" placeholder="Pilih Lembaga Desa" value={chooseGroup.label} required onPress={() => { }} />
|
<SelectForm
|
||||||
<InputForm bg="white" label="Tanggal Awal" type="default" placeholder="Pilih Tanggal Awal" required />
|
bg="white"
|
||||||
<InputForm bg="white" label="Tanggal Akhir" type="default" placeholder="Pilih Tanggal Akhir" required />
|
label="Lembaga Desa"
|
||||||
|
placeholder="Pilih Lembaga Desa"
|
||||||
|
value={chooseGroup.label}
|
||||||
|
required
|
||||||
|
onPress={() => { }}
|
||||||
|
error={error.group}
|
||||||
|
errorText="Lembaga Desa tidak boleh kosong"
|
||||||
|
/>
|
||||||
|
<Button title="Open" onPress={showDatePicker} />
|
||||||
|
{/* <DateTimePickerModal
|
||||||
|
isVisible={isDatePickerVisible}
|
||||||
|
mode="date"
|
||||||
|
date={new Date()}
|
||||||
|
onConfirm={handleConfirm}
|
||||||
|
onCancel={hideDatePicker}
|
||||||
|
/> */}
|
||||||
|
<InputForm
|
||||||
|
bg="white"
|
||||||
|
label="Tanggal Awal"
|
||||||
|
type="default"
|
||||||
|
placeholder="Pilih Tanggal Awal"
|
||||||
|
required
|
||||||
|
error={error.date}
|
||||||
|
errorText="Tanggal awal tidak boleh kosong"
|
||||||
|
/>
|
||||||
|
<InputForm
|
||||||
|
bg="white"
|
||||||
|
label="Tanggal Akhir"
|
||||||
|
type="default"
|
||||||
|
placeholder="Pilih Tanggal Akhir"
|
||||||
|
required
|
||||||
|
error={error.dateEnd}
|
||||||
|
errorText="Tanggal akhir tidak boleh kosong"
|
||||||
|
/>
|
||||||
<ReportChartProgress />
|
<ReportChartProgress />
|
||||||
<ReportChartDocument />
|
<ReportChartDocument />
|
||||||
<ReportChartEvent />
|
<ReportChartEvent />
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
@@ -353,3 +353,8 @@ export const apiGetDivision = async ({ user, search, group, kategori, active }:
|
|||||||
const response = await api.get(`mobile/division?user=${user}&active=${active}&group=${group}&search=${search}&cat=${kategori}`);
|
const response = await api.get(`mobile/division?user=${user}&active=${active}&group=${group}&search=${search}&cat=${kategori}`);
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const apiGetDivisionReport = async ({ user, cat, date, dateEnd, division, group }: { user: string, cat: string, date: string, dateEnd: string, division: string, group?: string }) => {
|
||||||
|
const response = await api.get(`mobile/division/report?user=${user}&cat=${cat}&date=${date}&date-end=${dateEnd}&division=${division}&group=${group}`);
|
||||||
|
return response.data;
|
||||||
|
};
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@expo/vector-icons": "^14.0.2",
|
"@expo/vector-icons": "^14.0.2",
|
||||||
"@react-native-async-storage/async-storage": "^2.1.2",
|
"@react-native-async-storage/async-storage": "^2.1.2",
|
||||||
|
"@react-native-community/datetimepicker": "8.3.0",
|
||||||
"@react-navigation/bottom-tabs": "^7.2.0",
|
"@react-navigation/bottom-tabs": "^7.2.0",
|
||||||
"@react-navigation/native": "^7.0.14",
|
"@react-navigation/native": "^7.0.14",
|
||||||
"@reduxjs/toolkit": "^2.7.0",
|
"@reduxjs/toolkit": "^2.7.0",
|
||||||
@@ -57,6 +58,7 @@
|
|||||||
"react-native-gifted-charts": "^1.4.57",
|
"react-native-gifted-charts": "^1.4.57",
|
||||||
"react-native-image-picker": "^8.2.1",
|
"react-native-image-picker": "^8.2.1",
|
||||||
"react-native-modal": "^14.0.0-rc.1",
|
"react-native-modal": "^14.0.0-rc.1",
|
||||||
|
"react-native-modal-datetime-picker": "^18.0.0",
|
||||||
"react-native-otp-entry": "^1.8.4",
|
"react-native-otp-entry": "^1.8.4",
|
||||||
"react-native-reanimated": "~3.17.4",
|
"react-native-reanimated": "~3.17.4",
|
||||||
"react-native-reanimated-carousel": "^4.0.2",
|
"react-native-reanimated-carousel": "^4.0.2",
|
||||||
|
|||||||
Reference in New Issue
Block a user