默认查询时间段设置

This commit is contained in:
bb_pan 2025-07-18 12:00:38 +08:00
parent 8ae195b7b3
commit a5b2e3d212
16 changed files with 104 additions and 32 deletions

View File

@ -326,7 +326,7 @@ export default {
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.getList();
},
@ -381,7 +381,7 @@ export default {
resetQuery() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.resetForm("queryForm");
this.queryParams.keyWord = "";

View File

@ -313,7 +313,7 @@ export default {
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.getList();
this.initSelectData()
@ -397,7 +397,7 @@ export default {
resetQuery() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
// this.resetForm("queryForm");
this.unitId=null;

View File

@ -510,7 +510,7 @@ export default {
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
// this.getStatusList();
this.getList()
@ -579,7 +579,7 @@ export default {
this.queryParams.keyWord = ''
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.handleQuery()
},

View File

@ -741,7 +741,7 @@ export default {
}
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.getList()
},
@ -802,7 +802,7 @@ export default {
resetQuery() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
// this.resetForm('queryForm')
this.queryParams.taskStatus = ''

View File

@ -363,7 +363,7 @@ export default {
}
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.getList();
// this.initSelectData()
@ -409,7 +409,7 @@ export default {
resetQuery() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
// this.resetForm("queryForm");
this.$refs.queryForm.resetFields()

View File

@ -318,7 +318,7 @@ export default {
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.getList();
},
@ -378,7 +378,7 @@ export default {
resetQuery() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.resetForm("queryForm");
this.queryParams.keyword = "";

View File

@ -161,7 +161,7 @@
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.dateRange = [this.format(start), this.format(end)]
this.getList()
},
@ -226,7 +226,7 @@
this.resetForm("queryForm");
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.dateRange = [this.format(start), this.format(end)]
this.queryParams.keyWord=null;
this.handleQuery();

View File

@ -374,7 +374,7 @@
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.dateRange = [this.format(start), this.format(end)]
this.getList()
},
@ -444,7 +444,7 @@
this.resetForm("queryForm");
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.dateRange = [this.format(start), this.format(end)]
this.queryParams.keyWord=null;
this.handleQuery();

View File

@ -165,7 +165,7 @@
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.dateRange = [this.format(start), this.format(end)]
this.getList()
},
@ -232,7 +232,7 @@
this.resetForm("queryForm");
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.dateRange = [this.format(start), this.format(end)]
this.queryParams.keyWord=null;
this.handleQuery();

View File

@ -165,7 +165,7 @@
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.dateRange = [this.format(start), this.format(end)]
this.getList()
},
@ -233,7 +233,7 @@
this.resetForm("queryForm");
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.dateRange = [this.format(start), this.format(end)]
this.queryParams.keyWord=null;
this.handleQuery();

View File

@ -182,7 +182,7 @@ export default {
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.dateRange = [this.format(start), this.format(end)]
this.getList()
},
@ -246,7 +246,7 @@ export default {
this.resetForm('queryForm')
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.dateRange = [this.format(start), this.format(end)]
this.queryParams.keyWord = null
this.handleQuery()

View File

@ -161,7 +161,7 @@
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.dateRange = [this.format(start), this.format(end)]
this.getList()
},
@ -228,7 +228,7 @@
this.resetForm("queryForm");
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
start.setMonth(start.getMonth() - 1)
this.dateRange = [this.format(start), this.format(end)]
this.queryParams.keyWord=null;
this.handleQuery();

View File

@ -151,9 +151,19 @@ export default {
}
},
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.getList()
},
methods: {
format(date) {
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${y}-${m}-${day}`
},
//
async getList() {
this.loading = true
@ -192,7 +202,10 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.time=[]
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.resetForm('queryForm')
this.handleQuery()
},
@ -208,11 +221,21 @@ export default {
return `${year}${month}${day}_${hours}${minutes}${seconds}`;
};
const params = {
keyWord: this.queryParams.keyWord,
inputType: this.queryParams.inputType,
typeName: this.queryParams.typeName,
typeModelName: this.queryParams.typeModelName,
startTime: this.queryParams.time && this.queryParams.time[0],
endTime: this.queryParams.time && this.queryParams.time[1],
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum
}
const currentTime = formatTime(new Date());
this.download(
'material/complex_query/exportInputRecord',
{
...this.queryParams,
...params,
},
`综合查询_入库记录_${currentTime}.xlsx`,
)

View File

@ -226,10 +226,20 @@ export default {
}
},
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.initSelectData()
this.getList()
},
methods: {
format(date) {
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${y}-${m}-${day}`
},
initSelectData() {
this.GetUnitData()
this.GetProData()
@ -339,7 +349,10 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.time=[]
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.unitId=[]
this.projectId=[]
this.queryParams.firstTypeIdList=[]
@ -358,11 +371,24 @@ export default {
return `${year}${month}${day}_${hours}${minutes}${seconds}`;
};
const params = {
unitId: this.queryParams.unitId,
proId: this.queryParams.proId,
keyWord: this.queryParams.keyWord,
outStyle: this.queryParams.outStyle,
typeName: this.queryParams.typeName,
typeModelName: this.queryParams.typeModelName,
firstTypeIdList: this.queryParams.firstTypeIdList,
startTime: this.queryParams.time && this.queryParams.time[0],
endTime: this.queryParams.time && this.queryParams.time[1],
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum
}
const currentTime = formatTime(new Date());
this.download(
'material/complex_query/exportOutRecord',
{
...this.queryParams,
...params,
},
`综合查询_出库记录_${currentTime}.xlsx`,
)

View File

@ -197,10 +197,20 @@ export default {
}
},
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.initSelectData()
this.getList()
},
methods: {
format(date) {
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${y}-${m}-${day}`
},
initSelectData() {
this.GetUnitData()
this.GetProData()
@ -284,7 +294,10 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.time=[]
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.unitId=[]
this.projectId=[]
this.resetForm('queryForm')
@ -301,12 +314,22 @@ export default {
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}${month}${day}_${hours}${minutes}${seconds}`;
};
const params = {
unitId: this.queryParams.unitId,
proId: this.queryParams.proId,
keyWord: this.queryParams.keyWord,
typeName: this.queryParams.typeName,
statusName: this.queryParams.statusName,
startTime: this.queryParams.time && this.queryParams.time[0],
endTime: this.queryParams.time && this.queryParams.time[1],
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum
}
const currentTime = formatTime(new Date());
this.download(
'material/complex_query/exportMachineHistoryRecord',
{
...this.queryParams,
...params,
},
`综合查询_设备使用追溯_${currentTime}.xlsx`,
)

View File

@ -201,7 +201,7 @@ export default {
created() {
const end = new Date()
let start = new Date()
start.setFullYear(start.getFullYear() - 1); //
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.initSelectData()
this.getList()