|
@@ -1,14 +1,31 @@
|
|
<template>
|
|
<template>
|
|
<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">
|
|
|
|
+ <template #service="{ item, params }">
|
|
|
|
+ <select-service-unit v-model="params[item.prop]"></select-service-unit>
|
|
|
|
+ </template>
|
|
|
|
+ <template #supplier="{ item, params }">
|
|
|
|
+ <select-supplier v-model="params[item.prop]"> </select-supplier>
|
|
|
|
+ </template>
|
|
|
|
+ <template #creator="{ item, params }">
|
|
|
|
+ <select-filter-user v-model="params[item.prop]"> </select-filter-user>
|
|
|
|
+ </template>
|
|
|
|
+ </SearchForm>
|
|
<div class="flex-1 page-wrap">
|
|
<div class="flex-1 page-wrap">
|
|
- <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="flex justify-between items-center">
|
|
|
|
+ <t-space>
|
|
|
|
+ <span>考勤总计:{{ statisticsInfo.total }}</span>
|
|
|
|
+ <span>已提交:{{ statisticsInfo.submitted }}</span>
|
|
|
|
+ <span>待提交:{{ statisticsInfo.unSubmitted }}</span>
|
|
|
|
+ <span>已提交累计人天:{{ statisticsInfo.allDays }}天</span>
|
|
|
|
+ <span>已提交累计工时:{{ statisticsInfo.allHours }}小时</span>
|
|
|
|
+ </t-space>
|
|
|
|
+ <div class="btn-group">
|
|
|
|
+ <t-button theme="success" @click="handleExport"
|
|
|
|
+ >导出统计结果</t-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
<t-table
|
|
<t-table
|
|
size="small"
|
|
size="small"
|
|
row-key="id"
|
|
row-key="id"
|
|
@@ -23,101 +40,88 @@
|
|
current: pagination.pageNumber,
|
|
current: pagination.pageNumber,
|
|
}"
|
|
}"
|
|
>
|
|
>
|
|
|
|
+ <template #user="{ row }">
|
|
|
|
+ {{ row.userName }}({{ row.userNo }})
|
|
|
|
+ </template>
|
|
|
|
+ <template #start-time="{ col, row }">
|
|
|
|
+ {{ timestampFilter(row[col.colKey]) }}
|
|
|
|
+ </template>
|
|
|
|
+ <template #end-time="{ col, row }">
|
|
|
|
+ {{ timestampFilter(row[col.colKey]) }}
|
|
|
|
+ </template>
|
|
|
|
+ <template #submit-time="{ col, row }">
|
|
|
|
+ {{ timestampFilter(row[col.colKey]) }}
|
|
|
|
+ </template>
|
|
|
|
+ <template #status="{ col, row }">
|
|
|
|
+ {{ flowStatusFilter(row[col.colKey]) }}
|
|
|
|
+ </template>
|
|
|
|
+ <template #operate="{ row }">
|
|
|
|
+ <div class="table-operations">
|
|
|
|
+ <t-link
|
|
|
|
+ v-if="row.status === 'AUDITING'"
|
|
|
|
+ theme="primary"
|
|
|
|
+ hover="color"
|
|
|
|
+ @click="handlePass(row)"
|
|
|
|
+ >
|
|
|
|
+ 同意撤回
|
|
|
|
+ </t-link>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
</t-table>
|
|
</t-table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="jsx" name="WorkStatistics">
|
|
<script setup lang="jsx" name="WorkStatistics">
|
|
-import { ref, reactive } from 'vue';
|
|
|
|
|
|
+import { ref, reactive, onMounted } from 'vue';
|
|
import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
|
|
import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
import {
|
|
import {
|
|
workStatisticsListApi,
|
|
workStatisticsListApi,
|
|
workStatisticsInfoApi,
|
|
workStatisticsInfoApi,
|
|
|
|
+ workStatisticsExportApi,
|
|
workStatisticsPassApi,
|
|
workStatisticsPassApi,
|
|
} from '@/api/work-hours';
|
|
} from '@/api/work-hours';
|
|
-
|
|
|
|
-const columns = [
|
|
|
|
- { 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: '管理',
|
|
|
|
- colKey: 'operate',
|
|
|
|
- fixed: 'right',
|
|
|
|
- width: 120,
|
|
|
|
- cell: (h, { row }) => {
|
|
|
|
- return (
|
|
|
|
- <div class="table-operations">
|
|
|
|
- <t-link
|
|
|
|
- theme="primary"
|
|
|
|
- hover="color"
|
|
|
|
- onClick={(e) => {
|
|
|
|
- e.stopPropagation();
|
|
|
|
- handlePass(row);
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 同意撤回
|
|
|
|
- </t-link>
|
|
|
|
- </div>
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
-];
|
|
|
|
-const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
|
|
|
|
- workStatisticsListApi
|
|
|
|
-);
|
|
|
|
-
|
|
|
|
-let statisticsInfo = reactive({ a: 1, b: 2, c: 3, d: 4, e: 5 });
|
|
|
|
-const getStatisticsInfo = async () => {
|
|
|
|
- const res = await workStatisticsInfoApi(params);
|
|
|
|
- statisticsInfo = res.data || {};
|
|
|
|
-};
|
|
|
|
|
|
+import { timestampFilter, flowStatusFilter } from '@/utils/filter';
|
|
|
|
+import { FLOW_STATUS } from '@/config/constants';
|
|
|
|
+import { dictToOptionList } from '@/utils/tool';
|
|
|
|
|
|
const fields = ref([
|
|
const fields = ref([
|
|
{
|
|
{
|
|
- prop: 'a',
|
|
|
|
|
|
+ prop: 'serviceId',
|
|
label: '服务单元',
|
|
label: '服务单元',
|
|
type: 'select',
|
|
type: 'select',
|
|
labelWidth: 100,
|
|
labelWidth: 100,
|
|
colSpan: 5,
|
|
colSpan: 5,
|
|
|
|
+ cell: 'service',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- prop: 'b',
|
|
|
|
|
|
+ prop: 'status',
|
|
label: '提交状态',
|
|
label: '提交状态',
|
|
type: 'select',
|
|
type: 'select',
|
|
labelWidth: 100,
|
|
labelWidth: 100,
|
|
colSpan: 5,
|
|
colSpan: 5,
|
|
|
|
+ options: dictToOptionList(FLOW_STATUS),
|
|
|
|
+ attrs: {
|
|
|
|
+ clearable: true,
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- prop: 'c',
|
|
|
|
|
|
+ prop: 'createId',
|
|
label: '提交人',
|
|
label: '提交人',
|
|
type: 'select',
|
|
type: 'select',
|
|
labelWidth: 100,
|
|
labelWidth: 100,
|
|
colSpan: 5,
|
|
colSpan: 5,
|
|
|
|
+ cell: 'creator',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- prop: 'd',
|
|
|
|
|
|
+ prop: 'userName',
|
|
label: '姓名',
|
|
label: '姓名',
|
|
labelWidth: 100,
|
|
labelWidth: 100,
|
|
colSpan: 5,
|
|
colSpan: 5,
|
|
|
|
+ attrs: {
|
|
|
|
+ clearable: true,
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 'buttons',
|
|
type: 'buttons',
|
|
@@ -134,42 +138,125 @@ const fields = ref([
|
|
],
|
|
],
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- prop: 'e',
|
|
|
|
|
|
+ prop: 'supplierId',
|
|
label: '所属供应商',
|
|
label: '所属供应商',
|
|
type: 'select',
|
|
type: 'select',
|
|
labelWidth: 100,
|
|
labelWidth: 100,
|
|
colSpan: 5,
|
|
colSpan: 5,
|
|
|
|
+ cell: 'supplier',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- prop: 'f',
|
|
|
|
|
|
+ prop: 'custom',
|
|
label: '客户名称',
|
|
label: '客户名称',
|
|
labelWidth: 100,
|
|
labelWidth: 100,
|
|
colSpan: 5,
|
|
colSpan: 5,
|
|
|
|
+ attrs: {
|
|
|
|
+ clearable: true,
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- prop: 'g',
|
|
|
|
|
|
+ prop: 'sopNo',
|
|
label: 'SOP流水号',
|
|
label: 'SOP流水号',
|
|
labelWidth: 100,
|
|
labelWidth: 100,
|
|
colSpan: 5,
|
|
colSpan: 5,
|
|
|
|
+ attrs: {
|
|
|
|
+ clearable: true,
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- prop: 'h',
|
|
|
|
|
|
+ prop: 'days',
|
|
|
|
+ type: 'number',
|
|
label: '违规工时>',
|
|
label: '违规工时>',
|
|
labelWidth: 100,
|
|
labelWidth: 100,
|
|
colSpan: 5,
|
|
colSpan: 5,
|
|
|
|
+ attrs: {
|
|
|
|
+ theme: 'column',
|
|
|
|
+ decimalPlaces: 0,
|
|
|
|
+ max: 1000000,
|
|
|
|
+ min: 0,
|
|
|
|
+ style: 'width: 120px',
|
|
|
|
+ },
|
|
},
|
|
},
|
|
]);
|
|
]);
|
|
const params = reactive({
|
|
const params = reactive({
|
|
- a: '',
|
|
|
|
- b: '',
|
|
|
|
- c: '',
|
|
|
|
- d: '',
|
|
|
|
- e: '',
|
|
|
|
- f: '',
|
|
|
|
- g: '',
|
|
|
|
- h: '',
|
|
|
|
|
|
+ serviceId: '',
|
|
|
|
+ status: '',
|
|
|
|
+ createId: '',
|
|
|
|
+ userName: '',
|
|
|
|
+ supplierId: '',
|
|
|
|
+ custom: '',
|
|
|
|
+ sopNo: '',
|
|
|
|
+ days: '',
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+const columns = [
|
|
|
|
+ { colKey: 'service', title: '服务单元' },
|
|
|
|
+ { colKey: 'sopNo', title: 'SOP流水号' },
|
|
|
|
+ { colKey: 'custom', title: '客户名称' },
|
|
|
|
+ { colKey: 'province', title: '省份' },
|
|
|
|
+ { colKey: 'city', title: '城市' },
|
|
|
|
+ {
|
|
|
|
+ colKey: 'examStartTime',
|
|
|
|
+ title: '项目开始时间',
|
|
|
|
+ width: 170,
|
|
|
|
+ cell: 'start-time',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ colKey: 'examEndTime',
|
|
|
|
+ title: '项目结束时间',
|
|
|
|
+ width: 170,
|
|
|
|
+ cell: 'end-time',
|
|
|
|
+ },
|
|
|
|
+ { colKey: 'userName', title: '姓名(人员档案号)', cell: 'user', width: 150 },
|
|
|
|
+ { colKey: 'roleName', title: '项目角色' },
|
|
|
|
+ { colKey: 'supplier', title: '供应商' },
|
|
|
|
+ { colKey: 'attendance', title: '实际出勤(天)', width: 120 },
|
|
|
|
+ { colKey: 'weekdays', title: '工作日(天)', width: 110 },
|
|
|
|
+ { colKey: 'weekends', title: '周末(天)', width: 100 },
|
|
|
|
+ { colKey: 'holidays', title: '法定节假日(天)', width: 140 },
|
|
|
|
+ { colKey: 'workHours', title: '累计工时(天)', width: 120 },
|
|
|
|
+ { colKey: 'violationDays', title: '违规工时(天)', width: 120 },
|
|
|
|
+ { colKey: 'submitter', title: '提交人' },
|
|
|
|
+ {
|
|
|
|
+ colKey: 'submissionTime',
|
|
|
|
+ title: '提交时间',
|
|
|
|
+ cell: 'submit-time',
|
|
|
|
+ width: 170,
|
|
|
|
+ },
|
|
|
|
+ { colKey: 'status', title: '提交状态', cell: 'status', width: 100 },
|
|
|
|
+ {
|
|
|
|
+ title: '管理',
|
|
|
|
+ colKey: 'operate',
|
|
|
|
+ cell: 'operate',
|
|
|
|
+ fixed: 'right',
|
|
|
|
+ width: 100,
|
|
|
|
+ },
|
|
|
|
+];
|
|
|
|
+const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
|
|
|
|
+ workStatisticsListApi
|
|
|
|
+);
|
|
|
|
+
|
|
|
|
+let statisticsInfo = ref({});
|
|
|
|
+const getStatisticsInfo = async () => {
|
|
|
|
+ const res = await workStatisticsInfoApi(params);
|
|
|
|
+ statisticsInfo.value = res || {};
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const handleExport = () => {
|
|
|
|
+ const confirmDia = DialogPlugin({
|
|
|
|
+ header: '操作提示',
|
|
|
|
+ body: `确定要导出查询到的所有结果吗?`,
|
|
|
|
+ confirmBtn: '确定',
|
|
|
|
+ cancelBtn: '取消',
|
|
|
|
+ onConfirm: async () => {
|
|
|
|
+ confirmDia.hide();
|
|
|
|
+ const res = await workStatisticsExportApi(params).catch(() => {});
|
|
|
|
+ if (!res) return;
|
|
|
|
+ MessagePlugin.success('开始下载');
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+
|
|
const handlePass = (row) => {
|
|
const handlePass = (row) => {
|
|
const confirmDia = DialogPlugin({
|
|
const confirmDia = DialogPlugin({
|
|
header: '同意撤回提示',
|
|
header: '同意撤回提示',
|
|
@@ -185,4 +272,8 @@ const handlePass = (row) => {
|
|
},
|
|
},
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+onMounted(() => {
|
|
|
|
+ getStatisticsInfo();
|
|
|
|
+});
|
|
</script>
|
|
</script>
|