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