Commit 7c93d14b authored by 李晓兵's avatar 李晓兵

'身份证上传'

parent 17102c61
...@@ -447,9 +447,7 @@ export default { ...@@ -447,9 +447,7 @@ export default {
hlsPopup.showLoading('请稍候') hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) { vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
console.log('%%%%%%%%%%%%' + res)
if (res.result === 'S') { if (res.result === 'S') {
console.log('**********' + res.lists)
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
...@@ -498,13 +496,14 @@ export default { ...@@ -498,13 +496,14 @@ export default {
var list = [] var list = []
for (let i = 0; i < vm.idCardImgList.length; i++) { for (let i = 0; i < vm.idCardImgList.length; i++) {
let obj = { let obj = {
'pkvalue': vm.idCardImgList[0].check_id, 'pkvalue': vm.idCardCheck_id,
'source_type': 'PRJ_CDD_ITEM_CHECK', 'source_type': 'PRJ_CDD_ITEM_CHECK',
'picture': '', 'picture': '',
'check_id': vm.idCardImgList[0].check_id, 'check_id': vm.idCardCheck_id,
'filePath': vm.idCardImgList[i], 'filePath': vm.idCardImgList[i].url,
'attachment_id': '', 'attachment_id': '',
'user_id': 1, 'user_id': 1,
'fileName': vm.idCardImgList[i].fileName,
} }
list.push(obj) list.push(obj)
} }
...@@ -600,6 +599,7 @@ export default { ...@@ -600,6 +599,7 @@ export default {
'filePath': '', 'filePath': '',
'attachment_id': '', 'attachment_id': '',
'user_id': 1, 'user_id': 1,
'fileName': '',
} }
let cameraoptions = { let cameraoptions = {
quality: 100, quality: 100,
...@@ -631,6 +631,7 @@ export default { ...@@ -631,6 +631,7 @@ export default {
'filePath': '', 'filePath': '',
'attachment_id': '', 'attachment_id': '',
'user_id': 1, 'user_id': 1,
'fileName': '',
} }
obj.picture = imgUrl[i] obj.picture = imgUrl[i]
obj.filePath = imgUrl[i] obj.filePath = imgUrl[i]
...@@ -745,7 +746,7 @@ export default { ...@@ -745,7 +746,7 @@ export default {
} else { } else {
if (ocrType === 'idCard') { if (ocrType === 'idCard') {
vm.idCardEditFlag = true // 身份证图片状态已修改 vm.idCardEditFlag = true // 身份证图片状态已修改
type === 'front' ? (vm.idCardFront = imgdata, vm.idCardIdentify(imgdata), vm.idCardImgList.push(imgdata)) : (vm.idCardBack = imgdata, vm.idCardImgList.push(imgdata)) type === 'front' ? (vm.idCardFront = imgdata, vm.idCardIdentify(imgdata), vm.idCardImgList.push({'url':imgdata,'fileName':'front'})) : (vm.idCardBack = imgdata, vm.idCardImgList.push({'url':imgdata,'fileName':'back'}))
} else if (ocrType === 'bankCard') { } else if (ocrType === 'bankCard') {
vm.bankImg = imgdata vm.bankImg = imgdata
vm.bankCardIdentify(imgdata) vm.bankCardIdentify(imgdata)
...@@ -771,7 +772,7 @@ export default { ...@@ -771,7 +772,7 @@ export default {
} else { } else {
if (ocrType === 'idCard') { if (ocrType === 'idCard') {
vm.idCardEditFlag = true // 身份证图片状态已修改 vm.idCardEditFlag = true // 身份证图片状态已修改
type === 'front' ? (vm.idCardFront = imgUrl[0], vm.idCardIdentify(imgUrl[0]), vm.idCardImgList.push(imgUrl[0])) : (vm.idCardBack = imgUrl[0], vm.idCardImgList.push(imgUrl[0])) type === 'front' ? (vm.idCardFront = imgUrl[0], vm.idCardIdentify(imgUrl[0]), vm.idCardImgList.push({'url':imgUrl[0],'fileName':'front'})) : (vm.idCardBack = imgUrl[0], vm.idCardImgList.push({'url':imgUrl[0],'fileName':'back'}))
} else if (ocrType === 'bankCard') { } else if (ocrType === 'bankCard') {
vm.bankImg = imgUrl[0] vm.bankImg = imgUrl[0]
vm.bankCardIdentify(imgUrl[0]) vm.bankCardIdentify(imgUrl[0])
......
...@@ -1306,6 +1306,7 @@ export default { ...@@ -1306,6 +1306,7 @@ export default {
'filePath': '', 'filePath': '',
'attachment_id': '', 'attachment_id': '',
'user_id': 1, 'user_id': 1,
'fileName': '',
} }
let cameraoptions = { let cameraoptions = {
quality: 100, quality: 100,
...@@ -1339,6 +1340,7 @@ export default { ...@@ -1339,6 +1340,7 @@ export default {
'filePath': '', 'filePath': '',
'attachment_id': '', 'attachment_id': '',
'user_id': 1, 'user_id': 1,
'fileName': '',
} }
obj.picture = imgUrl[i] obj.picture = imgUrl[i]
obj.filePath = imgUrl[i] obj.filePath = imgUrl[i]
......
...@@ -372,7 +372,7 @@ export default { ...@@ -372,7 +372,7 @@ export default {
fileUploadSvc: function (file, success) { fileUploadSvc: function (file, success) {
debugger debugger
let path = file.filePath let path = file.filePath
let name = path.substr(path.lastIndexOf('/') + 1) var name = path.substr(path.lastIndexOf('/') + 1)
let url = encodeURI(process.env.rootPath + '/app/fileUploadSvc?sysName=XCMG_DEV&apiName=attachment_upload') let url = encodeURI(process.env.rootPath + '/app/fileUploadSvc?sysName=XCMG_DEV&apiName=attachment_upload')
let options = new FileUploadOptions() // eslint-disable-line let options = new FileUploadOptions() // eslint-disable-line
options.fileKey = 'file' options.fileKey = 'file'
...@@ -387,7 +387,12 @@ export default { ...@@ -387,7 +387,12 @@ export default {
'access_token': window.localStorage.access_token, 'access_token': window.localStorage.access_token,
'filePath': path, 'filePath': path,
} }
options.fileName = name if(file.fileName){
options.fileName = file.fileName + name.split('.')[1]
}
else{
options.fileName = name
}
options.mimeType = 'multipart/form-date' options.mimeType = 'multipart/form-date'
let ft = new FileTransfer() // eslint-disable-line let ft = new FileTransfer() // eslint-disable-line
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment