This commit is contained in:
@@ -402,10 +402,16 @@ export default {
|
||||
name: "workorder-edit",
|
||||
params: {
|
||||
recordid: 0,
|
||||
createNew: {
|
||||
createType: atype,
|
||||
start: newEvent.start,
|
||||
end: newEvent.end,
|
||||
add: {
|
||||
type: atype,
|
||||
start: window.$gz.locale.localScheduleFormatToUTC8601String(
|
||||
newEvent.start,
|
||||
this.timeZoneName
|
||||
),
|
||||
end: window.$gz.locale.localScheduleFormatToUTC8601String(
|
||||
newEvent.end,
|
||||
this.timeZoneName
|
||||
),
|
||||
userId: this.$store.state.userId,
|
||||
name: this.$store.state.userName
|
||||
}
|
||||
|
||||
@@ -139,10 +139,70 @@ export default {
|
||||
});
|
||||
setDirty = true;
|
||||
} else {
|
||||
//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)
|
||||
console.log(
|
||||
"svc-workorder::created new, no obj, params are:",
|
||||
this.$route.params
|
||||
);
|
||||
|
||||
if (this.$route.params.add) {
|
||||
//todo: REFACTOR this is a temporary abomination, new items should be standardized somewhere else in one location
|
||||
const n = this.$route.params.add;
|
||||
switch (n.type) {
|
||||
case this.$ay.ayt().WorkOrderItemScheduledUser:
|
||||
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,
|
||||
fromCSRId: 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: [],
|
||||
scheduledUsers: [
|
||||
{
|
||||
id: 0,
|
||||
concurrency: 0,
|
||||
userId: n.userId,
|
||||
estimatedQuantity: window.$gz.locale.diffHoursFromUTC8601String(
|
||||
n.start,
|
||||
n.end
|
||||
),
|
||||
startDate: n.start,
|
||||
stopDate: n.end,
|
||||
serviceRateId: null,
|
||||
isDirty: true,
|
||||
workOrderItemId: 0,
|
||||
uid: Date.now(),
|
||||
userViz: n.name,
|
||||
serviceRateViz: null
|
||||
}
|
||||
],
|
||||
tasks: [],
|
||||
travels: [],
|
||||
units: [],
|
||||
outsideServices: [],
|
||||
uid: Date.now() //used for error tracking / display
|
||||
});
|
||||
|
||||
break;
|
||||
default:
|
||||
console.log("UNKNOWN TYPE", n.type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//NEW
|
||||
this.formState.loading = false;
|
||||
this.formState.ready = true;
|
||||
|
||||
Reference in New Issue
Block a user