Added validation to job actions BOD-391
This commit is contained in:
@@ -30,7 +30,7 @@ export function JobLinesComponent({
|
||||
setSearchText,
|
||||
selectedLines,
|
||||
setSelectedLines,
|
||||
jobId,
|
||||
job,
|
||||
setJobLineEditContext,
|
||||
}) {
|
||||
const [state, setState] = useState({
|
||||
@@ -308,12 +308,14 @@ export function JobLinesComponent({
|
||||
<SyncOutlined />
|
||||
</Button>
|
||||
<Button
|
||||
disabled={selectedLines.length > 0 ? false : true}
|
||||
disabled={
|
||||
!job.converted || (selectedLines.length > 0 ? false : true)
|
||||
}
|
||||
onClick={() => {
|
||||
setPartsOrderContext({
|
||||
actions: { refetch: refetch },
|
||||
context: {
|
||||
jobId: jobId,
|
||||
jobId: job.jobId,
|
||||
linesToOrder: selectedLines,
|
||||
},
|
||||
});
|
||||
@@ -346,7 +348,7 @@ export function JobLinesComponent({
|
||||
onClick={() => {
|
||||
setJobLineEditContext({
|
||||
actions: { refetch: refetch },
|
||||
context: { jobid: jobId },
|
||||
context: { jobid: job.jobId },
|
||||
});
|
||||
}}
|
||||
>
|
||||
@@ -370,7 +372,7 @@ export function JobLinesComponent({
|
||||
{record.parts_order_lines.map((item) => (
|
||||
<div key={item.id}>
|
||||
<Link
|
||||
to={`/manage/jobs/${jobId}?tab=partssublet&partsorderid=${item.parts_order.id}`}
|
||||
to={`/manage/jobs/${job.jobId}?tab=partssublet&partsorderid=${item.parts_order.id}`}
|
||||
>
|
||||
{item.parts_order.order_number || ""}
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user