diff --git a/api/login.js b/api/login.js index 0ef8f2c..79ecc74 100644 --- a/api/login.js +++ b/api/login.js @@ -2,60 +2,61 @@ import request from '@/utils/request' // 登录方法 export function login(username, password, code, uuid, clientId) { - const data = { - username, - password, - code, - uuid, - clientId - } - return request({ - 'url': '/login', - headers: { - isToken: false, - userName: username - }, - 'method': 'post', - 'data': data - }) + const data = { + username, + password, + code, + uuid, + clientId + } + return request({ + 'url': '/login', + headers: { + isToken: false, + userName: username + }, + timeout: 3000, + 'method': 'post', + 'data': data + }) } // 注册方法 export function register(data) { - return request({ - url: '/register', - headers: { - isToken: false - }, - method: 'post', - data: data - }) + return request({ + url: '/register', + headers: { + isToken: false + }, + method: 'post', + data: data + }) } // 获取用户详细信息 export function getInfo() { - return request({ - 'url': '/getInfo', - 'method': 'get' - }) + return request({ + 'url': '/getInfo', + 'method': 'get' + }) } // 退出方法 export function logout() { - return request({ - 'url': '/logout', - 'method': 'post' - }) + return request({ + 'url': '/logout', + 'method': 'post' + }) } // 获取验证码 export function getCodeImg() { - return request({ - 'url': '/captchaImage', - headers: { - isToken: false - }, - method: 'get', - timeout: 20000 - }) -} + return request({ + 'url': '/captchaImage', + headers: { + isToken: false + }, + method: 'get', + timeout: 20000 + }) +} \ No newline at end of file diff --git a/api/mmcall/index.js b/api/mmcall/index.js new file mode 100644 index 0000000..18985e9 --- /dev/null +++ b/api/mmcall/index.js @@ -0,0 +1,98 @@ +import request from '@/utils/request' + +// 查询叫料需求表列表 +export function getMmCallList(params) { + return request({ + url: '/mes/materialManagement/paintedparts_call/mmcall/list', + method: 'get', + params + }) +} + +// 查询线别MRP表 +export function queryCallMaterialMRP(params) { + return request({ + url: '/mes/materialManagement/paintedparts_call/mmcall/QueryCallMaterialMRP', + method: 'get', + params + }) +} + +// 获取线清单 groupCode groupName +export function getLineOptions(params) { + return request({ + url: '/mes/materialManagement/paintedparts_call/mmcall/GetLineOptions', + method: 'get', + params + }) +} + +// 查询叫料需求表详情 +export function getMmCallInfo(Id) { + return request({ + url: `/mes/materialManagement/paintedparts_call/mmcall/${Id}`, + method: 'get' + }) +} + +// 添加叫料需求表 +export function addMmCall(data) { + return request({ + url: '/mes/materialManagement/paintedparts_call/mmcall', + method: 'post', + data + }) +} + +// 更新叫料需求表 +export function updateMmCall(data) { + return request({ + url: '/mes/materialManagement/paintedparts_call/mmcall', + method: 'put', + data + }) +} + +// 删除叫料需求表 +export function deleteMmCall(ids) { + return request({ + url: `/mes/materialManagement/paintedparts_call/mmcall/${ids}`, + method: 'delete' + }) +} + +// 生成产线油漆件MRP +export function generateLineMmCallMRP(data) { + return request({ + url: '/mes/materialManagement/paintedparts_call/mmcall/GenerateLineMmCallMRP', + method: 'post', + data + }) +} + +// 涂装油漆件产线叫料 +export function doLineCallMaterial(data) { + return request({ + url: '/mes/materialManagement/paintedparts_call/mmcall/DoLineCallMaterial', + method: 'post', + data + }) +} + +// 涂装油漆件产线领料 +export function doLineReceiveMaterial(data) { + return request({ + url: '/mes/materialManagement/paintedparts_call/mmcall/DoLineReceiveMaterial', + method: 'post', + data + }) +} + +// 涂装油漆件产线退料 +export function doLineReturnBackMaterial(data) { + return request({ + url: '/mes/materialManagement/paintedparts_call/mmcall/DoLineReturnBackMaterial', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/manifest.json b/manifest.json index 7749a2c..ad9fe66 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name": "DOAN总装车间PDA", "appid": "__UNI__EFA389B", "description": "DOAN总装车间PDA", - "versionName": "1.5.0", - "versionCode": 150, + "versionName": "2.0.0", + "versionCode": 200, "transformPx": false, "app-plus": { "networkTimeout": { diff --git a/pages.json b/pages.json index c04cb23..248c77e 100644 --- a/pages.json +++ b/pages.json @@ -196,6 +196,20 @@ { "navigationBarTitleText" : "U03,U05线报工" } + }, + { + "path" : "pages/produceManagement/paintMaterial/paint_call", + "style" : + { + "navigationBarTitleText" : "产线油漆件叫料" + } + }, + { + "path" : "pages/produceManagement/paintMaterial/paint_receive", + "style" : + { + "navigationBarTitleText" : "产线油漆件收料" + } } ], "tabBar": { diff --git a/pages/index.vue b/pages/index.vue index a54ff73..d03c1eb 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -17,7 +17,7 @@ - + {{ item.name }} @@ -28,7 +28,7 @@ - + {{ item.name }} @@ -46,7 +46,7 @@ export default { }, data() { return { - socketRef:null, + socketRef: null, current: 0, swiperDotIndex: 0, bannerList: [ @@ -64,30 +64,40 @@ export default { produceOptions: [ { name: '产线报工(通用)', - icon: 'folder-add-filled', + iconPath: '/static/images/index_menu_icon/work_report_common.svg', url: '/pages/produceManagement/workorder/workorder' }, { name: '产线报工\n(U16线,U17线)', - icon: 'folder-add-filled', + iconPath: '/static/images/index_menu_icon/work_report_u16u17.svg', url: '/pages/produceManagement/workorder/workorder02' }, { name: '产线报工\n(U03线,U05线)', - icon: 'folder-add-filled', + iconPath: '/static/images/index_menu_icon/work_report_u03u05.svg', url: '/pages/produceManagement/workorder/workorder03' }, { name: '安灯报警', - icon: 'notification-filled', + iconPath: '/static/images/index_menu_icon/andon_alarm.svg', url: '/pages/produceManagement/andon/alarm' + }, + { + name: '产线油漆件叫料', + iconPath: '/static/images/index_menu_icon/paint_call.svg', + url: '/pages/produceManagement/paintMaterial/paint_call' + }, + { + name: '产线油漆件收料', + iconPath: '/static/images/index_menu_icon/paint_receive.svg', + url: '/pages/produceManagement/paintMaterial/paint_receive' } ], // 物料模块 materialOptions: [ { name: '产线备料', - icon: 'upload-filled', + iconPath: '/static/images/index_menu_icon/material_preparation.svg', url: '/pages/materialManagement/preparationByPlan/index' } // { @@ -128,8 +138,28 @@ export default { // 处理来自 renderjs 的获取存储数据请求 handleGetStorage() { const value = getBaseUrl(); - console.log('handleGetStorage', this.$refs.socketRef); - this.$refs.socketRef.receiveStorageValue(value); + const maxRetries = 5; + const initialDelay = 300; + let retries = 0; + + const attemptCall = () => { + console.log(`尝试调用receiveStorageValue (第${retries + 1}次)`, this.$refs.socketRef); + if (this.$refs.socketRef && typeof this.$refs.socketRef.receiveStorageValue === 'function') { + console.log('成功调用receiveStorageValue方法'); + this.$refs.socketRef.receiveStorageValue(value); + } else { + if (retries < maxRetries) { + retries++; + const delay = initialDelay * Math.pow(2, retries - 1); // 指数退避 + console.error(`第${retries}次尝试失败: socketRef未初始化或receiveStorageValue方法不存在,${delay}ms后重试`); + setTimeout(attemptCall, delay); + } else { + console.error(`达到最大重试次数(${maxRetries}),调用receiveStorageValue方法失败`); + } + } + }; + + attemptCall(); } } }; @@ -150,22 +180,6 @@ export default { methods: { initSignalR() { this.requestStorageValue(); - let baseUrl = this.baseUrl; - let url = `http://${baseUrl}/pdaHub`; - //let url = "http://192.168.50.163/pdaHub"; - this.signalRUtil = new SignalRUtil(url); - this.signalRUtil - .startConnection() - .then(() => { - this.isSignalRConnected = true; - // 监听服务器发送的消息 - this.signalRUtil.on('Call', (message) => { - this.showSystemAlertAndVibrate(message) - }); - }) - .catch((error) => { - console.error('SignalR 连接失败:', error); - }); }, stopSignalRConnection() { if (this.isSignalRConnected && this.signalRUtil) { @@ -208,20 +222,42 @@ export default { } // #endif }, - // 向逻辑层请求存储数据 - requestStorageValue() { - this.$ownerInstance.callMethod('handleGetStorage'); - }, - // 接收逻辑层返回的存储数据 - receiveStorageValue(value) { - console.log('从存储中获取的值:', value); - this.baseUrl = value; + // 向逻辑层请求存储数据 + requestStorageValue() { + this.$ownerInstance.callMethod('handleGetStorage'); + }, + // 接收逻辑层返回的存储数据 + receiveStorageValue(value) { + console.log('从存储中获取的值:', value); + this.baseUrl = value; - // 在这里可以进行后续处理 - } + // 确保baseUrl不为空时才初始化SignalR + if (this.baseUrl) { + let url = `http://${this.baseUrl}/pdaHub`; + console.log('SignalR 连接 URL:', url); + this.signalRUtil = new SignalRUtil(url); + this.signalRUtil + .startConnection() + .then(() => { + this.isSignalRConnected = true; + // 监听服务器发送的消息 + this.signalRUtil.on('Call', (message) => { + this.showSystemAlertAndVibrate(message) + }); + }) + .catch((error) => { + console.error('SignalR 连接失败:', error); + }); + } else { + console.error('baseUrl为空,无法初始化SignalR连接'); + } + } }, async mounted() { - this.initSignalR() + // 确保组件已经挂载完成再初始化 + setTimeout(() => { + this.initSignalR(); + }, 100); }, } @@ -250,6 +286,12 @@ view { margin-top: 10rpx; } +.menu-icon { + width: 60rpx; + height: 60rpx; + margin-bottom: 8rpx; +} + .grid-item-box { flex: 1; /* #ifndef APP-NVUE */ @@ -285,10 +327,18 @@ view { height: 300rpx; line-height: 300rpx; } + +.menu-icon { + width: 80rpx; + height: 80rpx; + margin-bottom: 8rpx; +} + .card-box { padding-bottom: 60px; margin-bottom: 60px; } + @media screen and (min-width: 500px) { .uni-swiper-dot-box { width: 400px; diff --git a/pages/login.vue b/pages/login.vue index e8d09bb..9d53067 100644 --- a/pages/login.vue +++ b/pages/login.vue @@ -128,6 +128,8 @@ export default { if (this.captchaEnabled) { this.getCode(); } + }).finally(()=>{ + this.$modal.closeLoading(); }); }, // 登录成功后,处理函数 diff --git a/pages/produceManagement/paintMaterial/paint_call.vue b/pages/produceManagement/paintMaterial/paint_call.vue new file mode 100644 index 0000000..5acb7be --- /dev/null +++ b/pages/produceManagement/paintMaterial/paint_call.vue @@ -0,0 +1,362 @@ + + + + + \ No newline at end of file diff --git a/pages/produceManagement/paintMaterial/paint_receive.vue b/pages/produceManagement/paintMaterial/paint_receive.vue new file mode 100644 index 0000000..a10f05d --- /dev/null +++ b/pages/produceManagement/paintMaterial/paint_receive.vue @@ -0,0 +1,249 @@ + + + + + \ No newline at end of file diff --git a/static/images/arrow-icon.svg b/static/images/arrow-icon.svg new file mode 100644 index 0000000..bc43e6e --- /dev/null +++ b/static/images/arrow-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/static/images/index_menu_icon/andon_alarm.svg b/static/images/index_menu_icon/andon_alarm.svg new file mode 100644 index 0000000..6598a28 --- /dev/null +++ b/static/images/index_menu_icon/andon_alarm.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/static/images/index_menu_icon/material_preparation.svg b/static/images/index_menu_icon/material_preparation.svg new file mode 100644 index 0000000..f59d8b2 --- /dev/null +++ b/static/images/index_menu_icon/material_preparation.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/static/images/index_menu_icon/paint_call.svg b/static/images/index_menu_icon/paint_call.svg new file mode 100644 index 0000000..1ac5f2d --- /dev/null +++ b/static/images/index_menu_icon/paint_call.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/static/images/index_menu_icon/paint_receive.svg b/static/images/index_menu_icon/paint_receive.svg new file mode 100644 index 0000000..91c3c1d --- /dev/null +++ b/static/images/index_menu_icon/paint_receive.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/static/images/index_menu_icon/work_report_common.svg b/static/images/index_menu_icon/work_report_common.svg new file mode 100644 index 0000000..54d7e39 --- /dev/null +++ b/static/images/index_menu_icon/work_report_common.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/static/images/index_menu_icon/work_report_u03u05.svg b/static/images/index_menu_icon/work_report_u03u05.svg new file mode 100644 index 0000000..16dd930 --- /dev/null +++ b/static/images/index_menu_icon/work_report_u03u05.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/static/images/index_menu_icon/work_report_u16u17.svg b/static/images/index_menu_icon/work_report_u16u17.svg new file mode 100644 index 0000000..8503270 --- /dev/null +++ b/static/images/index_menu_icon/work_report_u16u17.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/utils/request.js b/utils/request.js index 7286120..ecd85bc 100644 --- a/utils/request.js +++ b/utils/request.js @@ -46,6 +46,11 @@ const request = config => { // console.log('response',response); let [error, res] = response if (error) { + if(error.errMsg === "request:fail abort statusCode:-1 timeout"){ + toast('接口连接超时,请检查IP地址') + reject(error) + return + } toast('后端接口连接异常') reject(error) return