diff --git a/App.vue b/App.vue index ae33f74..55d9213 100644 --- a/App.vue +++ b/App.vue @@ -12,7 +12,7 @@ export default { initApp() { // 初始化应用配置 this.initConfig(); - // 检查用户登录状态 + // 检查用户登录状态(H5 debug跳过) //#ifdef H5 this.checkLogin(); //#endif @@ -31,4 +31,7 @@ export default { diff --git a/api/preparationTask/index.js b/api/preparationTask/index.js new file mode 100644 index 0000000..616d619 --- /dev/null +++ b/api/preparationTask/index.js @@ -0,0 +1,46 @@ +import request from '@/utils/request' + +// 获取全部线 +export function getLineOptions(params) { + return request({ + url: '/mes/Mobile/PreparationTask/get_lines', + method: 'get', + params + }) +} + +// 根据线获取工单 +export function getWorkOrderList(params) { + return request({ + url: '/mes/Mobile/PreparationTask/get_workorder', + method: 'get', + params + }) +} + +// 根据工单获取任务 +export function getWorkOrderTaskList(params) { + return request({ + url: '/mes/Mobile/PreparationTask/get_workorder_task', + method: 'get', + params + }) +} + +// 获取任务详情 +export function getTaskInfoList(params) { + return request({ + url: '/mes/Mobile/PreparationTask/get_task_info', + method: 'get', + params + }) +} + +// 任务生成 +export function generateIngredientTask(data) { + return request({ + url: '/mes/Mobile/PreparationTask/generate_ingredient_task', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/api/scan/index.js b/api/scan/index.js new file mode 100644 index 0000000..cac796b --- /dev/null +++ b/api/scan/index.js @@ -0,0 +1,10 @@ +import request from '@/utils/request' + +// 解析标签信息 +export function analysisScanCode(params) { + return request({ + url: '/mes/Mobile/PreparationTask/parse_material_code', + method: 'get', + params + }) +} \ No newline at end of file diff --git a/components/scan-input/scan-input.vue b/components/scan-input/scan-input.vue new file mode 100644 index 0000000..4b60dd9 --- /dev/null +++ b/components/scan-input/scan-input.vue @@ -0,0 +1,62 @@ + + + + + diff --git a/main.js b/main.js index 3985b1b..686af12 100644 --- a/main.js +++ b/main.js @@ -3,15 +3,24 @@ import App from './App' import store from './store' // store import plugins from './plugins' // plugins import './permission' // permission + +// dayjs + +import dayjs from 'dayjs' + +// 插件安装 +import scanInputVue from './components/scan-input/scan-input.vue' +Vue.component('ScanInput', scanInputVue) + Vue.use(plugins) Vue.config.productionTip = false Vue.prototype.$store = store - +Vue.prototype.$dayjs = dayjs App.mpType = 'app' const app = new Vue({ - ...App + ...App }) -app.$mount() +app.$mount() \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..8155ec5 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "dayjs": "^1.11.13" + } +} diff --git a/pages.json b/pages.json index c64b308..510f98c 100644 --- a/pages.json +++ b/pages.json @@ -1,79 +1,108 @@ { "pages": [{ - "path": "pages/login", - "style": { - "navigationBarTitleText": "登录" + "path": "pages/login", + "style": { + "navigationBarTitleText": "登录", + "navigationStyle": "custom" + } + }, { + "path": "pages/register", + "style": { + "navigationBarTitleText": "注册" + } + }, { + "path": "pages/index", + "style": { + "navigationBarTitleText": "首页" + } + }, { + "path": "pages/work/index", + "style": { + "navigationBarTitleText": "功能" + } + }, { + "path": "pages/mine/index", + "style": { + "navigationBarTitleText": "我的", + "navigationStyle": "custom" + } + }, { + "path": "pages/mine/avatar/index", + "style": { + "navigationBarTitleText": "修改头像" + } + }, { + "path": "pages/mine/info/index", + "style": { + "navigationBarTitleText": "个人信息" + } + }, { + "path": "pages/mine/info/edit", + "style": { + "navigationBarTitleText": "编辑资料" + } + }, { + "path": "pages/mine/pwd/index", + "style": { + "navigationBarTitleText": "修改密码" + } + }, { + "path": "pages/mine/setting/index", + "style": { + "navigationBarTitleText": "应用设置" + } + }, { + "path": "pages/mine/help/index", + "style": { + "navigationBarTitleText": "常见问题" + } + }, { + "path": "pages/mine/about/index", + "style": { + "navigationBarTitleText": "关于我们" + } + }, { + "path": "pages/common/webview/index", + "style": { + "navigationBarTitleText": "浏览网页" + } + }, { + "path": "pages/common/textview/index", + "style": { + "navigationBarTitleText": "浏览文本" + } + }, + { + "path": "pages/materialManagement/materialPreparation/index", + "style": { + "navigationBarTitleText": "备料管理" + } + }, + { + "path" : "pages/materialManagement/materialPreparation/batching", + "style" : + { + "navigationBarTitleText" : "配料任务" + } + }, + { + "path" : "pages/materialManagement/materialPreparation/taskDetail", + "style" : + { + "navigationBarTitleText" : "任务详情" + } + }, + { + "path" : "pages/materialManagement/materialPreparation/scanAddBatching", + "style" : + { + "navigationBarTitleText" : "扫码配料" + } } - }, { - "path": "pages/register", - "style": { - "navigationBarTitleText": "注册" - } - }, { - "path": "pages/index", - "style": { - "navigationBarTitleText": "首页", - "navigationStyle": "custom" - } - }, { - "path": "pages/work/index", - "style": { - "navigationBarTitleText": "工作台" - } - }, { - "path": "pages/mine/index", - "style": { - "navigationBarTitleText": "我的" - } - }, { - "path": "pages/mine/avatar/index", - "style": { - "navigationBarTitleText": "修改头像" - } - }, { - "path": "pages/mine/info/index", - "style": { - "navigationBarTitleText": "个人信息" - } - }, { - "path": "pages/mine/info/edit", - "style": { - "navigationBarTitleText": "编辑资料" - } - }, { - "path": "pages/mine/pwd/index", - "style": { - "navigationBarTitleText": "修改密码" - } - }, { - "path": "pages/mine/setting/index", - "style": { - "navigationBarTitleText": "应用设置" - } - }, { - "path": "pages/mine/help/index", - "style": { - "navigationBarTitleText": "常见问题" - } - }, { - "path": "pages/mine/about/index", - "style": { - "navigationBarTitleText": "关于我们" - } - }, { - "path": "pages/common/webview/index", - "style": { - "navigationBarTitleText": "浏览网页" - } - }, { - "path": "pages/common/textview/index", - "style": { - "navigationBarTitleText": "浏览文本" - } - }], + ], "tabBar": { "color": "#000000", - "selectedColor": "#000000", + "selectedColor": "#2979ff", "borderStyle": "white", "backgroundColor": "#ffffff", "list": [{ @@ -85,7 +114,7 @@ "pagePath": "pages/work/index", "iconPath": "static/images/tabbar/work.png", "selectedIconPath": "static/images/tabbar/work_.png", - "text": "工作台" + "text": "功能" }, { "pagePath": "pages/mine/index", "iconPath": "static/images/tabbar/mine.png", @@ -94,8 +123,8 @@ }] }, "globalStyle": { - "navigationBarTextStyle": "black", - "navigationBarTitleText": "RuoYi", - "navigationBarBackgroundColor": "#FFFFFF" + "navigationBarTextStyle": "white", + "navigationBarTitleText": "首页", + "navigationBarBackgroundColor": "#2979ff" } } \ No newline at end of file diff --git a/pages/index.vue b/pages/index.vue index 4646807..438df99 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1,43 +1,59 @@ diff --git a/pages/login.vue b/pages/login.vue index 6e8057a..77a70f1 100644 --- a/pages/login.vue +++ b/pages/login.vue @@ -20,28 +20,34 @@ + + + + + - + + 立即注册 登录即代表同意 - - + 《用户协议》 + 《隐私协议》 + --> + + diff --git a/pages/materialManagement/materialPreparation/index.vue b/pages/materialManagement/materialPreparation/index.vue new file mode 100644 index 0000000..24d899d --- /dev/null +++ b/pages/materialManagement/materialPreparation/index.vue @@ -0,0 +1,146 @@ + + + + + diff --git a/pages/materialManagement/materialPreparation/scanAddBatching.vue b/pages/materialManagement/materialPreparation/scanAddBatching.vue new file mode 100644 index 0000000..2061094 --- /dev/null +++ b/pages/materialManagement/materialPreparation/scanAddBatching.vue @@ -0,0 +1,130 @@ + + + + + diff --git a/pages/materialManagement/materialPreparation/taskDetail.vue b/pages/materialManagement/materialPreparation/taskDetail.vue new file mode 100644 index 0000000..030d99a --- /dev/null +++ b/pages/materialManagement/materialPreparation/taskDetail.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/pages/mine/index.vue b/pages/mine/index.vue index b79ed52..b46bc47 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -1,198 +1,191 @@ diff --git a/pages/work/index.vue b/pages/work/index.vue index 1afefc9..4204cd9 100644 --- a/pages/work/index.vue +++ b/pages/work/index.vue @@ -1,183 +1,165 @@ diff --git a/permission.js b/permission.js index cbaec53..2182b8b 100644 --- a/permission.js +++ b/permission.js @@ -20,9 +20,9 @@ list.forEach(item => { uni.addInterceptor(item, { invoke(to) { if (getToken()) { - if (to.url === loginPage) { - uni.reLaunch({ url: "/" }) - } + // if (to.url === loginPage) { + // uni.reLaunch({ url: "/" }) + // } return true } else { if (checkWhite(to.url)) { diff --git a/static/scss/global.scss b/static/scss/global.scss index ac636bd..04a7fe6 100644 --- a/static/scss/global.scss +++ b/static/scss/global.scss @@ -22,69 +22,68 @@ } .list-cell-arrow::before { - content: ' '; - height: 10px; - width: 10px; - border-width: 2px 2px 0 0; - border-color: #c0c0c0; - border-style: solid; - -webkit-transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0); - transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0); - position: absolute; - top: 50%; - margin-top: -6px; - right: 30rpx; - } - - .list-cell { - position: relative; - width: 100%; - box-sizing: border-box; - background-color: #fff; - color: #333; - padding: 26rpx 30rpx; - } - - .list-cell:first-child { - border-radius: 8rpx 8rpx 0 0; - } - - .list-cell:last-child { - border-radius: 0 0 8rpx 8rpx; - } - - .list-cell::after { - content: ''; - position: absolute; - border-bottom: 1px solid #eaeef1; - -webkit-transform: scaleY(0.5) translateZ(0); - transform: scaleY(0.5) translateZ(0); - transform-origin: 0 100%; - bottom: 0; - right: 0; - left: 0; - pointer-events: none; - } - - - .menu-list { - margin: 15px 15px; - - .menu-item-box { - width: 100%; - display: flex; - align-items: center; - - .menu-icon { - color: #007AFF; - font-size: 16px; - margin-right: 5px; - } - - .text-right { - margin-left: auto; - margin-right: 34rpx; - color: #999; - } - } - } + content: ' '; + height: 10px; + width: 10px; + border-width: 2px 2px 0 0; + border-color: #c0c0c0; + border-style: solid; + -webkit-transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0); + transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0); + position: absolute; + top: 50%; + margin-top: -6px; + right: 30rpx; +} + +.list-cell { + position: relative; + width: 100%; + box-sizing: border-box; + background-color: #fff; + color: #333; + padding: 26rpx 30rpx; +} + +.list-cell:first-child { + border-radius: 8rpx 8rpx 0 0; +} + +.list-cell:last-child { + border-radius: 0 0 8rpx 8rpx; +} + +.list-cell::after { + content: ''; + position: absolute; + border-bottom: 1px solid #eaeef1; + -webkit-transform: scaleY(0.5) translateZ(0); + transform: scaleY(0.5) translateZ(0); + transform-origin: 0 100%; + bottom: 0; + right: 0; + left: 0; + pointer-events: none; +} + +.menu-list { + margin: 15px 15px; + + .menu-item-box { + width: 100%; + display: flex; + align-items: center; + + .menu-icon { + color: #007aff; + font-size: 16px; + margin-right: 5px; + } + + .text-right { + margin-left: auto; + margin-right: 34rpx; + color: #999; + } + } +} diff --git a/utils/baseUrl.js b/utils/baseUrl.js new file mode 100644 index 0000000..f7457d2 --- /dev/null +++ b/utils/baseUrl.js @@ -0,0 +1,13 @@ +const BaseUrlKey = 'BaseUrl' + +export function getBaseUrl() { + return uni.getStorageSync(BaseUrlKey) +} + +export function setBaseUrl(BaseUrl) { + return uni.setStorageSync(BaseUrlKey, BaseUrl) +} + +export function removeBaseUrl() { + return uni.removeStorageSync(BaseUrlKey) +} \ No newline at end of file diff --git a/utils/request.js b/utils/request.js index d0efd45..1d321f1 100644 --- a/utils/request.js +++ b/utils/request.js @@ -3,6 +3,11 @@ import config from '@/config' import { getToken } from '@/utils/auth' +import { + getBaseUrl, + setBaseUrl, + removeBaseUrl +} from '@/utils/baseUrl'; import errorCode from '@/utils/errorCode' import { toast, @@ -15,6 +20,7 @@ const baseUrl = config.baseUrl const request = config => { // 是否需要设置 token + const storageBaseUrl = 'http://' + getBaseUrl(); const isToken = (config.headers || {}).isToken === false config.header = config.header || {} if (getToken() && !isToken) { @@ -30,7 +36,7 @@ const request = config => { uni.request({ method: config.method || 'get', timeout: config.timeout || timeout, - url: config.baseUrl || baseUrl + config.url, + url: config.baseUrl || storageBaseUrl + config.url, data: config.data, header: config.header, dataType: 'json' diff --git a/utils/scan.js b/utils/scan.js new file mode 100644 index 0000000..0381026 --- /dev/null +++ b/utils/scan.js @@ -0,0 +1,42 @@ + + +// 案例 +const example = ["20103484/20240907//2142","20103237/20240907//2142"] + + +export function formatValue(value) { + try { + if (value === "" || value === null || value === undefined) { + return "" + } + return analysisScanValue1(value) + } catch (err) { + uni.showToast({ + title: '标题', + duration: 2000 + }); + return "" + } +} +// 反馈对象 零件号,批次号(日期),数量,供应商代码 +let jsonObj = { + partnumber: '', + batchnumber: '', + quantity: 0.0, + code: '' +} + +export function getNewJsonObj() { + return JSON.parse(JSON.stringify(jsonObj)) +} + +function analysisScanValue1(value) { + const parts = value.split('/'); + const filteredParts = parts.filter(part => part !== ''); + const [first, second, third] = filteredParts; + let newJsonObj = getNewJsonObj(); + newJsonObj.partnumber = first; + newJsonObj.batchnumber = second; + newJsonObj.code = third; + return newJsonObj +} \ No newline at end of file