|
@@ -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>
|