songxy 8 месяцев назад
Родитель
Сommit
1ecf55d51f

+ 496 - 0
client/src/views/OaSystem/personnelManagement/deptRecord/index.ts

@@ -0,0 +1,496 @@
+import { getDictOptions } from '@/utils/dict'
+import { cloneDeep } from 'lodash-es'
+export const getDictList = () => {
+  const dictOptionsObj: any = {}
+  // 性别
+  const sex = getDictOptions('sex_type')
+  // 状态
+  const state = getDictOptions('staff_state_type')
+  // 在岗职位
+  const drzw = getDictOptions('post_type')
+  // 民族
+  const nation = getDictOptions('nation_type')
+  // 婚姻情况
+  const hyzk = getDictOptions('hy_type')
+  // 健康状况
+  const jkzk = getDictOptions('health')
+  // 户口性质
+  const hkxz = getDictOptions('hk_type')
+  // 政治面貌
+  const zzmm = getDictOptions('polity_type')
+  //签订公司
+  const qdgs = getDictOptions('company')
+  // 能力等级
+  const nldj = getDictOptions('ABILITY_LEVEL')
+  // 最高学历
+  const zgxl = getDictOptions('xl_type')
+  // 紧急联系人关系
+  const jjlxrgx = getDictOptions('contact_type')
+  //家庭成员关系
+  const jtcygx = getDictOptions('family_type')
+
+  dictOptionsObj.sex = sex
+  dictOptionsObj.state = state
+  dictOptionsObj.drzw = drzw
+  dictOptionsObj.nation = nation
+  dictOptionsObj.hyzk = hyzk
+  dictOptionsObj.jkzk = jkzk
+  dictOptionsObj.hkxz = hkxz
+  dictOptionsObj.zzmm = zzmm
+  dictOptionsObj.qdgs = qdgs
+  dictOptionsObj.nldj = nldj
+  dictOptionsObj.zgxl = zgxl
+  dictOptionsObj.jjlxrgx = jjlxrgx
+  dictOptionsObj.jtcygx = jtcygx
+  return dictOptionsObj
+}
+
+export const formConfigList = [
+  {
+    title: '基本信息',
+    children: [
+      {
+        name: 'sex',
+        title: '性别',
+        type: 'select',
+        options: [
+          {
+            value: 0,
+            label: '女'
+          },
+          {
+            value: 1,
+            label: '男'
+          }
+        ]
+      },
+      {
+        name: 'mobilePhone',
+        title: '手机'
+      },
+      {
+        name: 'birthday',
+        title: '出生日期',
+        type: 'time'
+      },
+      {
+        name: 'nation',
+        title: '民族',
+        type: 'select',
+        options: [
+          {
+            value: '1',
+            label: '汉族'
+          },
+          {
+            value: '2',
+            label: '其他'
+          }
+        ]
+      },
+      {
+        name: 'jg',
+        title: '籍贯'
+      },
+      {
+        name: 'zzmm',
+        title: '政治面貌',
+        type: 'select',
+        options: [
+          {
+            value: 1,
+            label: '群众'
+          },
+          {
+            value: 2,
+            label: '团员'
+          },
+          {
+            value: 3,
+            label: '党员'
+          }
+        ]
+      },
+      {
+        name: 'hyzk',
+        title: '婚姻状况',
+        type: 'select',
+        options: []
+      },
+      {
+        name: 'jkzk',
+        title: '健康状况',
+        type: 'select',
+        options: []
+      },
+      {
+        name: 'cjgzsj',
+        title: '参加工作时间',
+        type: 'time'
+      },
+      {
+        name: 'xjzdz',
+        title: '现居住地址',
+        tip: true
+      },
+      {
+        name: 'hkxz',
+        title: '户口性质',
+        type: 'select',
+        options: [
+          {
+            value: 1,
+            label: '城镇'
+          },
+          {
+            value: 2,
+            label: '农村'
+          }
+        ]
+      },
+      {
+        name: 'hkszd',
+        title: '户口所在地',
+        tip: true
+      },
+      {
+        name: 'xqah',
+        title: '兴趣爱好'
+      },
+      {
+        name: 'jntc',
+        title: '技能特长'
+      },
+      {
+        name: 'cgjl',
+        title: '成果奖励'
+      }
+    ]
+  },
+  {
+    title: '公司信息',
+    children: [
+      {
+        name: 'state',
+        title: '状态',
+        type: 'select',
+        options: [
+          {
+            value: 1,
+            label: '实习'
+          },
+          {
+            value: 2,
+            label: '试用'
+          },
+          {
+            value: 3,
+            label: '正式'
+          },
+          {
+            value: 4,
+            label: '离职'
+          }
+        ]
+      },
+      {
+        name: 'loginName',
+        title: '员工工号',
+        type: 'button'
+      },
+      {
+        name: 'qdgs',
+        title: '签订公司',
+        type: 'select',
+        options: []
+      },
+      {
+        name: 'drzw',
+        title: '在岗职位',
+        type: 'select',
+        options: []
+      },
+      {
+        name: 'nldj',
+        title: '能力等级',
+        type: 'select',
+        options: []
+      },
+      {
+        name: 'ysrzsj',
+        title: '初次入职时间',
+        type: 'time'
+      },
+      {
+        name: 'rgssj',
+        title: '万维空间入职时间',
+        type: 'time'
+      },
+      {
+        name: 'zdr',
+        sname: 'zdrmc',
+        title: '指导人',
+        type: 'user-select'
+      },
+      {
+        name: 'nzzsj',
+        title: '拟转正时间',
+        type: 'time'
+      },
+      {
+        name: 'zzsj',
+        title: '实际转正时间',
+        type: 'time'
+      },
+      {
+        name: 'htqdsj',
+        title: '合同签订时间',
+        type: 'time'
+      },
+      {
+        name: 'htdqs',
+        title: '合同到期时间',
+        type: 'time'
+      },
+      {
+        name: 'xqcs',
+        title: '签订次数'
+      },
+      {
+        name: 'sl',
+        title: '司龄',
+        append: '年'
+      }
+    ]
+  },
+  {
+    title: '工资卡信息',
+    children: [
+      {
+        name: 'khyh',
+        title: '开户行'
+      },
+      {
+        name: 'yhzh',
+        title: '银行卡号'
+      }
+    ]
+  },
+  {
+    title: '身份证信息',
+    children: [
+      {
+        name: 'cardid',
+        title: '证件号码'
+      },
+      {
+        name: 'sfzyxq',
+        type: 'time',
+        title: '有效期'
+      },
+      {
+        name: 'sfyj',
+        type: 'upload',
+        title: '上传附件'
+      }
+    ]
+  },
+  // {
+  //   title: '教育信息',
+  //   children: [
+  //     {
+  //       name: 'byxx',
+  //       title: '毕业院校'
+  //     },
+  //     {
+  //       name: 'bysj',
+  //       title: '毕业时间',
+  //       type: 'time'
+  //     },
+  //     {
+  //       name: 'zgxl',
+  //       title: '最高学历',
+  //       type: 'select',
+  //       options: [
+  //         {
+  //           value: 1,
+  //           label: '高中'
+  //         },
+  //         {
+  //           value: 2,
+  //           label: '中专'
+  //         },
+  //         {
+  //           value: 3,
+  //           label: '大专'
+  //         },
+  //         {
+  //           value: 4,
+  //           label: '本科'
+  //         },
+  //         {
+  //           value: 5,
+  //           label: '硕士'
+  //         },
+  //         {
+  //           value: 6,
+  //           label: '博士'
+  //         }
+  //       ]
+  //     },
+  //     {
+  //       name: 'major',
+  //       title: '专业'
+  //     }
+  //   ]
+  // },
+  {
+    title: '紧急联系人信息',
+    children: [
+      {
+        name: 'jjlxrxm',
+        title: '紧急联系人姓名'
+      },
+      {
+        name: 'jjlxrhm',
+        title: '紧急联系人电话'
+      },
+      {
+        name: 'jjlxrgx',
+        title: '紧急联系人关系',
+        type: 'select',
+        options: []
+      }
+    ]
+  }
+]
+
+export const getConfigDict = () => {
+  const dictList = getDictList()
+  const configList = cloneDeep(formConfigList)
+  // const numberType = ['sex', 'state', 'hyzk', 'hkxz', 'zzmm', 'zgxl', 'jjlxrgx']
+  configList.forEach((item) => {
+    item.children.forEach((child: any) => {
+      if (child.type == 'select' && dictList[child.name]) {
+        const options = dictList[child.name].map((item) => {
+          return {
+            label: item.label,
+            // value: numberType.includes(child.name) ? Number(item.value) : item.value
+            value: item.value
+          }
+        })
+        child.options = options
+      }
+    })
+  })
+
+  return configList
+}
+
+export const formRules = {
+  nickname: [{ required: true, message: '名称不能为空', trigger: 'blur' }]
+}
+
+//搜索
+export const searchConfig = [
+  {
+    name: 'nickname',
+    title: '员工名称'
+  },
+  {
+    name: 'state',
+    title: '状态',
+    type: 'select',
+    options: [
+      {
+        value: 1,
+        label: '实习'
+      },
+      {
+        value: 2,
+        label: '试用'
+      },
+      {
+        value: 3,
+        label: '正式'
+      },
+      {
+        value: 4,
+        label: '离职'
+      }
+    ]
+  },
+  {
+    name: 'zzmm',
+    title: '政治面貌',
+    type: 'select',
+    options: [
+      {
+        value: 1,
+        label: '群众'
+      },
+      {
+        value: 2,
+        label: '团员'
+      },
+      {
+        value: 3,
+        label: '党员'
+      }
+    ]
+  },
+  {
+    name: 'major',
+    title: '专业'
+  },
+
+  {
+    name: 'zgxl',
+    title: '最高学历',
+    type: 'select',
+    options: [
+      {
+        value: 1,
+        label: '高中'
+      },
+      {
+        value: 2,
+        label: '中专'
+      },
+      {
+        value: 3,
+        label: '大专'
+      },
+      {
+        value: 4,
+        label: '本科'
+      },
+      {
+        value: 5,
+        label: '硕士'
+      },
+      {
+        value: 6,
+        label: '博士'
+      }
+    ]
+  }
+]
+
+export const getTableConfigDict = (dataSource) => {
+  const dictList = getDictList()
+  const configList = cloneDeep(dataSource)
+  const numberType = ['sex', 'state', 'hyzk', 'hkxz', 'zzmm', 'zgxl', 'jjlxrgx']
+  configList.forEach((item) => {
+    if (item.type == 'select' && dictList[item.name]) {
+      const options = dictList[item.name].map((item) => {
+        return {
+          label: item.label,
+          value: numberType.includes(item.name) ? Number(item.value) : item.value
+        }
+      })
+      item.options = options
+    }
+  })
+  return configList
+}

