|
@@ -33,6 +33,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div slot="footer">
|
|
<div slot="footer">
|
|
|
|
|
+ <el-button @click="download">下载</el-button>
|
|
|
<el-button @click="print">打印预览</el-button>
|
|
<el-button @click="print">打印预览</el-button>
|
|
|
<el-button @click="close">关闭</el-button>
|
|
<el-button @click="close">关闭</el-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -86,6 +87,18 @@
|
|
|
mounted() {},
|
|
mounted() {},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ download() {
|
|
|
|
|
+ if (this.url) {
|
|
|
|
|
+ // 创建一个a标签
|
|
|
|
|
+ const link = document.createElement('a');
|
|
|
|
|
+ // 设置href为二维码的data URL
|
|
|
|
|
+ link.href = this.url;
|
|
|
|
|
+ // 设置下载文件名
|
|
|
|
|
+ link.download = `二维码_${this.workOrderId}.png`;
|
|
|
|
|
+ // 模拟点击下载
|
|
|
|
|
+ link.click();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
open(workOrderId) {
|
|
open(workOrderId) {
|
|
|
this.QRvisible = true;
|
|
this.QRvisible = true;
|
|
|
this.workOrderId = workOrderId;
|
|
this.workOrderId = workOrderId;
|
|
@@ -156,4 +169,4 @@
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
-<style scoped lang="scss"></style>
|
|
|
|
|
|
|
+<style scoped lang="scss"></style>
|