WIP Tech Claiming Ability
This commit is contained in:
@@ -70,7 +70,7 @@ export function JobLineDispatchButton({
|
||||
notification.open({
|
||||
type: "error",
|
||||
message: t("parts_dispatch.errors.creating", {
|
||||
error: JSON.stringify(result.errors),
|
||||
error: result.errors,
|
||||
}),
|
||||
});
|
||||
} else {
|
||||
@@ -79,7 +79,7 @@ export function JobLineDispatchButton({
|
||||
{
|
||||
name: Templates.parts_dispatch.key,
|
||||
variables: {
|
||||
id: result.data.insert_part_dispatch_one.id,
|
||||
id: result.data.insert_parts_dispatch_one.id,
|
||||
},
|
||||
},
|
||||
{},
|
||||
@@ -91,7 +91,7 @@ export function JobLineDispatchButton({
|
||||
notification.open({
|
||||
type: "error",
|
||||
message: t("parts_dispatch.errors.creating", {
|
||||
error: JSON.stringify(error),
|
||||
error: error,
|
||||
}),
|
||||
});
|
||||
} finally {
|
||||
@@ -137,7 +137,12 @@ export function JobLineDispatchButton({
|
||||
</Form.Item>
|
||||
|
||||
<Space wrap>
|
||||
<Button type="danger" onClick={() => form.submit()} loading={loading}>
|
||||
<Button
|
||||
type="danger"
|
||||
onClick={() => form.submit()}
|
||||
loading={loading}
|
||||
disabled={selectedLines.length === 0}
|
||||
>
|
||||
{t("general.actions.save")}
|
||||
</Button>
|
||||
<Button onClick={() => setVisible(false)}>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Card, Col, Row, Table } from "antd";
|
||||
import { Button, Card, Col, Row, Table } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||
@@ -28,9 +28,12 @@ export default function PartsDispatchExpander({ dispatch, job }) {
|
||||
width: "20%",
|
||||
|
||||
//sorter: (a, b) => alphaSort(a.number, b.number),
|
||||
render: (text, record) => (
|
||||
<DateTimeFormatter>{record.accepted_at}</DateTimeFormatter>
|
||||
),
|
||||
render: (text, record) =>
|
||||
record.accepted_at ? (
|
||||
<DateTimeFormatter>{record.accepted_at}</DateTimeFormatter>
|
||||
) : (
|
||||
<Button>{t("parts_dispatch.actions.accept")}</Button>
|
||||
),
|
||||
},
|
||||
];
|
||||
return (
|
||||
@@ -38,7 +41,7 @@ export default function PartsDispatchExpander({ dispatch, job }) {
|
||||
<Row gutter={[16, 16]}>
|
||||
<Col span={24}>
|
||||
<Table
|
||||
pagination={false}
|
||||
rowKey={"id"}
|
||||
dataSource={dispatch.parts_dispatch_lines}
|
||||
columns={columns}
|
||||
/>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import Icon, { SearchOutlined, ScheduleOutlined } from "@ant-design/icons";
|
||||
import Icon, {
|
||||
SearchOutlined,
|
||||
ScheduleOutlined,
|
||||
CarOutlined,
|
||||
} from "@ant-design/icons";
|
||||
import { Layout, Menu } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -68,6 +72,15 @@ export function TechSider({ technician, techLogout }) {
|
||||
<Menu.Item key="5" disabled={!!!technician} icon={<ScheduleOutlined />}>
|
||||
<Link to={`/tech/list`}>{t("menus.tech.productionlist")}</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item
|
||||
key="dispatchedparts"
|
||||
disabled={!!!technician}
|
||||
icon={<CarOutlined />}
|
||||
>
|
||||
<Link to={`/tech/dispatchedparts`}>
|
||||
{t("menus.tech.dispatchedparts")}
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item
|
||||
key="6"
|
||||
disabled={!!!technician}
|
||||
|
||||
Reference in New Issue
Block a user