上传附件逻辑修改

This commit is contained in:
zyx.net
2023-03-25 18:29:48 +08:00
parent f8533b953c
commit af0580bf4e
@@ -117,26 +117,32 @@ import ImportFile from '@/components/ImportFileData/index'
dataSource: [ dataSource: [
{ {
xtlb:'动力系统', xtlb:'动力系统',
tpt:'',
key:'1' key:'1'
}, },
{ {
xtlb:'传动系统', xtlb:'传动系统',
tpt:'',
key:'2' key:'2'
}, },
{ {
xtlb:'转向系统', xtlb:'转向系统',
tpt:'',
key:'3' key:'3'
}, },
{ {
xtlb:'制动系统', xtlb:'制动系统',
tpt:'',
key:'4' key:'4'
}, },
{ {
xtlb:'车身系统', xtlb:'车身系统',
tpt:'',
key:'5' key:'5'
}, },
{ {
xtlb:'车载能源系统', xtlb:'车载能源系统',
tpt:'',
key:'6' key:'6'
}, },
], ],
@@ -367,21 +373,25 @@ import ImportFile from '@/components/ImportFileData/index'
this.$emit('upgradedonlinedown') this.$emit('upgradedonlinedown')
}, },
uploadSuccess(data) { uploadSuccess(data) {
console.log(data)
let attIdList = [] let attIdList = []
if (data && data.length > 0) { if (data && data.length > 0) {
data.map(item => { data.map(item => {
attIdList.push(item.id || data.name) attIdList.push(item.id || data.name)
}) })
} }
this.dataSource.forEach((item) => {
if(item.key == this.type){
item.tpt = attIdList.join(',')
}
})
this.$forceUpdate()
// /** 赋值给当前对应的表单文件 */ // /** 赋值给当前对应的表单文件 */
// this.fileList.uploadName = attIdList.join(',') // this.fileList.uploadName = attIdList.join(',')
// this.fileList.certifyingmaterials = this.$t('viewFile') // this.fileList.certifyingmaterials = this.$t('viewFile')
}, },
clickButtonToUpload(current,index) { clickButtonToUpload(current,index) {
console.log(current)
this.type = index this.type = index
console.log(this.type) console.log(current)
this.$refs.uploadFile.perentHandleFunc() this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true this.$refs.uploadFile.visible = true
this.uploadName = current this.uploadName = current
@@ -397,7 +407,7 @@ import ImportFile from '@/components/ImportFileData/index'
addlineAtMid(record){ addlineAtMid(record){
let randomNum=Math.floor(Math.random()*99999999999+1) let randomNum=Math.floor(Math.random()*99999999999+1)
let obj = {xtlb:record.xtlb,key:randomNum} let obj = {xtlb:record.xtlb,key:randomNum}
this.dataSource.splice(this.dataSource.indexOf(record)+1,0,obj) this.dataSource.splice(this.dataSource.indexOf(record)+1,0,obj)
}, },
//最后一行加 //最后一行加