Browse Source

improve ui&ux

pull/2/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
b5e5da20ae
  1. 1417
      src/views/SimproV2/CreatedProyek/DialogFormProyek.js
  2. 85
      src/views/SimproV2/CreatedProyek/FormAsignHr.js
  3. 2
      src/views/SimproV2/CreatedProyek/index.js

1417
src/views/SimproV2/CreatedProyek/DialogFormProyek.js

File diff suppressed because it is too large Load Diff

85
src/views/SimproV2/CreatedProyek/FormAsignHr.js

@ -10,17 +10,17 @@ const FormAsignHr = ({ openDialog, closeDialog, toggleDialog, idTask, dataEdit,
const [id, setId] = useState(null)
const [typeForm, setTypeForm] = useState('add')
const [user, setUser] = useState(null)
const [rbs, setRbs] = useState("") //rbs ""
const [projectRole, setProjectRole] = useState(null) // id
const [groupR, setGroupR] = useState("") //group_r ""
const [maxUsed, setMaxUsed] = useState("") // max_used int
const [standartRate, setStandartRate] = useState("") //standart_rate int
const [uomStandartRate, setUomStandartRate] = useState(null) // uom_standart_rate ""
const [overTimeRate, setOverTimeRate] = useState("") //overtime_rate int
const [overTimeRateUom, setOverTimeRateUom] = useState(null) //uom_over_time_rate ""
const [costPerUsed, setCostPerUsed] = useState("") // cost_per_used int
const [accrue, setAccrue] = useState("") // accrue_at ""
const [baseCalender, setBaseCalender] = useState("") //base_calender ""
const [rbs, setRbs] = useState("")
const [projectRole, setProjectRole] = useState(null)
const [groupR, setGroupR] = useState("")
const [maxUsed, setMaxUsed] = useState("")
const [standartRate, setStandartRate] = useState("")
const [uomStandartRate, setUomStandartRate] = useState(null)
const [overTimeRate, setOverTimeRate] = useState("")
const [overTimeRateUom, setOverTimeRateUom] = useState(null)
const [costPerUsed, setCostPerUsed] = useState("")
const [accrue, setAccrue] = useState("")
const [baseCalender, setBaseCalender] = useState("")
const [listHr, setListHr] = useState([])
const handleClearData = () => {
@ -41,12 +41,11 @@ const FormAsignHr = ({ openDialog, closeDialog, toggleDialog, idTask, dataEdit,
useEffect(() => {
let data = dataHr || []
let availableHr = []
console.log("dataCurrentHr", dataCurrentHr)
data.map((val, index) => {
if(dataEdit && dataEdit.user_id){
if(parseInt(val.id)===parseInt(dataEdit.user_id)){
availableHr.push(val);
}
}
}
let check = dataCurrentHr.some(function (x) {
return parseInt(val.id)==parseInt(x.user_id)
@ -60,7 +59,6 @@ const FormAsignHr = ({ openDialog, closeDialog, toggleDialog, idTask, dataEdit,
useEffect(() => {
if (idTask && idTask > 0) {
console.log("data edit", dataEdit)
if(dataEdit && dataEdit!=""){
setTypeForm('edit')
setId(dataEdit.id)
@ -130,7 +128,7 @@ const FormAsignHr = ({ openDialog, closeDialog, toggleDialog, idTask, dataEdit,
<Col>
<FormGroup>
<Label>Human Resource</Label>
<Select showSearch value={user} onChange={(val) => setUser(val)} placeholder="Select Human Resource" filterOption={(input, option) =>
<Select showSearch value={user} onChange={(val) => setUser(val)} placeholder="Select Human Resource" filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
} style={{ width: '100%' }}>
{listHr && listHr.map(res => (
@ -152,46 +150,10 @@ const FormAsignHr = ({ openDialog, closeDialog, toggleDialog, idTask, dataEdit,
<Col>
<FormGroup>
<Label>Percentage Available User</Label>
<Input type="text" onChange={(e) => setMaxUsed(formatNumber(e.target.value))} value={maxUsed} placeholder='100%' />
<Input type="text" onChange={(e) => setMaxUsed(formatNumber(e.target.value))} value={maxUsed} placeholder='' required/>
</FormGroup>
</Col>
</Row>
{/* <Row>
<Col>
<FormGroup>
<Label>RBS</Label>
<Input type='text' onChange={(e) => setRbs(e.target.value)} value={rbs} placeholder='rbs..' />
</FormGroup>
</Col>
<Col>
<FormGroup>
<Label>Group R</Label>
<Input type='text' onChange={(e) => setGroupR(e.target.value)} value={groupR} placeholder='group r..' />
</FormGroup>
</Col>
</Row> */}
{/* <Row>
<Col>
<FormGroup>
<Label>Max Used</Label>
<Input type='number' onChange={(e) => setMaxUsed(e.target.value)} value={maxUsed} placeholder='10..' />
</FormGroup>
</Col>
<Col>
<FormGroup>
<Label>Cost Per Used</Label>
<Input type='number' onChange={(e) => setCostPerUsed(e.target.value)} value={costPerUsed} placeholder='2000..' />
</FormGroup>
</Col>
</Row> */}
{/* <Row>
<Col>
</Col>
<Col>
</Col>
</Row> */}
<div style={{widht:"100%",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}>
<FormGroup style={{flexBasis:"49%"}}>
<Label>Standart Rate</Label>
@ -206,7 +168,6 @@ const FormAsignHr = ({ openDialog, closeDialog, toggleDialog, idTask, dataEdit,
<Option value={"Day"}>Day</Option>
<Option value={"Hour"}>Hour</Option>
</Select>
{/* <Input type='text' onChange={(e) => setUomStandartRate(e.target.value)} value={uomStandartRate} placeholder='hari..' /> */}
</FormGroup>
</div>
@ -224,28 +185,12 @@ const FormAsignHr = ({ openDialog, closeDialog, toggleDialog, idTask, dataEdit,
<Option value={"Day"}>Day</Option>
<Option value={"Hour"}>Hour</Option>
</Select>
{/* <Input type='text' onChange={(e) => setOverTimeRateUom(e.target.value)} value={overTimeRateUom} placeholder='hari..' /> */}
</FormGroup>
</div>
{/* <Row>
<Col>
<FormGroup>
<Label>Accrue At</Label>
<Input type='text' onChange={(e) => setAccrue(e.target.value)} value={accrue} placeholder='accrue..' />
</FormGroup>
</Col>
<Col>
<FormGroup>
<Label>Base Calendar</Label>
<Input type='text' onChange={(e) => setBaseCalender(e.target.value)} value={baseCalender} placeholder='base calendar..' />
</FormGroup>
</Col>
</Row> */}
</Form>
)
}
return (
<>
<Modal size="lg" isOpen={openDialog} toggle={toggleDialog}>
@ -263,4 +208,4 @@ const FormAsignHr = ({ openDialog, closeDialog, toggleDialog, idTask, dataEdit,
}
export default FormAsignHr;
export default FormAsignHr;

2
src/views/SimproV2/CreatedProyek/index.js

@ -130,7 +130,6 @@ const CreatedProyek = ({ params, ...props }) => {
const getDataProyek = async () => {
let start = 0;
if (currentPage !== 1 && currentPage > 1) {
@ -960,7 +959,6 @@ const CreatedProyek = ({ params, ...props }) => {
{ViewProyek}
{RenderDialogForm}
{RenderDialogFormProyek}
{/* {RenderDialogFormResources} */}
{RenderDialogFormMaterial}
{RenderDialogTableTools}
{RenderDialogDoc}

Loading…
Cancel
Save