人员选择

master
lion 3 years ago
parent 0df5e3f9ab
commit 2611ec753d

@ -95,9 +95,10 @@ export default {
[this.getEventType(i.edit_input)]: (e) => { [this.getEventType(i.edit_input)]: (e) => {
if (i.field==='name') { if (i.field==='name') {
this.openRecords() this.openRecords()
this.form = Object.assign({}, this.form);
}else{ }else{
this.form[i.field] = e; this.form[i.field] = e;
// this.form = Object.assign({}, this.form);
} }
}, },
@ -218,6 +219,7 @@ export default {
this.$refs.recordModal.isShow = true this.$refs.recordModal.isShow = true
}, },
getRecordInfo(e){ getRecordInfo(e){
console.log(e)
for(var k in e){ for(var k in e){
for(var m in this.form){ for(var m in this.form){
if(m == k){ if(m == k){
@ -373,13 +375,16 @@ export default {
console.log("formInfo",this.formInfo) console.log("formInfo",this.formInfo)
this.formInfo.forEach((i) => { this.formInfo.forEach((i) => {
if (i && i.edit_input === "file") { if (i && i.edit_input === "file") {
this.file[i.field] = [ if(res[i._relations.link_with_name]){
{ this.file[i.field] = [
name: res[i._relations.link_with_name]?.original_name, {
url: res[i._relations.link_with_name]?.url, name: res[i._relations.link_with_name]?.original_name,
response: res[i._relations.link_with_name], url: res[i._relations.link_with_name]?.url,
}, response: res[i._relations.link_with_name],
]; },
];
}
} }
}); });
}, },
@ -407,7 +412,10 @@ export default {
); );
} }
if (info.edit_input === "file") { if (info.edit_input === "file") {
this.form[info.field] = this.file[info.field][0]?.response?.id; if(this.file[info.field]){
this.form[info.field] = this.file[info.field][0]?.response?.id;
}
} }
}); });
console.log(this.form); console.log(this.form);

Loading…
Cancel
Save