5 changed files with 925 additions and 34 deletions
@ -0,0 +1,78 @@ |
|||
/** |
|||
* 解析epmet后台返回结果,并且执行传入的逻辑 |
|||
* @param success_processor 正常返回执行的函数,代表要对data做何种操作。第一个参数是 |
|||
* @param fail_processor 异常返回执行的函数,代表要对data做何种操作 |
|||
* @param result 后台返回的结果json对象 |
|||
*/ |
|||
|
|||
|
|||
export default function EpmetResultResolver(env) { |
|||
|
|||
this._env = env; |
|||
this.success_processor = null; |
|||
|
|||
// 成功回调
|
|||
this.success = (success_processor) => { |
|||
this.success_processor = success_processor; |
|||
return this; |
|||
} |
|||
|
|||
// 失败回调
|
|||
this.fail = (fail_processor) => { |
|||
this.fail_processor = fail_processor; |
|||
return this; |
|||
} |
|||
|
|||
// 执行解析逻辑
|
|||
this.parse = (result) => { |
|||
const { data, code, msg } = result |
|||
|
|||
// 失败
|
|||
if (code !== 0) { |
|||
// 表明后台返回错误
|
|||
|
|||
// 首先调用失败兜底函数
|
|||
if (this.fail_processor) { |
|||
this.fail_processor(); |
|||
} |
|||
|
|||
// 弹出消息
|
|||
if (code < 8000) { |
|||
this._env.$message.error('服务器开小差了...') |
|||
} else { |
|||
this._env.$message.error(msg) |
|||
} |
|||
|
|||
return; |
|||
} |
|||
|
|||
// 成功
|
|||
if (this.success_processor) { |
|||
// 后台没有返回错误,正常执行
|
|||
this.success_processor(data) |
|||
} |
|||
} |
|||
|
|||
// processEpmetResult
|
|||
// 处理result的函数
|
|||
// this.processEpmetResult = (success_processor, fail_processor, result) => {
|
|||
// const { data, code, msg } = result
|
|||
// if (code !== 0) {
|
|||
// // 表明后台返回错误
|
|||
// fail_processor();
|
|||
// if (code < 8000) {
|
|||
// this.$message.error('服务器开小差了...')
|
|||
// } else {
|
|||
// this.$message.error(msg)
|
|||
// }
|
|||
// return
|
|||
// }
|
|||
//
|
|||
// if (success_processor) {
|
|||
// // 后台没有返回错误,正常执行
|
|||
// success_processor(data)
|
|||
// }
|
|||
// }
|
|||
|
|||
return this; |
|||
} |
@ -1,26 +0,0 @@ |
|||
/** |
|||
* 解析epmet后台返回结果,并且执行传入的逻辑 |
|||
* @param success_processor 正常返回执行的函数,代表要对data做何种操作 |
|||
* @param fail_processor 异常返回执行的函数,代表要对data做何种操作 |
|||
* @param result 后台返回的结果json对象 |
|||
*/ |
|||
const processResult = (success_processor, fail_processor, result) => { |
|||
const { data, code, msg } = result |
|||
if (code !== 0) { |
|||
// 表明后台返回错误
|
|||
if (code < 8000) { |
|||
this.$message.error('服务器开小差了...') |
|||
} else { |
|||
this.$message.error(msg) |
|||
} |
|||
fail_processor() |
|||
return |
|||
} |
|||
|
|||
if (success_processor) { |
|||
// 后台没有返回错误,正常执行
|
|||
success_processor(data) |
|||
} |
|||
} |
|||
|
|||
export const processEpmetResult = processResult |
@ -0,0 +1,437 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" |
|||
:title="'新增党组织'" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
:close="handleDlgClose"> |
|||
<el-form class="form" |
|||
:model="dataForm" |
|||
:rules="dataRule" |
|||
ref="dataForm" |
|||
@keyup.enter.native="" |
|||
:label-width="$i18n.locale === 'en-US' ? '120px' : '100px'"> |
|||
|
|||
<el-form-item prop="partyOrgLevel" |
|||
label="党组织类型"> |
|||
<el-select v-model="dataForm.partyOrgLevel" |
|||
@change="handlePartyOrgLevelSelected" |
|||
placeholder="请选择"> |
|||
<el-option |
|||
v-for="level in partyOrgLevels" |
|||
:key="level.levelCode" |
|||
:label="level.levelName" |
|||
:value="level.levelCode"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item prop="partyOrgPid" |
|||
label="上级党组织"> |
|||
<el-select v-model="dataForm.partyOrgPid" |
|||
@change="handleParentPartyOrgSelected" |
|||
placeholder="请选择"> |
|||
<el-option |
|||
v-for="org in parentPartyOrgs" |
|||
:key="org.id" |
|||
:label="org.partyOrgName" |
|||
:value="org.id"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item prop="orgId" |
|||
label="行政组织" v-if="orgSelectorShow"> |
|||
<el-select v-model="dataForm.orgId" |
|||
@change="" |
|||
placeholder="请选择"> |
|||
<el-option |
|||
v-for="org in xingzhengOrgs" |
|||
:key="org.orgId" |
|||
:label="org.orgName" |
|||
:value="org.orgId"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item prop="partyOrgName" |
|||
label="党组织名称"> |
|||
<el-input v-model="dataForm.partyOrgName" |
|||
placeholder="请输入党组织名称" |
|||
style="width: 300px"></el-input> |
|||
</el-form-item> |
|||
|
|||
<el-form-item prop="description" label="党组织介绍"> |
|||
<el-input |
|||
type="textarea" |
|||
:rows="2" |
|||
placeholder="" |
|||
v-model="this.dataForm.description"> |
|||
</el-input> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="地图位置" |
|||
prop="longitude" |
|||
style="display: block"> |
|||
<div style="width: 500px"> |
|||
<el-select v-model="searchValue" |
|||
filterable |
|||
style="width: 500px" |
|||
remote |
|||
:reserve-keyword="true" |
|||
placeholder="请输入位置关键词" |
|||
:remote-method="searchOnMap" |
|||
:loading="mapLoading"> |
|||
<el-option v-for="(item,index) in searchOptions" |
|||
@click.native="handleMapSearchResultSelected(index)" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
<div id="partyOrgMap" |
|||
class="div_map"></div> |
|||
</div> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
<template slot="footer"> |
|||
<el-button @click="">取消</el-button> |
|||
<el-button type="primary" @click="handleSubmitCreate">确定</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
var map |
|||
var search |
|||
var markers |
|||
var infoWindowList |
|||
var geocoder // 新建一个正逆地址解析类 |
|||
import debounce from 'lodash/debounce' |
|||
import { requestGet, requestPost } from "@/js/dai/request"; |
|||
import EpmetResultResolver from '@/js/epmet-result-resolver' |
|||
import { number } from 'echarts' |
|||
import daiMap from "@/utils/dai-map"; |
|||
|
|||
export default { |
|||
data () { |
|||
return { |
|||
dataForm: { |
|||
partyOrgPid: null, |
|||
partyOrgName: null, |
|||
partyOrgLevel: null, |
|||
orgId: null, // 行政组织id |
|||
description: null, |
|||
longitude: null, |
|||
latitude: null, |
|||
address: null |
|||
}, |
|||
// 党组织类型下拉框 |
|||
partyOrgLevels: [], |
|||
// 父级党组织 |
|||
parentPartyOrgs: [], |
|||
|
|||
// 行政组织列表 |
|||
xingzhengOrgs: [], |
|||
orgSelectorShow: true, // 行政组织是否显示 |
|||
|
|||
// 地图 |
|||
searchOptions: [], //用于展示的地图搜索结果列表 |
|||
searchValue: '', |
|||
mapLoading: false, // 地图加载 |
|||
mapSearchResultList: [], // 地图搜索结果列表 |
|||
epmetResultResolver: null, // epmet请求结果解析器 |
|||
} |
|||
}, |
|||
mounted () { |
|||
|
|||
}, |
|||
methods: { |
|||
// 初始化 |
|||
init () { |
|||
this.epmetResultResolver = new EpmetResultResolver(this); |
|||
|
|||
// 加载党组织级别下拉框 |
|||
this.loadPartyOrgLevels(); |
|||
|
|||
// 初始化地图 |
|||
let { latitude, longitude } = this.$store.state.user; |
|||
|
|||
setTimeout(() => { |
|||
this.$nextTick(() => { |
|||
if (!map) { |
|||
this.initMap(latitude, longitude); |
|||
} else { |
|||
map.setCenter(latitude, longitude); |
|||
map.setMarker(latitude, longitude); |
|||
} |
|||
}) |
|||
}, 50) |
|||
}, |
|||
|
|||
// 初始化地图 |
|||
initMap (latitude, longitude) { |
|||
map = new daiMap( |
|||
document.getElementById("partyOrgMap"), |
|||
{ latitude, longitude }, |
|||
{ |
|||
zoom: 16.2, // 设置地图缩放级别 |
|||
pitch: 43.5, // 设置俯仰角 |
|||
rotation: 45, // 设置地图旋转角度 |
|||
} |
|||
); |
|||
|
|||
// 监听地图平移结束事件 |
|||
map.on("dragend", (e) => { |
|||
this.handleMoveCenter(e); |
|||
}); |
|||
|
|||
// 设置地图默认经纬度中心店和标记 |
|||
map.setCenter(latitude, longitude); |
|||
map.setMarker(latitude, longitude); |
|||
}, |
|||
|
|||
// 加载党组织类型下拉框 |
|||
async loadPartyOrgLevels() { |
|||
let url = "/actual/base/party/org/listPartyOrgLevels"; |
|||
let rst = await requestGet(url, {}); |
|||
|
|||
this.epmetResultResolver |
|||
.success((data) => { |
|||
this.partyOrgLevels = data; |
|||
}) |
|||
.parse(rst); |
|||
|
|||
// processEpmetResult((data) => { |
|||
// this.partyOrgLevels = data; |
|||
// }, null, rst); |
|||
}, |
|||
|
|||
/** |
|||
* 党组织级别选中事件 |
|||
* @returns {Promise<void>} |
|||
*/ |
|||
async handlePartyOrgLevelSelected() { |
|||
// 加载上级党组织 |
|||
let url = "/actual/base/party/org/listParentPartyOrg"; |
|||
let rst = await requestGet(url, { |
|||
partyOrgLevel: this.dataForm.partyOrgLevel |
|||
}) |
|||
|
|||
this.epmetResultResolver.success((data) => { |
|||
this.parentPartyOrgs = data; |
|||
this.dataForm.partyOrgPid = null; |
|||
|
|||
// 控制行政组织组件是否显示 |
|||
// orgSelectorShows |
|||
if (this.dataForm.partyOrgLevel >= 6) { |
|||
this.orgSelectorShow = false; |
|||
} |
|||
}) |
|||
.parse(rst); |
|||
|
|||
// processEpmetResult((data) => { |
|||
// this.parentPartyOrgs = data; |
|||
// this.dataForm.partyOrgPid = null; |
|||
// |
|||
// // 控制行政组织组件是否显示 |
|||
// // orgSelectorShows |
|||
// if (this.dataForm.partyOrgLevel >= 6) { |
|||
// this.orgSelectorShow = false; |
|||
// } |
|||
// }, null, rst); |
|||
}, |
|||
|
|||
/** |
|||
* 上级党组织选中事件, |
|||
* 加载下级行政组织 |
|||
* @returns {Promise<void>} |
|||
*/ |
|||
async handleParentPartyOrgSelected() { |
|||
let url = "/actual/base/party/org/listXingZhengOrgs"; |
|||
let rst = await requestGet(url, { |
|||
partyOrgPid: this.dataForm.partyOrgPid |
|||
}); |
|||
|
|||
this.epmetResultResolver |
|||
.success((data) => { |
|||
this.xingzhengOrgs = data; |
|||
}) |
|||
.parse(rst); |
|||
|
|||
// processEpmetResult((data) => { |
|||
// this.xingzhengOrgs = data; |
|||
// console.log(this.xingzhengOrgs) |
|||
// }, null, rst); |
|||
}, |
|||
|
|||
/** |
|||
* 对话框关闭事件 |
|||
* @returns {Promise<void>} |
|||
*/ |
|||
async handleDlgClose() { |
|||
this.visible = false; |
|||
}, |
|||
|
|||
/** |
|||
* 提交表单 |
|||
* @returns {Promise<void>} |
|||
*/ |
|||
async handleSubmitCreate() { |
|||
let url = "/actual/base/party/org/create"; |
|||
|
|||
let params = { |
|||
...this.dataForm |
|||
} |
|||
|
|||
let rst = await requestPost(url, params) |
|||
|
|||
this.epmetResultResolver |
|||
.success((data) => { |
|||
this.$message.success("提交成功"); |
|||
}) |
|||
.parse(rst); |
|||
|
|||
// processEpmetResult((data) => { |
|||
// this.$message.success("提交成功"); |
|||
// }, null, rst) |
|||
}, |
|||
|
|||
// 地图搜索 |
|||
async searchOnMap (query) { |
|||
|
|||
if (query !== '') { |
|||
this.mapLoading = true; |
|||
|
|||
const { msg, data } = await map.searchNearby(query); |
|||
this.mapLoading = false; |
|||
this.mapSearchResultList = [] |
|||
|
|||
if (msg == "success" && data.resultList && data.resultList.length > 0) { |
|||
|
|||
if (data.resultList && data.resultList.length > 0) { |
|||
this.mapSearchResultList = data.resultList |
|||
this.searchOptions = this.mapSearchResultList.map(item => { |
|||
return { value: `${item.hotPointID}`, label: `${item.address + item.name}` }; |
|||
}); |
|||
} |
|||
} else { |
|||
this.searchOptions = [ |
|||
{ |
|||
value: '0', |
|||
label: '未检索到结果' |
|||
} |
|||
] |
|||
} |
|||
} else { |
|||
this.searchOptions = []; |
|||
} |
|||
}, |
|||
|
|||
// 地图中心点移动 |
|||
async handleMoveCenter () { |
|||
//修改地图中心点 |
|||
const { lat, lng } = map.getCenter(); |
|||
this.dataForm.latitude = lat; |
|||
this.dataForm.longitude = lng; |
|||
map.setMarker(lat, lng); |
|||
|
|||
let { msg, data } = await map.getAddress(lat, lng); |
|||
if (msg == "success") { |
|||
this.dataForm.address = data.address |
|||
this.searchValue = data.address |
|||
this.searchOptions = [] |
|||
|
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* 地图文本搜索,选中 |
|||
* @param index |
|||
*/ |
|||
handleMapSearchResultSelected (index) { |
|||
let selPosition = this.resultList[index] |
|||
let lonlat = selPosition.lonlat.split(" ") |
|||
map.setCenter(lonlat[1], lonlat[0]); |
|||
map.setMarker(lonlat[1], lonlat[0]); |
|||
this.dataForm.latitude = lonlat[1]; |
|||
this.dataForm.longitude = lonlat[0]; |
|||
this.dataForm.address = selPosition.address + selPosition.name |
|||
}, |
|||
|
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
partyOrgLevel: [ |
|||
{ required: true, message: '请选择党组织类型', trigger: 'blur' }, |
|||
], |
|||
partyOrgPid: [ |
|||
{ required: true, message: '请选择上级党组织', trigger: 'blur' }, |
|||
], |
|||
partyOrgName: [ |
|||
{ required: true, message: '党组织名称不能为空', trigger: 'blur' }, |
|||
], |
|||
orgId: [ |
|||
{ required: true, message: '行政组织不能为空', trigger: 'blur' }, |
|||
], |
|||
mySelectOrg: [ |
|||
{ required: true, message: '上级党组织不能为空', trigger: 'blur' }, |
|||
], |
|||
partyOrgType: [ |
|||
{ required: true, message: '党组织类型不能为空', trigger: 'blur' }, |
|||
], |
|||
agencyId: [ |
|||
{ required: true, message: '行政组织不能为空', trigger: 'blur' }, |
|||
], |
|||
} |
|||
}, |
|||
}, |
|||
props: { |
|||
visible: { |
|||
defult: false, |
|||
type: Boolean |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
@import "@/assets/scss/modules/visual/communityManageForm.scss"; |
|||
</style> |
|||
<style lang="scss" scoped> |
|||
.item_width_1 { |
|||
width: 560px; |
|||
|
|||
/deep/ .tox .tox-dialog { |
|||
z-index: 20000; |
|||
} |
|||
} |
|||
|
|||
.div_map { |
|||
position: relative; |
|||
} |
|||
|
|||
.div_searchmap { |
|||
z-index: 5000; |
|||
position: absolute; |
|||
top: 5px; |
|||
left: 5px; |
|||
} |
|||
|
|||
.tinymce_view { |
|||
height: 400px; |
|||
overflow: auto; |
|||
} |
|||
|
|||
.text_p { |
|||
margin: 0; |
|||
padding: 0 10px; |
|||
border: 1px solid #d9d9d9; |
|||
border-radius: 5px; |
|||
|
|||
> p { |
|||
margin: 0; |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,400 @@ |
|||
<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"> |
|||
<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"> |
|||
<el-button @click="handleClose">取 消</el-button> |
|||
<el-button type="primary" @click="editPrincipal">确 定</el-button> |
|||
</span> |
|||
</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 |
|||
}, |
|||
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'} |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
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:{ |
|||
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 |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
.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; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
.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); |
|||
} |
|||
} |
|||
.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