Browse Source

Merge remote-tracking branch 'origin/feature/addTag'

origin/feature/operatingData
weikai 5 years ago
parent
commit
5b39f93884
  1. 76
      src/views/modules/user/hasAuthenticationpartymembers.vue
  2. 9
      src/views/modules/user/party-review.vue
  3. 215
      src/views/modules/user/party-user-tag.vue
  4. 117
      src/views/modules/user/pass-authentication-dialog.vue
  5. 54
      src/views/modules/user/pass-authentication.vue
  6. 112
      src/views/modules/user/tag-property.vue
  7. 145
      src/views/modules/user/tagproperty-add-or-update.vue
  8. 158
      src/views/modules/user/tagproperty.vue
  9. 251
      src/views/modules/user/tagpropertyDetail.vue
  10. 32
      src/views/modules/user/tagpropertyRoute.vue
  11. 171
      src/views/modules/user/user-tag1.vue
  12. 20
      src/views/modules/user/usertag.vue

76
src/views/modules/user/hasAuthenticationpartymembers.vue

@ -12,17 +12,6 @@
clearable>
</el-cascader>
</el-form-item>
<!-- <el-form-item label="注册状态">
<el-select v-model="dataForm.registFlag"
clearable
placeholder="请选择">
<el-option v-for="item in registOptions"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item> -->
<br>
<el-form-item label="姓名" label-width="68px">
<el-input v-model="dataForm.realName"
@ -71,14 +60,19 @@
type="success"
@click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item>
<el-form-item>
<el-button type="success"
@click="setTagHandle()">批量打身份标签</el-button>
</el-form-item>
<br>
</el-form>
<el-table v-loading="dataListLoading"
:data="dataList"
border
@selection-change="dataListSelectionChangeHandle"
@selection-change="handleSelectionChange"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column label="序号" header-align="center" align="center" width="50px">
<template slot-scope="scope">
{{scope.$index+1}}
@ -137,6 +131,17 @@
align="center"
min-width="350"
show-overflow-tooltip> </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="partyReview(scope.row.userId)">身份标签管理</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination :current-page="page"
:page-sizes="[10, 20, 50, 100]"
@ -147,11 +152,21 @@
@current-change="pageCurrentChangeHandle">
</el-pagination>
</div>
<!-- 党员认证 -->
<party-review v-if="partyReviewVisible"
@firstDialogCallBack="firstDialogCallBack"
ref="partyReview"
@refreshDataList="getDataList"></party-review>
<pass-authentication-dialog v-if="dialogVisible" ref="passAuthenticationDialog" @refreshDataList="getDataList" v-on:connectResponse="connectResponse">
</pass-authentication-dialog>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import PartyReview from './party-user-tag'
import PassAuthenticationDialog from './pass-authentication-dialog'
export default {
mixins: [mixinViewModule],
data () {
@ -174,6 +189,9 @@ export default {
startTime: '',
endTime: ''
},
tableSelected: [],
dialogVisible: false,
partyReviewVisible: false,
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.endTime
@ -204,6 +222,8 @@ export default {
}
},
components: {
PartyReview,
PassAuthenticationDialog
},
watch: {
'deptIdList': function (val) {
@ -274,6 +294,26 @@ export default {
this.dataForm.startTime = startDate
this.dataForm.endTime = endDate
},
handleSelectionChange (val) {
this.tableSelected = val
},
setTagHandle () {
if (this.tableSelected.length === 0) {
this.$message({
message: '请选择党员!',
type: 'warning'
})
return false
}
this.dialogVisible = true
this.$nextTick(() => {
var paramArr = []
for (var i = 0; i < this.tableSelected.length; i++) {
paramArr[i] = this.tableSelected[i].userId
}
this.$refs.passAuthenticationDialog.init(paramArr)
})
},
// getStreetList () {
// this.$http.get(`/sys/dept/sublist/` + (localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))).then(({ data: res }) => {
// if (res.code !== 0) {
@ -387,6 +427,18 @@ export default {
}).catch(() => {
this.dataListLoading = false
})
},
firstDialogCallBack (value) {
if (value) {
this.getDataList()
}
},
partyReview (userId) {
this.partyReviewVisible = true
this.$nextTick(() => {
this.$refs.partyReview.dataForm.id = userId
this.$refs.partyReview.init()
})
}
}
}

9
src/views/modules/user/party-review.vue

@ -55,15 +55,6 @@
该用户会认证为居民并加入已认证居民列表
</p>
</el-form-item>
<el-form-item v-if="dataForm.partyFlag == 1" 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-item label="扫码支部">
<el-form-item label="扫码网格">
<el-table :data="userGridList"

215
src/views/modules/user/party-user-tag.vue

@ -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>

117
src/views/modules/user/pass-authentication-dialog.vue

@ -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>

54
src/views/modules/user/pass-authentication.vue

