This commit is contained in:
2021-05-12 22:15:05 +00:00
parent bfeb102ec2
commit ee1f203aa7
2 changed files with 17 additions and 6 deletions

View File

@@ -6,7 +6,7 @@
<template>
<div class="mb-6 mb-sm-0">
<v-btn icon class="ml-n1 mr-2" @click="openDialog = true">
<v-btn icon class="ml-n1 mr-2" @click="initAndOpen()">
<v-icon>$ayiEdit</v-icon>
</v-btn>
@@ -56,7 +56,9 @@
export default {
data() {
return {
openDialog: false
openDialog: false,
contractIdAtStart: null,
contractNameAtStart: null
};
},
@@ -76,9 +78,14 @@ export default {
},
methods: {
initAndOpen() {
this.contractIdAtStart = this.value.contractId;
this.contractNameAtStart = this.value.contractViz;
this.openDialog = true;
},
contractChange(newName) {
this.value.contractViz = newName;
this.pvm.formState.dirty = true;
// this.pvm.formState.dirty = true;
},
form() {
return window.$gz.form;
@@ -90,16 +97,19 @@ export default {
id: this.value.contractId
});
},
save() {
//TODO: save entire workorder
this.pvm.submit();
async save() {
await this.pvm.submit();
this.openDialog = false;
},
cancelDialog() {
this.value.contractId = this.contractIdAtStart;
this.value.contractViz = this.contractNameAtStart;
this.pvm.formState.dirty = false; //this only works because you can't be here and have a dirty form to start with
this.openDialog = false;
},
fieldValueChanged(ref) {
if (!this.pvm.formState.loading && !this.pvm.formState.readonly) {
this.value.isDirty = true;
window.$gz.form.fieldValueChanged(this.pvm, ref);
}
}

View File

@@ -126,6 +126,7 @@ export default {
tags: [],
customerId: null,
projectId: null,
contractId: null,
internalReferenceNumber: null,
customerReferenceNumber: null,
customerContactName: null,