原片追溯,报表日期

This commit is contained in:
helloDy
2024-04-26 10:16:07 +08:00
parent de831b339f
commit 4cafa78908
7 changed files with 287 additions and 194 deletions

View File

@@ -1,7 +1,7 @@
<!--
* @Author: Do not edit
* @Date: 2024-04-22 15:49:56
* @LastEditTime: 2024-04-25 14:30:44
* @LastEditTime: 2024-04-26 10:14:50
* @LastEditors: DY
* @Description:
-->
@@ -94,26 +94,45 @@ export default {
now.setHours(0, 0, 0, 0)
now.setDate(1)
let startOfMonth = now.getTime()
// let firstDayOfMonth = new Date(startOfMonth)
this.listQuery.time = startOfMonth
},
mounted() {
this.getList();
},
methods: {
getTime1() {
const firstDayOfMonth = new Date(this.listQuery.time)
const lastDayOfMonth = new Date(firstDayOfMonth.getFullYear(), firstDayOfMonth.getMonth() + 1, 0, 0, 0, 0, 0)
// console.log('时间', parseTime(firstDayOfMonth), parseTime(lastDayOfMonth))
this.$set(this.tableProps[2], 'label', '许昌安彩月原片生产汇总(' + parseTime(firstDayOfMonth) + '-' + parseTime(lastDayOfMonth) + ')')
this.$set(this.tableProps1[2], 'label', '许昌安彩月成品生产汇总(' + parseTime(firstDayOfMonth) + '-' + parseTime(lastDayOfMonth) + ')')
// this.tableProps[2].label = '许昌安彩月原片生产汇总(' + parseTime(firstDayOfMonth) + '-' + parseTime(lastDayOfMonth) + ')'
// this.tableProps1[2].label = '许昌安彩月成品生产汇总(' + parseTime(firstDayOfMonth) + '-' + parseTime(lastDayOfMonth) + ')'
console.log(this.tableProps, this.tableProps1)
},
async getList() {
const firstDayOfMonth = new Date(this.listQuery.time)
const lastDayOfMonth = new Date(firstDayOfMonth.getFullYear(), firstDayOfMonth.getMonth() + 1, 0, 0, 0, 0, 0)
this.tableData = [];
this.tableProps = [
{
prop: 'lineName',
label: '',
fixed: true,
width: 150,
},
{
prop: 'paramsName',
label: '',
fixed: true,
width: 150,
},
{
prop: 'xc',
label: '许昌安彩月原片生产汇总(' + parseTime(firstDayOfMonth) + '-' + parseTime(lastDayOfMonth) + ')',
// align: 'center',
children: []
}
];
this.tableData1 = [];
this.tableProps1 = [
@@ -121,18 +140,26 @@ export default {
prop: 'lineName',
label: '',
fixed: true,
width: 150,
},
{
prop: 'paramsName',
label: '',
fixed: true,
width: 150,
},
{
prop: 'xc1',
label: '许昌安彩月成品生产汇总(' + parseTime(firstDayOfMonth) + '-' + parseTime(lastDayOfMonth) + ')',
// align: 'center',
children: []
}
];
await productionMonthY(this.listQuery).then((res) => {
this.resData = res.data;
// 设置表头
Object.keys(this.resData).forEach((item) => {
this.tableProps.push({
this.tableProps[2].children.push({
prop: item,
label: item,
'show-overflow-tooltip': true,
@@ -144,7 +171,7 @@ export default {
this.resData1 = res.data;
// 设置表头
Object.keys(this.resData1).forEach((item) => {
this.tableProps1.push({
this.tableProps1[2].children.push({
prop: item,
label: item,
'show-overflow-tooltip': true,
@@ -152,6 +179,7 @@ export default {
});
this.buildTableData1(this.resData1);
});
// this.getTime1()
},
// 设置表格2数据
buildTableData1(data) {

View File

@@ -1,7 +1,7 @@
<!--
* @Author: Do not edit
* @Date: 2024-04-22 15:49:56
* @LastEditTime: 2024-04-25 11:14:34
* @LastEditTime: 2024-04-25 19:16:49
* @LastEditors: DY
* @Description:
-->
@@ -80,9 +80,25 @@ export default {
// glassWeekShow: false,
// proWeekShow: false,
tableData: [],
tableProps: [],
tableProps: [
{
prop: 'xc',
label: '许昌安彩年原片生产汇总',
align: 'center',
// fixed: true,
// width: 500,
children: []
}
],
tableData1: [],
tableProps1: [],
tableProps1: [
{
prop: 'xc1',
label: '许昌安彩年成品生产汇总',
align: 'center',
children: []
}
],
resData: [],
span1: [], //表格1的合并规则
resData1: [],
@@ -103,9 +119,17 @@ export default {
this.getList();
},
methods: {
getTime() {
const firstDayOfYear = new Date(this.listQuery.time)
const lastDayOfYear = new Date(firstDayOfYear.getFullYear() + 1, 0, 0, 0, 0, 0, 0)
// console.log('时间', parseTime(firstDayOfMonth), parseTime(lastDayOfMonth))
this.tableProps[0].label = '许昌安彩年原片生产汇总(' + parseTime(firstDayOfYear) + '-' + parseTime(lastDayOfYear) + ')'
this.tableProps1[0].label = '许昌安彩年成品生产汇总(' + parseTime(firstDayOfYear) + '-' + parseTime(lastDayOfYear) + ')'
},
async getList() {
this.getTime()
this.tableData = [];
this.tableProps = [
this.tableProps[0].children = [
{
prop: 'lineName',
label: '',
@@ -118,23 +142,23 @@ export default {
},
];
this.tableData1 = [];
this.tableProps1 = [
this.tableProps1[0].children = [
{
prop: 'lineName',
label: '',
fixed: true,
// fixed: true,
},
{
prop: 'paramsName',
label: '',
fixed: true,
// fixed: true,
},
];
await productionYearY(this.listQuery).then((res) => {
this.resData = res.data;
// 设置表头
Object.keys(this.resData).forEach((item) => {
this.tableProps.push({
this.tableProps[0].children.push({
prop: item,
label: item,
'show-overflow-tooltip': true,
@@ -146,7 +170,7 @@ export default {
this.resData1 = res.data;
// 设置表头
Object.keys(this.resData1).forEach((item) => {
this.tableProps1.push({
this.tableProps1[0].children.push({
prop: item,
label: item,
'show-overflow-tooltip': true,