diff --git a/src/views/PurchasingCenter/PurchaseContractSearch/index.vue b/src/views/PurchasingCenter/PurchaseContractSearch/index.vue index 41ae3ce3..e5a43e72 100644 --- a/src/views/PurchasingCenter/PurchaseContractSearch/index.vue +++ b/src/views/PurchasingCenter/PurchaseContractSearch/index.vue @@ -239,11 +239,8 @@ export default { created() { this.fetchData() }, - mounted() { - this.useqrcode() - }, methods: { - useqrcode() { + useqrcode(contractNum) { const opts = { errorCorrectionLevel: 'H', type: 'image/jpeg', @@ -251,7 +248,8 @@ export default { quality: 0.3 } } - QRCode.toDataURL('知道这是啥吗你就扫', opts, function(err, url) { + const str = 'http://192.168.1.109:8022/searchContract.html?contractNum=' + contractNum + QRCode.toDataURL(str, opts, function(err, url) { if (err) throw err const img = document.getElementById('img') img.src = url @@ -260,7 +258,6 @@ export default { searchPic() { // 读取图片时,查找合同流水号,获取其下所有图片id,根据拼接成的路径,查询图片显示出来。 searchFile(this.contract).then(response => { - console.log(response.data) if (response.data.length !== 0) { this.searchView = 'http://localhost:8022/Img/' + response.data[0].文件名 } else { @@ -335,6 +332,7 @@ export default { this.searchTable1() }, searchTable2(row) { + this.useqrcode(row.采购合同流水号) this.textarea = row.合同文本 this.supplier = row.供应商名称 this.contract = row.采购合同编号