This commit is contained in:
2021-06-21 18:22:13 +00:00
parent fa82935f6e
commit 6db9e23c86
3 changed files with 66 additions and 37 deletions

File diff suppressed because one or more lines are too long

View File

@@ -12,6 +12,7 @@
<v-btn icon class="ml-n1 mr-2" @click="openDialog = true"> <v-btn icon class="ml-n1 mr-2" @click="openDialog = true">
<v-icon>$ayiEdit</v-icon> <v-icon>$ayiEdit</v-icon>
</v-btn> </v-btn>
<img class="grey lighten-2" :src="imgUrl" />
</div> </div>
</template> </template>
@@ -24,11 +25,19 @@
<v-card-text> <v-card-text>
<template v-if="$vuetify.breakpoint.smAndUp"> <template v-if="$vuetify.breakpoint.smAndUp">
<!-- WIDE VIEW --> <!-- WIDE VIEW -->
<Sign data-cy="sign" /> <vueSignature
ref="sigCtrl"
:sig-option="sigOption"
:disabled="disabled"
></vueSignature>
</template> </template>
<template v-else> <template v-else>
<!-- NARROW VIEW --> <!-- NARROW VIEW -->
<Sign data-cy="sign" /> <vueSignature
ref="sigCtrl"
:sig-option="sigOption"
:disabled="disabled"
></vueSignature>
</template> </template>
<template> <template>
@@ -45,13 +54,9 @@
<v-btn color="blue darken-1" text @click="cancelDialog()">{{ <v-btn color="blue darken-1" text @click="cancelDialog()">{{
$ay.t("Cancel") $ay.t("Cancel")
}}</v-btn> }}</v-btn>
<v-btn <v-btn color="blue darken-1" text @click="save()">{{
color="blue darken-1" $ay.t("OK")
:disabled="selectedStatus == null" }}</v-btn>
text
@click="save()"
>{{ $ay.t("OK") }}</v-btn
>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
</v-dialog> </v-dialog>
@@ -62,15 +67,19 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* XXXeslint-disable */ /* XXXeslint-disable */
//////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////
import Sign from "./sign.vue"; import vueSignature from "vue-signature";
export default { export default {
components: { components: {
Sign vueSignature
}, },
data() { data() {
return { return {
selectedStatus: null, selectedStatus: null,
openDialog: false openDialog: false,
sigOption: {
penColor: "rgb(0, 0, 0)",
backgroundColor: "rgb(245,245,245)"
}
}; };
}, },
@@ -98,6 +107,13 @@ export default {
}, },
save() { save() {
let svg = this.$refs.sigCtrl.save("image/svg+xml");
if (this.variant == "customer") {
this.value.customerSignature = svg;
} else {
this.value.techSignature = svg;
}
this.$emit("change");
this.openDialog = false; this.openDialog = false;
}, },
cancelDialog() { cancelDialog() {
@@ -113,6 +129,20 @@ export default {
} }
} }
}, },
computed: {} computed: {
imgUrl: function() {
let sig = null;
if (this.variant == "customer") {
sig = this.value.customerSignature;
} else {
sig = this.value.techSignature;
}
if (sig != null && sig.length > 0 && sig.includes("svg")) {
return sig;
} else {
return null;
}
}
}
}; };
</script> </script>

View File

@@ -1,17 +1,15 @@
<template> <template>
<div> <div>
<Sign data-cy="sign" />
<UnderConstruction data-cy="underconstruction" /> <UnderConstruction data-cy="underconstruction" />
</div> </div>
</template> </template>
<script> <script>
import UnderConstruction from "../components/underconstruction.vue"; import UnderConstruction from "../components/underconstruction.vue";
import Sign from "../components/sign.vue";
export default { export default {
components: { components: {
UnderConstruction, UnderConstruction
Sign
}, },
beforeCreate() { beforeCreate() {
window.$gz.eventBus.$emit("menu-change", { window.$gz.eventBus.$emit("menu-change", {