Modified job search select to include additoinal filters IO-417
This commit is contained in:
1
client/debug.log
Normal file
1
client/debug.log
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[1207/095430.554:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
|
||||||
@@ -78,6 +78,8 @@ export function BillFormComponent({
|
|||||||
>
|
>
|
||||||
<JobSearchSelect
|
<JobSearchSelect
|
||||||
disabled={billEdit || disabled}
|
disabled={billEdit || disabled}
|
||||||
|
convertedOnly
|
||||||
|
// notExported={false}
|
||||||
onBlur={() => {
|
onBlur={() => {
|
||||||
if (form.getFieldValue("jobid") !== null) {
|
if (form.getFieldValue("jobid") !== null) {
|
||||||
loadLines({ variables: { id: form.getFieldValue("jobid") } });
|
loadLines({ variables: { id: form.getFieldValue("jobid") } });
|
||||||
|
|||||||
@@ -89,7 +89,12 @@ export function JobDetailCards({ setPrintCenterContext }) {
|
|||||||
<Tag
|
<Tag
|
||||||
color="#f50"
|
color="#f50"
|
||||||
key="production"
|
key="production"
|
||||||
style={{ display: data.jobs_by_pk.inproduction ? "" : "none" }}
|
style={{
|
||||||
|
display:
|
||||||
|
data && data.jobs_by_pk && data.jobs_by_pk.inproduction
|
||||||
|
? ""
|
||||||
|
: "none",
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{t("jobs.labels.inproduction")}
|
{t("jobs.labels.inproduction")}
|
||||||
</Tag>,
|
</Tag>,
|
||||||
|
|||||||
@@ -11,10 +11,31 @@ import AlertComponent from "../alert/alert.component";
|
|||||||
|
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
|
|
||||||
const JobSearchSelect = ({ value, onChange, onBlur, disabled }, ref) => {
|
const JobSearchSelect = (
|
||||||
|
{
|
||||||
|
value,
|
||||||
|
onChange,
|
||||||
|
onBlur,
|
||||||
|
disabled,
|
||||||
|
convertedOnly = false,
|
||||||
|
notExported = true,
|
||||||
|
},
|
||||||
|
ref
|
||||||
|
) => {
|
||||||
const [callSearch, { loading, error, data }] = useLazyQuery(
|
const [callSearch, { loading, error, data }] = useLazyQuery(
|
||||||
SEARCH_JOBS_FOR_AUTOCOMPLETE
|
SEARCH_JOBS_FOR_AUTOCOMPLETE,
|
||||||
|
{
|
||||||
|
...(convertedOnly || notExported
|
||||||
|
? {
|
||||||
|
variables: {
|
||||||
|
...(convertedOnly ? { isConverted: true } : {}),
|
||||||
|
...(notExported ? { notExported: true } : {}),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const [
|
const [
|
||||||
callIdSearch,
|
callIdSearch,
|
||||||
{ loading: idLoading, error: idError, data: idData },
|
{ loading: idLoading, error: idError, data: idData },
|
||||||
|
|||||||
@@ -778,23 +778,20 @@ export const ACTIVE_JOBS_FOR_AUTOCOMPLETE = gql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export const SEARCH_JOBS_FOR_AUTOCOMPLETE = gql`
|
export const SEARCH_JOBS_FOR_AUTOCOMPLETE = gql`
|
||||||
query SEARCH_JOBS_FOR_AUTOCOMPLETE($search: String) {
|
query SEARCH_JOBS_FOR_AUTOCOMPLETE($search: String, $isConverted: Boolean, $notExported: Boolean) {
|
||||||
search_jobs(
|
search_jobs(args: {search: $search}, limit: 50, order_by: {ro_number: desc_nulls_last}, where: {_and: {converted: {_eq: $isConverted}, date_exported: {_is_null: $notExported}}}) {
|
||||||
args: { search: $search }
|
id
|
||||||
limit: 50
|
ownr_fn
|
||||||
order_by: { ro_number: desc_nulls_last }
|
ownr_ln
|
||||||
) {
|
ro_number
|
||||||
id
|
est_number
|
||||||
ownr_fn
|
vehicleid
|
||||||
ownr_ln
|
v_make_desc
|
||||||
ro_number
|
v_model_desc
|
||||||
est_number
|
v_model_yr
|
||||||
vehicleid
|
|
||||||
v_make_desc
|
|
||||||
v_model_desc
|
|
||||||
v_model_yr
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
`;
|
`;
|
||||||
export const SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE = gql`
|
export const SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE = gql`
|
||||||
query SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE($id: uuid!) {
|
query SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE($id: uuid!) {
|
||||||
|
|||||||
Reference in New Issue
Block a user