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 router = useRouter()
const route = useRoute() const route = useRoute()
const searchConfig = ref([ const searchConfig = ref([
// { {
// label: '年份', label: '年份',
// prop: 'rdYear', prop: 'rdYear',
// component: 'el-date-picker', component: 'el-date-picker',
// props: { props: {
// placeholder: '请选择年份', placeholder: '请选择年份',
// clearable: true, clearable: true,
// type: 'year', type: 'year',
// format: 'YYYY', format: 'YYYY',
// valueFormat: 'YYYY', valueFormat: 'YYYY',
// }, },
// colProps: {} colProps: {}
// }, },
// { {
// label: '月份', label: '月份',
// prop: 'rdMonth', prop: 'rdMonth',
// component: 'el-date-picker', component: 'el-date-picker',
// props: { props: {
// placeholder: '请选择月份', placeholder: '请选择月份',
// clearable: true, clearable: true,
// type: 'month', type: 'month',
// format: 'MM', format: 'MM',
// valueFormat: 'MM', valueFormat: 'MM',
// }, },
// colProps: {} colProps: {}
// }, },
{ {
label: '主项目', label: '主项目',
prop: 'masterProjectName', prop: 'masterProjectName',
@@ -284,7 +284,15 @@ getMasterProjectName()
getSubprojectName() getSubprojectName()
const search = (val) => { 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() tableIns.value.refresh()
} }

View File

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

View File

@@ -1,5 +1,5 @@
<template> <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>--> <!-- <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"> <fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick" @selectionChange="selectionChange">
@@ -24,32 +24,32 @@ import {
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
const searchConfig = ref([ const searchConfig = ref([
// { {
// label: '年份', label: '年份',
// prop: 'paymentYear', prop: 'paymentYear',
// component: 'el-date-picker', component: 'el-date-picker',
// props: { props: {
// placeholder: '请选择年份', placeholder: '请选择年份',
// clearable: true, clearable: true,
// type: 'year', type: 'year',
// format: 'YYYY', format: 'YYYY',
// valueFormat: 'YYYY', valueFormat: 'YYYY',
// }, },
// colProps: {} colProps: {}
// }, },
// { {
// label: '月份', label: '月份',
// prop: 'paymentMonth', prop: 'paymentMonth',
// component: 'el-date-picker', component: 'el-date-picker',
// props: { props: {
// placeholder: '请选择月份', placeholder: '请选择月份',
// clearable: true, clearable: true,
// type: 'month', type: 'month',
// format: 'MM', format: 'M',
// valueFormat: 'MM', valueFormat: 'M',
// }, },
// colProps: {} colProps: {}
// }, },
{ {
label: '主项目', label: '主项目',
prop: 'masterProjectName', prop: 'masterProjectName',
@@ -249,7 +249,13 @@ getMasterProjectName()
getSubprojectName() getSubprojectName()
const search = (val) => { 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() tableIns.value.refresh()
} }
const headBtnClick = (key) => { const headBtnClick = (key) => {