epmet pc工作端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2233 lines
82 KiB

<template>
<div class="app-container">
<el-row>
<el-col :span="24" style="margin-left: 10px;margin-top: 10px;margin-bottom: 20px;">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item v-for="(breadcrumb, index) in breadcrumbArr" :key="breadcrumb.id">
4 years ago
<el-link v-if="breadcrumb.id === currentBreadcrumbKey" type="primary" @click.native="refreshThisPage(index)">{{ breadcrumb.name }}</el-link>
<el-link v-else type="info" @click.native="refreshThisPage(index)">{{ breadcrumb.name }}</el-link>
4 years ago
<el-link v-if="index === breadcrumbArr.length - 1" type="primary" @click.native="modifyOrgInfo" style="margin-left:10px;margin-top:0px;color:#3E8EF7;cursor:pointer" icon="el-icon-edit">修改</el-link>
</el-breadcrumb-item>
</el-breadcrumb>
</el-col>
4 years ago
</el-row>
<!-- 组织列表 -->
<el-table v-show="agencyTableFlag"
4 years ago
height="250"
:data="agencyTableListData"
style="width: 100%">
3 years ago
<el-table-column prop="agencyName" label="下级组织" ></el-table-column>
<el-table-column prop="contacts" label="联系人"></el-table-column>
<el-table-column prop="mobile" label="联系人电话"></el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
4 years ago
<template slot="header" slot-scope="scope">
<el-button size="mini"
type="primary"
icon="el-icon-plus"
4 years ago
@click="addAgency(scope.row)"
>新增</el-button>
</template>
<template slot-scope="scope">
4 years ago
<el-button size="mini"
4 years ago
type="warning"
icon="el-icon-arrow-right"
4 years ago
@click="entryAgency(scope.row.agencyId)"
4 years ago
>进入</el-button>
</template>
</el-table-column>
</el-table>
4 years ago
<!-- 下级机关单位/基层科室列表 -->
<el-table v-show="departmentTableFlag"
4 years ago
height="250"
:data="departmentTableListData"
style="width: 100%">
<el-table-column prop="departmentName" label="下级机关单位/基层科室"></el-table-column>
<el-table-column prop="contacts" label="联系人"></el-table-column>
<el-table-column prop="mobile" label="联系人电话"></el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot="header" slot-scope="scope">
<el-button size="mini"
type="primary"
icon="el-icon-plus"
@click="addCommunity(scope.row)"
>新增</el-button>
</template>
<template slot-scope="scope">
<el-button
size="mini"
type="warning"
icon="el-icon-arrow-right"
4 years ago
@click="entryDepartment(scope.row.departmentId)"
>进入</el-button>
</template>
</el-table-column>
</el-table>
<!-- 网格列表 -->
<el-table v-show="gridTableFlag"
3 years ago
height="250"
:data="gridTableListData"
style="width: 100%">
<el-table-column prop="gridName" label="直属网格"></el-table-column>
<el-table-column prop="gridTypeName" label="网格类型"></el-table-column>
<el-table-column prop="contacts" label="联系人"></el-table-column>
<el-table-column prop="mobile" label="联系人电话"></el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot="header" slot-scope="scope">
<el-button size="mini"
type="primary"
icon="el-icon-plus"
@click="addGrid(scope.row)"
>新增</el-button>
</template>
<template slot-scope="scope">
<el-button
size="mini"
type="warning"
icon="el-icon-arrow-right"
4 years ago
@click="entryGrid(scope.row.gridId)"
>进入</el-button>
</template>
</el-table-column>
</el-table>
<!-- 本级工作人员 -->
<el-table v-show="currentAgencyStaffTableFlag"
:data="agencyStaffTableListData"
style="width: 100%"
height="250">
<el-table-column prop="name" label="本级工作人员名字" width="260"></el-table-column>
<el-table-column prop="roles" label="本级工作人员职责" width="260">
<template slot-scope="scope">
<el-tag type="primary" size="mini" v-for="(role, index) in scope.row.roles" :key="index" disable-transitions>{{ role }}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
4 years ago
<template slot="header" slot-scope="scope">
<el-button size="mini"
type="primary"
icon="el-icon-plus"
@click="addPeo(scope.row)"
>新增</el-button>
4 years ago
</template>
<template slot-scope="scope">
<el-button
size="mini"
type="warning"
icon="el-icon-edit"
@click="xiuPeo(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="success"
icon="el-icon-view"
@click="lookAngency(scope.row)"
>查看</el-button>
<el-button
size="mini"
type="info"
icon="el-icon-rank"
@click="transfer(scope.row)"
>调动</el-button>
<el-button
size="mini"
type="danger"
icon="el-icon-circle-close"
@click="DisablePeo(scope.row)"
>禁用</el-button>
</template>
</el-table-column>
</el-table>
4 years ago
<!-- 下级机关单位/基层科室工作人员 -->
<el-table height="250" v-show="departmentStaffTableFlag"
:data="departmentStaffTableListData"
style="width: 100%">
4 years ago
<el-table-column prop="name" label="下级机关单位/基层科室工作人员" width="260"></el-table-column>
<el-table-column prop="roles" label="下级机关单位/基层科室工作人员职责" width="260">
<template slot-scope="scope">
<el-tag type="primary" size="mini" v-for="(role, index) in scope.row.roles" :key="index" disable-transitions>{{ role }}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
4 years ago
<template slot="header" slot-scope="scope">
4 years ago
<el-button size="mini" type="primary" icon="el-icon-plus" @click="addCommunityPeo(scope.row)">新增</el-button>
4 years ago
</template>
4 years ago
<template slot-scope="scope">
4 years ago
<el-button size="mini" type="warning" icon="el-icon-edit" @click="xiuCommunityPeo(scope.row)">修改</el-button>
<el-button size="mini" type="success" icon="el-icon-view" @click="lookAngency(scope.row)">查看</el-button>
<el-button size="mini" type="info" icon="el-icon-rank" @click="transfer(scope.row)">调动</el-button>
<el-button size="mini" type="danger" icon="el-icon-circle-close" @click="DisablePeo(scope.row)">禁用</el-button>
</template>
</el-table-column>
</el-table>
<!-- 网格工作人员 -->
<el-table v-show="gridStaffTableFlag"
:data="gridStaffTableListData"
style="width: 100%"
height="250">
<el-table-column prop="name" label="网格工作人员名字" width="260"></el-table-column>
<el-table-column prop="roles" label="网格工作人员职责" width="260">
<template slot-scope="scope">
<el-tag type="primary" size="mini" v-for="(role, index) in scope.row.roles" :key="index" disable-transitions>{{ role }}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
4 years ago
<template slot="header" slot-scope="scope">
4 years ago
<el-button size="mini" type="primary" icon="el-icon-plus" @click="addGridPeo(scope.row)">新增</el-button>
4 years ago
</template>
4 years ago
<template slot-scope="scope">
<el-button size="mini" type="warning" icon="el-icon-edit" @click="xiuGridPeo(scope.row)">修改</el-button>
<el-button size="mini" type="success" icon="el-icon-view" @click="lookAngency(scope.row)">查看</el-button>
<el-button size="mini" type="info" icon="el-icon-rank" @click="transfer(scope.row)">调动</el-button>
<el-button size="mini" type="danger" icon="el-icon-circle-close" @click="DisablePeo(scope.row)">禁用</el-button>
</template>
</el-table-column>
</el-table>
4 years ago
<!-- 新增下级机关单位/基层科室 -->
<el-dialog
4 years ago
title="新增部门"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose">
<el-form :rules="rules">
3 years ago
<el-form-item label="部门名称" prop="addDepartmentName">
<el-input v-model="insertForm.departmentName" placeholder="请输入部门名称"></el-input>
</el-form-item>
<el-form-item label="组织编码" prop="code">
<el-input v-model="insertForm.code" placeholder="请输入组织编码"></el-input>
</el-form-item>
<el-form-item label="联系人" prop="contacts">
<el-input v-model="insertForm.contacts" placeholder="请输入联系人姓名"></el-input>
</el-form-item>
<el-form-item label="联系电话" prop="mobile">
<el-input v-model="insertForm.mobile" placeholder="请输入联系电话"></el-input>
</el-form-item>
</el-form>
<div slot="footer" >
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
<!-- 新增网格 -->
<div v-if="dialogVisibleGrid">
<el-dialog
title="新增网格"
:visible.sync="dialogVisibleGrid"
width="60%"
:before-close="handleClose">
<el-form :rules="rules">
<el-form-item label="网格名称" prop="gridName">
<el-input v-model="GridForm.gridName" placeholder="请输入部门名称"></el-input>
</el-form-item>
<el-form-item label="网格编码" prop="GridCode">
<el-input v-model="GridForm.code" placeholder="请输入网格编码"></el-input>
</el-form-item>
<!-- 网格类型下拉框 -->
<el-form-item label="网格类型" prop="typeTag">
<el-select v-model="GridForm.gridType" clearable placeholder="网格类型">
<el-option v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="联系人" prop="GridContacts">
<el-input v-model="GridForm.contacts" placeholder="请输入联系人姓名"></el-input>
</el-form-item>
<el-form-item label="联系电话" prop="GridMobile">
<el-input v-model="GridForm.mobile" placeholder="请输入联系电话"></el-input>
</el-form-item>
<!-- 组织位置 -->
<el-form-item>
<div id="container">当前点击坐标为<span id="position"></span></div>
</el-form-item>
</el-form>
<div slot="footer" >
<el-button @click="cancelGrid"> </el-button>
<el-button type="primary" @click="submitGrid"> </el-button>
</div>
</el-dialog>
</div>
<!-- 新增人员 -->
4 years ago
<div v-if="dialogVisiblePeo">
<el-dialog
title="新增人员"
:visible.sync="dialogVisiblePeo"
width="30%"
:before-close="handleClose">
<el-form>
<el-form-item label="姓名" prop="peoName">
<el-input v-model="peoForm.name" placeholder="请输入姓名"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input v-model="peoForm.mobile" placeholder="请输入手机号"></el-input>
</el-form-item>
<!-- 性别下拉框 -->
<el-form-item label="性别" prop="gender">
<el-select v-model="peoForm.gender" clearable placeholder="性别">
<el-option v-for="item in genderList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<!-- 专兼职下拉框 -->
<el-form-item label="专兼职" prop="post">
<el-select v-model="peoForm.post" clearable placeholder="专兼职">
<el-option v-for="item in postList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<!-- 职责下拉框 -->
<el-form-item label="职责" prop="duty">
<el-select v-model="peoForm.duty" multiple placeholder="请选择">
<el-option
v-for="item in dutyList"
4 years ago
:key="item.roleId"
:label="item.roleName"
:value="item.roleId"
4 years ago
:disabled="item.disabled">
</el-option>
</el-select>
</el-form-item>
4 years ago
</el-form>
<div slot="footer" >
<el-button @click="cancelPeo"> </el-button>
<el-button type="primary" @click="submitPeo"> </el-button>
</div>
</el-dialog>
</div>
<!-- 人员修改 -->
<el-dialog
title="人员修改"
:visible.sync="modifyPeo"
width="30%"
:before-close="handleClose">
<el-form >
<el-form-item label="姓名" prop="peoName">
<el-input v-model="peoForm.name" placeholder="请输入姓名"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input v-model="peoForm.mobile" placeholder="请输入手机号"></el-input>
</el-form-item>
<el-form-item label="性别" prop="gender">
<el-select v-model="peoForm.gender" clearable placeholder="性别">
<el-option v-for="item in genderList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="专兼职" prop="post">
<el-select v-model="peoForm.post" clearable placeholder="专兼职">
<el-option v-for="item in postList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="职责" prop="duty">
<el-select v-model="peoForm.duty" multiple placeholder="请选择">
<el-option
v-for="item in dutyList"
4 years ago
:key="item.roleId"
:label="item.roleName"
:value="item.roleId"
:disabled="item.disabled">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" >
<el-button @click="cancelXiugai"> </el-button>
<el-button type="primary" @click="updatePeo"> </el-button>
</div>
</el-dialog>
<!-- 禁用弹窗 -->
<el-dialog
title="确认禁用"
:visible.sync="Disable"
width="30%"
:before-close="handleClose"
>
<span>禁用后该用户将无法登录系统是否继续</span>
<div slot="footer" >
<el-button @click="cancelDisable"> </el-button>
<el-button type="primary" @click="submitDisable"> </el-button>
</div>
</el-dialog>
<!-- 人员查看 -->
<el-dialog
title="人员详情"
:visible.sync="details"
width="30%"
4 years ago
:before-close="handleClosePeoView">
<el-form>
<el-form-item label="姓名" >
<el-input v-model="peoForm.name" placeholder="姓名" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="手机号" >
<el-input v-model="peoForm.mobile" placeholder="手机号" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="组织/部门" >
<el-input v-model="peoForm.zuzhi" placeholder="组织/部门" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="激活时间" >
<el-input v-model="peoForm.activeTime" placeholder="激活时间" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="职位" >
<el-input v-model="peoForm.duty" placeholder="职位" :disabled="true"></el-input>
</el-form-item>
3 years ago
<el-form-item label="是否禁用">
<el-input v-model="peoForm.disableFlag" placeholder="是否禁用" :disabled="true"></el-input>
</el-form-item>
</el-form>
<div slot="footer" >
<el-button type="primary" style="margin-right:170px" @click="cancelDetails"> </el-button>
</div>
</el-dialog>
<!-- 人员调动 -->
<el-dialog
title="人员调动"
:visible.sync="transferPeo"
width="30%"
:before-close="handleClose">
4 years ago
<el-form :model="agencyForm">
<el-form-item label="姓名">
<el-input v-model="transferForm.name" placeholder="姓名"></el-input>
</el-form-item>
<el-form-item label="调动至">
4 years ago
<el-cascader
clearable
:props="{ checkStrictly: true }"
v-model="selectValue"
:options="options"
@change="handleChange">
</el-cascader>
</el-form-item>
<el-form-item label="调动原因">
<el-input
type="textarea"
:rows="2"
placeholder="请输入内容"
maxlength="500"
show-word-limit
v-model="transferForm.remarks">
</el-input>
</el-form-item>
</el-form>
<div slot="footer" >
<el-button @click="cancelTransfer"> </el-button>
<el-button type="primary" @click="submitTransfer"> </el-button>
</div>
</el-dialog>
4 years ago
<!-- 新增组织 -->
4 years ago
<el-dialog
title="新增组织"
:visible.sync="createAgencyDialogFlag"
4 years ago
width="60%"
:before-close="handleClose">
<el-form>
<el-form-item label="组织名称">
<el-input v-model="agencyForm.agencyName" placeholder="请输入组织名称"></el-input>
</el-form-item>
<!-- 组织区划 -->
4 years ago
<el-form-item label="组织区划">
<el-select v-model="agencyForm.areaCode" placeholder="请选择组织区划" @change="handelZoing">
4 years ago
<el-option
v-for="item in zonings"
:key="item.areaCode"
:label="item.areaName"
:value="item.areaCode">
4 years ago
</el-option>
</el-select>
</el-form-item>
4 years ago
<el-form-item label="组织编码">
<el-input v-model="agencyForm.code" placeholder="请输入组织编码"></el-input>
</el-form-item>
<el-form-item label="负责人">
<el-input v-model="agencyForm.contacts" placeholder="请输入负责人名字"></el-input>
</el-form-item>
<el-form-item label="联系电话">
<el-input v-model="agencyForm.mobile" placeholder="请输入联系电话"></el-input>
</el-form-item>
<el-form-item>
<div id="con"></div>
</el-form-item>
</el-form>
<div slot="footer" >
<el-button @click="canceladdNewAgency"> </el-button>
<el-button type="primary" @click="submitaddNewAgency"> </el-button>
</div>
</el-dialog>
4 years ago
<!-- 修改市区级组织 -->
<el-dialog
title="修改组织"
:visible.sync="modifyCityOrgPop"
width="60%"
:before-close="handleClose">
<el-form>
<el-form-item label="组织名称">
<el-input v-model="OrgDetailsForm.agencyName" placeholder="请输入组织名称"></el-input>
</el-form-item>
<el-form-item label="组织编码">
<el-input v-model="OrgDetailsForm.code" placeholder="请输入组织编码"></el-input>
</el-form-item>
<el-form-item label="负责人">
<el-input v-model="OrgDetailsForm.contacts" placeholder="请输入负责人名字"></el-input>
</el-form-item>
<el-form-item label="联系电话">
<el-input v-model="OrgDetailsForm.mobile" placeholder="请输入联系电话"></el-input>
</el-form-item>
<el-form-item>
<div id="con"></div>
</el-form-item>
</el-form>
<div slot="footer" >
<el-button @click="cancelModifyCityOrgPop"> </el-button>
<el-button type="primary" @click="sunmitModifyCityOrgPop"> </el-button>
</div>
</el-dialog>
<!-- 修改街道/社区级组织 -->
<el-dialog
title="修改组织"
:visible.sync="streetOrCommunity"
width="60%"
:before-close="handleClose">
<el-form>
<el-form-item label="组织名称">
<el-input v-model="OrgDetailsForm.agencyName" placeholder="请输入组织名称"></el-input>
</el-form-item>
<!-- 组织区划 -->
<el-form-item label="组织区划">
<el-select v-model="OrgDetailsForm.areaCode" placeholder="请选择组织区划" @change="handelStreeOrCommunityZoing">
4 years ago
<el-option
v-for="item in zonings"
:key="item.areaCode"
:label="item.areaName"
:value="item.areaCode">
4 years ago
</el-option>
</el-select>
</el-form-item>
<el-form-item label="组织编码">
<el-input v-model="OrgDetailsForm.code" placeholder="请输入组织编码"></el-input>
</el-form-item>
<el-form-item label="负责人">
<el-input v-model="OrgDetailsForm.contacts" placeholder="请输入负责人名字"></el-input>
</el-form-item>
<el-form-item label="联系电话">
<el-input v-model="OrgDetailsForm.mobile" placeholder="请输入联系电话"></el-input>
</el-form-item>
<el-form-item>
<div id="con"></div>
</el-form-item>
</el-form>
<div slot="footer" >
<el-button @click="cancelstreetOrCommunity"> </el-button>
<el-button type="primary" @click="sunmitModifyCityOrgPop"> </el-button>
</div>
</el-dialog>
<!-- 修改下级机关单位 -->
<el-dialog
title="修改部门"
:visible.sync="OrgUnitPop"
width="60%"
:before-close="handleClose">
<el-form>
<el-form-item label="部门名称">
<el-input v-model="OrgUnitDetailsForm.departmentName" placeholder="请输入组织名称"></el-input>
</el-form-item>
<el-form-item label="组织编码">
<el-input v-model="OrgUnitDetailsForm.code" placeholder="请输入组织编码"></el-input>
</el-form-item>
<el-form-item label="负责人">
<el-input v-model="OrgUnitDetailsForm.contacts" placeholder="请输入负责人名字"></el-input>
</el-form-item>
<el-form-item label="联系电话">
<el-input v-model="OrgUnitDetailsForm.mobile" placeholder="请输入联系电话"></el-input>
</el-form-item>
</el-form>
<div slot="footer" >
<el-button @click="cancelOrgUnitPop"> </el-button>
<el-button type="primary" @click="sunmitOrgUnitForm"> </el-button>
</div>
</el-dialog>
<!-- 修改网格 -->
<el-dialog
title="修改网格"
:visible.sync="modifyGridPop"
width="60%"
:before-close="handleClose">
<el-form>
<el-form-item label="网格名称">
<el-input v-model="modifyGridFrom.gridName" placeholder="请输入组织名称"></el-input>
</el-form-item>
<el-form-item label="组织编码">
<el-input v-model="modifyGridFrom.code" placeholder="请输入组织编码"></el-input>
</el-form-item>
<!-- 网格类型下拉框 -->
<el-form-item label="网格类型" prop="typeTag">
<el-select v-model="modifyGridFrom.gridType" clearable placeholder="网格类型">
<el-option v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="负责人">
<el-input v-model="modifyGridFrom.contacts" placeholder="请输入负责人名字"></el-input>
</el-form-item>
<el-form-item label="联系电话">
<el-input v-model="modifyGridFrom.mobile" placeholder="请输入联系电话"></el-input>
</el-form-item>
<!-- 组织位置,地图 -->
<el-form-item>
<div id="con"></div>
</el-form-item>
</el-form>
<div slot="footer" >
<el-button @click="cancelModifyGridPop"> </el-button>
<el-button type="primary" @click="submitModifyGrid"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { requestPost } from "@/js/dai/request";
export default {
data(){
return{
4 years ago
// 新增组织弹窗
createAgencyDialogFlag: false,
4 years ago
// 修改市区级组织弹窗
modifyCityOrgPop:false,
// 修改街道/社区级组织弹窗
streetOrCommunity:false,
// 修改下级机关单位弹窗
OrgUnitPop:false,
// 修改网格弹窗
modifyGridPop:false,
// 组织列表展示标识
agencyTableFlag: true,
// 组织工作人员列表展示标识
currentAgencyStaffTableFlag: true,
// 组织列表数据
agencyTableListData: [],
// 组织工作人员列表数据
agencyStaffTableListData:[],
// 部门列表(机关、科室列表)列表展示标识
departmentTableFlag: true,
// 部门人员列表展示标识
departmentStaffTableFlag: false,
// 部门列表数据
departmentTableListData: [],
// 部门工作人员列表数据
departmentStaffTableListData:[],
// 网格列表展示标识
gridTableFlag:true,
// 网格人员列表展示标识
gridStaffTableFlag: false,
// 网格列表数据
gridTableListData: [],
// 网格工作人员列表数据
gridStaffTableListData:[],
4 years ago
// 用户所属组织ID
userAgencyId: localStorage.getItem("agencyId"),
4 years ago
// 修改时操作的用户staffId
userStaffId: '',
4 years ago
// 当前被操作的组织的ID
currentAgencyId: localStorage.getItem("agencyId"),
// 当前被操作的部门的ID
4 years ago
currentDepartmentId:'14f572e724eecf7668b655505d789cab',
4 years ago
// 当前被操作的网格的ID
4 years ago
currentGridOrgId:'63d5ff92ea981b1c58e4914ac894c610',
4 years ago
// 经纬度坐标
lat:'11',
lng:'11',
latitude:'11',
longitude:'11',
Navigation:'',
// 查询参数
queryParams: {
deptName: undefined,
status: undefined
},
// 状态列表
dictList:[],
// 重新渲染表格状态
refreshTable: true,
// 是否展开,默认全部展开
isExpandAll: true,
// 显示搜索条件
showSearch: true,
// 遮罩层
loading: true,
// 表格树数据
deptList: [],
// 弹窗开关
4 years ago
dialogVisible: false,
dialogVisibleGrid: false,
dialogVisiblePeo: false,
Disable: false,
details: false,
transferPeo: false,
// 社区添加表单项
insertForm:{
departmentName:'',
code:'',
contacts:'',
mobile:'',
agencyId:'',
departmentDuty:'123'
},
// 网格添加表单项
GridForm:{
gridName:'',
code:'',
contacts:'',
mobile:'',
agencyId:'',
manageDistrict:'',
gridType:'',
location: '', //坐标位置
longitude: '11', //经度
latitude: '11' ,//纬度
centerAddress:''
},
4 years ago
// 新增组织
agencyForm:{
parentAgencyId:'',
agencyName:'',
level:'',
areaCodeSwitch:'',
areaCode:'',
areaName:'',
contacts:'',
mobile:'',
code:''
},
// 树
tree:[],
// 新增人员表单项
peoForm:{
name:'',
mobile:'',
gender:'',
post:'',
duty:[],
orgType:'',
activeTime:'',
zuzhi:'',
3 years ago
disableFlag:''
},
// 人员调动
transferForm:{
name:'',
remarks:'',
transferTo:'',
staffId:'',
orgId:'',
orgType:''
},
// 人员禁用
DisableForm:{
staffId:'',
agencyId:'',
customerId:''
},
4 years ago
// 当前用户信息,用于获取组织区划
userForm:{
areaCode:'',
level:'',
parentAgencyId:''
},
4 years ago
// 组织详细信息
OrgDetailsForm:{
level:'',
agencyName:'',
code:'',
contacts:'',
mobile:'',
centerAddress:'',
areaCode:'',
4 years ago
agencyId:'',
areaName:''
4 years ago
},
// 下级机关单位
OrgUnitDetailsForm:{
code:'',
contacts:'',
departmentId:'',
departmentName:'',
mobile:''
},
// 网格修改表单
modifyGridFrom:{
gridName:'',
code:'',
gridTypeName:'',
contacts:'',
mobile:'',
latitude:'',
longitude:'',
agencyId:'',
gridType:'',
manageDistrict:'',
griId:''
},
judgeOrgInfoLevel:[],
keyWords: '',
typeList:[],
// 性别字典
genderList: [
{value: '1', label: '男'},
{value: '2', label: '女'},
],
// 专兼职字典
postList:[
{value: 'fulltime' , label: '专职'},
{value: 'parttime' , label: '兼职'}
],
// 职责字典
4 years ago
dutyList:[],
// 修改操作是否展示
modifyPeo:false,
submitOrgid:'',
// 级联数据
options:[
{
value:'',
label:'',
children:[
{
value:'',
label:'',
children:[]
},
{
value:'',
label:'',
children:[]
}
],
}
],
4 years ago
selectValue: [],
// 顶部 面包屑
breadcrumbArr: [],
// 面包屑 当前所属机构ID
4 years ago
currentBreadcrumbKey: '',
4 years ago
// 组织区划数据
zonings:[],
// 校验
4 years ago
rules: {
departmentName:[
{ required: true, message: '社区名称必填', trigger: 'blur' }
],
gridName:[
{ required: true, message: '网格名称必填', trigger: 'blur' }
3 years ago
],
addDepartmentName:[
{ required: true, message: '部门名称必填', trigger: 'blur' }
]
}
}
},
created(){
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
4 years ago
this.getAgencyStaffListData()
this.getRoleList()
// this.getNavigation()
// 更新顶部面包屑
this.assembleBreadcrumbArr(localStorage.getItem('agencyId'), 'agency')
},
watch: {
dialogVisibleGrid(val) {
if (val) {
setTimeout(() => {
let _that = this
this.initMap(_that)
}, 1000);
}
4 years ago
},
createAgencyDialogFlag(val) {
4 years ago
if (val) {
setTimeout(() => {
let _t = this
this.createMap(_t)
}, 1000);
}
4 years ago
},
modifyCityOrgPop(val){
if (val) {
setTimeout(() => {
let _t = this
this.createMap(_t)
}, 1000);
}
},
streetOrCommunity(val){
if (val) {
setTimeout(() => {
let _t = this
this.createMap(_t)
}, 1000);
}
},
modifyGridPop(val){
if (val) {
setTimeout(() => {
let _t = this
this.createMap(_t)
}, 1000);
}
}
},
mounted(){
// this.initMap()
},
methods:{
// 点击后获取id
handleChange (e) {
this.transferForm.orgId = e[1]
4 years ago
if(this.transferForm.orgId != null || ''){
if(this.transferForm.orgId === 0){
4 years ago
if(e[2] == null || ''){
this.transferForm.orgType = 'dept'
this.transferForm.orgId = "14f572e724eecf7668b655505d789cab"
}else{
this.transferForm.orgId = e[2]
this.transferForm.orgType = 'dept'
}
4 years ago
} else {
4 years ago
if(e[2] == null || ''){
this.transferForm.orgType = 'grid'
this.transferForm.orgId = "63d5ff92ea981b1c58e4914ac894c610"
} else {
this.transferForm.orgId = e[2]
this.transferForm.orgType = 'grid'
}
4 years ago
}
}else{
this.transferForm.orgId = e[0]
this.transferForm.orgType = 'agency'
}
4 years ago
},
/** 查询系统工作人员角色(职责) */
async getRoleList () {
const url = "/gov/org/staff/rolelist"
let params = {
agencyId: this.currentAgencyId
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.dutyList = data
}else{
this.$message.error(msg)
}
},
/** 查询组织列表 */
async getAgencyList(){
const url = "/gov/org/agency/agencylist"
let params = {
4 years ago
agencyId: this.currentAgencyId
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.agencyTableListData = data
}else{
this.$message.error(msg)
}
},
/** 查询社区列表 */
async getDepartmentList(){
const url = "/gov/org/department/departmentlist"
let params = {
4 years ago
agencyId: this.currentAgencyId
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.departmentTableListData = data
}else{
this.$message.error(msg)
}
},
/** 查询网格列表 */
async getGridList(){
const url = "/gov/org/grid/allgrids"
let params = {
4 years ago
agencyId: this.currentAgencyId
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.gridTableListData = data
}else{
this.$message.error(msg)
}
},
// 查询网格人员列表
4 years ago
async getGridStaffListData(){
const url = "/data/aggregator/org/stafflist"
let params = {
4 years ago
orgId:this.currentGridOrgId,
orgType:'grid',
pageNo:1,
pageSize:100
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.gridStaffTableListData = data.staffList
} else {
this.$message.error(msg)
}
},
// 查询组织工作人员
4 years ago
async getAgencyStaffListData(){
const url = "/data/aggregator/org/stafflist"
let params = {
4 years ago
orgId: this.currentAgencyId,
orgType:'agency',
pageNo:1,
pageSize:100
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0) {
this.agencyStaffTableListData = data.staffList
} else {
this.$message.error(msg)
}
},
// 查询部门人员
4 years ago
async getDepartmentStaffListData(){
const url = "/data/aggregator/org/stafflist"
let params = {
4 years ago
orgId:this.currentDepartmentId,
orgType:'dept',
pageNo:1,
pageSize:100
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.departmentStaffTableListData = data.staffList
} else {
this.$message.error(msg)
}
},
// 添加组织
async submit(){
const url = "/gov/org/department/adddepartment"
let params = {
agencyId:this.insertForm.agencyId,
departmentName:this.insertForm.departmentName,
departmentDuty:this.insertForm.departmentDuty,
contacts:this.insertForm.contacts,
mobile:this.insertForm.mobile,
code:this.insertForm.code
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.$message.success("添加成功")
this.dialogVisible = false
this.insertForm = []
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
4 years ago
this.getAgencyStaffListData()
}else{
this.$message.error(msg)
}
},
// 添加网格
async submitGrid(){
const url = "/gov/org/grid/addgrid"
let params = {
agencyId:this.GridForm.agencyId,
gridName:this.GridForm.gridName,
contacts:this.GridForm.contacts,
mobile:this.GridForm.mobile,
code:this.GridForm.code,
manageDistrict:this.GridForm.manageDistrict,
gridType:this.GridForm.gridType,
latitude:this.lat,
longitude:this.lng
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.$message.success("添加成功")
this.dialogVisibleGrid = false
this.GridForm = []
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
4 years ago
this.getAgencyStaffListData()
} else {
this.$message.error(msg)
}
},
// 添加人员
async submitPeo(){
const url = "/gov/org/staff/addstaffv2"
let params = {
orgType:this.peoForm.orgType,
name:this.peoForm.name,
mobile:this.peoForm.mobile,
gender:this.peoForm.gender,
workType:this.peoForm.post,
roles:this.peoForm.duty,
orgId:this.submitOrgid
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.$message.success("添加成功")
this.dialogVisiblePeo = false
this.peoForm = []
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
4 years ago
this.getAgencyStaffListData()
} else {
this.$message.error(msg)
}
},
// 人员修改
async updatePeo(){
const url = "/gov/org/staff/editstaff"
let params = {
4 years ago
staffId:this.userStaffId,
name:this.peoForm.name,
mobile:this.peoForm.mobile,
4 years ago
gender:this.peoForm.gender === '男' ? 1 : 0,
workType:this.peoForm.post,
roles:this.peoForm.duty,
4 years ago
agencyId:this.userAgencyId,
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0) {
4 years ago
this.$message.success("修改成功")
this.modifyPeo = false
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
4 years ago
this.getAgencyStaffListData()
4 years ago
this.getDepartmentStaffListData()
this.getGridStaffListData()
} else {
this.$message.error(msg)
}
},
// 字典
async getDictionaries(){
const url = "/sys/dict/data/dictlist"
let params = {
dictType:'grid_type'
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.typeList = data
} else {
this.$message.error(msg)
}
},
/** 搜索按钮操作 */
handleQuery(){
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.deptName = undefined
this.queryParams.status = undefined
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd(row){
this.dialogVisible=true
},
// 社区弹框关闭函数
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
this.insertFormRest()
done();
})
.catch(_ => {});
},
4 years ago
// 人员查看叉号关闭
handleClosePeoView(done){
this.insertFormRest()
done();
},
// 社区新增弹框重置函数
insertFormRest(){
this.insertForm.name = '',
this.insertForm.contacts = '',
this.insertForm.code = '',
3 years ago
this.insertForm.mobile = '',
this.insertForm.departmentName = ''
},
// 网格新增弹框重置函数
GridFormRest(){
this.GridForm.gridName = '',
this.GridForm.code = '',
this.GridForm.centerAddress = '',
this.GridForm.contacts = '',
this.GridForm.mobile = '',
this.GridForm.agencyId = '',
this.GridForm.manageDistrict = '',
this.GridForm.gridType = '',
this.GridForm.location = '',
this.GridForm.longitude = '',
this.GridForm.latitude = ''
},
/** 人员清空 */
peoFormRest(){
this.peoForm.name = '',
this.peoForm.mobile = '',
this.peoForm.gender = '',
this.peoForm.post = '',
this.peoForm.duty = ''
},
// 人员调动
transferRest(){
this.transferForm.name = '',
this.transferForm.remarks = '',
this.transferForm.transferTo = ''
this.transferForm.staffId = '',
this.transferForm.orgId = '',
this.transferForm.orgType = ''
this.selectValue = ''
3 years ago
this.options[0] = []
},
4 years ago
// 新增组织
addNewAgencyRest(){
this.agencyForm.parentAgencyId = '',
this.agencyForm.agencyName = '',
this.agencyForm.level = '',
this.agencyForm.areaCodeSwitch = '',
this.agencyForm.areaCode = '',
this.agencyForm.areaName = '',
this.agencyForm.contacts = '',
this.agencyForm.mobile = '',
this.agencyForm.code = '',
this.latitude = '',
this.longitude = ''
},
4 years ago
// 修改市级组织
cancelModifyCityOrgPopRest(){
this.OrgDetailsForm.level = '',
this.OrgDetailsForm.agencyName = '',
this.OrgDetailsForm.code = '',
this.OrgDetailsForm.contacts = '',
this.OrgDetailsForm.mobile = '',
this.OrgDetailsForm.centerAddress = '',
this.OrgDetailsForm.areaCode = ''
this.OrgDetailsForm.agencyId = ''
this.latitude = '',
this.longitude = ''
},
// 修改下级机关单位
OrgUnitDetailsRest(){
this.OrgUnitDetailsForm.code = '',
this.OrgUnitDetailsForm.contacts = '',
this.OrgUnitDetailsForm.departmentId = '',
this.OrgUnitDetailsForm.departmentName = '',
this.OrgUnitDetailsForm.mobile = ''
},
// 修改网格清空
ModifyGridPopRest(){
this.modifyGridFrom.gridName = '',
this.modifyGridFrom.code = '',
this.modifyGridFrom.gridTypeName = '',
this.modifyGridFrom.contacts = '',
this.modifyGridFrom.mobile = '',
this.latitude = '',
this.longitude = '',
this.modifyGridFrom.agencyId = '',
this.modifyGridFrom.gridType = '',
this.modifyGridFrom.manageDistrict = '',
this.modifyGridFrom.griId = ''
},
// 社区新增弹框取消按钮
cancel(){
this.dialogVisible = false
this.insertFormRest()
},
// 网格新增弹框取消按钮
cancelGrid(){
this.dialogVisibleGrid = false
this.GridFormRest()
},
/** 取消按钮 */
cancelPeo(){
this.dialogVisiblePeo = false
this.peoFormRest()
},
// 修改取消
cancelXiugai(){
this.modifyPeo = false
this.peoFormRest()
},
// 查看弹窗
cancelDetails(){
this.details = false
},
/** 人员调动取消按钮 */
cancelTransfer(){
this.transferRest()
this.transferPeo = false
},
4 years ago
// 新增组织取消按钮
canceladdNewAgency(){
this.addNewAgencyRest()
this.createAgencyDialogFlag = false
4 years ago
},
4 years ago
// 修改市级组织取消按钮
cancelModifyCityOrgPop(){
this.cancelModifyCityOrgPopRest()
this.modifyCityOrgPop = false
},
// 修改街道/社区级取消按钮
cancelstreetOrCommunity(){
this.cancelModifyCityOrgPopRest()
this.streetOrCommunity = false
},
// 取消修改下级机关单位按钮
cancelOrgUnitPop(){
this.OrgUnitPop = false
this.OrgUnitDetailsRest()
},
// 取消修改网格按钮
cancelModifyGridPop(){
this.modifyGridPop = false
this.ModifyGridPopRest()
},
// 进入网格,查询网格所属人员
4 years ago
entryGrid(gridId){
this.gridStaffTableListData = []
this.departmentStaffTableListData =[]
this.agencyStaffTableListData = []
4 years ago
this.currentGridOrgId = gridId
this.gridStaffTableFlag = true
this.departmentStaffTableFlag = false
this.currentAgencyStaffTableFlag = false
this.agencyTableFlag = false
this.departmentTableFlag = false
this.gridTableFlag = false
4 years ago
this.getGridStaffListData()
4 years ago
this.assembleBreadcrumbArr(gridId, 'grid')
},
4 years ago
// 进入部门,查询部门所属人员
4 years ago
entryDepartment(departmentId){
this.gridStaffTableListData = []
this.departmentStaffTableListData = []
this.agencyStaffTableListData = []
4 years ago
this.currentDepartmentId = departmentId
this.departmentStaffTableFlag = true
this.currentAgencyStaffTableFlag = false
this.gridStaffTableFlag = false
this.gridTableFlag = false
this.agencyTableFlag = false
this.departmentTableFlag = false
4 years ago
this.getDepartmentStaffListData()
4 years ago
this.assembleBreadcrumbArr(departmentId, 'department')
},
// 进入组织,重新渲染
4 years ago
entryAgency(agencyId){
4 years ago
this.currentAgencyId = agencyId
this.agencyTableListData = []
this.departmentTableListData = []
this.gridTableListData = []
this.gridStaffTableListData = []
this.agencyStaffTableListData = []
this.departmentStaffTableListData = []
4 years ago
this.getDepartmentList()
4 years ago
this.getGridList()
4 years ago
this.getAgencyStaffListData()
4 years ago
this.getAgencyList()
4 years ago
this.assembleBreadcrumbArr(agencyId, 'agency')
4 years ago
},
// 新增组织
addCommunity(row){
4 years ago
this.insertForm.agencyId = this.currentAgencyId
this.dialogVisible = true
},
// 新增网格
addGrid(row){
4 years ago
this.GridForm.agencyId = this.currentAgencyId
this.getDictionaries()
this.dialogVisibleGrid = true
},
// 新增人员
addPeo(row){
this.dialogVisiblePeo = true
this.peoForm.orgType = 'agency'
4 years ago
this.submitOrgid = this.currentAgencyId
},
4 years ago
// 新增社区人员
addCommunityPeo(){
this.dialogVisiblePeo = true
this.peoForm.orgType = 'dept'
4 years ago
this.submitOrgid = this.currentDepartmentId
},
4 years ago
// 新增网格人员
addGridPeo(){
this.dialogVisiblePeo = true
this.peoForm.orgType = 'grid'
4 years ago
this.submitOrgid = this.currentGridOrgId
},
// 修改网格人员
4 years ago
async xiuGridPeo(row){
this.modifyPeo = true
this.peoForm.orgType = 'grid'
4 years ago
this.submitOrgid = this.currentGridOrgId
4 years ago
this.userStaffId = row.staffId
4 years ago
const url = "/gov/org/staff/editstaffinit"
let params = {
staffId: row.staffId,
agencyId: this.currentAgencyId
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.peoForm.name = data.name
this.peoForm.mobile = data.mobile
4 years ago
this.peoForm.gender = data.gender === 1 ? '男' : '女'
4 years ago
this.peoForm.post = data.workType
// 已有的权限(职责)
let existedRoleArr = []
data.roleList.forEach(function (sysRole) {
if (sysRole.selected === true) {
existedRoleArr.push(sysRole.roleId)
}
})
this.peoForm.duty = existedRoleArr
} else {
this.$message.error(msg)
}
4 years ago
},
// 修改人员
async xiuPeo(row){
this.modifyPeo = true
this.peoForm.orgType = 'agency'
this.submitOrgid = this.currentAgencyId
this.userStaffId = row.staffId
const url = "/gov/org/staff/editstaffinit"
let params = {
staffId:row.staffId,
agencyId:this.currentAgencyId
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.peoForm.name = data.name
this.peoForm.mobile = data.mobile
this.peoForm.post = data.workType
this.peoForm.gender = data.gender === 1 ? '男' : '女'
// 已有的权限(职责)
let existedRoleArr = []
data.roleList.forEach(function (sysRole) {
if (sysRole.selected === true) {
existedRoleArr.push(sysRole.roleId)
}
})
this.peoForm.duty = existedRoleArr
} else {
this.$message.error(msg)
}
},
// 修改社区人员
async xiuCommunityPeo(row){
this.modifyPeo = true
this.peoForm.orgType = 'dept'
this.submitOrgid = this.currentDepartmentId
this.userStaffId = row.staffId
const url = '/gov/org/staff/editstaffinit'
let params = {
staffId:row.staffId,
agencyId:this.currentAgencyId
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.peoForm.name = data.name
this.peoForm.mobile = data.mobile
this.peoForm.gender = data.gender === 1 ? '男' : '女'
this.peoForm.post = data.workType
// 已有的权限(职责)
let existedRoleArr = []
data.roleList.forEach(function (sysRole) {
if (sysRole.selected === true) {
existedRoleArr.push(sysRole.roleId)
}
})
this.peoForm.duty = existedRoleArr
}else {
this.$message.error(msg)
}
},
// 取消禁用按钮
cancelDisable(){
this.Disable = false
},
// 人员禁用
DisablePeo(row){
this.DisableForm.staffId = row.staffId
this.Disable = true
},
// 确定禁用
async submitDisable(){
const url = "/epmetuser/customerstaff/disabledstaff"
let params = {
staffId:this.DisableForm.staffId,
agencyId:this.DisableForm.agencyId,
customerId:this.DisableForm.customerId
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.$message.success("禁用成功")
this.Disable = false
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
4 years ago
this.getAgencyStaffListData()
} else {
this.$message.error(msg)
}
},
// 查看按钮
async lookAngency(row){
const url = "/data/aggregator/org/staffdetailv2"
let params = {
staffId:row.staffId
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.peoForm.name = data.name
3 years ago
this.peoForm.mobile = data.mobile.substr(0,3) + "****" + data.mobile.substr(7)
this.peoForm.activeTime = data.activeTime
this.peoForm.duty = data.roles
this.peoForm.zuzhi = data.orgName
3 years ago
if (data.enableFlag === 'enable') {
this.peoForm.disableFlag = '已启用'
} else {
this.peoForm.disableFlag = '已禁用'
}
}
this.details = true
},
// 人员调动
async transfer(row){
this.transferForm.name = row.name
this.transferForm.staffId = row.staffId
this.transferPeo = true
const url = "/gov/org/customeragency/orgtree"
let params = {
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.options[0].label = data.agencyName
this.options[0].value = data.agencyId
4 years ago
console.log('--------',this.options)
let depart = Array.from(data.departmentList)
4 years ago
let gr = Array.from(data.gridList)
depart.forEach(item => {
const ob = {
value:item.deptId,
label:item.deptName
}
4 years ago
this.options[0].children[0].children.push(ob)
})
4 years ago
this.options[0].children[0].value = 0
this.options[0].children[0].label = "部门"
this.options[0].children[1].value = 1
this.options[0].children[1].label = "网格"
gr.forEach(item => {
const obj = {
value:item.gridId,
label:item.gridName
}
4 years ago
this.options[0].children[1].children.push(obj)
})
}else{
this.$message.error("树查询失败",msg)
}
},
// 人员调动确定
async submitTransfer(){
const url = "/gov/org/staff/stafftransferv2"
let params = {
staffId:this.transferForm.staffId,
orgId:this.transferForm.orgId,
orgType:this.transferForm.orgType,
remarks:this.transferForm.remarks
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.$message.success("调动成功")
this.transferRest()
this.transferPeo = false
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
4 years ago
this.getAgencyStaffListData()
4 years ago
this.getDepartmentStaffListData()
this.getAgencyStaffListData()
this.getGridStaffListData()
} else {
this.$message.error(msg)
}
},
4 years ago
// 获取导航
// async getNavigation(){
4 years ago
// const url = "/gov/org/customeragency/orgtree"
4 years ago
// let params = {
4 years ago
// }
4 years ago
// const { data, code, msg } = await requestPost(url,params)
4 years ago
// if(code === 0){
// this.Navigation = data.agencyName
// }
4 years ago
// 组装顶部面包屑数组
async assembleBreadcrumbArr (id, orgType) {
4 years ago
this.currentBreadcrumbKey = id
if (orgType === 'agency') {
const url = '/gov/org/agency/agencydetail'
let params = {
agencyId : id,
}
const { data, code, msg } = await requestPost(url, params)
if(code === 0){
4 years ago
// 社区级为最低级组织,不展示下级组织列表
4 years ago
if (data.level === 'community') {
this.agencyTableFlag = false
4 years ago
} else {
this.agencyTableFlag = true
4 years ago
}
if (this.breadcrumbArr.length === 0) {
this.breadcrumbArr = [{id: data.agencyId, name: data.agencyName, type: orgType}]
} else {
4 years ago
let hasBreadcrumbArr = false
this.breadcrumbArr.forEach(function (bc) {
if (bc.id === id) {
hasBreadcrumbArr = true
}
})
if (hasBreadcrumbArr === false) {
let breadcrumb = {id: data.agencyId, name: data.agencyName, type: orgType}
this.breadcrumbArr.push(breadcrumb)
}
}
} else {
this.$message.error(msg)
}
} else if (orgType === 'department') {
const url = '/gov/org/department/departmentdetail'
let params = {
departmentId : id,
}
const { data, code, msg } = await requestPost(url, params)
if(code === 0){
if (this.breadcrumbArr.length === 0) {
this.breadcrumbArr = [{id: data.departmentId, name: data.departmentName, type: orgType}]
} else {
4 years ago
let hasBreadcrumbArr = false
this.breadcrumbArr.forEach(function (bc) {
if (bc.id === id) {
hasBreadcrumbArr = true
}
})
if (hasBreadcrumbArr === false) {
let breadcrumb = {id: data.departmentId, name: data.departmentName, type: orgType}
this.breadcrumbArr.push(breadcrumb)
}
}
} else {
this.$message.error(msg)
}
} else if (orgType === 'grid') {
const url = '/gov/org/grid/griddetail'
let params = {
gridId : id,
}
const { data, code, msg } = await requestPost(url, params)
if(code === 0){
if (this.breadcrumbArr.length === 0) {
this.breadcrumbArr = [{id: data.grid, name: data.gridName, type: orgType}]
} else {
4 years ago
let hasBreadcrumbArr = false
this.breadcrumbArr.forEach(function (bc) {
if (bc.id === id) {
hasBreadcrumbArr = true
}
})
if (hasBreadcrumbArr === false) {
let breadcrumb = {id: data.grid, name: data.gridName, type: orgType}
this.breadcrumbArr.push(breadcrumb)
}
}
} else {
this.$message.error(msg)
}
}
},
async refreshThisPage (index) {
// 点击最后一级不触发响应
if (index === this.breadcrumbArr.length - 1) {
return
}
4 years ago
const selectOrg = this.breadcrumbArr[index]
this.breadcrumbArr = this.breadcrumbArr.slice(0, index + 1)
const orgId = selectOrg.id
const orgType = selectOrg.type
if (orgType === 'agency') {
this.agencyTableListData = []
this.agencyStaffTableListData = []
this.departmentTableListData = []
this.departmentStaffTableListData = []
this.gridTableListData = []
this.gridStaffTableListData = []
4 years ago
this.userAgencyId = orgId
this.currentAgencyId = orgId
this.agencyTableFlag = true
this.currentAgencyStaffTableFlag = true
this.departmentTableFlag = true
this.departmentStaffTableFlag = false
this.gridTableFlag = true
this.gridStaffTableFlag = false
4 years ago
this.assembleBreadcrumbArr(orgId, 'agency')
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
4 years ago
this.getAgencyStaffListData()
}
// 当点击最后一级不触发响应
// 其父级及以上,只可能属于组织,而非部门或网格,注释以下代码即可
// 若需要点击最后一级触发刷新,可释放以下代码
/* else if (orgType === 'department') {
this.agencyStaffTableListData = []
this.departmentStaffTableListData = []
this.gridStaffTableListData = []
4 years ago
this.currentDepartmentId = orgId
this.agencyTableFlag = false
this.currentAgencyStaffTableFlag = false
this.departmentTableFlag = false
this.departmentStaffTableFlag = true
this.gridTableFlag = false
this.gridStaffTableFlag = false
4 years ago
this.getDepartmentStaffListData()
this.assembleBreadcrumbArr(orgId, 'department')
4 years ago
} else if (orgType === 'grid') {
this.agencyStaffTableListData = []
this.departmentStaffTableListData =[]
this.gridStaffTableListData = []
4 years ago
this.currentGridOrgId = orgId
this.agencyTableFlag = false
this.currentAgencyStaffTableFlag = false
this.departmentTableFlag = false
this.departmentStaffTableFlag = false
this.gridTableFlag = false
this.gridStaffTableFlag = true
4 years ago
this.getGridStaffListData()
this.assembleBreadcrumbArr(orgId, 'grid')
} */
4 years ago
},
4 years ago
// 获取当前用户信息
async getUser(){
4 years ago
const url = '/gov/org/agency/agencydetail'
4 years ago
let params = {
agencyId: this.currentAgencyId
4 years ago
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.userForm.areaCode = data.areaCode
this.userForm.level = data.level
this.userForm.parentAgencyId = data.agencyId
this.getZoning()
}else{
this.$message.error(msg)
}
},
// 获取组织区划信息
async getZoning(){
const url = '/data/aggregator/org/nextlevelareacodelist'
let params = {
areaCode:this.userForm.areaCode,
level:this.userForm.level,
parentAgencyId:this.userForm.parentAgencyId
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.zonings = data
}else{
this.$message.error(msg)
}
},
handelZoing(val){
this.zonings.forEach(item => {
if (item.areaCode == val) {
this.agencyForm.level = item.level
this.agencyForm.areaName = item.areaName
this.agencyForm.areaCode = item.areaCode
}
})
4 years ago
},
handelStreeOrCommunityZoing(val){
this.zonings.forEach(item => {
if (item.areaCode == val) {
this.OrgDetailsForm.level = item.level
this.OrgDetailsForm.areaName = item.areaName
this.OrgDetailsForm.areaCode = item.areaCode
}
})
4 years ago
},
4 years ago
addAgency(row){
this.createAgencyDialogFlag = true
this.addNewAgencyRest()
4 years ago
this.getUser()
4 years ago
},
// 新增组织确定按钮
4 years ago
async submitaddNewAgency(){
const url = '/gov/org/agency/addagency-v2'
let params = {
parentAgencyId:this.userForm.parentAgencyId,
agencyName:this.agencyForm.agencyName,
level:this.agencyForm.level,
areaCodeSwitch:'closed',
areaCode:this.agencyForm.areaCode,
areaName:this.agencyForm.areaName,
contacts:this.agencyForm.contacts,
mobile:this.agencyForm.mobile,
code:this.agencyForm.code,
latitude:this.latitude,
longitude:this.longitude
}
4 years ago
4 years ago
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.$message.success("添加成功")
this.createAgencyDialogFlag = false
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
4 years ago
this.getAgencyStaffListData()
4 years ago
}else {
this.$message.error(msg)
}
4 years ago
},
4 years ago
// 修改面包屑
modifyOrgInfo(){
4 years ago
this.judgeOrgInfoLevel = this.breadcrumbArr[this.breadcrumbArr.length-1]
console.log(this.judgeOrgInfoLevel)
if(this.judgeOrgInfoLevel.type === "agency"){
this.getOrgDetailsById()
setTimeout(() => {
if(this.OrgDetailsForm.level === "district"){
/** 修改市区级弹窗 */
this.modifyCityOrgPop = true
}else {
/** 街道级和社区级弹窗 */
this.getUser()
this.streetOrCommunity = true
}
}, 1000);
} else if(this.judgeOrgInfoLevel.type === "department"){
/** 下级机关单位修改 */
this.OrgUnitPop = true
this.getOrgUnitDetailsById()
} else {
/** 网格修改 */
this.getDictionaries()
this.modifyGridPop = true
this.getGridDetailsById()
}
},
// 根据id获取组织机构详细信息
async getOrgDetailsById(){
const url = '/gov/org/agency/agencydetail'
let params = {
agencyId:this.judgeOrgInfoLevel.id
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.OrgDetailsForm.level = data.level
this.OrgDetailsForm.agencyName = data.agencyName
this.OrgDetailsForm.code = data.code
this.OrgDetailsForm.contacts = data.contacts
this.OrgDetailsForm.centerAddress = data.centerAddress
this.OrgDetailsForm.areaCode = data.areaCode
this.OrgDetailsForm.mobile = data.mobile
this.latitude = data.latitude
this.longitude = data.longitude
this.OrgDetailsForm.agencyId = data.agencyId
}else {
this.$message.error(msg)
}
},
// 根据id获取下级机关单位详情
async getOrgUnitDetailsById(){
const url = '/gov/org/department/departmentdetail'
let params = {
departmentId:this.judgeOrgInfoLevel.id
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.OrgUnitDetailsForm.code = data.code
this.OrgUnitDetailsForm.contacts = data.contacts
this.OrgUnitDetailsForm.departmentId = data.departmentId
this.OrgUnitDetailsForm.departmentName = data.departmentName
this.OrgUnitDetailsForm.mobile = data.mobile
}else {
this.$message.error(msg)
}
},
// 根据id获取网格详情
async getGridDetailsById(){
const url = '/gov/org/grid/griddetail'
let params = {
gridId: this.judgeOrgInfoLevel.id
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.modifyGridFrom.gridName = data.gridName
this.modifyGridFrom.code = data.code
this.modifyGridFrom.gridTypeName = data.gridTypeName
this.modifyGridFrom.contacts = data.contacts
this.modifyGridFrom.mobile = data.mobile
this.modifyGridFrom.agencyId = data.agencyId
this.modifyGridFrom.gridType = data.gridType
this.modifyGridFrom.manageDistrict = data.manageDistrict
this.modifyGridFrom.griId = data.grid
4 years ago
}else {
this.$message.error(msg)
}
},
// 市级/街道/社区级组织修改确定按钮
async sunmitModifyCityOrgPop(){
const url = '/gov/org/agency/editagency'
let params = {
agencyId: this.OrgDetailsForm.agencyId,
agencyName: this.OrgDetailsForm.agencyName,
contacts: this.OrgDetailsForm.contacts,
mobile: this.OrgDetailsForm.mobile,
code: this.OrgDetailsForm.code,
latitude: this.latitude,
3 years ago
longitude: this.longitude
4 years ago
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.$message.success("修改成功")
this.modifyCityOrgPop = false
this.streetOrCommunity = false
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
}else{
this.$message.error(msg)
}
},
// 修改下级机关单位确定按钮
async sunmitOrgUnitForm(){
const url = '/gov/org/department/editdepartment'
let params = {
code: this.OrgUnitDetailsForm.code,
contacts: this.OrgUnitDetailsForm.contacts,
departmentId: this.OrgUnitDetailsForm.departmentId,
departmentName: this.OrgUnitDetailsForm.departmentName,
mobile: this.OrgUnitDetailsForm.mobile
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.$message.success("修改成功")
this.OrgUnitPop = false
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
this.agencyPeo()
} else {
this.$message.error(msg)
}
},
// 修改网格确定按钮
async submitModifyGrid(){
const url = '/gov/org/grid/editgrid'
let params = {
gridId: this.modifyGridFrom.griId,
gridName: this.modifyGridFrom.gridName,
manageDistrict: this.modifyGridFrom.manageDistrict,
contacts: this.modifyGridFrom.contacts,
mobile: this.modifyGridFrom.mobile,
code: this.modifyGridFrom.code,
gridType: this.modifyGridFrom.gridType
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.$message.success("修改成功")
this.modifyGridPop = false
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
this.agencyPeo()
}else {
this.$message.error(msg)
}
4 years ago
},
/** 地图初始化 */
initMap(_that) {
var position = document.getElementById("position");
var center = new window.TMap.LatLng(39.984104, 116.307503);//设置中心点坐标
//初始化地图
var map = new window.TMap.Map("container", {
center: center
});
//绑定点击事件
map.on("click",function(evt){
_that.lat = evt.latLng.getLat().toFixed(6);
_that.lng = evt.latLng.getLng().toFixed(6);
position.innerHTML = _that.lat + "," + _that.lng;
})
4 years ago
},
createMap(_t){
document.getElementById("con").innerHTML = ''
document.getElementById("con").innerHTML = '当前点击坐标为:<span id="pos"></span>'
var position = document.getElementById("pos");
4 years ago
var center = new window.TMap.LatLng(this.latitude, this.longitude);//设置中心点坐标
4 years ago
//初始化地图
var map = new window.TMap.Map("con", {
center: center
});
//绑定点击事件
map.on("click",function(evt){
_t.latitude = evt.latLng.getLat().toFixed(6);
_t.longitude = evt.latLng.getLng().toFixed(6);
position.innerHTML = _t.latitude + "," + _t.longitude;
})
}
}
}
</script>
<style scoped>
#container {
4 years ago
width: 100%;
height: 100%;
}
#info{
left: 20px;
top: 20px;
font-size: 14px;
background: #fff;
width: 270px;
padding: 10px;
border-radius: 3px;
}
4 years ago
#con {
4 years ago
width: 100%;
height: 100%;
4 years ago
}
.el-tag + .el-tag {
margin-left: 10px;
}
</style>