case 4237
This commit is contained in:
@@ -1353,6 +1353,19 @@ async function clickHandler(menuItem) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "newwo":
|
||||||
|
m.vm.$router.push({
|
||||||
|
name: "workorder-edit",
|
||||||
|
params: {
|
||||||
|
recordid: 0,
|
||||||
|
customerId: m.vm.obj.id,
|
||||||
|
add: {
|
||||||
|
type: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
//v.next
|
//v.next
|
||||||
// case "Schedule":
|
// case "Schedule":
|
||||||
// m.vm.$router.push({
|
// m.vm.$router.push({
|
||||||
@@ -1449,6 +1462,18 @@ function generateMenu(vm) {
|
|||||||
|
|
||||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||||
|
|
||||||
|
if (
|
||||||
|
vm.$route.params.recordid != 0 &&
|
||||||
|
window.$gz.role.canChange(window.$gz.type.WorkOrder)
|
||||||
|
) {
|
||||||
|
menuOptions.menuItems.push({
|
||||||
|
title: "NewWorkOrder",
|
||||||
|
icon: "$ayiTools",
|
||||||
|
key: FORM_KEY + ":newwo",
|
||||||
|
vm: vm
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
menuOptions.menuItems.push({
|
menuOptions.menuItems.push({
|
||||||
title: "CustomerNoteList",
|
title: "CustomerNoteList",
|
||||||
icon: "$ayiClipboard",
|
icon: "$ayiClipboard",
|
||||||
@@ -1571,7 +1596,8 @@ async function fetchTranslatedText() {
|
|||||||
"LastLogin",
|
"LastLogin",
|
||||||
"CustomerNoteList",
|
"CustomerNoteList",
|
||||||
"CustomerNoteNotes",
|
"CustomerNoteNotes",
|
||||||
"CustomerNoteNoteDate"
|
"CustomerNoteNoteDate",
|
||||||
|
"NewWorkOrder"
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1207,6 +1207,19 @@ async function clickHandler(menuItem) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case "newwo":
|
||||||
|
m.vm.$router.push({
|
||||||
|
name: "workorder-edit",
|
||||||
|
params: {
|
||||||
|
recordid: 0,
|
||||||
|
customerId: m.vm.obj.customerId,
|
||||||
|
add: {
|
||||||
|
type: m.vm.$ay.ayt().WorkOrderItemUnit,
|
||||||
|
unitId: m.vm.obj.id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
window.$gz.eventBus.$emit(
|
window.$gz.eventBus.$emit(
|
||||||
"notify-warning",
|
"notify-warning",
|
||||||
@@ -1293,6 +1306,18 @@ function generateMenu(vm) {
|
|||||||
|
|
||||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||||
|
|
||||||
|
if (
|
||||||
|
vm.$route.params.recordid != 0 &&
|
||||||
|
vm.obj.customerId != 0 &&
|
||||||
|
window.$gz.role.canChange(window.$gz.type.WorkOrder)
|
||||||
|
) {
|
||||||
|
menuOptions.menuItems.push({
|
||||||
|
title: "NewWorkOrder",
|
||||||
|
icon: "$ayiTools",
|
||||||
|
key: FORM_KEY + ":newwo",
|
||||||
|
vm: vm
|
||||||
|
});
|
||||||
|
}
|
||||||
menuOptions.menuItems.push({
|
menuOptions.menuItems.push({
|
||||||
title: "UnitModels",
|
title: "UnitModels",
|
||||||
icon: "$ayiDiceD20",
|
icon: "$ayiDiceD20",
|
||||||
|
|||||||
@@ -290,8 +290,19 @@ export default {
|
|||||||
//sometimes we're here with some data to fill in (e.g. schedule creates new wo itemscheduled user, if so there will be a add property on the params)
|
//sometimes we're here with some data to fill in (e.g. schedule creates new wo itemscheduled user, if so there will be a add property on the params)
|
||||||
|
|
||||||
if (this.$route.params.add) {
|
if (this.$route.params.add) {
|
||||||
|
//case 4237
|
||||||
|
if (this.$route.params.customerId) {
|
||||||
|
//new work order with provided customer id
|
||||||
|
this.obj.customerId = Number.parseInt(
|
||||||
|
this.$route.params.customerId
|
||||||
|
);
|
||||||
|
setDirty = true;
|
||||||
|
}
|
||||||
const n = this.$route.params.add;
|
const n = this.$route.params.add;
|
||||||
switch (n.type) {
|
switch (n.type) {
|
||||||
|
case this.$ay.ayt().NoType:
|
||||||
|
//this is for cases where we want to specify a Customer for example but nothing further
|
||||||
|
break;
|
||||||
case this.$ay.ayt().WorkOrderItemScheduledUser:
|
case this.$ay.ayt().WorkOrderItemScheduledUser:
|
||||||
this.obj.items.push({
|
this.obj.items.push({
|
||||||
id: 0,
|
id: 0,
|
||||||
@@ -339,6 +350,46 @@ export default {
|
|||||||
uid: Date.now() //used for error tracking / display
|
uid: Date.now() //used for error tracking / display
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.obj.serviceDate = n.start;
|
||||||
|
break;
|
||||||
|
case this.$ay.ayt().WorkOrderItemUnit:
|
||||||
|
this.obj.items.push({
|
||||||
|
id: 0,
|
||||||
|
concurrency: 0,
|
||||||
|
notes: "-", //todo: default here at some point or just leave this TTM
|
||||||
|
wiki: null,
|
||||||
|
customFields: "{}",
|
||||||
|
tags: [],
|
||||||
|
workOrderId: null,
|
||||||
|
techNotes: null,
|
||||||
|
workOrderItemStatusId: null,
|
||||||
|
workOrderItemPriorityId: null,
|
||||||
|
requestDate: null,
|
||||||
|
warrantyService: false,
|
||||||
|
sequence: 1, //indexes are zero based but sequences are visible to user so 1 based
|
||||||
|
isDirty: true,
|
||||||
|
expenses: [],
|
||||||
|
labors: [],
|
||||||
|
loans: [],
|
||||||
|
parts: [],
|
||||||
|
partRequests: [],
|
||||||
|
units: [
|
||||||
|
{
|
||||||
|
id: 0,
|
||||||
|
concurrency: 0,
|
||||||
|
unitId: n.unitId,
|
||||||
|
isDirty: true,
|
||||||
|
workOrderItemId: 0,
|
||||||
|
uid: Date.now()
|
||||||
|
}
|
||||||
|
],
|
||||||
|
tasks: [],
|
||||||
|
travels: [],
|
||||||
|
scheduledUsers: [],
|
||||||
|
outsideServices: [],
|
||||||
|
uid: Date.now() //used for error tracking / display
|
||||||
|
});
|
||||||
|
|
||||||
this.obj.serviceDate = n.start;
|
this.obj.serviceDate = n.start;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -358,8 +409,10 @@ export default {
|
|||||||
this.formState.ready = true;
|
this.formState.ready = true;
|
||||||
//trigger rule breaking / validation
|
//trigger rule breaking / validation
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.obj.customerId = null;
|
if (!this.$route.params.customerId) {
|
||||||
this.fieldValueChanged(`customerId`);
|
this.obj.customerId = null;
|
||||||
|
this.fieldValueChanged(`customerId`);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user