This commit is contained in:
@@ -655,16 +655,19 @@ async function saveHeader(vm) {
|
||||
if (!vm.obj.isDirty) {
|
||||
return true;
|
||||
}
|
||||
let isPost = o.id == 0;
|
||||
let res = await window.$gz.api.upsert(`${API_BASE_URL}`, o);
|
||||
if (res.error) {
|
||||
displayResError(vm, res);
|
||||
return false;
|
||||
} else {
|
||||
//update any server changed fields
|
||||
vm.obj.concurrency = res.concurrency;
|
||||
vm.obj.id = res.id;
|
||||
vm.obj.serial = res.serial;
|
||||
vm.obj.concurrency = res.data.concurrency;
|
||||
vm.obj.isDirty = false;
|
||||
if (isPost) {
|
||||
vm.obj.id = res.data.id;
|
||||
vm.obj.serial = res.data.serial;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -705,13 +708,13 @@ async function saveItems(vm) {
|
||||
} else {
|
||||
//update any server changed fields
|
||||
//put fields
|
||||
o.concurrency = res.concurrency;
|
||||
o.concurrency = res.data.concurrency;
|
||||
o.isDirty = false;
|
||||
|
||||
//fields to update if post
|
||||
if (isPost) {
|
||||
o.id = res.id;
|
||||
o.workorderId = res.workorderId;
|
||||
o.id = res.data.id;
|
||||
o.workorderId = res.data.workorderId;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -755,13 +758,13 @@ async function saveScheduledUsers(vm, woitemindex) {
|
||||
} else {
|
||||
//update any server changed fields
|
||||
//always updated:
|
||||
o.concurrency = res.concurrency;
|
||||
o.concurrency = res.data.concurrency;
|
||||
o.isDirty = false;
|
||||
|
||||
//new records only...
|
||||
if (isPost) {
|
||||
o.id = res.id;
|
||||
o.workOrderItemId = res.workOrderItemId;
|
||||
o.id = res.data.id;
|
||||
o.workOrderItemId = res.data.workOrderItemId;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user