diff --git a/apps/hand-factory/api/wms/mealReport.js b/apps/hand-factory/api/wms/mealReport.js new file mode 100644 index 0000000..56d543f --- /dev/null +++ b/apps/hand-factory/api/wms/mealReport.js @@ -0,0 +1,72 @@ +import request from '@/utils/request' + +// 查询部门报餐主列表 +export function listMealReport(query) { + return request({ + url: '/wms/mealReport/list', + method: 'get', + params: query + }) +} + +// 查询部门报餐主详细 +export function getMealReport(reportId) { + return request({ + url: '/wms/mealReport/' + reportId, + method: 'get' + }) +} + +// 新增部门报餐主 +export function addMealReport(data) { + return request({ + url: '/wms/mealReport', + method: 'post', + data: data + }) +} + +// 修改部门报餐主 +export function updateMealReport(data) { + return request({ + url: '/wms/mealReport', + method: 'put', + data: data + }) +} + +// 删除部门报餐主 +export function delMealReport(reportId) { + return request({ + url: '/wms/mealReport/' + reportId, + method: 'delete' + }) +} + +// 报表相关接口 +// 按餐别统计 +export function getMealTypeCount(query) { + return request({ + url: '/wms/mealReport/report/mealType', + method: 'get', + params: query + }) +} + +// 按部门统计 +export function getDeptCount(query) { + return request({ + url: '/wms/mealReport/report/dept', + method: 'get', + params: query + }) +} + +// 按日期统计 +export function getDateCount(query) { + return request({ + url: '/wms/mealReport/report/date', + method: 'get', + params: query + }) +} diff --git a/apps/hand-factory/config.js b/apps/hand-factory/config.js index c2d7381..c6745a2 100644 --- a/apps/hand-factory/config.js +++ b/apps/hand-factory/config.js @@ -9,7 +9,7 @@ module.exports = { // 应用名称 name: "ruoyi-app", // 应用版本 - version: "1.3.26", + version: "1.3.27", // 应用logo logo: "/static/logo.jpg", // 官方网站 diff --git a/apps/hand-factory/manifest.json b/apps/hand-factory/manifest.json index 072448a..1746b1f 100644 --- a/apps/hand-factory/manifest.json +++ b/apps/hand-factory/manifest.json @@ -2,7 +2,7 @@ "name" : "科伦普", "appid" : "__UNI__E781B49", "description" : "", - "versionName" : "1.3.26", + "versionName" : "1.3.27", "versionCode" : 1, "transformPx" : false, "app-plus" : { diff --git a/apps/hand-factory/pages.json b/apps/hand-factory/pages.json index 4acfad2..0252781 100644 --- a/apps/hand-factory/pages.json +++ b/apps/hand-factory/pages.json @@ -88,6 +88,12 @@ "style": { "navigationBarTitleText": "钢卷查询" } + }, + { + "path": "pages/meal/meal", + "style": { + "navigationBarTitleText": "报餐情况" + } } // { // "path": "pages/register", @@ -180,6 +186,12 @@ "selectedIconPath": "/static/images/tabbar/search_.png", "iconPath": "/static/images/tabbar/search.png" }, + { + "text": "报餐", + "pagePath": "pages/meal/meal", + "selectedIconPath": "/static/images/tabbar/meal_.png", + "iconPath": "/static/images/tabbar/meal.png" + }, { "text": "我的", "pagePath": "pages/mine/index", diff --git a/apps/hand-factory/pages/index.vue b/apps/hand-factory/pages/index.vue index 038ec44..625b678 100644 --- a/apps/hand-factory/pages/index.vue +++ b/apps/hand-factory/pages/index.vue @@ -5,7 +5,12 @@ export default { data() { return { - hasJumped: false // 防止重复跳转的标记 + tabVisible: { + admin: [true, true, true, true, true, true], + canteen: [false, false, false, false, true, true], + worker: [false, true, true, true, false, true] + }, + hasJumped: false, // 防止重复跳转的标记 } }, onShow() { @@ -25,10 +30,13 @@ export default { const roles = res.data.roles; if (roles.includes('admin')) { - uni.setTabBarItem({ - index: 0, - visible: true - }); + for (let i = 0; i < this.tabVisible.admin.length; i++) { + const v = this.tabVisible.admin[i] + uni.setTabBarItem({ + index: i, + visible: v + }); + } // 管理员角色跳转 uni.switchTab({ url: '/pages/line/line', @@ -44,14 +52,48 @@ export default { }); } }); + } else if (roles.includes('canteen')) { + for (let i = 0; i < this.tabVisible.canteen.length; i++) { + const v = this.tabVisible.canteen[i] + uni.setTabBarItem({ + index: i, + visible: v + }); + } + // 食堂角色跳转 + uni.switchTab({ + url: '/pages/meal/meal', + success: () => { + this.hasJumped = true; // 标记已跳转 + }, + fail: (err) => { + console.error('管理员页面跳转失败:', err); + uni.showToast({ + title: '跳转产线页面失败', + icon: 'none', + duration: 2000 + }); + } + }); } else if (roles.includes('worker')) { // 工人角色跳转 // 设置tab内容 // 设置产线和复杂扫码不可见 - uni.setTabBarItem({ - index: 0, - visible: false - }); + for (let i = 0; i < this.tabVisible.worker.length; i++) { + const v = this.tabVisible.worker[i] + uni.setTabBarItem({ + index: i, + visible: v + }); + } + // uni.setTabBarItem({ + // index: 0, + // visible: false + // }); + // uni.setTabBarItem({ + // index: 4, + // visible: false + // }); uni.switchTab({ url: '/pages/easycode/easycode', success: () => { @@ -68,15 +110,18 @@ export default { }); } else { // 处理未定义角色(默认角色) - uni.showToast({ - title: '检测到未知角色,将跳转至默认页面', - icon: 'none', - duration: 2000 - }); - uni.setTabBarItem({ - index: 0, - visible: false - }); + // uni.showToast({ + // title: '检测到未知角色,将跳转至默认页面', + // icon: 'none', + // duration: 2000 + // }); + for (let i = 0; i < this.tabVisible.worker.length; i++) { + const v = this.tabVisible.worker[i] + uni.setTabBarItem({ + index: i, + visible: v + }); + } // 延迟跳转,确保提示被用户看到 setTimeout(() => { uni.switchTab({ diff --git a/apps/hand-factory/pages/meal/meal.vue b/apps/hand-factory/pages/meal/meal.vue new file mode 100644 index 0000000..90943ce --- /dev/null +++ b/apps/hand-factory/pages/meal/meal.vue @@ -0,0 +1,508 @@ + + + + + \ No newline at end of file diff --git a/apps/hand-factory/static/images/tabbar/meal.png b/apps/hand-factory/static/images/tabbar/meal.png new file mode 100644 index 0000000..be80519 Binary files /dev/null and b/apps/hand-factory/static/images/tabbar/meal.png differ diff --git a/apps/hand-factory/static/images/tabbar/meal_.png b/apps/hand-factory/static/images/tabbar/meal_.png new file mode 100644 index 0000000..c11bdce Binary files /dev/null and b/apps/hand-factory/static/images/tabbar/meal_.png differ diff --git a/apps/hand-factory/utils/update.js b/apps/hand-factory/utils/update.js index a686aa8..9ca2cf1 100644 --- a/apps/hand-factory/utils/update.js +++ b/apps/hand-factory/utils/update.js @@ -73,7 +73,7 @@ function checkStorageSpace() { function checkUpdate(forceCheck = false) { // 1. 准备本地版本信息 const localVersion = plus.runtime.version; // 基座版本 - const staticVersion = '1.3.26'; // 静态默认版本 + const staticVersion = '1.3.27'; // 静态默认版本 // const localWgtVersion = staticVersion; const localWgtVersion = uni.getStorageSync('wgtVersion') || staticVersion; // 本地wgt版本(从存储获取或用默认) const currentVersion = compareVersion(localWgtVersion, localVersion) > 0 diff --git a/apps/hand-factory/version.json b/apps/hand-factory/version.json index 4006807..d4f928c 100644 --- a/apps/hand-factory/version.json +++ b/apps/hand-factory/version.json @@ -1,5 +1,5 @@ { - "version": "klp 1.3.26", + "version": "klp 1.3.27", "wgtUrl": "http://49.232.154.205:10900/fadapp-update/klp/klp.wgt", "apkUrl": "http://49.232.154.205:10900/fadapp-update/klp/klp.apk" } \ No newline at end of file