|
@@ -113,9 +113,9 @@
|
|
|
<a-button type="link" @click="handleRepair(item)">
|
|
|
报修
|
|
|
</a-button>
|
|
|
- <a-button type="link" @click="uploadVisible = true">上传图片 </a-button>
|
|
|
+ <a-button type="link" @click="uploadImg(item,i)">{{ item.images.length>0?'查看图片':'上传图片' }}</a-button>
|
|
|
|
|
|
- <a-modal v-model="uploadVisible" title="上传图片" @cancel="uploadVisible = false">
|
|
|
+ <a-modal v-model="uploadVisible" title="上传图片" :footer="null" @cancel="uploadVisible = false">
|
|
|
<a-upload
|
|
|
:action="uploadUrl"
|
|
|
list-type="picture-card"
|
|
@@ -195,8 +195,7 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
uploadUrl: uploadUrl,
|
|
|
- defaultApplicationFileList: [
|
|
|
- ],
|
|
|
+ defaultApplicationFileList: [],
|
|
|
applicationFileList: [],
|
|
|
headers: {
|
|
|
Authorization: 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
|
|
@@ -217,6 +216,7 @@ export default {
|
|
|
pageSize: 10,
|
|
|
total: 0
|
|
|
},
|
|
|
+ imgId: '',
|
|
|
loading: false,
|
|
|
ListForm: [],
|
|
|
id: '',
|
|
@@ -304,18 +304,28 @@ export default {
|
|
|
val.fillValue = val.fillValue ? val.fillValue : ''
|
|
|
return val
|
|
|
})
|
|
|
+ item.images = item.content.filter(item => item.type === 11)
|
|
|
+ item.content = item.content.filter(item => item.type !== 11)
|
|
|
return item
|
|
|
})
|
|
|
+ console.log(this.ListForm)
|
|
|
})
|
|
|
- console.log(this.ListForm)
|
|
|
+ },
|
|
|
+ uploadImg (val, i) {
|
|
|
+ this.uploadVisible = true
|
|
|
+ console.log(val)
|
|
|
+ this.imgId = i
|
|
|
+ this.defaultApplicationFileList = this.BaseTool.UPLOAD.transImg(val.images)
|
|
|
+ console.log(this.defaultApplicationFileList)
|
|
|
+ console.log(this.applicationFileList)
|
|
|
},
|
|
|
handleRepair (val) {
|
|
|
const data = {
|
|
|
sbId: val.sbId,
|
|
|
sbName: val.sbName,
|
|
|
sbCph: val.positionName,
|
|
|
- applicationFileList: this.applicationFileList,
|
|
|
- defaultApplicationFileList: this.defaultApplicationFileList,
|
|
|
+ applicationFileList: val.images,
|
|
|
+ defaultApplicationFileList: this.BaseTool.UPLOAD.transImg(val.images),
|
|
|
treeData: val.content.map((item) => {
|
|
|
return {
|
|
|
title: item.name + ':' + item.fillValue,
|
|
@@ -324,8 +334,6 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- console.log(data)
|
|
|
-
|
|
|
const modal = this.$refs.baseFormRepairModal
|
|
|
modal.base(data)
|
|
|
},
|
|
@@ -347,6 +355,7 @@ export default {
|
|
|
handleApplicationFileChange (info) {
|
|
|
this.defaultApplicationFileList = info.fileList
|
|
|
this.applicationFileList = this.setFileList(info, 11)
|
|
|
+ this.ListForm[this.imgId].images = this.applicationFileList
|
|
|
},
|
|
|
setFileList (info, type) {
|
|
|
const file = info.file
|
|
@@ -401,14 +410,13 @@ export default {
|
|
|
this.getFillUpdates()
|
|
|
},
|
|
|
onChange (page) {
|
|
|
- console.log(page)
|
|
|
this.getInfo()
|
|
|
},
|
|
|
save () {
|
|
|
const detail = this.ListForm.map(item => {
|
|
|
return {
|
|
|
id: item.id,
|
|
|
- content: JSON.stringify(item.content)
|
|
|
+ content: JSON.stringify([...item.content, ...item.images])
|
|
|
}
|
|
|
})
|
|
|
const params = {
|