Commit a440540a authored by ccc2wdd's avatar ccc2wdd

招标管理,统计页面有初始年份和季度

parent 957c5344
......@@ -33,6 +33,20 @@
import { useUserStore } from '@/store/modules/user';
import moment from 'moment';
const params = ref({ tenderYear: '', biddingQuarter: '', companyName: '' });
const currentMonth = moment().format('MM');
const currentquarter = getQuarter();
function getQuarter() {
if (currentMonth <= 3) {
return '第一季度';
} else if (currentMonth <= 6) {
return '第二季度';
} else if (currentMonth <= 9) {
return '第三季度';
} else {
return '第四季度';
}
}
const seach = ref([
{
field: 'tenderYear',
......@@ -56,7 +70,7 @@
component: 'Select',
componentProps: {
placeholder: '季度',
defaultValue: '第一季度',
defaultValue: currentquarter,
options: [
{
label: '第一季度',
......@@ -82,6 +96,10 @@
const deptId = ref('');
onMounted(async () => {
deptId.value = useUserStore().userInfo.deptId;
// 设置当前年份
params.value.tenderYear = moment().format('YYYY');
// 设置当前季度
params.value.biddingQuarter = currentquarter;
getStatisticList();
});
......@@ -96,12 +114,13 @@
});
async function exportCount() {
const params = getFieldsValue();
const data = await exportStatisticList(params);
const data = await exportStatisticList(params.value);
downloadByData(data, '招标管理统计报表' + '.xlsx');
}
const loadingRef = ref(false);
function handleSubmit() {
let data = getFieldsValue();
params.value = data;
getStatisticList();
}
function setRowClassName(record) {
......@@ -122,7 +141,6 @@
return `${year}-${month}`;
}
async function getStatisticList() {
const params = getFieldsValue();
// if (params.tenderYear === undefined || params.tenderYear === null) {
// // 创建一个表示当前日期和时间的 Date 对象
// var currentDate = new Date();
......@@ -133,7 +151,7 @@
// columns[0].title = params.tenderYear + '年招标管理';
// }
loadingRef.value = true;
let data = await getListAll(params);
let data = await getListAll(params.value);
// dataSource.value = data;
let propsList = ['companyName', 'projectName'];
propsList.map((item) => {
......
import { BasicColumn, FormSchema } from '@/components/Table';
import {useUserStore} from "@/store/modules/user";
const deptId = useUserStore().userInfo.deptParentId;
const deptId = ''+useUserStore().userInfo.deptParentId;
//主模块-招标计划列表页
export const columns: BasicColumn[] = [
{
......
......@@ -29,23 +29,86 @@
import PageCard from '@/components/Page/src/PageCard.vue';
import { useRouter } from 'vue-router';
import { downloadByData } from '@/utils/file/download';
import moment from 'moment';
const currentMonth = moment().format('MM');
const currentquarter = getQuarter();
function getQuarter() {
if (currentMonth <= 3) {
return '第一季度';
} else if (currentMonth <= 6) {
return '第二季度';
} else if (currentMonth <= 9) {
return '第三季度';
} else {
return '第四季度';
}
}
const { push } = useRouter();
onMounted(async () => {
getStatisticList();
});
const seach = ref([
{
field: 'tenderYear',
label: '',
component: 'DatePicker',
componentProps: {
placeholder: '年份',
picker: 'year',
defaultValue: moment().format('YYYY'),
valueFormat: 'YYYY',
format: 'YYYY',
style: {
width: '100%',
},
},
colProps: { span: 4 },
},
{
field: 'biddingQuarter',
label: '',
component: 'Select',
componentProps: {
placeholder: '季度',
defaultValue: currentquarter,
options: [
{
label: '第一季度',
value: '第一季度',
},
{
label: '第二季度',
value: '第二季度',
},
{
label: '第三季度',
value: '第三季度',
},
{
label: '第四季度',
value: '第四季度',
},
],
},
colProps: { span: 4 },
},
]);
defineOptions({ name: 'MonthlyPlan' });
const [register, { openModal: openModal }] = useModal();
const formElRef = ref<Nullable<FormActionType>>(null);
const [registerForm, { getFieldsValue }] = useForm({
labelWidth: 90,
baseColProps: { span: 24 },
schemas: searchFormSchema,
schemas: seach,
showActionButtonGroup: false,
});
const params = ref({ tenderYear: '', biddingQuarter: '', companyName: '' });
const loadingRef = ref(false);
onMounted(async () => {
// 设置当前年份
params.value.tenderYear = moment().format('YYYY');
// 设置当前季度
params.value.biddingQuarter = currentquarter;
getStatisticList();
});
function handleSubmit() {
// let data = getFieldsValue();
// params.value = data;
......@@ -54,6 +117,8 @@
// } else {
// columns[0].title = '招标计划';
// }
let data = getFieldsValue();
params.value = data;
getStatisticList();
}
async function exportCount() {
......
......@@ -36,9 +36,19 @@
import { useUserStore } from '@/store/modules/user';
import moment from 'moment';
const currentMonth = new Date().getMonth() + 1;
const currentMonth = moment().format('MM');
const currentquarter = getQuarter();
function getQuarter() {
if (currentMonth <= 3) {
return '第一季度';
} else if (currentMonth <= 6) {
return '第二季度';
} else if (currentMonth <= 9) {
return '第三季度';
} else {
return '第四季度';
}
}
// 列表
const dataSource = ref([]);
// 表头
......@@ -203,21 +213,10 @@
]);
onMounted(async () => {
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 = '第四季度';
}
params.value.givenYear = moment().format('YYYY');
// 设置当前季度
params.value.quarter = currentquarter;
getStatisticList();
});
......@@ -236,17 +235,7 @@
downloadByData(data, '变更签证管理统计报表' + '.xls');
}
const loadingRef = ref(false);
function getQuarter() {
if (currentMonth <= 3) {
return '第一季度';
} else if (currentMonth <= 6) {
return '第二季度';
} else if (currentMonth <= 9) {
return '第三季度';
} else {
return '第四季度';
}
}
function handleSubmit() {
let data = getFieldsValue();
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