Commit 1500f46f by huaying

fix: 日期选择器

parent 7ec1f7df
......@@ -21,19 +21,19 @@ export default {
start = new Date(`${start.getFullYear()}-${start.getMonth() + 1}-${start.getDate()}`);
let start2 = new Date(pickerMinDate);
let end = new Date();
end = new Date(`${end.getFullYear()}-${end.getMonth() + 1}-${end.getDate()} 23:59:59`);
end = new Date(`${end.getFullYear()}-${end.getMonth() + 1}-${end.getDate() + 1}`);
let end2 = new Date(pickerMinDate);
if (pickerMinDate) {
start = start.setFullYear(start.getFullYear() - 2);
start2 = start2.setDate(start2.getDate() - 60);
start2 = start2.setMonth(start2.getMonth() - 6);
start = start > start2 ? start : start2;
end2 = end2.setDate(end2.getDate() + 60);
end2 = end2.setMonth(end2.getMonth() + 6);
end = end.getTime() > end2 ? end2 : end.getTime();
} else {
start = start.setFullYear(start.getFullYear() - 2);
end = end.getTime();
}
return time.getTime() < start || time.getTime() > end;
return time.getTime() <= start || time.getTime() >= end;
}
};
}
......@@ -60,9 +60,9 @@ export default {
return [getDate(start), getDate(end)];
},
btnChange(index) {
let that = this;
that.dateKey = index;
that.dateDefault = [];
//把index值赋给active,点击改变样式
this.dateKey = index;
this.dateDefault = [];
let setDate;
if (index == 0) {
// 近7天
......@@ -80,15 +80,14 @@ export default {
// 近三个月
setDate = endDate => {
endDate.setMonth(endDate.getMonth() - 3);
endDate.setDate(1);
endDate.setDate(endDate.getDate() + 1);
return new Date(endDate);
};
} else if (index == 3) {
// 近半年
setDate = endDate => {
endDate.setMonth(endDate.getMonth() - 6);
endDate.setDate(1); // 以1号为开端
// endDate.setDate(endDate.getDate() + 1);
endDate.setDate(endDate.getDate() + 1);
return new Date(endDate);
};
} else {
......@@ -100,10 +99,10 @@ export default {
return new Date(endDate);
};
}
const [start, end] = that.getDateRange(setDate);
that.dateDefault.push(end);
that.dateDefault.push(start);
that.getChartList();
const [start, end] = this.getDateRange(setDate);
this.dateDefault.push(end);
this.dateDefault.push(start);
this.getTableList();
}
}
};
......@@ -223,6 +223,9 @@ export default {
return true;
}
},
props: {
limitCode: this.$buttonCode.dataActCode
},
handler: row => {
this.$router.push(`/actCodeDetail?hmId=${row.hmId}&activeName=second`);
}
......@@ -234,6 +237,9 @@ export default {
return true;
}
},
props: {
limitCode: this.$buttonCode.infoActCode
},
handler: row => {
this.$router.push('/actCodeDetails?hmId=' + row.hmId);
}
......@@ -248,6 +254,9 @@ export default {
return true;
}
},
props: {
limitCode: this.$buttonCode.editActCode
},
handler: row => {
this.$router.push('/actCodeEdit?hmId=' + row.hmId);
}
......@@ -262,6 +271,9 @@ export default {
return true;
}
},
props: {
limitCode: this.$buttonCode.downActCode
},
handler: row => {
this.wxQrcode = row.wxQrcode;
this.imageName = `${row.hmId}_${row.name}`;
......@@ -276,16 +288,22 @@ export default {
return true;
}
},
props: {
limitCode: this.$buttonCode.delActCode
},
handler: row => {
this.$confirm('确认要作废该活码?此操作将永久废弃该活码,请确保不影响其他投放使用!', '作废提示', {
confirmButtonText: '删除',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.loadingStatus = true;
deleteRequest('/haoban-manage3-web/hm/qrcode/del', { hmId: row.hmId }).then(res => {
if (res.data.code == 0) {
setTimeout(() => {
this.getTableList();
// this.$router.go(0);
this.loadingStatus = false;
}, 1000);
}
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment