拆分详情增加

This commit is contained in:
caoyang
2022-03-30 15:57:45 +08:00
parent 33326162f9
commit d3696b6567
10 changed files with 485 additions and 175 deletions
@@ -588,7 +588,7 @@
type:String,
default:''
},
item:{
itemVal:{
type:Object,
default:{}
}
@@ -600,12 +600,15 @@
}else{
this.selectedNum=false
}
}
},
// itemVal(oldVal,newVal){
// console.log('new',oldVal,newVal)
// }
},
mounted() {
this.visible=this.addVisible
this.formInline=this.item
console.log('form',this.formInline,this.item)
// console.log('form',this.formInline,this.item)
this.loadData()
},
methods:{
@@ -615,7 +618,6 @@
if(res.success){
this.contentList=[...res.result]
console.log('res',res.result)
}
}).finally(()=>{
this.loading=false
@@ -639,7 +641,7 @@
},
//删除按钮
splitDelete(item,index){
console.log('itme',item,this.contentList)
// console.log('itme',item,this.contentList)
if(item.id){
this.deleteIds.push(item.id)
}
@@ -648,7 +650,7 @@
this.contentList[index]=this.contentList[index+1]
}
this.contentList.pop()
console.log('this.content',this.contentList)
// console.log('this.content',this.contentList)
},
//保存
splitSave(){
@@ -671,8 +673,8 @@
params[res] = params[res].join(',')
}
})
// console.log('item',this.item,JSON.stringify(this.item)=="{}")
if(JSON.stringify(this.item)=="{}"){
if(JSON.stringify(this.itemVal)=="{}"){
params.info_id=this.infoId
params.menu_id=this.menuId
}
@@ -695,6 +697,7 @@
this.visible=false
// this.$emit('closeVisible',false)
eventBUs.$emit('searchReset')
this.$emit('sumber')
}else{
this.$message.warning(this.$t('operationFailed'))
}
@@ -765,7 +768,7 @@
},
//上传文件
uploadSuccess1(data,imgs) {
console.log('dataimg',data,imgs)
// console.log('dataimg',data,imgs)
let lengthImg=imgs.length
for(let i = this.contentList.length;i>this.addIndex;i--){
this.contentList[i+lengthImg-1]=this.contentList[i-1]
@@ -780,7 +783,7 @@
})
}
this.splitVisible=false
console.log('conteend',this.contentList)
// console.log('conteend',this.contentList)
},
//点击图片预览
preImg(item){
@@ -971,16 +974,14 @@
})
},
edit(item) {
this.visible=true
this.type = 'edit'
this.getForm(() => {
getAction(this.url.getDocumentInfo, { id: item.id }).then((res) => {
if (res.success) {
this.formInline = res.result[0]
}
})
this.formInline=item
})
},
add() {
this.visible=true
this.formInline = {}
this.type = 'add'
this.getForm()