fix: 工艺路线排一次棒上传图片问题

This commit is contained in:
shijing 2026-01-20 11:20:26 +08:00
parent 4d23c5467a
commit adbd936382
1 changed files with 11 additions and 3 deletions

View File

@ -457,9 +457,14 @@ export default {
}, },
//Ids //Ids
imagesDel(index){ imagesDel(index){
this.fileIds.splice(index,1); let that = this;
this.paramsJsonFileurl.splice(index,1); that.fileIds.splice(index,1);
this.params_json.fileurl = JSON.stringify(this.paramsJsonFileurl); 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") { open(mode = "add") {
@ -487,14 +492,17 @@ export default {
that.params_json2=that.form.params_json; that.params_json2=that.form.params_json;
} }
if(data.process_name=='排一次棒'){ if(data.process_name=='排一次棒'){
that.fileIds= [];
that.params_json=that.form.params_json; that.params_json=that.form.params_json;
if(that.params_json.fileurl&&that.params_json.fileurl!=="[]"){ if(that.params_json.fileurl&&that.params_json.fileurl!=="[]"){
let fileurl = JSON.parse(that.params_json.fileurl); let fileurl = JSON.parse(that.params_json.fileurl);
fileurl.forEach((item)=>{ fileurl.forEach((item)=>{
item.url = item.path; item.url = item.path;
that.fileIds.push(item.id);
that.fileurl.push(item); that.fileurl.push(item);
that.fileurl_form.push(item); that.fileurl_form.push(item);
}) })
that.paramsJsonFileurl = that.fileurl_form;
} }
} }
setTimeout(() => { setTimeout(() => {