|
|
|
@ -1,12 +1,24 @@
|
|
|
|
|
import React, { useState, useEffect, useMemo } from 'react'; |
|
|
|
|
import { Card, CardBody, CardHeader, Col, Row, Input } from 'reactstrap'; |
|
|
|
|
import axios from "../../../const/interceptorApi" |
|
|
|
|
import * as XLSX from 'xlsx'; |
|
|
|
|
import SweetAlert from 'react-bootstrap-sweetalert'; |
|
|
|
|
import AssignHrProject from './AsignHrProject'; |
|
|
|
|
import AssignK3Project from './AssignK3Project'; |
|
|
|
|
import DialogDocument from './DialogDocument'; |
|
|
|
|
import DialogForm from './DialogForm'; |
|
|
|
|
import DialogFormMaterial from './DataRequestMaterial'; |
|
|
|
|
import DialogFormProyek from './DialogFormProyek'; |
|
|
|
|
import DialogGantt from './DialogGantt'; |
|
|
|
|
import DialogInitDocument from './DialogInitDocument'; |
|
|
|
|
import DialogTableTools from './DialogTableTools'; |
|
|
|
|
import React, { useState, useEffect, useMemo } from 'react'; |
|
|
|
|
import SweetAlert from 'react-bootstrap-sweetalert'; |
|
|
|
|
import ViewProject from './ViewProject'; |
|
|
|
|
import axios from "../../../const/interceptorApi" |
|
|
|
|
import moment from 'moment' |
|
|
|
|
import { Card, CardBody, CardHeader, Col, Row, Input } from 'reactstrap'; |
|
|
|
|
import { Icon } from '@iconify/react'; |
|
|
|
|
import { Link } from 'react-router-dom'; |
|
|
|
|
import { NotificationContainer, NotificationManager } from 'react-notifications'; |
|
|
|
|
import { Pagination, Table, Button, Tooltip, Popover, Skeleton, Divider } from 'antd'; |
|
|
|
|
import { formatNumber, formatRupiah, formatThousand, renderFormatRupiah } from '../../../const/CustomFunc' |
|
|
|
|
import { |
|
|
|
|
PROJECT_APPROVAL_ADD, PROJECT_APPROVAL_EDIT, PROJECT_PARTICIPANT_ADD, PROJECT_PARTICIPANT_EDIT, |
|
|
|
|
PROJECT_MILESTONE_ADD, PROJECT_MILESTONE_EDIT, PROJECT_PARTICIPANT_DELETE_BY_PROYEK, PROJECT_MILESTONE_DELETE_BY_PROYEK, PROJECT_APPROVAL_DELETE_BY_PROYEK, |
|
|
|
@ -14,18 +26,6 @@ import {
|
|
|
|
|
PROYEK_GET_ID, PROJECT_MILESTONE_SEARCH, PROJECT_PARTICIPANT_SEARCH, PROJECT_APPROVAL_SEARCH, CHECKLIST_K3_LIST, |
|
|
|
|
VERSION_GANTT_SEARCH |
|
|
|
|
} from '../../../const/ApiConst'; |
|
|
|
|
import { formatNumber, formatRupiah, formatThousand, renderFormatRupiah } from '../../../const/CustomFunc' |
|
|
|
|
import moment from 'moment' |
|
|
|
|
import DialogFormMaterial from './DataRequestMaterial'; |
|
|
|
|
import DialogTableTools from './DialogTableTools'; |
|
|
|
|
import DialogDocument from './DialogDocument'; |
|
|
|
|
import DialogInitDocument from './DialogInitDocument'; |
|
|
|
|
import DialogGantt from './DialogGantt'; |
|
|
|
|
import AssignHrProject from './AsignHrProject'; |
|
|
|
|
import AssignK3Project from './AssignK3Project'; |
|
|
|
|
import ViewProject from './ViewProject'; |
|
|
|
|
import { Icon } from '@iconify/react'; |
|
|
|
|
import { Link } from 'react-router-dom'; |
|
|
|
|
|
|
|
|
|
const url = ""; |
|
|
|
|
const proyek_id = localStorage.getItem('proyek_id'); |
|
|
|
@ -41,35 +41,35 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const [idTask, setidTask] = useState(0); |
|
|
|
|
const [dataTable, setDatatable] = useState([]) |
|
|
|
|
const [search, setSearch] = useState('') |
|
|
|
|
const [currentPage, setCurrentPage] = useState(1) |
|
|
|
|
const [totalPage, setTotalPage] = useState(0) |
|
|
|
|
const [openDialog, setOpenDialog] = useState(false) |
|
|
|
|
const [openDialogViewDetail, setOpenDialogViewDetail] = useState(false) |
|
|
|
|
const [openDialogMaterial, setOpenDialogMaterial] = useState(false) |
|
|
|
|
const [openDialogTools, setOpenDialogTools] = useState(false) |
|
|
|
|
const [openDialogGantt, setOpenDialogGantt] = useState(false) |
|
|
|
|
const [openDialogAsignHR, setOpenDialogAsignHR] = useState(false) |
|
|
|
|
const [openDialogAssignK3, setOpenDialogAssignK3] = useState(false) |
|
|
|
|
const [dataK3, setDataK3] = useState([]) // transfer list
|
|
|
|
|
const [idDelete, setIdDelete] = useState(0) |
|
|
|
|
const [alertDelete, setAlertDelete] = useState(false) |
|
|
|
|
const [rowsPerPage, setRowsPerPage] = useState(10) |
|
|
|
|
const [dataExport, setDataExport] = useState([]) |
|
|
|
|
const [userProyek, setUserProyek] = useState([]) |
|
|
|
|
const [materialProyek, setMaterialProyek] = useState([]) |
|
|
|
|
const [currentPage, setCurrentPage] = useState(1) |
|
|
|
|
const [dataCharter, setDataCharter] = useState(null) |
|
|
|
|
const [dataExport, setDataExport] = useState([]) |
|
|
|
|
const [dataK3, setDataK3] = useState([])
|
|
|
|
|
const [dataPm, setDataPM] = useState([]) |
|
|
|
|
const [dataTable, setDatatable] = useState([]) |
|
|
|
|
const [dataTypeProyek, setDataTypeProyek] = useState([]) |
|
|
|
|
const [dataView, setDataView] = useState([]) |
|
|
|
|
const [idDelete, setIdDelete] = useState(0) |
|
|
|
|
const [idTask, setidTask] = useState(0); |
|
|
|
|
const [materialProyek, setMaterialProyek] = useState([]) |
|
|
|
|
const [materialResource, setMaterialResource] = useState([]) |
|
|
|
|
const [toolsResource, setToolsResource] = useState([]) |
|
|
|
|
const [dataTypeProyek, setDataTypeProyek] = useState([]) |
|
|
|
|
const [dataPm, setDataPM] = useState([]) |
|
|
|
|
const [openDialog, setOpenDialog] = useState(false) |
|
|
|
|
const [openDialogAsignHR, setOpenDialogAsignHR] = useState(false) |
|
|
|
|
const [openDialogAssignK3, setOpenDialogAssignK3] = useState(false) |
|
|
|
|
const [openDialogDoc, setOpenDialogDoc] = useState(false) |
|
|
|
|
const [proyekName, setProyekName] = useState(""); |
|
|
|
|
const [openDialogGantt, setOpenDialogGantt] = useState(false) |
|
|
|
|
const [openDialogMaterial, setOpenDialogMaterial] = useState(false) |
|
|
|
|
const [openDialogProyek, setOpenDialogProyek] = useState(false) |
|
|
|
|
// project charter
|
|
|
|
|
const [openDialogTools, setOpenDialogTools] = useState(false) |
|
|
|
|
const [openDialogViewDetail, setOpenDialogViewDetail] = useState(false) |
|
|
|
|
const [proyekName, setProyekName] = useState(""); |
|
|
|
|
const [rowsPerPage, setRowsPerPage] = useState(10) |
|
|
|
|
const [search, setSearch] = useState('') |
|
|
|
|
const [toolsResource, setToolsResource] = useState([]) |
|
|
|
|
const [totalPage, setTotalPage] = useState(0) |
|
|
|
|
const [userProyek, setUserProyek] = useState([]) |
|
|
|
|
|
|
|
|
|
const [projectCharter, setProjectCharter] = useState(null) |
|
|
|
|
const [projectParticipant, setProjectParticipant] = useState(null) |
|
|
|
|
const [projectMilestone, setProjectMilestone] = useState(null) |
|
|
|
@ -81,7 +81,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
const pageName = params.name; |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
// getDataUserResource()
|
|
|
|
|
getDataMaterialResource() |
|
|
|
|
getDataToolsResource() |
|
|
|
|
handleGetTipeProject() |
|
|
|
@ -113,7 +112,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
|
|
|
|
|
const handleGetTipeProject = async () => { |
|
|
|
|
const result = await axios.get(TYPE_PROYEK, HEADER).then(res => res).catch(err => err.response) |
|
|
|
|
console.log(result) |
|
|
|
|
if (result && result.data && result.data.code === 200) { |
|
|
|
|
setDataTypeProyek(result.data.data); |
|
|
|
|
} else { |
|
|
|
@ -123,7 +121,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
|
|
|
|
|
const handleGetDataPm = async () => { |
|
|
|
|
const result = await axios.get(USER_LIST, HEADER).then(res => res).catch(err => err.response) |
|
|
|
|
console.log(result) |
|
|
|
|
if (result && result.data && result.data.code === 200) { |
|
|
|
|
setDataPM(result.data.data) |
|
|
|
|
} else { |
|
|
|
@ -147,7 +144,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
"joins": [ |
|
|
|
|
{ "name": "m_users", "column_join": "pm_id", "column_results": ["name", "username"] }, |
|
|
|
|
{ "name": "m_type_proyek", "column_join": "type_proyek_id", "column_results": ["name", "description"] }, |
|
|
|
|
// { "name": "subproyeks.m_subproyek", "column_join": "parent_id", "column_results": ["nama", "biaya", "color_progress", "jumlah_pekerja", "pic", "mulai_proyek", "akhir_proyek", "biaya_actual", "persentase_progress_plan", "persentase_progress_actual"] }
|
|
|
|
|
], |
|
|
|
|
"orders": { "columns": ["id"], "ascending": false }, |
|
|
|
|
"paging": { "start": start, "length": rowsPerPage } |
|
|
|
@ -160,17 +156,14 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// console.log("cek payload", payload)
|
|
|
|
|
|
|
|
|
|
const result = await axios |
|
|
|
|
.post(PROYEK_SEARCH, payload, HEADER) |
|
|
|
|
.then(res => res) |
|
|
|
|
.catch((error) => error.response); |
|
|
|
|
|
|
|
|
|
// console.log("data sub proyek", result)
|
|
|
|
|
|
|
|
|
|
if (result && result.data && result.data.code == 200) { |
|
|
|
|
// console.log("cek proyek", result)
|
|
|
|
|
let dataRes = result.data.data || [] |
|
|
|
|
|
|
|
|
|
setDatatable(dataRes); |
|
|
|
@ -187,7 +180,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
.catch((error) => error.response); |
|
|
|
|
|
|
|
|
|
if (result && result.data && result.data.code == 200) { |
|
|
|
|
console.log("cek material resource", result.data.data) |
|
|
|
|
let dataRes = result.data.data || [] |
|
|
|
|
setMaterialResource(dataRes); |
|
|
|
|
} else { |
|
|
|
@ -222,7 +214,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
.catch((error) => error.response); |
|
|
|
|
|
|
|
|
|
if (result && result.data && result.data.code == 200) { |
|
|
|
|
console.log("cek tools resource", result.data.data) |
|
|
|
|
let dataRes = result.data.data || [] |
|
|
|
|
setToolsResource(dataRes); |
|
|
|
|
} else { |
|
|
|
@ -237,7 +228,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
.catch((error) => error.response); |
|
|
|
|
|
|
|
|
|
if (result && result.data && result.data.code == 200) { |
|
|
|
|
console.log("cek k3 list", result.data.data) |
|
|
|
|
let dataRes = result.data.data || [] |
|
|
|
|
const finalData = [] |
|
|
|
|
if (dataRes.length > 0) { |
|
|
|
@ -261,7 +251,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const handleOpenDialogProyek = (id) => { |
|
|
|
|
console.log('handleOpenDialogProyek', id); |
|
|
|
|
setOpenDialogProyek(true) |
|
|
|
|
setidTask(id) |
|
|
|
|
} |
|
|
|
@ -301,21 +290,17 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
|
|
|
|
|
const handleOpenDialogTools = (data) => { |
|
|
|
|
setOpenDialogTools(true) |
|
|
|
|
console.log('handleOpenDialogTools', data); |
|
|
|
|
setidTask(data.id) |
|
|
|
|
setProyekName(data.nama) |
|
|
|
|
setUserProyek(data.user_proyeks) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const handleOpenDialogViewDetail = async (data) => { |
|
|
|
|
// console.log('handleOpenDialogViewDetail', data);
|
|
|
|
|
setidTask(data.id) |
|
|
|
|
// setDataView(data)
|
|
|
|
|
await getDataProject(data.id) |
|
|
|
|
await getProjectMilestone(data.id) |
|
|
|
|
await getProjectParticipant(data.id) |
|
|
|
|
await getProjectApproval(data.id) |
|
|
|
|
// await getDataProjectCharter(data.id);
|
|
|
|
|
setOpenDialogViewDetail(true) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -329,7 +314,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
if (result && result.data && result.data.code == 200) { |
|
|
|
|
let dataRes = result.data.data; |
|
|
|
|
setProjectCharter(dataRes); |
|
|
|
|
// console.log("cek project-charter resource", dataRes);
|
|
|
|
|
} else { |
|
|
|
|
NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); |
|
|
|
|
} |
|
|
|
@ -344,7 +328,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
"orders": { "columns": ["id"], "ascending": true }, |
|
|
|
|
"paging": { "start": 0, "length": -1 } |
|
|
|
|
} |
|
|
|
|
// const url = PROJECT_MI(proyek_id)
|
|
|
|
|
const result = await axios |
|
|
|
|
.post(PROJECT_MILESTONE_SEARCH, payload, HEADER) |
|
|
|
|
.then(res => res) |
|
|
|
@ -353,7 +336,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
if (result && result.data && result.data.code == 200) { |
|
|
|
|
let dataRes = result.data.data; |
|
|
|
|
setProjectMilestone(dataRes); |
|
|
|
|
// console.log("cek project milestone", dataRes);
|
|
|
|
|
} else { |
|
|
|
|
NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); |
|
|
|
|
} |
|
|
|
@ -368,7 +350,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
"orders": { "columns": ["id"], "ascending": true }, |
|
|
|
|
"paging": { "start": 0, "length": -1 } |
|
|
|
|
} |
|
|
|
|
// const url = PROJECT_MI(proyek_id)
|
|
|
|
|
const result = await axios |
|
|
|
|
.post(PROJECT_PARTICIPANT_SEARCH, payload, HEADER) |
|
|
|
|
.then(res => res) |
|
|
|
@ -378,7 +359,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
let dataRes = result.data.data; |
|
|
|
|
setProjectParticipant(dataRes); |
|
|
|
|
|
|
|
|
|
// console.log("cek project participant", dataRes);
|
|
|
|
|
} else { |
|
|
|
|
NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); |
|
|
|
|
} |
|
|
|
@ -393,7 +373,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
"orders": { "columns": ["id"], "ascending": true }, |
|
|
|
|
"paging": { "start": 0, "length": -1 } |
|
|
|
|
} |
|
|
|
|
// const url = PROJECT_MI(proyek_id)
|
|
|
|
|
const result = await axios |
|
|
|
|
.post(PROJECT_APPROVAL_SEARCH, payload, HEADER) |
|
|
|
|
.then(res => res) |
|
|
|
@ -402,7 +381,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
if (result && result.data && result.data.code == 200) { |
|
|
|
|
let dataRes = result.data.data; |
|
|
|
|
setProjectApproval(dataRes); |
|
|
|
|
// console.log("cek project approval", dataRes);
|
|
|
|
|
} else { |
|
|
|
|
NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); |
|
|
|
|
} |
|
|
|
@ -471,15 +449,12 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
const result = await axios.post(PROYEK_ADD, formData, HEADER) |
|
|
|
|
.then(res => res) |
|
|
|
|
.catch((error) => error.response); |
|
|
|
|
console.log(result) |
|
|
|
|
if (result && result.data && result.data.code === 200) { |
|
|
|
|
const { participants, milestones, approval } = data.projectCharter |
|
|
|
|
const resultParticipant = await saveParticipant(result.data.data_result.id, participants) |
|
|
|
|
const resultMilestone = await saveMilestone(result.data.data_result.id, milestones) |
|
|
|
|
const resultApproval = await saveApproval(result.data.data_result.id, approval) |
|
|
|
|
console.log({ resultApproval, resultMilestone, resultParticipant }) |
|
|
|
|
if (resultParticipant === "berhasil" && resultMilestone === "berhasil" && resultApproval === "berhasil") { |
|
|
|
|
// getDataProyek();
|
|
|
|
|
NotificationManager.success(`Data proyek berhasil ditambah`, 'Success!!'); |
|
|
|
|
} else { |
|
|
|
|
NotificationManager.success(`${result.data.message}`, 'Success!!'); |
|
|
|
@ -502,9 +477,7 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
} |
|
|
|
|
return axios.post(PROJECT_PARTICIPANT_ADD, payload, HEADER) |
|
|
|
|
}) |
|
|
|
|
console.log(request) |
|
|
|
|
const arr = await Promise.all(request).then(values => values).catch(err => err.response); |
|
|
|
|
console.log('result participant', arr) |
|
|
|
|
const result = arr.map(res => res.data.code == 200) |
|
|
|
|
if (result.length > 0) { |
|
|
|
|
return "gagal" |
|
|
|
@ -523,9 +496,7 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
} |
|
|
|
|
return axios.post(PROJECT_MILESTONE_ADD, payload, HEADER) |
|
|
|
|
}) |
|
|
|
|
console.log(request) |
|
|
|
|
const arr = await Promise.all(request).then(values => values).catch(err => err.response); |
|
|
|
|
console.log('result milestone', arr) |
|
|
|
|
const result = arr.map(res => res.data.code !== 200) |
|
|
|
|
if (result.length > 0) { |
|
|
|
|
return "gagal" |
|
|
|
@ -545,9 +516,7 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
} |
|
|
|
|
return axios.post(PROJECT_APPROVAL_ADD, payload, HEADER) |
|
|
|
|
}) |
|
|
|
|
console.log(request) |
|
|
|
|
const arr = await Promise.all(request).then(values => values).catch(err => err.response); |
|
|
|
|
console.log('result approval', arr) |
|
|
|
|
const result = arr.map(res => res.data.code !== 200) |
|
|
|
|
if (result.length > 0) { |
|
|
|
|
return "gagal" |
|
|
|
@ -565,7 +534,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
const result = await axios.put(urlEdit, formData, HEADER) |
|
|
|
|
.then(res => res) |
|
|
|
|
.catch((error) => error.response); |
|
|
|
|
console.log("cek result", result) |
|
|
|
|
const resultParticipant = await editParticipant(data.id, participants) |
|
|
|
|
const resultMilestone = await editMilestone(data.id, milestones) |
|
|
|
|
const resultApproval = await editApproval(data.id, approval) |
|
|
|
@ -580,7 +548,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
|
|
|
|
|
const editParticipant = async (id, data) => { |
|
|
|
|
await axios.delete(PROJECT_PARTICIPANT_DELETE_BY_PROYEK(id), HEADER) |
|
|
|
|
// if (restDelete){
|
|
|
|
|
const request = data.map(res => { |
|
|
|
|
const payload = { |
|
|
|
|
proyek_id: parseInt(id), |
|
|
|
@ -589,10 +556,7 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
} |
|
|
|
|
return axios.post(PROJECT_PARTICIPANT_ADD, payload, HEADER) |
|
|
|
|
}) |
|
|
|
|
console.log(request) |
|
|
|
|
const arr = await Promise.all(request).then(values => values).catch(err => err.response); |
|
|
|
|
console.log('result participant', arr) |
|
|
|
|
// let dataTittle = arr.data.tittle
|
|
|
|
|
const result = arr.map(res => res.data.code !== 200) |
|
|
|
|
if (result.length > 0) { |
|
|
|
|
return "gagal" |
|
|
|
@ -604,7 +568,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
|
|
|
|
|
const editMilestone = async (id, data) => { |
|
|
|
|
await axios.delete(PROJECT_MILESTONE_DELETE_BY_PROYEK(id), HEADER) |
|
|
|
|
console.log("res due", data) |
|
|
|
|
const request = data.map(res => { |
|
|
|
|
const payload = { |
|
|
|
|
proyek_id: parseInt(id), |
|
|
|
@ -614,9 +577,7 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
} |
|
|
|
|
return axios.post(PROJECT_MILESTONE_ADD, payload, HEADER) |
|
|
|
|
}) |
|
|
|
|
console.log(request) |
|
|
|
|
const arr = await Promise.all(request).then(values => values).catch(err => err.response); |
|
|
|
|
console.log('result milestone', arr) |
|
|
|
|
const result = arr.map(res => res.data.code !== 200) |
|
|
|
|
if (result.length > 0) { |
|
|
|
|
return "gagal" |
|
|
|
@ -625,7 +586,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const editApproval = async (id, data) => { |
|
|
|
|
console.log("cek data edit approval", data) |
|
|
|
|
await axios.delete(PROJECT_APPROVAL_DELETE_BY_PROYEK(id), HEADER) |
|
|
|
|
const request = data.map(res => { |
|
|
|
|
const payload = { |
|
|
|
@ -636,20 +596,11 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
} |
|
|
|
|
return axios.post(PROJECT_APPROVAL_ADD, payload, HEADER) |
|
|
|
|
}) |
|
|
|
|
console.log(request) |
|
|
|
|
const arr = await Promise.all(request).then(values => values).catch(err => err.response); |
|
|
|
|
console.log('result approval', arr) |
|
|
|
|
// if(arr)
|
|
|
|
|
|
|
|
|
|
// const result = arr.map(res => res.data.code !== 200)
|
|
|
|
|
// if (result.length > 0) {
|
|
|
|
|
// return "gagal"
|
|
|
|
|
// }
|
|
|
|
|
// return "berhasil"
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const handleDelete = async (id) => { |
|
|
|
|
// console.log('Delete')
|
|
|
|
|
await setAlertDelete(true) |
|
|
|
|
await setIdDelete(id) |
|
|
|
|
} |
|
|
|
@ -666,9 +617,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
|
|
|
|
|
const payload = { |
|
|
|
|
"paging": { "start": 0, "length": -1 }, |
|
|
|
|
// "columns": [
|
|
|
|
|
// { "name": "nama", "logic_operator": "like", "value": search, "operator": "AND" }
|
|
|
|
|
// ],
|
|
|
|
|
"joins": [], |
|
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
|
} |
|
|
|
@ -686,11 +634,9 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
.then(res => res) |
|
|
|
|
.catch((error) => error.response); |
|
|
|
|
|
|
|
|
|
// console.log(result)
|
|
|
|
|
|
|
|
|
|
if (result && result.data && result.data.code == 200) { |
|
|
|
|
let resData = result.data.data; |
|
|
|
|
console.log("resData", resData); |
|
|
|
|
const excelData = []; |
|
|
|
|
resData.map((n, index) => { |
|
|
|
|
let dataRow = { |
|
|
|
@ -709,9 +655,7 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
} |
|
|
|
|
excelData.push(dataRow) |
|
|
|
|
}) |
|
|
|
|
// console.log("cek excel data", excelData)
|
|
|
|
|
await setDataExport(excelData); |
|
|
|
|
// exportExcel();
|
|
|
|
|
} else { |
|
|
|
|
NotificationManager.error('Gagal Export Data!!', 'Failed'); |
|
|
|
|
} |
|
|
|
@ -836,7 +780,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
title: 'Budget', |
|
|
|
|
dataIndex: 'rencana_biaya', |
|
|
|
|
key: 'rencana_biaya', |
|
|
|
|
// render: (text, record) => { return renderFormatRupiah(text, "Rp") }
|
|
|
|
|
render: (text, record) => { return record.currency_symbol ? `${record.currency_symbol} ${formatThousand(text)}` : `${formatThousand(text)}` } |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
@ -937,7 +880,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
/> |
|
|
|
|
), [openDialogTools]) |
|
|
|
|
|
|
|
|
|
// DialogAsignHr
|
|
|
|
|
const RenderDialogAsignHr = useMemo(() => ( |
|
|
|
|
<AssignHrProject |
|
|
|
|
openDialog={openDialogAsignHR} |
|
|
|
@ -950,7 +892,6 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
), [openDialogAsignHR]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DialogAssignK3
|
|
|
|
|
const RenderDialogAssignK3 = useMemo(() => ( |
|
|
|
|
<AssignK3Project |
|
|
|
|
openDialog={openDialogAssignK3} |
|
|
|
|