This commit is contained in:
@@ -261,8 +261,8 @@ export default {
|
||||
fatal: false, //fatal error, further save is pointless, bail early and report
|
||||
errors: null //contains error objects from save
|
||||
},
|
||||
lastGetContractId: null,
|
||||
lastGetCustomerId: null
|
||||
lastGetContractId: -1, //note: -1 so that a new record updates
|
||||
lastGetCustomerId: -1
|
||||
};
|
||||
},
|
||||
//WATCHERS
|
||||
@@ -411,24 +411,24 @@ 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}set-contract/${this.obj.id}`,
|
||||
{ newContractId: this.obj.contractId }
|
||||
);
|
||||
if (res.error) {
|
||||
this.formState.serverError = res.error;
|
||||
window.$gz.form.setErrorBoxErrors(this);
|
||||
} else {
|
||||
this.obj = res.data;
|
||||
window.$gz.form.setFormState({
|
||||
vm: this,
|
||||
dirty: false,
|
||||
valid: true
|
||||
});
|
||||
}
|
||||
},
|
||||
// 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}set-contract/${this.obj.id}`,
|
||||
// { newContractId: this.obj.contractId }
|
||||
// );
|
||||
// if (res.error) {
|
||||
// this.formState.serverError = res.error;
|
||||
// window.$gz.form.setErrorBoxErrors(this);
|
||||
// } else {
|
||||
// this.obj = res.data;
|
||||
// window.$gz.form.setFormState({
|
||||
// vm: this,
|
||||
// dirty: false,
|
||||
// valid: true
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
async submit() {
|
||||
const vm = this;
|
||||
if (vm.canSave == false) {
|
||||
@@ -521,8 +521,8 @@ export default {
|
||||
this.$router.push({
|
||||
name: "workorder-edit",
|
||||
params: {
|
||||
recordid: vm.obj.id,
|
||||
obj: vm.obj // Pass data object to new form
|
||||
recordid: vm.obj.id
|
||||
// ,obj: vm.obj // Pass data object to new form
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user