From 8e852298cee281cfa3b2312f48b4840bbcd5a02d Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期一, 29 七月 2024 14:52:22 +0800 Subject: [PATCH] # --- pages/basics/combPro.vue | 55 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 47 insertions(+), 8 deletions(-) diff --git a/pages/basics/combPro.vue b/pages/basics/combPro.vue index 8156846..4cd3f49 100644 --- a/pages/basics/combPro.vue +++ b/pages/basics/combPro.vue @@ -98,8 +98,8 @@ minCount:0, maxCount:1, rowNum:'', - value:'', - couChange:true, + value:0, + couChange:false, baseIP:'', basePORT:'', selectArr : [], @@ -190,9 +190,11 @@ if(res.data.data != null){ that.addTableData(res.data.data) }else if(res.data.code === 403){ - uni.navigateBack({ - delta: 1 - }) + setTimeout(() => { + uni.reLaunch({ + url: '../login/login' + }); + }, 1000); }else { that.messageToggle('error') that.messageText = res.data.msg @@ -246,9 +248,11 @@ if(res.data.data != null){ that.addTableData(res.data.data) }else if(res.data.code === 403){ - uni.navigateBack({ - delta: 1 - }) + setTimeout(() => { + uni.reLaunch({ + url: '../login/login' + }); + }, 1000); }else { that.messageToggle('error') that.messageText = res.data.msg @@ -269,6 +273,7 @@ } } if(toPush) { + // data[i].count = 0 this.matData.push(data[i]); } } @@ -327,6 +332,40 @@ } } + for (let item of that.matData) { + item['anfme'] = item.count + } + uni.request({ + url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + "/mobile/comb/auth", + header: {'token':uni.getStorageSync('token')}, + data:{ + barcode:barcode, + combMats:that.matData, + billNo: billNo, + }, + method:'POST', + success(res) { + if(res.data.code === 200){ + that.reset() + that.matData = [] + that.couChange=true + that.messageToggle('success') + that.messageText = '缁勬墭鎴愬姛' + this.getFocus('firstFocus') + } else if(res.data.code === 403){ + setTimeout(() => { + uni.reLaunch({ + url: '../login/login' + }); + }, 1000); + } else { + that.messageToggle('error') + that.messageText = res.data.msg + } + } + }) + return + // 涓�鏈熺殑濡備笅 for (var i = 0; i < that.matData.length; i++) { var sad = that.matData[i].qty - that.value if (sad <= 5 && sad > 0) { -- Gitblit v1.9.1