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