diff --git a/gold-system/src/views/goldBeen/goldenBeenConsum.vue b/gold-system/src/views/goldBeen/goldenBeenConsum.vue index a9e505a..836b7f0 100644 --- a/gold-system/src/views/goldBeen/goldenBeenConsum.vue +++ b/gold-system/src/views/goldBeen/goldenBeenConsum.vue @@ -66,17 +66,30 @@ style="width: 220px" /> - - 消费时间: + + 开始时间: + + + 结束时间: + + + + 近7天 查询 @@ -185,7 +198,8 @@ const ruleFormRef = ref() const detailY = ref({ jwcode: '', ipAddress: '', - createTime: '', + startTime:'', + endTime:'', // channel: '', //频道 sourceName: '', //直播间 sourceType: '' //消费类型 @@ -194,11 +208,44 @@ const getObj = ref({ pageNum: 1, pageSize: 50 }) +// 今天 +const getToday = function () { + const today = new Date() + // 格式化开始时间 + const startDate = moment(today).startOf('day').format('YYYY-MM-DD HH:mm:ss') + // 格式化结束时间 + const endDate = moment(today).endOf('day').format('YYYY-MM-DD HH:mm:ss') + detailY.value.startTime = startDate + detailY.value.endTime = endDate + search() +} +// 昨天 +const getYesterday = function () { + const yesterday = moment().subtract(1, 'days') + // 格式化开始时间 + const startDate = yesterday.startOf('day').format('YYYY-MM-DD HH:mm:ss') + // 格式化结束时间 + const endDate = yesterday.endOf('day').format('YYYY-MM-DD HH:mm:ss') + detailY.value.startTime = startDate + detailY.value.endTime = endDate + search() +} +// 近7天 +const get7Days = function () { + // 格式化开始时间 + const startDate = moment().subtract(6, 'days').startOf('day').format('YYYY-MM-DD HH:mm:ss') + // 格式化结束时间 + const endDate = moment().endOf('day').format('YYYY-MM-DD HH:mm:ss') + detailY.value.startTime = startDate + detailY.value.endTime = endDate + search() +} //初始化 const getInit = async function () { try { console.log('搜索参数', getObj.value) - const [startTime, endTime] = detailY.value.createTime + const startTime = detailY.value.startTime + const endTime = detailY.value.endTime // 发送POST请求 const result = await API({ url: '/dou/getSpend', @@ -233,6 +280,7 @@ const trimJwCode = () => { detailY.value.sourceName = detailY.value.sourceName.replace(/\s/g, ''); } } + // 搜索 const search = function () { trimJwCode(); diff --git a/gold-system/src/views/goldBeen/goldenBeenDetail.vue b/gold-system/src/views/goldBeen/goldenBeenDetail.vue index e96b95c..37d0db9 100644 --- a/gold-system/src/views/goldBeen/goldenBeenDetail.vue +++ b/gold-system/src/views/goldBeen/goldenBeenDetail.vue @@ -57,19 +57,31 @@ /> --> - - 充值时间: + + 开始时间: + + 结束时间: + + + + + 近7天 查询 重置 @@ -412,6 +424,38 @@ const rules = ref({ jwcode: [{ required: true, message: '请输入精网号', trigger: 'blur' }], area: [{ required: true, message: '请选择所属地区', trigger: 'change' }] }) +// 今天 +const getToday = function () { + const today = new Date() + // 格式化开始时间 + const startDate = moment(today).startOf('day').format('YYYY-MM-DD HH:mm:ss') + // 格式化结束时间 + const endDate = moment(today).endOf('day').format('YYYY-MM-DD HH:mm:ss') + detailY.value.startTime = startDate + detailY.value.endTime = endDate + search() +} +// 昨天 +const getYesterday = function () { + const yesterday = moment().subtract(1, 'days') + // 格式化开始时间 + const startDate = yesterday.startOf('day').format('YYYY-MM-DD HH:mm:ss') + // 格式化结束时间 + const endDate = yesterday.endOf('day').format('YYYY-MM-DD HH:mm:ss') + detailY.value.startTime = startDate + detailY.value.endTime = endDate + search() +} +// 近7天 +const get7Days = function () { + // 格式化开始时间 + const startDate = moment().subtract(6, 'days').startOf('day').format('YYYY-MM-DD HH:mm:ss') + // 格式化结束时间 + const endDate = moment().endOf('day').format('YYYY-MM-DD HH:mm:ss') + detailY.value.startTime = startDate + detailY.value.endTime = endDate + search() +} //获取地区接口 const getArea = async () => { try { @@ -454,7 +498,6 @@ const detailY = ref({ orderNo: '', payStyle: '', type: '', - createTime: '', startTime:'', endTime:'' }) @@ -548,7 +591,8 @@ const getInit = async function ( ) { try { console.log('搜索参数', getObj.value) - const [startTime, endTime] = detailY.value.createTime + const startTime = detailY.value.startTime + const endTime = detailY.value.endTime console.log(startTime, endTime) // 发送POST请求 const result = await API({ @@ -633,8 +677,8 @@ const getCount = async () => { data: { jwcode: detailY.value.jwcode, deptName: detailY.value.deptName, - startTime: detailY.value.createTime[0], - endTime: detailY.value.createTime[1], + startTime: detailY.value.startTime, + endTime: detailY.value.endTime, orderNo: detailY.value.orderNo, type: detailY.value.type // payStyle: detailY.value.payStyle diff --git a/gold-system/src/views/managerecharge/activity.vue b/gold-system/src/views/managerecharge/activity.vue index aa48821..1a78c29 100644 --- a/gold-system/src/views/managerecharge/activity.vue +++ b/gold-system/src/views/managerecharge/activity.vue @@ -95,7 +95,58 @@ const get = async function (val) { ElMessage.error('请求失败') } } - +// 今天 +const getToday = function () { + const today = new Date() + const startDate = new Date( + today.getFullYear(), + today.getMonth(), + today.getDate() + ) + const endDate = new Date( + today.getFullYear(), + today.getMonth(), + today.getDate() + 1 + ) + getTime.value = [startDate, endDate] + console.log('getTime', getTime.value) + get() +} +// 昨天 +const getYesterday = function () { + const yesterday = new Date() + yesterday.setDate(yesterday.getDate() - 1) + const startDate = new Date( + yesterday.getFullYear(), + yesterday.getMonth(), + yesterday.getDate() + ) + const endDate = new Date( + yesterday.getFullYear(), + yesterday.getMonth(), + yesterday.getDate() + 1 + ) + getTime.value = [startDate, endDate] + console.log('getTime', getTime.value) + get() +} +// 近7天 +const get7Days = function () { + const today = new Date() + const startDate = new Date( + today.getFullYear(), + today.getMonth(), + today.getDate() - 6 + ) + const endDate = new Date( + today.getFullYear(), + today.getMonth(), + today.getDate() + 1 + ) + getTime.value = [startDate, endDate] + console.log('getTime', getTime.value) + get() +} // 活动名称去空格 const trim = () => { if (activity.value.activityName) { @@ -223,6 +274,11 @@ const del = (row) => { start-placeholder="起始时间" end-placeholder="结束时间" /> + + + 近7天
重置 diff --git a/gold-system/src/views/managerecharge/rate.vue b/gold-system/src/views/managerecharge/rate.vue index 9d0aaf3..01df6af 100644 --- a/gold-system/src/views/managerecharge/rate.vue +++ b/gold-system/src/views/managerecharge/rate.vue @@ -97,6 +97,62 @@ const get = async function (val) { // 在这里可以处理错误逻辑,比如显示错误提示等 } } + +// 今天 +const getToday = function () { + const today = new Date(); + const startDate = new Date( + today.getFullYear(), + today.getMonth(), + today.getDate() + ); + const endDate = new Date( + today.getFullYear(), + today.getMonth(), + today.getDate() + 1 + ); + // value1!!value1!!lhl狗屎脑子 + value1.value = [startDate, endDate]; + console.log('value1', value1.value); + get(); +} +// 昨天 +const getYesterday = function () { + const yesterday = new Date(); + yesterday.setDate(yesterday.getDate() - 1); + const startDate = new Date( + yesterday.getFullYear(), + yesterday.getMonth(), + yesterday.getDate() + ); + const endDate = new Date( + yesterday.getFullYear(), + yesterday.getMonth(), + yesterday.getDate() + 1 + ); + // 这个也是value1!! + value1.value = [startDate, endDate]; + console.log('value1', value1.value); + get(); +} +// 近7天 +const get7Days = function () { + const today = new Date(); + const startDate = new Date( + today.getFullYear(), + today.getMonth(), + today.getDate() - 6 + ); + const endDate = new Date( + today.getFullYear(), + today.getMonth(), + today.getDate() + 1 + ); + // value1!! + value1.value = [startDate, endDate]; + console.log('value1', value1.value); + get(); +} // 搜索 const search = function () { getObj.value.pageNum = 1 @@ -464,6 +520,9 @@ function handleInput(value) { :size="size" value-format="YYYY-MM-DD" /> + + + 近7天 { detailY.value.jwcode = detailY.value.jwcode.replace(/\s/g, ''); } } +// 今天 +const getToday = function () { + const today = moment() + const startDate = today.startOf('day').toDate() + const endDate = today.endOf('day').toDate() + getTime.value = [startDate, endDate] + search() +} + +// 昨天 +const getYesterday = function () { + const yesterday = moment().subtract(1, 'day') + const startDate = yesterday.startOf('day').toDate() + const endDate = yesterday.endOf('day').toDate() + getTime.value = [startDate, endDate] + search() +} +// 近7天 +const get7Days = function () { + const startDate = moment().subtract(6, 'day').startOf('day').toDate() + const endDate = moment().endOf('day').toDate() + getTime.value = [startDate, endDate] + search() +} // 搜索 const search = function () { trimJwCode(); @@ -559,8 +583,11 @@ const handleCurrentChange = function (val) { range-separator="至" start-placeholder="起始时间" end-placeholder="结束时间" - style="margin-right: 700px" + style="margin-right: 50px" /> + + + 近7天 导出Excel表格 重置 查询