This commit is contained in:
@@ -365,21 +365,13 @@ todo: many biz objects are not using new PUT methodology
|
|||||||
CURRENTLY DOING: workorder round two electric boogaloo
|
CURRENTLY DOING: workorder round two electric boogaloo
|
||||||
basics first then increasingly esoteric features
|
basics first then increasingly esoteric features
|
||||||
|
|
||||||
currently: request button implementations
|
|
||||||
make the button actually do the work
|
|
||||||
trigger a route that adds a request and then insert it into the object tree so it appears
|
|
||||||
maybe though it's done from the parts form but signals to the svc-workorder header to do the actual work??
|
|
||||||
or maybe better in the part form as a separation of concerns issue and part does have access to the full object so can
|
|
||||||
easily insert it into the tree!!!!!!
|
|
||||||
handle the case where the inventory changes after error but before click
|
|
||||||
both ways: has enough all of a sudden or has even less all of a sudden
|
|
||||||
|
|
||||||
Biggies
|
Biggies
|
||||||
todo 3: actual inventory
|
|
||||||
1961 / 3752- auto remove from inventory immediately when wo saved and re-instate if changed
|
ODDS / ENDS
|
||||||
see PO back end for example of exactly this
|
replicate new viz strip code to all children save like parts does now
|
||||||
SEEDER
|
|
||||||
make sure generated inventory and workorders are going to work with enough quantity etc
|
INVENTORY
|
||||||
|
|
||||||
todo: No inventory setting *IMPORTANT* must test with inventory turned off for this and for PO system as well or whatever is necessary
|
todo: No inventory setting *IMPORTANT* must test with inventory turned off for this and for PO system as well or whatever is necessary
|
||||||
make it work like v7
|
make it work like v7
|
||||||
NOTE: In v7 selecting serial copied to description field for some reason, but v8 has dedicated serial field so this is probably an import issue i.e. make sure import copies serials to serials
|
NOTE: In v7 selecting serial copied to description field for some reason, but v8 has dedicated serial field so this is probably an import issue i.e. make sure import copies serials to serials
|
||||||
@@ -387,11 +379,7 @@ todo: No inventory setting *IMPORTANT* must test with inventory turned off for t
|
|||||||
NEED:
|
NEED:
|
||||||
on WO must hide all serial number selection elements if useinventory is off
|
on WO must hide all serial number selection elements if useinventory is off
|
||||||
but it seems reasonable to leave the field to just hand enter them in if desired
|
but it seems reasonable to leave the field to just hand enter them in if desired
|
||||||
WO part selection: if useinventory then must run CheckIfEnoughInventory and offer to request or set to zero
|
|
||||||
in v7 when useinventory=true you cannot enter a quantity that is more than is in stock, you either initiate a request or it sets it to zero and won't allow any other value
|
|
||||||
so this must be replicated in v8 exactly and dynamically, not from server itself, but server must still check at last moment of save and return error if unavailable
|
|
||||||
See v7 project workorderform.cs line 8878 for the code in question
|
|
||||||
Proper error messages that are localized and must display correctly in UI at the source of the woitempart error
|
|
||||||
|
|
||||||
todo: workorder save method is using a shallow clone by reference for each object NOT a copy as intended which is killing the error system as UID is being wiped
|
todo: workorder save method is using a shallow clone by reference for each object NOT a copy as intended which is killing the error system as UID is being wiped
|
||||||
See Part save for a clone method using json parse and stringify, but maybe that's shit and need something better
|
See Part save for a clone method using json parse and stringify, but maybe that's shit and need something better
|
||||||
|
|||||||
@@ -379,12 +379,11 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
doRequest() {
|
doRequest() {
|
||||||
//todo: remove the requestAmountViz and error on edit of partid, warehouse or quantity to prevent ordering the wrong part here if they click on the button after editing those things
|
|
||||||
|
|
||||||
const requestQuantity = this.value.items[this.activeWoItemIndex].parts[
|
const requestQuantity = this.value.items[this.activeWoItemIndex].parts[
|
||||||
this.activeItemIndex
|
this.activeItemIndex
|
||||||
].requestAmountViz;
|
].requestAmountViz; //set in svc-workorder.vue on save of part with insufficient qty
|
||||||
if (requestQuantity != null && requestQuantity > 0) {
|
if (requestQuantity != null && requestQuantity > 0) {
|
||||||
|
//Get names for UI for request record so user knows it's the right one
|
||||||
let selectedPartWarehouse = this.$refs[
|
let selectedPartWarehouse = this.$refs[
|
||||||
`Items[${this.activeWoItemIndex}].parts[${this.activeItemIndex}].partWarehouseId`
|
`Items[${this.activeWoItemIndex}].parts[${this.activeItemIndex}].partWarehouseId`
|
||||||
].getFullSelectionValue();
|
].getFullSelectionValue();
|
||||||
@@ -402,14 +401,14 @@ export default {
|
|||||||
selectedPart = selectedPart.name;
|
selectedPart = selectedPart.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
//change the partquantity
|
//change the part quantity to the balance in stock
|
||||||
this.value.items[this.activeWoItemIndex].parts[
|
this.value.items[this.activeWoItemIndex].parts[
|
||||||
this.activeItemIndex
|
this.activeItemIndex
|
||||||
].quantity =
|
].quantity =
|
||||||
this.value.items[this.activeWoItemIndex].parts[this.activeItemIndex]
|
this.value.items[this.activeWoItemIndex].parts[this.activeItemIndex]
|
||||||
.quantity - requestQuantity;
|
.quantity - requestQuantity;
|
||||||
//add a request record
|
|
||||||
|
|
||||||
|
//add a request record
|
||||||
this.value.items[this.activeWoItemIndex].partRequests.push({
|
this.value.items[this.activeWoItemIndex].partRequests.push({
|
||||||
id: 0,
|
id: 0,
|
||||||
concurrency: 0,
|
concurrency: 0,
|
||||||
@@ -426,6 +425,7 @@ export default {
|
|||||||
workOrderItemId: this.value.items[this.activeWoItemIndex].id,
|
workOrderItemId: this.value.items[this.activeWoItemIndex].id,
|
||||||
uid: Date.now() //used for error tracking / display
|
uid: Date.now() //used for error tracking / display
|
||||||
});
|
});
|
||||||
|
|
||||||
this.$emit("change");
|
this.$emit("change");
|
||||||
|
|
||||||
//clear the error but leave dirty and let user save it
|
//clear the error but leave dirty and let user save it
|
||||||
|
|||||||
@@ -920,19 +920,18 @@ async function saveUnits(vm, woItemIndex) {
|
|||||||
|
|
||||||
for (let i = 0; i < vm.obj.items[woItemIndex].units.length; i++) {
|
for (let i = 0; i < vm.obj.items[woItemIndex].units.length; i++) {
|
||||||
if (vm.obj.items[woItemIndex].units[i].isDirty) {
|
if (vm.obj.items[woItemIndex].units[i].isDirty) {
|
||||||
const o = vm.obj.items[woItemIndex].units[i];
|
//clone and skip viz and other fields
|
||||||
const uid = o.uid;
|
const o = window.$gz.util.deepCopySkip(
|
||||||
//strip out viz fields before sending
|
vm.obj.items[woItemIndex].units[i],
|
||||||
o.isDirty = undefined;
|
["uid", "isDirty"]
|
||||||
o.uid = undefined;
|
);
|
||||||
o.unitViz = undefined;
|
|
||||||
let res = await window.$gz.api.upsert(`${API_BASE_URL}items/units`, o);
|
let res = await window.$gz.api.upsert(`${API_BASE_URL}items/units`, o);
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
handleSaveError(vm, {
|
handleSaveError(vm, {
|
||||||
error: res.error,
|
error: res.error,
|
||||||
itemUid: vm.obj.items[woItemIndex].uid,
|
itemUid: vm.obj.items[woItemIndex].uid,
|
||||||
childKey: "units",
|
childKey: "units",
|
||||||
childUid: uid
|
childUid: vm.obj.items[woItemIndex].units[i].uid
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
||||||
@@ -956,13 +955,12 @@ async function saveScheduledUsers(vm, woItemIndex) {
|
|||||||
|
|
||||||
for (let i = 0; i < vm.obj.items[woItemIndex].scheduledUsers.length; i++) {
|
for (let i = 0; i < vm.obj.items[woItemIndex].scheduledUsers.length; i++) {
|
||||||
if (vm.obj.items[woItemIndex].scheduledUsers[i].isDirty) {
|
if (vm.obj.items[woItemIndex].scheduledUsers[i].isDirty) {
|
||||||
const o = vm.obj.items[woItemIndex].scheduledUsers[i];
|
//clone and skip viz and other fields
|
||||||
const uid = o.uid;
|
const o = window.$gz.util.deepCopySkip(
|
||||||
//strip out viz fields before sending
|
vm.obj.items[woItemIndex].scheduledUsers[i],
|
||||||
o.isDirty = undefined;
|
["uid", "isDirty"]
|
||||||
o.uid = undefined;
|
);
|
||||||
o.serviceRateViz = undefined;
|
|
||||||
o.userViz = undefined;
|
|
||||||
const res = await window.$gz.api.upsert(
|
const res = await window.$gz.api.upsert(
|
||||||
`${API_BASE_URL}items/scheduled-users`,
|
`${API_BASE_URL}items/scheduled-users`,
|
||||||
o
|
o
|
||||||
@@ -972,7 +970,7 @@ async function saveScheduledUsers(vm, woItemIndex) {
|
|||||||
error: res.error,
|
error: res.error,
|
||||||
itemUid: vm.obj.items[woItemIndex].uid,
|
itemUid: vm.obj.items[woItemIndex].uid,
|
||||||
childKey: "scheduledUsers",
|
childKey: "scheduledUsers",
|
||||||
childUid: uid
|
childUid: vm.obj.items[woItemIndex].scheduledUsers[i].uid
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
||||||
@@ -1028,13 +1026,11 @@ async function saveTasks(vm, woItemIndex) {
|
|||||||
|
|
||||||
for (let i = 0; i < vm.obj.items[woItemIndex].tasks.length; i++) {
|
for (let i = 0; i < vm.obj.items[woItemIndex].tasks.length; i++) {
|
||||||
if (vm.obj.items[woItemIndex].tasks[i].isDirty) {
|
if (vm.obj.items[woItemIndex].tasks[i].isDirty) {
|
||||||
const o = vm.obj.items[woItemIndex].tasks[i];
|
//clone and skip viz and other fields
|
||||||
const uid = o.uid;
|
const o = window.$gz.util.deepCopySkip(
|
||||||
//strip out viz fields before sending
|
vm.obj.items[woItemIndex].tasks[i],
|
||||||
o.isDirty = undefined;
|
["uid", "isDirty"]
|
||||||
o.uid = undefined;
|
);
|
||||||
o.statusViz = undefined;
|
|
||||||
o.completedByUserViz = undefined;
|
|
||||||
|
|
||||||
const res = await window.$gz.api.upsert(`${API_BASE_URL}items/tasks`, o);
|
const res = await window.$gz.api.upsert(`${API_BASE_URL}items/tasks`, o);
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
@@ -1042,7 +1038,7 @@ async function saveTasks(vm, woItemIndex) {
|
|||||||
error: res.error,
|
error: res.error,
|
||||||
itemUid: vm.obj.items[woItemIndex].uid,
|
itemUid: vm.obj.items[woItemIndex].uid,
|
||||||
childKey: "tasks",
|
childKey: "tasks",
|
||||||
childUid: uid
|
childUid: vm.obj.items[woItemIndex].tasks[i].uid
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
||||||
@@ -1124,11 +1120,10 @@ async function saveParts(vm, woItemIndex) {
|
|||||||
for (let i = 0; i < vm.obj.items[woItemIndex].parts.length; i++) {
|
for (let i = 0; i < vm.obj.items[woItemIndex].parts.length; i++) {
|
||||||
if (vm.obj.items[woItemIndex].parts[i].isDirty) {
|
if (vm.obj.items[woItemIndex].parts[i].isDirty) {
|
||||||
//clone and skip viz and other fields
|
//clone and skip viz and other fields
|
||||||
let o = window.$gz.util.deepCopySkip(vm.obj.items[woItemIndex].parts[i], [
|
const o = window.$gz.util.deepCopySkip(
|
||||||
"uid",
|
vm.obj.items[woItemIndex].parts[i],
|
||||||
"cost",
|
["uid", "cost", "listPrice", "isDirty"]
|
||||||
"listPrice"
|
);
|
||||||
]);
|
|
||||||
|
|
||||||
const res = await window.$gz.api.upsert(`${API_BASE_URL}items/parts`, o);
|
const res = await window.$gz.api.upsert(`${API_BASE_URL}items/parts`, o);
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
@@ -1202,19 +1197,12 @@ async function savePartRequests(vm, woItemIndex) {
|
|||||||
|
|
||||||
for (let i = 0; i < vm.obj.items[woItemIndex].partRequests.length; i++) {
|
for (let i = 0; i < vm.obj.items[woItemIndex].partRequests.length; i++) {
|
||||||
if (vm.obj.items[woItemIndex].partRequests[i].isDirty) {
|
if (vm.obj.items[woItemIndex].partRequests[i].isDirty) {
|
||||||
const o = vm.obj.items[woItemIndex].partRequests[i];
|
//clone and skip viz and other fields
|
||||||
const uid = o.uid;
|
const o = window.$gz.util.deepCopySkip(
|
||||||
//strip out viz fields before sending
|
vm.obj.items[woItemIndex].partRequests[i],
|
||||||
o.isDirty = undefined;
|
["uid", "isDirty"]
|
||||||
o.uid = undefined;
|
);
|
||||||
o.partViz = undefined;
|
|
||||||
o.upcViz = undefined;
|
|
||||||
o.partWarehouseViz = undefined;
|
|
||||||
o.purchaseOrderViz = undefined;
|
|
||||||
o.purchaseOrderIdViz = undefined;
|
|
||||||
o.purchaseOrderDateViz = undefined;
|
|
||||||
o.purchaseOrderExpectedDateViz = undefined;
|
|
||||||
o.purchaseOrderOnOrderViz = undefined;
|
|
||||||
const res = await window.$gz.api.upsert(
|
const res = await window.$gz.api.upsert(
|
||||||
`${API_BASE_URL}items/part-requests`,
|
`${API_BASE_URL}items/part-requests`,
|
||||||
o
|
o
|
||||||
@@ -1224,7 +1212,7 @@ async function savePartRequests(vm, woItemIndex) {
|
|||||||
error: res.error,
|
error: res.error,
|
||||||
itemUid: vm.obj.items[woItemIndex].uid,
|
itemUid: vm.obj.items[woItemIndex].uid,
|
||||||
childKey: "partRequests",
|
childKey: "partRequests",
|
||||||
childUid: uid
|
childUid: vm.obj.items[woItemIndex].partRequests[i].uid
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
||||||
@@ -1248,22 +1236,11 @@ async function saveLabors(vm, woItemIndex) {
|
|||||||
|
|
||||||
for (let i = 0; i < vm.obj.items[woItemIndex].labors.length; i++) {
|
for (let i = 0; i < vm.obj.items[woItemIndex].labors.length; i++) {
|
||||||
if (vm.obj.items[woItemIndex].labors[i].isDirty) {
|
if (vm.obj.items[woItemIndex].labors[i].isDirty) {
|
||||||
const o = vm.obj.items[woItemIndex].labors[i];
|
//clone and skip viz and other fields
|
||||||
const uid = o.uid;
|
const o = window.$gz.util.deepCopySkip(
|
||||||
//strip out viz fields before sending
|
vm.obj.items[woItemIndex].labors[i],
|
||||||
o.isDirty = undefined;
|
["uid", "isDirty"]
|
||||||
o.uid = undefined;
|
);
|
||||||
o.userViz = undefined;
|
|
||||||
o.serviceRateViz = undefined;
|
|
||||||
o.taxCodeSaleViz = undefined;
|
|
||||||
o.costViz = undefined;
|
|
||||||
o.listPriceViz = undefined;
|
|
||||||
o.unitOfMeasureViz = undefined;
|
|
||||||
o.priceViz = undefined;
|
|
||||||
o.netViz = undefined;
|
|
||||||
o.taxAViz = undefined;
|
|
||||||
o.taxBViz = undefined;
|
|
||||||
o.lineTotalViz = undefined;
|
|
||||||
|
|
||||||
const res = await window.$gz.api.upsert(`${API_BASE_URL}items/labors`, o);
|
const res = await window.$gz.api.upsert(`${API_BASE_URL}items/labors`, o);
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
@@ -1271,7 +1248,7 @@ async function saveLabors(vm, woItemIndex) {
|
|||||||
error: res.error,
|
error: res.error,
|
||||||
itemUid: vm.obj.items[woItemIndex].uid,
|
itemUid: vm.obj.items[woItemIndex].uid,
|
||||||
childKey: "labors",
|
childKey: "labors",
|
||||||
childUid: uid
|
childUid: vm.obj.items[woItemIndex].labors[i].uid
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
||||||
@@ -1323,22 +1300,11 @@ async function saveTravels(vm, woItemIndex) {
|
|||||||
|
|
||||||
for (let i = 0; i < vm.obj.items[woItemIndex].travels.length; i++) {
|
for (let i = 0; i < vm.obj.items[woItemIndex].travels.length; i++) {
|
||||||
if (vm.obj.items[woItemIndex].travels[i].isDirty) {
|
if (vm.obj.items[woItemIndex].travels[i].isDirty) {
|
||||||
const o = vm.obj.items[woItemIndex].travels[i];
|
//clone and skip viz and other fields
|
||||||
const uid = o.uid;
|
const o = window.$gz.util.deepCopySkip(
|
||||||
//strip out viz fields before sending
|
vm.obj.items[woItemIndex].travels[i],
|
||||||
o.isDirty = undefined;
|
["uid", "isDirty"]
|
||||||
o.uid = undefined;
|
);
|
||||||
o.userViz = undefined;
|
|
||||||
o.travelRateViz = undefined;
|
|
||||||
o.taxCodeSaleViz = undefined;
|
|
||||||
o.costViz = undefined;
|
|
||||||
o.listPriceViz = undefined;
|
|
||||||
o.unitOfMeasureViz = undefined;
|
|
||||||
o.priceViz = undefined;
|
|
||||||
o.netViz = undefined;
|
|
||||||
o.taxAViz = undefined;
|
|
||||||
o.taxBViz = undefined;
|
|
||||||
o.lineTotalViz = undefined;
|
|
||||||
|
|
||||||
const res = await window.$gz.api.upsert(
|
const res = await window.$gz.api.upsert(
|
||||||
`${API_BASE_URL}items/travels`,
|
`${API_BASE_URL}items/travels`,
|
||||||
@@ -1349,7 +1315,7 @@ async function saveTravels(vm, woItemIndex) {
|
|||||||
error: res.error,
|
error: res.error,
|
||||||
itemUid: vm.obj.items[woItemIndex].uid,
|
itemUid: vm.obj.items[woItemIndex].uid,
|
||||||
childKey: "travels",
|
childKey: "travels",
|
||||||
childUid: uid
|
childUid: vm.obj.items[woItemIndex].travels[i].uid
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
||||||
@@ -1430,16 +1396,11 @@ async function saveExpenses(vm, woItemIndex) {
|
|||||||
|
|
||||||
for (let i = 0; i < vm.obj.items[woItemIndex].expenses.length; i++) {
|
for (let i = 0; i < vm.obj.items[woItemIndex].expenses.length; i++) {
|
||||||
if (vm.obj.items[woItemIndex].expenses[i].isDirty) {
|
if (vm.obj.items[woItemIndex].expenses[i].isDirty) {
|
||||||
const o = vm.obj.items[woItemIndex].expenses[i];
|
//clone and skip viz and other fields
|
||||||
const uid = o.uid;
|
const o = window.$gz.util.deepCopySkip(
|
||||||
//strip out viz fields before sending
|
vm.obj.items[woItemIndex].expenses[i],
|
||||||
o.isDirty = undefined;
|
["uid", "isDirty"]
|
||||||
o.uid = undefined;
|
);
|
||||||
o.chargeTaxCodeViz = undefined;
|
|
||||||
o.userViz = undefined;
|
|
||||||
o.taxAViz = undefined;
|
|
||||||
o.taxBViz = undefined;
|
|
||||||
o.lineTotalViz = undefined;
|
|
||||||
|
|
||||||
const res = await window.$gz.api.upsert(
|
const res = await window.$gz.api.upsert(
|
||||||
`${API_BASE_URL}items/expenses`,
|
`${API_BASE_URL}items/expenses`,
|
||||||
@@ -1450,7 +1411,7 @@ async function saveExpenses(vm, woItemIndex) {
|
|||||||
error: res.error,
|
error: res.error,
|
||||||
itemUid: vm.obj.items[woItemIndex].uid,
|
itemUid: vm.obj.items[woItemIndex].uid,
|
||||||
childKey: "expenses",
|
childKey: "expenses",
|
||||||
childUid: uid
|
childUid: vm.obj.items[woItemIndex].scheduledUsers[i].uid
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
||||||
@@ -1503,27 +1464,18 @@ async function saveLoans(vm, woItemIndex) {
|
|||||||
|
|
||||||
for (let i = 0; i < vm.obj.items[woItemIndex].loans.length; i++) {
|
for (let i = 0; i < vm.obj.items[woItemIndex].loans.length; i++) {
|
||||||
if (vm.obj.items[woItemIndex].loans[i].isDirty) {
|
if (vm.obj.items[woItemIndex].loans[i].isDirty) {
|
||||||
const o = vm.obj.items[woItemIndex].loans[i];
|
//clone and skip viz and other fields
|
||||||
const uid = o.uid;
|
const o = window.$gz.util.deepCopySkip(
|
||||||
//strip out viz fields before sending
|
vm.obj.items[woItemIndex].loans[i],
|
||||||
o.isDirty = undefined;
|
["uid", "isDirty"]
|
||||||
o.uid = undefined;
|
);
|
||||||
o.taxCodeViz = undefined;
|
|
||||||
o.loanUnitViz = undefined;
|
|
||||||
o.unitOfMeasureViz = undefined;
|
|
||||||
o.priceViz = undefined;
|
|
||||||
o.netViz = undefined;
|
|
||||||
o.taxAViz = undefined;
|
|
||||||
o.taxBViz = undefined;
|
|
||||||
o.lineTotalViz = undefined;
|
|
||||||
|
|
||||||
const res = await window.$gz.api.upsert(`${API_BASE_URL}items/loans`, o);
|
const res = await window.$gz.api.upsert(`${API_BASE_URL}items/loans`, o);
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
handleSaveError(vm, {
|
handleSaveError(vm, {
|
||||||
error: res.error,
|
error: res.error,
|
||||||
itemUid: vm.obj.items[woItemIndex].uid,
|
itemUid: vm.obj.items[woItemIndex].uid,
|
||||||
childKey: "loans",
|
childKey: "loans",
|
||||||
childUid: uid
|
childUid: vm.obj.items[woItemIndex].loans[i].uid
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
||||||
@@ -1579,21 +1531,11 @@ async function saveOutsideServices(vm, woItemIndex) {
|
|||||||
|
|
||||||
for (let i = 0; i < vm.obj.items[woItemIndex].outsideServices.length; i++) {
|
for (let i = 0; i < vm.obj.items[woItemIndex].outsideServices.length; i++) {
|
||||||
if (vm.obj.items[woItemIndex].outsideServices[i].isDirty) {
|
if (vm.obj.items[woItemIndex].outsideServices[i].isDirty) {
|
||||||
const o = vm.obj.items[woItemIndex].outsideServices[i];
|
//clone and skip viz and other fields
|
||||||
const uid = o.uid;
|
const o = window.$gz.util.deepCopySkip(
|
||||||
//strip out viz fields before sending
|
vm.obj.items[woItemIndex].outsideServices[i],
|
||||||
o.isDirty = undefined;
|
["uid", "isDirty"]
|
||||||
o.uid = undefined;
|
);
|
||||||
o.unitViz = undefined;
|
|
||||||
o.vendorSentToViz = undefined;
|
|
||||||
o.vendorSentViaViz = undefined;
|
|
||||||
o.taxCodeViz = undefined;
|
|
||||||
o.costViz = undefined;
|
|
||||||
o.priceViz = undefined;
|
|
||||||
o.netViz = undefined;
|
|
||||||
o.taxAViz = undefined;
|
|
||||||
o.taxBViz = undefined;
|
|
||||||
o.lineTotalViz = undefined;
|
|
||||||
|
|
||||||
const res = await window.$gz.api.upsert(
|
const res = await window.$gz.api.upsert(
|
||||||
`${API_BASE_URL}items/outside-services`,
|
`${API_BASE_URL}items/outside-services`,
|
||||||
@@ -1604,7 +1546,7 @@ async function saveOutsideServices(vm, woItemIndex) {
|
|||||||
error: res.error,
|
error: res.error,
|
||||||
itemUid: vm.obj.items[woItemIndex].uid,
|
itemUid: vm.obj.items[woItemIndex].uid,
|
||||||
childKey: "outsideServices",
|
childKey: "outsideServices",
|
||||||
childUid: uid
|
childUid: vm.obj.items[woItemIndex].outsideServices[i].uid
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
||||||
|
|||||||
Reference in New Issue
Block a user