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> <template>
<div class="mb-6 mb-sm-0"> <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-icon>$ayiEdit</v-icon>
</v-btn> </v-btn>
@@ -56,7 +56,9 @@
export default { export default {
data() { data() {
return { return {
openDialog: false openDialog: false,
contractIdAtStart: null,
contractNameAtStart: null
}; };
}, },
@@ -76,9 +78,14 @@ export default {
}, },
methods: { methods: {
initAndOpen() {
this.contractIdAtStart = this.value.contractId;
this.contractNameAtStart = this.value.contractViz;
this.openDialog = true;
},
contractChange(newName) { contractChange(newName) {
this.value.contractViz = newName; this.value.contractViz = newName;
this.pvm.formState.dirty = true; // this.pvm.formState.dirty = true;
}, },
form() { form() {
return window.$gz.form; return window.$gz.form;
@@ -90,16 +97,19 @@ export default {
id: this.value.contractId id: this.value.contractId
}); });
}, },
save() { async save() {
//TODO: save entire workorder await this.pvm.submit();
this.pvm.submit();
this.openDialog = false; this.openDialog = false;
}, },
cancelDialog() { 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; this.openDialog = false;
}, },
fieldValueChanged(ref) { fieldValueChanged(ref) {
if (!this.pvm.formState.loading && !this.pvm.formState.readonly) { if (!this.pvm.formState.loading && !this.pvm.formState.readonly) {
this.value.isDirty = true;
window.$gz.form.fieldValueChanged(this.pvm, ref); window.$gz.form.fieldValueChanged(this.pvm, ref);
} }
} }

View File

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