采购合同查询:新增扫码二维码显示详情

This commit is contained in:
chenjianan
2018-11-17 16:42:38 +08:00
parent 42b47c94c2
commit 299d06af44

View File

@@ -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.采购合同编号