Browse Source

【联户结亲】-【删除功能】-(王童)-2021/7/21

master
Jackwang 4 years ago
parent
commit
a62db77c99
  1. 5
      src/views/modules/workRecord/helpgroup.vue
  2. 199
      src/views/modules/workRecord/helpgroupDetail.vue
  3. 4
      src/views/modules/workRecord/helpgrouproute.vue

5
src/views/modules/workRecord/helpgroup.vue

@ -36,6 +36,7 @@
<!-- <el-button v-if="$hasPermission('workrecord:helpgroup:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>-->
<el-button type="text" size="small" @click="addFamily(scope.row.id)">{{ $t('添加家庭') }}</el-button>
<el-button type="text" size="small" @click="addGroupUser(scope.row.id,scope.row.userIdList)">{{ $t('关联干部') }}</el-button>
<el-button type="text" size="small" @click="selectDetails(scope.row.id)">{{ '查看详情' }}</el-button>
</template>
</el-table-column>
</el-table>
@ -87,6 +88,10 @@ export default {
this.getDataList()
},
methods: {
selectDetails (id) {
this.$parent.selectComponent = 'HelpgroupDetail'
this.$router.push({ path: '/workRecord-helpgrouproute', query: { id: id} })
},
addFamily(infoId) {
this.familyAddVisible = true
this.$nextTick(() => {

199
src/views/modules/workRecord/helpgroupDetail.vue

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

4
src/views/modules/workRecord/helpgrouproute.vue

@ -6,6 +6,7 @@
<script>
import Helpgroup from './helpgroup'
import GroupfamilyAdd from './groupfamily-add'
import HelpgroupDetail from './helpgroupDetail'
export default {
data () {
return {
@ -14,7 +15,8 @@
},
components: {
Helpgroup,
GroupfamilyAdd
GroupfamilyAdd,
HelpgroupDetail
},
methods: {
init () {

Loading…
Cancel
Save