|
@@ -245,20 +245,27 @@ class Calendar extends Component {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
handleChangeSelect = (selectedOption) => this.setState({ selectedOption });
|
|
handleChangeSelect = (selectedOption) => this.setState({ selectedOption });
|
|
|
- logUpdateLaporanSuccess = async () => {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ logUpdateLaporanError = async () => {
|
|
|
const getToken = await getCsrf();
|
|
const getToken = await getCsrf();
|
|
|
const _csrf = getToken.token;
|
|
const _csrf = getToken.token;
|
|
|
const { token, query } = this.props;
|
|
const { token, query } = this.props;
|
|
|
const { id } = query;
|
|
const { id } = query;
|
|
|
- await createLog(token, { aktivitas: `Berhasil mengubah data laporan, id: ${id}`, _csrf: _csrf });
|
|
|
|
|
-
|
|
|
|
|
|
|
+ await createLog(token, { aktivitas: `Berhasil mengubah data laporan, id: ${id}`, _csrf: _csrf, menu: "Penjadwalan" });
|
|
|
}
|
|
}
|
|
|
- logUpdateLaporanError = async () => {
|
|
|
|
|
|
|
+ logdelegasi = async () => {
|
|
|
|
|
+ const getToken = await getCsrf();
|
|
|
|
|
+ const _csrf = getToken.token;
|
|
|
|
|
+ const { token, query } = this.props;
|
|
|
|
|
+ const { id } = query;
|
|
|
|
|
+ await createLog(token, { aktivitas: `Berhasil Delegasi Laporan, id: ${id}`, _csrf: _csrf , menu :"Penjadwalan"});
|
|
|
|
|
+ }
|
|
|
|
|
+ logDitutup = async () => {
|
|
|
const getToken = await getCsrf();
|
|
const getToken = await getCsrf();
|
|
|
const _csrf = getToken.token;
|
|
const _csrf = getToken.token;
|
|
|
const { token, query } = this.props;
|
|
const { token, query } = this.props;
|
|
|
const { id } = query;
|
|
const { id } = query;
|
|
|
- await createLog(token, { aktivitas: `Berhasil mengubah data laporan, id: ${id}`, _csrf: _csrf });
|
|
|
|
|
|
|
+ await createLog(token, { aktivitas: `Berhasil menutup laporan, id: ${id}`, _csrf: _csrf, menu: "Penjadwalan" });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
handleSimpan = async (value) => {
|
|
handleSimpan = async (value) => {
|
|
@@ -288,18 +295,19 @@ class Calendar extends Component {
|
|
|
if (value.status.value === this.getStatus()[1].value) {
|
|
if (value.status.value === this.getStatus()[1].value) {
|
|
|
data.change_role = "true";
|
|
data.change_role = "true";
|
|
|
update = await updateLaporan(token, id, data, _csrf);
|
|
update = await updateLaporan(token, id, data, _csrf);
|
|
|
|
|
+ await this.logdelegasi()
|
|
|
Router.push("/app/penjadwalan");
|
|
Router.push("/app/penjadwalan");
|
|
|
} else if (value.status.value === this.getStatus()[2].value) {
|
|
} else if (value.status.value === this.getStatus()[2].value) {
|
|
|
-
|
|
|
|
|
update = await updateLaporan(token, id, formdata, _csrf + `&redudansi=true`);
|
|
update = await updateLaporan(token, id, formdata, _csrf + `&redudansi=true`);
|
|
|
|
|
+ await this.logDitutup()
|
|
|
Router.push("/app/penjadwalan");
|
|
Router.push("/app/penjadwalan");
|
|
|
}
|
|
}
|
|
|
if (!update) {
|
|
if (!update) {
|
|
|
- toast.update(toastid, { render: "Gagal simpan jadwal", type: "error", isLoading: false, autoClose: true, closeButton: true });
|
|
|
|
|
|
|
+ toast.update(toastid, { render: "Error", type: "error", isLoading: false, autoClose: true, closeButton: true });
|
|
|
this.logUpdateLaporanError()
|
|
this.logUpdateLaporanError()
|
|
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
- toast.update(toastid, { render: "Input jadwal berhasil", type: "success", isLoading: false, autoClose: true, closeButton: true });
|
|
|
|
|
|
|
+ toast.update(toastid, { render: "Success", type: "success", isLoading: false, autoClose: true, closeButton: true });
|
|
|
this.logUpdateLaporanSuccess()
|
|
this.logUpdateLaporanSuccess()
|
|
|
Router.push("/app/penjadwalan");
|
|
Router.push("/app/penjadwalan");
|
|
|
}
|
|
}
|