refactor(expense-management):恢复并优化日期选择功能

- 在成本详情、支出详情和分摊详情页面中重新启用年份和月份选择功能
-优化日期选择器的格式和价值格式
- 在搜索时去除月份参数的前置0,确保正确传递参数
- 调整搜索表单的样式,移除多余的样式属性
This commit is contained in:
dj
2025-08-20 00:00:44 +08:00
parent d20b968307
commit e1543e05b4
3 changed files with 102 additions and 82 deletions

View File

@@ -26,32 +26,32 @@ import {
const router = useRouter()
const route = useRoute()
const searchConfig = ref([
// {
// label: '年份',
// prop: 'rdYear',
// component: 'el-date-picker',
// props: {
// placeholder: '请选择年份',
// clearable: true,
// type: 'year',
// format: 'YYYY',
// valueFormat: 'YYYY',
// },
// colProps: {}
// },
// {
// label: '月份',
// prop: 'rdMonth',
// component: 'el-date-picker',
// props: {
// placeholder: '请选择月份',
// clearable: true,
// type: 'month',
// format: 'MM',
// valueFormat: 'MM',
// },
// colProps: {}
// },
{
label: '年份',
prop: 'rdYear',
component: 'el-date-picker',
props: {
placeholder: '请选择年份',
clearable: true,
type: 'year',
format: 'YYYY',
valueFormat: 'YYYY',
},
colProps: {}
},
{
label: '月份',
prop: 'rdMonth',
component: 'el-date-picker',
props: {
placeholder: '请选择月份',
clearable: true,
type: 'month',
format: 'MM',
valueFormat: 'MM',
},
colProps: {}
},
{
label: '主项目',
prop: 'masterProjectName',
@@ -284,7 +284,15 @@ getMasterProjectName()
getSubprojectName()
const search = (val) => {
tableConfig.params = {...val}
// 去除 rdMonth 前置0
let param={
...val
}
if (param.rdMonth) {
param.rdMonth = parseInt(param.rdMonth, 10).toString();
}
tableConfig.params = {...param}
tableIns.value.refresh()
}

View File

@@ -20,32 +20,32 @@ const router = useRouter()
const route = useRoute()
const searchConfig = ref(
[
// {
// label: '年份',
// prop: 'paymentYear',
// component: 'el-date-picker',
// props: {
// placeholder: '请选择年份',
// clearable: true,
// type: 'year',
// format: 'YYYY',
// valueFormat: 'YYYY',
// },
// colProps: {}
// },
// {
// label: '月份',
// prop: 'paymentMonth',
// component: 'el-date-picker',
// props: {
// placeholder: '请选择月份',
// clearable: true,
// type: 'month',
// format: 'MM',
// valueFormat: 'MM',
// },
// colProps: {}
// },
{
label: '年份',
prop: 'paymentYear',
component: 'el-date-picker',
props: {
placeholder: '请选择年份',
clearable: true,
type: 'year',
format: 'YYYY',
valueFormat: 'YYYY',
},
colProps: {}
},
{
label: '月份',
prop: 'paymentMonth',
component: 'el-date-picker',
props: {
placeholder: '请选择月份',
clearable: true,
type: 'month',
format: 'MM',
valueFormat: 'MM',
},
colProps: {}
},
{
label: '主项目',
prop: 'masterProjectName',
@@ -286,7 +286,13 @@ const getSubprojectName =async (val) => {
getMasterProjectName()
getSubprojectName()
const search = (val) => {
tableConfig.params = {...val}
let param={
...val
}
if (param.paymentMonth) {
param.paymentMonth = parseInt(param.paymentMonth, 10).toString();
}
tableConfig.params = {...param}
tableIns.value.refresh()
}
const init = async () => {

View File

@@ -1,5 +1,5 @@
<template>
<fvSearchForm :searchConfig="searchConfig" @search="search" style="margin-left: 16px"></fvSearchForm>
<fvSearchForm :searchConfig="searchConfig" @search="search" ></fvSearchForm>
<!-- <el-button color="#DED0B2" style="float: left;margin: 0 10px 10px 0" @click="exportTable">导出</el-button>-->
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick" @selectionChange="selectionChange">
@@ -24,32 +24,32 @@ import {
const router = useRouter()
const route = useRoute()
const searchConfig = ref([
// {
// label: '年份',
// prop: 'paymentYear',
// component: 'el-date-picker',
// props: {
// placeholder: '请选择年份',
// clearable: true,
// type: 'year',
// format: 'YYYY',
// valueFormat: 'YYYY',
// },
// colProps: {}
// },
// {
// label: '月份',
// prop: 'paymentMonth',
// component: 'el-date-picker',
// props: {
// placeholder: '请选择月份',
// clearable: true,
// type: 'month',
// format: 'MM',
// valueFormat: 'MM',
// },
// colProps: {}
// },
{
label: '年份',
prop: 'paymentYear',
component: 'el-date-picker',
props: {
placeholder: '请选择年份',
clearable: true,
type: 'year',
format: 'YYYY',
valueFormat: 'YYYY',
},
colProps: {}
},
{
label: '月份',
prop: 'paymentMonth',
component: 'el-date-picker',
props: {
placeholder: '请选择月份',
clearable: true,
type: 'month',
format: 'M',
valueFormat: 'M',
},
colProps: {}
},
{
label: '主项目',
prop: 'masterProjectName',
@@ -249,7 +249,13 @@ getMasterProjectName()
getSubprojectName()
const search = (val) => {
tableConfig.params = {...val}
let param={
...val
}
if (param.paymentMonth) {
param.paymentMonth = parseInt(param.paymentMonth, 10).toString();
}
tableConfig.params = {...param}
tableIns.value.refresh()
}
const headBtnClick = (key) => {