+ 247 - 0
client/src/views/OaSystem/personnelManagement/deptRecord/index.vue

@@ -0,0 +1,247 @@
+<template>
+  <div class="oa-sys-list-view">
+    <div class="searchBox">
+      <div class="form" v-for="child in searchConfigList" :key="child.name">
+        <span class="formSpan">{{ child.title }}:</span>
+        <el-select
+          v-if="child.type === 'select'"
+          v-model="queryParams[child?.name]"
+          placeholder=""
+          clearable
+        >
+          <el-option
+            v-for="item in child.options"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+        <DeptTree v-if="child.type === 'dept-select'" v-model="queryParams.deptId" check-strictly />
+        <el-input
+          v-if="child?.type === undefined"
+          v-model="queryParams[child?.name]"
+          placeholder=""
+        />
+      </div>
+      <div class="from" style="margin: 5px 0">
+        <div class="btnBox">
+          <el-button type="primary" style="background: #3485ff" @click="handleQuery">
+            <img src="@/assets/imgs/OA/search.png" class="mr-8px" alt="" />
+            查询</el-button
+          >
+          <el-button type="primary" @click="exportHandle">
+            <img src="@/assets/imgs/OA/open.png" class="mr-8px" alt="" />
+            导出</el-button
+          >
+          <el-button type="primary" color="#05CE9E">
+            <img src="@/assets/imgs/OA/open.png" class="mr-8px" alt="" />
+            <span style="color: #fff">导入</span>
+          </el-button>
+        </div>
+      </div>
+    </div>
+
+    <div class="tableBox">
+      <TableLayout :is-loading="loading" :data="list">
+        <el-table-column fixed align="center" type="index" label="序号" width="80" />
+        <el-table-column fixed align="center" prop="nickname" label="员工姓名" width="100" />
+        <el-table-column
+          align="center"
+          prop="deptName"
+          label="所属部门"
+          width="200"
+          show-overflow-tooltip
+        />
+        <el-table-column align="center" prop="state" label="状态" width="80">
+          <template #default="scope">
+            {{ getDictLabel(DICT_TYPE.STAFF_STATE_TYPES, scope.row.state) }}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" prop="zzmm" label="政治面貌" width="100">
+          <template #default="scope">
+            {{ getDictLabel(DICT_TYPE.POLITY_TYPES, scope.row.zzmm) }}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" prop="hkxz" label="户口性质" width="120">
+          <template #default="scope">
+            {{ getDictLabel(DICT_TYPE.HK_TYPES, scope.row.hkxz) }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          prop="byxx"
+          label="毕业院校"
+          width="180"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          align="center"
+          prop="bysj"
+          label="毕业时间"
+          :formatter="dateFormatter2"
+          width="120"
+        />
+        <el-table-column align="center" prop="zgxl" label="最高学历" width="120">
+          <template #default="scope">
+            {{ getDictLabel(DICT_TYPE.XL_TYPE, scope.row.zgxl) }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          prop="major"
+          label="专业"
+          width="200"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          align="center"
+          prop="cjgzsj"
+          label="参加工作时间"
+          :formatter="dateFormatter2"
+          width="120"
+        />
+        <el-table-column
+          align="center"
+          prop="rgssj"
+          label="入职时间"
+          :formatter="dateFormatter2"
+          width="120"
+        />
+        <el-table-column
+          align="center"
+          prop="htdqs"
+          label="合同到期时间"
+          :formatter="dateFormatter2"
+          width="120"
+        />
+        <el-table-column
+          align="center"
+          prop="zzsj"
+          label="转正时间"
+          :formatter="dateFormatter2"
+          width="120"
+        />
+        <el-table-column align="center" label="操作" fixed="right" width="120">
+          <template #default="scope">
+            <div style="display: flex">
+              <div class="operateBtn" @click="operateClick(scope.row, 'view')">
+                <span>查看</span>
+              </div>
+              <div class="operateBtn" @click="operateClick(scope.row, 'edit')">
+                <span>编辑</span>
+              </div>
+            </div>
+          </template>
+        </el-table-column>
+      </TableLayout>
+      <div class="pageBox">
+        <el-pagination
+          v-model:current-page="queryParams.pageNo"
+          :page-size="queryParams.pageSize"
+          background
+          layout="total, prev, pager, next, jumper"
+          :total="total"
+          @current-change="handleCurrentChange"
+        />
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup lang="ts">
+import * as StaffRecordsApi from '@/api/oa/staffRecords'
+import { dateFormatter2 } from '@/utils/formatTime'
+import { getUserInfo } from '@/utils/tool'
+import { DICT_TYPE, getDictLabel } from '@/utils/dict'
+import { getTableConfigDict, searchConfig } from './index'
+// import DeptSelect from '@/components/DeptSelect/index.vue'
+import TableLayout from '../../oaViews/layout/TableLayout.vue'
+import DeptTree from '@/views/OaSystem/components/DeptTree/index.vue'
+import download from '@/utils/download'
+
+const searchConfigList = getTableConfigDict(searchConfig)
+
+const userInfo = getUserInfo()
+
+defineOptions({ name: 'DeptRecord' })
+const queryParams = reactive({
+  pageNo: 1,
+  pageSize: 15,
+  nickname: undefined,
+  deptId: userInfo['deptId'],
+  state: undefined,
+  zzmm: undefined,
+  hkxz: undefined,
+  zgxl: undefined,
+  major: undefined,
+  pyxs: undefined,
+  sfytd: undefined
+})
+const loading = ref(true) // 列表的加载中
+const total = ref(0) // 列表的总页数
+const list = ref([]) // 列表的数
+
+const router = useRouter()
+
+/** 查询列表 */
+const getList = async () => {
+  loading.value = true
+  try {
+    const data = await StaffRecordsApi.getRecordsPage(queryParams)
+    list.value = data.records
+    total.value = data.total
+  } finally {
+    loading.value = false
+  }
+}
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.pageNo = 1
+  getList()
+}
+
+/** 分页操作 */
+const handleCurrentChange = (pageNo: number) => {
+  queryParams.pageNo = pageNo
+  getList()
+}
+
+const operateClick = (row: any, type: string) => {
+  router.push({
+    path: '/staffDetail',
+    query: { id: row.userId, type }
+  })
+}
+
+/**部门切换时 */
+const deptOnChange = (id) => {
+  console.log(id)
+  queryParams.deptId = id
+}
+const exportHandle = async () => {
+  const sendData = {
+    ...queryParams,
+    pageSize: total.value
+  }
+  console.log(queryParams)
+  const result = await StaffRecordsApi.excelStaffRecord(sendData)
+  download.excel(result, '员工档案.xls')
+}
+/** 初始化 */
+onMounted(() => {
+  getList()
+})
+</script>
+
+<style lang="scss" scoped>
+:deep(.el-input) {
+  width: 160px;
+}
+
+:deep(.el-table--default) {
+  .el-table__cell {
+    padding: 14px 0;
+  }
+}
+</style>