feat(wms): 修改报表时间区间为昨天6点至今天6点并添加标签打印功能
修改多个报表页面的默认时间区间从全天改为昨天6点至今天6点,自动处理跨月跨年情况 在钢卷操作面板添加标签打印按钮功能,优化标签预览按钮样式
This commit is contained in:
@@ -3,12 +3,12 @@
|
||||
<el-row>
|
||||
<el-form label-width="80px" inline>
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker style="width: 200px;" v-model="queryParams.byExportTimeStart" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="选择开始时间"></el-date-picker>
|
||||
<el-date-picker style="width: 200px;" v-model="queryParams.byExportTimeStart" type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择开始时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker style="width: 200px;" v-model="queryParams.byExportTimeEnd" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="选择结束时间"></el-date-picker>
|
||||
<el-date-picker style="width: 200px;" v-model="queryParams.byExportTimeEnd" type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择结束时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="入场钢卷号" prop="endTime">
|
||||
<el-input style="width: 200px; display: inline-block;" v-model="queryParams.enterCoilNo"
|
||||
@@ -113,15 +113,24 @@ export default {
|
||||
// 工具函数:个位数补零,保证格式统一(比如 9 → 09,5 → 05)
|
||||
const addZero = (num) => num.toString().padStart(2, '0')
|
||||
|
||||
const now = new Date()
|
||||
// 基于【本地北京时间】获取年月日
|
||||
const year = now.getFullYear()
|
||||
const month = addZero(now.getMonth() + 1) // 月份+1 补零
|
||||
const day = addZero(now.getDate())
|
||||
const now = new Date() // 当前本地北京时间
|
||||
// 核心:获取【昨天】的日期对象(自动处理跨月/跨年,无边界问题)
|
||||
const yesterday = new Date(now)
|
||||
yesterday.setDate(yesterday.getDate() - 1)
|
||||
|
||||
// ✅ 正确的 北京时间 今日开始/结束时间
|
||||
const startTime = `${year}-${month}-${day} 00:00:00`
|
||||
const endTime = `${year}-${month}-${day} 23:59:59`
|
||||
// 昨天的年、月、日(补零格式化)
|
||||
const yesYear = yesterday.getFullYear()
|
||||
const yesMonth = addZero(yesterday.getMonth() + 1)
|
||||
const yesDay = addZero(yesterday.getDate())
|
||||
|
||||
// 今天的年、月、日(补零格式化)
|
||||
const nowYear = now.getFullYear()
|
||||
const nowMonth = addZero(now.getMonth() + 1)
|
||||
const nowDay = addZero(now.getDate())
|
||||
|
||||
// ✅ 目标时间区间:昨天早上6点 至 今天早上6点
|
||||
const startTime = `${yesYear}-${yesMonth}-${yesDay} 06:00:00`
|
||||
const endTime = `${nowYear}-${nowMonth}-${nowDay} 06:00:00`
|
||||
return {
|
||||
list: [],
|
||||
queryParams: {
|
||||
|
||||
@@ -122,15 +122,24 @@ export default {
|
||||
// 工具函数:个位数补零,保证格式统一(比如 9 → 09,5 → 05)
|
||||
const addZero = (num) => num.toString().padStart(2, '0')
|
||||
|
||||
const now = new Date()
|
||||
// 基于【本地北京时间】获取年月日
|
||||
const year = now.getFullYear()
|
||||
const month = addZero(now.getMonth() + 1) // 月份+1 补零
|
||||
const day = addZero(now.getDate())
|
||||
const now = new Date() // 当前本地北京时间
|
||||
// 核心:获取【昨天】的日期对象(自动处理跨月/跨年,无边界问题)
|
||||
const yesterday = new Date(now)
|
||||
yesterday.setDate(yesterday.getDate() - 1)
|
||||
|
||||
// ✅ 正确的 北京时间 今日开始/结束时间
|
||||
const startTime = `${year}-${month}-${day} 00:00:00`
|
||||
const endTime = `${year}-${month}-${day} 23:59:59`
|
||||
// 昨天的年、月、日(补零格式化)
|
||||
const yesYear = yesterday.getFullYear()
|
||||
const yesMonth = addZero(yesterday.getMonth() + 1)
|
||||
const yesDay = addZero(yesterday.getDate())
|
||||
|
||||
// 今天的年、月、日(补零格式化)
|
||||
const nowYear = now.getFullYear()
|
||||
const nowMonth = addZero(now.getMonth() + 1)
|
||||
const nowDay = addZero(now.getDate())
|
||||
|
||||
// ✅ 目标时间区间:昨天早上6点 至 今天早上6点
|
||||
const startTime = `${yesYear}-${yesMonth}-${yesDay} 06:00:00`
|
||||
const endTime = `${nowYear}-${nowMonth}-${nowDay} 06:00:00`
|
||||
return {
|
||||
list: [],
|
||||
queryParams: {
|
||||
|
||||
@@ -112,18 +112,27 @@ export default {
|
||||
},
|
||||
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
|
||||
data() {
|
||||
// 工具函数:个位数补零,保证格式统一(比如 9 → 09,5 → 05)
|
||||
// 工具函数:个位数补零,保证格式统一(比如 9 → 09,5 → 05)
|
||||
const addZero = (num) => num.toString().padStart(2, '0')
|
||||
|
||||
const now = new Date()
|
||||
// 基于【本地北京时间】获取年月日
|
||||
const year = now.getFullYear()
|
||||
const month = addZero(now.getMonth() + 1) // 月份+1 补零
|
||||
const day = addZero(now.getDate())
|
||||
const now = new Date() // 当前本地北京时间
|
||||
// 核心:获取【昨天】的日期对象(自动处理跨月/跨年,无边界问题)
|
||||
const yesterday = new Date(now)
|
||||
yesterday.setDate(yesterday.getDate() - 1)
|
||||
|
||||
// ✅ 正确的 北京时间 今日开始/结束时间
|
||||
const startTime = `${year}-${month}-${day} 00:00:00`
|
||||
const endTime = `${year}-${month}-${day} 23:59:59`
|
||||
// 昨天的年、月、日(补零格式化)
|
||||
const yesYear = yesterday.getFullYear()
|
||||
const yesMonth = addZero(yesterday.getMonth() + 1)
|
||||
const yesDay = addZero(yesterday.getDate())
|
||||
|
||||
// 今天的年、月、日(补零格式化)
|
||||
const nowYear = now.getFullYear()
|
||||
const nowMonth = addZero(now.getMonth() + 1)
|
||||
const nowDay = addZero(now.getDate())
|
||||
|
||||
// ✅ 目标时间区间:昨天早上6点 至 今天早上6点
|
||||
const startTime = `${yesYear}-${yesMonth}-${yesDay} 06:00:00`
|
||||
const endTime = `${nowYear}-${nowMonth}-${nowDay} 06:00:00`
|
||||
return {
|
||||
list: [],
|
||||
queryParams: {
|
||||
|
||||
Reference in New Issue
Block a user