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