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