zouyu
2025-03-05 42f135086753fc6784e1b4894a4fcc6164a06669
Merge branch 'refs/heads/dev'

# Conflicts:
# src/views/system/customer/index.vue
已修改6个文件
924 ■■■■ 文件已修改
public/favicon.ico 补丁 | 查看 | 原始文档 | blame | 历史
src/api/system/customer.js 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/system/user.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/customer/index.vue 140 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/user/index.vue 752 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/favicon.ico

src/api/system/customer.js
@@ -4,7 +4,7 @@
// 查询客户列表
export function selectCustomPageList(query) {
  return request({
    url: "/system/user/selectCustomPageList",
    url: "/system/custom/selectCustomPageList",
    method: "get",
    params: query,
  });
@@ -12,24 +12,31 @@
// 新增客户
export function addCustom(query) {
  return request({
    url: "/system/user/addCustom",
    url: "/system/custom/addCustom",
    method: "post",
    params: query,
    data: query,
  });
}
// 修改客户
export function upCustom(query) {
  return request({
    url: "/system/user/upCustom",
    url: "/system/custom/upCustom",
    method: "post",
    params: query,
    data: query,
  });
}
// 删除客户
export function delCustomById(query) {
  return request({
    url: "/system/user/delCustomById",
    url: "/system/custom/delCustomById",
    method: "post",
    params: query,
    data: query,
  });
}
// 获取单位
export function selectCustomEnum() {
  return request({
    url: "/system/custom/selectCustomEnum",
    method: "get",
  });
}
src/api/system/user.js
@@ -165,13 +165,7 @@
    method: "get",
  });
}
// 获取单位
export function selectCustomEnum() {
  return request({
    url: "/user/selectCustomEnum",
    method: "get",
  });
}
// 提交添加架构信息
export function addDepartment(params) {
  return request({
src/views/system/customer/index.vue
@@ -2,26 +2,62 @@
  <div class="app-container">
    <div class="search">
      <div>
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
        <el-form
          :model="queryParams"
          ref="queryForm"
          size="small"
          :inline="true"
        >
          <el-form-item label="客户名称" prop="company">
            <el-input size="small" placeholder="请输入" clearable v-model="queryParams.company"
              @keyup.enter.native="getList"></el-input>
            <el-input
              size="small"
              placeholder="请输入"
              clearable
              v-model="queryParams.company"
              @keyup.enter.native="getList"
            ></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="getList">查 询</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="refresh">重 置</el-button>
            <el-button
              type="primary"
              icon="el-icon-search"
              size="mini"
              @click="getList"
              >查 询</el-button
            >
            <el-button icon="el-icon-refresh" size="mini" @click="refresh"
              >重 置</el-button
            >
          </el-form-item>
        </el-form>
      </div>
      <div>
        <el-button size="small" type="primary" @click="openFormDia('add')" icon="el-icon-plus">新增</el-button>
        <el-button
          size="small"
          type="primary"
          @click="openFormDia('add')"
          icon="el-icon-plus"
          >新增</el-button
        >
      </div>
    </div>
    <div>
      <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading"></lims-table>
      <lims-table
        :tableData="tableData"
        @pagination="pagination"
        :column="column"
        :page="page"
        :tableLoading="tableLoading"
      ></lims-table>
    </div>
    <el-dialog :title="formTitle" :visible.sync="addDia" width="450px">
      <el-form ref="userForm" :model="user" :rules="userRules" label-position="right" label-width="100px">
      <el-form
        ref="userForm"
        :model="user"
        :rules="userRules"
        label-position="right"
        label-width="100px"
      >
        <el-form-item label="客户名称" prop="company">
          <el-input v-model="user.company" size="small" clearable></el-input>
        </el-form-item>
@@ -29,18 +65,33 @@
          <el-input v-model="user.companyEn" size="small" clearable></el-input>
        </el-form-item>
        <el-form-item label="单位地址" prop="address">
          <el-input type="textarea" v-model="user.address" size="small" clearable
            :autosize="{ minRows: 2, maxRows: 4 }"></el-input>
          <el-input
            type="textarea"
            v-model="user.address"
            size="small"
            clearable
            :autosize="{ minRows: 2, maxRows: 4 }"
          ></el-input>
        </el-form-item>
        <el-form-item label="单位地址EN" prop="addressEn">
          <el-input type="textarea" v-model="user.addressEn" size="small" clearable
            :autosize="{ minRows: 2, maxRows: 4 }"></el-input>
          <el-input
            type="textarea"
            v-model="user.addressEn"
            size="small"
            clearable
            :autosize="{ minRows: 2, maxRows: 4 }"
          ></el-input>
        </el-form-item>
        <el-form-item label="单位电话" prop="phone">
          <el-input v-model="user.phone" size="small" clearable></el-input>
        </el-form-item>
        <el-form-item label="加急额度" prop="num">
          <el-input v-model="user.num" size="small" clearable></el-input>
          <el-input-number
            v-model="user.num"
            size="small"
            clearable
            :min="0"
          ></el-input-number>
        </el-form-item>
        <el-form-item label="客户编号" prop="code2">
          <el-input v-model="user.code2" size="small" clearable></el-input>
@@ -51,7 +102,9 @@
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="reset">取 消</el-button>
        <el-button type="primary" @click="customAdd" :loading="loading">确 定</el-button>
        <el-button type="primary" @click="customAdd" :loading="loading"
          >确 定</el-button
        >
      </span>
    </el-dialog>
  </div>
@@ -62,6 +115,7 @@
import {
  addCustom,
  selectCustomPageList,
  delCustomById,
  upCustom,
} from "@/api/system/customer";
export default {
@@ -89,10 +143,31 @@
          label: "操作",
          operation: [
            {
              name: "委托记录",
              type: "text",
              clickFun: (row) => {
                console.log(row);
              },
            },
            {
              name: "协议记录",
              type: "text",
              clickFun: (row) => {
                console.log(row);
              },
            },
            {
              name: "编辑",
              type: "text",
              clickFun: (row) => {
                this.openFormDia("edit", row);
              },
            },
            {
              name: "删除",
              type: "text",
              clickFun: (row) => {
                this.delCustomRow(row);
              },
            },
          ],
@@ -133,7 +208,19 @@
  mounted() {
    this.getList();
  },
  watch: {
    addDia(newVal) {
      if (!newVal) {
        this.user = {};
      }
    },
  },
  methods: {
    pagination({ page, limit }) {
      this.page.current = page;
      this.page.size = limit;
      this.getList();
    },
    // 查询客户列表
    getList() {
      this.tableLoading = true;
@@ -141,8 +228,8 @@
        .then((res) => {
          this.tableLoading = false;
          if (res.code === 200) {
            this.tableData = res.data;
            this.page.total = res.total;
            this.tableData = res.data.records;
            this.page.total = res.data.total;
          }
        })
        .catch((err) => {
@@ -155,9 +242,28 @@
      this.getList();
    },
    openFormDia(type, row) {
      this.addDia = true;
      this.formTitle = type === "add" ? "新增客户" : "编辑客户";
      this.operationType = type;
      if (row) {
        this.user = this.HaveJson(row);
      }
      this.addDia = true;
    },
    delCustomRow(row) {
      this.$confirm("确认删除该条客户记录吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          delCustomById({ id: row.id }).then((res) => {
            if (res.status === 200) {
              this.$message.success("删除成功");
            }
            this.getList();
          });
        })
        .catch(() => {});
    },
    customAdd() {
      this.$refs["userForm"].validate((valid) => {
src/views/system/user/index.vue
@@ -1,16 +1,44 @@
<template>
  <div class="app-container">
    <el-row :gutter="20">
      <splitpanes :horizontal="this.$store.getters.device === 'mobile'" class="default-theme">
      <splitpanes
        :horizontal="this.$store.getters.device === 'mobile'"
        class="default-theme"
      >
        <!--部门数据-->
        <pane size="12">
          <el-col>
            <div class="head-container addButton">
              <el-input v-model="deptName" placeholder="部门名称" clearable size="small" prefix-icon="el-icon-search" style="margin-bottom: 20px" />
              <el-button style="margin-left: 4px" type="primary" plain icon="el-icon-plus" size="mini" circle @click="addSchema"></el-button>
              <el-input
                v-model="deptName"
                placeholder="部门名称"
                clearable
                size="small"
                prefix-icon="el-icon-search"
                style="margin-bottom: 20px"
              />
              <el-button
                style="margin-left: 4px"
                type="primary"
                plain
                icon="el-icon-plus"
                size="mini"
                circle
                @click="addSchema"
              ></el-button>
            </div>
            <div class="head-container">
              <el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false" :filter-node-method="filterNode" ref="tree" node-key="id" default-expand-all highlight-current @node-click="handleNodeClick" />
              <el-tree
                :data="deptOptions"
                :props="defaultProps"
                :expand-on-click-node="false"
                :filter-node-method="filterNode"
                ref="tree"
                node-key="id"
                default-expand-all
                highlight-current
                @node-click="handleNodeClick"
              />
            </div>
          </el-col>
        </pane>
@@ -18,69 +46,168 @@
        <pane size="88">
          <div class="search_form">
            <div>
              <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
              <el-form
                :model="queryParams"
                ref="queryForm"
                size="small"
                :inline="true"
                v-show="showSearch"
              >
                <el-form-item label="用户名称" prop="nickName">
                  <el-input v-model="queryParams.nickName" placeholder="请输入用户名称" clearable @keyup.enter.native="handleQuery" />
                  <el-input
                    v-model="queryParams.nickName"
                    placeholder="请输入用户名称"
                    clearable
                    @keyup.enter.native="handleQuery"
                  />
                </el-form-item>
                <el-form-item label="状态" prop="status">
                  <el-select v-model="queryParams.status" placeholder="用户状态" clearable>
                    <el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
                  <el-select
                    v-model="queryParams.status"
                    placeholder="用户状态"
                    clearable
                  >
                    <el-option
                      v-for="dict in dict.type.sys_normal_disable"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    />
                  </el-select>
                </el-form-item>
                <el-form-item>
                  <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查 询</el-button>
                  <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重 置</el-button>
                  <el-button
                    type="primary"
                    icon="el-icon-search"
                    size="mini"
                    @click="handleQuery"
                    >查 询</el-button
                  >
                  <el-button
                    icon="el-icon-refresh"
                    size="mini"
                    @click="resetQuery"
                    >重 置</el-button
                  >
                </el-form-item>
              </el-form>
            </div>
            <div class="options_button">
              <el-button type="primary" size="mini" @click="openthirdParty" v-hasPermi="['system:user:add']">获取三方人员</el-button>
              <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:user:add']">新增用户</el-button>
              <el-button
                type="primary"
                size="mini"
                @click="openthirdParty"
                v-hasPermi="['system:user:add']"
                >获取三方人员</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-plus"
                size="mini"
                @click="handleAdd"
                v-hasPermi="['system:user:add']"
                >新增用户</el-button
              >
            </div>
          </div>
          <el-col>
            <el-table v-loading="loading" :data="userList">
              <el-table-column label="序号" align="center" type="index" />
              <el-table-column label="姓名" align="center" key="nickName" prop="nickName" :show-overflow-tooltip="true" />
              <el-table-column label="账号" align="center" key="userName" prop="userName" :show-overflow-tooltip="true" />
              <el-table-column
                label="姓名"
                align="center"
                key="nickName"
                prop="nickName"
                :show-overflow-tooltip="true"
              />
              <el-table-column
                label="账号"
                align="center"
                key="userName"
                prop="userName"
                :show-overflow-tooltip="true"
              />
              <el-table-column label="状态" align="center" key="status">
                <template slot-scope="scope">
                  <el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
                  <el-switch
                    v-model="scope.row.status"
                    active-value="0"
                    inactive-value="1"
                    @change="handleStatusChange(scope.row)"
                  ></el-switch>
                </template>
              </el-table-column>
              <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" width="120" />
              <el-table-column label="操作" align="center" width="160" class-nickName="small-padding fixed-width">
              <el-table-column
                label="手机号码"
                align="center"
                key="phonenumber"
                prop="phonenumber"
                width="120"
              />
              <el-table-column
                label="操作"
                align="center"
                width="160"
                class-nickName="small-padding fixed-width"
              >
                <template slot-scope="scope">
                  <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:user:edit']">修改</el-button>
<!--                  <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']">删除</el-button>-->
<!--                  <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:user:resetPwd', 'system:user:edit']">-->
<!--                    <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>-->
<!--                    <el-dropdown-menu slot="dropdown">-->
<!--                      <el-dropdown-item command="handleResetPwd" icon="el-icon-key" v-hasPermi="['system:user:resetPwd']">重置密码</el-dropdown-item>-->
<!--                      <el-dropdown-item command="handleAuthRole" icon="el-icon-circle-check" v-hasPermi="['system:user:edit']">分配角色</el-dropdown-item>-->
<!--                    </el-dropdown-menu>-->
<!--                  </el-dropdown>-->
                  <el-button
                    size="mini"
                    type="text"
                    icon="el-icon-edit"
                    @click="handleUpdate(scope.row)"
                    v-hasPermi="['system:user:edit']"
                    >修改</el-button
                  >
                  <!--                  <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']">删除</el-button>-->
                  <!--                  <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:user:resetPwd', 'system:user:edit']">-->
                  <!--                    <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>-->
                  <!--                    <el-dropdown-menu slot="dropdown">-->
                  <!--                      <el-dropdown-item command="handleResetPwd" icon="el-icon-key" v-hasPermi="['system:user:resetPwd']">重置密码</el-dropdown-item>-->
                  <!--                      <el-dropdown-item command="handleAuthRole" icon="el-icon-circle-check" v-hasPermi="['system:user:edit']">分配角色</el-dropdown-item>-->
                  <!--                    </el-dropdown-menu>-->
                  <!--                  </el-dropdown>-->
                </template>
              </el-table-column>
            </el-table>
            <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
            <pagination
              v-show="total > 0"
              :total="total"
              :page.sync="queryParams.pageNum"
              :limit.sync="queryParams.pageSize"
              @pagination="getList"
            />
          </el-col>
        </pane>
      </splitpanes>
    </el-row>
    <!-- 添加或修改用户配置对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body @close="reset">
    <el-dialog
      :title="title"
      :visible.sync="open"
      width="900px"
      append-to-body
      @close="reset"
    >
      <el-form ref="form" :model="form" :rules="rules" label-width="90px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="姓名" prop="nickName">
              <el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" />
              <el-input
                v-model="form.nickName"
                placeholder="请输入用户昵称"
                maxlength="30"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="账号" prop="userName">
              <el-input v-model="form.userName" placeholder="请输入用户昵称" maxlength="30" />
              <el-input
                v-model="form.userName"
                placeholder="请输入用户昵称"
                maxlength="30"
              />
            </el-form-item>
          </el-col>
        </el-row>
@@ -88,47 +215,90 @@
          <el-col :span="12">
            <el-form-item label="状态" prop="status">
              <el-radio-group v-model="form.status">
                <el-radio v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio>
                <el-radio
                  v-for="dict in dict.type.sys_normal_disable"
                  :key="dict.value"
                  :label="dict.value"
                  >{{ dict.label }}</el-radio
                >
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="电话号码" prop="phonenumber">
              <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
              <el-input
                v-model="form.phonenumber"
                placeholder="请输入手机号码"
                maxlength="11"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="角色" prop="roleIds">
              <el-select v-model="form.roleIds" multiple placeholder="请选择角色" clearable>
                <el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId" :disabled="item.status == 1"></el-option>
              <el-select
                v-model="form.roleIds"
                multiple
                placeholder="请选择角色"
                clearable
              >
                <el-option
                  v-for="item in roleOptions"
                  :key="item.roleId"
                  :label="item.roleName"
                  :value="item.roleId"
                  :disabled="item.status == 1"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="密码" prop="password">
              <el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password />
              <el-input
                v-model="form.password"
                placeholder="请输入用户密码"
                type="password"
                maxlength="20"
                show-password
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="姓名EN" prop="nameEn">
              <el-input v-model="form.nameEn" placeholder="请输入姓名EN" maxlength="50" />
              <el-input
                v-model="form.nameEn"
                placeholder="请输入姓名EN"
                maxlength="50"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="邮箱" prop="email">
              <el-input v-model="form.email" placeholder="请输入内容"></el-input>
              <el-input
                v-model="form.email"
                placeholder="请输入内容"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="单位" prop="company">
              <el-select v-model="form.company" placeholder="请选择岗位" style="width: 100%" clearable>
                <el-option v-for="item in postOptions" :key="item.postId" :label="item.postName" :value="item.postId"></el-option>
              <el-select
                v-model="form.company"
                placeholder="请选择单位"
                style="width: 100%"
                clearable
              >
                <el-option
                  v-for="item in postOptions"
                  :key="item.id"
                  :label="item.company"
                  :value="item.id + ''"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
@@ -143,8 +313,14 @@
                accept=".png, .jpg, .jpeg, .gif"
                :on-error="handleUploadError"
                :on-success="handleUploadSuccess"
                :before-upload="handleBeforeUpload">
                <img v-if="signatureUrl" :src="signatureUrl" class="avatar" alt="">
                :before-upload="handleBeforeUpload"
              >
                <img
                  v-if="signatureUrl"
                  :src="signatureUrl"
                  class="avatar"
                  alt=""
                />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </el-form-item>
@@ -158,8 +334,14 @@
                accept=".png, .jpg, .jpeg, .gif"
                :on-error="handleUploadError1"
                :on-success="handleUploadSuccess1"
                :before-upload="handleBeforeUpload1">
                <img v-if="pictureUrl" :src="pictureUrl" class="avatar" alt="">
                :before-upload="handleBeforeUpload1"
              >
                <img
                  v-if="pictureUrl"
                  :src="pictureUrl"
                  class="avatar"
                  alt=""
                />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </el-form-item>
@@ -173,16 +355,40 @@
    </el-dialog>
    <!-- 用户导入对话框 -->
    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
      <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
    <el-dialog
      :title="upload.title"
      :visible.sync="upload.open"
      width="400px"
      append-to-body
    >
      <el-upload
        ref="upload"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="upload.headers"
        :action="upload.url + '?updateSupport=' + upload.updateSupport"
        :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :auto-upload="false"
        drag
      >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
        <div class="el-upload__tip text-center" slot="tip">
          <div class="el-upload__tip" slot="tip">
            <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
            <el-checkbox
              v-model="upload.updateSupport"
            />是否更新已经存在的用户数据
          </div>
          <span>仅允许导入xls、xlsx格式文件。</span>
          <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
          <el-link
            type="primary"
            :underline="false"
            style="font-size: 12px; vertical-align: baseline"
            @click="importTemplate"
            >下载模板</el-link
          >
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
@@ -192,38 +398,87 @@
    </el-dialog>
    <!-- 获取人事系统人员信息 -->
    <el-dialog title="获取人事系统人员信息" :visible.sync="addthirdParty" width="70%">
    <el-dialog
      title="获取人事系统人员信息"
      :visible.sync="addthirdParty"
      width="70%"
    >
      <div class="body" v-loading="thirdPartyLoading">
        <el-row>
          <el-col :span="8" style="height: 70vh;overflow: hidden;" v-if="companiesList.length!=1">
            <el-input v-model="search2" placeholder="输入关键字搜索" clearable size="small"
                      @clear="searchFilter2" @keyup.enter.native="searchFilter2"
                      prefix-icon="el-icon-search" style="margin-bottom: 20px;width: 90%"/>
            <el-tree :data="datathirdParty" node-key="companyId" :props="defaultProps" @node-click="nodeClick2"
                     style="height: calc(100% - 42px);" @node-expand="nodeOpen0" :filter-node-method="filterNode2" ref="tree2"
                     highlight-current>
          <el-col
            :span="8"
            style="height: 70vh; overflow: hidden"
            v-if="companiesList.length != 1"
          >
            <el-input
              v-model="search2"
              placeholder="输入关键字搜索"
              clearable
              size="small"
              @clear="searchFilter2"
              @keyup.enter.native="searchFilter2"
              prefix-icon="el-icon-search"
              style="margin-bottom: 20px; width: 90%"
            />
            <el-tree
              :data="datathirdParty"
              node-key="companyId"
              :props="defaultProps"
              @node-click="nodeClick2"
              style="height: calc(100% - 42px)"
              @node-expand="nodeOpen0"
              :filter-node-method="filterNode2"
              ref="tree2"
              highlight-current
            >
            </el-tree>
          </el-col>
          <el-col :span="companiesList.length==1?24:16" style="height: 70vh;padding-left: 8px;">
            <div style="display: flex;align-items: center;margin-bottom: 10px">
          <el-col
            :span="companiesList.length == 1 ? 24 : 16"
            style="height: 70vh; padding-left: 8px"
          >
            <div
              style="display: flex; align-items: center; margin-bottom: 10px"
            >
              <span style="width: 140px">员工号/员工姓名:</span>
              <el-input size="small" placeholder="请输入员工号/员工姓名" @clear="searchPerson" clearable v-model="userSearch2"
                        style="width: 50%"
                        @keyup.enter.native="searchPerson()"></el-input>
              <el-input
                size="small"
                placeholder="请输入员工号/员工姓名"
                @clear="searchPerson"
                clearable
                v-model="userSearch2"
                style="width: 50%"
                @keyup.enter.native="searchPerson()"
              ></el-input>
            </div>
            <el-table height="67vh" stripe :data="personList" v-loading="personLoad" ref="personTable"
                      @selection-change="handleSelectionChange">
              <el-table-column type="selection" width="50">
              </el-table-column>
            <el-table
              height="67vh"
              stripe
              :data="personList"
              v-loading="personLoad"
              ref="personTable"
              @selection-change="handleSelectionChange"
            >
              <el-table-column type="selection" width="50"> </el-table-column>
              <el-table-column prop="employeeID" label="员工号">
              </el-table-column>
              <el-table-column prop="nickName" label="员工姓名">
              </el-table-column>
              <el-table-column prop="department" label="部门" min-width="200">
              </el-table-column>
              <el-table-column prop="isLive" label="已存在" width="80" align="center">
              <el-table-column
                prop="isLive"
                label="已存在"
                width="80"
                align="center"
              >
                <template slot-scope="scope">
                  <el-tag type="success" effect="dark" v-if="scope.row.isLive === 1">√</el-tag>
                  <el-tag
                    type="success"
                    effect="dark"
                    v-if="scope.row.isLive === 1"
                    >√</el-tag
                  >
                </template>
              </el-table-column>
            </el-table>
@@ -232,23 +487,32 @@
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="addthirdParty = false">取 消</el-button>
        <el-button type="primary" @click="addUser2" :loading="addLoad">确 定</el-button>
        <el-button type="primary" @click="addUser2" :loading="addLoad"
          >确 定</el-button
        >
      </div>
    </el-dialog>
    <el-dialog title="架构新增" :visible.sync="addDia" width="400px">
      <div class="body">
        <el-row style="line-height: 50px;">
          <el-col :span="6" style="text-align: right;">
        <el-row style="line-height: 50px">
          <el-col :span="6" style="text-align: right">
            <span class="required-span">* </span>架构名称:
          </el-col>
          <el-col :span="16" :offset="1">
            <el-input v-model="addOb.nickName" placeholder="请输入架构名称" clearable size="small"></el-input>
            <el-input
              v-model="addOb.nickName"
              placeholder="请输入架构名称"
              clearable
              size="small"
            ></el-input>
          </el-col>
        </el-row>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="addDia = false">取 消</el-button>
        <el-button type="primary" @click="addStandardTree" :loading="addLoad">确 定</el-button>
        <el-button type="primary" @click="addStandardTree" :loading="addLoad"
          >确 定</el-button
        >
      </span>
    </el-dialog>
  </div>
@@ -264,8 +528,14 @@
  resetUserPwd,
  changeUserStatus,
  deptTreeSelect,
  selectCompaniesList, selectSimpleList, addPersonUser, uploadFile, selectRoleList, selectCustomEnum, addDepartment
  selectCompaniesList,
  selectSimpleList,
  addPersonUser,
  uploadFile,
  selectRoleList,
  addDepartment,
} from "@/api/system/user";
import { selectCustomEnum } from "@/api/system/customer";
import { getToken } from "@/utils/auth";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@@ -274,7 +544,7 @@
export default {
  nickName: "User",
  dicts: ['sys_normal_disable', 'sys_user_sex'],
  dicts: ["sys_normal_disable", "sys_user_sex"],
  components: { Treeselect, Splitpanes, Pane },
  data() {
    return {
@@ -314,7 +584,7 @@
      form: {},
      defaultProps: {
        children: "children",
        label: "label"
        label: "label",
      },
      // 用户导入参数
      upload: {
@@ -329,11 +599,11 @@
        // 设置上传的请求头部
        headers: { Authorization: "Bearer " + getToken() },
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + "/system/user/importData"
        url: process.env.VUE_APP_BASE_API + "/system/user/importData",
      },
      uploadAction: process.env.VUE_APP_BASE_API + '/deviceScope/uploadFile',
      signatureUrl: '',
      pictureUrl: '',
      uploadAction: process.env.VUE_APP_BASE_API + "/deviceScope/uploadFile",
      signatureUrl: "",
      pictureUrl: "",
      // 查询参数
      queryParams: {
        pageNum: 1,
@@ -341,7 +611,7 @@
        nickName: undefined,
        phonenumber: undefined,
        status: undefined,
        deptId: undefined
        deptId: undefined,
      },
      // 列信息
      columns: [
@@ -351,25 +621,15 @@
        { key: 3, label: `部门`, visible: true },
        { key: 4, label: `手机号码`, visible: true },
        { key: 5, label: `状态`, visible: true },
        { key: 6, label: `创建时间`, visible: true }
        { key: 6, label: `创建时间`, visible: true },
      ],
      // 表单校验
      rules: {
        nickName: [
          { required: true, message: "请填写姓名", trigger: "blur" },
        ],
        userName: [
          { required: true, message: "请填写账号", trigger: "blur" }
        ],
        nameEn: [
          { required: true, message: "请输入姓名EN", trigger: "blur" }
        ],
        status: [
          { required: true, message: "请选择状态", trigger: "change" }
        ],
        roleIds: [
          { required: true, message: "请选择角色", trigger: "change" }
        ],
        nickName: [{ required: true, message: "请填写姓名", trigger: "blur" }],
        userName: [{ required: true, message: "请填写账号", trigger: "blur" }],
        nameEn: [{ required: true, message: "请输入姓名EN", trigger: "blur" }],
        status: [{ required: true, message: "请选择状态", trigger: "change" }],
        roleIds: [{ required: true, message: "请选择角色", trigger: "change" }],
        password: [
          { required: true, message: "密码不能为空", trigger: "blur" },
        ],
@@ -378,27 +638,27 @@
            required: true,
            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
            message: "请输入正确的手机号码",
            trigger: "blur"
          }
        ]
            trigger: "blur",
          },
        ],
      },
      // 获取三方人员弹框
      addthirdParty: false,
      thirdPartyLoading:false,
      thirdPartyLoading: false,
      companiesList: [],
      search2: '',
      search2: "",
      datathirdParty: [],
      currentCompaniesList: [],
      personList: [],
      personListCopy: [],
      personLoad: false,
      userSearch2: '',
      userSearch2: "",
      addLoad: false,
      //
      addDia: false, // 添加架构弹框
      addOb: {
        fatherId: 10001,
        nickName: '',
        nickName: "",
      },
    };
  },
@@ -406,12 +666,12 @@
    // 根据名称筛选部门树
    deptName(val) {
      this.$refs.tree.filter(val);
    }
    },
  },
  created() {
    this.getList();
    this.getDeptTree();
    this.getConfigKey("sys.user.initPassword").then(response => {
    this.getConfigKey("sys.user.initPassword").then((response) => {
      this.initPassword = response.msg;
    });
  },
@@ -419,7 +679,8 @@
    /** 查询用户列表 */
    getList() {
      this.loading = true;
      listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
      listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
        (response) => {
          this.userList = response.rows;
          this.total = response.total;
          this.loading = false;
@@ -427,41 +688,45 @@
      );
    },
    // 打开添加架构弹框
    addSchema () {
      this.addDia = true
    addSchema() {
      this.addDia = true;
    },
    // 提交架构
    addStandardTree () {
      if (this.addOb.nickName == null || this.addOb.factory == '') {
        this.$message.error('构架名称是必填项')
        return
    addStandardTree() {
      if (this.addOb.nickName == null || this.addOb.factory == "") {
        this.$message.error("构架名称是必填项");
        return;
      }
      this.addLoad = true
      addDepartment(this.addOb).then(res => {
        if (res.code === 201) {
          this.addLoad = false
          return
        }
        this.$message.success('添加成功')
        this.addDia = false
        this.getList()
        this.addLoad = false
        this.addOb.nickName = ''
      }).catch(e => {
        this.addDia = false
        this.addLoad = false
      })
      this.addLoad = true;
      addDepartment(this.addOb)
        .then((res) => {
          if (res.code === 201) {
            this.addLoad = false;
            return;
          }
          this.$message.success("添加成功");
          this.addDia = false;
          this.getList();
          this.addLoad = false;
          this.addOb.nickName = "";
        })
        .catch((e) => {
          this.addDia = false;
          this.addLoad = false;
        });
    },
    /** 查询部门下拉树结构 */
    getDeptTree() {
      deptTreeSelect().then(response => {
      deptTreeSelect().then((response) => {
        this.deptOptions = response.data;
        this.enabledDeptOptions = this.filterDisabledDept(JSON.parse(JSON.stringify(response.data)));
        this.enabledDeptOptions = this.filterDisabledDept(
          JSON.parse(JSON.stringify(response.data))
        );
      });
    },
    // 过滤禁用的部门
    filterDisabledDept(deptList) {
      return deptList.filter(dept => {
      return deptList.filter((dept) => {
        if (dept.disabled) {
          return false;
        }
@@ -484,13 +749,17 @@
    // 用户状态修改
    handleStatusChange(row) {
      let text = row.status === "0" ? "启用" : "停用";
      this.$modal.confirm('确认要"' + text + '""' + row.nickName + '"用户吗?').then(function() {
        return changeUserStatus(row.userId, row.status);
      }).then(() => {
        this.$modal.msgSuccess(text + "成功");
      }).catch(function() {
        row.status = row.status === "0" ? "1" : "0";
      });
      this.$modal
        .confirm('确认要"' + text + '""' + row.nickName + '"用户吗?')
        .then(function () {
          return changeUserStatus(row.userId, row.status);
        })
        .then(() => {
          this.$modal.msgSuccess(text + "成功");
        })
        .catch(function () {
          row.status = row.status === "0" ? "1" : "0";
        });
    },
    // 取消按钮
    cancel() {
@@ -510,8 +779,8 @@
        email: undefined,
        sex: undefined,
        status: "0",
        company: '',
        roleIds: []
        company: "",
        roleIds: [],
      };
      this.resetForm("form");
    },
@@ -530,7 +799,7 @@
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.userId);
      this.ids = selection.map((item) => item.userId);
      this.single = selection.length != 1;
      this.multiple = !selection.length;
    },
@@ -551,23 +820,28 @@
    openthirdParty() {
      this.addthirdParty = true;
      this.thirdPartyLoading = true;
      selectCompaniesList().then(res => {
        this.companiesList = this.HaveJson(res.data);
        if(this.companiesList.length ==1){
          selectSimpleList({companyId: this.companiesList[0].companyId}).then(res => {
      selectCompaniesList()
        .then((res) => {
          this.companiesList = this.HaveJson(res.data);
          if (this.companiesList.length == 1) {
            selectSimpleList({
              companyId: this.companiesList[0].companyId,
            }).then((res) => {
              this.thirdPartyLoading = false;
              this.personListCopy = JSON.parse(JSON.stringify(res.data));
              this.personList = res.data;
              this.$refs.personTable.doLayout();
            });
          } else {
            this.thirdPartyLoading = false;
            this.personListCopy = JSON.parse(JSON.stringify(res.data))
            this.personList = res.data
            this.$refs.personTable.doLayout()
          })
        }else{
          }
          this.datathirdParty = this.tranListToTreeData(res.data, "ROOT");
        })
        .catch(() => {
          this.thirdPartyLoading = false;
        }
        this.datathirdParty = this.tranListToTreeData(res.data, "ROOT");
      }).catch(() => {
        this.thirdPartyLoading = false;
      })
      if(this.componentData.entity.roleId > 10000)this.$message.warning('由于未选中具体角色,新增用户将成为默认角色')
        });
      if (this.componentData.entity.roleId > 10000)
        this.$message.warning("由于未选中具体角色,新增用户将成为默认角色");
    },
    tranListToTreeData(list, rootValue) {
      const arr = [];
@@ -583,47 +857,50 @@
      return arr;
    },
    searchPerson() {
      let arr = JSON.parse(JSON.stringify(this.personListCopy))
      this.personList = arr.filter(a => {
        if (a.employeeID.includes(this.userSearch2) || a.nickName.includes(this.userSearch2)) {
          return true
      let arr = JSON.parse(JSON.stringify(this.personListCopy));
      this.personList = arr.filter((a) => {
        if (
          a.employeeID.includes(this.userSearch2) ||
          a.nickName.includes(this.userSearch2)
        ) {
          return true;
        }
      })
      });
    },
    searchFilter2() {
      this.$refs.tree2.filter(this.search2)
      this.$refs.tree2.filter(this.search2);
    },
    nodeClick2(ob, node, el) {
      this.getNodeParent(node)
      if (ob.companyId !== 'SC21') {
        this.personLoad = true
        selectSimpleList({companyId: ob.companyId}).then(res => {
          this.personListCopy = JSON.parse(JSON.stringify(res.data))
          this.personList = res.data
          this.personLoad = false
          this.$refs.personTable.doLayout()
        })
      this.getNodeParent(node);
      if (ob.companyId !== "SC21") {
        this.personLoad = true;
        selectSimpleList({ companyId: ob.companyId }).then((res) => {
          this.personListCopy = JSON.parse(JSON.stringify(res.data));
          this.personList = res.data;
          this.personLoad = false;
          this.$refs.personTable.doLayout();
        });
      }
    },
    getNodeParent(val) {
      this.currentCompaniesList[val.level - 1] = val.data.companyId
      this.currentCompaniesList[val.level - 1] = val.data.companyId;
      if (val.parent != null) {
        this.getNodeParent(val.parent)
        this.getNodeParent(val.parent);
      }
    },
    nodeOpen0(data, node, el) {
      this.currentCompaniesList[node.level - nodeOpen01] = data.id
      this.currentCompaniesList[node.level - nodeOpen01] = data.id;
    },
    filterNode2(value, data) {
      if (!value) return true;
      return data['companyName'].indexOf(value) !== -1;
      return data["companyName"].indexOf(value) !== -1;
    },
    addUser2() {
      if (this.multipleSelection.length === 0) {
        return this.$message.error('请选择人员')
        return this.$message.error("请选择人员");
      }
      if (this.currentCompaniesList.length === 0) {
        return this.$message.error('请选择组织')
        return this.$message.error("请选择组织");
      }
      /* for (let index = this.currentCompaniesList.length-1; index >1; index--) {
        let obj = this.multipleSelection.find(a=>a.companyId==this.currentCompaniesList[index])
@@ -631,39 +908,41 @@
          this.currentCompaniesList.splice(index,1)
        }
      } */
      let arr = []
      this.currentCompaniesList.forEach(b => {
        let obj = this.companiesList.find(a => a.companyId == b)
        arr.push(obj)
      })
      this.addLoad = true
      let arr = [];
      this.currentCompaniesList.forEach((b) => {
        let obj = this.companiesList.find((a) => a.companyId == b);
        arr.push(obj);
      });
      this.addLoad = true;
      addPersonUser({
        company: arr,
        person: this.multipleSelection,
        roleId: this.componentData.entity.roleId
      }).then(res => {
        if (res.code === 201) {
          this.addLoad = false
          return
        }
        this.$message.success('操作成功')
        this.multipleSelection = []
        this.$refs.personTable.clearSelection()
        this.addLoad = false
        this.userSearch2 = ''
        this.getList()
      }).catch(e => {
        this.addLoad = false
        roleId: this.componentData.entity.roleId,
      })
        .then((res) => {
          if (res.code === 201) {
            this.addLoad = false;
            return;
          }
          this.$message.success("操作成功");
          this.multipleSelection = [];
          this.$refs.personTable.clearSelection();
          this.addLoad = false;
          this.userSearch2 = "";
          this.getList();
        })
        .catch((e) => {
          this.addLoad = false;
        });
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      selectCustomEnum().then(res => {
      selectCustomEnum().then((res) => {
        this.postOptions = res.data;
      })
      getUser().then(response => {
      });
      getUser().then((response) => {
        this.roleOptions = response.roles;
        this.title = "添加用户";
      });
@@ -671,11 +950,11 @@
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      selectCustomEnum().then(res => {
      selectCustomEnum().then((res) => {
        this.postOptions = res.data;
      })
      });
      const userId = row.userId || this.ids;
      getUser(userId).then(response => {
      getUser(userId).then((response) => {
        this.form = response.data;
        this.roleOptions = response.roles;
        this.$set(this.form, "roleIds", response.roleIds);
@@ -693,32 +972,34 @@
        inputErrorMessage: "用户密码长度必须介于 5 和 20 之间",
        inputValidator: (value) => {
          if (/<|>|"|'|\||\\/.test(value)) {
            return "不能包含非法字符:< > \" ' \\\ |"
            return "不能包含非法字符:< > \" ' \\\ |";
          }
        },
      }).then(({ value }) => {
          resetUserPwd(row.userId, value).then(response => {
      })
        .then(({ value }) => {
          resetUserPwd(row.userId, value).then((response) => {
            this.$modal.msgSuccess("修改成功,新密码是:" + value);
          });
        }).catch(() => {});
        })
        .catch(() => {});
    },
    /** 分配角色操作 */
    handleAuthRole: function(row) {
    handleAuthRole: function (row) {
      const userId = row.userId;
      this.$router.push("/system/user-auth/role/" + userId);
    },
    /** 提交按钮 */
    submitForm: function() {
      this.$refs["form"].validate(valid => {
    submitForm: function () {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.userId != undefined) {
            updateUser(this.form).then(response => {
            updateUser(this.form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addUser(this.form).then(response => {
            addUser(this.form).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
@@ -730,17 +1011,24 @@
    /** 删除按钮操作 */
    handleDelete(row) {
      const userIds = row.userId || this.ids;
      this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
        return delUser(userIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
      this.$modal
        .confirm('是否确认删除用户编号为"' + userIds + '"的数据项?')
        .then(function () {
          return delUser(userIds);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    /** 下载模板操作 */
    importTemplate() {
      this.download('system/user/importTemplate', {
      }, `user_template_${new Date().getTime()}.xlsx`)
      this.download(
        "system/user/importTemplate",
        {},
        `user_template_${new Date().getTime()}.xlsx`
      );
    },
    // 文件上传中处理
    handleFileUploadProgress(event, file, fileList) {
@@ -751,7 +1039,13 @@
      this.upload.open = false;
      this.upload.isUploading = false;
      this.$refs.upload.clearFiles();
      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
      this.$alert(
        "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
          response.msg +
          "</div>",
        "导入结果",
        { dangerouslyUseHTMLString: true }
      );
      this.getList();
    },
    // 提交上传文件
@@ -785,10 +1079,14 @@
        // 获取光标所在位置
        let length = quill.getSelection().index;
        // 插入图片  res.url为服务器返回的图片地址
        quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.fileName);
        quill.insertEmbed(
          length,
          "image",
          process.env.VUE_APP_BASE_API + res.fileName
        );
        // 调整光标到最后
        quill.setSelection(length + 1);
        this.signatureUrl = res.data.url
        this.signatureUrl = res.data.url;
      } else {
        this.$message.error("图片插入失败");
      }
@@ -823,10 +1121,14 @@
        // 获取光标所在位置
        let length = quill.getSelection().index;
        // 插入图片  res.url为服务器返回的图片地址
        quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.fileName);
        quill.insertEmbed(
          length,
          "image",
          process.env.VUE_APP_BASE_API + res.fileName
        );
        // 调整光标到最后
        quill.setSelection(length + 1);
        this.pictureUrl = res.data.url
        this.pictureUrl = res.data.url;
      } else {
        this.$message.error("图片插入失败");
      }
@@ -834,7 +1136,7 @@
    handleUploadError1() {
      this.$message.error("图片插入失败");
    },
  }
  },
};
</script>
@@ -854,7 +1156,7 @@
  overflow: hidden;
}
.avatar-uploader ::v-deep .el-upload:hover {
  border-color: #409EFF;
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 20px;
vue.config.js
@@ -36,7 +36,8 @@
    proxy: {
      // detail: https://cli.vuejs.org/config/#devserver-proxy
      [process.env.VUE_APP_BASE_API]: {
        target: `http://192.168.0.104:8002`,
        // target: `http://192.168.0.104:8002`,
        target: `http://127.0.0.1:8002`,
        changeOrigin: true,
        pathRewrite: {
          ["^" + process.env.VUE_APP_BASE_API]: "",