@ -86,13 +86,18 @@
type="success"
@click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item>
<el-form-item>
<el-button type="success"
@click="setTagHandle()">批量打身份标签</el-button>
</el-form-item>
</div>
</el-form>
<el-table v-loading="dataListLoading"
:data="dataList"
border
@selection-change="dataListSelectionChangeHandle"
@selection-change="handleSelectionChange"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column label="序号" header-align="center" align="center" width="50px">
<template slot-scope="scope">
{{scope.$index+1}}
@ -133,6 +138,9 @@
<el-button type="text"
size="small"
@click="userGridHandle(scope.row.id)">管理支部</el-button>
<el-button type="text"
size="small"
@click="partyReview(scope.row.id)">身份标签管理</el-button>
<el-button type="text"
size="small"
@click="userDetailHandle(scope.row.id)">查看</el-button>
@ -156,6 +164,13 @@
<user-grid v-if="userGridVisible"
ref="userGrid"
@refreshDataList="getDataList"></user-grid>
<pass-authentication-dialog v-if="dialogVisible" ref="passAuthenticationDialog" @refreshDataList="getDataList" v-on:connectResponse="connectResponse">
</pass-authentication-dialog>
<user-tag v-if="tagVisble"
ref="userTag"
@refreshDataList="getDataList"></user-tag>
</div>
</el-card>
</template>
@ -164,7 +179,9 @@
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './user-add-or-update'
import UserDetail from './user-detail'
import UserTag from './user-tag1'
import UserGrid from './user-grid'
import PassAuthenticationDialog from './pass-authentication-dialog'
export default {
mixins: [mixinViewModule],
data () {
@ -189,6 +206,7 @@ export default {
partyFlag: '0', // (0-1-)
state: '3'
},
tableSelected: [],
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.endTime
@ -208,7 +226,9 @@ export default {
deptIdList: [],
options: [],
userDetailVisible: false,
tagVisble: false,
userGridVisible: false,
dialogVisible: false,
streetOptions: [],
communityOptions: [],
gridOptions: [],
@ -285,6 +305,26 @@ export default {
this.dataForm.startTime = startDate
this.dataForm.endTime = endDate
},
handleSelectionChange (val) {
this.tableSelected = val
},
setTagHandle () {
if (this.tableSelected.length === 0) {
this.$message({
message: '请选择居民!',
type: 'warning'
})
return false
}
this.dialogVisible = true
this.$nextTick(() => {
var paramArr = []
for (var i = 0; i < this.tableSelected.length; i++) {
paramArr[i] = this.tableSelected[i].id
}
this.$refs.passAuthenticationDialog.init(paramArr)
})
},
getStreetList () {
this.$http.get(`/sys/dept/sublist/` + (localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))).then(({ data: res }) => {
if (res.code !== 0) {
@ -386,11 +426,21 @@ export default {
e.target.value = e.target.value.replace(/[`~!#$%^&*()_\+=<>?:"{}|~!#¥%……&*()={}|《》?:“”【】\\[\]、;‘’,。、\s+]/g, '')
this.dataForm.mobile = e.target.value
},
partyReview(userId){
this.tagVisble = true
this.$nextTick(() => {
this.$refs.userTag.dataForm.id = userId
this.$refs.userTag.init()
})
}
},
components: {
AddOrUpdate,
UserDetail,
UserGrid
UserGrid,
UserTag,
PassAuthenticationDialog
}
}
</script>

112
src/views/modules/user/tag-property.vue

@ -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>

145
src/views/modules/user/tagproperty-add-or-update.vue

@ -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>

158
src/views/modules/user/tagproperty.vue

@ -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>

251
src/views/modules/user/tagpropertyDetail.vue

@ -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>

32
src/views/modules/user/tagpropertyRoute.vue

@ -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>

171
src/views/modules/user/user-tag1.vue

@ -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>

20
src/views/modules/user/usertag.vue

@ -22,10 +22,11 @@
label="序号" align="center"></el-table-column>
<el-table-column prop="tagName" label="标签名" header-align="center" align="center"></el-table-column>
<el-table-column prop="tagCode" label="标签编码" header-align="center" align="center"></el-table-column>
<el-table-column prop="tagDesc" label="标签描述" header-align="center" align="center"></el-table-column>
<el-table-column prop="tagDesc" label="标签描述" header-align="center" align="center" show-overflow-tooltip></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="addProperty(scope.row.id,scope.row.propertyIds)">配置属性</el-button>
<el-button v-if="$hasPermission('usertag:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('usertag:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
@ -42,6 +43,8 @@
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<!-- 弹框选择属性 -->
<master-user v-if="masterUserVisible" ref="masterUser" @refreshDataList="getDataList"></master-user>
</div>
</el-card>
</template>
@ -49,6 +52,7 @@
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './usertag-add-or-update'
import MasterUser from '@/views/modules/user/tag-property'
export default {
mixins: [mixinViewModule],
data () {
@ -61,11 +65,21 @@ export default {
},
dataForm: {
id: ''
}
},
masterUserVisible: false
}
},
components: {
AddOrUpdate
AddOrUpdate,
MasterUser
},
methods: {
addProperty (id, propertyIds) {
this.masterUserVisible = true
this.$nextTick(() => {
this.$refs.masterUser.init(id, propertyIds)
})
}
}
}
</script>

Loading…
Cancel
Save