|
|
|
@ -1,19 +1,19 @@
|
|
|
|
|
import React, { useEffect, useRef, useState } from "react" |
|
|
|
|
import { MultiSelect } from "react-multi-select-component" |
|
|
|
|
import { Col, Label, Row } from "reactstrap" |
|
|
|
|
import Select from "react-select" |
|
|
|
|
import { Button as ButtonP } from "primereact/button" |
|
|
|
|
import { isObjEmpty } from "../util" |
|
|
|
|
import $ from "jquery" |
|
|
|
|
import collect from "collect.js" |
|
|
|
|
import { useDispatch, useSelector } from "react-redux" |
|
|
|
|
import { setSelectedOpsi } from "../store/KpdlStore" |
|
|
|
|
import React, { useEffect, useRef, useState } from 'react' |
|
|
|
|
import { MultiSelect } from 'react-multi-select-component' |
|
|
|
|
import { Col, Label, Row } from 'reactstrap' |
|
|
|
|
import Select from 'react-select' |
|
|
|
|
import { Button as ButtonP } from 'primereact/button' |
|
|
|
|
import { isObjEmpty } from '../util' |
|
|
|
|
import $ from 'jquery' |
|
|
|
|
import collect from 'collect.js' |
|
|
|
|
import { useDispatch, useSelector } from 'react-redux' |
|
|
|
|
import { setSelectedOpsi } from '../store/KpdlStore' |
|
|
|
|
|
|
|
|
|
const NipPerekam = ({ dataSend, setDataSend, activeTab, toast, setHiddenGraphMatoa, dataOpsi }) => { |
|
|
|
|
const dispatch = useDispatch() |
|
|
|
|
const storeKpdl = useSelector((state) => state.kpdl) |
|
|
|
|
|
|
|
|
|
const base_url = "<?=base_url()?>" |
|
|
|
|
const base_url = '<?=base_url()?>' |
|
|
|
|
|
|
|
|
|
const [kanwil, setKanwil] = useState({}) |
|
|
|
|
const [kpp, setKpp] = useState(null) |
|
|
|
@ -27,9 +27,9 @@ const NipPerekam = ({ dataSend, setDataSend, activeTab, toast, setHiddenGraphMat
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
$.ajax({ |
|
|
|
|
url: base_url + "kewilayahan/ref/kanwilPratama", |
|
|
|
|
method: "GET", |
|
|
|
|
dataType: "json", |
|
|
|
|
url: base_url + 'kewilayahan/ref/kanwilPratama', |
|
|
|
|
method: 'GET', |
|
|
|
|
dataType: 'json', |
|
|
|
|
success: (data) => { |
|
|
|
|
setKanwil(data) |
|
|
|
|
} |
|
|
|
@ -46,9 +46,9 @@ const NipPerekam = ({ dataSend, setDataSend, activeTab, toast, setHiddenGraphMat
|
|
|
|
|
if (kanwilSelected && !isObjEmpty(kanwilSelected)) { |
|
|
|
|
const kanwil = kanwilSelected.value |
|
|
|
|
$.ajax({ |
|
|
|
|
url: base_url + "kewilayahan/ref/kppPratama", |
|
|
|
|
method: "GET", |
|
|
|
|
dataType: "json", |
|
|
|
|
url: base_url + 'kewilayahan/ref/kppPratama', |
|
|
|
|
method: 'GET', |
|
|
|
|
dataType: 'json', |
|
|
|
|
data: { kanwil }, |
|
|
|
|
success: (data) => { |
|
|
|
|
setKpp(data) |
|
|
|
@ -65,9 +65,9 @@ const NipPerekam = ({ dataSend, setDataSend, activeTab, toast, setHiddenGraphMat
|
|
|
|
|
if (kppSelected && !isObjEmpty(kppSelected)) { |
|
|
|
|
const kpp = kppSelected.value |
|
|
|
|
$.ajax({ |
|
|
|
|
url: base_url + "kewilayahan/ref/seksi", |
|
|
|
|
method: "GET", |
|
|
|
|
dataType: "json", |
|
|
|
|
url: base_url + 'kewilayahan/ref/seksi', |
|
|
|
|
method: 'GET', |
|
|
|
|
dataType: 'json', |
|
|
|
|
data: { kpp }, |
|
|
|
|
success: (data) => { |
|
|
|
|
setSeksi(data) |
|
|
|
@ -79,15 +79,15 @@ const NipPerekam = ({ dataSend, setDataSend, activeTab, toast, setHiddenGraphMat
|
|
|
|
|
useEffect(() => { |
|
|
|
|
setAr([]) |
|
|
|
|
setArSelected([]) |
|
|
|
|
const seksi = collect(seksiSelected).pluck("value").all() |
|
|
|
|
const seksi = collect(seksiSelected).pluck('value').all() |
|
|
|
|
if (seksi.length && !isObjEmpty(seksiSelected)) { |
|
|
|
|
const kpp = kppSelected.value |
|
|
|
|
// const seksi = collect(seksiSelected).pluck("value").all()
|
|
|
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
url: base_url + "kewilayahan/ref/ar", |
|
|
|
|
method: "POST", |
|
|
|
|
dataType: "json", |
|
|
|
|
url: base_url + 'kewilayahan/ref/ar', |
|
|
|
|
method: 'POST', |
|
|
|
|
dataType: 'json', |
|
|
|
|
data: { kpp, seksi }, |
|
|
|
|
success: (data) => { |
|
|
|
|
setAr(data) |
|
|
|
@ -97,13 +97,13 @@ const NipPerekam = ({ dataSend, setDataSend, activeTab, toast, setHiddenGraphMat
|
|
|
|
|
}, [seksiSelected]) |
|
|
|
|
|
|
|
|
|
const buttonProsesOnClick = () => { |
|
|
|
|
const nip_ar_perekam = collect(arSelected).pluck("value").all() |
|
|
|
|
const nip_ar_perekam = collect(arSelected).pluck('value').all() |
|
|
|
|
if (nip_ar_perekam.length) { |
|
|
|
|
dispatch(setSelectedOpsi(dataOpsi.perekam)) |
|
|
|
|
setDataSend({ opsiWilZona: dataOpsi.perekam.key, nip_ar_perekam }) |
|
|
|
|
setHiddenGraphMatoa(true) |
|
|
|
|
} else { |
|
|
|
|
toast.current.show({ severity: "info", summary: "Info", detail: "AR Perekam harus dipilih" }) |
|
|
|
|
toast.current.show({ severity: 'info', summary: 'Info', detail: 'AR Perekam harus dipilih' }) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return ( |
|
|
|
@ -156,7 +156,7 @@ const NipPerekam = ({ dataSend, setDataSend, activeTab, toast, setHiddenGraphMat
|
|
|
|
|
setSeksiSelected(e) |
|
|
|
|
}} |
|
|
|
|
labelledBy="Pilih Seksi" |
|
|
|
|
overrideStrings={{ allItemsAreSelected: "Semua dipilih", selectSomeItems: "Pilih Seksi" }} |
|
|
|
|
overrideStrings={{ allItemsAreSelected: 'Semua dipilih', selectSomeItems: 'Pilih Seksi' }} |
|
|
|
|
/> |
|
|
|
|
</Col> |
|
|
|
|
<Col md="3"> |
|
|
|
@ -173,7 +173,7 @@ const NipPerekam = ({ dataSend, setDataSend, activeTab, toast, setHiddenGraphMat
|
|
|
|
|
setArSelected(e) |
|
|
|
|
}} |
|
|
|
|
labelledBy="Pilih AR" |
|
|
|
|
overrideStrings={{ allItemsAreSelected: "Semua dipilih", selectSomeItems: "Pilih AR" }} |
|
|
|
|
overrideStrings={{ allItemsAreSelected: 'Semua dipilih', selectSomeItems: 'Pilih AR' }} |
|
|
|
|
/> |
|
|
|
|
</Col> |
|
|
|
|
</Row> |
|
|
|
|