diff --git a/jnpf-java-boot/jnpf-web/src/views/scm/person/form.vue b/jnpf-java-boot/jnpf-web/src/views/scm/person/form.vue index 63f1655..337f21e 100644 --- a/jnpf-java-boot/jnpf-web/src/views/scm/person/form.vue +++ b/jnpf-java-boot/jnpf-web/src/views/scm/person/form.vue @@ -81,7 +81,18 @@ :style='{ "width": "100%" }'> + + + + + 生成 + + +
+
+
+
@@ -133,11 +144,15 @@ import { import { thousandsFormat } from "@/components/Generator/utils/index" +import QRCode from 'qrcodejs2' +import JsBarcode from 'jsbarcode' export default { components: {}, props: [], data() { return { + qrcode: '', + barcode: "", dataFormSubmitType: 0, continueBtnLoading: false, index: 0, @@ -268,6 +283,47 @@ export default { }, mounted() { }, methods: { + getQRimg() { + if (this.dataForm.userCode == null || this.dataForm.userName == null || + this.dataForm.phone == null || this.dataForm.userAscription == null || this.dataForm.idCard == null + || this.dataForm.effectiveStartTime == null || this.dataForm.effectiveEndTime == null|| this.dataForm.entryCodes == null) { + this.$message.error('请完善设备必填信息'); + return + } + let qrCodeJsonString = JSON.stringify(this.dataForm); + this.qrcode = qrCodeJsonString; + if (!this.qrcode) { + return + } + this.$refs.qrCode.innerHTML = ""; + let qrcode = new QRCode(this.$refs.qrCode, { + width: 265, + height: 265, // 高度 + text: this.qrcode, // 二维码内容 + // render: 'canvas' // 设置渲染方式(有两种方式 table和canvas,默认是canvas) + // background: '#f0f' + // foreground: '#ff0' + correctLevel: QRCode.CorrectLevel.H //容错级别 容错级别有:(1)QRCode.CorrectLevel.L (2)QRCode.CorrectLevel.M (3)QRCode.CorrectLevel.Q (4)QRCode.CorrectLevel.H + }) + }, + getBarcode() { + let reg = /^[A-Za-z0-9]+$/ + if (!reg.test(this.barcode)) { + this.$message({ + message: '请输入数字或者英文字母', + type: 'error', + duration: 1500, + }) + return + } + JsBarcode("#barcode", this.barcode, { + // format: "pharmacode", + // lineColor: "#0aa", + width: 4, + height: 80, + displayValue: false + }); + }, selectChangeData(var1, var2) { this.dataForm.merchantId = var2.id; this.dataForm.merchantName = var2.cmp_nm;