新增报表

This commit is contained in:
‘937886381’
2024-04-22 17:14:59 +08:00
parent 29c3a9fb72
commit 5ea4c219ed
12 changed files with 449 additions and 102 deletions

View File

@@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-04-18 14:08:46
* @LastEditTime: 2024-04-22 08:48:08
* @LastEditTime: 2024-04-22 17:10:49
* @LastEditors: zhp
* @Description:
-->
@@ -116,10 +116,6 @@ export default {
},
codeList: ['sj1', 'sj2', 'sj3', 'sj4', 'sj5', 'sj7', 'sj8', 'sj10', 'sj11', 'sj12', 'sj13', 'sj14'],
tableData: [],
listQuery: {
productionLineId: 1696716506443354114,
startTime: "2024-01-19 07:00:00"
},
formConfig: [
{
type: 'datePicker',
@@ -157,8 +153,8 @@ export default {
},
mounted() {
// this.formConfig[1].defaultSelect[]
this.listQuery.startTime = this.formConfig[0].defaultSelect[0]
this.listQuery.endTime = this.formConfig[0].defaultSelect[1]
// this.listQuery.startTime = this.formConfig[0].defaultSelect[0]
// this.listQuery.endTime = this.formConfig[0].defaultSelect[1]
// this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000
this.getDataList()
// this.getSpanArr(this.tableData)
@@ -239,7 +235,10 @@ export default {
this.dataListLoading = true;
// this.listQuery.startTime = '1713197388000';
// this.listQuery.endTime = '1713254961000';
this.urlOptions.getDataListURL(this.listQuery).then(res => {
this.urlOptions.getDataListURL({
productionLineId: '1696716506443354114',
startTime: '1705618800000'
},).then(res => {
console.log(res.data);
// console.log(res)
// console.log(res.data)

View File

@@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-04-18 10:01:33
* @LastEditTime: 2024-04-18 16:26:48
* @LastEditTime: 2024-04-22 14:42:31
* @LastEditors: zhp
* @Description:
-->
@@ -163,35 +163,35 @@ export default {
// this.getDict();
},
methods: {
getSummaries(param) {
console.log(columns)
// getSummaries(param) {
// console.log(columns)
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
// const data = data.map(item => !Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] += ' ';
} else {
sums[index] = '-';
}
});
// const { columns, data } = param;
// const sums = [];
// columns.forEach((column, index) => {
// if (index === 0) {
// sums[index] = '合计';
// return;
// }
// const values = data.map(item => Number(item[column.property]));
// // const data = data.map(item => !Number(item[column.property]));
// if (!values.every(value => isNaN(value))) {
// sums[index] = values.reduce((prev, curr) => {
// const value = Number(curr);
// if (!isNaN(value)) {
// return prev + curr;
// } else {
// return prev;
// }
// }, 0);
// sums[index] += ' ';
// } else {
// sums[index] = '-';
// }
// });
return sums;
},
// return sums;
// },
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
let spanOneArr = [], concatOne = 0;
this.tableData.map((item, index) => {