@@ -28,7 +28,7 @@ const cardColor = (ssbuckets, totalHrs) => {
|
||||
const getContrastYIQ = (bgColor) =>
|
||||
(bgColor.r * 299 + bgColor.g * 587 + bgColor.b * 114) / 1000 >= 128 ? "black" : "white";
|
||||
|
||||
export default function ProductionBoardCard({ technician, card, bodyshop, cardSettings, clone }) {
|
||||
export default function ProductionBoardCard({ technician, card, bodyshop, cardSettings, clone, style }) {
|
||||
const { t } = useTranslation();
|
||||
const { metadata } = card;
|
||||
|
||||
@@ -72,7 +72,8 @@ export default function ProductionBoardCard({ technician, card, bodyshop, cardSe
|
||||
size="small"
|
||||
style={{
|
||||
backgroundColor: cardSettings?.cardcolor && `rgba(${bgColor.r},${bgColor.g},${bgColor.b},${bgColor.a})`,
|
||||
color: cardSettings?.cardcolor && contrastYIQ
|
||||
color: cardSettings?.cardcolor && contrastYIQ,
|
||||
...style
|
||||
}}
|
||||
title={
|
||||
<Space>
|
||||
@@ -103,10 +104,10 @@ export default function ProductionBoardCard({ technician, card, bodyshop, cardSe
|
||||
</Link>
|
||||
}
|
||||
>
|
||||
{!clone && (
|
||||
<Row>
|
||||
{cardSettings?.ownr_nm && (
|
||||
<Col span={24}>
|
||||
<Row>
|
||||
{cardSettings?.ownr_nm && (
|
||||
<Col span={24}>
|
||||
<Tooltip title={`${metadata.ownr_ln || ""} ${metadata.ownr_co_nm || ""}`}>
|
||||
{cardSettings.compact ? (
|
||||
<div className="ellipses">{`${metadata.ownr_ln || ""} ${metadata.ownr_co_nm || ""}`}</div>
|
||||
) : (
|
||||
@@ -114,87 +115,113 @@ export default function ProductionBoardCard({ technician, card, bodyshop, cardSe
|
||||
<OwnerNameDisplay ownerObject={card} />
|
||||
</div>
|
||||
)}
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.model_info && (
|
||||
<Col span={24}>
|
||||
</Tooltip>
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.model_info && (
|
||||
<Col span={24}>
|
||||
<Tooltip
|
||||
title={`${metadata.v_model_yr || ""} ${metadata.v_make_desc || ""} ${metadata.v_model_desc || ""}`}
|
||||
>
|
||||
<div className="ellipses">{`${metadata.v_model_yr || ""} ${metadata.v_make_desc || ""} ${metadata.v_model_desc || ""}`}</div>
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.ins_co_nm && metadata.ins_co_nm && (
|
||||
<Col span={cardSettings.compact ? 24 : 12}>
|
||||
</Tooltip>
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.ins_co_nm && metadata.ins_co_nm && (
|
||||
<Col span={cardSettings.compact ? 24 : 12}>
|
||||
<Tooltip title={metadata.ins_co_nm || ""}>
|
||||
<div className="ellipses">{metadata.ins_co_nm || ""}</div>
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.clm_no && metadata.clm_no && (
|
||||
<Col span={cardSettings.compact ? 24 : 12}>
|
||||
</Tooltip>
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.clm_no && metadata.clm_no && (
|
||||
<Col span={cardSettings.compact ? 24 : 12}>
|
||||
<Tooltip title={metadata.clm_no || ""}>
|
||||
<div className="ellipses">{metadata.clm_no || ""}</div>
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.employeeassignments && (
|
||||
<Col span={24}>
|
||||
<Row>
|
||||
<Col span={cardSettings.compact ? 24 : 12}>{`B: ${
|
||||
employee_body ? `${employee_body.first_name.substr(0, 3)} ${employee_body.last_name.charAt(0)}` : ""
|
||||
} ${metadata.labhrs.aggregate.sum.mod_lb_hrs || "?"}h`}</Col>
|
||||
<Col span={cardSettings.compact ? 24 : 12}>{`P: ${
|
||||
employee_prep ? `${employee_prep.first_name.substr(0, 3)} ${employee_prep.last_name.charAt(0)}` : ""
|
||||
}`}</Col>
|
||||
<Col span={cardSettings.compact ? 24 : 12}>{`R: ${
|
||||
employee_refinish
|
||||
? `${employee_refinish.first_name.substr(0, 3)} ${employee_refinish.last_name.charAt(0)}`
|
||||
: ""
|
||||
} ${metadata.larhrs.aggregate.sum.mod_lb_hrs || "?"}h`}</Col>
|
||||
<Col span={cardSettings.compact ? 24 : 12}>{`C: ${
|
||||
employee_csr ? `${employee_csr.first_name} ${employee_csr.last_name}` : ""
|
||||
}`}</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.actual_in && metadata.actual_in && (
|
||||
<Col span={cardSettings.compact ? 24 : 12}>
|
||||
</Tooltip>
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.employeeassignments && (
|
||||
<Col span={24}>
|
||||
<Row>
|
||||
<Col span={cardSettings.compact ? 24 : 12}>
|
||||
<Tooltip
|
||||
title={`B: ${employee_body ? `${employee_body.first_name.substr(0, 3)} ${employee_body.last_name.charAt(0)}` : ""} ${metadata.labhrs.aggregate.sum.mod_lb_hrs || "?"}h`}
|
||||
>
|
||||
<div className="ellipses">{`B: ${employee_body ? `${employee_body.first_name.substr(0, 3)} ${employee_body.last_name.charAt(0)}` : ""} ${metadata.labhrs.aggregate.sum.mod_lb_hrs || "?"}h`}</div>
|
||||
</Tooltip>
|
||||
</Col>
|
||||
<Col span={cardSettings.compact ? 24 : 12}>
|
||||
<Tooltip
|
||||
title={`P: ${employee_prep ? `${employee_prep.first_name.substr(0, 3)} ${employee_prep.last_name.charAt(0)}` : ""}`}
|
||||
>
|
||||
<div className="ellipses">{`P: ${employee_prep ? `${employee_prep.first_name.substring(0, 3)} ${employee_prep.last_name.charAt(0)}` : ""}`}</div>
|
||||
</Tooltip>
|
||||
</Col>
|
||||
<Col span={cardSettings.compact ? 24 : 12}>
|
||||
<Tooltip
|
||||
title={`R: ${employee_refinish ? `${employee_refinish.first_name.substring(0, 3)} ${employee_refinish.last_name.charAt(0)}` : ""} ${metadata.larhrs.aggregate.sum.mod_lb_hrs || "?"}h`}
|
||||
>
|
||||
<div className="ellipses">{`R: ${employee_refinish ? `${employee_refinish.first_name.substring(0, 3)} ${employee_refinish.last_name.charAt(0)}` : ""} ${metadata.larhrs.aggregate.sum.mod_lb_hrs || "?"}h`}</div>
|
||||
</Tooltip>
|
||||
</Col>
|
||||
<Col span={cardSettings.compact ? 24 : 12}>
|
||||
<Tooltip title={`C: ${employee_csr ? `${employee_csr.first_name} ${employee_csr.last_name}` : ""}`}>
|
||||
<div className="ellipses">{`C: ${employee_csr ? `${employee_csr.first_name} ${employee_csr.last_name}` : ""}`}</div>
|
||||
</Tooltip>
|
||||
</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.actual_in && metadata.actual_in && (
|
||||
<Col span={cardSettings.compact ? 24 : 12}>
|
||||
<Tooltip title={metadata.actual_in}>
|
||||
<Space>
|
||||
<DownloadOutlined />
|
||||
<DateTimeFormatter format="MM/DD">{metadata.actual_in}</DateTimeFormatter>
|
||||
</Space>
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.scheduled_completion && metadata.scheduled_completion && (
|
||||
<Col span={cardSettings.compact ? 24 : 12}>
|
||||
</Tooltip>
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.scheduled_completion && metadata.scheduled_completion && (
|
||||
<Col span={cardSettings.compact ? 24 : 12}>
|
||||
<Tooltip title={metadata.scheduled_completion}>
|
||||
<Space className={pastDueAlert}>
|
||||
<CalendarOutlined />
|
||||
<DateTimeFormatter format="MM/DD">{metadata.scheduled_completion}</DateTimeFormatter>
|
||||
</Space>
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.ats && metadata.alt_transport && (
|
||||
<Col span={12}>
|
||||
<div>{metadata.alt_transport || ""}</div>
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.sublets && (
|
||||
<Col span={12}>
|
||||
<ProductionSubletsManageComponent subletJobLines={metadata.subletLines} />
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.production_note && (
|
||||
<Col span={24}>
|
||||
<ProductionListColumnProductionNote
|
||||
record={{
|
||||
production_vars: card?.metadata.production_vars,
|
||||
id: card?.id,
|
||||
refetch: card?.refetch
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.partsstatus && (
|
||||
<Col span={24}>
|
||||
<JobPartsQueueCount parts={metadata.joblines_status} />
|
||||
</Col>
|
||||
)}
|
||||
</Row>
|
||||
)}
|
||||
</Tooltip>
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.ats && metadata.alt_transport && (
|
||||
<Col span={12}>
|
||||
<Tooltip title={metadata.alt_transport}>
|
||||
<div className="ellipses">{metadata.alt_transport || ""}</div>
|
||||
</Tooltip>
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.sublets && (
|
||||
<Col span={12}>
|
||||
<ProductionSubletsManageComponent subletJobLines={metadata.subletLines} />
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.production_note && (
|
||||
<Col span={24}>
|
||||
<ProductionListColumnProductionNote
|
||||
record={{
|
||||
production_vars: card?.metadata.production_vars,
|
||||
id: card?.id,
|
||||
refetch: card?.refetch
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
)}
|
||||
{cardSettings?.partsstatus && (
|
||||
<Col span={24}>
|
||||
<JobPartsQueueCount parts={metadata.joblines_status} />
|
||||
</Col>
|
||||
)}
|
||||
</Row>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user