Added shift clock framework + login on tech console BOD-97 BOD-188
This commit is contained in:
@@ -19,15 +19,14 @@ export default function TimeTicketModalComponent({
|
||||
<div>
|
||||
<div style={{ display: "flex" }}>
|
||||
<Form.Item
|
||||
name="jobid"
|
||||
name='jobid'
|
||||
label={t("timetickets.fields.ro_number")}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
]}>
|
||||
<JobSearchSelect
|
||||
options={roAutoCompleteOptions}
|
||||
onBlur={() => {
|
||||
@@ -40,15 +39,14 @@ export default function TimeTicketModalComponent({
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="employeeid"
|
||||
name='employeeid'
|
||||
label={t("timetickets.fields.employee")}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
]}>
|
||||
<EmployeeSearchSelect options={employeeAutoCompleteOptions} />
|
||||
</Form.Item>
|
||||
</div>
|
||||
@@ -56,71 +54,65 @@ export default function TimeTicketModalComponent({
|
||||
<div style={{ display: "flex" }}>
|
||||
<Form.Item
|
||||
label={t("timetickets.fields.date")}
|
||||
name="date"
|
||||
name='date'
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
]}>
|
||||
<DatePicker />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("timetickets.fields.productivehrs")}
|
||||
name="productivehrs"
|
||||
name='productivehrs'
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<InputNumber />
|
||||
]}>
|
||||
<InputNumber min={0} precision={1} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("timetickets.fields.actualhrs")}
|
||||
name="actualhrs"
|
||||
name='actualhrs'
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<InputNumber />
|
||||
]}>
|
||||
<InputNumber min={0} precision={1} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="cost_center"
|
||||
name='cost_center'
|
||||
label={t("timetickets.fields.cost_center")}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
]}>
|
||||
<Select
|
||||
style={{ width: "150px" }}
|
||||
onChange={() => {
|
||||
console.log("Changed.");
|
||||
}}
|
||||
>
|
||||
}}>
|
||||
{responsibilityCenters.costs.map((item) => (
|
||||
<Select.Option key={item.name}>{item.name}</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="ciecacode"
|
||||
name='ciecacode'
|
||||
label={t("timetickets.fields.ciecacode")}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
]}>
|
||||
<Input disabled />
|
||||
</Form.Item>
|
||||
</div>
|
||||
|
||||
@@ -59,7 +59,7 @@ export function TimeTicketModalContainer({
|
||||
} else {
|
||||
insertTicket({
|
||||
variables: {
|
||||
timeTicketInput: [values],
|
||||
timeTicketInput: [{ ...values, bodyshop: bodyshop.id }],
|
||||
},
|
||||
})
|
||||
.then(handleMutationSuccess)
|
||||
@@ -108,22 +108,21 @@ export function TimeTicketModalContainer({
|
||||
);
|
||||
form.setFieldsValue({
|
||||
cost_center: emps.length > 0 ? emps[0].cost_center : "",
|
||||
ciecacode: Object.keys(
|
||||
bodyshop.md_responsibility_centers.defaults
|
||||
).find(
|
||||
(key) =>
|
||||
bodyshop.md_responsibility_centers.defaults[key] ===
|
||||
emps[0].cost_center
|
||||
),
|
||||
ciecacode:
|
||||
Object.keys(bodyshop.md_responsibility_centers.defaults.costs).find(
|
||||
(key) =>
|
||||
bodyshop.md_responsibility_centers.defaults.costs[key] ===
|
||||
emps[0].cost_center
|
||||
) || "LAB",
|
||||
});
|
||||
}
|
||||
if (!!changedFields.cost_center && !!EmployeeAutoCompleteData) {
|
||||
form.setFieldsValue({
|
||||
ciecacode: Object.keys(
|
||||
bodyshop.md_responsibility_centers.defaults
|
||||
bodyshop.md_responsibility_centers.defaults.costs
|
||||
).find(
|
||||
(key) =>
|
||||
bodyshop.md_responsibility_centers.defaults[key] ===
|
||||
bodyshop.md_responsibility_centers.defaults.costs[key] ===
|
||||
changedFields.cost_center
|
||||
),
|
||||
});
|
||||
@@ -152,18 +151,16 @@ export function TimeTicketModalContainer({
|
||||
</Button>
|
||||
{timeTicketModal.context && timeTicketModal.context.id ? null : (
|
||||
<Button
|
||||
type="primary"
|
||||
type='primary'
|
||||
onClick={() => {
|
||||
setEnterAgain(true);
|
||||
}}
|
||||
>
|
||||
}}>
|
||||
{t("general.actions.saveandnew")}
|
||||
</Button>
|
||||
)}
|
||||
</span>
|
||||
}
|
||||
destroyOnClose
|
||||
>
|
||||
destroyOnClose>
|
||||
<Form
|
||||
onFinish={handleFinish}
|
||||
autoComplete={"off"}
|
||||
@@ -178,8 +175,7 @@ export function TimeTicketModalContainer({
|
||||
}
|
||||
: { jobid: timeTicketModal.context.jobId || null }
|
||||
}
|
||||
onValuesChange={handleFieldsChange}
|
||||
>
|
||||
onValuesChange={handleFieldsChange}>
|
||||
<TimeTicketModalComponent
|
||||
form={form}
|
||||
roAutoCompleteOptions={RoAutoCompleteData && RoAutoCompleteData.jobs}
|
||||
|
||||
Reference in New Issue
Block a user