diff --git a/src/views/mtm/route_form.vue b/src/views/mtm/route_form.vue index 7d9413e6..d21437d8 100644 --- a/src/views/mtm/route_form.vue +++ b/src/views/mtm/route_form.vue @@ -457,9 +457,14 @@ export default { }, //合并新增的图片Ids imagesDel(index){ - this.fileIds.splice(index,1); - this.paramsJsonFileurl.splice(index,1); - this.params_json.fileurl = JSON.stringify(this.paramsJsonFileurl); + let that = this; + that.fileIds.splice(index,1); + let id = that.paramsJsonFileurl[index].id; + let list = that.fileurl_form.filter(item => item.id != id); + that.fileurl_form = list; + let list1 = that.paramsJsonFileurl.filter(item1 => item1.id != id); + that.paramsJsonFileurl = list1; + that.params_json.fileurl = JSON.stringify(that.paramsJsonFileurl); }, //显示 open(mode = "add") { @@ -487,14 +492,17 @@ export default { that.params_json2=that.form.params_json; } if(data.process_name=='排一次棒'){ + that.fileIds= []; that.params_json=that.form.params_json; if(that.params_json.fileurl&&that.params_json.fileurl!=="[]"){ let fileurl = JSON.parse(that.params_json.fileurl); fileurl.forEach((item)=>{ item.url = item.path; + that.fileIds.push(item.id); that.fileurl.push(item); that.fileurl_form.push(item); }) + that.paramsJsonFileurl = that.fileurl_form; } } setTimeout(() => {