|
@@ -2,6 +2,13 @@
|
|
<div class="work-statistics flex flex-col h-full">
|
|
<div class="work-statistics flex flex-col h-full">
|
|
<SearchForm :fields="fields" :params="params"></SearchForm>
|
|
<SearchForm :fields="fields" :params="params"></SearchForm>
|
|
<div class="flex-1 page-wrap">
|
|
<div class="flex-1 page-wrap">
|
|
|
|
+ <p>
|
|
|
|
+ <span>考勤总计:{{ statisticsInfo.a }}</span>
|
|
|
|
+ <span class="m-l-20px">已提交:{{ statisticsInfo.b }}</span>
|
|
|
|
+ <span class="m-l-20px">待提交:{{ statisticsInfo.c }}</span>
|
|
|
|
+ <span class="m-l-20px">已提交累计人天:{{ statisticsInfo.d }}天</span>
|
|
|
|
+ <span class="m-l-20px">已提交累计工时:{{ statisticsInfo.e }}小时</span>
|
|
|
|
+ </p>
|
|
<t-table
|
|
<t-table
|
|
size="small"
|
|
size="small"
|
|
row-key="id"
|
|
row-key="id"
|
|
@@ -13,6 +20,7 @@
|
|
defaultPageSize: 10,
|
|
defaultPageSize: 10,
|
|
onChange,
|
|
onChange,
|
|
total: pagination.total,
|
|
total: pagination.total,
|
|
|
|
+ current: pagination.page,
|
|
}"
|
|
}"
|
|
>
|
|
>
|
|
</t-table>
|
|
</t-table>
|
|
@@ -22,24 +30,39 @@
|
|
|
|
|
|
<script setup lang="jsx" name="WorkStatistics">
|
|
<script setup lang="jsx" name="WorkStatistics">
|
|
import { ref, reactive } from 'vue';
|
|
import { ref, reactive } from 'vue';
|
|
-import { getTableData } from '@/api/test';
|
|
|
|
|
|
+import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
|
|
+import {
|
|
|
|
+ workStatisticsListApi,
|
|
|
|
+ workStatisticsInfoApi,
|
|
|
|
+ workStatisticsPassApi,
|
|
|
|
+} from '@/api/work-hours';
|
|
|
|
|
|
const columns = [
|
|
const columns = [
|
|
- { colKey: 'a', title: '服务单元名称' },
|
|
|
|
- { colKey: 'b', title: '服务开始时间' },
|
|
|
|
- { colKey: 'c', title: '服务截止时间' },
|
|
|
|
- { colKey: 'd', title: '业务类型' },
|
|
|
|
- { colKey: 'e', title: '负责人' },
|
|
|
|
- { colKey: 'f', title: '区域配比' },
|
|
|
|
- { colKey: 'g', title: '当前状态' },
|
|
|
|
- { colKey: 'h', title: '创建人' },
|
|
|
|
- { colKey: 'i', title: '创建时间' },
|
|
|
|
|
|
+ { colKey: 'a', title: '服务单元' },
|
|
|
|
+ { colKey: 'b', title: 'SOP流水号' },
|
|
|
|
+ { colKey: 'c', title: '客户名称' },
|
|
|
|
+ { colKey: 'd', title: '省份' },
|
|
|
|
+ { colKey: 'e', title: '城市' },
|
|
|
|
+ { colKey: 'f', title: '项目开始时间', width: 170 },
|
|
|
|
+ { colKey: 'g', title: '项目结束时间', width: 170 },
|
|
|
|
+ { colKey: 'h', title: '姓名(人员档案号)', width: 150 },
|
|
|
|
+ { colKey: 'i', title: '项目角色' },
|
|
|
|
+ { colKey: 'j', title: '供应商' },
|
|
|
|
+ { colKey: 'k', title: '实际出勤(天)', width: 120 },
|
|
|
|
+ { colKey: 'l', title: '工作日(天)', width: 110 },
|
|
|
|
+ { colKey: 'm', title: '周末(天)', width: 100 },
|
|
|
|
+ { colKey: 'n', title: '法定节假日(天)', width: 140 },
|
|
|
|
+ { colKey: 'o', title: '累计工时(天)', width: 120 },
|
|
|
|
+ { colKey: 'p', title: '违规工时(天)', width: 120 },
|
|
|
|
+ { colKey: 'q', title: '提交人' },
|
|
|
|
+ { colKey: 'r', title: '提交时间', width: 170 },
|
|
|
|
+ { colKey: 's', title: '提交状态', width: 100 },
|
|
{
|
|
{
|
|
- title: '操作',
|
|
|
|
|
|
+ title: '管理',
|
|
colKey: 'operate',
|
|
colKey: 'operate',
|
|
fixed: 'right',
|
|
fixed: 'right',
|
|
- width: 260,
|
|
|
|
|
|
+ width: 120,
|
|
cell: (h, { row }) => {
|
|
cell: (h, { row }) => {
|
|
return (
|
|
return (
|
|
<div class="table-operations">
|
|
<div class="table-operations">
|
|
@@ -48,6 +71,7 @@ const columns = [
|
|
hover="color"
|
|
hover="color"
|
|
onClick={(e) => {
|
|
onClick={(e) => {
|
|
e.stopPropagation();
|
|
e.stopPropagation();
|
|
|
|
+ handlePass(row);
|
|
}}
|
|
}}
|
|
>
|
|
>
|
|
同意撤回
|
|
同意撤回
|
|
@@ -57,15 +81,15 @@ const columns = [
|
|
},
|
|
},
|
|
},
|
|
},
|
|
];
|
|
];
|
|
-const {
|
|
|
|
- loading: tableLoading,
|
|
|
|
- pagination,
|
|
|
|
- tableData,
|
|
|
|
- fetchData,
|
|
|
|
- onChange,
|
|
|
|
-} = useFetchTable(getTableData);
|
|
|
|
|
|
+const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
|
|
|
|
+ workStatisticsListApi
|
|
|
|
+);
|
|
|
|
|
|
-const refresh = async () => {};
|
|
|
|
|
|
+const statisticsInfo = reactive({ a: 1, b: 2, c: 3, d: 4, e: 5 });
|
|
|
|
+const getStatisticsInfo = async () => {
|
|
|
|
+ const res = await workStatisticsInfoApi(params);
|
|
|
|
+ statisticsInfo = res.data || {};
|
|
|
|
+};
|
|
|
|
|
|
const fields = ref([
|
|
const fields = ref([
|
|
{
|
|
{
|
|
@@ -102,6 +126,10 @@ const fields = ref([
|
|
{
|
|
{
|
|
type: 'button',
|
|
type: 'button',
|
|
text: '查询',
|
|
text: '查询',
|
|
|
|
+ onClick: () => {
|
|
|
|
+ search();
|
|
|
|
+ getStatisticsInfo();
|
|
|
|
+ },
|
|
},
|
|
},
|
|
],
|
|
],
|
|
},
|
|
},
|
|
@@ -141,6 +169,20 @@ const params = reactive({
|
|
g: '',
|
|
g: '',
|
|
h: '',
|
|
h: '',
|
|
});
|
|
});
|
|
-</script>
|
|
|
|
|
|
|
|
-<style></style>
|
|
|
|
|
|
+const handlePass = (row) => {
|
|
|
|
+ const confirmDia = DialogPlugin({
|
|
|
|
+ header: '同意撤回提示',
|
|
|
|
+ body: `您确定要同意撤回这条工时数据吗?撤回后,该工时数据可以暂时无法继续结算。`,
|
|
|
|
+ confirmBtn: '确定',
|
|
|
|
+ cancelBtn: '取消',
|
|
|
|
+ onConfirm: async () => {
|
|
|
|
+ confirmDia.hide();
|
|
|
|
+ const res = await workStatisticsPassApi(row.id).catch(() => {});
|
|
|
|
+ if (!res) return;
|
|
|
|
+ MessagePlugin.success('操作成功');
|
|
|
|
+ fetchData();
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+</script>
|