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