|
|
|
@ -223,42 +223,47 @@ export default { |
|
|
|
}); |
|
|
|
|
|
|
|
this.$peisAPI.imageAcquisition(JSON.stringify(toOutShell)) |
|
|
|
.then(res => { |
|
|
|
.then(async (res) => { |
|
|
|
let lres = JSON.parse(res) |
|
|
|
// console.log('this.$peisAPI.imageAcquisition',lres) |
|
|
|
if (lres.code > -1) { |
|
|
|
let baseHead = 'data:image/jpeg;base64,' |
|
|
|
switch (lres.data.ImageFormat) { |
|
|
|
case 'png': |
|
|
|
case 'bmp': |
|
|
|
baseHead = `data:image/${lres.data.ImageFormat};base64,` |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
this.checkPictures.push({ pictureFilename: baseHead + lres.data.Image }) |
|
|
|
let fileName = lres.data.FilePath |
|
|
|
let dotIndex = fileName.lastIndexOf('\\'); |
|
|
|
if (dotIndex > -1) fileName = fileName.substring(dotIndex, fileName.length); |
|
|
|
for (let i = 0; i < lres.data.length; i++) { |
|
|
|
let item = lres.data[i]; |
|
|
|
|
|
|
|
let body = { |
|
|
|
registerCheckId: this.dataTransOpts.tableS.register_check.id, |
|
|
|
pictureBaseStrs: [{ |
|
|
|
fileName, |
|
|
|
localPathName: lres.data.FilePath, |
|
|
|
pictureBaseStr: baseHead + lres.data.Image |
|
|
|
}] |
|
|
|
} |
|
|
|
postapi('/api/app/RegisterCheckPicture/InstrumentMapping', body).then(res => { |
|
|
|
if (res.code > -1) { |
|
|
|
this.getCheckPictures(this.dataTransOpts.tableS.register_check.id) |
|
|
|
// FilePath: |
|
|
|
// Image |
|
|
|
// ImageFormat |
|
|
|
|
|
|
|
let baseHead = 'data:image/jpeg;base64,' |
|
|
|
switch (item.ImageFormat) { |
|
|
|
case 'png': |
|
|
|
case 'bmp': |
|
|
|
baseHead = `data:image/${item.ImageFormat};base64,` |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
}) |
|
|
|
// FilePath: |
|
|
|
// Image |
|
|
|
// ImageFormat |
|
|
|
// console.log(lres.data,this.checkPictures) |
|
|
|
this.checkPictures.push({ pictureFilename: baseHead + item.Image }) |
|
|
|
let fileName = item.FilePath |
|
|
|
let dotIndex = fileName.lastIndexOf('\\'); |
|
|
|
if (dotIndex > -1) fileName = fileName.substring(dotIndex, fileName.length); |
|
|
|
|
|
|
|
let body = { |
|
|
|
registerCheckId: this.dataTransOpts.tableS.register_check.id, |
|
|
|
pictureBaseStrs: [{ |
|
|
|
fileName, |
|
|
|
localPathName: item.FilePath, |
|
|
|
pictureBaseStr: baseHead + item.Image |
|
|
|
}] |
|
|
|
} |
|
|
|
try { |
|
|
|
await postapi('/api/app/RegisterCheckPicture/InstrumentMapping', body) |
|
|
|
} catch (error) { |
|
|
|
console.log('btnGetPic err',error) |
|
|
|
} |
|
|
|
} |
|
|
|
this.getCheckPictures(this.dataTransOpts.tableS.register_check.id) |
|
|
|
} |
|
|
|
console.log('lres', lres) |
|
|
|
}).catch(err => { |
|
|
|
this.$message.error(err) |
|
|
|
}).finally(() => { |
|
|
|
|