This commit is contained in:
2021-07-26 21:52:09 +00:00
parent 29cd9e8541
commit 41303e7726
13 changed files with 8426 additions and 86 deletions

View File

@@ -88,7 +88,7 @@ export default {
let wi = this.$route.params.copyItem;
if (wi) {
this.washWorkOrderItem(wi);
wi.workOrderId = vm.obj.id;
wi.quoteId = vm.obj.id;
wi.sequence = vm.obj.items.length + 1;
vm.obj.items.push(wi);
setDirty = true;
@@ -104,7 +104,7 @@ export default {
this.obj.serial = 0;
this.obj.isDirty = true;
vm.obj.items.forEach(z => {
z.workOrderId = 0;
z.quoteId = 0;
this.washWorkOrderItem(z);
});
setDirty = true;
@@ -228,8 +228,8 @@ export default {
hour12: window.$gz.locale.getHour12(),
// resetSelections: false,
selectLists: {
wostatus: [],
allowedwostatus: [],
quotestatus: [],
allowedquotestatus: [],
woItemPriorities: [],
woItemStatus: [],
woItemTaskCompletionTypes: [],
@@ -288,8 +288,8 @@ export default {
//find it in the status collection
//and return here
const laststate = this.obj.states[this.obj.states.length - 1];
const found = this.selectLists.wostatus.find(
z => z.id == laststate.workOrderStatusId
const found = this.selectLists.quotestatus.find(
z => z.id == laststate.quoteStatusId
);
if (found) {
return found;
@@ -625,19 +625,19 @@ export default {
wi.expenses.forEach(x => {
x.id = 0;
x.workOrderItemId = 0;
x.quoteItemId = 0;
x.concurrency = undefined;
x.isDirty = true;
});
wi.labors.forEach(x => {
x.id = 0;
x.workOrderItemId = 0;
x.quoteItemId = 0;
x.concurrency = undefined;
x.isDirty = true;
});
wi.loans.forEach(x => {
x.id = 0;
x.workOrderItemId = 0;
x.quoteItemId = 0;
x.concurrency = undefined;
x.isDirty = true;
x.cost = 0;
@@ -645,7 +645,7 @@ export default {
});
wi.parts.forEach(x => {
x.id = 0;
x.workOrderItemId = 0;
x.quoteItemId = 0;
x.concurrency = undefined;
x.isDirty = true;
x.cost = 0;
@@ -654,31 +654,31 @@ export default {
wi.scheduledUsers.forEach(x => {
x.id = 0;
x.workOrderItemId = 0;
x.quoteItemId = 0;
x.concurrency = undefined;
x.isDirty = true;
});
wi.tasks.forEach(x => {
x.id = 0;
x.workOrderItemId = 0;
x.quoteItemId = 0;
x.concurrency = undefined;
x.isDirty = true;
});
wi.travels.forEach(x => {
x.id = 0;
x.workOrderItemId = 0;
x.quoteItemId = 0;
x.concurrency = undefined;
x.isDirty = true;
});
wi.units.forEach(x => {
x.id = 0;
x.workOrderItemId = 0;
x.quoteItemId = 0;
x.concurrency = undefined;
x.isDirty = true;
});
wi.outsideServices.forEach(x => {
x.id = 0;
x.workOrderItemId = 0;
x.quoteItemId = 0;
x.concurrency = undefined;
x.isDirty = true;
});
@@ -732,8 +732,8 @@ async function saveHeader(vm) {
vm.obj.id = res.data.id;
vm.obj.serial = res.data.serial;
//walk all unsaved direct children and set the workorder id so they can save
vm.obj.states.forEach(z => (z.workOrderId = vm.obj.id));
vm.obj.items.forEach(z => (z.workOrderId = vm.obj.id));
vm.obj.states.forEach(z => (z.quoteId = vm.obj.id));
vm.obj.items.forEach(z => (z.quoteId = vm.obj.id));
}
}
}
@@ -1870,7 +1870,7 @@ async function fetchTranslatedText(vm) {
"WorkOrderInternalReferenceNumber",
"WorkOrderOnsite",
"NewStatus",
"WorkOrderStatus",
"QuoteQuoteStatusType",
"WorkOrderCustom1",
"WorkOrderCustom2",
"WorkOrderCustom3",
@@ -2087,8 +2087,8 @@ async function populateSelectionLists(vm) {
vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm);
} else {
vm.selectLists.wostatus = res.data.all;
vm.selectLists.allowedwostatus = res.data.allowed;
vm.selectLists.quotestatus = res.data.all;
vm.selectLists.allowedquotestatus = res.data.allowed;
}
res = await window.$gz.api.get("work-order-item-status/list");