Browse Source

新增erp部门 公司 人员

hurx 1 tuần trước cách đây
mục cha
commit
79293b5442

+ 63 - 0
src/api/erpData/erpCompany/index.ts

@@ -0,0 +1,63 @@
+import request from '@/utils/request';
+import { AxiosPromise } from 'axios';
+import { ErpCompanyVO, ErpCompanyForm, ErpCompanyQuery } from '@/api/erpData/erpCompany/types';
+
+/**
+ * 查询erp公司信息列表
+ * @param query
+ * @returns {*}
+ */
+
+export const listErpCompany = (query?: ErpCompanyQuery): AxiosPromise<ErpCompanyVO[]> => {
+  return request({
+    url: '/system/erpCompany/list',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 查询erp公司信息详细
+ * @param id
+ */
+export const getErpCompany = (id: string | number): AxiosPromise<ErpCompanyVO> => {
+  return request({
+    url: '/system/erpCompany/' + id,
+    method: 'get'
+  });
+};
+
+/**
+ * 新增erp公司信息
+ * @param data
+ */
+export const addErpCompany = (data: ErpCompanyForm) => {
+  return request({
+    url: '/system/erpCompany',
+    method: 'post',
+    data: data
+  });
+};
+
+/**
+ * 修改erp公司信息
+ * @param data
+ */
+export const updateErpCompany = (data: ErpCompanyForm) => {
+  return request({
+    url: '/system/erpCompany',
+    method: 'put',
+    data: data
+  });
+};
+
+/**
+ * 删除erp公司信息
+ * @param id
+ */
+export const delErpCompany = (id: string | number | Array<string | number>) => {
+  return request({
+    url: '/system/erpCompany/' + id,
+    method: 'delete'
+  });
+};

+ 410 - 0
src/api/erpData/erpCompany/types.ts

@@ -0,0 +1,410 @@
+export interface ErpCompanyVO {
+  /**
+   * 主键ID
+   */
+  id: string | number;
+
+  /**
+   * 会计主体ID
+   */
+  accBnId: string | number;
+
+  /**
+   * 会计主体编号
+   */
+  accBnNo: string;
+
+  /**
+   * 公司地址
+   */
+  address: string;
+
+  /**
+   * 开始日期
+   */
+  begDate: string;
+
+  /**
+   * 经营范围
+   */
+  busScp: string;
+
+  /**
+   * 注册资本金额
+   */
+  capAmt: number;
+
+  /**
+   * 公司全名
+   */
+  companyFullName: string;
+
+  /**
+   * 法人代表
+   */
+  corporation: string;
+
+  /**
+   * 电子邮箱
+   */
+  email: string;
+
+  /**
+   * 结束日期
+   */
+  endDate: string;
+
+  /**
+   * 成立日期
+   */
+  foundDate: string;
+
+  /**
+   * 内部客户ID
+   */
+  inCustId: string | number;
+
+  /**
+   * 内部供应商ID
+   */
+  inSupId: string | number;
+
+  /**
+   * 法律代表人
+   */
+  lelPer: string;
+
+  /**
+   * 联系电话
+   */
+  phone: string;
+
+  /**
+   * 负责人/经办人
+   */
+  principal: string;
+
+  /**
+   * 注册地址
+   */
+  regAddr: string;
+
+  /**
+   * 注册日期
+   */
+  regDate: string;
+
+  /**
+   * 注册机关
+   */
+  regOrg: string;
+
+  /**
+   * 税务登记号
+   */
+  taxNo: string;
+
+  /**
+   * 公司编号
+   */
+  companyCode: string;
+
+  /**
+   * 公司名称
+   */
+  companyName: string;
+
+  /**
+   * 是否显示(0-是,1-否)
+   */
+  isShow: string;
+
+  /**
+   * 数据来源
+   */
+  dataSource: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status: string;
+
+  /**
+   * 备注
+   */
+  remark: string;
+}
+
+export interface ErpCompanyForm extends BaseEntity {
+  /**
+   * 主键ID
+   */
+  id?: string | number;
+
+  /**
+   * 会计主体ID
+   */
+  accBnId?: string | number;
+
+  /**
+   * 会计主体编号
+   */
+  accBnNo?: string;
+
+  /**
+   * 公司地址
+   */
+  address?: string;
+
+  /**
+   * 开始日期
+   */
+  begDate?: string;
+
+  /**
+   * 经营范围
+   */
+  busScp?: string;
+
+  /**
+   * 注册资本金额
+   */
+  capAmt?: number;
+
+  /**
+   * 公司全名
+   */
+  companyFullName?: string;
+
+  /**
+   * 法人代表
+   */
+  corporation?: string;
+
+  /**
+   * 电子邮箱
+   */
+  email?: string;
+
+  /**
+   * 结束日期
+   */
+  endDate?: string;
+
+  /**
+   * 成立日期
+   */
+  foundDate?: string;
+
+  /**
+   * 内部客户ID
+   */
+  inCustId?: string | number;
+
+  /**
+   * 内部供应商ID
+   */
+  inSupId?: string | number;
+
+  /**
+   * 法律代表人
+   */
+  lelPer?: string;
+
+  /**
+   * 联系电话
+   */
+  phone?: string;
+
+  /**
+   * 负责人/经办人
+   */
+  principal?: string;
+
+  /**
+   * 注册地址
+   */
+  regAddr?: string;
+
+  /**
+   * 注册日期
+   */
+  regDate?: string;
+
+  /**
+   * 注册机关
+   */
+  regOrg?: string;
+
+  /**
+   * 税务登记号
+   */
+  taxNo?: string;
+
+  /**
+   * 公司编号
+   */
+  companyCode?: string;
+
+  /**
+   * 公司名称
+   */
+  companyName?: string;
+
+  /**
+   * 是否显示(0-是,1-否)
+   */
+  isShow?: string;
+
+  /**
+   * 数据来源
+   */
+  dataSource?: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status?: string;
+
+  /**
+   * 备注
+   */
+  remark?: string;
+}
+
+export interface ErpCompanyQuery extends PageQuery {
+  /**
+   * 会计主体ID
+   */
+  accBnId?: string | number;
+
+  /**
+   * 会计主体编号
+   */
+  accBnNo?: string;
+
+  /**
+   * 公司地址
+   */
+  address?: string;
+
+  /**
+   * 开始日期
+   */
+  begDate?: string;
+
+  /**
+   * 经营范围
+   */
+  busScp?: string;
+
+  /**
+   * 注册资本金额
+   */
+  capAmt?: number;
+
+  /**
+   * 公司全名
+   */
+  companyFullName?: string;
+
+  /**
+   * 法人代表
+   */
+  corporation?: string;
+
+  /**
+   * 电子邮箱
+   */
+  email?: string;
+
+  /**
+   * 结束日期
+   */
+  endDate?: string;
+
+  /**
+   * 成立日期
+   */
+  foundDate?: string;
+
+  /**
+   * 内部客户ID
+   */
+  inCustId?: string | number;
+
+  /**
+   * 内部供应商ID
+   */
+  inSupId?: string | number;
+
+  /**
+   * 法律代表人
+   */
+  lelPer?: string;
+
+  /**
+   * 联系电话
+   */
+  phone?: string;
+
+  /**
+   * 负责人/经办人
+   */
+  principal?: string;
+
+  /**
+   * 注册地址
+   */
+  regAddr?: string;
+
+  /**
+   * 注册日期
+   */
+  regDate?: string;
+
+  /**
+   * 注册机关
+   */
+  regOrg?: string;
+
+  /**
+   * 税务登记号
+   */
+  taxNo?: string;
+
+  /**
+   * 公司编号
+   */
+  companyCode?: string;
+
+  /**
+   * 公司名称
+   */
+  companyName?: string;
+
+  /**
+   * 是否显示(0-是,1-否)
+   */
+  isShow?: string;
+
+  /**
+   * 数据来源
+   */
+  dataSource?: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status?: string;
+
+  /**
+   * 平台标识
+   */
+  platformCode?: string;
+
+  /**
+   * 日期范围参数
+   */
+  params?: any;
+}

+ 71 - 0
src/api/erpData/erpDept/index.ts

@@ -0,0 +1,71 @@
+import request from '@/utils/request';
+import { AxiosPromise } from 'axios';
+import { ErpDeptVO, ErpDeptForm, ErpDeptQuery } from '@/api/erpData/erpDept/types';
+
+/**
+ * 查询erp部门列表
+ * @param query
+ * @returns {*}
+ */
+
+export const listErpDept = (query?: ErpDeptQuery): AxiosPromise<ErpDeptVO[]> => {
+  return request({
+    url: '/system/erpDept/list',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 查询erp部门详细
+ * @param deptId
+ */
+export const getErpDept = (deptId: string | number): AxiosPromise<ErpDeptVO> => {
+  return request({
+    url: '/system/erpDept/' + deptId,
+    method: 'get'
+  });
+};
+
+// 查询部门列表(排除节点)
+export const listErpDeptExcludeChild = (deptId: string | number): AxiosPromise<ErpDeptVO[]> => {
+  return request({
+    url: '/system/erpDept/list/exclude/' + deptId,
+    method: 'get'
+  });
+};
+
+/**
+ * 新增erp部门
+ * @param data
+ */
+export const addErpDept = (data: ErpDeptForm) => {
+  return request({
+    url: '/system/erpDept',
+    method: 'post',
+    data: data
+  });
+};
+
+/**
+ * 修改erp部门
+ * @param data
+ */
+export const updateErpDept = (data: ErpDeptForm) => {
+  return request({
+    url: '/system/erpDept',
+    method: 'put',
+    data: data
+  });
+};
+
+/**
+ * 删除erp部门
+ * @param deptId
+ */
+export const delErpDept = (deptId: string | number | Array<string | number>) => {
+  return request({
+    url: '/system/erpDept/' + deptId,
+    method: 'delete'
+  });
+};

+ 295 - 0
src/api/erpData/erpDept/types.ts

@@ -0,0 +1,295 @@
+export interface ErpDeptVO {
+  /**
+   * 部门id
+   */
+  deptId: string | number;
+
+  /**
+   * 部门编号
+   */
+  deptNo: string;
+
+  /**
+   * 父部门id
+   */
+  parentId: string | number;
+
+  /**
+   * 公司id
+   */
+  companyId: string | number;
+
+  /**
+   * 祖级列表
+   */
+  ancestors: string;
+
+  /**
+   * 部门名称
+   */
+  deptName: string;
+
+  /**
+   * 部门类别编码
+   */
+  deptCategory: string;
+
+  /**
+   * 显示顺序
+   */
+  orderNum: number;
+
+  /**
+   * 负责人
+   */
+  leader: number;
+
+  /**
+   * 联系电话
+   */
+  phone: string;
+
+  /**
+   * 邮箱
+   */
+  email: string;
+
+  /**
+   * 部门状态(0正常 1停用)
+   */
+  status: string;
+
+  /**
+   * 是否是公司(0是  1否)
+   */
+  isCompanyFlag: string;
+
+  /**
+   * 部门经理id
+   */
+  managerId: string | number;
+
+  /**
+   * 部门主管id
+   */
+  chargeId: string | number;
+
+  /**
+   * 部门经理编号
+   */
+  managerNo: string;
+
+  /**
+   * 部门主管编号
+   */
+  chargeNo: string;
+
+  /**
+   * 部门经理
+   */
+  managerName: string;
+
+  /**
+   * 部门主管
+   */
+  chargeName: string;
+}
+
+export interface ErpDeptForm extends BaseEntity {
+  /**
+   * 部门id
+   */
+  deptId?: string | number;
+
+  /**
+   * 部门编号
+   */
+  deptNo?: string;
+
+  /**
+   * 父部门id
+   */
+  parentId?: string | number;
+
+  /**
+   * 公司id
+   */
+  companyId?: string | number;
+
+  /**
+   * 祖级列表
+   */
+  ancestors?: string;
+
+  /**
+   * 部门名称
+   */
+  deptName?: string;
+
+  /**
+   * 部门类别编码
+   */
+  deptCategory?: string;
+
+  /**
+   * 显示顺序
+   */
+  orderNum?: number;
+
+  /**
+   * 负责人
+   */
+  leader?: number;
+
+  /**
+   * 联系电话
+   */
+  phone?: string;
+
+  /**
+   * 邮箱
+   */
+  email?: string;
+
+  /**
+   * 部门状态(0正常 1停用)
+   */
+  status?: string;
+
+  /**
+   * 是否是公司(0是  1否)
+   */
+  isCompanyFlag?: string;
+
+  /**
+   * 部门经理id
+   */
+  managerId?: string | number;
+
+  /**
+   * 部门主管id
+   */
+  chargeId?: string | number;
+
+  /**
+   * 部门经理编号
+   */
+  managerNo?: string;
+
+  /**
+   * 部门主管编号
+   */
+  chargeNo?: string;
+
+  /**
+   * 部门经理
+   */
+  managerName?: string;
+
+  /**
+   * 部门主管
+   */
+  chargeName?: string;
+}
+
+export interface ErpDeptQuery extends PageQuery {
+  /**
+   * 部门编号
+   */
+  deptNo?: string;
+
+  /**
+   * 父部门id
+   */
+  parentId?: string | number;
+
+  /**
+   * 公司id
+   */
+  companyId?: string | number;
+
+  /**
+   * 祖级列表
+   */
+  ancestors?: string;
+
+  /**
+   * 部门名称
+   */
+  deptName?: string;
+
+  /**
+   * 部门类别编码
+   */
+  deptCategory?: string;
+
+  /**
+   * 显示顺序
+   */
+  orderNum?: number;
+
+  /**
+   * 负责人
+   */
+  leader?: number;
+
+  /**
+   * 联系电话
+   */
+  phone?: string;
+
+  /**
+   * 邮箱
+   */
+  email?: string;
+
+  /**
+   * 部门状态(0正常 1停用)
+   */
+  status?: string;
+
+  /**
+   * 平台标识
+   */
+  platformCode?: string;
+
+  /**
+   * 是否是公司(0是  1否)
+   */
+  isCompanyFlag?: string;
+
+  /**
+   * 部门经理id
+   */
+  managerId?: string | number;
+
+  /**
+   * 部门主管id
+   */
+  chargeId?: string | number;
+
+  /**
+   * 部门经理编号
+   */
+  managerNo?: string;
+
+  /**
+   * 部门主管编号
+   */
+  chargeNo?: string;
+
+  /**
+   * 部门经理
+   */
+  managerName?: string;
+
+  /**
+   * 部门主管
+   */
+  chargeName?: string;
+
+  /**
+   * 日期范围参数
+   */
+  params?: any;
+}

+ 63 - 0
src/api/erpData/erpStaff/index.ts

@@ -0,0 +1,63 @@
+import request from '@/utils/request';
+import { AxiosPromise } from 'axios';
+import { ErpStaffVO, ErpStaffForm, ErpStaffQuery } from '@/api/erpData/erpStaff/types';
+
+/**
+ * 查询erp人员信息列表
+ * @param query
+ * @returns {*}
+ */
+
+export const listErpStaff = (query?: ErpStaffQuery): AxiosPromise<ErpStaffVO[]> => {
+  return request({
+    url: '/system/erpStaff/list',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 查询erp人员信息详细
+ * @param staffId
+ */
+export const getErpStaff = (staffId: string | number): AxiosPromise<ErpStaffVO> => {
+  return request({
+    url: '/system/erpStaff/' + staffId,
+    method: 'get'
+  });
+};
+
+/**
+ * 新增erp人员信息
+ * @param data
+ */
+export const addErpStaff = (data: ErpStaffForm) => {
+  return request({
+    url: '/system/erpStaff',
+    method: 'post',
+    data: data
+  });
+};
+
+/**
+ * 修改erp人员信息
+ * @param data
+ */
+export const updateErpStaff = (data: ErpStaffForm) => {
+  return request({
+    url: '/system/erpStaff',
+    method: 'put',
+    data: data
+  });
+};
+
+/**
+ * 删除erp人员信息
+ * @param staffId
+ */
+export const delErpStaff = (staffId: string | number | Array<string | number>) => {
+  return request({
+    url: '/system/erpStaff/' + staffId,
+    method: 'delete'
+  });
+};

+ 215 - 0
src/api/erpData/erpStaff/types.ts

@@ -0,0 +1,215 @@
+export interface ErpStaffVO {
+  /**
+   * 人员ID
+   */
+  staffId: string | number;
+
+  /**
+   * 人员编码
+   */
+  staffCode: string;
+
+  /**
+   * 姓名
+   */
+  staffName: string;
+
+  /**
+   * 所属部门编码
+   */
+  deptId: string | number;
+
+  /**
+   * 联系电话
+   */
+  phone: string;
+
+  /**
+   * 岗位编码
+   */
+  postId: string | number;
+
+  /**
+   * 性别
+   */
+  sex: string;
+
+  /**
+   * 角色编码
+   */
+  roleId: string | number;
+
+  /**
+   * 数据来源
+   */
+  dataSource: string;
+
+  /**
+   * 密码
+   */
+  password: string;
+
+  /**
+   * 有效期起始
+   */
+  validFrom: string | number;
+
+  /**
+   * 有效期截止
+   */
+  validTo: string | number;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status: string;
+
+  /**
+   * 备注
+   */
+  remark: string;
+}
+
+export interface ErpStaffForm extends BaseEntity {
+  /**
+   * 人员ID
+   */
+  staffId?: string | number;
+
+  /**
+   * 人员编码
+   */
+  staffCode?: string;
+
+  /**
+   * 姓名
+   */
+  staffName?: string;
+
+  /**
+   * 所属部门编码
+   */
+  deptId?: string | number;
+
+  /**
+   * 联系电话
+   */
+  phone?: string;
+
+  /**
+   * 岗位编码
+   */
+  postId?: string | number;
+
+  /**
+   * 性别
+   */
+  sex?: string;
+
+  /**
+   * 角色编码
+   */
+  roleId?: string | number;
+
+  /**
+   * 数据来源
+   */
+  dataSource?: string;
+
+  /**
+   * 密码
+   */
+  password?: string;
+
+  /**
+   * 有效期起始
+   */
+  validFrom?: string | number;
+
+  /**
+   * 有效期截止
+   */
+  validTo?: string | number;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status?: string;
+
+  /**
+   * 备注
+   */
+  remark?: string;
+}
+
+export interface ErpStaffQuery extends PageQuery {
+  /**
+   * 人员编码
+   */
+  staffCode?: string;
+
+  /**
+   * 姓名
+   */
+  staffName?: string;
+
+  /**
+   * 所属部门编码
+   */
+  deptId?: string | number;
+
+  /**
+   * 联系电话
+   */
+  phone?: string;
+
+  /**
+   * 岗位编码
+   */
+  postId?: string | number;
+
+  /**
+   * 性别
+   */
+  sex?: string;
+
+  /**
+   * 角色编码
+   */
+  roleId?: string | number;
+
+  /**
+   * 数据来源
+   */
+  dataSource?: string;
+
+  /**
+   * 密码
+   */
+  password?: string;
+
+  /**
+   * 有效期起始
+   */
+  validFrom?: string | number;
+
+  /**
+   * 有效期截止
+   */
+  validTo?: string | number;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status?: string;
+
+  /**
+   * 平台标识
+   */
+  platformCode?: string;
+
+  /**
+   * 日期范围参数
+   */
+  params?: any;
+}

+ 247 - 0
src/views/erpData/erpCompany/index.vue

@@ -0,0 +1,247 @@
+<template>
+  <div class="p-2">
+    <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
+      <div v-show="showSearch" class="mb-[10px]">
+        <el-card shadow="hover">
+          <el-form ref="queryFormRef" :model="queryParams" :inline="true">
+            <el-form-item label="公司编码" prop="companyCode">
+              <el-input v-model="queryParams.companyCode" placeholder="请输入公司编码" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="公司名称" prop="companyName">
+              <el-input v-model="queryParams.companyName" placeholder="请输入公司名称" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+              <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+            </el-form-item>
+          </el-form>
+        </el-card>
+      </div>
+    </transition>
+    <el-card shadow="never">
+      <template #header>
+        <el-row :gutter="10" class="mb8">
+          <el-col :span="22"><span>ERP公司信息列表</span> </el-col>
+          <el-col :span="1.5">
+            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:company:add']">新增</el-button>
+          </el-col>
+        </el-row>
+      </template>
+      <el-table v-loading="loading" border :data="erpCompanyList" @selection-change="handleSelectionChange">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="编号" align="center" prop="companyCode" />
+        <el-table-column label="企业名称" align="left" prop="companyName" min-width="180" />
+        <el-table-column label="成立日期" align="center" prop="foundDate" width="180">
+          <template #default="scope">
+            <span>{{ parseTime(scope.row.foundDate, '{y}-{m}-{d}') }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="法人代表" align="center" prop="corporation" />
+        <el-table-column label="办公电话" align="center" prop="phone" />
+        <el-table-column label="公司地址" align="center" prop="address" />
+        <el-table-column label="状态" align="center" prop="isShow">
+          <template #default="scope">
+            <el-switch v-model="scope.row.isShow" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
+          </template>
+        </el-table-column>
+        <!-- <el-table-column label="数据来源" align="center" prop="dataSource" /> -->
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+          <template #default="scope">
+            <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:company:edit']">编辑</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
+    </el-card>
+  </div>
+</template>
+
+<script setup name="ErpCompany" lang="ts">
+import { listErpCompany, getErpCompany, delErpCompany, addErpCompany, updateErpCompany } from '@/api/erpData/erpCompany';
+import { ErpCompanyVO, ErpCompanyQuery, ErpCompanyForm } from '@/api/erpData/erpCompany/types';
+
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { sys_platform_yes_no } = toRefs<any>(proxy?.useDict('sys_platform_yes_no'));
+
+const erpCompanyList = ref<ErpCompanyVO[]>([]);
+const buttonLoading = ref(false);
+const loading = ref(true);
+const showSearch = ref(true);
+const ids = ref<Array<string | number>>([]);
+const single = ref(true);
+const multiple = ref(true);
+const total = ref(0);
+
+const queryFormRef = ref<ElFormInstance>();
+const erpCompanyFormRef = ref<ElFormInstance>();
+
+const dialog = reactive<DialogOption>({
+  visible: false,
+  title: ''
+});
+
+const initFormData: ErpCompanyForm = {
+  id: undefined,
+  accBnId: undefined,
+  accBnNo: undefined,
+  address: undefined,
+  begDate: undefined,
+  busScp: undefined,
+  capAmt: undefined,
+  companyFullName: undefined,
+  corporation: undefined,
+  email: undefined,
+  endDate: undefined,
+  foundDate: undefined,
+  inCustId: undefined,
+  inSupId: undefined,
+  lelPer: undefined,
+  phone: undefined,
+  principal: undefined,
+  regAddr: undefined,
+  regDate: undefined,
+  regOrg: undefined,
+  taxNo: undefined,
+  companyCode: undefined,
+  companyName: undefined,
+  isShow: undefined,
+  dataSource: undefined,
+  status: undefined,
+  remark: undefined
+};
+const data = reactive<PageData<ErpCompanyForm, ErpCompanyQuery>>({
+  form: { ...initFormData },
+  queryParams: {
+    pageNum: 1,
+    pageSize: 10,
+    accBnId: undefined,
+    accBnNo: undefined,
+    address: undefined,
+    begDate: undefined,
+    busScp: undefined,
+    capAmt: undefined,
+    companyFullName: undefined,
+    corporation: undefined,
+    email: undefined,
+    endDate: undefined,
+    foundDate: undefined,
+    inCustId: undefined,
+    inSupId: undefined,
+    lelPer: undefined,
+    phone: undefined,
+    principal: undefined,
+    regAddr: undefined,
+    regDate: undefined,
+    regOrg: undefined,
+    taxNo: undefined,
+    companyCode: undefined,
+    companyName: undefined,
+    isShow: undefined,
+    dataSource: undefined,
+    status: undefined,
+    platformCode: undefined,
+    params: {}
+  },
+  rules: {}
+});
+
+const { queryParams, form, rules } = toRefs(data);
+
+/** 查询erp公司信息列表 */
+const getList = async () => {
+  loading.value = true;
+  const res = await listErpCompany(queryParams.value);
+  erpCompanyList.value = res.rows;
+  total.value = res.total;
+  loading.value = false;
+};
+
+/** 取消按钮 */
+const cancel = () => {
+  reset();
+  dialog.visible = false;
+};
+
+/** 表单重置 */
+const reset = () => {
+  form.value = { ...initFormData };
+  erpCompanyFormRef.value?.resetFields();
+};
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.value.pageNum = 1;
+  getList();
+};
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value?.resetFields();
+  handleQuery();
+};
+
+/** 多选框选中数据 */
+const handleSelectionChange = (selection: ErpCompanyVO[]) => {
+  ids.value = selection.map((item) => item.id);
+  single.value = selection.length != 1;
+  multiple.value = !selection.length;
+};
+
+/** 新增按钮操作 */
+const handleAdd = () => {
+  reset();
+  dialog.visible = true;
+  dialog.title = '添加erp公司信息';
+};
+
+/** 修改按钮操作 */
+const handleUpdate = async (row?: ErpCompanyVO) => {
+  reset();
+  const _id = row?.id || ids.value[0];
+  const res = await getErpCompany(_id);
+  Object.assign(form.value, res.data);
+  dialog.visible = true;
+  dialog.title = '修改erp公司信息';
+};
+
+/** 提交按钮 */
+const submitForm = () => {
+  erpCompanyFormRef.value?.validate(async (valid: boolean) => {
+    if (valid) {
+      buttonLoading.value = true;
+      if (form.value.id) {
+        await updateErpCompany(form.value).finally(() => (buttonLoading.value = false));
+      } else {
+        await addErpCompany(form.value).finally(() => (buttonLoading.value = false));
+      }
+      proxy?.$modal.msgSuccess('操作成功');
+      dialog.visible = false;
+      await getList();
+    }
+  });
+};
+
+/** 删除按钮操作 */
+const handleDelete = async (row?: ErpCompanyVO) => {
+  const _ids = row?.id || ids.value;
+  await proxy?.$modal.confirm('是否确认删除erp公司信息编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
+  await delErpCompany(_ids);
+  proxy?.$modal.msgSuccess('删除成功');
+  await getList();
+};
+
+/** 导出按钮操作 */
+const handleExport = () => {
+  proxy?.download(
+    'system/erpCompany/export',
+    {
+      ...queryParams.value
+    },
+    `erpCompany_${new Date().getTime()}.xlsx`
+  );
+};
+
+onMounted(() => {
+  getList();
+});
+</script>

+ 344 - 0
src/views/erpData/erpDept/index.vue

@@ -0,0 +1,344 @@
+<template>
+  <div class="p-2">
+    <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
+      <div v-show="showSearch" class="mb-[10px]">
+        <el-card shadow="hover">
+          <el-form ref="queryFormRef" :model="queryParams" :inline="true">
+            <el-form-item label="部门名称" prop="deptName">
+              <el-input v-model="queryParams.deptName" placeholder="请输入部门名称" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="类别编码" prop="deptCategory">
+              <el-input v-model="queryParams.deptCategory" placeholder="请输入类别编码" clearable style="width: 240px" @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="状态" prop="status">
+              <el-select v-model="queryParams.status" placeholder="部门状态" clearable>
+                <el-option v-for="dict in 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="Search" @click="handleQuery">搜索</el-button>
+              <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+            </el-form-item>
+          </el-form>
+        </el-card>
+      </div>
+    </transition>
+
+    <el-card shadow="hover">
+      <template #header>
+        <el-row :gutter="10">
+          <el-col :span="1.5">
+            <el-button v-hasPermi="['system:erpDept:add']" type="primary" plain icon="Plus" @click="handleAdd()">新增 </el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
+          </el-col>
+          <right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
+        </el-row>
+      </template>
+
+      <el-table
+        ref="deptTableRef"
+        v-loading="loading"
+        :data="erpDeptList"
+        row-key="deptId"
+        border
+        :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
+        :default-expand-all="isExpandAll"
+      >
+        <el-table-column prop="deptName" label="部门名称"></el-table-column>
+        <el-table-column prop="deptNo" align="center" label="类别编码"></el-table-column>
+        <el-table-column prop="orderNum" align="center" label="排序"></el-table-column>
+        <el-table-column prop="status" align="center" label="状态" width="100">
+          <template #default="scope">
+            <dict-tag :options="sys_normal_disable" :value="scope.row.status" />
+          </template>
+        </el-table-column>
+        <el-table-column label="创建时间" align="center" prop="createTime" width="200">
+          <template #default="scope">
+            <span>{{ proxy.parseTime(scope.row.createTime) }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column fixed="right" align="center" label="操作">
+          <template #default="scope">
+            <el-button v-hasPermi="['system:erpDept:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)">编辑</el-button>
+            <el-button v-hasPermi="['system:erpDept:add']" link type="primary" icon="Plus" @click="handleAdd(scope.row)">新增</el-button>
+            <el-button v-hasPermi="['system:erpDept:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-card>
+
+    <el-dialog v-model="dialog.visible" :title="dialog.title" destroy-on-close append-to-body width="600px">
+      <el-form ref="erpDeptFormRef" :model="form" :rules="rules" label-width="80px">
+        <el-row>
+          <el-col v-if="form.parentId !== 0" :span="24">
+            <el-form-item label="上级部门" prop="parentId">
+              <el-tree-select
+                v-model="form.parentId"
+                :data="deptOptions"
+                :props="{ value: 'deptId', label: 'deptName', children: 'children' } as any"
+                value-key="deptId"
+                placeholder="选择上级部门"
+                check-strictly
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="部门名称" prop="deptName">
+              <el-input v-model="form.deptName" placeholder="请输入部门名称" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="类别编码" prop="deptNo">
+              <el-input v-model="form.deptNo" placeholder="请输入类别编码" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="显示排序" prop="orderNum">
+              <el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12"> </el-col>
+          <el-col :span="12">
+            <el-form-item label="部门经理" prop="managerId">
+              <el-select v-model="form.managerId" placeholder="请选择部门经理" @change="handleManagerChange" filterable>
+                <el-option v-for="item in staffOptions" :key="item.staffId" :label="`${item.staffCode} , ${item.staffName}`" :value="item.staffId" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="部门主管" prop="chargeId">
+              <el-select v-model="form.chargeId" placeholder="请选择部门主管" @change="handleChargeChange" filterable>
+                <el-option v-for="item in staffOptions" :key="item.staffId" :label="`${item.staffCode} , ${item.staffName}`" :value="item.staffId" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="部门状态">
+              <el-radio-group v-model="form.status">
+                <el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button type="primary" @click="submitForm">确 定</el-button>
+          <el-button @click="cancel">取 消</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup name="ErpDept" lang="ts">
+import { listErpDept, getErpDept, delErpDept, addErpDept, updateErpDept, listErpDeptExcludeChild } from '@/api/erpData/erpDept';
+import { ErpDeptVO, ErpDeptQuery, ErpDeptForm } from '@/api/erpData/erpDept/types';
+import { listComStaff } from '@/api/company/comStaff';
+import { ComStaffVO } from '@/api/company/comStaff/types';
+
+interface DeptOptionsType {
+  deptId: number | string;
+  deptName: string;
+  children: DeptOptionsType[];
+}
+
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable'));
+
+const erpDeptList = ref<ErpDeptVO[]>([]);
+const loading = ref(true);
+const showSearch = ref(true);
+const deptOptions = ref<DeptOptionsType[]>([]);
+const isExpandAll = ref(true);
+const staffOptions = ref<ComStaffVO[]>([]);
+
+const dialog = reactive<DialogOption>({
+  visible: false,
+  title: ''
+});
+
+const deptTableRef = ref<ElTableInstance>();
+const queryFormRef = ref<ElFormInstance>();
+const erpDeptFormRef = ref<ElFormInstance>();
+
+const initFormData: ErpDeptForm = {
+  deptId: undefined,
+  parentId: undefined,
+  deptName: undefined,
+  deptCategory: undefined,
+  deptNo: undefined,
+  orderNum: 0,
+  leader: undefined,
+  phone: undefined,
+  email: undefined,
+  status: '0',
+  managerId: undefined,
+  chargeId: undefined,
+  managerNo: undefined,
+  chargeNo: undefined,
+  managerName: undefined,
+  chargeName: undefined
+};
+
+const initData: PageData<ErpDeptForm, ErpDeptQuery> = {
+  form: { ...initFormData },
+  queryParams: {
+    pageNum: 1,
+    pageSize: 10,
+    deptName: undefined,
+    deptCategory: undefined,
+    status: undefined
+  },
+  rules: {
+    parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
+    deptName: [{ required: true, message: '部门名称不能为空', trigger: 'blur' }],
+    orderNum: [{ required: true, message: '显示排序不能为空', trigger: 'blur' }]
+  }
+};
+
+const data = reactive<PageData<ErpDeptForm, ErpDeptQuery>>(initData);
+const { queryParams, form, rules } = toRefs<PageData<ErpDeptForm, ErpDeptQuery>>(data);
+
+/** 查询菜单列表 */
+const getList = async () => {
+  loading.value = true;
+  const res = await listErpDept(queryParams.value);
+  const data = proxy?.handleTree<ErpDeptVO>(res.data, 'deptId');
+  if (data) {
+    erpDeptList.value = data;
+  }
+  loading.value = false;
+};
+
+/** 取消按钮 */
+const cancel = () => {
+  reset();
+  dialog.visible = false;
+};
+
+/** 表单重置 */
+const reset = () => {
+  form.value = { ...initFormData };
+  erpDeptFormRef.value?.resetFields();
+};
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  getList();
+};
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value?.resetFields();
+  handleQuery();
+};
+
+/** 获取员工列表 */
+const getStaffList = async () => {
+  try {
+    const res = await listComStaff();
+    staffOptions.value = res.rows || [];
+  } catch (error) {
+    console.error('获取列表失败:', error);
+  }
+};
+
+/** 经理变更 */
+const handleManagerChange = (staffId: string | number) => {
+  if (staffId) {
+    const staff = staffOptions.value.find((item) => item.staffId === staffId);
+    if (staff) {
+      form.value.managerName = staff.staffName || '';
+      form.value.managerNo = staff.staffCode || '';
+    }
+  } else {
+    form.value.managerName = '';
+    form.value.managerNo = '';
+  }
+};
+
+/** 主管变更 */
+const handleChargeChange = (staffId: string | number) => {
+  if (staffId) {
+    const staff = staffOptions.value.find((item) => item.staffId === staffId);
+    if (staff) {
+      form.value.chargeName = staff.staffName || '';
+      form.value.chargeNo = staff.staffCode || '';
+    }
+  } else {
+    form.value.chargeName = '';
+    form.value.chargeNo = '';
+  }
+};
+
+/** 展开/折叠操作 */
+const handleToggleExpandAll = () => {
+  isExpandAll.value = !isExpandAll.value;
+  toggleExpandAll(erpDeptList.value, isExpandAll.value);
+};
+
+/** 展开/折叠所有 */
+const toggleExpandAll = (data: any[], status: boolean) => {
+  data.forEach((item) => {
+    deptTableRef.value?.toggleRowExpansion(item, status);
+    if (item.children && item.children.length > 0) toggleExpandAll(item.children, status);
+  });
+};
+
+/** 新增按钮操作 */
+const handleAdd = async (row?: ErpDeptVO) => {
+  reset();
+  const res = await listErpDept();
+  const data = proxy?.handleTree<DeptOptionsType>(res.data, 'deptId');
+  if (data) {
+    deptOptions.value = data;
+    if (row && row.deptId) {
+      form.value.parentId = row?.deptId;
+    }
+  }
+  dialog.visible = true;
+  dialog.title = '添加部门';
+};
+
+/** 修改按钮操作 */
+const handleUpdate = async (row: ErpDeptVO) => {
+  reset();
+  const res = await getErpDept(row.deptId);
+  form.value = res.data;
+  const response = await listErpDeptExcludeChild(row.deptId);
+  const data = proxy?.handleTree<DeptOptionsType>(response.data, 'deptId');
+  if (data) {
+    deptOptions.value = data;
+  }
+  dialog.visible = true;
+  dialog.title = '修改部门';
+};
+
+/** 提交按钮 */
+const submitForm = () => {
+  erpDeptFormRef.value?.validate(async (valid: boolean) => {
+    if (valid) {
+      form.value.deptId ? await updateErpDept(form.value) : await addErpDept(form.value);
+      proxy?.$modal.msgSuccess('操作成功');
+      dialog.visible = false;
+      await getList();
+    }
+  });
+};
+
+/** 删除按钮操作 */
+const handleDelete = async (row: ErpDeptVO) => {
+  await proxy?.$modal.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?');
+  await delErpDept(row.deptId);
+  await getList();
+  proxy?.$modal.msgSuccess('删除成功');
+};
+
+onMounted(() => {
+  getList();
+  getStaffList();
+});
+</script>

+ 345 - 0
src/views/erpData/erpStaff/index.vue

@@ -0,0 +1,345 @@
+<template>
+  <div class="p-2">
+    <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
+      <div v-show="showSearch" class="mb-[10px]">
+        <el-card shadow="hover">
+          <el-form ref="queryFormRef" :model="queryParams" :inline="true">
+            <el-form-item label="姓名" prop="staffName">
+              <el-input v-model="queryParams.staffName" placeholder="请输入姓名" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="所属部门" prop="deptId">
+              <el-tree-select
+                v-model="queryParams.deptId"
+                :data="deptList"
+                node-key="deptId"
+                :props="{ value: 'deptId', label: 'deptName', children: 'children' }"
+                placeholder="请选择部门"
+                clearable
+              />
+            </el-form-item>
+            <el-form-item label="所属岗位" prop="postId">
+              <el-select v-model="queryParams.postId" placeholder="请选择岗位" clearable>
+                <el-option v-for="post in postList" :key="post.postId" :label="post.postName" :value="post.postId" />
+              </el-select>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+              <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+            </el-form-item>
+          </el-form>
+        </el-card>
+      </div>
+    </transition>
+
+    <el-card shadow="never">
+      <template #header>
+        <el-row :gutter="10" class="mb8">
+          <el-col :span="20"><span>ERP人员设定信息列表</span> </el-col>
+          <el-col :span="1.5">
+            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:comStaff:add']">新增</el-button>
+          </el-col>
+        </el-row>
+      </template>
+
+      <el-table v-loading="loading" border :data="erpStaffList" @selection-change="handleSelectionChange">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="人员编码" align="center" prop="staffCode" />
+        <el-table-column label="姓名" align="center" prop="staffName" />
+        <el-table-column label="性别" align="center" prop="sex">
+          <template #default="scope">
+            <dict-tag :options="sys_user_sex" :value="scope.row.sex" />
+          </template>
+        </el-table-column>
+        <!-- <el-table-column label="部门编码" align="center" prop="deptCode" /> -->
+        <el-table-column label="部门名称" align="center" prop="deptName" />
+        <el-table-column label="手机号" align="center" prop="phone" />
+        <el-table-column label="岗位" align="center" prop="postName" />
+        <el-table-column label="状态" align="center" prop="status">
+          <template #default="scope">
+            <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" class-name="small-padding fixed-width">
+          <template #default="scope">
+            <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:comStaff:edit']">编辑</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
+    </el-card>
+    <!-- 添加或修改人员信息对话框 -->
+    <el-dialog :title="dialog.title" v-model="dialog.visible" width="700px" append-to-body>
+      <el-form ref="comStaffFormRef" :model="form" :rules="rules" label-width="100px">
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="人员编码" prop="staffCode">
+              <el-input v-model="form.staffCode" placeholder="请输入人员编码" :disabled="!!form.staffId" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="姓名" prop="staffName">
+              <el-input v-model="form.staffName" placeholder="请输入姓名" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="所属部门" prop="deptId">
+              <el-tree-select
+                v-model="form.deptId"
+                :data="deptList"
+                node-key="deptId"
+                :props="{ value: 'deptId', label: 'deptName', children: 'children' }"
+                placeholder="请选择部门"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="岗位" prop="postId">
+              <el-select v-model="form.postId" placeholder="请选择岗位">
+                <el-option v-for="post in postList" :key="post.postId" :label="post.postName" :value="post.postId" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="手机号" prop="phone">
+              <el-input v-model="form.phone" placeholder="请输入联系电话" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="性别" prop="sex">
+              <el-radio-group v-model="form.sex">
+                <el-radio v-for="dict in sys_user_sex" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="是否启用" prop="status">
+              <el-radio-group v-model="form.status">
+                <el-radio v-for="dict in sys_platform_yes_no" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
+          <el-button @click="cancel">取 消</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup name="ErpStaff" lang="ts">
+import { listErpStaff, getErpStaff, delErpStaff, addErpStaff, updateErpStaff } from '@/api/erpData/erpStaff';
+import { ErpStaffVO, ErpStaffQuery, ErpStaffForm } from '@/api/erpData/erpStaff/types';
+import { listErpDept, getErpDept } from '@/api/erpData/erpDept';
+import { ErpDeptVO } from '@/api/erpData/erpDept/types';
+import { listPost, getPost, deptTreeSelect } from '@/api/system/post';
+import { PostVO } from '@/api/system/post/types';
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { sys_platform_yes_no, sys_user_sex } = toRefs<any>(proxy?.useDict('sys_platform_yes_no', 'sys_user_sex'));
+
+const erpStaffList = ref<ErpStaffVO[]>([]);
+const buttonLoading = ref(false);
+const loading = ref(true);
+const showSearch = ref(true);
+const ids = ref<Array<string | number>>([]);
+const single = ref(true);
+const multiple = ref(true);
+const total = ref(0);
+const deptList = ref<ErpDeptVO[]>([]);
+const postList = ref<PostVO[]>([]);
+const queryFormRef = ref<ElFormInstance>();
+const erpStaffFormRef = ref<ElFormInstance>();
+
+const dialog = reactive<DialogOption>({
+  visible: false,
+  title: ''
+});
+
+const initFormData: ErpStaffForm = {
+  staffId: undefined,
+  staffCode: undefined,
+  staffName: undefined,
+  deptId: undefined,
+  phone: undefined,
+  postId: undefined,
+  sex: undefined,
+  roleId: undefined,
+  dataSource: undefined,
+  password: undefined,
+  validFrom: undefined,
+  validTo: undefined,
+  status: undefined,
+  remark: undefined
+};
+const data = reactive<PageData<ErpStaffForm, ErpStaffQuery>>({
+  form: { ...initFormData },
+  queryParams: {
+    pageNum: 1,
+    pageSize: 10,
+    staffCode: undefined,
+    staffName: undefined,
+    deptId: undefined,
+    phone: undefined,
+    postId: undefined,
+    sex: undefined,
+    roleId: undefined,
+    dataSource: undefined,
+    password: undefined,
+    validFrom: undefined,
+    validTo: undefined,
+    status: undefined,
+    platformCode: undefined,
+    params: {}
+  },
+  rules: {}
+});
+
+const { queryParams, form, rules } = toRefs(data);
+
+/** 查询erp人员信息列表 */
+const getList = async () => {
+  loading.value = true;
+  const res = await listErpStaff(queryParams.value);
+  erpStaffList.value = res.rows;
+  total.value = res.total;
+  loading.value = false;
+};
+
+/** 获取部门列表(树结构) */
+const getDeptList = async () => {
+  const res = await listErpDept();
+  const data = proxy?.handleTree<ErpDeptVO>(res.rows, 'deptId');
+  if (data) {
+    deptList.value = data;
+  }
+  loading.value = false;
+};
+
+/** 获取岗位列表 */
+const getPostList = async (deptId?: number | string) => {
+  try {
+    const res = await listPost({ belongDeptId: deptId });
+    postList.value = res.rows || [];
+  } catch (error) {
+    console.error('获取岗位列表失败', error);
+  }
+};
+
+/** 监听部门选择变化,更新岗位列表 */
+watch(
+  () => queryParams.value.deptId,
+  (newDeptId) => {
+    // 清空岗位选择
+    queryParams.value.postId = undefined;
+    // 根据部门获取岗位列表
+    if (newDeptId) {
+      getPostList(newDeptId);
+    } else {
+      getPostList();
+    }
+  }
+);
+
+/** 取消按钮 */
+const cancel = () => {
+  reset();
+  dialog.visible = false;
+};
+
+/** 表单重置 */
+const reset = () => {
+  form.value = { ...initFormData };
+  erpStaffFormRef.value?.resetFields();
+};
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.value.pageNum = 1;
+  getList();
+};
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value?.resetFields();
+  handleQuery();
+};
+
+/** 多选框选中数据 */
+const handleSelectionChange = (selection: ErpStaffVO[]) => {
+  ids.value = selection.map((item) => item.staffId);
+  single.value = selection.length != 1;
+  multiple.value = !selection.length;
+};
+
+/** 新增按钮操作 */
+const handleAdd = () => {
+  reset();
+  dialog.visible = true;
+  dialog.title = '添加erp人员信息';
+};
+
+/** 修改按钮操作 */
+const handleUpdate = async (row?: ErpStaffVO) => {
+  reset();
+  const _staffId = row?.staffId || ids.value[0];
+  const res = await getErpStaff(_staffId);
+  Object.assign(form.value, res.data);
+  dialog.visible = true;
+  dialog.title = '修改erp人员信息';
+};
+
+/** 提交按钮 */
+const submitForm = () => {
+  erpStaffFormRef.value?.validate(async (valid: boolean) => {
+    if (valid) {
+      buttonLoading.value = true;
+      if (form.value.staffId) {
+        await updateErpStaff(form.value).finally(() => (buttonLoading.value = false));
+      } else {
+        await addErpStaff(form.value).finally(() => (buttonLoading.value = false));
+      }
+      proxy?.$modal.msgSuccess('操作成功');
+      dialog.visible = false;
+      await getList();
+    }
+  });
+};
+
+/** 删除按钮操作 */
+const handleDelete = async (row?: ErpStaffVO) => {
+  const _staffIds = row?.staffId || ids.value;
+  await proxy?.$modal.confirm('是否确认删除erp人员信息编号为"' + _staffIds + '"的数据项?').finally(() => (loading.value = false));
+  await delErpStaff(_staffIds);
+  proxy?.$modal.msgSuccess('删除成功');
+  await getList();
+};
+
+/** 导出按钮操作 */
+const handleExport = () => {
+  proxy?.download(
+    'system/erpStaff/export',
+    {
+      ...queryParams.value
+    },
+    `erpStaff_${new Date().getTime()}.xlsx`
+  );
+};
+
+onMounted(() => {
+  getDeptList();
+  getPostList();
+  getList();
+});
+</script>