3 changed files with 254 additions and 21 deletions
@ -0,0 +1,222 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" |
|||
title="身份标签管理" |
|||
:modal-append-to-body="false" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false"> |
|||
<el-form :model="dataForm" |
|||
:rules="dataRule" |
|||
ref="dataForm" |
|||
@keyup.enter.native="dataFormSubmitHandle()" |
|||
:label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> |
|||
<el-form-item label="姓名" |
|||
prop="realName"> |
|||
<el-input v-model="dataForm.realName" |
|||
placeholder="请输入" |
|||
clearable></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="手机号" |
|||
prop="mobile"> |
|||
<el-input v-model="dataForm.mobile" |
|||
placeholder="请输入" |
|||
clearable></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="身份证号" |
|||
prop="identityNo"> |
|||
<el-input v-model="dataForm.identityNo" |
|||
placeholder="请输入" |
|||
clearable></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="认证支部" |
|||
prop="allDeptNames"> |
|||
<span>{{dataForm.allDeptNames}}</span> |
|||
</el-form-item> |
|||
<el-form-item label="身份标签" > |
|||
<el-select v-model="dataForm.tagIdsNew" multiple collapse-tags placeholder="请选择身份标签"> |
|||
<el-option v-for="item in tagOptions" |
|||
:key="item.id" |
|||
:label="item.tagName" |
|||
:value="item.id"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<template slot="footer"> |
|||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|||
<el-button type="primary" |
|||
:disabled="isAble" |
|||
@click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
|
|||
export default { |
|||
name: 'party-user-tag', |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
identityNoRepeatVisible: false, |
|||
realNameRepeatVisible: false, |
|||
isAble: false, |
|||
dataForm: { |
|||
id: '', |
|||
partyFlag: '1', |
|||
cadreFlag: '', |
|||
state: '', |
|||
tagIds: [], |
|||
remark: '', |
|||
totalSubmitNum: '', |
|||
totalPassSubmitNum: '', |
|||
totalFailNum: '', |
|||
realName: '', |
|||
mobile: '', |
|||
identityNo: '', |
|||
tagIdsNew:[], |
|||
|
|||
}, |
|||
authenticateHistoryVisible: false, |
|||
cadreOptions: [{ cadreFlag: '1', cadreTitle: '是' }, { cadreFlag: '0', cadreTitle: '否' }], |
|||
tagOptions: [ |
|||
|
|||
], |
|||
userGridList: [], |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
realName: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
mobile: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
identityNo: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
partyFlag: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} |
|||
}) |
|||
this.getTagOptions() |
|||
}, |
|||
getTagOptions () { |
|||
this.$http.get(`/app-user/usertag/partyTag`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.tagOptions = res.data |
|||
// this.tagOptions =[ |
|||
// {id:"11125",tagName:"党员"}, |
|||
// {id:"11124",tagName:"入党积极分子"}, |
|||
// {id:"11123",tagName:"双认证党员"}, |
|||
// {id:"11122",tagName:"基层干部"}, |
|||
// {id:"11121",tagName:"书记"} |
|||
// ] |
|||
}).catch(() => { }) |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/app-user/partymembers/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
this.dataForm.partyFlag = '1' // 默认是党员 |
|||
this.dataForm.tagIds = [] |
|||
this.dataForm.partyFlag = '' |
|||
this.dataForm.tagIds = '' |
|||
this.dataForm.partyTagIds = [] |
|||
}).catch(() => { }) |
|||
this.$http.get(`/app-user/usergrid/listUserGrid/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.userGridList = res.data |
|||
}).catch(() => { }) |
|||
}, |
|||
// 确定 |
|||
dataFormSubmitHandle: debounce(function () { |
|||
debugger |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
this.isAble = true |
|||
let postData = { |
|||
userId: this.dataForm.id, |
|||
tagIds: this.dataForm.tagIdsNew |
|||
} |
|||
this.$http[!this.dataForm.id ? 'post' : 'post']('/app-user/usertagrelation/addTag/', postData).then(({ data: res }) => { |
|||
this.isAble = false |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
} |
|||
}) |
|||
} |
|||
}).catch(() => { }) |
|||
}) |
|||
}, 1000, { 'leading': true, 'trailing': false }), |
|||
registerResult (userId) { |
|||
this.$http.get(`api/message/sms/registerResult?userId=` + userId).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
}).catch(() => { }) |
|||
}, |
|||
// 查看详情 |
|||
userAuthenticateHistoryListHandle (userId) { |
|||
if (!this.dataForm.totalSubmitNum > 0) { |
|||
return this.$message.error('累计提交' + this.dataForm.totalSubmitNum + '次,没有认证历史记录') |
|||
} |
|||
this.authenticateHistoryVisible = true |
|||
this.$nextTick(() => { |
|||
this.$refs.authenticateHistory.dataForm.userId = userId |
|||
this.$refs.authenticateHistory.init() |
|||
}) |
|||
}, |
|||
showLeaderFlagFormatter (row, column, cellValue, index) { |
|||
if (cellValue === '1') { |
|||
return '是' |
|||
} else { |
|||
return '否' |
|||
} |
|||
}, |
|||
secondDialogCallBack (value) { |
|||
if (value) { |
|||
this.visible = false |
|||
this.$emit('firstDialogCallBack', true) |
|||
} |
|||
} |
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
Loading…
Reference in new issue