This commit is contained in:
2021-05-14 23:11:25 +00:00
parent da9a62931d
commit a15f0e9087
2 changed files with 14 additions and 1 deletions

View File

@@ -107,7 +107,7 @@ export default {
});
},
async save() {
await this.pvm.submit();
await this.pvm.submitNewContract();
this.openDialog = false;
},
cancelDialog() {

View File

@@ -407,6 +407,19 @@ export default {
});
}
},
async submitNewContract() {
//save new contract route, this only ever gets called from a clean wo with no dirty edits so just save the contract and reset the wo from the result
let res = await window.$gz.api.post(
`${API_BASE_URL}contract`,
this.obj.contractId
);
if (res.error) {
this.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(this);
} else {
this.obj = res.data;
}
},
async submit() {
const vm = this;
if (vm.canSave == false) {