feat: 同步代码

This commit is contained in:
cgd_mac 2022-02-25 08:56:32 +08:00
commit 3034a1a3b0
2 changed files with 41 additions and 16 deletions

View File

@ -268,7 +268,8 @@
typeData: [], typeData: [],
fileList: [], fileList: [],
fileList2: [], fileList2: [],
fileList3: [] fileList3: [],
isRegister: 0
} }
}, },
mounted () { mounted () {
@ -277,9 +278,10 @@
methods: { methods: {
// //
registerEdit (record) { registerEdit (record) {
this.modalTitle = '新增人员' this.modalTitle = '审核人员'
this.confirmLoading = true this.confirmLoading = true
this.visible = true this.visible = true
this.isRegister = 1
this.registerDisabled = true this.registerDisabled = true
setTimeout(() => { setTimeout(() => {
@ -290,7 +292,9 @@
userName: record.userName, userName: record.userName,
phone: record.phone, phone: record.phone,
orgId: record.orgId, orgId: record.orgId,
orgName: record.orgName orgName: record.orgName,
id: record.personId, // personId
userId: record.userId
} }
) )
}, 100) }, 100)
@ -302,6 +306,7 @@
this.modalTitle = '编辑人员' this.modalTitle = '编辑人员'
this.confirmLoading = true this.confirmLoading = true
this.visible = true this.visible = true
this.isRegister = 0
this.registerDisabled = true this.registerDisabled = true
@ -382,30 +387,50 @@
handleSubmit () { handleSubmit () {
const { form: { validateFields } } = this const { form: { validateFields } } = this
this.confirmLoading = true this.confirmLoading = true
const _this = this
validateFields((errors, values) => { validateFields((errors, values) => {
if (!errors) { if (!errors) {
values.type = values.type.join(',') values.type = values.type.join(',')
values.idPhotoFace = JSON.stringify(this.fileList) values.idPhotoFace = JSON.stringify(this.fileList)
values.idPhotoBack = JSON.stringify(this.fileList2) values.idPhotoBack = JSON.stringify(this.fileList2)
if (this.fileList3.length > 0) values.avatar = this.fileList3[0].url if (this.fileList3.length > 0) values.avatar = this.fileList3[0].url
personAddOrUpdate(values).then((res) => {
this.confirmLoading = false
if (res.code === 200) {
this.$message.success('操作成功')
this.$emit('ok', values)
this.handleCancel() //
} else { if(_this.isRegister === 1) {
this.$message.error('操作失败:' + res.msg) this.$confirm({
} title: '提示',
}, (err) => { content: '确认通过审核吗?',
this.$message.error(err) onOk () {
}) values.isRegister = 1 //
_this.addOrUpdate(values)
},
onCancel () {}
})
} else {
_this.addOrUpdate(values)
}
} else { } else {
this.confirmLoading = false this.confirmLoading = false
} }
}) })
}, },
addOrUpdate (values) {
personAddOrUpdate(values).then((res) => {
this.confirmLoading = false
if (res.code === 200) {
this.$message.success('操作成功')
this.$emit('ok', values)
this.handleCancel()
} else {
this.$message.error('操作失败:' + res.msg)
}
}, (err) => {
this.$message.error(err)
})
},
idCardNoBlur (event) { idCardNoBlur (event) {
const idCardNo = event.target.value const idCardNo = event.target.value
this.analyzeIdCardNo(idCardNo) this.analyzeIdCardNo(idCardNo)

View File

@ -48,7 +48,7 @@
</a-card> </a-card>
<a-card :bordered="false"> <a-card :bordered="false">
<div class="table-operator"> <div class="table-operator">
<a-button @click="addPerson" icon="plus" type="primary" v-if="hasPerm('person:edit')">新增人员</a-button> <a-button @click="addPerson" icon="plus" type="primary" v-if="hasPerm('person:edit')">人员</a-button>
<template v-if="orgType === 1"> <template v-if="orgType === 1">
<a-button @click="transfer" type="primary" v-if="hasPerm('person:transfer')">转移部门</a-button> <a-button @click="transfer" type="primary" v-if="hasPerm('person:transfer')">转移部门</a-button>