4 changed files with 248 additions and 379 deletions
@ -1,400 +1,271 @@ |
|||
<template> |
|||
<el-card ref="searchCard" class="resi-card-table"> |
|||
<div class="resi-row-btn"> |
|||
<el-button class="diy-button--add" |
|||
size="small" |
|||
@click="addOrUpdateHandle()">新增</el-button> |
|||
</div> |
|||
<!-- 列表表格 --> |
|||
<el-table |
|||
class="resi-table" |
|||
v-loading="tableLoading" |
|||
:data="tableData" |
|||
:default-expand-all="true" |
|||
row-key="id" |
|||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
|||
|
|||
:height="tableHeight"> |
|||
<el-table-column prop="partyOrgName" min-width="250" label="党组织名称"></el-table-column> |
|||
<el-table-column prop="partyOrgType" min-width="150" label="类别"> |
|||
<template slot-scope="scope"> |
|||
<div class="resi-row-btn"> |
|||
<el-button class="diy-button-add" |
|||
size="small" |
|||
@click="handleCreateBtnClick">新增 |
|||
</el-button> |
|||
</div> |
|||
|
|||
<!--创建对话框--> |
|||
<Create ref="create-org" v-if="createDlgShow" :visible="createDlgShow"></Create> |
|||
|
|||
<!-- 列表表格 --> |
|||
<!--<el-table |
|||
class="resi-table" |
|||
v-loading="tableLoading" |
|||
:data="tableData" |
|||
:default-expand-all="true" |
|||
row-key="id" |
|||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
|||
|
|||
:height="tableHeight"> |
|||
<el-table-column prop="partyOrgName" min-width="250" label="党组织名称"></el-table-column> |
|||
<el-table-column prop="partyOrgType" min-width="150" label="类别"> |
|||
<template slot-scope="scope"> |
|||
<span v-for="(item, index) in partyOrgTypes" |
|||
:key="item.value" |
|||
:value="item.label" |
|||
v-if="scope.row.partyOrgType == item.value"> |
|||
{{ item.label }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="principal" width="120" label="负责人"></el-table-column> |
|||
<el-table-column prop="principalMobile" width="150" label="联系方式"></el-table-column> |
|||
<el-table-column label="操作" align="center" width="300"> |
|||
<template slot-scope="scope"> |
|||
<el-button v-if="scope.row.partyOrgType != '6'" |
|||
@click="principal(scope.row)" |
|||
type="text" |
|||
size="small" |
|||
class="div-table-button--detail">{{'负责人'}}</el-button> |
|||
<el-button v-if="(scope.row.agencyId == agencyId || scope.row.agencyPids.includes(agencyId)) && scope.row.partyOrgType != '6'" |
|||
@click="handleLook(scope.row.agencyPids, scope.row.id, scope.row)" |
|||
type="text" |
|||
size="small" |
|||
class="div-table-button--detail">{{'查看党员'}}</el-button> |
|||
<el-button v-if="(scope.row.agencyId == agencyId || scope.row.agencyPids.includes(agencyId)) && scope.row.partyOrgType != '5' && scope.row.partyOrgType != '6'" |
|||
@click="addOrUpdateHandle('', scope.row.id, scope.row.orgPids, scope.row.agencyId, scope.row.partyOrgType, scope.row.partyOrgName)" |
|||
type="text" |
|||
size="small" |
|||
class="div-table-button--add">新增下级</el-button> |
|||
<el-button v-if="(scope.row.agencyId == agencyId || scope.row.agencyPids.includes(agencyId)) && scope.row.partyOrgType != '6'" |
|||
@click="addOrUpdateHandle(scope.row.id, '', '', scope.row.pid, scope.row.partyOrgType, '')" |
|||
type="text" |
|||
size="small" |
|||
class="div-table-button--edit">修改</el-button> |
|||
<el-button v-if="(scope.row.agencyId == agencyId || scope.row.agencyPids.includes(agencyId))&& scope.row.partyOrgType != '6'" |
|||
@click="deleteAgency(scope.row.id)" |
|||
type="text" |
|||
size="small" |
|||
class="btn-color-del">删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getTableData"></add-or-update> |
|||
<!-- 查看党员 --> |
|||
<el-dialog :visible.sync="lookMemberShow" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
:title="memberTitle" |
|||
width="1050px" |
|||
top="5vh" |
|||
class="dialog-h" |
|||
@closed="lookMemberClose"> |
|||
<look-Member ref="ref_table_Member" |
|||
@lookMemberCancle="lookMemberCancle" |
|||
@lookMemberOk="lookMemberOk"></look-Member> |
|||
</el-dialog> |
|||
<el-dialog |
|||
title="负责人" |
|||
:visible.sync="principalShow" |
|||
width="850px" |
|||
top="5vh" |
|||
class="dialog-h" |
|||
:before-close="handleClose"> |
|||
<el-form ref="refPrincipalRules" |
|||
:inline="true" |
|||
:model="editPrincipalData" |
|||
:rules="principalRules" |
|||
class="div_form"> |
|||
<el-form-item label="负责人" |
|||
label-width="150px" |
|||
prop="principal"> |
|||
<el-select v-model="editPrincipalData.principal" |
|||
placeholder="请选择" |
|||
clearable |
|||
style="width: 200px" |
|||
class="item_width_4"> |
|||
<el-option v-for="item in staffs" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<span slot="footer" class="dialog-footer"> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="principal" width="120" label="负责人"></el-table-column> |
|||
<el-table-column prop="principalMobile" width="150" label="联系方式"></el-table-column> |
|||
<el-table-column label="操作" align="center" width="300"> |
|||
<template slot-scope="scope"> |
|||
<el-button v-if="scope.row.partyOrgType != '6'" |
|||
@click="principal(scope.row)" |
|||
type="text" |
|||
size="small" |
|||
class="div-table-button--detail">{{ '负责人' }} |
|||
</el-button> |
|||
<el-button |
|||
v-if="(scope.row.agencyId == agencyId || scope.row.agencyPids.includes(agencyId)) && scope.row.partyOrgType != '6'" |
|||
@click="handleLook(scope.row.agencyPids, scope.row.id, scope.row)" |
|||
type="text" |
|||
size="small" |
|||
class="div-table-button--detail">{{ '查看党员' }} |
|||
</el-button> |
|||
<el-button |
|||
v-if="(scope.row.agencyId == agencyId || scope.row.agencyPids.includes(agencyId)) && scope.row.partyOrgType != '5' && scope.row.partyOrgType != '6'" |
|||
@click="addOrUpdateHandle('', scope.row.id, scope.row.orgPids, scope.row.agencyId, scope.row.partyOrgType, scope.row.partyOrgName)" |
|||
type="text" |
|||
size="small" |
|||
class="div-table-button--add">新增下级 |
|||
</el-button> |
|||
<el-button |
|||
v-if="(scope.row.agencyId == agencyId || scope.row.agencyPids.includes(agencyId)) && scope.row.partyOrgType != '6'" |
|||
@click="addOrUpdateHandle(scope.row.id, '', '', scope.row.pid, scope.row.partyOrgType, '')" |
|||
type="text" |
|||
size="small" |
|||
class="div-table-button--edit">修改 |
|||
</el-button> |
|||
<el-button |
|||
v-if="(scope.row.agencyId == agencyId || scope.row.agencyPids.includes(agencyId))&& scope.row.partyOrgType != '6'" |
|||
@click="deleteAgency(scope.row.id)" |
|||
type="text" |
|||
size="small" |
|||
class="btn-color-del">删除 |
|||
</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table>--> |
|||
|
|||
<!--<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getTableData"></add-or-update>--> |
|||
|
|||
<!-- 查看党员 --> |
|||
<!--<el-dialog :visible.sync="lookMemberShow" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
:title="memberTitle" |
|||
width="1050px" |
|||
top="5vh" |
|||
class="dialog-h" |
|||
@closed="lookMemberClose"> |
|||
<look-Member ref="ref_table_Member" |
|||
@lookMemberCancle="lookMemberCancle" |
|||
@lookMemberOk="lookMemberOk"></look-Member> |
|||
</el-dialog>--> |
|||
<!--<el-dialog |
|||
title="负责人" |
|||
:visible.sync="principalShow" |
|||
width="850px" |
|||
top="5vh" |
|||
class="dialog-h" |
|||
:before-close="handleClose"> |
|||
<el-form ref="refPrincipalRules" |
|||
:inline="true" |
|||
:model="editPrincipalData" |
|||
:rules="principalRules" |
|||
class="div_form"> |
|||
<el-form-item label="负责人" |
|||
label-width="150px" |
|||
prop="principal"> |
|||
<el-select v-model="editPrincipalData.principal" |
|||
placeholder="请选择" |
|||
clearable |
|||
style="width: 200px" |
|||
class="item_width_4"> |
|||
<el-option v-for="item in staffs" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<el-button @click="handleClose">取 消</el-button> |
|||
<el-button type="primary" @click="editPrincipal">确 定</el-button> |
|||
</span> |
|||
</el-dialog> |
|||
</el-dialog>--> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import AddOrUpdate from './icpartyorg-add-or-update' |
|||
import TableTreeColumn from '@/components/table-tree-column' |
|||
import lookMember from './lookMember' |
|||
import { mapGetters } from 'vuex' |
|||
export default { |
|||
data () { |
|||
return { |
|||
principalShow: false, |
|||
staffs: [], |
|||
editPrincipalData: { |
|||
principal: '', |
|||
principalMobile: '', |
|||
partyOrgId: '', |
|||
principalStaffId: '' |
|||
}, |
|||
searchH: 0, |
|||
dataForm: { |
|||
id: '', |
|||
customerId: '', |
|||
orgPids: '', |
|||
agencyId: '' |
|||
}, |
|||
tableLoading: false, |
|||
tableData: [], |
|||
partyOrgTypes: [ |
|||
{ |
|||
value: '0', |
|||
label: '省委' |
|||
}, |
|||
{ |
|||
value: '1', |
|||
label: '市委' |
|||
}, |
|||
{ |
|||
value: '2', |
|||
label: '区委' |
|||
}, |
|||
{ |
|||
value: '3', |
|||
label: '党工委' |
|||
}, |
|||
{ |
|||
value: '4', |
|||
label: '党委' |
|||
}, |
|||
{ |
|||
value: '5', |
|||
label: '支部' |
|||
}, |
|||
{ |
|||
value: '6', |
|||
label: '党小组' |
|||
} |
|||
], |
|||
agencyId: '', |
|||
addOrUpdateVisible: false, |
|||
lookMemberShow: false, |
|||
memberTitle: '查看党员' |
|||
} |
|||
}, |
|||
components: { |
|||
AddOrUpdate, |
|||
TableTreeColumn, |
|||
lookMember |
|||
// import AddOrUpdate from './icpartyorg-add-or-update' |
|||
import TableTreeColumn from '@/components/table-tree-column' |
|||
import Create from './create' |
|||
// import lookMember from './lookMember' |
|||
import { mapGetters } from 'vuex' |
|||
|
|||
export default { |
|||
data () { |
|||
return { |
|||
createDlgShow: false, // 创建对话框是否显示 |
|||
editDlgShow: false, // 创建对话框是否显示 |
|||
} |
|||
}, |
|||
components: { |
|||
TableTreeColumn, Create |
|||
}, |
|||
computed: { |
|||
...mapGetters(['clientHeight', 'iframeHeight']), |
|||
tableHeight () { |
|||
const h = this.clientHeight - this.searchH - 230 + this.iframeHeigh |
|||
const _h = this.clientHeight - 230 - this.searchH |
|||
return this.$store.state.inIframe ? h : _h |
|||
}, |
|||
computed: { |
|||
...mapGetters(['clientHeight', 'iframeHeight']), |
|||
tableHeight() { |
|||
const h = this.clientHeight - this.searchH - 230 + this.iframeHeigh |
|||
const _h = this.clientHeight - 230 - this.searchH |
|||
return this.$store.state.inIframe ? h : _h |
|||
}, |
|||
principalRules() { |
|||
return { |
|||
principal: [ |
|||
{required: true, message: '负责人不能为空', trigger: 'blur'} |
|||
] |
|||
} |
|||
principalRules () { |
|||
return { |
|||
principal: [ |
|||
{ required: true, message: '负责人不能为空', trigger: 'blur' } |
|||
] |
|||
} |
|||
}, |
|||
mounted() { |
|||
} |
|||
}, |
|||
mounted () { |
|||
this.$nextTick(() => { |
|||
this.searchH = this.$refs.searchCard.$el.offsetHeight |
|||
console.log('tableHeight', this.tableHeight) |
|||
}) |
|||
}, |
|||
async created () { |
|||
// this.agencyId = localStorage.getItem('agencyId') |
|||
// this.dataForm.customerId = localStorage.getItem('customerId') |
|||
// this.dataForm.agencyId = localStorage.getItem('agencyId') |
|||
// this.getTableData() |
|||
// this.pageLoading = true |
|||
}, |
|||
methods: { |
|||
/** |
|||
* 点击"新增" |
|||
*/ |
|||
handleCreateBtnClick() { |
|||
this.createDlgShow = true; |
|||
this.$nextTick(() => { |
|||
this.searchH = this.$refs.searchCard.$el.offsetHeight |
|||
console.log('tableHeight', this.tableHeight) |
|||
}) |
|||
}, |
|||
async created () { |
|||
this.agencyId = localStorage.getItem('agencyId') |
|||
this.dataForm.customerId = localStorage.getItem('customerId') |
|||
this.dataForm.agencyId = localStorage.getItem('agencyId') |
|||
this.getTableData() |
|||
// this.pageLoading = true |
|||
}, |
|||
methods:{ |
|||
principal(row) { |
|||
this.principalShow = true |
|||
this.$nextTick(() => { |
|||
this.$refs['refPrincipalRules'].resetFields(); |
|||
}) |
|||
this.editPrincipalData.partyOrgId = row.id |
|||
this.editPrincipalData.principal = row.principal |
|||
this.$http.post('/data/aggregator/org/staff-select-list/'+row.agencyId,{'params': {}}).then(({ data: res }) =>{ |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.internalMsg ? res.internalMsg : res.msg ? res.msg : '查询失败') |
|||
} else { |
|||
this.staffs = res.data |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
editPrincipal(row) { |
|||
this.staffs.forEach(s => { |
|||
if (this.editPrincipalData.principal === s.value){ |
|||
this.editPrincipalData.principal = s.name |
|||
this.editPrincipalData.principalStaffId = s.value |
|||
this.editPrincipalData.principalMobile = s.mobile |
|||
} |
|||
}) |
|||
this.$refs['refPrincipalRules'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
this.$http.post('/resi/partymember/icPartyOrg/editPrincipal',this.editPrincipalData).then(({ data: res }) =>{ |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.internalMsg ? res.internalMsg : res.msg ? res.msg : '查询失败') |
|||
}else { |
|||
this.principalShow = false |
|||
this.getTableData() |
|||
this.resetEditPrincipalData() |
|||
} |
|||
}).catch(() => {}) |
|||
}) |
|||
}, |
|||
handleClose() { |
|||
this.principalShow = false |
|||
this.resetEditPrincipalData() |
|||
}, |
|||
resetEditPrincipalData() { |
|||
this.editPrincipalData = { |
|||
principal: '', |
|||
principalMobile: '', |
|||
partyOrgId: '', |
|||
principalStaffId: '' |
|||
} |
|||
}, |
|||
// 查询列表 |
|||
async getTableData () { |
|||
this.tableLoading = true |
|||
let params = { |
|||
customerId: localStorage.getItem('customerId') |
|||
} |
|||
await this.$http.get('/resi/partymember/icPartyOrg/getTreelist', {params: this.dataForm}).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.internalMsg ? res.internalMsg : res.msg ? res.msg : '查询失败') |
|||
} else { |
|||
this.tableData = res.data |
|||
} |
|||
}).catch(() => {}) |
|||
this.tableLoading = false |
|||
}, |
|||
// 新增 / 修改 |
|||
addOrUpdateHandle (id, orgId, orgPids, pid, partyOrgType, partyOrgName) { |
|||
this.addOrUpdateVisible = true |
|||
this.$nextTick(() => { |
|||
this.$refs.addOrUpdate.dataForm.id = id |
|||
// 新增下级需要传 |
|||
this.$refs.addOrUpdate.dataForm.orgId = orgId // 党组织 |
|||
this.$refs.addOrUpdate.dataForm.orgPids = orgPids |
|||
this.$refs.addOrUpdate.dataForm.pid = pid |
|||
this.$refs.addOrUpdate.dataForm._partyOrgType = partyOrgType |
|||
this.$refs.addOrUpdate.dataForm.sjdzzName = partyOrgName |
|||
this.$refs.addOrUpdate.init() |
|||
}) |
|||
}, |
|||
// 删除 |
|||
deleteAgency (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.delete('/resi/partymember/icPartyOrg/delete', {'data': [id]}).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.internalMsg ? res.internalMsg : res.msg ? res.msg : '查询失败') |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.getTableData() |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}).catch(() => {}) |
|||
}, |
|||
// 查看党员 |
|||
handleLook(agencyPids, id, row) { |
|||
this.lookMemberShow = true |
|||
this.$nextTick(() => { |
|||
this.$refs.ref_table_Member.initForm(agencyPids.split(':')[agencyPids.split(':').length - 1], id) |
|||
}) |
|||
}, |
|||
lookMemberClose () { |
|||
this.lookMemberShow = false |
|||
}, |
|||
lookMemberCancle () { |
|||
this.lookMemberShow = false |
|||
}, |
|||
lookMemberOk () { |
|||
this.lookMemberShow = false |
|||
} |
|||
this.$refs['create-org'].init(); |
|||
}); |
|||
} |
|||
|
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
.resi-container .resi-card-table { |
|||
::v-deep .el-table { |
|||
th { |
|||
color: #fff; |
|||
background-color: rgba(33, 149, 254, 1); |
|||
} |
|||
.resi-container .resi-card-table { |
|||
::v-deep .el-table { |
|||
th { |
|||
color: #fff; |
|||
background-color: rgba(33, 149, 254, 1); |
|||
} |
|||
|
|||
.cell { |
|||
span:nth-of-type(3) { |
|||
display: inline-block; |
|||
width: 90%; |
|||
word-break: break-all; |
|||
} |
|||
.cell { |
|||
span:nth-of-type(3) { |
|||
display: inline-block; |
|||
width: 90%; |
|||
word-break: break-all; |
|||
} |
|||
} |
|||
} |
|||
.resi-table { |
|||
::v-deep .el-button--text { |
|||
text-decoration: underline; |
|||
} |
|||
::v-deep .btn-color-del { |
|||
margin-left: 10px; |
|||
color: rgba(213, 16, 16, 1); |
|||
} |
|||
::v-deep .btn-color-edit { |
|||
color: rgba(0, 167, 169, 1); |
|||
} |
|||
} |
|||
|
|||
.resi-table { |
|||
::v-deep .el-button--text { |
|||
text-decoration: underline; |
|||
} |
|||
|
|||
::v-deep .btn-color-del { |
|||
margin-left: 10px; |
|||
color: rgba(213, 16, 16, 1); |
|||
} |
|||
|
|||
::v-deep .btn-color-edit { |
|||
color: rgba(0, 167, 169, 1); |
|||
} |
|||
} |
|||
</style> |
|||
<style lang="scss" scoped> |
|||
.resi-row-btn { |
|||
display: flex; |
|||
margin-bottom: 13px; |
|||
::v-deep .el-button { |
|||
// margin-left: 10px; |
|||
border: 0; |
|||
} |
|||
::v-deep .el-select { |
|||
margin-right: 10px; |
|||
} |
|||
.el-button--success { |
|||
background: rgba(34, 193, 195, 1); |
|||
} |
|||
.resi-row-btn { |
|||
display: flex; |
|||
margin-bottom: 13px; |
|||
|
|||
::v-deep .el-button { |
|||
// margin-left: 10px; |
|||
border: 0; |
|||
} |
|||
.avatar-uploader { |
|||
::v-deep .el-upload { |
|||
cursor: pointer; |
|||
position: relative; |
|||
overflow: hidden; |
|||
} |
|||
.el-upload:hover { |
|||
border-color: #409eff; |
|||
} |
|||
.avatar { |
|||
width: 70px; |
|||
height: 70px; |
|||
display: block; |
|||
} |
|||
.avatar-uploader-icon { |
|||
border: 1px dashed #d9d9d9; |
|||
border-radius: 6px; |
|||
font-size: 28px; |
|||
color: #8c939d; |
|||
width: 70px; |
|||
height: 70px; |
|||
line-height: 70px; |
|||
text-align: center; |
|||
} |
|||
|
|||
::v-deep .el-select { |
|||
margin-right: 10px; |
|||
} |
|||
|
|||
.resi-btns { |
|||
margin-top: 20px; |
|||
.el-button--success { |
|||
background: rgba(34, 193, 195, 1); |
|||
} |
|||
} |
|||
|
|||
.avatar-uploader { |
|||
::v-deep .el-upload { |
|||
cursor: pointer; |
|||
position: relative; |
|||
overflow: hidden; |
|||
} |
|||
|
|||
.el-upload:hover { |
|||
border-color: #409eff; |
|||
} |
|||
|
|||
.avatar { |
|||
width: 70px; |
|||
height: 70px; |
|||
display: block; |
|||
} |
|||
|
|||
.avatar-uploader-icon { |
|||
border: 1px dashed #d9d9d9; |
|||
border-radius: 6px; |
|||
font-size: 28px; |
|||
color: #8c939d; |
|||
width: 70px; |
|||
height: 70px; |
|||
line-height: 70px; |
|||
text-align: center; |
|||
} |
|||
} |
|||
|
|||
.resi-btns { |
|||
margin-top: 20px; |
|||
text-align: center; |
|||
} |
|||
</style> |
|||
|
|||
Loading…
Reference in new issue