12 changed files with 1341 additions and 33 deletions
@ -0,0 +1,215 @@ |
|||
<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.partyTagIds" 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: '', |
|||
partyTagIds:[], |
|||
|
|||
}, |
|||
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 |
|||
}).catch(() => { }) |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/app-user/user/${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 = '' |
|||
}).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 () { |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
this.isAble = true |
|||
let userIds =[ |
|||
this.dataForm.id |
|||
] |
|||
let postData = { |
|||
userId: userIds, |
|||
tagIds: this.dataForm.partyTagIds |
|||
} |
|||
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> |
@ -0,0 +1,117 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" |
|||
title="选择身份标签" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
width="600px" |
|||
height="90%"> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-sys__user"> |
|||
<el-form :inline="true" :model="dataForm"> |
|||
<el-form-item label=""> |
|||
<el-form-item label="身份标签" prop="tagIds"> |
|||
<el-select v-model="dataForm.tagIds" placeholder="身份标签" multiple collapse-tags> |
|||
<el-option v-for="item in paramNameArr" :key="item.id" :label="item.tagName" :value="item.id" > |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form> |
|||
<el-button type="primary" @click="dataFormSubmitHandle()" :disabled="isAble" style="margin-left:48%" class="end">{{"确定"}}</el-button> |
|||
</el-form> |
|||
</div> |
|||
</el-card> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
import debounce from 'lodash/debounce' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/app-user/tagproperty/page', |
|||
getDataListIsPage: true, |
|||
deleteURL: '/app-user/tagproperty', |
|||
deleteIsBatch: true, |
|||
exportURL: '/app-user/tagproperty/export' |
|||
}, |
|||
visible: false, |
|||
dataForm: { |
|||
tagIds: [], |
|||
userId: [] |
|||
}, |
|||
paramNameArr: [], |
|||
isAble: false |
|||
} |
|||
}, |
|||
methods: { |
|||
// 获取数据列表 |
|||
init (paramArr) { |
|||
this.visible = true |
|||
this.isAble = false |
|||
this.$nextTick(() => { |
|||
this.dataForm.tagIds = [] |
|||
this.dataForm.userId = paramArr |
|||
// 调用获取标签属性下拉信息接口 |
|||
this.getParamListInfo() |
|||
}) |
|||
}, |
|||
// 获取标签属性下拉信息 |
|||
getParamListInfo () { |
|||
this.$http.get(`/app-user/usertag/partyTag`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.paramNameArr = res.data |
|||
}).catch(() => {}) |
|||
}, |
|||
// 表单提交 |
|||
dataFormSubmitHandle: debounce(function () { |
|||
if (this.dataForm.tagIds === null || this.dataForm.tagIds.length === 0) { |
|||
this.$message({ |
|||
message: '请选择标签!', |
|||
type: 'warning' |
|||
}) |
|||
return false |
|||
} |
|||
this.$confirm('批量打身份标签会替换已有身份标签!确定提交吗?', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
// 确定逻辑 |
|||
this.isAble = true |
|||
this.$http['post']('/app-user/usertagrelation/addTag', this.dataForm).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
this.isAble = false |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}).catch(() => {}) |
|||
}, 1000, { 'leading': true, 'trailing': false }) |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped lang='scss'> |
|||
.el-form{ |
|||
.end{ |
|||
margin-top: 10px; |
|||
} |
|||
} |
|||
.el-button--success{ |
|||
margin-top: 0px!important; |
|||
} |
|||
</style> |
@ -0,0 +1,112 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" |
|||
title="选择标签属性" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
width="600px" |
|||
height="90%"> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-sys__user"> |
|||
<el-form :inline="true" :model="dataForm"> |
|||
<el-form-item label=""> |
|||
<el-form-item label="标签属性" prop="tagPropertyids"> |
|||
<el-select v-model="dataForm.tagPropertyids" placeholder="标签属性" multiple collapse-tags> |
|||
<el-option v-for="item in paramNameArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" > |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form> |
|||
<el-button type="primary" @click="dataFormSubmitHandle()" :disabled="isAble" style="margin-left:48%" class="end">{{"确定"}}</el-button> |
|||
</el-form> |
|||
</div> |
|||
</el-card> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
import debounce from 'lodash/debounce' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/app-user/tagproperty/page', |
|||
getDataListIsPage: true, |
|||
deleteURL: '/app-user/tagproperty', |
|||
deleteIsBatch: true, |
|||
exportURL: '/app-user/tagproperty/export' |
|||
}, |
|||
visible: false, |
|||
dataForm: { |
|||
tagid: '', |
|||
tagPropertyids: [] |
|||
}, |
|||
paramNameArr: [], |
|||
isAble: false |
|||
} |
|||
}, |
|||
methods: { |
|||
// 获取数据列表 |
|||
init (tagId, propertyIds) { |
|||
this.visible = true |
|||
this.isAble = false |
|||
this.$nextTick(() => { |
|||
// 调用获取标签属性下拉信息接口 |
|||
this.getParamListInfo() |
|||
this.dataForm.tagid = tagId |
|||
if (propertyIds !== null) { |
|||
this.dataForm.tagPropertyids = propertyIds |
|||
} |
|||
}) |
|||
}, |
|||
// 获取标签属性下拉信息 |
|||
getParamListInfo () { |
|||
this.$http.get(`/app-user/property/listSimple`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.paramNameArr = res.data |
|||
}).catch(() => {}) |
|||
}, |
|||
// 表单提交 |
|||
dataFormSubmitHandle: debounce(function () { |
|||
if (this.dataForm.tagPropertyids === null || this.dataForm.tagPropertyids.length === 0) { |
|||
this.$message({ |
|||
message: '请选择标签属性!', |
|||
type: 'warning' |
|||
}) |
|||
return false |
|||
} |
|||
this.isAble = true |
|||
this.$http['post']('/app-user/tagproperty/', this.dataForm).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
this.isAble = false |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}, 1000, { 'leading': true, 'trailing': false }) |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped lang='scss'> |
|||
.el-form{ |
|||
.end{ |
|||
margin-top: 10px; |
|||
} |
|||
} |
|||
.el-button--success{ |
|||
margin-top: 0px!important; |
|||
} |
|||
</style> |
@ -0,0 +1,145 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :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="propertyName"> |
|||
<el-input v-model="dataForm.propertyName" placeholder="属性名称"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="属性值" prop="propertyValue"> |
|||
<el-input v-model="dataForm.propertyValue" placeholder="属性值"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="徽章图片地址" prop="url"> |
|||
<el-input v-model="dataForm.url" placeholder="徽章图片地址"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="备注" prop="remanrk"> |
|||
<el-input v-model="dataForm.remanrk" placeholder="备注"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="逻辑删除" prop="delFlag"> |
|||
<el-input v-model="dataForm.delFlag" placeholder="逻辑删除"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="乐观锁" prop="revision"> |
|||
<el-input v-model="dataForm.revision" placeholder="乐观锁"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="创建人" prop="createdBy"> |
|||
<el-input v-model="dataForm.createdBy" placeholder="创建人"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="创建时间" prop="createdTime"> |
|||
<el-input v-model="dataForm.createdTime" placeholder="创建时间"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="更新人" prop="updatedBy"> |
|||
<el-input v-model="dataForm.updatedBy" placeholder="更新人"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="更新时间" prop="updatedTime"> |
|||
<el-input v-model="dataForm.updatedTime" placeholder="更新时间"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<template slot="footer"> |
|||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|||
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
id: '', |
|||
propertyName: '', |
|||
propertyValue: '', |
|||
url: '', |
|||
remanrk: '', |
|||
delFlag: '', |
|||
revision: '', |
|||
createdBy: '', |
|||
createdTime: '', |
|||
updatedBy: '', |
|||
updatedTime: '' |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
propertyName: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
propertyValue: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
url: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
remanrk: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
delFlag: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
revision: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
createdBy: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
createdTime: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
updatedBy: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
updatedTime: [ |
|||
{ 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() |
|||
} |
|||
}) |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/news/tagproperty/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
// 表单提交 |
|||
dataFormSubmitHandle: debounce(function () { |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
this.$http[!this.dataForm.id ? 'post' : 'put']('/news/tagproperty/', this.dataForm).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}) |
|||
}, 1000, { 'leading': true, 'trailing': false }) |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,158 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-news__tagproperty}"> |
|||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> |
|||
<el-form-item label="属性名称"> |
|||
<el-input v-model="dataForm.propertyName" placeholder="属性名称" clearable></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="属性值"> |
|||
<el-input v-model="dataForm.propertyValue" placeholder="属性值" clearable></el-input> |
|||
</el-form-item> |
|||
<br> |
|||
<el-form-item label="注册时间" prop="startTime"> |
|||
<el-date-picker v-model="dataForm.startTime" |
|||
type="date" |
|||
:picker-options="pickerBeginDateBefore" |
|||
value-format="yyyy-MM-dd" |
|||
format="yyyy-MM-dd" |
|||
placeholder="选择日期时间" |
|||
style="width:200px" @change="changeTime"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="至" prop="endTime"> |
|||
<el-date-picker v-model="dataForm.endTime" |
|||
type="date" |
|||
:picker-options="pickerBeginDateAfter" |
|||
value-format="yyyy-MM-dd" |
|||
format="yyyy-MM-dd" |
|||
placeholder="选择日期时间" |
|||
style="width:200px" @change="changeTime"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button @click="getDataList()" type="success">{{ $t('query') }}</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button |
|||
type="primary" |
|||
@click="addOrUpdateHandle()">{{ $t('add') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> |
|||
<el-table-column label="序号" header-align="center" align="center" width="50px"> |
|||
<template slot-scope="scope"> |
|||
{{scope.$index+1}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="propertyName" label="属性名称" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="propertyValue" label="属性值" header-align="center" align="center"></el-table-column> |
|||
<el-table-column label="徽章" header-align="center" align="center"> |
|||
<template slot-scope="scope"> |
|||
<img :src="scope.row.url" width="40" height="40" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="remanrk" label="备注" header-align="center" show-overflow-tooltip align="center"></el-table-column> |
|||
<el-table-column prop="createdTime" label="创建时间" header-align="center" align="center"></el-table-column> |
|||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> |
|||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination |
|||
:current-page="page" |
|||
:page-sizes="[10, 20, 50, 100]" |
|||
:page-size="limit" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
@size-change="pageSizeChangeHandle" |
|||
@current-change="pageCurrentChangeHandle"> |
|||
</el-pagination> |
|||
<!-- 弹窗, 新增 / 修改 --> |
|||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
|||
</div> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
import AddOrUpdate from './tagproperty-add-or-update' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/app-user/property/page', |
|||
getDataListIsPage: true, |
|||
deleteURL: '/app-user/property', |
|||
deleteIsBatch: true |
|||
}, |
|||
dataForm: { |
|||
id: '', |
|||
propertyName:'', |
|||
propertyValue:'', |
|||
startTime:"", |
|||
endTime:"" |
|||
}, |
|||
pickerBeginDateBefore: { |
|||
disabledDate: (time) => { |
|||
let beginDateVal = this.dataForm.endTime |
|||
if (beginDateVal) { |
|||
return time.getTime() > new Date(beginDateVal + ' 00:00:00').getTime() |
|||
} |
|||
} |
|||
}, |
|||
pickerBeginDateAfter: { |
|||
disabledDate: (time) => { |
|||
let EndDateVal = this.dataForm.startTime |
|||
if (EndDateVal) { |
|||
return time.getTime() < new Date(EndDateVal + ' 00:00:00').getTime() |
|||
} |
|||
} |
|||
}, |
|||
} |
|||
}, |
|||
components: { |
|||
AddOrUpdate |
|||
}, |
|||
created () { |
|||
this.getDataList(); |
|||
this.initTime() |
|||
}, |
|||
methods:{ |
|||
addOrUpdateHandle (id, disabled) { |
|||
this.$parent.selectComponent = 'UserTagPropertyDetail' |
|||
this.$router.push({ path: '/user-tagpropertyRoute', query: { id: id, disabled: disabled } }) |
|||
}, |
|||
initTime () { |
|||
const end = new Date() |
|||
const start = new Date() |
|||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30) |
|||
this.time = [start, end] |
|||
let year = start.getFullYear() |
|||
let month = start.getMonth() + 1 |
|||
if (month < 10) { |
|||
month = '0' + month |
|||
} |
|||
let date = start.getDate() |
|||
if (date < 10) { |
|||
date = '0' + date |
|||
} |
|||
let startDate = year + '-' + month + '-' + date |
|||
let yearend = end.getFullYear() |
|||
let monthend = end.getMonth() + 1 |
|||
if (monthend < 10) { |
|||
monthend = '0' + monthend |
|||
} |
|||
let dateend = end.getDate() |
|||
if (dateend < 10) { |
|||
dateend = '0' + dateend |
|||
} |
|||
let endDate = yearend + '-' + monthend + '-' + dateend |
|||
this.dataForm.startTime = startDate |
|||
this.dataForm.endTime = endDate |
|||
}, |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,251 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'" > |
|||
<el-form-item label="属性名称" prop="propertyName" label-width="100px"> |
|||
<el-input |
|||
placeholder="请输入属性名称" |
|||
v-model="dataForm.propertyName" |
|||
style="width:50%"> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item label="属性值" prop="propertyValue" label-width="100px"> |
|||
<el-input |
|||
placeholder="请输入属性值" |
|||
v-model="dataForm.propertyValue" |
|||
style="width:50%"> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item label="徽章图片" v-loading="loading" prop="images" label-width="100px"> |
|||
<el-upload |
|||
ref="upload" |
|||
:action="uploadUrl" |
|||
:class="{hide:hideUpload}" |
|||
list-type="picture-card" |
|||
:file-list="dataForm.replyPicture" |
|||
:limit=1 |
|||
:on-preview="handlePictureCardPreview" |
|||
:on-remove="handleRemove" |
|||
:on-success="handleAvatarSuccess" |
|||
:on-error="handelError" |
|||
:before-upload="beforeAvatarUpload" |
|||
style="width:480px"> |
|||
<i class="el-icon-plus"></i> |
|||
</el-upload> |
|||
<el-dialog :visible.sync="dialogVisible"> |
|||
<img width="100%" :src="dialogImageUrl" alt=""> |
|||
</el-dialog> |
|||
</el-form-item> |
|||
<el-form-item label="备注" label-width="100px"> |
|||
<el-input |
|||
type="textarea" |
|||
:rows="3" |
|||
placeholder="请输入备注,100字以内" |
|||
v-model="dataForm.remanrk" |
|||
maxlength="2000" |
|||
style="width:50%"> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-form> |
|||
<el-form-item style="margin-left:35px;"> |
|||
<el-button type="primary" @click="backToUserRelationList">{{"返回"}}</el-button> |
|||
<el-button type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
import Cookies from 'js-cookie' |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
pove: false, |
|||
dataForm: { |
|||
id:'', |
|||
propertyName:'', |
|||
propertyValue:'', |
|||
replyPicture: [], |
|||
remanrk:'', |
|||
}, |
|||
isAble: false, |
|||
replyInfoState: false, |
|||
meetTypeArr: [], |
|||
dailyTypeArr: [], |
|||
hideUpload: false, |
|||
|
|||
pageDisabled: false, |
|||
|
|||
uploadUrl: '', |
|||
loading: false, |
|||
dialogImageUrl: '', |
|||
dialogVisible: false, |
|||
options: [] |
|||
} |
|||
}, |
|||
created: function () { |
|||
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadImg?token=${Cookies.get('token')}` |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
propertyName: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
propertyValue: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
mounted () { |
|||
this.pageDisabled = this.$route.query.disabled |
|||
this.hideUpload = this.$route.query.disabled |
|||
if (this.$route.query.id !== '' && this.$route.query.id != null) { |
|||
this.dataForm.id = this.$route.query.id |
|||
this.getInfo() |
|||
} else { |
|||
|
|||
} |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} |
|||
}) |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/app-user/property/${this.dataForm.id}`).then(({ data: res }) => { |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data, |
|||
} |
|||
let picture=[ |
|||
{ |
|||
url : res.data.url, |
|||
breviaryUrl : res.data.url |
|||
} |
|||
]; |
|||
if (res.data.url === ''){ |
|||
picture=[]; |
|||
} |
|||
this.dataForm.replyPicture = picture; |
|||
if (res.data.url === ''){ |
|||
this.hideUpload=false |
|||
}else { |
|||
this.hideUpload=true |
|||
} |
|||
|
|||
}).catch(() => {}) |
|||
}, |
|||
// 表单提交 |
|||
dataFormSubmitHandle: debounce(function () { |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
let pageDate={ |
|||
id:this.dataForm.id, |
|||
propertyName: this.dataForm.propertyName, |
|||
propertyValue:this.dataForm.propertyValue, |
|||
url: this.dataForm.replyPicture[0] === undefined ? '' : this.dataForm.replyPicture[0].url, |
|||
remanrk: this.dataForm.remanrk, |
|||
} |
|||
this.$http[!this.dataForm.id ? 'post' : 'put']('/app-user/property', pageDate).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
this.backToUserRelationList(); |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}) |
|||
}, 1000, { 'leading': true, 'trailing': false }), |
|||
|
|||
handleAvatarSuccess (res, file) { |
|||
this.loading = false |
|||
this.isAble = false |
|||
if (res === null || res.data === null || res.data.imgUrl === null) { |
|||
this.$message.error('文件上传失败!') |
|||
this.handleErrorRemove(file) |
|||
return false |
|||
} |
|||
this.dataForm.replyPicture.push({ url: res.data.imgUrl, breviaryUrl: res.data.thumbnail, fileType: 1 }) |
|||
this.hideUpload = this.dataForm.replyPicture.length >= 1 |
|||
}, |
|||
handleErrorRemove (file) { |
|||
// 实现缩略图模板时删除文件 |
|||
let fileList = this.$refs.upload.uploadFiles |
|||
for (var i = 0; i < fileList.length; i++) { |
|||
let item = fileList[i] |
|||
if (item.url === file.url) { |
|||
fileList.splice(i, 1) |
|||
} |
|||
} |
|||
}, |
|||
handelError () { |
|||
this.loading = false |
|||
this.isAble = false |
|||
this.$message.error('上传文件失败!') |
|||
}, |
|||
handlePictureCardPreview (file) { |
|||
this.dialogImageUrl = file.url |
|||
this.dialogVisible = true |
|||
}, |
|||
handleRemove (file, fileList) { |
|||
for (var i = 0; i < this.dataForm.replyPicture.length; i++) { |
|||
let item = this.dataForm.replyPicture[i] |
|||
if (item.url === file.url) { |
|||
this.dataForm.replyPicture.splice(i, 1) |
|||
} |
|||
} |
|||
this.hideUpload = this.dataForm.replyPicture.length >= 1 |
|||
}, |
|||
beforeAvatarUpload (file) { |
|||
if (this.dataForm.replyPicture.length === 1) { |
|||
this.$message.error('最多上传1张图片!') |
|||
return false |
|||
} |
|||
this.loading = true |
|||
this.isAble = true |
|||
const isJPG = file.type === 'image/jpeg' |
|||
const isPNG = file.type === 'image/png' |
|||
// const isLt1M = file.size / 1024 / 1024 < 1 |
|||
// 判断是否符合格式要求 |
|||
if (!isJPG && !isPNG) { |
|||
this.$message.error('上传文件必须是jpg、png格式!') |
|||
this.loading = false |
|||
this.isAble = false |
|||
return false |
|||
} |
|||
}, |
|||
// 返回按钮点击事件 |
|||
backToUserRelationList () { |
|||
this.$emit('UserTagProperty') |
|||
this.$parent.selectComponent = 'UserTagProperty' |
|||
this.$router.push({ path: '/user-tagpropertyRoute' }) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
.hide .el-upload--picture-card { |
|||
display: none; |
|||
} |
|||
</style> |
@ -0,0 +1,32 @@ |
|||
<template> |
|||
<keep-alive include="UserTagPorperty"> |
|||
<component :is="selectComponent"></component> |
|||
</keep-alive> |
|||
</template> |
|||
|
|||
<script> |
|||
import UserTagProperty from './tagproperty' |
|||
import UserTagPropertyDetail from './tagpropertyDetail' |
|||
|
|||
export default { |
|||
name: 'tagpropertyRoute', |
|||
data () { |
|||
return { |
|||
selectComponent: UserTagProperty |
|||
} |
|||
}, |
|||
components: { |
|||
UserTagProperty, |
|||
UserTagPropertyDetail |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.selectComponent = UserTagProperty |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
@ -0,0 +1,171 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" |
|||
title="用户详情" |
|||
: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" v-if="dataForm.realName"> |
|||
<span>{{dataForm.realName}}</span> |
|||
</el-form-item> |
|||
<el-form-item label="手机号" |
|||
prop="mobile" v-if="dataForm.mobile"> |
|||
<span>{{dataForm.mobile}}</span> |
|||
</el-form-item> |
|||
<el-form-item label="身份证号" |
|||
prop="identityNo" v-if="dataForm.identityNo"> |
|||
<span>{{dataForm.identityNo}}</span> |
|||
</el-form-item> |
|||
<el-form-item label="居民住址" |
|||
prop="address" v-if="dataForm.address"> |
|||
<span>{{dataForm.address}}</span> |
|||
</el-form-item> |
|||
<el-form-item label="是否党员" v-if="false" |
|||
prop="partyFlag"> |
|||
<span v-if="dataForm.partyFlag === '0'">否</span> |
|||
<span v-if="dataForm.partyFlag === '1'">是</span> |
|||
</el-form-item> |
|||
<el-form-item label="通过审核" |
|||
prop="state" v-if="dataForm.state==='3'||dataForm.state==='2'"> |
|||
<span v-if="dataForm.state === '3'">是</span> |
|||
<span v-if="dataForm.state === '2'">否</span> |
|||
</el-form-item> |
|||
<el-form-item v-if="dataForm.state === '2' && dataForm.remark" |
|||
label="审核备注" |
|||
prop="remark"> |
|||
<span>{{dataForm.remark}}</span> |
|||
</el-form-item> |
|||
<el-form-item label="身份标签" > |
|||
<el-select v-model="dataForm.partyTagIds" 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 @click="dataFormSubmitHandle()" |
|||
type="primary">{{ $t('confirm') }}</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
|
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
id: '', |
|||
partyFlag: '', |
|||
cadreFlag: '', |
|||
state: '', |
|||
remark: '', |
|||
partyTagIds: [] |
|||
}, |
|||
partyFlagOptions: [{ id: '0', name: '不是' }, { id: '1', name: '是' }], |
|||
cadreOptions: [{ cadreFlag: '1', cadreTitle: '是' }, { cadreFlag: '0', cadreTitle: '否' }], |
|||
tagOptions: [], |
|||
userGridList: [] |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
this.queryUserGridList() |
|||
} |
|||
}) |
|||
this.getTagOptions() |
|||
}, |
|||
getTagOptions () { |
|||
this.$http.get(`/app-user/usertag/list`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.tagOptions = res.data |
|||
}).catch(() => { }) |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/app-user/user/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
this.dataForm.tagIds = [] |
|||
}).catch(() => { }) |
|||
}, |
|||
// 获取用户网格列表 |
|||
queryUserGridList () { |
|||
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(() => { }) |
|||
}, |
|||
showLeaderFlagFormatter (row, column, cellValue, index) { |
|||
console.log(cellValue) |
|||
if (cellValue === '1') { |
|||
return '是' |
|||
} else { |
|||
return '否' |
|||
} |
|||
}, |
|||
// 确定 |
|||
dataFormSubmitHandle: debounce(function () { |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
this.isAble = true |
|||
let userIds =[ |
|||
this.dataForm.id |
|||
] |
|||
let postData = { |
|||
userId: userIds, |
|||
tagIds: this.dataForm.partyTagIds |
|||
} |
|||
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 }), |
|||
} |
|||
} |
|||
</script> |
Loading…
Reference in new issue