BOD-17 Added header blocks to contract detail.
This commit is contained in:
@@ -3024,6 +3024,27 @@
|
||||
<folder_node>
|
||||
<name>labels</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>courtesycar</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<folder_node>
|
||||
<name>fuel</name>
|
||||
<children>
|
||||
@@ -3218,6 +3239,27 @@
|
||||
</concept_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<concept_node>
|
||||
<name>vehicle</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
@@ -8331,6 +8373,27 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>job</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>lines</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Descriptions, Card } from "antd";
|
||||
import { Link } from "react-router-dom";
|
||||
export default function ContractCourtesyCarBlock({ courtesyCar }) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Link to={`/manage/courtesycars/${courtesyCar && courtesyCar.id}`}>
|
||||
<Card title={t("courtesycars.labels.courtesycar")}>
|
||||
<Descriptions size="small" column={1}>
|
||||
<Descriptions.Item label={t("courtesycars.fields.fleetnumber")}>
|
||||
{(courtesyCar && courtesyCar.fleetnumber) || ""}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("courtesycars.fields.plate")}>
|
||||
{(courtesyCar && courtesyCar.plate) || ""}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("courtesycars.labels.vehicle")}>
|
||||
{`${(courtesyCar && courtesyCar.year) || ""} ${(courtesyCar &&
|
||||
courtesyCar.make) ||
|
||||
""} ${(courtesyCar && courtesyCar.model) || ""}`}
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</Card>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
@@ -10,26 +10,30 @@ export default function ContractFormComponent() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div>
|
||||
<Input value={state} onChange={e => setState(e.target.value)} />
|
||||
<Button
|
||||
onClick={() => {
|
||||
console.log("state", state);
|
||||
//let data = state;
|
||||
<div style={{ background: "#f00" }}>
|
||||
TEST AREA
|
||||
<Input value={state} onChange={e => setState(e.target.value)} />
|
||||
<Button
|
||||
onClick={() => {
|
||||
console.log("state", state);
|
||||
//let data = state;
|
||||
|
||||
var data =
|
||||
"%FLDELRAY BEACH^DOE$JOHN$^4818 S FEDERAL BLVD^ ? ;6360100462172082009=2101198299090=? #! 33435 I 1600 ECCECC00000?";
|
||||
data = data.replace(/\n/, "");
|
||||
// replace spaces with regular space
|
||||
data = data.replace(/\s/g, " ");
|
||||
var track = data.match(/(.*?\?)(.*?\?)(.*?\?)/);
|
||||
console.log("data", data);
|
||||
console.log("track", track);
|
||||
const a = aamva.stripe(data);
|
||||
console.log(JSON.stringify(a));
|
||||
}}
|
||||
>
|
||||
Decode
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
var data =
|
||||
"%FLDELRAY BEACH^DOE$JOHN$^4818 S FEDERAL BLVD^ ? ;6360100462172082009=2101198299090=? #! 33435 I 1600 ECCECC00000?";
|
||||
data = data.replace(/\n/, "");
|
||||
// replace spaces with regular space
|
||||
data = data.replace(/\s/g, " ");
|
||||
var track = data.match(/(.*?\?)(.*?\?)(.*?\?)/);
|
||||
console.log("data", data);
|
||||
console.log("track", track);
|
||||
const a = aamva.stripe(data);
|
||||
console.log(JSON.stringify(a));
|
||||
}}
|
||||
>
|
||||
Decode
|
||||
</Button>
|
||||
<Form.Item
|
||||
label={t("contracts.fields.status")}
|
||||
name="status"
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Descriptions, Card } from "antd";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
export default function ContractJobBlock({ job }) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Link to={`/manage/jobs/${job && job.id}`}>
|
||||
<Card title={t("jobs.labels.job")}>
|
||||
<Descriptions size="small" column={1}>
|
||||
<Descriptions.Item label={t("jobs.fields.ro_number")}>
|
||||
{(job && job.ro_number) || ""}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.vehicle")}>
|
||||
{`${(job && job.v_model_yr) || ""} ${(job && job.v_make_desc) ||
|
||||
""} ${(job && job.v_model_desc) || ""}`}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.owner")}>
|
||||
{`${(job && job.ownr_fn) || ""} ${(job && job.ownr_ln) ||
|
||||
""} ${(job && job.ownr_co_nm) || ""}`}
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</Card>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
@@ -15,10 +15,7 @@ export const UPDATE_CONTRACT = gql`
|
||||
$contractId: uuid!
|
||||
$cccontract: cccontracts_set_input!
|
||||
) {
|
||||
update_cccontracts(
|
||||
where: { id: { _eq: $contractId } }
|
||||
_set: $cccontract
|
||||
) {
|
||||
update_cccontracts(where: { id: { _eq: $contractId } }, _set: $cccontract) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
@@ -49,12 +46,31 @@ export const QUERY_CONTRACT_BY_PK = gql`
|
||||
driver_zip
|
||||
id
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
est_number
|
||||
ro_number
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
scheduled_completion
|
||||
}
|
||||
kmend
|
||||
kmstart
|
||||
scheduledreturn
|
||||
start
|
||||
status
|
||||
updated_at
|
||||
courtesycar {
|
||||
id
|
||||
fleetnumber
|
||||
make
|
||||
model
|
||||
year
|
||||
plate
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -2,14 +2,18 @@ import React from "react";
|
||||
import ContractFormComponent from "../../components/contract-form/contract-form.component";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Button } from "antd";
|
||||
export default function ContractDetailPage() {
|
||||
import ContractJobBlock from "../../components/contract-job-block/contract-job-block.component";
|
||||
import ContractCourtesyCarBlock from "../../components/contract-courtesy-car-block/contract-courtesy-car-block.component";
|
||||
|
||||
export default function ContractDetailPage({ job, courtesyCar }) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div>
|
||||
<Button type="primary" htmlType="submit">
|
||||
{t("general.actions.save")}
|
||||
</Button>
|
||||
SOME SORT OF HEADER INFORMATION HERE.
|
||||
<ContractJobBlock job={job} />
|
||||
<ContractCourtesyCarBlock courtesyCar={courtesyCar} />
|
||||
<ContractFormComponent />
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -78,7 +78,10 @@ export default function ContractDetailPageContainer() {
|
||||
: {}
|
||||
}
|
||||
>
|
||||
<ContractDetailPageComponent />
|
||||
<ContractDetailPageComponent
|
||||
job={data ? data.cccontracts_by_pk.job : null}
|
||||
courtesyCar={data ? data.cccontracts_by_pk.courtesycar : null}
|
||||
/>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -203,6 +203,7 @@
|
||||
"year": "Year"
|
||||
},
|
||||
"labels": {
|
||||
"courtesycar": "Courtesy Car",
|
||||
"fuel": {
|
||||
"12": "1/2",
|
||||
"14": "1/4",
|
||||
@@ -213,7 +214,8 @@
|
||||
"78": "7/8",
|
||||
"empty": "Empty",
|
||||
"full": "Full"
|
||||
}
|
||||
},
|
||||
"vehicle": "Vehicle Description"
|
||||
},
|
||||
"status": {
|
||||
"in": "Available",
|
||||
@@ -535,6 +537,7 @@
|
||||
"creating_new_job": "Creating new job...",
|
||||
"documents": "Documents",
|
||||
"existing_jobs": "Existing Jobs",
|
||||
"job": "Job Details",
|
||||
"lines": "Estimate Lines",
|
||||
"notes": "Notes",
|
||||
"override_header": "Override estimate header on import?",
|
||||
|
||||
@@ -203,6 +203,7 @@
|
||||
"year": ""
|
||||
},
|
||||
"labels": {
|
||||
"courtesycar": "",
|
||||
"fuel": {
|
||||
"12": "",
|
||||
"14": "",
|
||||
@@ -213,7 +214,8 @@
|
||||
"78": "",
|
||||
"empty": "",
|
||||
"full": ""
|
||||
}
|
||||
},
|
||||
"vehicle": ""
|
||||
},
|
||||
"status": {
|
||||
"in": "",
|
||||
@@ -535,6 +537,7 @@
|
||||
"creating_new_job": "Creando nuevo trabajo ...",
|
||||
"documents": "documentos",
|
||||
"existing_jobs": "Empleos existentes",
|
||||
"job": "",
|
||||
"lines": "Líneas estimadas",
|
||||
"notes": "Notas",
|
||||
"override_header": "¿Anular encabezado estimado al importar?",
|
||||
|
||||
@@ -203,6 +203,7 @@
|
||||
"year": ""
|
||||
},
|
||||
"labels": {
|
||||
"courtesycar": "",
|
||||
"fuel": {
|
||||
"12": "",
|
||||
"14": "",
|
||||
@@ -213,7 +214,8 @@
|
||||
"78": "",
|
||||
"empty": "",
|
||||
"full": ""
|
||||
}
|
||||
},
|
||||
"vehicle": ""
|
||||
},
|
||||
"status": {
|
||||
"in": "",
|
||||
@@ -535,6 +537,7 @@
|
||||
"creating_new_job": "Création d'un nouvel emploi ...",
|
||||
"documents": "Les documents",
|
||||
"existing_jobs": "Emplois existants",
|
||||
"job": "",
|
||||
"lines": "Estimer les lignes",
|
||||
"notes": "Remarques",
|
||||
"override_header": "Remplacer l'en-tête d'estimation à l'importation?",
|
||||
|
||||
Reference in New Issue
Block a user