diff --git a/ayanova/src/components/work-order-contract.vue b/ayanova/src/components/work-order-contract.vue index 523612fa..d9d42bd7 100644 --- a/ayanova/src/components/work-order-contract.vue +++ b/ayanova/src/components/work-order-contract.vue @@ -107,7 +107,7 @@ export default { }); }, async save() { - await this.pvm.submit(); + await this.pvm.submitNewContract(); this.openDialog = false; }, cancelDialog() { diff --git a/ayanova/src/views/svc-workorder.vue b/ayanova/src/views/svc-workorder.vue index c67e28b9..62c299f5 100644 --- a/ayanova/src/views/svc-workorder.vue +++ b/ayanova/src/views/svc-workorder.vue @@ -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) {