[bug] 表单下拉带出信息清除
This commit is contained in:
@@ -283,18 +283,28 @@ export default {
|
||||
*/
|
||||
postContactChange(value) {
|
||||
console.log(value)
|
||||
getContactsById({ id: value }).then(res => {
|
||||
let obj = {
|
||||
postalCode: res.result.postalCode,
|
||||
contactAddress: res.result.contactAddress
|
||||
}
|
||||
if (this.packContactId) {
|
||||
this.packContact = obj
|
||||
this.packContact.contactId = value
|
||||
} else {
|
||||
this.form.setFieldsValue(pick(obj, 'postalCode', 'contactAddress'))
|
||||
}
|
||||
})
|
||||
// value不为undefined
|
||||
if (value) {
|
||||
getContactsById({ id: value }).then(res => {
|
||||
let obj = {
|
||||
postalCode: res.result.postalCode,
|
||||
contactAddress: res.result.contactAddress
|
||||
}
|
||||
if (this.packContactId) {
|
||||
this.packContact = obj
|
||||
this.packContact.contactId = value
|
||||
} else {
|
||||
this.form.setFieldsValue(pick(obj, 'postalCode', 'contactAddress'))
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
// value为undefined,清除邮政编码和通讯地址
|
||||
const obj = {
|
||||
postalCode: undefined,
|
||||
contactAddress: undefined
|
||||
}
|
||||
this.form.setFieldsValue(pick(obj, 'postalCode', 'contactAddress'))
|
||||
},
|
||||
/**
|
||||
* 清空本次开票金额
|
||||
|
||||
Reference in New Issue
Block a user