qsh 2 months ago
parent aa84bb69f3
commit 3db8be1280
  1. 21
      src/api/home/falseDiligence.js
  2. 110
      src/views/Home/FalseDiligenceReport/index.vue
  3. 23
      src/views/Home/Salary/index.vue
  4. 9
      src/views/Pers/Employee/index.vue

@ -0,0 +1,21 @@
import request from '@/config/axios'
// 查询列表
export const getPage = async (data) => {
return await request.post({ url: '/admin-api/oa/dingtalk/attendance/periodPage', data })
}
// 同步假勤数据
export const syncFalseDiligence = async (params) => {
return await request.get({ url: '/admin-api/oa/dingtalk/attendance/sync', params })
}
// 修改考勤数据
export const updateFalseDiligence = async (data) => {
return await request.put({ url: '/admin-api/oa/dingtalk/attendance/update', data })
}
// 封存考勤数据
export const saveFalseDiligence = async (params) => {
return await request.get({ url: '/admin-api/oa/dingtalk/attendance/confirm', params })
}

@ -14,7 +14,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-input <el-input
v-model="searchForm.orgName" v-model.trim="searchForm.dept"
placeholder="组织名称" placeholder="组织名称"
clearable clearable
@keyup.enter="handleSearch" @keyup.enter="handleSearch"
@ -22,7 +22,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-input <el-input
v-model="searchForm.name" v-model.trim="searchForm.name"
placeholder="员工姓名" placeholder="员工姓名"
clearable clearable
@keyup.enter="handleSearch" @keyup.enter="handleSearch"
@ -45,113 +45,118 @@
stripe stripe
:default-expand-all="false" :default-expand-all="false"
row-key="id" row-key="id"
:tree-props="{ children: 'userSalaryGrantRespVOList', hasChildren: 'hasChildren' }" :tree-props="{ children: 'userDingAttendanceRespVOList', hasChildren: 'hasChildren' }"
:span-method="spanMethod" :span-method="spanMethod"
> >
<el-table-column label="姓名" min-width="90px"> <el-table-column label="姓名" min-width="90px">
<template #default="{ row }"> <template #default="{ row }">
<span v-if="row.userSalaryGrantRespVOList && row.userSalaryGrantRespVOList.length"> <span v-if="row.userDingAttendanceRespVOList && row.userDingAttendanceRespVOList.length">
<span>{{ row.period }}</span> <span>{{ row.period }}</span>
<span class="ml-20px">考勤人数{{ row.grantNum }}</span> <span class="ml-20px">考勤人数{{ row.attendanceUserCount }}</span>
<span class="ml-20px">不考勤人数{{ row.allGrantSalaryTotal }}</span> <span class="ml-20px">不考勤人数{{ row.notAttendanceUserCount }}</span>
</span> </span>
<span v-else> <span v-else>
{{ row.name }} {{ row.employeeName }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="period" label="年月" min-width="90px" /> <el-table-column prop="period" label="年月" min-width="90px" />
<el-table-column prop="dept" label="组织" min-width="90px" /> <el-table-column prop="dept" label="组织" min-width="90px" />
<el-table-column prop="post" label="计薪天数" min-width="90px" /> <el-table-column label="是否考勤" min-width="90px">
<template #default="{ row }">
{{ row.needAttendance ? '考勤' : '不考勤' }}
</template>
</el-table-column>
<el-table-column prop="shouldWorkDay" label="计薪天数" min-width="90px" />
<el-table-column label="出勤天数" align="center"> <el-table-column label="出勤天数" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-input-number <el-input-number
v-if="row.edit" v-if="row.edit"
v-model="row.baseSalary" v-model="row.reallyWorkDay"
:min="0" :min="0"
:controls="false" :controls="false"
size="small" size="small"
style="width: 65px" style="width: 65px"
/> />
<span v-else> {{ row.baseSalary }}</span> <span v-else> {{ row.reallyWorkDay }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="缺勤天数" align="center"> <el-table-column label="缺勤天数" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-input-number <el-input-number
v-if="row.edit" v-if="row.edit"
v-model="row.baseSalary" v-model="row.absenceDay"
:min="0" :min="0"
:controls="false" :controls="false"
size="small" size="small"
style="width: 65px" style="width: 65px"
/> />
<span v-else> {{ row.baseSalary }}</span> <span v-else> {{ row.absenceDay }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="事假时长" align="center"> <el-table-column label="事假时长" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-input-number <el-input-number
v-if="row.edit" v-if="row.edit"
v-model="row.baseSalary" v-model="row.absenceLeaveDay"
:min="0" :min="0"
:controls="false" :controls="false"
size="small" size="small"
style="width: 65px" style="width: 65px"
/> />
<span v-else> {{ row.baseSalary }}</span> <span v-else> {{ row.absenceLeaveDay }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="婚假天数" align="center"> <el-table-column label="婚假天数" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-input-number <el-input-number
v-if="row.edit" v-if="row.edit"
v-model="row.baseSalary" v-model="row.marryLeaveDay"
:min="0" :min="0"
:controls="false" :controls="false"
size="small" size="small"
style="width: 65px" style="width: 65px"
/> />
<span v-else> {{ row.baseSalary }}</span> <span v-else> {{ row.marryLeaveDay }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="产假天数" align="center"> <el-table-column label="产假天数" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-input-number <el-input-number
v-if="row.edit" v-if="row.edit"
v-model="row.baseSalary" v-model="row.maternityLeaveDay"
:min="0" :min="0"
:controls="false" :controls="false"
size="small" size="small"
style="width: 65px" style="width: 65px"
/> />
<span v-else> {{ row.baseSalary }}</span> <span v-else> {{ row.maternityLeaveDay }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="丧假天数" align="center"> <el-table-column label="丧假天数" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-input-number <el-input-number
v-if="row.edit" v-if="row.edit"
v-model="row.baseSalary" v-model="row.funeralLeaveDay"
:min="0" :min="0"
:controls="false" :controls="false"
size="small" size="small"
style="width: 65px" style="width: 65px"
/> />
<span v-else> {{ row.baseSalary }}</span> <span v-else> {{ row.funeralLeaveDay }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="旷工天数" align="center"> <el-table-column label="旷工天数" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-input-number <el-input-number
v-if="row.edit" v-if="row.edit"
v-model="row.baseSalary" v-model="row.skipWorkDay"
:min="0" :min="0"
:controls="false" :controls="false"
size="small" size="small"
style="width: 65px" style="width: 65px"
/> />
<span v-else> {{ row.baseSalary }}</span> <span v-else> {{ row.skipWorkDay }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" width="200"> <el-table-column label="操作" fixed="right" width="200">
@ -202,15 +207,17 @@
</template> </template>
<script setup name="FalseDilegenceReport"> <script setup name="FalseDilegenceReport">
import { ElLoading } from 'element-plus'
import { removeNullField } from '@/utils' import { removeNullField } from '@/utils'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import * as SalaryApi from '@/api/home/salary.js' import * as FalseDiligenceApi from '@/api/home/falseDiligence.js'
const message = useMessage() // const message = useMessage() //
const searchForm = ref({ const searchForm = ref({
name: undefined, name: undefined,
period: undefined, period: undefined,
dept: undefined,
pageNo: 1, pageNo: 1,
pageSize: 20 pageSize: 20
}) })
@ -240,10 +247,10 @@ async function getList() {
month: new Date(params.period).getMonth() + 1 month: new Date(params.period).getMonth() + 1
} }
} }
const data = await SalaryApi.getSalaryPage(removeNullField(params)) const data = await FalseDiligenceApi.getPage(removeNullField(params))
if (searchForm.value.name) { if (searchForm.value.name) {
tableList.value = data.list.reduce((pre, cur) => { tableList.value = data.list.reduce((pre, cur) => {
return pre.concat(cur.userSalaryGrantRespVOList) return pre.concat(cur.userDingAttendanceRespVOList)
}, []) }, [])
} else { } else {
tableList.value = data.list.map((it, index) => ({ tableList.value = data.list.map((it, index) => ({
@ -261,10 +268,10 @@ async function getList() {
} }
function spanMethod({ row, columnIndex }) { function spanMethod({ row, columnIndex }) {
if (row.userSalaryGrantRespVOList && row.userSalaryGrantRespVOList.length > 0) { if (row.userDingAttendanceRespVOList && row.userDingAttendanceRespVOList.length > 0) {
if (columnIndex === 0) { if (columnIndex === 0) {
return [1, 11] return [1, 12]
} else if (columnIndex == 11 && row.id) { } else if (columnIndex == 12 && row.id) {
return [1, 1] return [1, 1]
} else { } else {
return [0, 0] return [0, 0]
@ -272,23 +279,49 @@ function spanMethod({ row, columnIndex }) {
} }
} }
let globalLoading = ref({})
async function handleSync() { async function handleSync() {
const result = await message.prompt('请输入年月,如2024-01') try {
message.success(`正在同步${formatDate(new Date(result.value), 'YYYY-MM')}假勤数据,请稍后...`) const result = await message.prompt('请输入年月,如2024-01')
const period = formatDate(new Date(result.value), 'YYYY-MM')
globalLoading.value = ElLoading.service({
lock: true,
text: `正在同步${period}假勤数据,请稍后...`,
background: 'rgba(0, 0, 0, 0.7)'
})
await FalseDiligenceApi.syncFalseDiligence({ period })
globalLoading.value.close()
message.success(`同步成功!`)
getList()
} catch {
globalLoading.value.close()
}
} }
function handleEdit(row) { function handleEdit(row) {
row.edit = '1' row.edit = '1'
row.userSalaryGrantRespVOList.forEach((it) => (it.edit = true)) row.userDingAttendanceRespVOList.forEach((it) => (it.edit = true))
} }
async function handleSave(row) { async function handleSave(row) {
row.edit = '0' try {
row.userSalaryGrantRespVOList.forEach((it) => (it.edit = false)) row.edit = '0'
loading.value = true row.userDingAttendanceRespVOList.forEach((it) => (it.edit = false))
await SalaryApi.updateSalarySlip(row.userSalaryGrantRespVOList) globalLoading.value = ElLoading.service({
message.success('保存成功!') lock: true,
getList() text: `假勤数据保存中,请稍后...`,
background: 'rgba(0, 0, 0, 0.7)'
})
await FalseDiligenceApi.updateFalseDiligence({
userDingAttendanceSaveReqVO: row.userDingAttendanceRespVOList
})
globalLoading.value.close()
message.success('保存成功!')
getList()
} catch {
globalLoading.value.close()
}
} }
async function handleSealup(row) { async function handleSealup(row) {
@ -296,8 +329,7 @@ async function handleSealup(row) {
// //
await message.confirm('确认要封存"' + row.period + '"假勤吗?') await message.confirm('确认要封存"' + row.period + '"假勤吗?')
// //
await SalaryApi.sealupSalarySlip({ await FalseDiligenceApi.saveFalseDiligence({
grantIdList: row.userSalaryGrantRespVOList.map((it) => it.grantId),
period: row.period period: row.period
}) })
// //

@ -320,6 +320,7 @@ import DialogSalaryImport from './Comp/DialogSalaryImport.vue'
import { removeNullField } from '@/utils' import { removeNullField } from '@/utils'
import * as SalaryApi from '@/api/home/salary.js' import * as SalaryApi from '@/api/home/salary.js'
import { ElLoading } from 'element-plus'
const message = useMessage() // const message = useMessage() //
@ -402,13 +403,23 @@ function handleEdit(row) {
row.userSalaryGrantRespVOList.forEach((it) => (it.edit = true)) row.userSalaryGrantRespVOList.forEach((it) => (it.edit = true))
} }
const globalLoading = ref({})
async function handleSave(row) { async function handleSave(row) {
row.edit = '0' try {
row.userSalaryGrantRespVOList.forEach((it) => (it.edit = false)) row.edit = '0'
loading.value = true row.userSalaryGrantRespVOList.forEach((it) => (it.edit = false))
await SalaryApi.updateSalarySlip(row.userSalaryGrantRespVOList) globalLoading.value = ElLoading.service({
message.success('保存成功!') lock: true,
getList() text: `工资条数据保存中,请稍后...`,
background: 'rgba(0, 0, 0, 0.7)'
})
await SalaryApi.updateSalarySlip(row.userSalaryGrantRespVOList)
globalLoading.value.close()
message.success('保存成功!')
getList()
} catch {
globalLoading.value.close()
}
} }
async function handleSealup(row) { async function handleSealup(row) {

@ -33,9 +33,10 @@
<el-table-column label="姓名" prop="name" /> <el-table-column label="姓名" prop="name" />
<el-table-column label="职位" prop="post" /> <el-table-column label="职位" prop="post" />
<el-table-column label="手机号码" prop="mobile" width="120" /> <el-table-column label="手机号码" prop="mobile" width="120" />
<el-table-column label="微信号" prop="wxAlias" width="120" /> <el-table-column label="微信号" prop="wxAlias" min-width="120" />
<el-table-column label="考勤方案" prop="attendanceSettingName" /> <el-table-column label="钉钉号" prop="dingUserId" min-width="120" />
<el-table-column label="已开通系统" prop="instanceName" /> <el-table-column label="考勤方案" prop="attendanceSettingName" width="100" />
<el-table-column label="已开通系统" prop="instanceName" min-width="120" />
<el-table-column label="在职状态" key="status" width="150"> <el-table-column label="在职状态" key="status" width="150">
<template #default="scope"> <template #default="scope">
<el-switch <el-switch
@ -49,7 +50,7 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="260"> <el-table-column label="操作" width="260" fixed="right">
<template #default="scope"> <template #default="scope">
<el-button <el-button
type="primary" type="primary"

Loading…
Cancel
Save