|
|
@@ -1,480 +1,596 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <el-main ref="elMain" style="padding: 0px">
|
|
|
- <Split :gutterSize="2" style="height: calc(100vh - 120px)">
|
|
|
- <!-- 左侧树Start -->
|
|
|
- <SplitArea :size="leftSplitWidth" :minSize="240">
|
|
|
+ <div>
|
|
|
+ <el-main ref="elMain" style="padding: 0px">
|
|
|
+ <Split :gutterSize="2" style="height: calc(100vh - 120px)">
|
|
|
+ <!-- 左侧树Start -->
|
|
|
+ <SplitArea :size="leftSplitWidth" :minSize="240">
|
|
|
+ <div>
|
|
|
<div>
|
|
|
- <div>
|
|
|
- <kt-button style="
|
|
|
- background-color: #ffc000;
|
|
|
- border: #ffc000;
|
|
|
- " icon="fa fa-plus" label="添加人员" type="primary" perms="sys:agent:add" @click="handleAddButton" />
|
|
|
- </div>
|
|
|
- <el-divider></el-divider>
|
|
|
- <!-- 左侧树形结构 -->
|
|
|
- <el-tree :data="ztreeNodes" :props="{ children: 'children', label: 'name' }" node-key="id"
|
|
|
- :default-expanded-keys="['9']" @node-click="onZTreeClick"></el-tree>
|
|
|
+ <kt-button
|
|
|
+ style="background-color: #ffc000; border: #ffc000"
|
|
|
+ icon="fa fa-plus"
|
|
|
+ label="添加人员"
|
|
|
+ type="primary"
|
|
|
+ perms="sys:agent:add"
|
|
|
+ @click="handleAddButton"
|
|
|
+ />
|
|
|
</div>
|
|
|
- </SplitArea>
|
|
|
- <!-- 左侧树End -->
|
|
|
-
|
|
|
- <!-- 右侧列表页面Start -->
|
|
|
- <SplitArea :size="rightSplitWidth">
|
|
|
- <templateTable :formList="formList" :searchData.sync="queryFrom" :tableConfig="tableConfig"
|
|
|
- :data="pageResult" @getList="findPage" @handleSearchList="handleSearchList" :pagination="pageData">
|
|
|
- </templateTable>
|
|
|
- </SplitArea>
|
|
|
- <!-- 右侧列表页面End -->
|
|
|
- </Split>
|
|
|
- </el-main>
|
|
|
-
|
|
|
- <!-- 新增修改界面 -->
|
|
|
- <el-dialog :title="dialogTitle" width="60%" :visible.sync="dialogVisible" :close-on-click-modal="false"
|
|
|
- :before-close="handleDialogBefore" @close="closeDialog" v-dialogDrag>
|
|
|
- <el-tabs v-model="activeName">
|
|
|
- <el-tab-pane label="基本信息" name="1">
|
|
|
- <el-form :model="formData" :rules="formDataRules" ref="formData" :inline="true" label-width="130px" size="small">
|
|
|
- <el-row>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="机构名称" prop="deptId">
|
|
|
- <el-cascader style="width:200px" :options="ztreeNodes" v-model="formData.deptId" clearable
|
|
|
+ <el-divider></el-divider>
|
|
|
+ <!-- 左侧树形结构 -->
|
|
|
+ <el-tree
|
|
|
+ :data="ztreeNodes"
|
|
|
+ :props="{ children: 'children', label: 'name' }"
|
|
|
+ node-key="id"
|
|
|
+ :default-expanded-keys="['9']"
|
|
|
+ @node-click="onZTreeClick"
|
|
|
+ ></el-tree>
|
|
|
+ </div>
|
|
|
+ </SplitArea>
|
|
|
+ <!-- 左侧树End -->
|
|
|
+
|
|
|
+ <!-- 右侧列表页面Start -->
|
|
|
+ <SplitArea :size="rightSplitWidth">
|
|
|
+ <templateTable
|
|
|
+ :formList="formList"
|
|
|
+ :searchData.sync="queryFrom"
|
|
|
+ :tableConfig="tableConfig"
|
|
|
+ :data="pageResult"
|
|
|
+ @getList="findPage"
|
|
|
+ @handleSearchList="handleSearchList"
|
|
|
+ :pagination="pageData"
|
|
|
+ >
|
|
|
+ </templateTable>
|
|
|
+ </SplitArea>
|
|
|
+ <!-- 右侧列表页面End -->
|
|
|
+ </Split>
|
|
|
+ </el-main>
|
|
|
+
|
|
|
+ <!-- 新增修改界面 -->
|
|
|
+ <el-dialog
|
|
|
+ :title="dialogTitle"
|
|
|
+ width="60%"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :before-close="handleDialogBefore"
|
|
|
+ @close="closeDialog"
|
|
|
+ v-dialogDrag
|
|
|
+ >
|
|
|
+ <el-tabs v-model="activeName">
|
|
|
+ <el-tab-pane label="基本信息" name="1">
|
|
|
+ <el-form
|
|
|
+ :model="formData"
|
|
|
+ :rules="formDataRules"
|
|
|
+ ref="formData"
|
|
|
+ :inline="true"
|
|
|
+ label-width="130px"
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="机构名称" prop="deptId">
|
|
|
+ <el-cascader
|
|
|
+ style="width: 200px"
|
|
|
+ :options="ztreeNodes"
|
|
|
+ v-model="formData.deptId"
|
|
|
+ clearable
|
|
|
:disabled="dialogTitle == '编辑渠道信息'"
|
|
|
- :show-all-levels="false" :props="{
|
|
|
- value: 'id',
|
|
|
- label: 'name',
|
|
|
- checkStrictly: true,
|
|
|
- }" @change="handleChange">
|
|
|
- </el-cascader>
|
|
|
- </el-form-item></el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="员工工号" prop="id">
|
|
|
- <el-input v-model="formData.id" disabled></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="手机号" prop="mobile">
|
|
|
- <el-input v-model="formData.mobile"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="名称" prop="name">
|
|
|
- <el-input v-model="formData.name"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item v-if="dialogPassword" label="密码" prop="word">
|
|
|
- <el-input v-model="formData.password" :class="isShow==true?'disc':'none'" ></el-input>
|
|
|
- <i class="el-icon-view icon" @click="isShowFun()"></i>
|
|
|
- <!-- <el-input style="width:200px" v-model="formData.password" autocomplete="new-password"
|
|
|
+ :show-all-levels="false"
|
|
|
+ :props="{
|
|
|
+ value: 'id',
|
|
|
+ label: 'name',
|
|
|
+ checkStrictly: true,
|
|
|
+ }"
|
|
|
+ @change="handleChange"
|
|
|
+ >
|
|
|
+ </el-cascader> </el-form-item
|
|
|
+ ></el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="员工工号" prop="id">
|
|
|
+ <el-input v-model="formData.id" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="手机号" prop="mobile">
|
|
|
+ <el-input v-model="formData.mobile"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="名称" prop="name">
|
|
|
+ <el-input v-model="formData.name"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item v-if="dialogPassword" label="密码" prop="word">
|
|
|
+ <el-input
|
|
|
+ v-model="formData.password"
|
|
|
+ :class="isShow == true ? 'disc' : 'none'"
|
|
|
+ ></el-input>
|
|
|
+ <i class="el-icon-view icon" @click="isShowFun()"></i>
|
|
|
+ <!-- <el-input style="width:200px" v-model="formData.password" autocomplete="new-password"
|
|
|
show-password></el-input> -->
|
|
|
-
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="状态" prop="status">
|
|
|
- <el-select :disabled="dialogTitle == '新增渠道信息'" style="width:200px" v-model="formData.status" placeholder="请选择">
|
|
|
- <el-option v-for="val in user_statusoptions" :label="val.label" :value="val.value"
|
|
|
- :key="val.id"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="角色" prop="roleId">
|
|
|
- <el-select style="width:200px" v-model="formData.roleId" placeholder="请选择" disabled>
|
|
|
- <el-option v-for="val in roles" :label="val.name" :value="val.id + ''" :key="val.id"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="业务员" prop="referrerId">
|
|
|
- <el-select style="width:200px" v-model="formData.referrerId" placeholder="请选择">
|
|
|
- <el-option v-for="val in recommenderOptions" :label="val.name" :value="val.id"
|
|
|
- :key="val.id"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="业务员工号" prop="referrerName">
|
|
|
- <el-input v-model="formData.referrerId" disabled></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- <div style="text-align: right;">
|
|
|
- <el-button size="small" type="primary" style="background-color: #ffc000; border: 1px solid #ffc000" @click="closeDialog">取消</el-button>
|
|
|
- <el-button size="small" type="primary" @click="submitForm">提交</el-button>
|
|
|
- </div>
|
|
|
- </el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
-
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="状态" prop="status">
|
|
|
+ <el-select
|
|
|
+ :disabled="dialogTitle == '新增渠道信息'"
|
|
|
+ style="width: 200px"
|
|
|
+ v-model="formData.status"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="val in user_statusoptions"
|
|
|
+ :label="val.label"
|
|
|
+ :value="val.value"
|
|
|
+ :key="val.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="角色" prop="roleId">
|
|
|
+ <el-select
|
|
|
+ style="width: 200px"
|
|
|
+ v-model="formData.roleId"
|
|
|
+ placeholder="请选择"
|
|
|
+ disabled
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="val in roles"
|
|
|
+ :label="val.name"
|
|
|
+ :value="val.id + ''"
|
|
|
+ :key="val.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="业务员" prop="referrerId">
|
|
|
+ <el-select
|
|
|
+ style="width: 200px"
|
|
|
+ v-model="formData.referrerId"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="val in recommenderOptions"
|
|
|
+ :label="val.name"
|
|
|
+ :value="val.id"
|
|
|
+ :key="val.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="业务员工号" prop="referrerName">
|
|
|
+ <el-input v-model="formData.referrerId" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div style="text-align: right">
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ style="background-color: #ffc000; border: 1px solid #ffc000"
|
|
|
+ @click="closeDialog"
|
|
|
+ >取消</el-button
|
|
|
+ >
|
|
|
+ <el-button size="small" type="primary" @click="submitForm"
|
|
|
+ >提交</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
|
|
|
<script>
|
|
|
- import KtButton from "@/views/Core/KtButton"; // 按钮权限组件
|
|
|
- import tree from "@/components/ztree.vue"; // 机构树组件
|
|
|
- import templateTable from '../../../components/TemplateTable/index.vue'
|
|
|
- import peopleImage from '@/components/PeopleImage/index.vue'
|
|
|
- export default {
|
|
|
- components: {
|
|
|
- KtButton,
|
|
|
- tree,
|
|
|
- templateTable,
|
|
|
- peopleImage
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- activeName: '1', //弹框tab索引
|
|
|
- isShow:true, //密码是否显示
|
|
|
- formList: [ //树右侧搜索数据列
|
|
|
- {
|
|
|
- label: "工号",
|
|
|
- prop: "userId",
|
|
|
- type: 'input'
|
|
|
- },
|
|
|
+import KtButton from "@/views/Core/KtButton"; // 按钮权限组件
|
|
|
+import tree from "@/components/ztree.vue"; // 机构树组件
|
|
|
+import templateTable from "../../../components/TemplateTable/index.vue";
|
|
|
+import peopleImage from "@/components/PeopleImage/index.vue";
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ KtButton,
|
|
|
+ tree,
|
|
|
+ templateTable,
|
|
|
+ peopleImage,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ activeName: "1", //弹框tab索引
|
|
|
+ isShow: true, //密码是否显示
|
|
|
+ formList: [
|
|
|
+ //树右侧搜索数据列
|
|
|
+ {
|
|
|
+ label: "工号",
|
|
|
+ prop: "userId",
|
|
|
+ type: "input",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "姓名",
|
|
|
+ prop: "name",
|
|
|
+ type: "input",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "手机号",
|
|
|
+ prop: "mobile",
|
|
|
+ type: "input",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "状态",
|
|
|
+ prop: "status",
|
|
|
+ type: "select",
|
|
|
+ options: JSON.parse(localStorage.getItem("user_statusoptions")),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "角色",
|
|
|
+ prop: "roleId",
|
|
|
+ type: "select",
|
|
|
+ options: [
|
|
|
+ { label: "出单员", value: "19" },
|
|
|
+ { label: "团队长", value: "21" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ tableConfig: {
|
|
|
+ columns: [
|
|
|
+ // 数据列
|
|
|
+ { prop: "deptId", label: "部门编码", type: "text" },
|
|
|
{
|
|
|
- label: "姓名",
|
|
|
- prop: "name",
|
|
|
- type: 'input'
|
|
|
+ prop: "pdeptName",
|
|
|
+ label: "机构名称",
|
|
|
+ type: "text",
|
|
|
},
|
|
|
+ { prop: "deptName", label: "部门名称", type: "text" },
|
|
|
+
|
|
|
+ { prop: "userId", label: "工号", type: "text" },
|
|
|
+ { prop: "name", label: "姓名", type: "text" },
|
|
|
+ { prop: "mobile", label: "联系电话", type: "text" },
|
|
|
{
|
|
|
- label: "手机号",
|
|
|
- prop: "mobile",
|
|
|
- type: 'input'
|
|
|
+ prop: "roleId",
|
|
|
+ label: "角色",
|
|
|
+ type: "text",
|
|
|
},
|
|
|
{
|
|
|
- label: "状态",
|
|
|
prop: "status",
|
|
|
- type: "select",
|
|
|
- options: JSON.parse(localStorage.getItem('user_statusoptions'))
|
|
|
+ label: "状态",
|
|
|
+ type: "text",
|
|
|
},
|
|
|
- // {
|
|
|
- // label: "角色",
|
|
|
- // prop: "roleId",
|
|
|
- // type: "select",
|
|
|
- // options: [{label: "出单员", value: "1"},{label: "团队长", value: "2"}]
|
|
|
- // },
|
|
|
],
|
|
|
- tableConfig: {
|
|
|
- columns: [
|
|
|
- // 数据列
|
|
|
- { prop: "deptId", label: "部门编码", type: 'text' },
|
|
|
- {
|
|
|
- prop: "pdeptName",
|
|
|
- label: "机构名称", type: 'text',
|
|
|
- },
|
|
|
- { prop: "deptName", label: "部门名称", type: 'text', },
|
|
|
-
|
|
|
- { prop: "userId", label: "工号", type: 'text', },
|
|
|
- { prop: "name", label: "姓名", type: 'text', },
|
|
|
- { prop: "mobile", label: "联系电话", type: 'text', },
|
|
|
- {
|
|
|
- prop: "roleId",
|
|
|
- label: "角色", type: 'text',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "status",
|
|
|
- label: "状态", type: 'text',
|
|
|
- },],
|
|
|
- loading: true,
|
|
|
- isPaginationShow: true,
|
|
|
- isShowIndex: true,
|
|
|
- optBtns: [
|
|
|
- {
|
|
|
- type: 'primary',
|
|
|
- label: '编辑',
|
|
|
- icon: "fa fa-edit",
|
|
|
- click: (row, index) => { return this.handleTableEdit(row) },
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- recommenderOptions: [],
|
|
|
- pageData: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- totalSize: 0
|
|
|
- },
|
|
|
- deptId: JSON.parse(localStorage.getItem('user_data')).deptId,
|
|
|
- formData: {
|
|
|
- roleId: '19',
|
|
|
- },
|
|
|
- formDataRules: {
|
|
|
- deptId: [{ required: true, message: "请选择机构", trigger: "change" }],
|
|
|
- mobile: [
|
|
|
- { required: true, message: "请输入手机号", trigger: "blur" },
|
|
|
- { min: 11, max: 11, message: "请输入11位手机号码", trigger: "blur" },
|
|
|
- {
|
|
|
- pattern:
|
|
|
- /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/,
|
|
|
- message: "请输入正确的手机号",
|
|
|
- trigger: "blur",
|
|
|
+ loading: true,
|
|
|
+ isPaginationShow: true,
|
|
|
+ isShowIndex: true,
|
|
|
+ optBtns: [
|
|
|
+ {
|
|
|
+ type: "primary",
|
|
|
+ label: "编辑",
|
|
|
+ icon: "fa fa-edit",
|
|
|
+ click: (row, index) => {
|
|
|
+ return this.handleTableEdit(row);
|
|
|
},
|
|
|
- ],
|
|
|
- name: [{ required: true, message: "请填写名称", trigger: "blur" }],
|
|
|
- // password: [{ required: true, message: "请填写密码", trigger: "blur" }],
|
|
|
- status: [{ required: true, message: "请选择状态", trigger: "change" }],
|
|
|
- // roleId: [{ required: true, message: "请填写角色", trigger: "blur" }],
|
|
|
- referrerId:[{ required: true, message: "请选择业务员", trigger: "change" }],
|
|
|
- },
|
|
|
- filterObject: {},
|
|
|
- peopleid: "",
|
|
|
- peopledeptid: "",
|
|
|
- /**Split 开始 */
|
|
|
- leftSplitWidth: 20,
|
|
|
- rightSplitWidth: 80,
|
|
|
- ztreeObj: null,
|
|
|
- ztreeSetting: {
|
|
|
- check: {
|
|
|
- enable: false,
|
|
|
},
|
|
|
- data: {
|
|
|
- simpleData: {
|
|
|
- enable: true,
|
|
|
- pIdKey: "parentId",
|
|
|
- },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ recommenderOptions: [],
|
|
|
+ pageData: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ },
|
|
|
+ deptId: JSON.parse(localStorage.getItem("user_data")).deptId,
|
|
|
+ formData: {
|
|
|
+ roleId: "19",
|
|
|
+ },
|
|
|
+ formDataRules: {
|
|
|
+ deptId: [{ required: true, message: "请选择机构", trigger: "change" }],
|
|
|
+ mobile: [
|
|
|
+ { required: true, message: "请输入手机号", trigger: "blur" },
|
|
|
+ { min: 11, max: 11, message: "请输入11位手机号码", trigger: "blur" },
|
|
|
+ {
|
|
|
+ pattern:
|
|
|
+ /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/,
|
|
|
+ message: "请输入正确的手机号",
|
|
|
+ trigger: "blur",
|
|
|
},
|
|
|
- view: {
|
|
|
- showIcon: false,
|
|
|
+ ],
|
|
|
+ name: [{ required: true, message: "请填写名称", trigger: "blur" }],
|
|
|
+ // password: [{ required: true, message: "请填写密码", trigger: "blur" }],
|
|
|
+ status: [{ required: true, message: "请选择状态", trigger: "change" }],
|
|
|
+ // roleId: [{ required: true, message: "请填写角色", trigger: "blur" }],
|
|
|
+ referrerId: [
|
|
|
+ { required: true, message: "请选择业务员", trigger: "change" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ filterObject: {},
|
|
|
+ peopleid: "",
|
|
|
+ peopledeptid: "",
|
|
|
+ /**Split 开始 */
|
|
|
+ leftSplitWidth: 20,
|
|
|
+ rightSplitWidth: 80,
|
|
|
+ ztreeObj: null,
|
|
|
+ ztreeSetting: {
|
|
|
+ check: {
|
|
|
+ enable: false,
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ simpleData: {
|
|
|
+ enable: true,
|
|
|
+ pIdKey: "parentId",
|
|
|
},
|
|
|
},
|
|
|
- ztreeNodes: [],
|
|
|
- currentTreeNode: null,
|
|
|
- queryFrom: {},// 右侧列表查询数据Start
|
|
|
- pageResult: [],
|
|
|
- containsSubDeptChecked: true, //是否包含下级机构
|
|
|
- dialogTitle: "", //弹框title
|
|
|
- dialogVisible: false, // 新增编辑界面是否显示
|
|
|
- user_statusoptions: JSON.parse(localStorage.getItem('user_statusoptions')),
|
|
|
- roles: JSON.parse(localStorage.getItem('find_all')),
|
|
|
- option: [], //机构列表
|
|
|
- dialogPassword:true, //密码是否显示
|
|
|
- };
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.findLeftTreeData(); // 获取机构树的数据
|
|
|
- this.findPage()
|
|
|
+ view: {
|
|
|
+ showIcon: false,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ztreeNodes: [],
|
|
|
+ currentTreeNode: null,
|
|
|
+ queryFrom: {}, // 右侧列表查询数据Start
|
|
|
+ pageResult: [],
|
|
|
+ containsSubDeptChecked: true, //是否包含下级机构
|
|
|
+ dialogTitle: "", //弹框title
|
|
|
+ dialogVisible: false, // 新增编辑界面是否显示
|
|
|
+ user_statusoptions: JSON.parse(
|
|
|
+ localStorage.getItem("user_statusoptions")
|
|
|
+ ),
|
|
|
+ roles: JSON.parse(localStorage.getItem("find_all")),
|
|
|
+ option: [], //机构列表
|
|
|
+ dialogPassword: true, //密码是否显示
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.findLeftTreeData(); // 获取机构树的数据
|
|
|
+ this.findPage();
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ //用像素初始化左边的split的宽度
|
|
|
+ this.changeTreeWidth(240); // 初始化树的宽度
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ containsSubDeptChecked() {
|
|
|
+ this.findPage();
|
|
|
},
|
|
|
- mounted() {
|
|
|
- //用像素初始化左边的split的宽度
|
|
|
- this.changeTreeWidth(240); // 初始化树的宽度
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 初始化树的宽度
|
|
|
+ changeTreeWidth(widthVal) {
|
|
|
+ this.leftSplitWidth = Math.ceil(
|
|
|
+ (widthVal / this.$refs.elMain.$el.clientWidth) * 100
|
|
|
+ );
|
|
|
+ this.rightSplitWidth = 100 - this.leftSplitWidth;
|
|
|
},
|
|
|
- watch: {
|
|
|
- containsSubDeptChecked() {
|
|
|
- this.findPage();
|
|
|
- },
|
|
|
+ // 获取机构树的数据
|
|
|
+ findLeftTreeData() {
|
|
|
+ this.$api.dept.findDeptTree().then((res) => {
|
|
|
+ this.treeDataRecursion(res.data, 1);
|
|
|
+ this.ztreeNodes = res.data;
|
|
|
+ });
|
|
|
},
|
|
|
- methods: {
|
|
|
- // 初始化树的宽度
|
|
|
- changeTreeWidth(widthVal) {
|
|
|
- this.leftSplitWidth = Math.ceil(
|
|
|
- (widthVal / this.$refs.elMain.$el.clientWidth) * 100
|
|
|
- );
|
|
|
- this.rightSplitWidth = 100 - this.leftSplitWidth;
|
|
|
- },
|
|
|
- // 获取机构树的数据
|
|
|
- findLeftTreeData() {
|
|
|
- this.$api.dept.findDeptTree().then((res) => {
|
|
|
- this.ztreeNodes = res.data;
|
|
|
- });
|
|
|
- },
|
|
|
- // 点击事件
|
|
|
- onZTreeClick(evt, treeId, treeNode) {
|
|
|
- this.currentTreeNode = evt;
|
|
|
- this.deptId = this.currentTreeNode.id;
|
|
|
- this.pageData.pageNum = 1;
|
|
|
- this.findPage();
|
|
|
- },
|
|
|
- //联级选择器触发事件
|
|
|
- handleChange(val) {
|
|
|
- if (val && val.length !== 0) {
|
|
|
- this.formData.referrerId = ''
|
|
|
- this.formData.deptId = val.at(-1);
|
|
|
- this.$api.user.selectfindByreferrerId({ deptId: this.formData.deptId }).then((res) => {
|
|
|
- this.recommenderOptions = res.data
|
|
|
- });
|
|
|
+ //树过滤五级机构递归
|
|
|
+ treeDataRecursion(data, num, one) {
|
|
|
+ data = data || this.ztreeNodes;
|
|
|
+ one = one || 0;
|
|
|
+ one++;
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
+ if (data[i].comlevel == 5 && data[i].managementSource != num) {
|
|
|
+ data.splice(i, 1);
|
|
|
+ i = i - 1;
|
|
|
+ } else if (one > 5 && data[i].comlevel == null) {
|
|
|
+ data.splice(i, 1);
|
|
|
+ i = i - 1;
|
|
|
+ } else {
|
|
|
+ this.treeDataRecursion(data[i].children, num, one);
|
|
|
}
|
|
|
- },
|
|
|
- // 右侧列表的方法Start
|
|
|
- findPage(data) {
|
|
|
- this.tableConfig.loading = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 点击事件
|
|
|
+ onZTreeClick(evt, treeId, treeNode) {
|
|
|
+ this.currentTreeNode = evt;
|
|
|
+ this.deptId = this.currentTreeNode.id;
|
|
|
+ this.pageData.pageNum = 1;
|
|
|
+ this.findPage();
|
|
|
+ },
|
|
|
+ //联级选择器触发事件
|
|
|
+ handleChange(val) {
|
|
|
+ if (val && val.length !== 0) {
|
|
|
+ this.formData.referrerId = "";
|
|
|
+ this.formData.deptId = val.at(-1);
|
|
|
this.$api.user
|
|
|
- .findPage({ ...this.pageData, dto: { ...data, roleId: '19', deptId: this.deptId } })
|
|
|
+ .selectfindByreferrerId({ deptId: this.formData.deptId })
|
|
|
.then((res) => {
|
|
|
- if (res.code == 200 && res.data.content.length > 0) {
|
|
|
- res.data.content.forEach(val => {
|
|
|
- if (val.status && val.status !== '' && val.status !== null) {
|
|
|
- val.status = this.user_statusoptions.find(ele => ele.value == val.status).label
|
|
|
- }
|
|
|
- if (val.roleId && val.roleId !== '' && val.roleId !== null) {
|
|
|
- val.roleId = this.roles.find(ele => ele.id == val.roleId).name
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- this.tableConfig.loading = false;
|
|
|
- this.pageResult = res.data.content;
|
|
|
- this.pageData.pageNum = res.data.pageNum;
|
|
|
- this.pageData.pageSize = res.data.pageSize;
|
|
|
- this.pageData.totalSize = res.data.totalSize;
|
|
|
- })
|
|
|
- },
|
|
|
- isShowFun(){
|
|
|
- this.isShow=!this.isShow
|
|
|
- },
|
|
|
- handleSearchList(data) {
|
|
|
- this.findPage(data)
|
|
|
- },
|
|
|
- //编辑
|
|
|
- async handleTableEdit(params) {
|
|
|
- this.dialogPassword = false
|
|
|
- this.dataForm = {
|
|
|
- SFZ_01: "",
|
|
|
- SFZ_02: "",
|
|
|
- Z6Z_00: "",
|
|
|
- LD_00: "",
|
|
|
- YP_00: "",
|
|
|
- DX_00: "",
|
|
|
- };
|
|
|
- this.activeName = '1'
|
|
|
- let res = await this.$api.user.getUserDatail(params.userId)
|
|
|
- if (res.code == 200) {
|
|
|
- this.$api.user.selectfindByreferrerId({ deptId: res.data.sysUser.deptId }).then((res) => {
|
|
|
- this.recommenderOptions = res.data
|
|
|
+ this.recommenderOptions = res.data;
|
|
|
});
|
|
|
- res.data.sysUser.status += ''
|
|
|
- this.formData = res.data.sysUser
|
|
|
- this.formData.password = ''
|
|
|
- this.dialogTitle = "编辑渠道信息";
|
|
|
- this.dialogVisible = true;
|
|
|
- }
|
|
|
- else {
|
|
|
- this.$message.error(res.msg);
|
|
|
- }
|
|
|
- },
|
|
|
- //添加人员
|
|
|
- handleAddButton() {
|
|
|
- //级联渲染部门列表
|
|
|
- this.$api.user.selectfindByreferrerId({ deptId: this.deptId }).then((res) => {
|
|
|
- this.recommenderOptions = res.data
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 右侧列表的方法Start
|
|
|
+ findPage(data) {
|
|
|
+ this.tableConfig.loading = true;
|
|
|
+ this.$api.user
|
|
|
+ .findUserList({
|
|
|
+ ...this.pageData,
|
|
|
+ dto: { ...data, deptId: this.deptId, agentFlag: "1" },
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200 && res.data.records.length > 0) {
|
|
|
+ res.data.records.forEach((val) => {
|
|
|
+ if (val.status && val.status !== "" && val.status !== null) {
|
|
|
+ val.status = this.user_statusoptions.find(
|
|
|
+ (ele) => ele.value == val.status
|
|
|
+ ).label;
|
|
|
+ }
|
|
|
+ if (val.roleId && val.roleId !== "" && val.roleId !== null) {
|
|
|
+ val.roleId = this.roles.find(
|
|
|
+ (ele) => ele.id == val.roleId
|
|
|
+ ).name;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.tableConfig.loading = false;
|
|
|
+ this.pageResult = res.data.records;
|
|
|
+ this.pageData.pageNum = res.data.current;
|
|
|
+ this.pageData.pageSize = res.data.size;
|
|
|
+ this.pageData.totalSize = res.data.total;
|
|
|
});
|
|
|
- if (this.currentTreeNode == null) {
|
|
|
- this.$message.info("请选择所属公司或部门");
|
|
|
- return;
|
|
|
- }
|
|
|
- let statusArr = this.user_statusoptions.filter(item=>item.label=='正常')
|
|
|
- this.dialogPassword = true
|
|
|
- this.formData = {
|
|
|
- roleId: '19',
|
|
|
- status: '',
|
|
|
- referrerId:'',
|
|
|
- deptId: this.deptId
|
|
|
- }
|
|
|
- this.formData.status = statusArr.length > 0 ? statusArr[0].value : ''
|
|
|
- this.activeName = '1'
|
|
|
- this.dialogTitle = "新增渠道信息";
|
|
|
+ },
|
|
|
+ isShowFun() {
|
|
|
+ this.isShow = !this.isShow;
|
|
|
+ },
|
|
|
+ handleSearchList(data) {
|
|
|
+ this.findPage(data);
|
|
|
+ },
|
|
|
+ //编辑
|
|
|
+ async handleTableEdit(params) {
|
|
|
+ this.dialogPassword = false;
|
|
|
+ this.dataForm = {
|
|
|
+ SFZ_01: "",
|
|
|
+ SFZ_02: "",
|
|
|
+ Z6Z_00: "",
|
|
|
+ LD_00: "",
|
|
|
+ YP_00: "",
|
|
|
+ DX_00: "",
|
|
|
+ };
|
|
|
+ this.activeName = "1";
|
|
|
+ let res = await this.$api.user.getUserDatail(params.userId);
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$api.user
|
|
|
+ .selectfindByreferrerId({ deptId: res.data.sysUser.deptId })
|
|
|
+ .then((res) => {
|
|
|
+ this.recommenderOptions = res.data;
|
|
|
+ });
|
|
|
+ res.data.sysUser.status += "";
|
|
|
+ this.formData = res.data.sysUser;
|
|
|
+ this.formData.password = "";
|
|
|
+ this.dialogTitle = "编辑渠道信息";
|
|
|
this.dialogVisible = true;
|
|
|
-
|
|
|
- },
|
|
|
- // 退出对话框之前确认提示
|
|
|
- handleDialogBefore(done) {
|
|
|
- this.$confirm("确认关闭?")
|
|
|
- .then((_) => {
|
|
|
- done();
|
|
|
- })
|
|
|
- .catch((_) => { });
|
|
|
- },
|
|
|
- // 清空数据
|
|
|
- closeDialog() {
|
|
|
- this.dialogVisible = false;
|
|
|
- },
|
|
|
- // 提交
|
|
|
- submitForm() {
|
|
|
- this.$refs.formData.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- this.$confirm("确认提交吗?", "提示", {})
|
|
|
- .then(() => {
|
|
|
- if (this.dialogTitle == '新增渠道信息') {
|
|
|
- this.$api.user.saveUserInfo({sysUser: this.formData}).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.$message({
|
|
|
- message: "保存成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- this.dialogVisible = false;
|
|
|
- this.$refs["formData"].resetFields();
|
|
|
- this.activeName = '1'
|
|
|
- this.findPage();
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: `保存失败,请重新添加,(${res.msg})`,
|
|
|
- type: "error",
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- else{
|
|
|
- this.$api.user.updateUserInfo(this.formData.id,{sysUser: this.formData }).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.$message({
|
|
|
- message: "编辑成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- this.dialogVisible = false;
|
|
|
- this.$refs["formData"].resetFields();
|
|
|
- this.activeName = '1'
|
|
|
- this.findPage();
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: `编辑失败,请重新添加,(${res.msg})`,
|
|
|
- type: "error",
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //添加人员
|
|
|
+ handleAddButton() {
|
|
|
+ //级联渲染部门列表
|
|
|
+ this.$api.user
|
|
|
+ .selectfindByreferrerId({ deptId: this.deptId })
|
|
|
+ .then((res) => {
|
|
|
+ this.recommenderOptions = res.data;
|
|
|
});
|
|
|
- },
|
|
|
- }
|
|
|
- };
|
|
|
- </script>
|
|
|
+ if (this.currentTreeNode == null) {
|
|
|
+ this.$message.info("请选择所属公司或部门");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let statusArr = this.user_statusoptions.filter(
|
|
|
+ (item) => item.label == "正常"
|
|
|
+ );
|
|
|
+ this.dialogPassword = true;
|
|
|
+ this.formData = {
|
|
|
+ roleId: "19",
|
|
|
+ status: "",
|
|
|
+ referrerId: "",
|
|
|
+ deptId: this.deptId,
|
|
|
+ };
|
|
|
+ this.formData.status = statusArr.length > 0 ? statusArr[0].value : "";
|
|
|
+ this.activeName = "1";
|
|
|
+ this.dialogTitle = "新增渠道信息";
|
|
|
+ this.dialogVisible = true;
|
|
|
+ },
|
|
|
+ // 退出对话框之前确认提示
|
|
|
+ handleDialogBefore(done) {
|
|
|
+ this.$confirm("确认关闭?")
|
|
|
+ .then((_) => {
|
|
|
+ done();
|
|
|
+ })
|
|
|
+ .catch((_) => {});
|
|
|
+ },
|
|
|
+ // 清空数据
|
|
|
+ closeDialog() {
|
|
|
+ this.dialogVisible = false;
|
|
|
+ },
|
|
|
+ // 提交
|
|
|
+ submitForm() {
|
|
|
+ this.$refs.formData.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.$confirm("确认提交吗?", "提示", {}).then(() => {
|
|
|
+ if (this.dialogTitle == "新增渠道信息") {
|
|
|
+ this.$api.user
|
|
|
+ .saveUserInfo({ sysUser: this.formData })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: "保存成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.$refs["formData"].resetFields();
|
|
|
+ this.activeName = "1";
|
|
|
+ this.findPage();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: `保存失败,请重新添加,(${res.msg})`,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$api.user
|
|
|
+ .updateUserInfo(this.formData.id, { sysUser: this.formData })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: "编辑成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.$refs["formData"].resetFields();
|
|
|
+ this.activeName = "1";
|
|
|
+ this.findPage();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: `编辑失败,请重新添加,(${res.msg})`,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
|
|
|
<style scoped>
|
|
|
- .el-divider--horizontal {
|
|
|
- margin: 4px 0;
|
|
|
- }
|
|
|
-
|
|
|
- /* 顶部查询条件样式Start */
|
|
|
- .queryFrom .el-row {
|
|
|
- margin: 10px 0px;
|
|
|
- }
|
|
|
-
|
|
|
- .queryFrom .el-form-item {
|
|
|
- margin-bottom: 0px;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- .queryFrom .queryButton .el-form-item__content {
|
|
|
- margin-left: 0px !important;
|
|
|
- }
|
|
|
- .disc{
|
|
|
- -webkit-text-security:disc;
|
|
|
- position: relative;
|
|
|
- }
|
|
|
- .none{
|
|
|
- -webkit-text-security:none;
|
|
|
- position: relative;
|
|
|
- }
|
|
|
- .icon{
|
|
|
- color: #ccc;
|
|
|
- position: absolute;
|
|
|
- right: 0;
|
|
|
- top:10px;
|
|
|
- text-align: center
|
|
|
- }
|
|
|
- </style>
|
|
|
+.el-divider--horizontal {
|
|
|
+ margin: 4px 0;
|
|
|
+}
|
|
|
+
|
|
|
+/* 顶部查询条件样式Start */
|
|
|
+.queryFrom .el-row {
|
|
|
+ margin: 10px 0px;
|
|
|
+}
|
|
|
+
|
|
|
+.queryFrom .el-form-item {
|
|
|
+ margin-bottom: 0px;
|
|
|
+}
|
|
|
+
|
|
|
+.queryFrom .queryButton .el-form-item__content {
|
|
|
+ margin-left: 0px !important;
|
|
|
+}
|
|
|
+.disc {
|
|
|
+ -webkit-text-security: disc;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+.none {
|
|
|
+ -webkit-text-security: none;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+.icon {
|
|
|
+ color: #ccc;
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ top: 10px;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+</style>
|
|
|
|