fengdong777 2 years ago
parent
commit
278285a991
  1. 45
      supervise-crm-ui/src/views/project/projectAdd.vue

45
supervise-crm-ui/src/views/project/projectAdd.vue

@ -336,6 +336,7 @@
ValSid:[], ValSid:[],
ARRSid:[], ARRSid:[],
ImgSid:[], ImgSid:[],
getImgsid:[],
} }
}, },
created() { created() {
@ -539,16 +540,22 @@
}) })
}, },
delSid(delSid){ delSid(delSid){
console.log(delSid.sid); let newVarImg=[]
for(var i=0;i<this.ImgSid.length;i++){ this.ImgSid.forEach(function check(value) {
if(this.ImgSid[i].sid==delSid.sid){ if(value.sid != delSid.sid) {
for(var i=0;i<this.ImgSid.length;i++){ newVarImg.push(value);
var ARRSid=[] }
ARRSid.push(this.ImgSid[i].sid) })
this.formobj.storeHouseProjectDto.shSids=ARRSid this.ImgSid=newVarImg
} console.log(this.ImgSid);
} var ARRSid=[]
// this.ImgSid=arrImg if(this.ImgSid.length>0){
for(var i=0;i<this.ImgSid.length;i++){
ARRSid.push(this.ImgSid[i].sid)
this.formobj.storeHouseProjectDto.shSids=ARRSid
}
}else{
this.formobj.storeHouseProjectDto.shSids=[]
} }
}, },
handleReturn(isreload) { handleReturn(isreload) {
@ -584,6 +591,7 @@
this.ImgSid=[] this.ImgSid=[]
this.ValSid=[] this.ValSid=[]
this.ARRSid=[] this.ARRSid=[]
this.getImgsid=[]
this.title= "【新增】项目信息", this.title= "【新增】项目信息",
this.$emit('doback') this.$emit('doback')
}, },
@ -627,6 +635,9 @@
req.selectStoreHouseSid(row.sid).then((res) => { req.selectStoreHouseSid(row.sid).then((res) => {
if (res.success) { if (res.success) {
this.ImgSid=res.data this.ImgSid=res.data
for(let i=0;i<this.ImgSid.length;i++){
this.getImgsid.push(this.ImgSid[i].sid)
}
} }
}) })
}, },
@ -638,12 +649,20 @@
}, },
guanlianSid(){ guanlianSid(){
let val=this.ValSid let val=this.ValSid
this.ImgSid=this.ValSid console.log(val);
for(let i=0;i<val.length;i++){ for(let i=0;i<val.length;i++){
this.ARRSid.push(val[i].sid) this.ARRSid.push(val[i].sid)
} }
var newArr = [...new Set(this.ARRSid)]; var oldArr = [...new Set(this.ARRSid)];
this.formobj.storeHouseProjectDto.shSids=newArr if(this.ImgSid){
let newArr =this.getImgsid.concat(oldArr);
let newImg=this.ImgSid.concat(this.ValSid);
this.ImgSid=[...new Set(newImg)];
this.formobj.storeHouseProjectDto.shSids=newArr
}else{
this.ImgSid=[...new Set(this.ValSid )]
this.formobj.storeHouseProjectDto.shSids=oldArr
}
this.drawer=false this.drawer=false
this.$refs.multipleTable.clearSelection(); this.$refs.multipleTable.clearSelection();
}, },

Loading…
Cancel
Save