IO-1034 Resolve undefined error messages for reqd form list fields.

This commit is contained in:
Patrick Fic
2021-05-18 14:11:54 -07:00
parent b8fe2f29e5
commit 2e614197e1
2 changed files with 18 additions and 3 deletions

View File

@@ -47,6 +47,7 @@ export function BillEnterModalLinesComponent({
return {
key: `${field.index}joblinename`,
name: [field.name, "joblineid"],
label: t("billlines.fields.jobline"),
rules: [
{
required: true,
@@ -94,6 +95,7 @@ export function BillEnterModalLinesComponent({
return {
key: `${field.index}line_desc`,
name: [field.name, "line_desc"],
label: t("billlines.fields.line_desc"),
rules: [
{
required: true,
@@ -113,6 +115,7 @@ export function BillEnterModalLinesComponent({
return {
key: `${field.index}quantity`,
name: [field.name, "quantity"],
label: t("billlines.fields.quantity"),
rules: [
{
required: true,
@@ -134,6 +137,7 @@ export function BillEnterModalLinesComponent({
return {
key: `${field.index}actual_price`,
name: [field.name, "actual_price"],
label: t("billlines.fields.actual_price"),
rules: [
{
required: true,
@@ -186,10 +190,12 @@ export function BillEnterModalLinesComponent({
dataIndex: "actual_cost",
editable: true,
width: "8rem",
formItemProps: (field) => {
return {
key: `${field.index}actual_cost`,
name: [field.name, "actual_cost"],
label: t("billlines.fields.actual_cost"),
rules: [
{
required: true,
@@ -221,10 +227,12 @@ export function BillEnterModalLinesComponent({
title: t("billlines.fields.cost_center"),
dataIndex: "cost_center",
editable: true,
formItemProps: (field) => {
return {
key: `${field.index}cost_center`,
name: [field.name, "cost_center"],
label: t("billlines.fields.cost_center"),
rules: [
{
required: true,
@@ -246,6 +254,7 @@ export function BillEnterModalLinesComponent({
title: t("billlines.fields.location"),
dataIndex: "location",
editable: true,
label: t("billlines.fields.location"),
formItemProps: (field) => {
return {
key: `${field.index}location`,
@@ -499,7 +508,11 @@ const EditableCell = ({
return (
<td {...restProps}>
<Form.Item name={dataIndex} {...(formItemProps && formItemProps(record))}>
<Form.Item
labelCol={{ span: 0 }}
name={dataIndex}
{...(formItemProps && formItemProps(record))}
>
{(formInput && formInput(record, record.key)) || children}
</Form.Item>
</td>

View File

@@ -102,9 +102,10 @@ export function JobsCloseLines({ bodyshop, job, jobRO }) {
</td>
<td>
<Form.Item
//label={t("joblines.fields.profitcenter_part")}
label={t("joblines.fields.profitcenter_part")}
key={`${index}profitcenter_part`}
name={[field.name, "profitcenter_part"]}
labelCol={{ span: 0 }}
rules={[
{
required: !!job.joblines[index].act_price,
@@ -135,7 +136,8 @@ export function JobsCloseLines({ bodyshop, job, jobRO }) {
</td>
<td>
<Form.Item
//label={t("joblines.fields.profitcenter_labor")}
label={t("joblines.fields.profitcenter_labor")}
labelCol={{ span: 0 }}
key={`${index}profitcenter_labor`}
name={[field.name, "profitcenter_labor"]}
rules={[