This commit is contained in:
2021-12-15 23:48:31 +00:00
parent e0ec642598
commit 2bf9b40cc9

View File

@@ -60,34 +60,49 @@
}}</span> }}</span>
</div> </div>
</template> </template>
<v-sheet <template v-if="hasSignature">
v-if="$vuetify.breakpoint.xs" <img
data-cy="sigSheet" v-if="$vuetify.breakpoint.xs"
width="275px" data-cy="sigImage"
height="75px" width="275px"
> height="75px"
<vueSignature :src="imgUrl"
ref="sigCtrl" />
data-cy="sigCtrl" <img
:sig-option="sigOption" v-else
:disabled="disabled || imgUrl != null" data-cy="sigImage"
:default-url="imgUrl" width="550px"
:w="'275px'" height="150px"
:h="'75px'" :src="imgUrl"
></vueSignature> />
</v-sheet> </template>
<v-sheet v-else data-cy="sigSheet" width="550px" height="150px"> <template v-else>
<vueSignature <v-sheet
ref="sigCtrl" v-if="$vuetify.breakpoint.xs"
data-cy="sigCtrl" data-cy="sigSheet"
:sig-option="sigOption" width="275px"
:disabled="disabled || imgUrl != null" height="75px"
:default-url="imgUrl" >
:w="'550px'" <vueSignature
:h="'150px'" ref="sigCtrl"
></vueSignature> data-cy="sigCtrl"
</v-sheet> :sig-option="sigOption"
:disabled="disabled || imgUrl != null"
:w="'275px'"
:h="'75px'"
></vueSignature>
</v-sheet>
<v-sheet v-else data-cy="sigSheet" width="550px" height="150px">
<vueSignature
ref="sigCtrl"
data-cy="sigCtrl"
:sig-option="sigOption"
:disabled="disabled || imgUrl != null"
:w="'550px'"
:h="'150px'"
></vueSignature>
</v-sheet>
</template>
{{ sigDateLocalized }} {{ sigDateLocalized }}
<template v-if="variant == 'customer'"> <template v-if="variant == 'customer'">
<div <div
@@ -185,6 +200,7 @@ export default {
return window.$gz.form; return window.$gz.form;
}, },
save() { save() {
console.log("ISEMPTY", this.$refs.sigCtrl.isEmpty());
let svg = this.$refs.sigCtrl.save("image/svg+xml"); let svg = this.$refs.sigCtrl.save("image/svg+xml");
if (this.$refs.sigCtrl.isEmpty()) { if (this.$refs.sigCtrl.isEmpty()) {
svg = null; svg = null;
@@ -219,20 +235,21 @@ export default {
} }
}, },
cancelDialog() { cancelDialog() {
this.$refs.sigCtrl.fromDataURL(this.tempSig); // this.$refs.sigCtrl.fromDataURL(this.tempSig);
this.setSig(this.tempSig); // this.setSig(this.tempSig);
this.setCaptured(this.tempDate); // this.setCaptured(this.tempDate);
this.setName(this.tempName); // this.setName(this.tempName);
this.openDialog = false;
this.tempName = null; this.tempName = null;
this.tempSig = null; this.tempSig = null;
this.tempDate = null; this.tempDate = null;
this.openDialog = false;
}, },
erase() { erase() {
this.setSig(null); this.setSig(null);
this.setCaptured(null); this.setCaptured(null);
this.setName(null); this.setName(null);
this.$refs.sigCtrl.clear(); //this.$refs.sigCtrl.clear();
this.value.isDirty = true; this.value.isDirty = true;
this.pvm.formState.dirty = true; this.pvm.formState.dirty = true;
this.$emit("change"); this.$emit("change");