[bug] 表单下拉带出信息清除
This commit is contained in:
+15
-9
@@ -309,7 +309,7 @@ export default {
|
|||||||
},
|
},
|
||||||
principalId: {
|
principalId: {
|
||||||
rules: [{ required: true, message: '请选择负责人' }],
|
rules: [{ required: true, message: '请选择负责人' }],
|
||||||
validateTrigger: 'blur'
|
validateTrigger: 'change'
|
||||||
},
|
},
|
||||||
contractAmount: {
|
contractAmount: {
|
||||||
rules: [{ required: true, validator: this.checkMoney }],
|
rules: [{ required: true, validator: this.checkMoney }],
|
||||||
@@ -527,15 +527,21 @@ export default {
|
|||||||
* @param value
|
* @param value
|
||||||
*/
|
*/
|
||||||
principalChange(value) {
|
principalChange(value) {
|
||||||
let param = {
|
// value不为undefined
|
||||||
id: value
|
if (value) {
|
||||||
}
|
let param = {
|
||||||
getAllUserList(param).then(res => {
|
id: value
|
||||||
this.model.departmentName = res.result[0].orgCodeTxt
|
}
|
||||||
this.$nextTick(() => {
|
getAllUserList(param).then(res => {
|
||||||
this.form.setFieldsValue(pick(this.model, 'departmentName'))
|
this.model.departmentName = res.result[0].orgCodeTxt
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model, 'departmentName'))
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
return
|
||||||
|
}
|
||||||
|
// value为undefined时清除部门名称
|
||||||
|
this.form.setFieldsValue({departmentName: undefined})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 总签订金额修改
|
* 总签订金额修改
|
||||||
|
|||||||
@@ -589,19 +589,25 @@ export default {
|
|||||||
* @param value
|
* @param value
|
||||||
*/
|
*/
|
||||||
principalChange(value) {
|
principalChange(value) {
|
||||||
let param = {
|
// value不为undefined
|
||||||
id: value
|
if (value) {
|
||||||
}
|
let param = {
|
||||||
getAllUserList(param).then(res => {
|
id: value
|
||||||
if (res.success) {
|
|
||||||
this.model.departmentName = res.result[0].orgCodeTxt
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.form.setFieldsValue(pick(this.model, 'departmentName'))
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$message.warn(res.message)
|
|
||||||
}
|
}
|
||||||
})
|
getAllUserList(param).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.model.departmentName = res.result[0].orgCodeTxt
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model, 'departmentName'))
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// value为undefined时清除部门名称
|
||||||
|
this.form.setFieldsValue({departmentName: undefined})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 打包状态修改
|
* 打包状态修改
|
||||||
|
|||||||
@@ -283,18 +283,28 @@ export default {
|
|||||||
*/
|
*/
|
||||||
postContactChange(value) {
|
postContactChange(value) {
|
||||||
console.log(value)
|
console.log(value)
|
||||||
getContactsById({ id: value }).then(res => {
|
// value不为undefined
|
||||||
let obj = {
|
if (value) {
|
||||||
postalCode: res.result.postalCode,
|
getContactsById({ id: value }).then(res => {
|
||||||
contactAddress: res.result.contactAddress
|
let obj = {
|
||||||
}
|
postalCode: res.result.postalCode,
|
||||||
if (this.packContactId) {
|
contactAddress: res.result.contactAddress
|
||||||
this.packContact = obj
|
}
|
||||||
this.packContact.contactId = value
|
if (this.packContactId) {
|
||||||
} else {
|
this.packContact = obj
|
||||||
this.form.setFieldsValue(pick(obj, 'postalCode', 'contactAddress'))
|
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