老产品前端代码
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.

2399 lines
74 KiB

<template>
3 years ago
<div class="app-container">
<el-row>
3 years ago
<el-col :span="24" style="margin-left: 10px; margin-top: 10px; margin-bottom: 20px">
3 years ago
<el-breadcrumb separator-class="el-icon-arrow-right">
3 years ago
<el-breadcrumb-item v-for="(breadcrumb, index) in breadcrumbArr" :key="breadcrumb.id">
<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>
3 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"
>
3 years ago
修改
</el-link>
3 years ago
</el-breadcrumb-item>
</el-breadcrumb>
</el-col>
</el-row>
<!-- 组织列表 -->
3 years ago
<el-table v-show="agencyTableFlag" height="250" :data="agencyTableListData" style="width: 100%">
<el-table-column prop="agencyName" label="下级组织"></el-table-column>
3 years ago
<el-table-column prop="contacts" label="联系人"></el-table-column>
<el-table-column prop="mobile" label="联系人电话"></el-table-column>
3 years ago
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
3 years ago
<template slot="header">
3 years ago
<el-button size="mini" type="primary" icon="el-icon-plus" @click="addAgency()">新增</el-button>
3 years ago
</template>
<template slot-scope="scope">
3 years ago
<el-button size="mini" type="warning" icon="el-icon-arrow-right" @click="entryAgency(scope.row.agencyId)">进入</el-button>
3 years ago
</template>
</el-table-column>
</el-table>
<!-- 下级机关单位/基层科室列表 -->
3 years ago
<el-table v-show="departmentTableFlag" height="250" :data="departmentTableListData" style="width: 100%">
<el-table-column prop="departmentName" label="下级机关单位/基层科室"></el-table-column>
<el-table-column prop="departmentTypeShow" label="部门类型"></el-table-column>
3 years ago
<el-table-column prop="contacts" label="联系人"></el-table-column>
<el-table-column prop="mobile" label="联系人电话"></el-table-column>
3 years ago
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
3 years ago
<template slot="header" slot-scope="scope">
3 years ago
<!-- <el-button
3 years ago
size="mini"
type="primary"
icon="el-icon-plus"
@click="addCommunity(scope.row)"
3 years ago
>下载导入模板</el-button
3 years ago
>
<el-button
size="mini"
3 years ago
type="primary"
icon="el-icon-plus"
@click="addCommunity(scope.row)"
>导入</el-button
> -->
<!-- <el-button class="diy-button--add"
type="primary"
size="small"
@click="handleAdd">{{ $t('add') }}</el-button> -->
<div style="display: flex;">
<el-button size="small" style="margin-right:10px" type="primary" @click="handleExportModule()">下载导入模板</el-button>
<el-upload
:headers="$getElUploadHeaders()"
ref="upload"
class="upload-btn"
:multiple="false"
:show-file-list="false"
:before-upload="
file => {
beforeUpload(file);
}
"
action=""
accept=".xls,.xlsx"
:http-request="
() => {
uploadFile();
}
"
>
<el-button type="primary" style="margin-right:10px" size="small">导入</el-button>
</el-upload>
<!-- <el-button class="diy-button--reset"
size="small"
@click="handleExport">导出</el-button> -->
<el-button size="mini" type="primary" icon="el-icon-plus" @click="addCommunity(scope.row)">新增</el-button>
</div>
</template>
<template slot-scope="scope">
<el-button size="mini" type="warning" icon="el-icon-arrow-right" @click="entryDepartment(scope.row)">进入</el-button>
3 years ago
</template>
</el-table-column>
</el-table>
<!-- 网格列表 -->
3 years ago
<el-table v-if="currentAgencyLevel == 'community'" v-show="gridTableFlag" height="250" :data="gridTableListData" style="width: 100%">
3 years ago
<el-table-column prop="gridName" label="直属网格"></el-table-column>
3 years ago
<el-table-column prop="gridTypeName" label="网格类型"></el-table-column>
3 years ago
<el-table-column prop="contacts" label="联系人"></el-table-column>
<el-table-column prop="mobile" label="联系人电话"></el-table-column>
3 years ago
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
3 years ago
<template slot="header" slot-scope="scope">
3 years ago
<el-button size="mini" type="primary" icon="el-icon-plus" @click="addGrid(scope.row)">新增</el-button>
3 years ago
</template>
<template slot-scope="scope">
3 years ago
<el-button size="mini" type="warning" icon="el-icon-arrow-right" @click="entryGrid(scope.row.gridId)">进入</el-button>
3 years ago
</template>
</el-table-column>
</el-table>
<!-- 本级工作人员 -->
3 years ago
<el-table v-show="currentAgencyStaffTableFlag" :data="cleanAgencyStaffTableListData" style="width: 100%" height="350">
3 years ago
<el-table-column prop="name" label="本级工作人员名字" width="260">
<template slot-scope="scope">
<span>{{ scope.row.name }}</span>
3 years ago
<el-tag v-if="scope.row.enableFlag === 'disabled'" type="danger" style="margin-left: 10px" size="mini" disable-transitions>{{ '已禁用' }}</el-tag>
3 years ago
</template>
</el-table-column>
<el-table-column prop="roles" label="本级工作人员职责" width="260">
<template slot-scope="scope">
3 years ago
<el-tag type="primary" size="mini" v-for="(role, index) in scope.row.roles" :key="index" disable-transitions>{{ role }}</el-tag>
3 years ago
</template>
</el-table-column>
3 years ago
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
3 years ago
<template slot="header" slot-scope="scope">
<el-input
3 years ago
placeholder="请输入姓名或手机号"
3 years ago
v-model="searchStaffKeyword"
style="width: 400px; margin-right: 10px"
@input="handleSearchStaff"
class="input-with-select"
>
3 years ago
<el-button @click.stop="handleSearchStaff" slot="append" icon="el-icon-search"></el-button>
3 years ago
</el-input>
3 years ago
<el-button size="mini" type="primary" icon="el-icon-plus" @click="addPeo(scope.row)">新增</el-button>
3 years ago
</template>
<template slot-scope="scope">
3 years ago
<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 v-if="scope.row.enableFlag === 'enable'" size="mini" type="danger" icon="el-icon-circle-close" @click="DisablePeo(scope.row)">禁用/删除</el-button>
<el-button v-if="scope.row.enableFlag === 'disabled'" size="mini" type="danger" icon="el-icon-circle-close" @click="enablestaff(scope.row)">解禁</el-button>
3 years ago
</template>
</el-table-column>
</el-table>
<!-- 下级机关单位/基层科室工作人员 -->
3 years ago
<el-table height="350" v-show="departmentStaffTableFlag" :data="cleanDepartmentStaffTableListData" style="width: 100%">
<el-table-column prop="name" label="下级机关单位/基层科室工作人员" width="260"></el-table-column>
<el-table-column prop="roles" label="下级机关单位/基层科室工作人员职责" width="260">
3 years ago
<template slot-scope="scope">
3 years ago
<el-tag type="primary" size="mini" v-for="(role, index) in scope.row.roles" :key="index" disable-transitions>{{ role }}</el-tag>
3 years ago
</template>
</el-table-column>
3 years ago
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
3 years ago
<template slot="header" slot-scope="scope">
<el-input
3 years ago
placeholder="请输入姓名或手机号"
3 years ago
v-model="searchDeptStaffKeyword"
style="width: 400px; margin-right: 10px"
@input="handleSearchDeptStaff"
class="input-with-select"
>
3 years ago
<el-button @click.stop="handleSearchDeptStaff" slot="append" icon="el-icon-search"></el-button>
3 years ago
</el-input>
3 years ago
<el-button v-if="selDeptType === 'duty'" size="mini" type="primary" icon="el-icon-plus" @click="addCommunityPeo(scope.row)">新增</el-button>
3 years ago
</template>
<template slot-scope="scope">
3 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 v-if="selDeptType === 'duty'" 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>
3 years ago
</template>
</el-table-column>
</el-table>
<!-- 网格工作人员 -->
3 years ago
<el-table v-show="gridStaffTableFlag" :data="cleanGridStaffTableListData" style="width: 100%" height="350">
<el-table-column prop="name" label="网格工作人员名字" width="260"></el-table-column>
3 years ago
<el-table-column prop="roles" label="网格工作人员职责" width="260">
<template slot-scope="scope">
3 years ago
<el-tag type="primary" size="mini" v-for="(role, index) in scope.row.roles" :key="index" disable-transitions>{{ role }}</el-tag>
3 years ago
</template>
</el-table-column>
3 years ago
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
3 years ago
<template slot="header" slot-scope="scope">
<el-input
3 years ago
placeholder="请输入姓名或手机号"
3 years ago
v-model="searchGridStaffKeyword"
style="width: 400px; margin-right: 10px"
@input="handleSearchGridStaff"
class="input-with-select"
>
3 years ago
<el-button @click.stop="handleSearchGridStaff" slot="append" icon="el-icon-search"></el-button>
3 years ago
</el-input>
3 years ago
<el-button size="mini" type="primary" icon="el-icon-plus" @click="addGridPeo(scope.row)">新增</el-button>
3 years ago
</template>
<template slot-scope="scope">
3 years ago
<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>
3 years ago
</template>
</el-table-column>
</el-table>
<!-- 新增下级机关单位/基层科室 -->
3 years ago
<el-dialog title="新增部门" :visible.sync="dialogVisible" width="850" :before-close="handleClose">
3 years ago
<el-form label-width="120px" :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>
3 years ago
</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">
3 years ago
<el-dialog title="新增网格" :visible.sync="dialogVisibleGrid" width="850" :before-close="handleClose">
3 years ago
<el-form label-width="120px" :rules="rules">
3 years ago
<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>
3 years ago
<!-- 网格类型下拉框 -->
<el-form-item label="网格类型" prop="typeTag">
3 years ago
<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>
3 years ago
</el-select>
</el-form-item>
3 years ago
<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>
3 years ago
<!-- 组织位置 -->
3 years ago
<el-form-item label="坐标"><div id="con"></div></el-form-item>
3 years ago
</el-form>
<div slot="footer">
<el-button @click="cancelGrid"> </el-button>
3 years ago
<el-button type="primary" @click="submitGrid"> </el-button>
3 years ago
</div>
</el-dialog>
</div>
<!-- 新增人员 -->
<div v-if="dialogVisiblePeo">
3 years ago
<el-dialog title="新增人员" :visible.sync="dialogVisiblePeo" width="850" :before-close="handleClose">
<el-form :model="peoForm" label-width="120px" ref="addPeoForm" :rules="rulesPeo">
<el-form-item label="姓名" prop="name"><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>
3 years ago
<!-- 性别下拉框 -->
<el-form-item label="性别" prop="gender">
3 years ago
<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>
3 years ago
</el-select>
</el-form-item>
<!-- 专兼职下拉框 -->
<el-form-item label="专兼职" prop="post">
3 years ago
<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>
3 years ago
</el-select>
</el-form-item>
<!-- 职责下拉框 -->
<el-form-item label="职责" prop="duty">
3 years ago
<el-select v-model="peoForm.duty" multiple placeholder="请选择">
<el-option v-for="item in dutyList" :key="item.roleId" :label="item.roleName" :value="item.roleId" :disabled="item.disabled"></el-option>
3 years ago
</el-select>
</el-form-item>
<el-form-item label="角色" prop="newRoles">
3 years ago
<el-select v-model="peoForm.newRoles" multiple placeholder="请选择">
<el-option v-for="item in roleList" :key="item.id" :label="item.name" :value="item.id"></el-option>
3 years ago
</el-select>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="cancelPeo"> </el-button>
3 years ago
<el-button type="primary" @click="submitPeo"> </el-button>
3 years ago
</div>
</el-dialog>
</div>
<!-- 人员修改 -->
3 years ago
<el-dialog v-if="modifyPeo" title="人员修改" :visible.sync="modifyPeo" width="850" :before-close="handleClose">
<el-form :model="peoForm" label-width="120px" ref="editPeoForm" :rules="rulesPeo">
<el-form-item label="姓名" prop="name"><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>
3 years ago
<el-form-item label="性别" prop="gender">
3 years ago
<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>
3 years ago
</el-select>
</el-form-item>
<el-form-item label="专兼职" prop="post">
3 years ago
<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>
3 years ago
</el-select>
</el-form-item>
<el-form-item label="职责" prop="duty">
3 years ago
<el-select v-model="peoForm.duty" multiple placeholder="请选择">
<el-option v-for="item in dutyList" :key="item.roleId" :label="item.roleName" :value="item.roleId" :disabled="item.disabled"></el-option>
3 years ago
</el-select>
</el-form-item>
<el-form-item label="角色" prop="newRoles">
3 years ago
<el-select v-model="peoForm.newRoles" multiple placeholder="请选择">
<el-option v-for="item in roleList" :key="item.id" :label="item.name" :value="item.id"></el-option>
3 years ago
</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>
<!-- 禁用弹窗 -->
3 years ago
<el-dialog v-if="Disable" title="确认禁用" :visible.sync="Disable" width="850" :before-close="handleClose">
3 years ago
<span>禁用后该用户将无法登录系统是否继续</span>
<div slot="footer">
<el-button @click="cancelDisable"> </el-button>
3 years ago
<el-button type="primary" @click="submitDisable"> </el-button>
3 years ago
</div>
</el-dialog>
<!-- 人员查看 -->
3 years ago
<el-dialog v-if="details" title="人员详情" :visible.sync="details" width="850" :before-close="handleClosePeoView">
3 years ago
<el-form label-width="120px">
3 years ago
<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>
<el-form-item label="是否禁用"><el-input v-model="peoForm.disableFlag" placeholder="是否禁用" :disabled="true"></el-input></el-form-item>
3 years ago
</el-form>
3 years ago
<div slot="footer"><el-button type="primary" style="margin-right: 170px" @click="cancelDetails"> </el-button></div>
3 years ago
</el-dialog>
<!-- 人员调动 -->
3 years ago
<el-dialog v-if="transferPeo" title="人员调动" :visible.sync="transferPeo" width="850" :before-close="handleClose">
3 years ago
<el-form label-width="120px" :model="agencyForm">
3 years ago
<el-form-item label="姓名"><el-input v-model="transferForm.name" placeholder="姓名"></el-input></el-form-item>
3 years ago
<el-form-item label="调动至">
<el-cascader
clearable
:props="{ checkStrictly: true, multiple: false }"
v-model="selectValue"
:options="options"
style="width: 100%"
@change="handleChangeTransferCascader"
>
<template slot-scope="{ data }">
<span>{{ data.label }}</span>
3 years ago
<span v-if="data.type != 'agency'" style="color: #aaa; font-size: 12px">{{ data.typeName }}</span>
3 years ago
</template>
</el-cascader>
</el-form-item>
<el-form-item label="调动原因">
3 years ago
<el-input type="textarea" :rows="2" placeholder="请输入内容" maxlength="500" show-word-limit v-model="transferForm.remarks"></el-input>
3 years ago
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="cancelTransfer"> </el-button>
3 years ago
<el-button type="primary" @click="submitTransfer"> </el-button>
3 years ago
</div>
</el-dialog>
<!-- 新增组织 -->
3 years ago
<el-dialog v-if="createAgencyDialogFlag" title="新增组织" :visible.sync="createAgencyDialogFlag" width="850" :before-close="handleClose">
3 years ago
<el-form label-width="120px">
3 years ago
<el-form-item label="组织名称"><el-input v-model="agencyForm.agencyName" placeholder="请输入组织名称"></el-input></el-form-item>
3 years ago
<!-- 组织区划 -->
<el-form-item label="组织区划">
3 years ago
<el-select v-model="agencyForm.areaCode" placeholder="请选择组织区划" @change="handelZoing">
<el-option v-for="item in zonings" :key="item.areaCode" :label="item.areaName" :value="item.areaCode"></el-option>
3 years ago
</el-select>
</el-form-item>
3 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>
3 years ago
<el-form-item label="组织简介">
3 years ago
<el-input v-model="agencyForm.remark" type="textarea" rows="3" maxlength="500" show-word-limit placeholder="请输入组织简介"></el-input>
3 years ago
</el-form-item>
3 years ago
<el-form-item label="坐标"><div id="con"></div></el-form-item>
3 years ago
</el-form>
<div slot="footer">
<el-button @click="canceladdNewAgency"> </el-button>
3 years ago
<el-button type="primary" @click="submitaddNewAgency"> </el-button>
3 years ago
</div>
</el-dialog>
<!-- 修改市区级组织 -->
3 years ago
<el-dialog v-if="modifyCityOrgPop" title="修改组织" :visible.sync="modifyCityOrgPop" width="850" :before-close="handleClose">
3 years ago
<el-form label-width="120px">
3 years ago
<el-form-item label="组织名称"><el-input v-model="OrgDetailsForm.agencyName" placeholder="请输入组织名称"></el-input></el-form-item>
3 years ago
3 years ago
<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>
3 years ago
<el-form-item label="组织简介">
3 years ago
<el-input type="textarea" v-model="OrgDetailsForm.remark" placeholder="请输入内容" resize="none" rows="3" maxlength="500" show-word-limit></el-input>
3 years ago
</el-form-item>
3 years ago
<el-form-item label="坐标"><div id="con"></div></el-form-item>
3 years ago
</el-form>
<div slot="footer">
<el-button @click="cancelModifyCityOrgPop"> </el-button>
3 years ago
<el-button type="primary" @click="sunmitModifyCityOrgPop"> </el-button>
3 years ago
</div>
</el-dialog>
<!-- 修改街道/社区级组织 -->
3 years ago
<el-dialog v-if="streetOrCommunity" title="修改组织" :visible.sync="streetOrCommunity" width="850" :before-close="handleClose">
3 years ago
<el-form label-width="120px">
3 years ago
<el-form-item label="组织名称"><el-input v-model="OrgDetailsForm.agencyName" placeholder="请输入组织名称"></el-input></el-form-item>
3 years ago
<!-- 组织区划 -->
<el-form-item label="组织区划">
3 years ago
<el-select v-model="OrgDetailsForm.areaCode" placeholder="请选择组织区划" @change="handelStreeOrCommunityZoing">
<el-option v-for="item in zonings" :key="item.areaCode" :label="item.areaName" :value="item.areaCode"></el-option>
3 years ago
</el-select>
</el-form-item>
3 years ago
<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>
3 years ago
<el-form-item label="组织简介">
3 years ago
<el-input type="textarea" v-model="OrgDetailsForm.remark" placeholder="请输入内容" show-word-limit maxlength="500" resize="none" rows="3"></el-input>
3 years ago
</el-form-item>
3 years ago
<el-form-item label="联系电话"><el-input v-model="OrgDetailsForm.mobile" placeholder="请输入联系电话"></el-input></el-form-item>
<el-form-item label="坐标"><div id="con"></div></el-form-item>
3 years ago
</el-form>
<div slot="footer">
<el-button @click="cancelstreetOrCommunity"> </el-button>
3 years ago
<el-button type="primary" @click="sunmitModifyCityOrgPop"> </el-button>
3 years ago
</div>
</el-dialog>
<!-- 修改下级机关单位 -->
3 years ago
<el-dialog v-if="OrgUnitPop" title="修改部门" :visible.sync="OrgUnitPop" width="850" :before-close="handleClose">
3 years ago
<el-form label-width="120px">
3 years ago
<el-form-item label="部门名称"><el-input v-model="OrgUnitDetailsForm.departmentName" placeholder="请输入组织名称"></el-input></el-form-item>
3 years ago
3 years ago
<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="联系电话1"><el-input v-model="OrgUnitDetailsForm.mobile" placeholder="请输入联系电话"></el-input></el-form-item>
3 years ago
</el-form>
<div slot="footer">
<el-button @click="cancelOrgUnitPop"> </el-button>
3 years ago
<el-button type="primary" @click="sunmitOrgUnitForm"> </el-button>
3 years ago
</div>
</el-dialog>
<!-- 修改网格 -->
3 years ago
<el-dialog v-if="modifyGridPop" title="修改网格" :visible.sync="modifyGridPop" width="850" :before-close="handleClose">
3 years ago
<el-form label-width="120px">
3 years ago
<el-form-item label="网格名称"><el-input v-model="modifyGridFrom.gridName" placeholder="请输入组织名称"></el-input></el-form-item>
3 years ago
3 years ago
<el-form-item label="组织编码"><el-input v-model="modifyGridFrom.code" placeholder="请输入组织编码"></el-input></el-form-item>
3 years ago
<!-- 网格类型下拉框 -->
<el-form-item label="网格类型" prop="typeTag">
3 years ago
<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>
3 years ago
</el-select>
</el-form-item>
<!-- 排序 -->
3 years ago
<el-form-item label="排序"><el-input-number v-model="modifyGridFrom.gridSort" :min="1" label="排序"></el-input-number></el-form-item>
3 years ago
3 years ago
<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>
3 years ago
<!-- 组织位置,地图 -->
3 years ago
<el-form-item label="坐标"><div id="con"></div></el-form-item>
3 years ago
</el-form>
<div slot="footer">
<el-button @click="cancelModifyGridPop"> </el-button>
3 years ago
<el-button type="primary" @click="submitModifyGrid"> </el-button>
3 years ago
</div>
</el-dialog>
</div>
</template>
<script>
3 years ago
import { requestPost, requestGet } from '@/js/dai/request';
import daiMap from '@/utils/dai-map';
export default {
3 years ago
data() {
return {
// 新增组织弹窗
createAgencyDialogFlag: false,
// 修改市区级组织弹窗
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: [],
// 用户所属组织ID
3 years ago
userAgencyId: localStorage.getItem('agencyId'),
3 years ago
// 修改时操作的用户staffId
3 years ago
userStaffId: '',
3 years ago
// 当前被操作的组织的ID
3 years ago
currentAgencyId: localStorage.getItem('agencyId'),
3 years ago
// 当前被操作的部门的ID
3 years ago
currentDepartmentId: '14f572e724eecf7668b655505d789cab',
3 years ago
// 当前被操作的网格的ID
3 years ago
currentGridOrgId: '63d5ff92ea981b1c58e4914ac894c610',
3 years ago
// 当前被操作的组织的级别
3 years ago
currentAgencyLevel: localStorage.getItem('level'),
currentAreaCode: '',
currentAreaCodeSwitch: '',
parentAreaCode: '',
parentAgencyId: localStorage.getItem('agencyId'),
parentAgencyLevel: localStorage.getItem('level'),
3 years ago
// 经纬度坐标
3 years ago
lat: '',
lng: '',
latitude: '',
longitude: '',
Navigation: '',
3 years ago
// 查询参数
queryParams: {
deptName: undefined,
3 years ago
status: undefined
3 years ago
},
// 状态列表
dictList: [],
// 重新渲染表格状态
refreshTable: true,
// 是否展开,默认全部展开
isExpandAll: true,
// 显示搜索条件
showSearch: true,
// 遮罩层
loading: true,
// 表格树数据
deptList: [],
// 弹窗开关
dialogVisible: false,
dialogVisibleGrid: false,
dialogVisiblePeo: false,
Disable: false,
details: false,
transferPeo: false,
// 社区添加表单项
insertForm: {
3 years ago
departmentName: '',
code: '',
contacts: '',
mobile: '',
agencyId: '',
departmentDuty: '123'
3 years ago
},
// 网格添加表单项
GridForm: {
3 years ago
gridName: '',
code: '',
contacts: '',
mobile: '',
agencyId: '',
manageDistrict: '',
gridType: '',
location: '', //坐标位置
longitude: '', //经度
latitude: '', //纬度
centerAddress: ''
3 years ago
},
// 新增组织
agencyForm: {
3 years ago
parentAgencyId: '',
agencyName: '',
level: '',
areaCodeSwitch: '',
areaCode: '',
areaName: '',
contacts: '',
mobile: '',
remark: '',
code: ''
3 years ago
},
// 树
tree: [],
// 新增人员表单项
peoForm: {
3 years ago
name: '',
mobile: '',
gender: '',
post: '',
3 years ago
duty: [],
3 years ago
orgType: '',
activeTime: '',
zuzhi: '',
disableFlag: '',
newRoles: []
3 years ago
},
// 人员调动
transferForm: {
3 years ago
name: '',
remarks: '',
transferTo: '',
staffId: '',
orgId: '',
orgType: ''
3 years ago
},
// 人员禁用
DisableForm: {
3 years ago
staffId: '',
agencyId: '',
customerId: ''
3 years ago
},
// 组织详细信息
OrgDetailsForm: {
3 years ago
level: '',
agencyName: '',
code: '',
contacts: '',
mobile: '',
centerAddress: '',
areaCode: '',
agencyId: '',
areaName: '',
remark: ''
3 years ago
},
// 下级机关单位
OrgUnitDetailsForm: {
3 years ago
code: '',
contacts: '',
departmentId: '',
departmentName: '',
mobile: ''
3 years ago
},
// 网格修改表单
modifyGridFrom: {
3 years ago
gridName: '',
code: '',
gridTypeName: '',
contacts: '',
mobile: '',
latitude: '',
longitude: '',
agencyId: '',
gridType: '',
manageDistrict: '',
griId: '',
3 years ago
// 排序
3 years ago
gridSort: 0
3 years ago
},
judgeOrgInfoLevel: [],
3 years ago
keyWords: '',
3 years ago
typeList: [],
// 性别字典
3 years ago
genderList: [{ value: 1, label: '男' }, { value: 2, label: '女' }, { value: 0, label: '未知' }],
3 years ago
// 专兼职字典
3 years ago
postList: [{ value: 'fulltime', label: '专职' }, { value: 'parttime', label: '兼职' }],
3 years ago
// 职责字典
dutyList: [],
// 修改操作是否展示
modifyPeo: false,
roleList: [],
// 级联数据
options: [],
selectValue: [],
// 顶部 面包屑
breadcrumbArr: [],
// 面包屑 当前所属机构ID
3 years ago
currentBreadcrumbKey: '',
3 years ago
// 组织区划数据
zonings: [],
// 校验
rules: {
departmentName: [
{
required: true,
3 years ago
message: '社区名称必填',
trigger: 'blur'
}
3 years ago
],
gridName: [
{
required: true,
3 years ago
message: '网格名称必填',
trigger: 'blur'
}
3 years ago
],
addDepartmentName: [
{
required: true,
3 years ago
message: '部门名称必填',
trigger: 'blur'
}
]
3 years ago
},
rulesPeo: {
3 years ago
name: [{ required: true, message: '姓名必填', trigger: 'blur' }],
mobile: [{ required: true, message: '手机号必填', trigger: 'blur' }],
gender: [{ required: true, message: '性别必填', trigger: 'blur' }],
post: [{ required: true, message: '专兼职必填', trigger: 'blur' }],
duty: [{ required: true, message: '职责必填', trigger: 'blur' }],
newRoles: [{ required: true, message: '角色必填', trigger: 'blur' }]
3 years ago
},
3 years ago
selDeptType: '',
3 years ago
3 years ago
searchStaffKeyword: '',
searchGridStaffKeyword: '',
searchDeptStaffKeyword: ''
3 years ago
};
},
watch: {
dialogVisibleGrid(val) {
if (val) {
setTimeout(() => {
this.createMap();
}, 1000);
}
},
createAgencyDialogFlag(val) {
if (val) {
setTimeout(() => {
this.createMap();
}, 1000);
}
},
modifyCityOrgPop(val) {
if (val) {
setTimeout(() => {
this.createMap();
}, 1000);
}
},
streetOrCommunity(val) {
if (val) {
setTimeout(() => {
this.createMap();
}, 1000);
}
},
modifyGridPop(val) {
if (val) {
setTimeout(() => {
3 years ago
this.createMap('modifyGridFrom');
3 years ago
}, 1000);
}
3 years ago
}
3 years ago
},
computed: {
cleanAgencyStaffTableListData() {
3 years ago
return this.agencyStaffTableListData.filter(item => !item.hidden);
3 years ago
},
cleanGridStaffTableListData() {
3 years ago
return this.gridStaffTableListData.filter(item => !item.hidden);
3 years ago
},
cleanDepartmentStaffTableListData() {
3 years ago
return this.departmentStaffTableListData.filter(item => !item.hidden);
}
3 years ago
},
mounted() {
this.getAgencyList();
this.getDepartmentList();
this.getGridList();
this.getAgencyStaffListData();
this.getDutyList();
this.getRoleList();
// this.getNavigation()
// 更新顶部面包屑
3 years ago
this.assembleBreadcrumbArr(localStorage.getItem('agencyId'), 'agency');
3 years ago
// this.initMap()
},
methods: {
3 years ago
// async handleExport () {
// let title = "部门导出";
// const url = "/epmetuser/icVaccinePrarmeter/vaccine-export";
// app.ajax.exportFilePost(
// url,
// this.dataForm,
// (data, rspMsg) => {
// console.log(data)
// this.download(data, title + ".xlsx");
// },
// (rspMsg, data) => {
// this.$message.error(rspMsg);
// }
// );
// },
beforeUpload(file) {
this.files = file;
const isText = file.type === 'application/vnd.ms-excel';
const isTextComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
if (!isText && !isTextComputer) {
this.$message.error('请选择正确格式的文件');
this.files = null;
this.fileName = '';
return false;
} else {
this.fileName = file.name;
return true;
}
},
async uploadFile() {
if (this.fileName == '') {
this.$message.warning('请选择要上传的文件!');
return false;
}
this.$message({
showClose: true,
message: '导入中,请到系统管理-导入记录中查看进度',
duration: 0
});
//清空上传列表
this.$refs['upload'].clearFiles();
let url = '';
let fileFormData = new FormData();
fileFormData.append('file', this.files); //filename是键,file是值,就是要传的文件,test.zip是要传的文件名
fileFormData.append('agencyId',this.currentAgencyId);
url = '/gov/org/department/yantai/import';
window.app.ajax.post2(
url,
fileFormData,
(data, rspMsg) => {
if (data.code === 0 && data.msg == 'success') {
// this.getDepartmentList();
// this.$message.success('导入成功')
} else {
// this.$message({
// showClose: true,
// message: rspMsg,
// duration: 0,
// type: "error"
// })
// this.$message.error(rspMsg)
}
// this.loadTable();
},
(rspMsg, data) => {},
{ headers: { 'Content-Type': 'multipart/form-data' } }
);
this.getDepartmentList();
},
download(data, fileName) {
if (!data) {
return;
}
var csvData = new Blob([data]);
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(csvData, fileName);
} else {
var a = document.createElement('a');
document.body.appendChild(a);
a.style = 'display: none';
var url = window.URL.createObjectURL(csvData);
a.href = url;
a.download = fileName;
a.click();
a.remove();
window.URL.revokeObjectURL(url);
}
},
handleExportModule() {
let title = '部门导入模板';
let url = '/gov/org/department/yantai/download-tem';
let params = {};
app.ajax.exportFilePost(
url,
params,
(data, rspMsg) => {
this.download(data, title + '.xls');
},
(rspMsg, data) => {
this.$message.error(rspMsg);
3 years ago
}
);
},
3 years ago
handleSearchStaff() {
const { searchStaffKeyword, agencyStaffTableListData } = this;
this.agencyStaffTableListData = agencyStaffTableListData.map(item => {
return {
...item,
hidden: !(item.name.indexOf(searchStaffKeyword) != -1 || item.mobile.indexOf(searchStaffKeyword) != -1)
};
});
},
3 years ago
handleSearchGridStaff() {
const { searchGridStaffKeyword, gridStaffTableListData } = this;
3 years ago
this.gridStaffTableListData = gridStaffTableListData.map(item => {
3 years ago
return {
...item,
3 years ago
hidden: !(item.name.indexOf(searchGridStaffKeyword) != -1 || item.mobile.indexOf(searchGridStaffKeyword) != -1)
3 years ago
};
});
},
handleSearchDeptStaff() {
3 years ago
const { searchDeptStaffKeyword, departmentStaffTableListData } = this;
this.departmentStaffTableListData = departmentStaffTableListData.map(item => {
return {
...item,
hidden: !(item.name.indexOf(searchDeptStaffKeyword) != -1 || item.mobile.indexOf(searchDeptStaffKeyword) != -1)
};
});
3 years ago
},
// 点击后获取id
handleChangeTransferCascader(e) {
3 years ago
console.log('*********************');
3 years ago
function findItem(valueArr, coll) {
3 years ago
console.log('--------------------');
3 years ago
console.log(valueArr);
let copyArr = [...valueArr];
let firstValue = copyArr.shift();
3 years ago
let item = coll.find(a => a.value == firstValue);
3 years ago
console.log(item);
if (copyArr.length > 0) {
return findItem(copyArr, item.children);
} else {
return item;
}
}
let item = findItem(e, this.options);
this.transferForm.orgId = item.value;
this.transferForm.orgType = item.type;
},
/** 查询系统工作人员角色(职责) */
async getDutyList() {
3 years ago
const url = '/gov/org/staff/rolelist';
3 years ago
let params = {
3 years ago
agencyId: this.currentAgencyId
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.dutyList = data;
} else {
this.$message.error(msg);
}
},
/** 查询系统工作人员角色(职责) */
async getRoleList() {
this.tableLoading = true;
3 years ago
const url = '/gov/access/govrole/list';
3 years ago
let params = {};
const { data, code, msg } = await requestGet(url, params);
if (code === 0) {
this.roleList = data;
} else {
this.$message.error(msg);
}
this.tableLoading = false;
},
/** 查询组织列表 */
async getAgencyList() {
3 years ago
const url = '/gov/org/agency/agencylist';
3 years ago
let params = {
3 years ago
agencyId: this.currentAgencyId
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.agencyTableListData = data;
} else {
this.$message.error(msg);
}
},
/** 查询社区列表 */
async getDepartmentList() {
3 years ago
const url = '/gov/org/department/departmentlist';
3 years ago
let params = {
3 years ago
agencyId: this.currentAgencyId
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.departmentTableListData = data;
3 years ago
this.departmentTableListData.forEach(element => {
if (element.deptType === 'duty') {
element.departmentTypeShow = '职能部门';
} else if (element.deptType === 'party_unit') {
element.departmentTypeShow = '联建单位';
} else if (element.deptType === 'community_org') {
element.departmentTypeShow = '社会自组织';
3 years ago
} else {
3 years ago
element.departmentTypeShow = '';
3 years ago
}
});
} else {
this.$message.error(msg);
}
},
/** 查询网格列表 */
async getGridList() {
3 years ago
const url = '/gov/org/grid/allgrids';
3 years ago
let params = {
3 years ago
agencyId: this.currentAgencyId
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.gridTableListData = data;
} else {
this.$message.error(msg);
}
},
// 查询网格人员列表
async getGridStaffListData() {
3 years ago
const url = '/data/aggregator/org/stafflist';
3 years ago
let params = {
orgId: this.currentGridOrgId,
3 years ago
orgType: 'grid',
3 years ago
pageNo: 1,
3 years ago
pageSize: 10000
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.gridStaffTableListData = data.staffList || [];
3 years ago
} else {
this.$message.error(msg);
}
},
// 查询组织工作人员
async getAgencyStaffListData() {
3 years ago
const url = '/data/aggregator/org/stafflist';
3 years ago
let params = {
orgId: this.currentAgencyId,
3 years ago
orgType: 'agency',
3 years ago
pageNo: 1,
3 years ago
pageSize: 10000
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.agencyStaffTableListData = data.staffList || [];
3 years ago
} else {
this.$message.error(msg);
}
},
// 查询部门人员
async getDepartmentStaffListData() {
3 years ago
const url = '/data/aggregator/org/stafflist';
3 years ago
let params = {
orgId: this.currentDepartmentId,
3 years ago
orgType: 'dept',
3 years ago
pageNo: 1,
3 years ago
pageSize: 10000
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.departmentStaffTableListData = data.staffList || [];
3 years ago
} else {
this.$message.error(msg);
}
},
// 添加组织
async submit() {
3 years ago
const url = '/gov/org/department/adddepartment';
3 years ago
let params = {
agencyId: this.insertForm.agencyId,
departmentName: this.insertForm.departmentName,
departmentDuty: this.insertForm.departmentDuty,
contacts: this.insertForm.contacts,
mobile: this.insertForm.mobile,
3 years ago
code: this.insertForm.code
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
3 years ago
this.$message.success('添加成功');
3 years ago
this.dialogVisible = false;
this.insertForm = [];
this.getAgencyList();
this.getDepartmentList();
this.getGridList();
this.getAgencyStaffListData();
} else {
this.$message.error(msg);
}
},
// 添加网格
async submitGrid() {
3 years ago
const url = '/gov/org/grid/addgrid';
3 years ago
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,
3 years ago
longitude: this.lng
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
3 years ago
this.$message.success('添加成功');
3 years ago
this.dialogVisibleGrid = false;
this.GridForm = [];
this.getAgencyList();
this.getDepartmentList();
this.getGridList();
this.getAgencyStaffListData();
} else {
this.$message.error(msg);
}
},
async submitPeo() {
3 years ago
this.$refs['addPeoForm'].validate((valid, err) => {
3 years ago
if (valid) {
this.submitPeoDo();
} else {
app.util.validateRule(err);
3 years ago
return console.log('error submit!!', valid, err);
3 years ago
}
});
},
// 添加人员
async submitPeoDo() {
3 years ago
const url = '/gov/org/staff/addstaffv2';
3 years ago
const {
3 years ago
peoForm: { orgType }
3 years ago
} = this;
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,
newRoles: this.peoForm.newRoles,
3 years ago
orgId: orgType == 'agency' ? this.currentAgencyId : orgType == 'dept' ? this.currentDepartmentId : this.currentGridOrgId
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
3 years ago
this.$message.success('添加成功');
3 years ago
this.dialogVisiblePeo = false;
this.peoForm = [];
this.getAgencyList();
this.getDepartmentList();
this.getGridList();
this.getAgencyStaffListData();
this.insertFormRest();
3 years ago
if (orgType == 'dept') {
3 years ago
this.getDepartmentStaffListData();
3 years ago
} else if (orgType == 'grid') {
3 years ago
this.getGridStaffListData();
} else {
this.getAgencyStaffListData();
}
} else {
this.$message.error(msg);
}
},
async updatePeo() {
3 years ago
this.$refs['editPeoForm'].validate((valid, err) => {
3 years ago
if (valid) {
this.updatePeoDo();
} else {
app.util.validateRule(err);
3 years ago
return console.log('error updatePeo!!', valid, err);
3 years ago
}
});
},
// 人员修改
async updatePeoDo() {
3 years ago
const url = '/gov/org/staff/editstaff';
3 years ago
let params = {
staffId: this.userStaffId,
name: this.peoForm.name,
mobile: this.peoForm.mobile,
// gender: this.peoForm.gender === '男' ? 1 : 0,
gender: this.peoForm.gender,
workType: this.peoForm.post,
roles: this.peoForm.duty,
newRoles: this.peoForm.newRoles,
3 years ago
agencyId: this.currentAgencyId
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
3 years ago
this.$message.success('修改成功');
3 years ago
this.modifyPeo = false;
this.getAgencyList();
this.getDepartmentList();
this.getGridList();
this.getAgencyStaffListData();
this.getDepartmentStaffListData();
this.getGridStaffListData();
this.insertFormRest();
} else {
this.$message.error(msg);
}
},
// 字典
async getDictionaries() {
3 years ago
const url = '/sys/dict/data/dictlist';
3 years ago
let params = {
3 years ago
dictType: 'grid_type'
3 years ago
};
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) {
3 years ago
this.$confirm('确认关闭?')
.then(_ => {
3 years ago
this.insertFormRest();
done();
})
3 years ago
.catch(_ => {});
3 years ago
},
// 人员查看叉号关闭
handleClosePeoView(done) {
this.insertFormRest();
done();
},
// 社区新增弹框重置函数
insertFormRest() {
3 years ago
this.insertForm.name = '';
this.insertForm.contacts = '';
this.insertForm.code = '';
this.insertForm.mobile = '';
this.insertForm.departmentName = '';
3 years ago
this.peoForm = {
3 years ago
name: '',
mobile: '',
gender: '',
post: '',
3 years ago
duty: [],
3 years ago
orgType: '',
activeTime: '',
zuzhi: '',
disableFlag: '',
newRoles: []
3 years ago
};
},
// 网格新增弹框重置函数
GridFormRest() {
3 years ago
(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 = '');
3 years ago
},
/** 人员清空 */
peoFormRest() {
3 years ago
(this.peoForm.name = ''), (this.peoForm.mobile = ''), (this.peoForm.gender = ''), (this.peoForm.post = ''), (this.peoForm.duty = '');
3 years ago
this.peoForm.newRoles = [];
},
// 人员调动
transferRest() {
3 years ago
(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] = [];
},
// 新增组织
addNewAgencyRest() {
3 years ago
(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.agencyForm.remark = ''),
(this.latitude = ''),
(this.longitude = '');
3 years ago
},
// 修改市级组织
cancelModifyCityOrgPopRest() {
3 years ago
(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 = '');
3 years ago
},
// 修改下级机关单位
OrgUnitDetailsRest() {
3 years ago
(this.OrgUnitDetailsForm.code = ''),
(this.OrgUnitDetailsForm.contacts = ''),
(this.OrgUnitDetailsForm.departmentId = ''),
(this.OrgUnitDetailsForm.departmentName = ''),
(this.OrgUnitDetailsForm.mobile = '');
3 years ago
},
// 修改网格清空
ModifyGridPopRest() {
3 years ago
(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 = '');
3 years ago
},
// 社区新增弹框取消按钮
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;
},
// 新增组织取消按钮
canceladdNewAgency() {
this.addNewAgencyRest();
this.createAgencyDialogFlag = false;
},
// 修改市级组织取消按钮
cancelModifyCityOrgPop() {
this.cancelModifyCityOrgPopRest();
this.modifyCityOrgPop = false;
},
// 修改街道/社区级取消按钮
cancelstreetOrCommunity() {
this.cancelModifyCityOrgPopRest();
this.streetOrCommunity = false;
},
// 取消修改下级机关单位按钮
cancelOrgUnitPop() {
this.OrgUnitPop = false;
this.OrgUnitDetailsRest();
},
// 取消修改网格按钮
cancelModifyGridPop() {
this.modifyGridPop = false;
this.ModifyGridPopRest();
},
// 进入网格,查询网格所属人员
entryGrid(gridId) {
console.log(gridId);
this.gridStaffTableListData = [];
this.departmentStaffTableListData = [];
this.agencyStaffTableListData = [];
this.currentGridOrgId = gridId;
this.gridStaffTableFlag = true;
this.departmentStaffTableFlag = false;
this.currentAgencyStaffTableFlag = false;
this.agencyTableFlag = false;
this.departmentTableFlag = false;
this.gridTableFlag = false;
this.getGridStaffListData();
3 years ago
this.assembleBreadcrumbArr(gridId, 'grid');
3 years ago
},
// 进入部门,查询部门所属人员
entryDepartment(row) {
console.log(row);
this.gridStaffTableListData = [];
this.departmentStaffTableListData = [];
this.agencyStaffTableListData = [];
this.currentDepartmentId = row.departmentId;
this.departmentStaffTableFlag = true;
this.currentAgencyStaffTableFlag = false;
this.gridStaffTableFlag = false;
this.gridTableFlag = false;
this.agencyTableFlag = false;
this.departmentTableFlag = false;
this.selDeptType = row.deptType;
this.getDepartmentStaffListData();
3 years ago
this.assembleBreadcrumbArr(row.departmentId, 'department');
3 years ago
},
// 进入组织,重新渲染
entryAgency(agencyId) {
this.currentAgencyId = agencyId;
this.agencyTableListData = [];
this.departmentTableListData = [];
this.gridTableListData = [];
this.gridStaffTableListData = [];
this.agencyStaffTableListData = [];
this.departmentStaffTableListData = [];
this.getDepartmentList();
this.getGridList();
this.getAgencyStaffListData();
this.getAgencyList();
3 years ago
this.assembleBreadcrumbArr(agencyId, 'agency');
3 years ago
},
// 新增组织
addCommunity(row) {
this.insertForm.agencyId = this.currentAgencyId;
this.dialogVisible = true;
},
// 新增网格
addGrid(row) {
this.GridForm.agencyId = this.currentAgencyId;
this.getDictionaries();
this.dialogVisibleGrid = true;
},
// 新增人员
addPeo(row) {
this.dialogVisiblePeo = true;
3 years ago
this.peoForm.orgType = 'agency';
3 years ago
},
// 新增社区人员
addCommunityPeo() {
this.dialogVisiblePeo = true;
3 years ago
this.peoForm.orgType = 'dept';
3 years ago
},
// 新增网格人员
addGridPeo() {
this.dialogVisiblePeo = true;
3 years ago
this.peoForm.orgType = 'grid';
3 years ago
},
// 修改网格人员
async xiuGridPeo(row) {
this.modifyPeo = true;
3 years ago
this.peoForm.orgType = 'grid';
3 years ago
this.userStaffId = row.staffId;
3 years ago
const url = '/gov/org/staff/editstaffinit';
3 years ago
let params = {
staffId: row.staffId,
3 years ago
agencyId: this.currentAgencyId
3 years ago
};
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.gender = data.gender;
this.peoForm.post = data.workType;
// 已有的权限(职责)
let existedDutyArr = [];
3 years ago
data.roleList.forEach(function(sysDuty) {
3 years ago
if (sysDuty.selected === true) {
existedDutyArr.push(sysDuty.roleId);
}
});
this.peoForm.duty = existedDutyArr;
// 已有的权限(角色)
let existedRoleArr = [];
3 years ago
data.newRoleList.forEach(function(sysRole) {
3 years ago
if (sysRole.selected === true) {
existedRoleArr.push(sysRole.roleId);
}
});
this.peoForm.newRoles = existedRoleArr;
} else {
this.$message.error(msg);
}
},
// 修改人员
async xiuPeo(row) {
this.modifyPeo = true;
3 years ago
this.peoForm.orgType = 'agency';
3 years ago
this.userStaffId = row.staffId;
3 years ago
const url = '/gov/org/staff/editstaffinit';
3 years ago
let params = {
staffId: row.staffId,
3 years ago
agencyId: this.currentAgencyId
3 years ago
};
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 ? '男' : '女'
this.peoForm.gender = data.gender;
// 已有的权限(职责)
let existedDutyArr = [];
3 years ago
data.roleList.forEach(function(sysDuty) {
3 years ago
if (sysDuty.selected === true) {
existedDutyArr.push(sysDuty.roleId);
}
});
this.peoForm.duty = existedDutyArr;
// 已有的权限(角色)
let existedRoleArr = [];
3 years ago
data.newRoleList.forEach(function(sysRole) {
3 years ago
if (sysRole.selected === true) {
existedRoleArr.push(sysRole.roleId);
}
});
this.peoForm.newRoles = existedRoleArr;
} else {
this.$message.error(msg);
}
},
// 修改社区人员
async xiuCommunityPeo(row) {
this.modifyPeo = true;
3 years ago
this.peoForm.orgType = 'dept';
3 years ago
this.userStaffId = row.staffId;
3 years ago
const url = '/gov/org/staff/editstaffinit';
3 years ago
let params = {
staffId: row.staffId,
3 years ago
agencyId: this.currentAgencyId
3 years ago
};
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.gender = data.gender;
this.peoForm.post = data.workType;
// 已有的权限(职责)
let existedDutyArr = [];
3 years ago
data.roleList.forEach(function(sysDuty) {
3 years ago
if (sysDuty.selected === true) {
existedDutyArr.push(sysDuty.roleId);
}
});
this.peoForm.duty = existedDutyArr;
// 已有的权限(角色)
let existedRoleArr = [];
3 years ago
data.newRoleList.forEach(function(sysRole) {
3 years ago
if (sysRole.selected === true) {
existedRoleArr.push(sysRole.roleId);
}
});
this.peoForm.newRoles = existedRoleArr;
} else {
this.$message.error(msg);
}
},
// 取消禁用按钮
cancelDisable() {
this.Disable = false;
},
// 人员禁用
DisablePeo(row) {
this.DisableForm.staffId = row.staffId;
this.Disable = true;
},
enablestaff(row) {
3 years ago
this.$confirm('确认解禁该员工?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
3 years ago
})
.then(() => {
this.submitEnable(row);
})
3 years ago
.catch(err => {
if (err == 'cancel') {
3 years ago
// this.$message({
// type: "info",
// message: "已取消删除"
// });
}
});
},
// 确定解禁
async submitEnable(row) {
3 years ago
const url = '/epmetuser/customerstaff/enablestaff';
3 years ago
let params = {
3 years ago
staffId: row.staffId
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
3 years ago
this.$message.success('解禁成功');
3 years ago
this.Disable = false;
this.getAgencyList();
this.getDepartmentList();
this.getGridList();
this.getAgencyStaffListData();
} else {
this.$message.error(msg);
}
},
// 确定禁用
async submitDisable() {
3 years ago
const url = '/epmetuser/customerstaff/disabledstaff';
3 years ago
let params = {
staffId: this.DisableForm.staffId,
agencyId: this.DisableForm.agencyId,
3 years ago
customerId: this.DisableForm.customerId
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
3 years ago
this.$message.success('禁用成功');
3 years ago
this.Disable = false;
this.getAgencyList();
this.getDepartmentList();
this.getGridList();
this.getAgencyStaffListData();
} else {
this.$message.error(msg);
}
},
// 查看按钮
async lookAngency(row) {
3 years ago
const url = '/data/aggregator/org/staffdetailv2';
3 years ago
let params = {
3 years ago
staffId: row.staffId
3 years ago
};
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);
3 years ago
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 = '已启用';
3 years ago
} else {
3 years ago
this.peoForm.disableFlag = '已禁用';
3 years ago
}
}
this.details = true;
},
// 人员调动
async transfer(row) {
this.transferForm.name = row.name;
this.transferForm.staffId = row.staffId;
this.transferPeo = true;
3 years ago
const url = '/gov/org/customeragency/orgtree';
3 years ago
let params = {};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
function computeOption(opt) {
return {
label: opt.agencyName,
value: opt.agencyId,
3 years ago
type: 'agency',
3 years ago
children: [
3 years ago
...(opt.departmentList || []).map(item => ({
3 years ago
label: item.deptName,
value: item.deptId,
3 years ago
type: 'dept',
typeName: '部门'
3 years ago
})),
3 years ago
...(opt.gridList || []).map(item => ({
3 years ago
label: item.gridName,
value: item.gridId,
3 years ago
type: 'grid',
typeName: '网格'
3 years ago
})),
3 years ago
...(opt.subAgencyList || []).map(item => computeOption(item))
]
3 years ago
};
}
if (data) {
this.options = [computeOption(data)];
3 years ago
console.log('树树树树树树树树树树', this.options[0]);
3 years ago
}
} else {
3 years ago
this.$message.error('树查询失败', msg);
3 years ago
}
},
// 人员调动确定
async submitTransfer() {
3 years ago
const url = '/gov/org/staff/stafftransferv2';
3 years ago
let params = {
staffId: this.transferForm.staffId,
orgId: this.transferForm.orgId,
orgType: this.transferForm.orgType,
3 years ago
remarks: this.transferForm.remarks
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
3 years ago
this.$message.success('调动成功');
3 years ago
this.transferRest();
this.transferPeo = false;
this.getAgencyList();
this.getDepartmentList();
this.getGridList();
this.getAgencyStaffListData();
this.getDepartmentStaffListData();
this.getAgencyStaffListData();
this.getGridStaffListData();
} else {
this.$message.error(msg);
}
},
// 获取导航
// async getNavigation(){
// const url = "/gov/org/customeragency/orgtree"
// let params = {
// }
// const { data, code, msg } = await requestPost(url,params)
// if(code === 0){
// this.Navigation = data.agencyName
// }
// 组装顶部面包屑数组
async assembleBreadcrumbArr(id, orgType) {
this.currentBreadcrumbKey = id;
3 years ago
if (orgType === 'agency') {
const url = '/gov/org/agency/agencydetail';
3 years ago
let params = {
3 years ago
agencyId: id
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
// 社区级为最低级组织,不展示下级组织列表
this.currentAgencyLevel = data.level;
this.currentAreaCode = data.areaCode;
this.currentAreaCodeSwitch = data.areaCodeSwitch;
if (data.parentList && data.parentList.length > 0) {
3 years ago
this.parentAreaCode = data.parentList[data.parentList.length - 1].areaCode;
this.parentAgencyId = data.parentList[data.parentList.length - 1].id;
this.parentAgencyLevel = data.parentList[data.parentList.length - 1].level;
3 years ago
}
3 years ago
if (data.level === 'community') {
3 years ago
this.agencyTableFlag = false;
} else {
this.agencyTableFlag = true;
}
if (this.breadcrumbArr.length === 0) {
this.breadcrumbArr = [
{
id: data.agencyId,
name: data.agencyName,
3 years ago
type: orgType
}
3 years ago
];
} else {
let hasBreadcrumbArr = false;
3 years ago
this.breadcrumbArr.forEach(function(bc) {
3 years ago
if (bc.id === id) {
hasBreadcrumbArr = true;
}
});
if (hasBreadcrumbArr === false) {
let breadcrumb = {
id: data.agencyId,
name: data.agencyName,
3 years ago
type: orgType
3 years ago
};
this.breadcrumbArr.push(breadcrumb);
}
}
} else {
this.$message.error(msg);
}
3 years ago
} else if (orgType === 'department') {
const url = '/gov/org/department/departmentdetail';
3 years ago
let params = {
3 years ago
departmentId: id
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
if (this.breadcrumbArr.length === 0) {
this.breadcrumbArr = [
{
id: data.departmentId,
name: data.departmentName,
3 years ago
type: orgType
}
3 years ago
];
} else {
let hasBreadcrumbArr = false;
3 years ago
this.breadcrumbArr.forEach(function(bc) {
3 years ago
if (bc.id === id) {
hasBreadcrumbArr = true;
}
});
if (hasBreadcrumbArr === false) {
let breadcrumb = {
id: data.departmentId,
name: data.departmentName,
3 years ago
type: orgType
3 years ago
};
this.breadcrumbArr.push(breadcrumb);
}
}
} else {
this.$message.error(msg);
}
3 years ago
} else if (orgType === 'grid') {
const url = '/gov/org/grid/griddetail';
3 years ago
let params = {
3 years ago
gridId: id
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
if (this.breadcrumbArr.length === 0) {
this.breadcrumbArr = [
{
id: data.grid,
name: data.gridName,
3 years ago
type: orgType
}
3 years ago
];
} else {
let hasBreadcrumbArr = false;
3 years ago
this.breadcrumbArr.forEach(function(bc) {
3 years ago
if (bc.id === id) {
hasBreadcrumbArr = true;
}
});
if (hasBreadcrumbArr === false) {
let breadcrumb = {
id: data.grid,
name: data.gridName,
3 years ago
type: orgType
3 years ago
};
this.breadcrumbArr.push(breadcrumb);
}
}
} else {
this.$message.error(msg);
}
}
},
async refreshThisPage(index) {
// 点击最后一级不触发响应
if (index === this.breadcrumbArr.length - 1) {
return;
}
const selectOrg = this.breadcrumbArr[index];
this.breadcrumbArr = this.breadcrumbArr.slice(0, index + 1);
const orgId = selectOrg.id;
const orgType = selectOrg.type;
3 years ago
if (orgType === 'agency') {
3 years ago
this.agencyTableListData = [];
this.agencyStaffTableListData = [];
this.departmentTableListData = [];
this.departmentStaffTableListData = [];
this.gridTableListData = [];
this.gridStaffTableListData = [];
this.userAgencyId = orgId;
this.currentAgencyId = orgId;
this.agencyTableFlag = true;
this.currentAgencyStaffTableFlag = true;
this.departmentTableFlag = true;
this.departmentStaffTableFlag = false;
this.gridTableFlag = true;
this.gridStaffTableFlag = false;
3 years ago
this.assembleBreadcrumbArr(orgId, 'agency');
3 years ago
this.getAgencyList();
this.getDepartmentList();
this.getGridList();
this.getAgencyStaffListData();
}
// 当点击最后一级不触发响应
// 其父级及以上,只可能属于组织,而非部门或网格,注释以下代码即可
// 若需要点击最后一级触发刷新,可释放以下代码
/* else if (orgType === 'department') {
3 years ago
this.agencyStaffTableListData = []
this.departmentStaffTableListData = []
this.gridStaffTableListData = []
this.currentDepartmentId = orgId
this.agencyTableFlag = false
this.currentAgencyStaffTableFlag = false
this.departmentTableFlag = false
this.departmentStaffTableFlag = true
this.gridTableFlag = false
this.gridStaffTableFlag = false
this.getDepartmentStaffListData()
this.assembleBreadcrumbArr(orgId, 'department')
} else if (orgType === 'grid') {
this.agencyStaffTableListData = []
this.departmentStaffTableListData =[]
this.gridStaffTableListData = []
this.currentGridOrgId = orgId
this.agencyTableFlag = false
this.currentAgencyStaffTableFlag = false
this.departmentTableFlag = false
this.departmentStaffTableFlag = false
this.gridTableFlag = false
this.gridStaffTableFlag = true
this.getGridStaffListData()
this.assembleBreadcrumbArr(orgId, 'grid')
} */
3 years ago
},
// 获取组织区划信息
async getZoning(areaCode, parentAgencyId, parentAgencyLevel) {
3 years ago
const url = '/data/aggregator/org/nextlevelareacodelist';
3 years ago
let params = {
areaCode: areaCode,
level: parentAgencyLevel,
3 years ago
parentAgencyId: parentAgencyId
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.zonings = data;
} else {
this.$message.error(msg);
}
},
handelZoing(val) {
3 years ago
this.zonings.forEach(item => {
3 years ago
if (item.areaCode == val) {
this.agencyForm.level = item.level;
this.agencyForm.areaName = item.areaName;
this.agencyForm.areaCode = item.areaCode;
}
});
},
handelStreeOrCommunityZoing(val) {
3 years ago
this.zonings.forEach(item => {
3 years ago
if (item.areaCode == val) {
this.OrgDetailsForm.level = item.level;
this.OrgDetailsForm.areaName = item.areaName;
this.OrgDetailsForm.areaCode = item.areaCode;
}
});
},
addAgency() {
this.createAgencyDialogFlag = true;
this.addNewAgencyRest();
3 years ago
this.getZoning(this.currentAreaCode, this.currentAgencyId, this.currentAgencyLevel);
3 years ago
},
// 新增组织确定按钮
async submitaddNewAgency() {
3 years ago
const url = '/gov/org/agency/addagency-v2';
3 years ago
let params = {
parentAgencyId: this.currentAgencyId,
agencyName: this.agencyForm.agencyName,
level: this.agencyForm.level,
areaCodeSwitch: this.currentAreaCodeSwitch,
areaCode: this.agencyForm.areaCode,
areaName: this.agencyForm.areaName,
contacts: this.agencyForm.contacts,
mobile: this.agencyForm.mobile,
code: this.agencyForm.code,
remark: this.agencyForm.remark,
latitude: this.latitude,
3 years ago
longitude: this.longitude
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
3 years ago
this.$message.success('添加成功');
3 years ago
this.createAgencyDialogFlag = false;
this.getAgencyList();
this.getDepartmentList();
this.getGridList();
this.getAgencyStaffListData();
} else {
this.$message.error(msg);
}
},
// 修改面包屑
modifyOrgInfo() {
3 years ago
this.judgeOrgInfoLevel = this.breadcrumbArr[this.breadcrumbArr.length - 1];
if (this.judgeOrgInfoLevel.type === 'agency') {
3 years ago
this.getOrgDetailsById();
setTimeout(() => {
3 years ago
if (this.OrgDetailsForm.level === 'district') {
3 years ago
/** 修改市区级弹窗 */
this.modifyCityOrgPop = true;
} else {
/** 街道级和社区级弹窗 */
3 years ago
this.getZoning(this.parentAreaCode, this.parentAgencyId, this.parentAgencyLevel);
3 years ago
this.streetOrCommunity = true;
}
}, 1000);
3 years ago
} else if (this.judgeOrgInfoLevel.type === 'department') {
3 years ago
/** 下级机关单位修改 */
this.OrgUnitPop = true;
this.getOrgUnitDetailsById();
} else {
/** 网格修改 */
this.getDictionaries();
this.modifyGridPop = true;
this.getGridDetailsById();
}
},
// 根据id获取组织机构详细信息
async getOrgDetailsById() {
3 years ago
const url = '/gov/org/agency/agencydetail';
3 years ago
let params = {
3 years ago
agencyId: this.judgeOrgInfoLevel.id
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.currentAgencyLevel = data.level;
this.currentAreaCode = data.areaCode;
if (data.parentList && data.parentList.length > 0) {
3 years ago
this.parentAreaCode = data.parentList[data.parentList.length - 1].areaCode;
this.parentAgencyId = data.parentList[data.parentList.length - 1].id;
this.parentAgencyLevel = data.parentList[data.parentList.length - 1].level;
3 years ago
}
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.OrgDetailsForm.remark = data.remark;
this.latitude = data.latitude;
this.longitude = data.longitude;
this.OrgDetailsForm.agencyId = data.agencyId;
} else {
this.$message.error(msg);
}
},
// 根据id获取下级机关单位详情
async getOrgUnitDetailsById() {
3 years ago
const url = '/gov/org/department/departmentdetail';
3 years ago
let params = {
3 years ago
departmentId: this.judgeOrgInfoLevel.id
3 years ago
};
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() {
3 years ago
const url = '/gov/org/grid/griddetail';
3 years ago
let params = {
3 years ago
gridId: this.judgeOrgInfoLevel.id
3 years ago
};
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;
this.modifyGridFrom.gridSort = data.gridSort;
this.modifyGridFrom.latitude = data.latitude;
this.modifyGridFrom.longitude = data.longitude;
3 years ago
} else {
this.$message.error(msg);
}
},
// 市级/街道/社区级组织修改确定按钮
async sunmitModifyCityOrgPop() {
3 years ago
const url = '/gov/org/agency/editagency';
3 years ago
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,
longitude: this.longitude,
3 years ago
remark: this.OrgDetailsForm.remark
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
3 years ago
this.$message.success('修改成功');
3 years ago
this.modifyCityOrgPop = false;
this.streetOrCommunity = false;
this.getAgencyList();
this.getDepartmentList();
this.getGridList();
this.agencyPeo();
} else {
this.$message.error(msg);
}
},
// 修改下级机关单位确定按钮
async sunmitOrgUnitForm() {
3 years ago
const url = '/gov/org/department/editdepartment';
3 years ago
let params = {
code: this.OrgUnitDetailsForm.code,
contacts: this.OrgUnitDetailsForm.contacts,
departmentId: this.OrgUnitDetailsForm.departmentId,
departmentName: this.OrgUnitDetailsForm.departmentName,
3 years ago
mobile: this.OrgUnitDetailsForm.mobile
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
3 years ago
this.$message.success('修改成功');
3 years ago
this.OrgUnitPop = false;
this.getAgencyList();
this.getDepartmentList();
this.getGridList();
this.agencyPeo();
} else {
this.$message.error(msg);
}
},
// 修改网格确定按钮
async submitModifyGrid() {
3 years ago
const url = '/gov/org/grid/editgrid';
3 years ago
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,
sort: this.modifyGridFrom.gridSort,
latitude: this.modifyGridFrom.latitude,
3 years ago
longitude: this.modifyGridFrom.longitude
3 years ago
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
3 years ago
this.$message.success('修改成功');
3 years ago
this.modifyGridPop = false;
this.getAgencyList();
this.getDepartmentList();
this.getGridList();
this.agencyPeo();
} else {
this.$message.error(msg);
}
},
/** 地图初始化 */
createMap(type) {
let { latitude, longitude } = this[type] || this;
3 years ago
if (latitude === null || latitude === '' || longitude === null || longitude === '') {
let { latitude: latitude2, longitude: longitude2 } = this.$store.state.user;
if (!latitude2 || latitude2 == '' || latitude2 == '0') {
3 years ago
latitude = 39.9088810666821;
longitude = 116.39743841556731;
} else {
latitude = latitude2;
longitude = longitude2;
}
}
var map = new daiMap(
3 years ago
document.getElementById('con'),
3 years ago
{ latitude, longitude },
{
zoom: 16.2, // 设置地图缩放级别
pitch: 43.5, // 设置俯仰角
3 years ago
rotation: 45 // 设置地图旋转角度
3 years ago
}
);
// 监听地图平移结束
3 years ago
map.on('dragend', e => {
3 years ago
//修改地图中心点
const { lat, lng } = map.getCenter();
map.setMarker(lat, lng);
if (type) {
this[type].latitude = lat;
this[type].longitude = lng;
} else {
this.latitude = lat;
this.longitude = lng;
}
});
3 years ago
map.setMarker(latitude, longitude);
3 years ago
}
}
};
</script>
<style scoped>
3 years ago
#container {
3 years ago
width: 100%;
height: 100%;
3 years ago
}
#info {
3 years ago
left: 20px;
top: 20px;
font-size: 14px;
background: #fff;
width: 270px;
padding: 10px;
border-radius: 3px;
3 years ago
}
#con {
3 years ago
width: 100%;
height: 100%;
3 years ago
}
.el-tag + .el-tag {
3 years ago
margin-left: 10px;
3 years ago
}
</style>