Compare commits
1 Commits
0e1599809d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b93d636c8a |
73
apps/hand-factory/api/system/config.js
Normal file
73
apps/hand-factory/api/system/config.js
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询参数列表
|
||||||
|
export function listConfig(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/config/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询参数详细
|
||||||
|
export function getConfig(configId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/config/' + configId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据参数键名查询参数值
|
||||||
|
export function getConfigKey(configKey) {
|
||||||
|
return request({
|
||||||
|
url: '/system/config/configKey/' + configKey,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增参数配置
|
||||||
|
export function addConfig(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/config',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改参数配置
|
||||||
|
export function updateConfig(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/config',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改参数配置
|
||||||
|
export function updateConfigByKey(key, value) {
|
||||||
|
return request({
|
||||||
|
url: '/system/config/updateByKey',
|
||||||
|
method: 'put',
|
||||||
|
data: {
|
||||||
|
configKey: key,
|
||||||
|
configValue: value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除参数配置
|
||||||
|
export function delConfig(configId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/config/' + configId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 刷新参数缓存
|
||||||
|
export function refreshCache() {
|
||||||
|
return request({
|
||||||
|
url: '/system/config/refreshCache',
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ module.exports = {
|
|||||||
// 应用名称
|
// 应用名称
|
||||||
name: "ruoyi-app",
|
name: "ruoyi-app",
|
||||||
// 应用版本
|
// 应用版本
|
||||||
version: "1.3.29",
|
version: "1.3.30",
|
||||||
// 应用logo
|
// 应用logo
|
||||||
logo: "/static/logo.jpg",
|
logo: "/static/logo.jpg",
|
||||||
// 官方网站
|
// 官方网站
|
||||||
|
|||||||
@@ -252,9 +252,6 @@
|
|||||||
* @param {Boolean} isRefresh 是否刷新(重置页码)
|
* @param {Boolean} isRefresh 是否刷新(重置页码)
|
||||||
*/
|
*/
|
||||||
async fetchList(isRefresh = false) {
|
async fetchList(isRefresh = false) {
|
||||||
if (!this.hasMore) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
// 刷新时重置页码和加载状态
|
// 刷新时重置页码和加载状态
|
||||||
if (isRefresh) {
|
if (isRefresh) {
|
||||||
@@ -299,9 +296,6 @@
|
|||||||
* @param {Boolean} isRefresh 是否刷新(重置页码)
|
* @param {Boolean} isRefresh 是否刷新(重置页码)
|
||||||
*/
|
*/
|
||||||
async fetchDeliveryPlan(isRefresh = false) {
|
async fetchDeliveryPlan(isRefresh = false) {
|
||||||
if (!this.planHasMore) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
if (isRefresh) {
|
if (isRefresh) {
|
||||||
this.planPageNum = 1;
|
this.planPageNum = 1;
|
||||||
|
|||||||
@@ -4,31 +4,19 @@
|
|||||||
<view class="date-time-wrap">
|
<view class="date-time-wrap">
|
||||||
<view class="picker-item">
|
<view class="picker-item">
|
||||||
<text class="picker-label">餐别:</text>
|
<text class="picker-label">餐别:</text>
|
||||||
<uni-data-select
|
<uni-data-select v-model="queryParams.mealType" :localdata="range" @change="getList"></uni-data-select>
|
||||||
v-model="queryParams.mealType"
|
|
||||||
:localdata="range"
|
|
||||||
@change="getList"
|
|
||||||
></uni-data-select>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 报餐日期选择 -->
|
<!-- 报餐日期选择 -->
|
||||||
<view class="picker-item">
|
<view class="picker-item">
|
||||||
<text class="picker-label">报餐日期:</text>
|
<text class="picker-label">报餐日期:</text>
|
||||||
<uni-datetime-picker
|
<uni-datetime-picker v-model="queryParams.reportDate" type="date" placeholder="选择日期" @change="onDateConfirm"
|
||||||
v-model="queryParams.reportDate"
|
class="picker-input"></uni-datetime-picker>
|
||||||
type="date"
|
|
||||||
placeholder="选择日期"
|
|
||||||
@change="onDateConfirm"
|
|
||||||
class="picker-input"
|
|
||||||
></uni-datetime-picker>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 自定义截止时间选择 -->
|
<!-- 自定义截止时间选择 -->
|
||||||
<view class="picker-item">
|
<view class="picker-item">
|
||||||
<text class="picker-label">截止时间:</text>
|
<text class="picker-label">截止时间:</text>
|
||||||
<view
|
<view class="custom-time-picker" @click="openTimePopup">
|
||||||
class="custom-time-picker"
|
|
||||||
@click="openTimePopup"
|
|
||||||
>
|
|
||||||
<text class="time-text">{{ formattedDeadlineTime }}</text>
|
<text class="time-text">{{ formattedDeadlineTime }}</text>
|
||||||
<uni-icons type="arrowdown" size="14" color="#999"></uni-icons>
|
<uni-icons type="arrowdown" size="14" color="#999"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
@@ -100,37 +88,22 @@
|
|||||||
<!-- 小时选择 -->
|
<!-- 小时选择 -->
|
||||||
<view class="time-unit">
|
<view class="time-unit">
|
||||||
<text class="unit-label">时</text>
|
<text class="unit-label">时</text>
|
||||||
<uni-number-box
|
<uni-number-box v-model="timeSelect.hour" :min="0" :max="23" :step="1"
|
||||||
v-model="timeSelect.hour"
|
@change="handleTimeChange"></uni-number-box>
|
||||||
:min="0"
|
|
||||||
:max="23"
|
|
||||||
:step="1"
|
|
||||||
@change="handleTimeChange"
|
|
||||||
></uni-number-box>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 分钟选择 -->
|
<!-- 分钟选择 -->
|
||||||
<view class="time-unit">
|
<view class="time-unit">
|
||||||
<text class="unit-label">分</text>
|
<text class="unit-label">分</text>
|
||||||
<uni-number-box
|
<uni-number-box v-model="timeSelect.minute" :min="0" :max="59" :step="1"
|
||||||
v-model="timeSelect.minute"
|
@change="handleTimeChange"></uni-number-box>
|
||||||
:min="0"
|
|
||||||
:max="59"
|
|
||||||
:step="1"
|
|
||||||
@change="handleTimeChange"
|
|
||||||
></uni-number-box>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 秒选择 -->
|
<!-- 秒选择 -->
|
||||||
<view class="time-unit">
|
<view class="time-unit">
|
||||||
<text class="unit-label">秒</text>
|
<text class="unit-label">秒</text>
|
||||||
<uni-number-box
|
<uni-number-box v-model="timeSelect.second" :min="0" :max="59" :step="1"
|
||||||
v-model="timeSelect.second"
|
@change="handleTimeChange"></uni-number-box>
|
||||||
:min="0"
|
|
||||||
:max="59"
|
|
||||||
:step="1"
|
|
||||||
@change="handleTimeChange"
|
|
||||||
></uni-number-box>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -139,370 +112,413 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listMealReport } from "@/api/wms/mealReport";
|
import {
|
||||||
import { getDicts } from '@/api/system/dict/data.js'
|
listMealReport
|
||||||
|
} from "@/api/wms/mealReport";
|
||||||
|
import {
|
||||||
|
getDicts
|
||||||
|
} from '@/api/system/dict/data.js'
|
||||||
|
import {
|
||||||
|
getConfigKey
|
||||||
|
} from '@/api/system/config.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MealReportStatistics',
|
name: 'MealReportStatistics',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
mealType: '',
|
mealType: '',
|
||||||
reportDate: '',
|
reportDate: '',
|
||||||
pageSize: 9999,
|
pageSize: 9999,
|
||||||
pageNum: 1
|
pageNum: 1
|
||||||
},
|
},
|
||||||
deadlineDate: '', // 截止日期
|
deadlineDate: '', // 截止日期
|
||||||
deadlineTime: '12:00:00', // 截止时间(原始值)
|
deadlineTime: '12:00:00', // 截止时间(原始值)
|
||||||
// 时分秒选择器临时变量
|
// 时分秒选择器临时变量
|
||||||
timeSelect: {
|
timeSelect: {
|
||||||
hour: 12,
|
hour: 12,
|
||||||
minute: 0,
|
minute: 0,
|
||||||
second: 0
|
second: 0
|
||||||
},
|
},
|
||||||
list: [],
|
list: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
// 统计数据
|
// 统计数据
|
||||||
validDineIn: 0,
|
validDineIn: 0,
|
||||||
validTakeout: 0,
|
validTakeout: 0,
|
||||||
validTotal: 0,
|
validTotal: 0,
|
||||||
invalidDineIn: 0,
|
invalidDineIn: 0,
|
||||||
invalidTakeout: 0,
|
invalidTakeout: 0,
|
||||||
invalidTotal: 0,
|
invalidTotal: 0,
|
||||||
range: []
|
range: []
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
// 格式化截止时间显示(补零)
|
|
||||||
formattedDeadlineTime() {
|
|
||||||
const [hour, minute, second] = this.deadlineTime.split(':');
|
|
||||||
return `${hour.padStart(2, '0')}:${minute.padStart(2, '0')}:${second.padStart(2, '0')}`;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
// 初始化今日日期
|
|
||||||
this.initTodayDate();
|
|
||||||
// 初始化截止日期为今日
|
|
||||||
this.deadlineDate = this.queryParams.reportDate;
|
|
||||||
// 获取餐别字典数据
|
|
||||||
this.getRangeData();
|
|
||||||
// 加载报餐数据
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 初始化今日日期为yyyy-MM-dd格式 */
|
|
||||||
initTodayDate() {
|
|
||||||
const today = new Date();
|
|
||||||
const year = today.getFullYear();
|
|
||||||
const month = String(today.getMonth() + 1).padStart(2, '0');
|
|
||||||
const day = String(today.getDate()).padStart(2, '0');
|
|
||||||
this.queryParams.reportDate = `${year}-${month}-${day}`;
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 获取餐别字典数据 */
|
|
||||||
getRangeData() {
|
|
||||||
getDicts('hrm_meal_type').then(res => {
|
|
||||||
this.range = res.data.map(item => ({
|
|
||||||
text: item.dictLabel,
|
|
||||||
value: item.dictValue
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 查询部门报餐列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listMealReport(this.queryParams).then(response => {
|
|
||||||
this.list = response.rows || [];
|
|
||||||
this.loading = false;
|
|
||||||
this.calcTableSum();
|
|
||||||
}).catch(error => {
|
|
||||||
console.error('获取报餐数据失败:', error);
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 核心逻辑:区分有效/无效报餐统计 */
|
|
||||||
calcTableSum() {
|
|
||||||
let validDine = 0, validTake = 0, validAll = 0;
|
|
||||||
let invalidDine = 0, invalidTake = 0, invalidAll = 0;
|
|
||||||
|
|
||||||
this.list.forEach(item => {
|
|
||||||
// 处理空值,转为数字
|
|
||||||
const dine = item.dineInPeople ? Number(item.dineInPeople) : 0;
|
|
||||||
const take = item.takeoutPeople ? Number(item.takeoutPeople) : 0;
|
|
||||||
const total = item.totalPeople ? Number(item.totalPeople) : 0;
|
|
||||||
|
|
||||||
// 判断当前报餐是否有效
|
|
||||||
if (this.isValidMealReport(item.createTime)) {
|
|
||||||
validDine += dine;
|
|
||||||
validTake += take;
|
|
||||||
validAll += total;
|
|
||||||
} else {
|
|
||||||
invalidDine += dine;
|
|
||||||
invalidTake += take;
|
|
||||||
invalidAll += total;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 赋值到统计变量
|
|
||||||
this.validDineIn = validDine;
|
|
||||||
this.validTakeout = validTake;
|
|
||||||
this.validTotal = validAll;
|
|
||||||
this.invalidDineIn = invalidDine;
|
|
||||||
this.invalidTakeout = invalidTake;
|
|
||||||
this.invalidTotal = invalidAll;
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 判断报餐是否有效:创建时间在截止时间之前则有效 */
|
|
||||||
isValidMealReport(createTime) {
|
|
||||||
if (!createTime) return false;
|
|
||||||
|
|
||||||
// 拼接完整的截止时间字符串
|
|
||||||
const deadlineDateTime = `${this.deadlineDate || this.queryParams.reportDate} ${this.deadlineTime}`;
|
|
||||||
// 比较时间
|
|
||||||
const createTimeObj = new Date(createTime);
|
|
||||||
const deadlineTimeObj = new Date(deadlineDateTime);
|
|
||||||
|
|
||||||
return createTimeObj <= deadlineTimeObj;
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 报餐日期选择确认 */
|
|
||||||
onDateConfirm(e) {
|
|
||||||
this.queryParams.reportDate = e;
|
|
||||||
// 如果截止日期未选择,同步为报餐日期
|
|
||||||
if (!this.deadlineDate) {
|
|
||||||
this.deadlineDate = e;
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
// 格式化截止时间显示(补零)
|
||||||
|
formattedDeadlineTime() {
|
||||||
|
const [hour, minute, second] = this.deadlineTime.split(':');
|
||||||
|
return `${hour.padStart(2, '0')}:${minute.padStart(2, '0')}:${second.padStart(2, '0')}`;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
// 初始化今日日期
|
||||||
|
this.initTodayDate();
|
||||||
|
// 初始化截止日期为今日
|
||||||
|
this.deadlineDate = this.queryParams.reportDate;
|
||||||
|
// 获取餐别字典数据
|
||||||
|
this.getRangeData();
|
||||||
|
// 加载报餐数据
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.getDeadlineConfig();
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
/** 初始化今日日期为yyyy-MM-dd格式 */
|
||||||
|
initTodayDate() {
|
||||||
|
const today = new Date();
|
||||||
|
const year = today.getFullYear();
|
||||||
|
const month = String(today.getMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(today.getDate()).padStart(2, '0');
|
||||||
|
this.queryParams.reportDate = `${year}-${month}-${day}`;
|
||||||
|
},
|
||||||
|
|
||||||
/** 截止日期选择确认 */
|
getDeadlineConfig() {
|
||||||
onDeadlineDateConfirm(e) {
|
getConfigKey('hrm.meal.deadline').then(response => {
|
||||||
this.deadlineDate = e;
|
this.queryParams.deadlineTime = response.msg || '16:00:00'
|
||||||
this.calcTableSum();
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// ===== 自定义时间选择器逻辑 =====
|
/** 获取餐别字典数据 */
|
||||||
/** 打开时间选择弹窗 */
|
getRangeData() {
|
||||||
openTimePopup() {
|
getDicts('hrm_meal_type').then(res => {
|
||||||
// 解析当前时间到选择器
|
this.range = res.data.map(item => ({
|
||||||
const [hour, minute, second] = this.deadlineTime.split(':').map(Number);
|
text: item.dictLabel,
|
||||||
this.timeSelect = { hour, minute, second };
|
value: item.dictValue
|
||||||
// 打开弹窗
|
}));
|
||||||
this.$refs.timePopup.open('center');
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 关闭时间选择弹窗 */
|
/** 查询部门报餐列表 */
|
||||||
closeTimePopup() {
|
getList() {
|
||||||
this.$refs.timePopup.close();
|
this.loading = true;
|
||||||
},
|
listMealReport(this.queryParams).then(response => {
|
||||||
|
this.list = response.rows || [];
|
||||||
|
this.loading = false;
|
||||||
|
this.calcTableSum();
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('获取报餐数据失败:', error);
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/** 处理时分秒数值变化 */
|
/** 核心逻辑:区分有效/无效报餐统计 */
|
||||||
handleTimeChange() {
|
calcTableSum() {
|
||||||
// 确保数值在合法范围内
|
let validDine = 0,
|
||||||
this.timeSelect.hour = Math.max(0, Math.min(23, this.timeSelect.hour));
|
validTake = 0,
|
||||||
this.timeSelect.minute = Math.max(0, Math.min(59, this.timeSelect.minute));
|
validAll = 0;
|
||||||
this.timeSelect.second = Math.max(0, Math.min(59, this.timeSelect.second));
|
let invalidDine = 0,
|
||||||
},
|
invalidTake = 0,
|
||||||
|
invalidAll = 0;
|
||||||
|
|
||||||
/** 确认选择的时间 */
|
this.list.forEach(item => {
|
||||||
confirmTime() {
|
// 处理空值,转为数字
|
||||||
// 格式化时分秒(补零)
|
const dine = item.dineInPeople ? Number(item.dineInPeople) : 0;
|
||||||
const hour = String(this.timeSelect.hour).padStart(2, '0');
|
const take = item.takeoutPeople ? Number(item.takeoutPeople) : 0;
|
||||||
const minute = String(this.timeSelect.minute).padStart(2, '0');
|
const total = item.totalPeople ? Number(item.totalPeople) : 0;
|
||||||
const second = String(this.timeSelect.second).padStart(2, '0');
|
|
||||||
// 更新截止时间
|
// 判断当前报餐是否有效
|
||||||
this.deadlineTime = `${hour}:${minute}:${second}`;
|
if (this.isValidMealReport(item.createTime)) {
|
||||||
// 重新计算统计数据
|
validDine += dine;
|
||||||
this.calcTableSum();
|
validTake += take;
|
||||||
// 关闭弹窗
|
validAll += total;
|
||||||
this.closeTimePopup();
|
} else {
|
||||||
|
invalidDine += dine;
|
||||||
|
invalidTake += take;
|
||||||
|
invalidAll += total;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 赋值到统计变量
|
||||||
|
this.validDineIn = validDine;
|
||||||
|
this.validTakeout = validTake;
|
||||||
|
this.validTotal = validAll;
|
||||||
|
this.invalidDineIn = invalidDine;
|
||||||
|
this.invalidTakeout = invalidTake;
|
||||||
|
this.invalidTotal = invalidAll;
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 判断报餐是否有效:创建时间在截止时间之前则有效 */
|
||||||
|
isValidMealReport(createTime) {
|
||||||
|
if (!createTime) return false;
|
||||||
|
|
||||||
|
// 拼接完整的截止时间字符串
|
||||||
|
const deadlineDateTime = `${this.deadlineDate || this.queryParams.reportDate} ${this.deadlineTime}`;
|
||||||
|
// 比较时间
|
||||||
|
const createTimeObj = new Date(createTime);
|
||||||
|
const deadlineTimeObj = new Date(deadlineDateTime);
|
||||||
|
|
||||||
|
return createTimeObj <= deadlineTimeObj;
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 报餐日期选择确认 */
|
||||||
|
onDateConfirm(e) {
|
||||||
|
this.queryParams.reportDate = e;
|
||||||
|
// 如果截止日期未选择,同步为报餐日期
|
||||||
|
if (!this.deadlineDate) {
|
||||||
|
this.deadlineDate = e;
|
||||||
|
}
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 截止日期选择确认 */
|
||||||
|
onDeadlineDateConfirm(e) {
|
||||||
|
this.deadlineDate = e;
|
||||||
|
this.calcTableSum();
|
||||||
|
},
|
||||||
|
|
||||||
|
// ===== 自定义时间选择器逻辑 =====
|
||||||
|
/** 打开时间选择弹窗 */
|
||||||
|
openTimePopup() {
|
||||||
|
// 解析当前时间到选择器
|
||||||
|
const [hour, minute, second] = this.deadlineTime.split(':').map(Number);
|
||||||
|
this.timeSelect = {
|
||||||
|
hour,
|
||||||
|
minute,
|
||||||
|
second
|
||||||
|
};
|
||||||
|
// 打开弹窗
|
||||||
|
this.$refs.timePopup.open('center');
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 关闭时间选择弹窗 */
|
||||||
|
closeTimePopup() {
|
||||||
|
this.$refs.timePopup.close();
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 处理时分秒数值变化 */
|
||||||
|
handleTimeChange() {
|
||||||
|
// 确保数值在合法范围内
|
||||||
|
this.timeSelect.hour = Math.max(0, Math.min(23, this.timeSelect.hour));
|
||||||
|
this.timeSelect.minute = Math.max(0, Math.min(59, this.timeSelect.minute));
|
||||||
|
this.timeSelect.second = Math.max(0, Math.min(59, this.timeSelect.second));
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 确认选择的时间 */
|
||||||
|
confirmTime() {
|
||||||
|
// 格式化时分秒(补零)
|
||||||
|
const hour = String(this.timeSelect.hour).padStart(2, '0');
|
||||||
|
const minute = String(this.timeSelect.minute).padStart(2, '0');
|
||||||
|
const second = String(this.timeSelect.second).padStart(2, '0');
|
||||||
|
// 更新截止时间
|
||||||
|
this.deadlineTime = `${hour}:${minute}:${second}`;
|
||||||
|
// 重新计算统计数据
|
||||||
|
this.calcTableSum();
|
||||||
|
// 关闭弹窗
|
||||||
|
this.closeTimePopup();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* 容器样式 */
|
/* 容器样式 */
|
||||||
.meal-report-container {
|
.meal-report-container {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 日期时间选择区域 */
|
/* 日期时间选择区域 */
|
||||||
.date-time-wrap {
|
.date-time-wrap {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
.picker-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
.picker-label {
|
|
||||||
font-size: 14px;
|
|
||||||
color: #333;
|
|
||||||
min-width: 80px;
|
|
||||||
}
|
|
||||||
.picker-input {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 自定义时间选择器样式 */
|
.picker-item {
|
||||||
.custom-time-picker {
|
display: flex;
|
||||||
flex: 1;
|
align-items: center;
|
||||||
display: flex;
|
gap: 8px;
|
||||||
align-items: center;
|
}
|
||||||
justify-content: space-between;
|
|
||||||
padding: 8px 10px;
|
|
||||||
border: 1px solid #eee;
|
|
||||||
border-radius: 4px;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
.time-text {
|
|
||||||
font-size: 14px;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 统计卡片样式 */
|
.picker-label {
|
||||||
.statistics-card {
|
font-size: 14px;
|
||||||
background-color: #fff;
|
color: #333;
|
||||||
border-radius: 8px;
|
min-width: 80px;
|
||||||
overflow: hidden;
|
}
|
||||||
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
|
|
||||||
}
|
|
||||||
.card-title {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #333;
|
|
||||||
padding: 12px 15px;
|
|
||||||
border-bottom: 1px solid #eee;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 网格布局:3列 */
|
.picker-input {
|
||||||
.stats-grid {
|
flex: 1;
|
||||||
display: grid;
|
}
|
||||||
grid-template-columns: repeat(3, 1fr);
|
|
||||||
border: 1px solid #eee;
|
|
||||||
border-top: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 统计项样式 */
|
/* 自定义时间选择器样式 */
|
||||||
.stats-item {
|
.custom-time-picker {
|
||||||
padding: 12px 8px;
|
flex: 1;
|
||||||
text-align: center;
|
display: flex;
|
||||||
border-right: 1px solid #eee;
|
align-items: center;
|
||||||
border-bottom: 1px solid #eee;
|
justify-content: space-between;
|
||||||
box-sizing: border-box;
|
padding: 8px 10px;
|
||||||
font-size: 14px;
|
border: 1px solid #eee;
|
||||||
}
|
border-radius: 4px;
|
||||||
/* 去掉最后一列右边框 */
|
background-color: #fff;
|
||||||
.stats-grid .stats-item:nth-child(3n) {
|
}
|
||||||
border-right: none;
|
|
||||||
}
|
|
||||||
/* 去掉最后一行下边框 */
|
|
||||||
.stats-grid .stats-item:last-child,
|
|
||||||
.stats-grid .stats-item:nth-last-child(2),
|
|
||||||
.stats-grid .stats-item:nth-last-child(3) {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 标签和值样式 */
|
.time-text {
|
||||||
.item-label {
|
font-size: 14px;
|
||||||
display: block;
|
color: #333;
|
||||||
color: #666;
|
}
|
||||||
font-size: 12px;
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
.item-value {
|
|
||||||
display: block;
|
|
||||||
color: #333;
|
|
||||||
font-size: 15px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 时间弹窗样式 */
|
/* 统计卡片样式 */
|
||||||
.time-popup-content {
|
.statistics-card {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding-bottom: 20px;
|
border-radius: 8px;
|
||||||
}
|
overflow: hidden;
|
||||||
.popup-header {
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
||||||
display: flex;
|
}
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 12px 15px;
|
|
||||||
border-bottom: 1px solid #eee;
|
|
||||||
}
|
|
||||||
.popup-title {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.popup-btns {
|
|
||||||
display: flex;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
.cancel-btn, .confirm-btn {
|
|
||||||
padding: 6px 12px;
|
|
||||||
font-size: 14px;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
.cancel-btn {
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
color: #666;
|
|
||||||
border: 1px solid #eee;
|
|
||||||
}
|
|
||||||
.confirm-btn {
|
|
||||||
background-color: #007aff;
|
|
||||||
color: #fff;
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 时分秒选择区域 */
|
.card-title {
|
||||||
.time-select-wrap {
|
font-size: 16px;
|
||||||
display: flex;
|
font-weight: 600;
|
||||||
flex-direction: column;
|
color: #333;
|
||||||
align-items: center;
|
padding: 12px 15px;
|
||||||
justify-content: center;
|
border-bottom: 1px solid #eee;
|
||||||
gap: 10px;
|
}
|
||||||
padding: 20px 15px;
|
|
||||||
}
|
|
||||||
.time-unit {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
.unit-label {
|
|
||||||
font-size: 12px;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
.colon {
|
|
||||||
font-size: 20px;
|
|
||||||
color: #333;
|
|
||||||
margin: 0 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 适配小屏手机 */
|
/* 网格布局:3列 */
|
||||||
@media (max-width: 375px) {
|
.stats-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
border: 1px solid #eee;
|
||||||
|
border-top: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 统计项样式 */
|
||||||
.stats-item {
|
.stats-item {
|
||||||
padding: 10px 5px;
|
padding: 12px 8px;
|
||||||
}
|
text-align: center;
|
||||||
.item-label {
|
border-right: 1px solid #eee;
|
||||||
font-size: 11px;
|
border-bottom: 1px solid #eee;
|
||||||
}
|
box-sizing: border-box;
|
||||||
.item-value {
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
.time-select-wrap {
|
|
||||||
gap: 5px;
|
/* 去掉最后一列右边框 */
|
||||||
padding: 15px 10px;
|
.stats-grid .stats-item:nth-child(3n) {
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 去掉最后一行下边框 */
|
||||||
|
.stats-grid .stats-item:last-child,
|
||||||
|
.stats-grid .stats-item:nth-last-child(2),
|
||||||
|
.stats-grid .stats-item:nth-last-child(3) {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 标签和值样式 */
|
||||||
|
.item-label {
|
||||||
|
display: block;
|
||||||
|
color: #666;
|
||||||
|
font-size: 12px;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-value {
|
||||||
|
display: block;
|
||||||
|
color: #333;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 时间弹窗样式 */
|
||||||
|
.time-popup-content {
|
||||||
|
background-color: #fff;
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 12px 15px;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-btns {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cancel-btn,
|
||||||
|
.confirm-btn {
|
||||||
|
padding: 6px 12px;
|
||||||
|
font-size: 14px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cancel-btn {
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
color: #666;
|
||||||
|
border: 1px solid #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.confirm-btn {
|
||||||
|
background-color: #007aff;
|
||||||
|
color: #fff;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 时分秒选择区域 */
|
||||||
|
.time-select-wrap {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 10px;
|
||||||
|
padding: 20px 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time-unit {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.unit-label {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.colon {
|
||||||
|
font-size: 20px;
|
||||||
|
color: #333;
|
||||||
|
margin: 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 适配小屏手机 */
|
||||||
|
@media (max-width: 375px) {
|
||||||
|
.stats-item {
|
||||||
|
padding: 10px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-label {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-value {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time-select-wrap {
|
||||||
|
gap: 5px;
|
||||||
|
padding: 15px 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
@@ -73,7 +73,7 @@ function checkStorageSpace() {
|
|||||||
function checkUpdate(forceCheck = false) {
|
function checkUpdate(forceCheck = false) {
|
||||||
// 1. 准备本地版本信息
|
// 1. 准备本地版本信息
|
||||||
const localVersion = plus.runtime.version; // 基座版本
|
const localVersion = plus.runtime.version; // 基座版本
|
||||||
const staticVersion = '1.3.29'; // 静态默认版本
|
const staticVersion = '1.3.30'; // 静态默认版本
|
||||||
// const localWgtVersion = staticVersion;
|
// const localWgtVersion = staticVersion;
|
||||||
const localWgtVersion = uni.getStorageSync('wgtVersion') || staticVersion; // 本地wgt版本(从存储获取或用默认)
|
const localWgtVersion = uni.getStorageSync('wgtVersion') || staticVersion; // 本地wgt版本(从存储获取或用默认)
|
||||||
const currentVersion = compareVersion(localWgtVersion, localVersion) > 0
|
const currentVersion = compareVersion(localWgtVersion, localVersion) > 0
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "klp 1.3.29",
|
"version": "klp 1.3.30",
|
||||||
"wgtUrl": "http://49.232.154.205:10900/fadapp-update/klp/klp.wgt",
|
"wgtUrl": "http://49.232.154.205:10900/fadapp-update/klp/klp.wgt",
|
||||||
"apkUrl": "http://49.232.154.205:10900/fadapp-update/klp/klp.apk"
|
"apkUrl": "http://49.232.154.205:10900/fadapp-update/klp/klp.apk"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user