Update jobline display and related jobs.

This commit is contained in:
Patrick Fic
2025-11-14 14:09:44 -08:00
parent ec7327e1fd
commit 5235519dd8
12 changed files with 326 additions and 59 deletions

View File

@@ -1,4 +1,4 @@
import { GET_JOB_BY_PK } from "@/graphql/jobs.queries";
import { GET_JOB_LINES } from "@/graphql/jobs.queries";
import { useQuery } from "@apollo/client";
import { useGlobalSearchParams } from "expo-router";
import React from "react";
@@ -10,7 +10,7 @@ import ErrorDisplay from "../error/error-display";
export default function JobLines() {
const { jobId } = useGlobalSearchParams();
const { loading, error, data, refetch } = useQuery(GET_JOB_BY_PK, {
const { loading, error, data, refetch } = useQuery(GET_JOB_LINES, {
variables: {
id: jobId,
},
@@ -47,13 +47,13 @@ export default function JobLines() {
<DataTable.Title style={{ flex: 2 }}>
{t("jobdetail.labels.lines_lbr_ty")}
</DataTable.Title>
<DataTable.Title style={{ flex: 1 }} numeric>
<DataTable.Title style={{ flex: 1 }}>
{t("jobdetail.labels.lines_lb_hrs")}
</DataTable.Title>
<DataTable.Title style={{ flex: 2 }}>
{t("jobdetail.labels.lines_part_type")}
</DataTable.Title>
<DataTable.Title style={{ flex: 1 }} numeric>
<DataTable.Title style={{ flex: 1 }}>
{t("jobdetail.labels.lines_qty")}
</DataTable.Title>
</DataTable.Header>
@@ -71,15 +71,13 @@ export default function JobLines() {
<DataTable.Cell style={{ flex: 2 }}>
{item.mod_lbr_ty && t(`jobdetail.lbr_types.${item.mod_lbr_ty}`)}
</DataTable.Cell>
<DataTable.Cell style={{ flex: 1 }} numeric>
<DataTable.Cell style={{ flex: 1 }}>
{item.mod_lb_hrs}
</DataTable.Cell>
<DataTable.Cell style={{ flex: 2 }}>
{item.part_type && t(`jobdetail.part_types.${item.part_type}`)}
</DataTable.Cell>
<DataTable.Cell style={{ flex: 1 }} numeric>
{item.part_qty}
</DataTable.Cell>
<DataTable.Cell style={{ flex: 1 }}>{item.part_qty}</DataTable.Cell>
</DataTable.Row>
))}
</DataTable>