6 changed files with 506 additions and 31 deletions
@ -0,0 +1,200 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" |
|||
title="选择干部" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
width="80%" |
|||
height="90%"> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-sys__user"> |
|||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataListSearch()"> |
|||
<el-form-item label="用户名"> |
|||
<el-input v-model="dataForm.username" :placeholder="$t('user.username')" clearable maxlength="10" @keyup.native="btKeyUpUserName"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="真实姓名"> |
|||
<el-input v-model="dataForm.realname" placeholder='真实姓名' clearable maxlength="10" @keyup.native="btKeyUpRealname"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="邮箱"> |
|||
<el-input v-model="dataForm.email" placeholder="邮箱" clearable maxlength="20" @keyup.native="btKeyUpEmail"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="手机号"> |
|||
<el-input v-model="dataForm.mobile" placeholder="手机号" clearable maxlength="11" @keyup.native="btKeyUpMobile"></el-input> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button @click="getDataList()" type="success">{{ $t('query') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table v-loading="dataListLoading" :data="dataList" max-height="450" style="width: 100%;" @selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> |
|||
<el-table-column |
|||
type="index" |
|||
header-align="center" |
|||
align="center" |
|||
width="50" |
|||
label='序号' |
|||
></el-table-column> |
|||
<el-table-column prop="username" :label="$t('user.username')" sortable="custom" header-align="center" align="center" width="100"></el-table-column> |
|||
<el-table-column prop="realName" :label="$t('user.realName')" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="deptName" :label="$t('user.deptName')" header-align="center" align="center" min-width="120"></el-table-column> |
|||
<el-table-column prop="email" :label="$t('user.email')" header-align="center" align="center" width="200"></el-table-column> |
|||
<el-table-column prop="mobile" :label="$t('user.mobile')" sortable="custom" header-align="center" align="center" width="120"></el-table-column> |
|||
<el-table-column prop="status" :label="$t('user.status')" sortable="custom" header-align="center" align="center" width="180"> |
|||
<template slot-scope="scope"> |
|||
<el-tag v-if="scope.row.status === 0" size="small" type="danger">{{ $t('user.status0') }}</el-tag> |
|||
<el-tag v-else size="small" type="success">{{ $t('user.status1') }}</el-tag> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="createDate" :label="$t('user.createDate')" sortable="custom" header-align="center" align="center" width="180"></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> |
|||
<el-form> |
|||
<el-button type="primary" :disabled="isAble" @click="submitGroupUser()" style="margin-left:48%" class="end">{{"确定"}}</el-button> |
|||
</el-form> |
|||
</div> |
|||
</el-card> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
|
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/sys/user/getGroupUser', |
|||
getDataListIsPage: true, |
|||
deleteURL: '/sys/user', |
|||
deleteIsBatch: true, |
|||
exportURL: '/sys/user/export' |
|||
}, |
|||
visible: false, |
|||
dataForm: { |
|||
groupId:'', |
|||
username: '', |
|||
realname: '', |
|||
mobile: '', |
|||
email: '', |
|||
userIds:'' |
|||
}, |
|||
isAble: false, |
|||
pageIndex: 1, |
|||
limitVal: 10, |
|||
userIdListl:[], |
|||
responseData: [] |
|||
} |
|||
}, |
|||
methods: { |
|||
btKeyUpUserName (e) { |
|||
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_\-+=<>?:"{}|·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/g, '') |
|||
this.dataForm.username = e.target.value |
|||
}, |
|||
btKeyUpRealname (e) { |
|||
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_\-+=<>?:"{}|·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/g, '') |
|||
this.dataForm.realname = e.target.value |
|||
}, |
|||
btKeyUpEmail (e) { |
|||
e.target.value = e.target.value.replace(/[`~!#$%^&*()_\-+=<>?:"{}|~!#¥%……&*()——={}|《》?:“”【】、;‘’,。、]/g, '') |
|||
this.dataForm.email = e.target.value |
|||
}, |
|||
btKeyUpMobile (e) { |
|||
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_=<>?:"{}|·~!@#¥%……&*()——={}|《》?:“”【】、;‘’,。、]/g, '') |
|||
this.dataForm.mobile = e.target.value |
|||
}, |
|||
getDataListOverWrite () { |
|||
this.page = 1 |
|||
this.getDataList() |
|||
}, |
|||
// 获取数据列表 |
|||
// getGroupUserList () { |
|||
// this.$http |
|||
// .get(`/sys/user/getGroupUser`,{ |
|||
// params: { username: this.dataForm.username, realname: this.dataForm.realname, |
|||
// mobile: this.dataForm.mobile, email: this.dataForm.email, userIds: this.dataForm.userIds, |
|||
// page: this.pageIndex, limit: this.limitVal} |
|||
// }) |
|||
// .then(({ data: res }) => { |
|||
// if (res.code !== 0) { |
|||
// return this.$message.error(res.msg) |
|||
// } |
|||
// this.dataList = res.data |
|||
// }) |
|||
// .catch(() => {}) |
|||
// }, |
|||
// 获取数据列表 |
|||
init () { |
|||
this.dataForm.userIds = this.userIdListl.join(",") |
|||
this.visible = true |
|||
this.isAble = false |
|||
this.$nextTick(() => { |
|||
this.getDataList() |
|||
}) |
|||
}, |
|||
handleSelectionChange (val) { |
|||
this.responseData = val |
|||
}, |
|||
// 返回主列表 |
|||
backToGroupList () { |
|||
this.$emit('refreshDataList') |
|||
// this.$parent.selectComponent = 'Helpgroup' |
|||
// this.$router.push({ path: '/helpgrouproute' }) |
|||
}, |
|||
submitGroupUser(){ |
|||
if (this.responseData.length === 0) { |
|||
this.$message({ |
|||
message: '请选择干部!', |
|||
type: 'warning' |
|||
}) |
|||
return false |
|||
} |
|||
this.isAble = true |
|||
this.$http.post(`/workRecord/groupcadrerelation/submitGroupUser`, |
|||
{groupId:this.dataForm.groupId,userList:this.responseData}).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.backToGroupList() |
|||
} |
|||
}) |
|||
this.visible = false |
|||
}).catch(() => {}) |
|||
}, |
|||
getInfo () { |
|||
if (this.responseData.length === 0) { |
|||
this.$message({ |
|||
message: '请选择干部!', |
|||
type: 'warning' |
|||
}) |
|||
return false |
|||
} |
|||
this.$emit('connectResponse', this.responseData) |
|||
this.visible = false |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped lang='scss'> |
|||
.el-form{ |
|||
.end{ |
|||
margin-top: 10px; |
|||
} |
|||
} |
|||
.el-button--success{ |
|||
margin-top: 0px!important; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,200 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-__masteruserrelation}"> |
|||
<el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '120px'" disabled> |
|||
<el-form-item label="小组名称:" prop="groupName" label-width="95px"> |
|||
<div>{{dataForm.groupName}}</div> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-form> |
|||
<el-form-item label=" 小组家庭信息:" label-width="120px"></el-form-item> |
|||
<el-table v-loading="familyListLoading" :data="dataForm.familyList" border style="width: 80%;" height="290" label-width="120px"> |
|||
<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="name" label="姓名" header-align="center" align="center" show-overflow-tooltip width="130"></el-table-column> |
|||
<el-table-column prop="telPhone" label="手机号" header-align="center" align="center" width="160" |
|||
show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="pairingReasonsName" label="结对原因" header-align="center" align="center" show-overflow-tooltip width="160"></el-table-column> |
|||
<el-table-column prop="allDeptNames" label="所属部门" header-align="center" align="center" show-overflow-tooltip width="305"></el-table-column> |
|||
<el-table-column :label="$t('handle')" header-align="center" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="text" size="small" @click="deleteGroupFamily(scope.row.familyGroupId)">{{ $t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</el-form> |
|||
|
|||
<el-form> |
|||
<el-form-item label=" 关联干部信息:" label-width="120px"></el-form-item> |
|||
<el-table v-loading="userListLoading" :data="dataForm.userList" border style="width: 80%;" height="290" label-width="120px"> |
|||
<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="username" :label="$t('user.username')" sortable="custom" header-align="center" align="center" show-overflow-tooltip width="100"></el-table-column> |
|||
<el-table-column prop="realName" :label="$t('user.realName')" show-overflow-tooltip header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="deptName" :label="$t('user.deptName')" show-overflow-tooltip header-align="center" align="center" min-width="120"></el-table-column> |
|||
<el-table-column prop="email" :label="$t('user.email')" show-overflow-tooltip header-align="center" align="center" width="180"></el-table-column> |
|||
<el-table-column prop="mobile" :label="$t('user.mobile')" show-overflow-tooltip sortable="custom" header-align="center" align="center" width="120"></el-table-column> |
|||
<el-table-column prop="createDate" :label="$t('user.createDate')" show-overflow-tooltip sortable="custom" header-align="center" align="center" width="160"></el-table-column> |
|||
<el-table-column :label="$t('handle')" header-align="center" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="text" size="small" @click="deleteGroupUser(scope.row.id)">{{ $t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</el-form> |
|||
|
|||
<el-form> |
|||
<el-form-item style="margin-left:35px;margin-top: 30px"> |
|||
<el-button type="primary" @click="backToUserRelationList">{{"返回"}}</el-button> |
|||
</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> |
|||
|
|||
</div> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
import Cookies from 'js-cookie' |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
groupName:'', |
|||
id: '', |
|||
familyList:[] |
|||
}, |
|||
familyListLoading: false, |
|||
userListLoading: false |
|||
} |
|||
}, |
|||
computed: { |
|||
|
|||
}, |
|||
components: { |
|||
}, |
|||
created: function () { |
|||
}, |
|||
mounted () { |
|||
if (this.$route.query.id !== '' && this.$route.query.id != null) { |
|||
this.dataForm.id = this.$route.query.id |
|||
this.getInfo() |
|||
} |
|||
}, |
|||
methods: { |
|||
// 删除关联干部 |
|||
deleteGroupFamily (id) { |
|||
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('delete') }), this.$t('prompt.title'), { |
|||
confirmButtonText: this.$t('confirm'), |
|||
cancelButtonText: this.$t('cancel'), |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.$http.put( |
|||
`/workRecord/familygrouprelation/deleteRelation/`+id |
|||
).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.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} |
|||
} |
|||
}) |
|||
}).catch(() => { }) |
|||
}).catch(() => { }) |
|||
}, |
|||
// 删除关联干部 |
|||
deleteGroupUser (id) { |
|||
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('delete') }), this.$t('prompt.title'), { |
|||
confirmButtonText: this.$t('confirm'), |
|||
cancelButtonText: this.$t('cancel'), |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.$http.put( |
|||
`/workRecord/groupcadrerelation/deleteRelation`, |
|||
{groupId:this.dataForm.id,cadreUserId:id} |
|||
).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.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} |
|||
} |
|||
}) |
|||
}).catch(() => { }) |
|||
}).catch(() => { }) |
|||
}, |
|||
|
|||
init () { |
|||
this.dataForm.id = this.$route.query.id |
|||
this.visible = true |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} |
|||
}) |
|||
}, |
|||
// 返回按钮点击事件 |
|||
backToUserRelationList () { |
|||
this.$emit('refreshDataList') |
|||
this.$parent.selectComponent = 'Helpgroup' |
|||
this.$router.push({ path: '/workRecord-helpgrouproute' }) |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/workRecord/helpgroup/getGroupDetail/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
console.log(this.dataForm); |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
console.log(this.dataForm); |
|||
}).catch(() => {}) |
|||
}, |
|||
openHandle () { |
|||
this.handleVisible = true |
|||
this.$nextTick(() => { |
|||
this.$refs.checkrecordsHandle.dataForm.id = this.dataForm.id |
|||
this.$refs.checkrecordsHandle.init() |
|||
}) |
|||
}, |
|||
connectResponse () { |
|||
this.backToUserRelationList () |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style> |
|||
.hide .el-upload--picture-card { |
|||
display: none; |
|||
} |
|||
</style> |
|||
Loading…
Reference in new issue