分标委新增成员修改
This commit is contained in:
@@ -51,7 +51,7 @@ export default {
|
||||
}
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
type: [String, Object],
|
||||
required: false,
|
||||
default: undefined
|
||||
},
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<j-modal
|
||||
:title="title"
|
||||
:width="width"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
switchFullscreen
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭">
|
||||
:title="title"
|
||||
:width="width"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
switchFullscreen
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-row>
|
||||
@@ -32,11 +32,13 @@
|
||||
<a-row>
|
||||
<a-col :xl="12" :sm="24">
|
||||
<a-form-item label="姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<!-- 联系人使用将label、value合并为数组形式传值-->
|
||||
<select-contacts :selected-company="selectedCompany"
|
||||
placeholder="请选择联系人"
|
||||
v-decorator="['contactsId',validatorRules.contactsId]"
|
||||
v-decorator="['contacts',validatorRules.contacts]"
|
||||
:maxLength='50'
|
||||
ref="selectContacts"
|
||||
labelInValue
|
||||
@change="handleContactChange"
|
||||
@ok="addContactsOk"></select-contacts>
|
||||
</a-form-item>
|
||||
@@ -113,7 +115,7 @@ export default {
|
||||
rules: [{ required: true, message: '请选择企业' }],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
contactsId: {
|
||||
contacts: {
|
||||
rules: [{ required: true, message: '请选择联系人' }],
|
||||
validateTrigger: 'blur'
|
||||
}
|
||||
@@ -151,6 +153,9 @@ export default {
|
||||
if (!err) {
|
||||
let httpurl = this.url.add
|
||||
let method = 'post'
|
||||
// 拆分联系人信息
|
||||
values.contactsName = values.contacts.label
|
||||
values.contactsId = values.contacts.key
|
||||
const submitValue = Object.assign(this.model, values)
|
||||
const formData = {
|
||||
committeeId: submitValue.committeeId,
|
||||
@@ -184,12 +189,12 @@ export default {
|
||||
companyChange(value) {
|
||||
console.log(value)
|
||||
this.selectedCompany = value
|
||||
this.model.contactsId = undefined
|
||||
this.model.contacts = undefined
|
||||
this.model.email = undefined
|
||||
this.model.phone = undefined
|
||||
this.model.post = undefined
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model, 'contactsId', 'email', 'phone', 'post'))
|
||||
this.form.setFieldsValue(pick(this.model, 'contacts', 'email', 'phone', 'post'))
|
||||
})
|
||||
},
|
||||
/**
|
||||
@@ -204,7 +209,7 @@ export default {
|
||||
*/
|
||||
handleContactChange(value) {
|
||||
const param = {
|
||||
id: value
|
||||
id: value.key
|
||||
}
|
||||
getContactsById(param).then(res => {
|
||||
this.model = Object.assign(this.model, res.result)
|
||||
|
||||
Reference in New Issue
Block a user