Commit 6a11cdd1 authored by 李晓兵's avatar 李晓兵

'附件上传'

parent a2703204
......@@ -10,6 +10,7 @@ module.exports = merge(prodEnv, {
loginPath: '"http://180.104.121.66:8088/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password=" ',
basePath: '"http://180.104.121.66:8088/r/api/interface?sysName=XCMG_DEV&apiName="',
rootPath: '"http://180.104.121.66:8088/r/api"',
filePath: '"http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_DEV&apiName=file_view&"',
ocrPath:'"http://180.104.121.66:8088/r/api"',
file_url: '"http://hlsapp.hand-china.com/file/"',
appId: '"com.hls.easy.car"',
......
......@@ -7,6 +7,7 @@ module.exports = {
loginPath: '"http://180.104.121.66:8088/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password=" ',
basePath: '"http://180.104.121.66:8088/r/api/interface?sysName=XCMG_DEV&apiName="',
rootPath: '"http://180.104.121.66:8088/r/api"',
filePath: '"http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_DEV&apiName=file_view&"',
ocrPath:'"http://180.104.121.66:8088/r/api"',
file_url: '"http://hlsapp.hand-china.com/file/"',
appId: '"com.hls.easy.car"',
......
......@@ -198,13 +198,19 @@
<span>{{ list.description }}</span>
<div class="img-content">
<!--待上传图片列表-->
<div v-for="(list, index) in upload_list" :key="index">
<img :src="list.picture" >
<div v-for="(item, index) in upload_list" v-if="item.check_id==list.check_id" :key="index" class="card-upload">
<img :src="item.picture" >
<div class="close" @click="delete_pic(item.attachment_id)">
<img src="@/assets/userBind/deleteIcon.png">
</div>
</div>
<!--从服务器上下载的图片-->
<div v-for="item in dowload_list" class="card-upload">
<div v-for="(pic, index) in item" :key="index">
<img :src="item.url" >
<div v-for="item in dowload_list" >
<div v-for="(pic, index) in item" :key="index" v-if="pic.check_id==list.check_id" class="card-upload">
<img :src="pic.url" >
<div class="close" @click="delete_pic(pic.attachment_id)">
<img src="@/assets/userBind/deleteIcon.png">
</div>
</div>
</div>
<div class="card-upload" @click="imgUploadShow(list.check_id)">
......@@ -431,19 +437,21 @@ export default {
}
})
},
load_picture(check_id){
debugger
load_picture (check_id, index) {
let vm = this
let url = process.env.basePath + 'attachment_list_query'
let url = process.env.basePath + 'attachment_list_query' + '&index' + index // 附件查询
let param = {
check_id: check_id,
}
hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
console.log('%%%%%%%%%%%%' + res)
if (res.result === 'S') {
console.log('**********' + res.lists)
res.lists.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.attachment_id + '&access_token=' + window.localStorage.access_token
})
vm.dowload_list.push(res.lists)
console.log(JSON.stringify(vm.dowload_list))
} else {
hlsPopup.showLongCenter(res.message)
}
......@@ -471,8 +479,8 @@ export default {
if (res.result === 'S') {
vm.cddItemList = [...res.lists]
// 查询图片
vm.cddItemList.forEach(item => {
vm.load_picture(item.check_id)
vm.cddItemList.forEach((item, index) => {
vm.load_picture(item.check_id, index)
})
}
})
......@@ -540,7 +548,7 @@ export default {
}
},
// 图片上传入口
imgUploadShow(check_id){
imgUploadShow (check_id) {
let vm = this
hlsPopup.showActionSheet({
titleText: '请选择照片',
......@@ -554,7 +562,7 @@ export default {
},
})
},
imgUploadOpenCamera(check_id){
imgUploadOpenCamera (check_id) {
let vm = this
let obj = {
'pkvalue': check_id,
......@@ -562,7 +570,7 @@ export default {
'picture': '',
'filePath': '',
'attachment_id': '',
'user_id':1
'user_id': 1,
}
let cameraoptions = {
quality: 100,
......@@ -580,12 +588,13 @@ export default {
}
hlsUtil.openCamera(cameraoptions, success, error)
},
imgUploadTakePicture(check_id){
imgUploadTakePicture (check_id) {
let vm = this
let cameraoptions = {
quality: 100,
}
let success = function (imgUrl) {
var list = []
for (let i = 0; i < imgUrl.length; i++) {
let obj = {
'pkvalue': check_id,
......@@ -593,11 +602,10 @@ export default {
'picture': '',
'filePath': '',
'attachment_id': '',
'user_id':1
'user_id': 1,
}
obj.picture = imgUrl[i]
obj.filePath = imgUrl[i]
var list = []
list.push(obj)
}
// 拍完一张立马执行保存图片逻辑
......@@ -609,7 +617,7 @@ export default {
},
// 图片保存
save_picture (list) {
alert('图片待上传数组 ' + JSON.stringify(list))
alert('图片待上传数组 ' + JSON.stringify(list))
let vm = this
if (list.length) {
// hlsPopup.showLoading('图片上传请稍候')
......@@ -625,7 +633,7 @@ export default {
for (var i = 0; i < list.length; i++) {
let uploadSuccess = function (res) {
if (res.result === 'S') {
alert('返回结果 '+ JSON.stringify(res.response))
alert('返回结果 ' + JSON.stringify(res.response))
alreadyUploadNum++
for (var j = 0; j < list.length; j++) {
if (list[j].filePath === res.response.filePath) {
......@@ -647,6 +655,24 @@ export default {
hlsPopup.hideLoading()
}
},
// 删除图片
delete_pic(attachment_id){
hlsPopup.showLongCenter('接口还没写')
/*let vm = this
let url = process.env.basePath + 'attachment_list_query'
let param = {
attachment_id: attachment_id,
}
hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
} else {
hlsPopup.showLongCenter(res.message)
}
})*/
},
/* uploadIdCardFront () {
let vm = this
let url = process.env.basePath + 'attachment_upload'
......@@ -1217,7 +1243,17 @@ export default {
align-items: center;
margin-top: 12px;
margin-left: 12px;
// float: left;
float: left;
.close {
position: absolute;
color: #F96F68;
margin-top: -45px;
margin-left: 40px;
img{
width: 14px;
height: 14px;
}
}
img {
width: 88px;
height: 88px;
......
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