|
|
|
@ -6,7 +6,7 @@ import {
|
|
|
|
|
import { DatePicker, Tooltip, Drawer, Divider, Layout, Button, Space, Progress } from 'antd'; |
|
|
|
|
import { |
|
|
|
|
CloseOutlined, |
|
|
|
|
MinusOutlined,
|
|
|
|
|
MinusOutlined, |
|
|
|
|
PlusOutlined |
|
|
|
|
} from '@ant-design/icons'; |
|
|
|
|
import { formatRupiah, formatNumber } from '../../../const/CustomFunc' |
|
|
|
@ -20,17 +20,17 @@ import {
|
|
|
|
|
import 'antd/dist/antd.css'; |
|
|
|
|
// const { Option } = Select
|
|
|
|
|
|
|
|
|
|
const DialogFormActivity = ({
|
|
|
|
|
const DialogFormActivity = ({ |
|
|
|
|
activityProject, |
|
|
|
|
openDialogActivity,
|
|
|
|
|
closeDialogActivity,
|
|
|
|
|
openDialogActivity, |
|
|
|
|
closeDialogActivity, |
|
|
|
|
handleOpenDialogReport, |
|
|
|
|
toggleDialogActivity,
|
|
|
|
|
typeDialogActivity,
|
|
|
|
|
proyek_id,
|
|
|
|
|
version_gantt_id,
|
|
|
|
|
idBoard,
|
|
|
|
|
dataHr,
|
|
|
|
|
toggleDialogActivity, |
|
|
|
|
typeDialogActivity, |
|
|
|
|
proyek_id, |
|
|
|
|
version_gantt_id, |
|
|
|
|
idBoard, |
|
|
|
|
dataHr, |
|
|
|
|
dataEditCard, |
|
|
|
|
userToActivityDelete, |
|
|
|
|
userToActivityAdd |
|
|
|
@ -63,9 +63,9 @@ const DialogFormActivity = ({
|
|
|
|
|
|
|
|
|
|
setId(dataEditCard.id) |
|
|
|
|
setText(dataEditCard.activity) |
|
|
|
|
setProgress(dataEditCard.persentase_progress)
|
|
|
|
|
setProgress(dataEditCard.persentase_progress) |
|
|
|
|
setStartDate(moment(dataEditCard.start_date)) |
|
|
|
|
setEndDate(moment(dataEditCard.end_date))
|
|
|
|
|
setEndDate(moment(dataEditCard.end_date)) |
|
|
|
|
dataEditCard.assign_hr.map((item) => { |
|
|
|
|
item.value = item.id_hr |
|
|
|
|
item.label = item.name |
|
|
|
@ -91,7 +91,7 @@ const DialogFormActivity = ({
|
|
|
|
|
closeDialogActivity('cancel', 'none') |
|
|
|
|
setVolumePlan(0) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleSave = () => { |
|
|
|
|
let data = ''; |
|
|
|
@ -112,7 +112,7 @@ const DialogFormActivity = ({
|
|
|
|
|
alert("hr cannot be empty!"); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (typeDialogActivity === "Save") { |
|
|
|
|
|
|
|
|
|
data = { |
|
|
|
@ -138,7 +138,7 @@ const DialogFormActivity = ({
|
|
|
|
|
} |
|
|
|
|
userToActivityAdd(dataSaveHr) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IdDeleteHrTemporary.map((item)=>{ |
|
|
|
|
|
|
|
|
@ -149,7 +149,7 @@ const DialogFormActivity = ({
|
|
|
|
|
setHrTemporaryAdd([]) |
|
|
|
|
setIdDeleteHrTemporary([]) |
|
|
|
|
setHrTemporary([]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
progress == 100 ? |
|
|
|
|
data = { |
|
|
|
|
"text": text, |
|
|
|
@ -179,11 +179,10 @@ const DialogFormActivity = ({
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const onChangeHr = (newValue, actionMeta) => {
|
|
|
|
|
if (typeDialogActivity === "Edit") {
|
|
|
|
|
const onChangeHr = (newValue, actionMeta) => { |
|
|
|
|
if (typeDialogActivity === "Edit") { |
|
|
|
|
if (actionMeta.action === 'select-option') { |
|
|
|
|
const item = actionMeta.option |
|
|
|
|
// console.log("actionMeta", item);
|
|
|
|
|
// let dataSaveHr = {
|
|
|
|
|
// "user_id": item.id,
|
|
|
|
|
// "role_proyek_id": item.proyek_role,
|
|
|
|
@ -196,18 +195,18 @@ const DialogFormActivity = ({
|
|
|
|
|
} else if (actionMeta.action === 'remove-value') { |
|
|
|
|
const id = actionMeta.removedValue.id |
|
|
|
|
// userToActivityDelete(id)
|
|
|
|
|
for (let k in hrTemporary) {
|
|
|
|
|
for (let k in hrTemporary) { |
|
|
|
|
if (hrTemporary[k].id == id) { |
|
|
|
|
setIdDeleteHrTemporary([...IdDeleteHrTemporary, id]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setHr(newValue) |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const increase = () => { |
|
|
|
|
let newPercent = progress + 10; |
|
|
|
|
if (newPercent > 100) { |
|
|
|
@ -216,7 +215,7 @@ const DialogFormActivity = ({
|
|
|
|
|
setProgress(newPercent); |
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const decline = () => { |
|
|
|
|
let newPercent = progress - 10; |
|
|
|
|
if (newPercent < 0) { |
|
|
|
@ -240,13 +239,13 @@ const DialogFormActivity = ({
|
|
|
|
|
<Label className="capitalize">Start Date</Label> |
|
|
|
|
<DatePicker style={{ width: "100%" }} value={startDate} onChange={(dateItem, dateString) => { |
|
|
|
|
dateItem.set({hour:0,minute:0,second:0}) |
|
|
|
|
setStartDate(dateItem)}}
|
|
|
|
|
setStartDate(dateItem)}} |
|
|
|
|
/> |
|
|
|
|
</FormGroup> |
|
|
|
|
</Col> |
|
|
|
|
<Col md={12}> |
|
|
|
|
<FormGroup> |
|
|
|
|
<Label className="capitalize">End date</Label> |
|
|
|
|
<Label className="capitalize">End date</Label> |
|
|
|
|
<DatePicker style={{ width: "100%" }} value={endDate} onChange={(dateItem, dateString) => { |
|
|
|
|
dateItem.set({hour:23,minute:59,second:59}) |
|
|
|
|
setEndDate(dateItem)}} |
|
|
|
|