Added job line edit modal selects for fields and formatted BOD-203
This commit is contained in:
@@ -9316,6 +9316,32 @@
|
|||||||
</concept_node>
|
</concept_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
|
<folder_node>
|
||||||
|
<name>validations</name>
|
||||||
|
<children>
|
||||||
|
<concept_node>
|
||||||
|
<name>zeropriceexistingpart</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>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { Form, Input, Modal } from "antd";
|
import { Form, Input, Modal, Select, InputNumber } from "antd";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import InputCurrency from "../form-items-formatted/currency-form-item.component";
|
import InputCurrency from "../form-items-formatted/currency-form-item.component";
|
||||||
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
|
|
||||||
export default function JobLinesUpsertModalComponent({
|
export default function JobLinesUpsertModalComponent({
|
||||||
visible,
|
visible,
|
||||||
@@ -21,6 +22,7 @@ export default function JobLinesUpsertModalComponent({
|
|||||||
<Form
|
<Form
|
||||||
onFinish={handleFinish}
|
onFinish={handleFinish}
|
||||||
initialValues={jobLine}
|
initialValues={jobLine}
|
||||||
|
layout="vertical"
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
form={form}
|
form={form}
|
||||||
>
|
>
|
||||||
@@ -31,44 +33,112 @@ export default function JobLinesUpsertModalComponent({
|
|||||||
: t("joblines.labels.new")
|
: t("joblines.labels.new")
|
||||||
}
|
}
|
||||||
visible={visible}
|
visible={visible}
|
||||||
|
width="60%"
|
||||||
okText={t("general.actions.save")}
|
okText={t("general.actions.save")}
|
||||||
onOk={() => form.submit()}
|
onOk={() => form.submit()}
|
||||||
okButtonProps={{ loading: loading }}
|
okButtonProps={{ loading: loading }}
|
||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
>
|
>
|
||||||
<Form.Item
|
<LayoutFormRow grow>
|
||||||
label={t("joblines.fields.line_desc")}
|
<Form.Item
|
||||||
rules={[
|
label={t("joblines.fields.line_desc")}
|
||||||
{
|
rules={[
|
||||||
required: true,
|
{
|
||||||
message: t("general.validation.required"),
|
required: true,
|
||||||
},
|
message: t("general.validation.required"),
|
||||||
]}
|
},
|
||||||
name="line_desc"
|
]}
|
||||||
>
|
name="line_desc"
|
||||||
<Input />
|
>
|
||||||
</Form.Item>
|
<Input />
|
||||||
<Form.Item label={t("joblines.fields.oem_partno")} name="oem_partno">
|
</Form.Item>
|
||||||
<Input />
|
<Form.Item label={t("joblines.fields.oem_partno")} name="oem_partno">
|
||||||
</Form.Item>
|
<Input />
|
||||||
<Form.Item label={t("joblines.fields.part_type")} name="part_type">
|
</Form.Item>
|
||||||
<Input />
|
</LayoutFormRow>
|
||||||
</Form.Item>
|
<LayoutFormRow grow>
|
||||||
<Form.Item label={t("joblines.fields.mod_lbr_ty")} name="mod_lbr_ty">
|
<Form.Item label={t("joblines.fields.part_type")} name="part_type">
|
||||||
<Input />
|
<Select>
|
||||||
</Form.Item>
|
<Select.Option value="PAA">
|
||||||
<Form.Item
|
{t("joblines.fields.part_types.PAA")}
|
||||||
label={t("joblines.fields.op_code_desc")}
|
</Select.Option>
|
||||||
name="op_code_desc"
|
<Select.Option value="PAE">
|
||||||
>
|
{t("joblines.fields.part_types.PAE")}
|
||||||
<Input />
|
</Select.Option>
|
||||||
</Form.Item>
|
<Select.Option value="PAL">
|
||||||
<Form.Item label={t("joblines.fields.mod_lb_hrs")} name="mod_lb_hrs">
|
{t("joblines.fields.part_types.PAL")}
|
||||||
<InputCurrency />
|
</Select.Option>
|
||||||
</Form.Item>
|
<Select.Option value="PAS">
|
||||||
<Form.Item label={t("joblines.fields.act_price")} name="act_price">
|
{t("joblines.fields.part_types.PAS")}
|
||||||
<InputCurrency />
|
</Select.Option>
|
||||||
</Form.Item>
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label={t("joblines.fields.mod_lbr_ty")} name="mod_lbr_ty">
|
||||||
|
<Select>
|
||||||
|
<Select.Option value="LAA">
|
||||||
|
{t("joblines.fields.lbr_types.LAA")}
|
||||||
|
</Select.Option>
|
||||||
|
<Select.Option value="LAB">
|
||||||
|
{t("joblines.fields.lbr_types.LAB")}
|
||||||
|
</Select.Option>
|
||||||
|
<Select.Option value="LAD">
|
||||||
|
{t("joblines.fields.lbr_types.LAD")}
|
||||||
|
</Select.Option>
|
||||||
|
<Select.Option value="LAF">
|
||||||
|
{t("joblines.fields.lbr_types.LAF")}
|
||||||
|
</Select.Option>
|
||||||
|
<Select.Option value="LAG">
|
||||||
|
{t("joblines.fields.lbr_types.LAG")}
|
||||||
|
</Select.Option>
|
||||||
|
<Select.Option value="LAM">
|
||||||
|
{t("joblines.fields.lbr_types.LAM")}
|
||||||
|
</Select.Option>
|
||||||
|
<Select.Option value="LAR">
|
||||||
|
{t("joblines.fields.lbr_types.LAR")}
|
||||||
|
</Select.Option>
|
||||||
|
<Select.Option value="LAS">
|
||||||
|
{t("joblines.fields.lbr_types.LAS")}
|
||||||
|
</Select.Option>
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
|
</LayoutFormRow>
|
||||||
|
<LayoutFormRow grow>
|
||||||
|
<Form.Item
|
||||||
|
label={t("joblines.fields.op_code_desc")}
|
||||||
|
name="op_code_desc"
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label={t("joblines.fields.mod_lb_hrs")} name="mod_lb_hrs">
|
||||||
|
<InputCurrency />
|
||||||
|
</Form.Item>
|
||||||
|
</LayoutFormRow>
|
||||||
|
<LayoutFormRow grow>
|
||||||
|
<Form.Item label={t("joblines.fields.part_qty")} name="part_qty">
|
||||||
|
<InputNumber precision={0} min={0} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label={t("joblines.fields.db_price")} name="db_price">
|
||||||
|
<InputCurrency precision={2} min={0} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("joblines.fields.act_price")}
|
||||||
|
name="act_price"
|
||||||
|
rules={[
|
||||||
|
({ getFieldValue }) => ({
|
||||||
|
validator(rule, value) {
|
||||||
|
if (!value || getFieldValue("part_type") !== "PAE") {
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
return Promise.reject(
|
||||||
|
t("joblines.validations.zeropriceexistingpart")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<InputCurrency precision={2} min={0} />
|
||||||
|
</Form.Item>
|
||||||
|
</LayoutFormRow>
|
||||||
</Modal>
|
</Modal>
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -610,6 +610,9 @@
|
|||||||
"created": "Job line created successfully.",
|
"created": "Job line created successfully.",
|
||||||
"saved": "Job line saved.",
|
"saved": "Job line saved.",
|
||||||
"updated": "Job line updated successfully."
|
"updated": "Job line updated successfully."
|
||||||
|
},
|
||||||
|
"validations": {
|
||||||
|
"zeropriceexistingpart": "This line cannot have any price since it uses an existing part."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"jobs": {
|
"jobs": {
|
||||||
|
|||||||
@@ -610,6 +610,9 @@
|
|||||||
"created": "",
|
"created": "",
|
||||||
"saved": "",
|
"saved": "",
|
||||||
"updated": ""
|
"updated": ""
|
||||||
|
},
|
||||||
|
"validations": {
|
||||||
|
"zeropriceexistingpart": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"jobs": {
|
"jobs": {
|
||||||
|
|||||||
@@ -610,6 +610,9 @@
|
|||||||
"created": "",
|
"created": "",
|
||||||
"saved": "",
|
"saved": "",
|
||||||
"updated": ""
|
"updated": ""
|
||||||
|
},
|
||||||
|
"validations": {
|
||||||
|
"zeropriceexistingpart": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"jobs": {
|
"jobs": {
|
||||||
|
|||||||
Reference in New Issue
Block a user