【bug】 标协会员-基本信息、会员管理员增肌编辑的修改、增加两种不同的调用方式
This commit is contained in:
@@ -80,7 +80,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import pick from 'lodash.pick'
|
import pick from 'lodash.pick'
|
||||||
import { isEmail } from '../../../utils/validate'
|
import { isEmail } from '../../../utils/validate'
|
||||||
import { httpAction } from '@api/memberManage'
|
import { getAction, httpAction } from '@api/memberManage'
|
||||||
import { JSEncrypt } from 'jsencrypt'
|
import { JSEncrypt } from 'jsencrypt'
|
||||||
import { getEncryptedString } from '../../../api/standardsAssociationApi'
|
import { getEncryptedString } from '../../../api/standardsAssociationApi'
|
||||||
|
|
||||||
@@ -130,15 +130,20 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
url: {
|
url: {
|
||||||
edit: '/memberInfo/memberInfo/edit'
|
edit: '/memberInfo/memberInfo/edit',
|
||||||
|
detail: '/memberInfo/memberInfo/queryById'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
edit(record) {
|
edit(record) {
|
||||||
this.form.resetFields()
|
this.form.resetFields()
|
||||||
this.model = Object.assign({}, record)
|
|
||||||
this.visible = true
|
this.visible = true
|
||||||
|
// this.getMemberInfo(record)
|
||||||
|
this.setDataFunc(record)
|
||||||
|
},
|
||||||
|
setDataFunc(record) {
|
||||||
|
this.model = Object.assign({}, record)
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.form.setFieldsValue(pick(this.model, 'companyName', 'liaisonMan', 'mobile', 'email', 'validDate'))
|
this.form.setFieldsValue(pick(this.model, 'companyName', 'liaisonMan', 'mobile', 'email', 'validDate'))
|
||||||
})
|
})
|
||||||
@@ -148,14 +153,18 @@ export default {
|
|||||||
this.form.validateFields((err, values) => {
|
this.form.validateFields((err, values) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
this.confirmLoading = true
|
this.confirmLoading = true
|
||||||
const formData = Object.assign({}, values, {id: this.model.id})
|
const formData = Object.assign(this.model, values)
|
||||||
let encrypt = new JSEncrypt()
|
let encrypt = new JSEncrypt()
|
||||||
encrypt.setPublicKey(this.encryptedString)
|
encrypt.setPublicKey(this.encryptedString)
|
||||||
formData.mobile = encrypt.encrypt(values.mobile)
|
formData.standardPhone = encrypt.encrypt(formData.standardPhone)
|
||||||
formData.email = encrypt.encrypt(values.email)
|
formData.standardMobile = encrypt.encrypt(formData.standardMobile)
|
||||||
|
formData.standardEmail = encrypt.encrypt(formData.standardEmail)
|
||||||
|
formData.mobile = encrypt.encrypt(formData.mobile)
|
||||||
|
formData.email = encrypt.encrypt(formData.email)
|
||||||
|
formData.phone = encrypt.encrypt(formData.phone)
|
||||||
formData.rsapublickey = this.encryptedString
|
formData.rsapublickey = this.encryptedString
|
||||||
|
|
||||||
console.log('表单提交数据', formData)
|
|
||||||
httpAction(this.url.edit, formData, 'put').then((res) => {
|
httpAction(this.url.edit, formData, 'put').then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$message.success(res.message)
|
this.$message.success(res.message)
|
||||||
@@ -195,6 +204,22 @@ export default {
|
|||||||
this.encryptedString = res.result
|
this.encryptedString = res.result
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
/*
|
||||||
|
* 获取会员的详细信息
|
||||||
|
* */
|
||||||
|
getMemberInfo(record) {
|
||||||
|
// 会员用户id,后续在user等信息中调取
|
||||||
|
const memberId = record.id
|
||||||
|
const url = this.url.detail + '?id=' + memberId
|
||||||
|
getAction(url).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.setDataFunc(res.result)
|
||||||
|
}
|
||||||
|
if (res.code === 510) {
|
||||||
|
this.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// 获得公钥的相关信息
|
// 获得公钥的相关信息
|
||||||
|
|||||||
Reference in New Issue
Block a user