fix 工作组成员单位维护编辑联系人清空及邮寄联系人下拉数据错误的问题
This commit is contained in:
@@ -41,7 +41,7 @@
|
|||||||
<a-col :xl="12" :sm="24">
|
<a-col :xl="12" :sm="24">
|
||||||
<a-form-item :label="`企业联系人${index + 1}`" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-form-item :label="`企业联系人${index + 1}`" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
<select-contacts :selected-company="selectedCompany"
|
<select-contacts :selected-company="selectedCompany"
|
||||||
:init-contacts="selectedContact1"
|
:init-contacts="model.payWorkingGroupSubItemContactsList[index]"
|
||||||
:placeholder="`请选择企业联系人${index + 1}`"
|
:placeholder="`请选择企业联系人${index + 1}`"
|
||||||
v-decorator="[`payWorkingGroupSubItemContactsList[${index}].contactsId`, {rules: [{ required: index === 0, validator: index === 0 ? validateContactRequired : validateContact }],validateTrigger: 'change'}]"
|
v-decorator="[`payWorkingGroupSubItemContactsList[${index}].contactsId`, {rules: [{ required: index === 0, validator: index === 0 ? validateContactRequired : validateContact }],validateTrigger: 'change'}]"
|
||||||
:maxLength='50'
|
:maxLength='50'
|
||||||
@@ -534,7 +534,8 @@ export default {
|
|||||||
// 默认的联系人数据
|
// 默认的联系人数据
|
||||||
defaultPayWorkingGroupSubItemContact: {
|
defaultPayWorkingGroupSubItemContact: {
|
||||||
contactsId: undefined,
|
contactsId: undefined,
|
||||||
remarks: null
|
remarks: null,
|
||||||
|
name: null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -605,18 +606,22 @@ export default {
|
|||||||
// 是否存在从收入合同传入的签订联系人id
|
// 是否存在从收入合同传入的签订联系人id
|
||||||
this.model.mailContactsId = this.signedContactId || this.model.mailContactsTemporaryId || undefined
|
this.model.mailContactsId = this.signedContactId || this.model.mailContactsTemporaryId || undefined
|
||||||
if (this.model.id) {
|
if (this.model.id) {
|
||||||
this.selectedContact1 = {
|
// 传给组件的init-contact值,需要id和name两个属性
|
||||||
id: this.model.contactsTemporaryIdOne,
|
this.model.payWorkingGroupSubItemContactsList && this.model.payWorkingGroupSubItemContactsList.forEach(item => {
|
||||||
name: this.model.contactsTemporaryNameOne
|
item.name = item.contactsTemporaryName
|
||||||
}
|
})
|
||||||
this.selectedContact2 = {
|
// this.selectedContact1 = {
|
||||||
id: this.model.contactsTemporaryIdTwo,
|
// id: this.model.contactsTemporaryIdOne,
|
||||||
name: this.model.contactsTemporaryNameTwo
|
// name: this.model.contactsTemporaryNameOne
|
||||||
}
|
// }
|
||||||
this.selectedContact3 = {
|
// this.selectedContact2 = {
|
||||||
id: this.model.contactsTemporaryIdThree,
|
// id: this.model.contactsTemporaryIdTwo,
|
||||||
name: this.model.contactsTemporaryNameThree
|
// name: this.model.contactsTemporaryNameTwo
|
||||||
}
|
// }
|
||||||
|
// this.selectedContact3 = {
|
||||||
|
// id: this.model.contactsTemporaryIdThree,
|
||||||
|
// name: this.model.contactsTemporaryNameThree
|
||||||
|
// }
|
||||||
this.selectedMailContact = {
|
this.selectedMailContact = {
|
||||||
id: this.model.mailContactsTemporaryId,
|
id: this.model.mailContactsTemporaryId,
|
||||||
name: this.model.mailContactsTemporaryName
|
name: this.model.mailContactsTemporaryName
|
||||||
@@ -784,14 +789,24 @@ export default {
|
|||||||
* @param value
|
* @param value
|
||||||
*/
|
*/
|
||||||
companyChange(value) {
|
companyChange(value) {
|
||||||
|
// 当前选中的企业和之前选中的企业一致,就不修改了
|
||||||
|
if (this.selectedCompany && value && this.selectedCompany.id === value.id) {
|
||||||
|
return
|
||||||
|
}
|
||||||
this.selectedCompany = value
|
this.selectedCompany = value
|
||||||
this.model.contactsIdOne = undefined
|
// this.model.contactsIdOne = undefined
|
||||||
this.model.contactsIdTwo = undefined
|
// this.model.contactsIdTwo = undefined
|
||||||
this.model.contactsIdThree = undefined
|
// this.model.contactsIdThree = undefined
|
||||||
|
// 处理默认显示的三个企业联系人
|
||||||
|
this.model.payWorkingGroupSubItemContactsList = []
|
||||||
|
this.model.payWorkingGroupSubItemContactsList.push(this.defaultPayWorkingGroupSubItemContact)
|
||||||
|
this.model.payWorkingGroupSubItemContactsList.push(this.defaultPayWorkingGroupSubItemContact)
|
||||||
|
this.model.payWorkingGroupSubItemContactsList.push(this.defaultPayWorkingGroupSubItemContact)
|
||||||
this.model.mailContactsId = undefined
|
this.model.mailContactsId = undefined
|
||||||
|
this.selectedMailContact = null
|
||||||
this.model.contractNum = undefined
|
this.model.contractNum = undefined
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.form.setFieldsValue(pick(this.model, 'contactsIdOne', 'contactsIdTwo', 'contactsIdThree', 'mailContactsId', 'contractNum'))
|
this.form.setFieldsValue(pick(this.model, 'mailContactsId', 'contractNum', 'payWorkingGroupSubItemContactsList'))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user