|
@@ -3,14 +3,30 @@
|
|
<SearchForm :fields="fields" :params="params"></SearchForm>
|
|
<SearchForm :fields="fields" :params="params"></SearchForm>
|
|
|
|
|
|
<div class="flex-1 page-wrap">
|
|
<div class="flex-1 page-wrap">
|
|
- <div class="btn-group">
|
|
|
|
- <t-button
|
|
|
|
- theme="success"
|
|
|
|
- :disabled="!selectedRowKeys.length"
|
|
|
|
- @click="multSubmit"
|
|
|
|
- >批量提交</t-button
|
|
|
|
- >
|
|
|
|
|
|
+ <div class="flex justify-between items-center">
|
|
|
|
+ <t-space>
|
|
|
|
+ <span>考勤总计:{{ statisticsInfo.a }}</span>
|
|
|
|
+ <span>已提交:{{ statisticsInfo.b }}</span>
|
|
|
|
+ <span>待提交:{{ statisticsInfo.c }}</span>
|
|
|
|
+ <span>累计人天:{{ statisticsInfo.d }}天</span>
|
|
|
|
+ <span>累计工时:{{ statisticsInfo.e }}小时</span>
|
|
|
|
+ </t-space>
|
|
|
|
+ <div class="btn-group">
|
|
|
|
+ <t-button
|
|
|
|
+ theme="success"
|
|
|
|
+ :disabled="!selectedRowKeys.length"
|
|
|
|
+ @click="multSubmit"
|
|
|
|
+ >批量提交</t-button
|
|
|
|
+ >
|
|
|
|
+ <t-button
|
|
|
|
+ theme="success"
|
|
|
|
+ :disabled="!selectedRowKeys.length"
|
|
|
|
+ @click="multExport"
|
|
|
|
+ >批量导出</t-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
<t-table
|
|
<t-table
|
|
size="small"
|
|
size="small"
|
|
row-key="id"
|
|
row-key="id"
|
|
@@ -39,7 +55,9 @@ import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
import {
|
|
import {
|
|
workAttendanceListApi,
|
|
workAttendanceListApi,
|
|
|
|
+ workAttendanceInfoApi,
|
|
workAttendanceSubmitApi,
|
|
workAttendanceSubmitApi,
|
|
|
|
+ workAttendanceExportApi,
|
|
workAttendanceWithdrawApi,
|
|
workAttendanceWithdrawApi,
|
|
workAttendanceCancelWithdrawApi,
|
|
workAttendanceCancelWithdrawApi,
|
|
} from '@/api/work-hours';
|
|
} from '@/api/work-hours';
|
|
@@ -123,6 +141,11 @@ const columns = [
|
|
const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
|
|
const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
|
|
workAttendanceListApi
|
|
workAttendanceListApi
|
|
);
|
|
);
|
|
|
|
+let statisticsInfo = reactive({ a: 1, b: 2, c: 3, d: 4, e: 5 });
|
|
|
|
+const getStatisticsInfo = async () => {
|
|
|
|
+ const res = await workAttendanceInfoApi(params);
|
|
|
|
+ statisticsInfo = res.data || {};
|
|
|
|
+};
|
|
|
|
|
|
const fields = ref([
|
|
const fields = ref([
|
|
{
|
|
{
|
|
@@ -161,6 +184,7 @@ const fields = ref([
|
|
text: '查询',
|
|
text: '查询',
|
|
onClick: () => {
|
|
onClick: () => {
|
|
search();
|
|
search();
|
|
|
|
+ getStatisticsInfo();
|
|
},
|
|
},
|
|
},
|
|
},
|
|
],
|
|
],
|
|
@@ -229,7 +253,7 @@ const multSubmit = () => {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
const confirmDia = DialogPlugin({
|
|
const confirmDia = DialogPlugin({
|
|
- header: '操作警告',
|
|
|
|
|
|
+ header: '操作提示',
|
|
body: `确定要提交选择的所有记录吗?`,
|
|
body: `确定要提交选择的所有记录吗?`,
|
|
confirmBtn: '确定',
|
|
confirmBtn: '确定',
|
|
cancelBtn: '取消',
|
|
cancelBtn: '取消',
|
|
@@ -244,11 +268,31 @@ const multSubmit = () => {
|
|
},
|
|
},
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
+const multExport = () => {
|
|
|
|
+ if (!selectedRowKeys.value.length) {
|
|
|
|
+ MessagePlugin.error('请选择要导出的记录');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ const confirmDia = DialogPlugin({
|
|
|
|
+ header: '操作提示',
|
|
|
|
+ body: `确定要导出选择的所有记录吗?`,
|
|
|
|
+ confirmBtn: '确定',
|
|
|
|
+ cancelBtn: '取消',
|
|
|
|
+ onConfirm: async () => {
|
|
|
|
+ confirmDia.hide();
|
|
|
|
+ const res = await workAttendanceExportApi(selectedRowKeys.value).catch(
|
|
|
|
+ () => {}
|
|
|
|
+ );
|
|
|
|
+ if (!res) return;
|
|
|
|
+ MessagePlugin.success('开始下载');
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
|
|
const handleSubmit = (row) => {
|
|
const handleSubmit = (row) => {
|
|
const confirmDia = DialogPlugin({
|
|
const confirmDia = DialogPlugin({
|
|
- header: '操作警告',
|
|
|
|
- body: `确定要提交当前记录吗?`,
|
|
|
|
|
|
+ header: '提交提示',
|
|
|
|
+ body: `该工时数据提交后就可以进行工时统计结算,且该工时数据无法进行任何修改操作,您要继续提交吗?`,
|
|
confirmBtn: '确定',
|
|
confirmBtn: '确定',
|
|
cancelBtn: '取消',
|
|
cancelBtn: '取消',
|
|
onConfirm: async () => {
|
|
onConfirm: async () => {
|
|
@@ -262,8 +306,8 @@ const handleSubmit = (row) => {
|
|
};
|
|
};
|
|
const handleWithdraw = (row) => {
|
|
const handleWithdraw = (row) => {
|
|
const confirmDia = DialogPlugin({
|
|
const confirmDia = DialogPlugin({
|
|
- header: '操作警告',
|
|
|
|
- body: `确定要撤回当前记录吗?`,
|
|
|
|
|
|
+ header: '撤回提示',
|
|
|
|
+ body: `您确定要撤回这条已提交的工时数据吗?您操作撤回后,还需要工时管理人员同意撤回,这条工时数据才能被真正撤回。`,
|
|
confirmBtn: '确定',
|
|
confirmBtn: '确定',
|
|
cancelBtn: '取消',
|
|
cancelBtn: '取消',
|
|
onConfirm: async () => {
|
|
onConfirm: async () => {
|
|
@@ -277,7 +321,7 @@ const handleWithdraw = (row) => {
|
|
};
|
|
};
|
|
const handleCancelWithdraw = (row) => {
|
|
const handleCancelWithdraw = (row) => {
|
|
const confirmDia = DialogPlugin({
|
|
const confirmDia = DialogPlugin({
|
|
- header: '操作警告',
|
|
|
|
|
|
+ header: '操作提示',
|
|
body: `确定要取消撤回当前记录吗?`,
|
|
body: `确定要取消撤回当前记录吗?`,
|
|
confirmBtn: '确定',
|
|
confirmBtn: '确定',
|
|
cancelBtn: '取消',
|
|
cancelBtn: '取消',
|