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

View File

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