Commit 957c5344 authored by ccc2wdd's avatar ccc2wdd

变更签证,统计页面有初始年份和季度

parent 68e4c565
...@@ -23,7 +23,10 @@ ...@@ -23,7 +23,10 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, ref } from 'vue'; import { onMounted, ref } from 'vue';
import { Table } from 'ant-design-vue'; import { Table } from 'ant-design-vue';
import { getStatisticListAll, exportChangeSignature } from '@/api/changeSignatrue/changeSignatrue'; import {
getStatisticListAll,
exportChangeSignature,
} from '@/api/changeSignatrue/changeSignatrue';
import { BasicForm, FormActionType, FormSchema, useForm } from '@/components/Form'; import { BasicForm, FormActionType, FormSchema, useForm } from '@/components/Form';
import StatisticWindow from '@/views/monthlyPlan/statisticWindow/statisticWindow.vue'; import StatisticWindow from '@/views/monthlyPlan/statisticWindow/statisticWindow.vue';
import { useModal } from '@/components/Modal'; import { useModal } from '@/components/Modal';
...@@ -33,50 +36,9 @@ ...@@ -33,50 +36,9 @@
import { useUserStore } from '@/store/modules/user'; import { useUserStore } from '@/store/modules/user';
import moment from 'moment'; import moment from 'moment';
const seach = ref([ const currentMonth = new Date().getMonth() + 1;
{ const currentquarter = getQuarter();
field: 'givenYear',
label: '',
component: 'DatePicker',
componentProps: {
placeholder: '年份',
picker: 'year',
valueFormat: 'YYYY',
format: 'YYYY',
style: {
width: '100%',
},
},
colProps: { span: 4 },
},
{
field: 'quarter',
label: '',
component: 'Select',
componentProps: {
placeholder: '季度',
options: [
{
label: '第一季度',
value: '第一季度',
},
{
label: '第二季度',
value: '第二季度',
},
{
label: '第三季度',
value: '第三季度',
},
{
label: '第四季度',
value: '第四季度',
},
],
},
colProps: { span: 4 },
},
]);
// 列表 // 列表
const dataSource = ref([]); const dataSource = ref([]);
// 表头 // 表头
...@@ -193,8 +155,69 @@ ...@@ -193,8 +155,69 @@
const { push } = useRouter(); const { push } = useRouter();
const deptId = ref(''); const deptId = ref('');
const params = ref({ givenYear: '', quarter: '', deptId: '' }); const params = ref({ givenYear: '', quarter: '', deptId: '' });
const seach = ref([
{
field: 'givenYear',
label: '',
component: 'DatePicker',
componentProps: {
defaultValue: moment().format('YYYY'),
placeholder: '年份',
picker: 'year',
valueFormat: 'YYYY',
format: 'YYYY',
style: {
width: '100%',
},
},
colProps: { span: 4 },
},
{
field: 'quarter',
label: '',
component: 'Select',
componentProps: {
defaultValue: currentquarter,
placeholder: '季度',
options: [
{
label: '第一季度',
value: '第一季度',
},
{
label: '第二季度',
value: '第二季度',
},
{
label: '第三季度',
value: '第三季度',
},
{
label: '第四季度',
value: '第四季度',
},
],
},
colProps: { span: 4 },
},
]);
onMounted(async () => { onMounted(async () => {
deptId.value = useUserStore().userInfo.deptId; deptId.value = useUserStore().userInfo.deptId;
// 获取当前日期
const now = new Date();
// 设置当前年份
params.value.givenYear = now.getFullYear().toString();
// 计算当前季度
const currentMonth = now.getMonth() + 1; // getMonth() 返回的月份是从 0 开始的
if (currentMonth <= 3) {
params.value.quarter = '第一季度';
} else if (currentMonth <= 6) {
params.value.quarter = '第二季度';
} else if (currentMonth <= 9) {
params.value.quarter = '第三季度';
} else {
params.value.quarter = '第四季度';
}
getStatisticList(); getStatisticList();
}); });
...@@ -213,6 +236,17 @@ ...@@ -213,6 +236,17 @@
downloadByData(data, '变更签证管理统计报表' + '.xls'); downloadByData(data, '变更签证管理统计报表' + '.xls');
} }
const loadingRef = ref(false); const loadingRef = ref(false);
function getQuarter() {
if (currentMonth <= 3) {
return '第一季度';
} else if (currentMonth <= 6) {
return '第二季度';
} else if (currentMonth <= 9) {
return '第三季度';
} else {
return '第四季度';
}
}
function handleSubmit() { function handleSubmit() {
let data = getFieldsValue(); let data = getFieldsValue();
params.value = data; params.value = data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment