增加时间默认值

This commit is contained in:
bb_pan 2025-07-09 17:06:52 +08:00
parent f6c384e163
commit 2ca86860de
6 changed files with 71 additions and 7 deletions

View File

@ -324,10 +324,19 @@ export default {
};
},
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
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}`
},
//
handleSelectionChange(selection) {
this.sendTemp = [];
@ -370,7 +379,10 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.time = [];
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.queryParams.time = [this.format(start), this.format(end)]
this.resetForm("queryForm");
this.queryParams.keyWord = "";
this.handleQuery();

View File

@ -476,7 +476,7 @@ export default {
const res = await getProjectInfoApi({ unitId: null, isApp: true })
console.log('🚀 ~ projectInfoList ~ res:', res)
if (res.data && res.data.length > 0) {
this.projectIds = res.data.map(item => item.proId)
this.projectIds = res.data.map(item => item.projectId)
} else {
this.projectIds = []
}

View File

@ -311,10 +311,20 @@ export default {
}
},
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.queryParams.time = [this.format(start), this.format(end)]
this.getList();
this.initSelectData()
},
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}`
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
@ -385,7 +395,10 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.time = []
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.queryParams.time = [this.format(start), this.format(end)]
// this.resetForm("queryForm");
this.unitId=null;
this.projectId=null;

View File

@ -658,9 +658,19 @@ export default {
if (this.$route.query.code) {
this.queryParams.keyWord = this.$route.query.code
}
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
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}`
},
//
handleSelectionChange(selection) {
this.maCodeList = []
@ -709,7 +719,10 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.time = []
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.queryParams.time = [this.format(start), this.format(end)]
// this.resetForm('queryForm')
this.queryParams.taskStatus = ''
this.queryParams.keyWord = ''

View File

@ -361,12 +361,22 @@ export default {
if(this.$route.query.code){
this.queryParams.keyWord=this.$route.query.code
}
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.queryParams.time = [this.format(start), this.format(end)]
this.getList();
// this.initSelectData()
// this.InitIGetInfo()
},
components: { vueEasyPrint },
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}`
},
//
InitIGetInfo() {
getInfo().then((res) => {
@ -399,7 +409,10 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.time = []
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.queryParams.time = [this.format(start), this.format(end)]
// this.resetForm("queryForm");
this.$refs.queryForm.resetFields()
this.handleQuery()

View File

@ -316,9 +316,19 @@ export default {
};
},
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
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}`
},
//
handleSelectionChange(selection) {
this.passTemp = [];
@ -366,7 +376,10 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.time = [];
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.queryParams.time = [this.format(start), this.format(end)]
this.resetForm("queryForm");
this.queryParams.keyword = "";
this.handleQuery();