This commit is contained in:
2020-12-30 21:52:20 +00:00
parent ca50561f33
commit 4a7026fa95
2 changed files with 28 additions and 2 deletions

View File

@@ -37,7 +37,7 @@ todo: actual customer reports so can figure out datalist for bringing other name
CURRENTLY DOING:
ServiceBank
todo: fix wrong source column data showing
todo: replicate servicebank open code from Customer form to HO and Unit

View File

@@ -247,7 +247,19 @@
data-cy="usesBanking"
:error-messages="form().serverErrors(this, 'usesBanking')"
@change="fieldValueChanged('usesBanking')"
></v-checkbox>
>
<template v-slot:append v-if="canOpenServiceBank()">
<v-btn
outlined
small
color="primary"
@click="openServiceBank"
class="ml-12"
>
<v-icon>$ayiCarBattery</v-icon></v-btn
>
</template></v-checkbox
>
</v-col>
<!-- --------------------------------- -->
@@ -815,6 +827,20 @@ export default {
}
},
methods: {
canOpenServiceBank: function() {
return this.obj.usesBanking == true && this.$route.params.recordid != 0;
},
openServiceBank: function() {
if (this.canOpenServiceBank()) {
this.$router.push({
name: "service-banks",
params: {
objectType: window.$gz.type.HeadOffice,
objectId: this.$route.params.recordid
}
});
}
},
canSave: function() {
return this.formState.valid && this.formState.dirty;
},