3 changed files with 207 additions and 1 deletions
@ -0,0 +1,199 @@ |
|||
<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="180"></el-table-column> |
|||
<el-table-column prop="telPhone" label="手机号" header-align="center" align="center" width="180" |
|||
show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="pairingReasonsName" label="结对原因" header-align="center" align="center" show-overflow-tooltip width="180"></el-table-column> |
|||
<el-table-column :label="$t('handle')" header-align="center" align="center" width="180"> |
|||
<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