This commit is contained in:
2025-10-30 13:37:52 +08:00
parent d859ba62c8
commit c9c8f82910
31 changed files with 1485 additions and 397 deletions

View File

@@ -54,7 +54,7 @@
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:total="listQuery.total"
@pagination="getDataList" />
@pagination="getNavDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@@ -87,9 +87,12 @@ import ButtonNav from '@/components/ButtonNav';
const tableProps = [
{
prop: 'recTime',
prop: 'time',
label: '日期',
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
},
{
prop: 'remark',
label: '备注',
},
{
prop: 'otherCostName',
@@ -99,9 +102,14 @@ const tableProps = [
prop: 'price',
label: '总价(元)',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
];
const tableProps2 = [
// {
// prop: 'remark',
// label: '备注',
// },
{
prop: 'otherCostName',
label: '成本名称',
@@ -110,6 +118,7 @@ const tableProps2 = [
prop: 'price',
label: '总价(元)',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
];
export default {
@@ -182,13 +191,16 @@ export default {
{
type: 'datePicker',
label: '时间范围',
dateType: 'daterange',
format: 'yyyy-MM-dd',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
defaultTime: ['08:30:00', '08:30:00'],
param: 'searchTime',
width: 350,
clearable: false,
},
{
type: 'button',
@@ -237,26 +249,20 @@ export default {
},
methods: {
buttonClick(val) {
if (val.statisticType === 2) {
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年第{w}周');
}else{
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年{m}月{d}日');
}
this.formConfig2[1].startPlaceholder = '开始时间';
this.formConfig2[1].endPlaceholder = '结束时间';
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.name = val.name || null;
this.listQuery.statisticType = val.statisticType || 1;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
? val.searchTime[1]
: null;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
this.getDataList();
} else {
this.getDataList2();
@@ -267,13 +273,18 @@ export default {
break;
case 'export':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.name = val.name || null;
this.listQuery.statisticType = val.statisticType || 1;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
? val.searchTime[1]
: null;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
}
this.handleExport();
break;
default:
@@ -295,15 +306,26 @@ export default {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
this.formConfig2[1].startPlaceholder = parseTime(start).substr(0, 10);
this.formConfig2[1].endPlaceholder = parseTime(end).substr(0, 10);
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
this.$nextTick(() => {
this.$refs.searchBarForm2.formInline.searchTime = [
this.listQuery.startTime,
this.listQuery.endTime,
];
});
this.listQuery.name = null;
this.listQuery.pageNo = 1;
this.getDataList2();
}
},
getNavDataList(){
if (this.activeName === 'his') {
this.getDataList();
} else {
this.getDataList2();
}
},
// 获取数据2列表
getDataList2() {
getRawOthercostSunPage(this.listQuery).then((response) => {