diff --git a/src/views/oa/erp/timesheetReport/projectManHour/index.vue b/src/views/oa/erp/timesheetReport/projectManHour/index.vue
index f669aca..fa98e0d 100644
--- a/src/views/oa/erp/timesheetReport/projectManHour/index.vue
+++ b/src/views/oa/erp/timesheetReport/projectManHour/index.vue
@@ -17,24 +17,10 @@
-
-
+
+
-
-
+
搜索
@@ -82,6 +68,7 @@ import {
} from '@/api/oa/erp/timesheetReport';
import { getErpProjectInfoList } from '@/api/oa/erp/projectInfo';
import { allListDept, listDept } from '@/api/system/dept';
+import { FormInstance } from 'element-plus';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { project_category } = toRefs(proxy?.useDict('project_category'));
@@ -92,11 +79,12 @@ const showSearch = ref(true);
const ids = ref>([]);
const single = ref(true);
const multiple = ref(true);
-const dateRange = ref<[string, string]>(['', '']);
+const monthRange = ref<[string, string]>(['', '']);
const projectOptions = ref([]);
const deptOptions = ref([]);
const projectLoading = ref(false);
+const queryRef = ref();
const queryParams = ref({
pageNum: 1,
@@ -108,19 +96,22 @@ const queryParams = ref({
});
const totalHoursLabel = computed(() => {
- if (dateRange.value && dateRange.value[0] && dateRange.value[1]) {
- return `当月工时 (${dateRange.value[0]} 至 ${dateRange.value[1]})`;
+ if (monthRange.value && monthRange.value[0] && monthRange.value[1]) {
+ const start = monthRange.value[0];
+ const end = monthRange.value[1];
+ const fmt = (m: string) => m.substring(0, 4) + '年' + m.substring(4) + '月';
+ return `工时 (${fmt(start)} 至 ${fmt(end)})`;
}
- return '当月工时';
+ return '工时';
});
/** 查询列表 */
const getList = async () => {
loading.value = true;
const params = { ...queryParams.value };
- if (dateRange.value) {
- params.startTime = dateRange.value[0];
- params.endTime = dateRange.value[1];
+ if (monthRange.value && monthRange.value[0] && monthRange.value[1]) {
+ params.startTime = monthRange.value[0];
+ params.endTime = monthRange.value[1];
}
const res = await listProjectManHourReport(params);
reportList.value = res.data;
@@ -146,17 +137,17 @@ const handleSelectionChange = (selection: ProjectManHourReportVO[]) => {
/** 重置按钮操作 */
const resetQuery = () => {
- dateRange.value = ['', ''];
- (proxy as any)?.resetForm('queryRef');
+ monthRange.value = ['', ''];
+ queryRef.value?.resetFields();
handleQuery();
};
/** 导出按钮操作 */
const handleExport = () => {
const params = { ...queryParams.value };
- if (dateRange.value) {
- params.startTime = dateRange.value[0];
- params.endTime = dateRange.value[1];
+ if (monthRange.value && monthRange.value[0] && monthRange.value[1]) {
+ params.startTime = monthRange.value[0];
+ params.endTime = monthRange.value[1];
}
proxy?.download('/oa/erp/timesheetReport/exportProjectManHour', params, `项目工时统计报表_${new Date().getTime()}.xlsx`);
};
@@ -213,16 +204,6 @@ const getDeptList = async () => {
deptOptions.value = res.data || res.rows || [];
};
-/** 禁用非周一的日期 */
-const disabledDateStart = (date: Date) => {
- // getDay() 返回 0=周日, 1=周一
- return date.getDay() !== 1;
-};
-
-const disabledDateEnd = (date: Date) => {
- return date.getDay() !== 0;
-};
-
const spanArr = ref([]);
const pos = ref(0);
diff --git a/src/views/oa/erp/timesheetReport/projectPersonnel/index.vue b/src/views/oa/erp/timesheetReport/projectPersonnel/index.vue
index 79c5a00..b4d9bba 100644
--- a/src/views/oa/erp/timesheetReport/projectPersonnel/index.vue
+++ b/src/views/oa/erp/timesheetReport/projectPersonnel/index.vue
@@ -6,22 +6,20 @@
-
+
-
@@ -74,15 +72,18 @@