This commit is contained in:
2020-12-30 17:20:03 +00:00
parent 07ff575ad0
commit c5a0f6baa6
4 changed files with 27 additions and 165 deletions

View File

@@ -312,7 +312,7 @@
:error-messages="form().serverErrors(this, 'usesBanking')"
@change="fieldValueChanged('usesBanking')"
>
<template v-slot:append>
<template v-slot:append v-if="canOpenServiceBank()">
<v-btn
outlined
small
@@ -320,7 +320,7 @@
@click="openServiceBank"
class="ml-12"
>
<v-icon>{{ serviceBankIcon() }}</v-icon></v-btn
<v-icon>$ayiCarBattery</v-icon></v-btn
>
</template>
</v-checkbox>
@@ -927,24 +927,19 @@ export default {
}
},
methods: {
serviceBankIcon: function() {
if (this.obj.usesBanking != true || this.$route.params.recordid == 0) {
return null;
}
return "$ayiCarBattery";
canOpenServiceBank: function() {
return this.obj.usesBanking == true && this.$route.params.recordid != 0;
},
openServiceBank: function() {
if (this.obj.usesBanking != true || this.$route.params.recordid == 0) {
return null;
if (this.canOpenServiceBank()) {
this.$router.push({
name: "service-banks",
params: {
objectType: window.$gz.type.Customer,
objectId: this.$route.params.recordid
}
});
}
this.$router.push({
name: "service-banks",
params: {
objectType: window.$gz.type.Customer,
objectId: this.$route.params.recordid
}
});
},
canSave: function() {
return this.formState.valid && this.formState.dirty;