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