fix: 修正文本错误并优化日期处理逻辑

修复多处文案中"点菜集成"为"点采集成"
移除base.vue中多余的条件判断
优化报表页面的日期处理逻辑,使用本地时间并保证格式统一
移除zha.vue中硬编码的status默认值
This commit is contained in:
砂糖
2026-01-10 08:25:00 +08:00
parent 415094f33c
commit fe935b5b7c
6 changed files with 37 additions and 16 deletions

View File

@@ -100,11 +100,18 @@ export default {
},
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
data() {
// 获取昨天0点到今天0点的时间范围
// 工具函数:个位数补零,保证格式统一(比如 9 → 095 → 05
const addZero = (num) => num.toString().padStart(2, '0')
const now = new Date()
const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000)
const startTime = now.toISOString().slice(0, 10) + ' 00:00:00'
const endTime = now.toISOString().slice(0, 10) + ' 23:59:59'
// 基于【本地北京时间】获取年月日
const year = now.getFullYear()
const month = addZero(now.getMonth() + 1) // 月份+1 补零
const day = addZero(now.getDate())
// ✅ 正确的 北京时间 今日开始/结束时间
const startTime = `${year}-${month}-${day} 00:00:00`
const endTime = `${year}-${month}-${day} 23:59:59`
return {
list: [],
queryParams: {