IO-1920 Add ability to directly post tickets from tech console.
This commit is contained in:
@@ -5691,6 +5691,32 @@
|
|||||||
</concept_node>
|
</concept_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
|
<folder_node>
|
||||||
|
<name>inventory</name>
|
||||||
|
<children>
|
||||||
|
<concept_node>
|
||||||
|
<name>list</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>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
<name>jobs</name>
|
<name>jobs</name>
|
||||||
<children>
|
<children>
|
||||||
|
|||||||
@@ -11,13 +11,21 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
|
|||||||
import TechClockInComponent from "./tech-job-clock-in-form.component";
|
import TechClockInComponent from "./tech-job-clock-in-form.component";
|
||||||
import TechJobPrintTickets from "../tech-job-print-tickets/tech-job-print-tickets.component";
|
import TechJobPrintTickets from "../tech-job-print-tickets/tech-job-print-tickets.component";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
technician: selectTechnician,
|
technician: selectTechnician,
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
export function TechClockInContainer({ technician, bodyshop }) {
|
setTimeTicketContext: (context) =>
|
||||||
|
dispatch(setModalContext({ context: context, modal: "timeTicket" })),
|
||||||
|
});
|
||||||
|
export function TechClockInContainer({
|
||||||
|
setTimeTicketContext,
|
||||||
|
technician,
|
||||||
|
bodyshop,
|
||||||
|
}) {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [insertTimeTicket] = useMutation(INSERT_NEW_TIME_TICKET, {
|
const [insertTimeTicket] = useMutation(INSERT_NEW_TIME_TICKET, {
|
||||||
@@ -75,6 +83,16 @@ export function TechClockInContainer({ technician, bodyshop }) {
|
|||||||
title={t("timetickets.labels.clockintojob")}
|
title={t("timetickets.labels.clockintojob")}
|
||||||
extra={
|
extra={
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
|
<Button
|
||||||
|
onClick={() => {
|
||||||
|
setTimeTicketContext({
|
||||||
|
actions: {},
|
||||||
|
context: { timeticket: { employeeid: technician.id } },
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("timetickets.actions.enter")}
|
||||||
|
</Button>
|
||||||
<TechJobPrintTickets />
|
<TechJobPrintTickets />
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -92,4 +110,7 @@ export function TechClockInContainer({ technician, bodyshop }) {
|
|||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export default connect(mapStateToProps, null)(TechClockInContainer);
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(TechClockInContainer);
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ export function TimeTicketModalComponent({
|
|||||||
authLevel,
|
authLevel,
|
||||||
employeeAutoCompleteOptions,
|
employeeAutoCompleteOptions,
|
||||||
isEdit,
|
isEdit,
|
||||||
|
employeeSelectDisabled,
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
@@ -118,6 +119,7 @@ export function TimeTicketModalComponent({
|
|||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<EmployeeSearchSelect
|
<EmployeeSearchSelect
|
||||||
|
disabled={employeeSelectDisabled}
|
||||||
options={employeeAutoCompleteOptions}
|
options={employeeAutoCompleteOptions}
|
||||||
onSelect={(value) => {
|
onSelect={(value) => {
|
||||||
const emps =
|
const emps =
|
||||||
|
|||||||
@@ -244,6 +244,12 @@ export function TimeTicketModalContainer({
|
|||||||
employeeAutoCompleteOptions={
|
employeeAutoCompleteOptions={
|
||||||
EmployeeAutoCompleteData && EmployeeAutoCompleteData.employees
|
EmployeeAutoCompleteData && EmployeeAutoCompleteData.employees
|
||||||
}
|
}
|
||||||
|
employeeSelectDisabled={
|
||||||
|
timeTicketModal.context?.timeticket?.employeeid &&
|
||||||
|
!timeTicketModal.context.id
|
||||||
|
? true
|
||||||
|
: false
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -352,6 +352,9 @@
|
|||||||
"employees": {
|
"employees": {
|
||||||
"page": "Employees -> List"
|
"page": "Employees -> List"
|
||||||
},
|
},
|
||||||
|
"inventory": {
|
||||||
|
"list": "Inventory -> List"
|
||||||
|
},
|
||||||
"jobs": {
|
"jobs": {
|
||||||
"admin": "Jobs -> Admin",
|
"admin": "Jobs -> Admin",
|
||||||
"available-list": "Jobs -> Available List",
|
"available-list": "Jobs -> Available List",
|
||||||
|
|||||||
@@ -352,6 +352,9 @@
|
|||||||
"employees": {
|
"employees": {
|
||||||
"page": ""
|
"page": ""
|
||||||
},
|
},
|
||||||
|
"inventory": {
|
||||||
|
"list": ""
|
||||||
|
},
|
||||||
"jobs": {
|
"jobs": {
|
||||||
"admin": "",
|
"admin": "",
|
||||||
"available-list": "",
|
"available-list": "",
|
||||||
|
|||||||
@@ -352,6 +352,9 @@
|
|||||||
"employees": {
|
"employees": {
|
||||||
"page": ""
|
"page": ""
|
||||||
},
|
},
|
||||||
|
"inventory": {
|
||||||
|
"list": ""
|
||||||
|
},
|
||||||
"jobs": {
|
"jobs": {
|
||||||
"admin": "",
|
"admin": "",
|
||||||
"available-list": "",
|
"available-list": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user