This commit is contained in:
@@ -107,7 +107,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
async save() {
|
async save() {
|
||||||
await this.pvm.submit();
|
await this.pvm.submitNewContract();
|
||||||
this.openDialog = false;
|
this.openDialog = false;
|
||||||
},
|
},
|
||||||
cancelDialog() {
|
cancelDialog() {
|
||||||
|
|||||||
@@ -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() {
|
async submit() {
|
||||||
const vm = this;
|
const vm = this;
|
||||||
if (vm.canSave == false) {
|
if (vm.canSave == false) {
|
||||||
|
|||||||
Reference in New Issue
Block a user