Resolved issues on time ticket modal IO-563
This commit is contained in:
@@ -6,7 +6,7 @@ import React, { forwardRef, useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE,
|
||||
SEARCH_JOBS_FOR_AUTOCOMPLETE
|
||||
SEARCH_JOBS_FOR_AUTOCOMPLETE,
|
||||
} from "../../graphql/jobs.queries";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
const { Option } = Select;
|
||||
@@ -61,12 +61,6 @@ const JobSearchSelect = (
|
||||
}
|
||||
}, [value, option, callIdSearch]);
|
||||
|
||||
// useEffect(() => {
|
||||
// if (value !== option && onChange) {
|
||||
// onChange(option);
|
||||
// }
|
||||
// }, [value, option, onChange]);
|
||||
|
||||
const handleSelect = (value) => {
|
||||
setOption(value);
|
||||
if (value !== option && onChange) {
|
||||
|
||||
@@ -21,7 +21,6 @@ export function LaborAllocationsTable({
|
||||
adjustments,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [totals, setTotals] = useState([]);
|
||||
useEffect(() => {
|
||||
if (!!joblines && !!timetickets && !!bodyshop);
|
||||
@@ -33,7 +32,8 @@ export function LaborAllocationsTable({
|
||||
adjustments
|
||||
)
|
||||
);
|
||||
}, [joblines, timetickets, bodyshop, adjustments]);
|
||||
if (!jobId) setTotals([]);
|
||||
}, [joblines, timetickets, bodyshop, adjustments, jobId]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
@@ -6,7 +6,7 @@ export const CalculateAllocationsTotals = (
|
||||
) => {
|
||||
const jobCodes = joblines.map((item) => item.mod_lbr_ty);
|
||||
//.filter((value, index, self) => self.indexOf(value) === index && !!value);
|
||||
const ticketCodes = timetickets.map((item) => item.cieca_code);
|
||||
const ticketCodes = timetickets.map((item) => item.ciecacode);
|
||||
//.filter((value, index, self) => self.indexOf(value) === index && !!value);
|
||||
const allCodes = [...jobCodes, ...ticketCodes].filter(
|
||||
(value, index, self) => self.indexOf(value) === index && !!value
|
||||
|
||||
@@ -138,11 +138,13 @@ export default function TimeTicketModalComponent({
|
||||
</Form.Item>
|
||||
</LayoutFormRow>
|
||||
<Form.Item shouldUpdate>
|
||||
<LaborAllocationsTable
|
||||
jobId={form.getFieldValue("jobid")}
|
||||
joblines={lineTicketData.joblines}
|
||||
timetickets={lineTicketData.timetickets}
|
||||
/>
|
||||
{() => (
|
||||
<LaborAllocationsTable
|
||||
jobId={form.getFieldValue("jobid")}
|
||||
joblines={lineTicketData.joblines}
|
||||
timetickets={lineTicketData.timetickets}
|
||||
/>
|
||||
)}
|
||||
</Form.Item>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -95,7 +95,8 @@ export function TimeTicketModalContainer({
|
||||
if (enterAgain) {
|
||||
//Capture the existing information and repopulate it.
|
||||
|
||||
const prev = form.getFieldsValue(["jobid", "employeeid", "date"]);
|
||||
const prev = form.getFieldsValue(["date"]);
|
||||
|
||||
form.resetFields();
|
||||
form.setFieldsValue(prev);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user