Added parts table for job close BOD-131
This commit is contained in:
@@ -3,6 +3,7 @@ import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import JobsCloseLaborMaterialAllocation from "../../components/jobs-close-labmat-allocation/jobs-close-labmat-allocation.component";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import JobsClosePartsAllocation from "../../components/jobs-close-parts-allocation/jobs-close-parts-allocation.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
@@ -20,12 +21,24 @@ export function JobsCloseComponent({ job, bodyshop, jobTotals }) {
|
||||
}, {})
|
||||
);
|
||||
|
||||
const [partsAllocations, setPartsAllocations] = useState(
|
||||
Object.keys(jobTotals.parts.parts.list).reduce((acc, val) => {
|
||||
acc[val] = { ...jobTotals.parts.parts.list[val], allocations: [] };
|
||||
|
||||
return acc;
|
||||
}, {})
|
||||
);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<JobsCloseLaborMaterialAllocation
|
||||
labmatAllocations={labmatAllocations}
|
||||
setLabmatAllocations={setLabmatAllocations}
|
||||
/>
|
||||
<JobsClosePartsAllocation
|
||||
partsAllocations={partsAllocations}
|
||||
setPartsAllocations={setPartsAllocations}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user