From 7dd2e7918b00a857ca8a3634e24b2f6dd7446d1b Mon Sep 17 00:00:00 2001 From: zhang <zc857179121@qq.com> Date: 星期二, 24 六月 2025 10:29:33 +0800 Subject: [PATCH] Merge branch 'xgmFlwms' of http://47.97.1.152:5880/r/wms_app into xgmFlwms --- pages/basics/combPro.vue | 98 +++++++++++++++++++++++++++++++++++-------------- 1 files changed, 70 insertions(+), 28 deletions(-) diff --git a/pages/basics/combPro.vue b/pages/basics/combPro.vue index b74495a..190a9c7 100644 --- a/pages/basics/combPro.vue +++ b/pages/basics/combPro.vue @@ -42,7 +42,7 @@ <!-- <button class="uni-button" size="mini" type="warn" @click="remove(index,item)">鍒犻櫎</button> --> </uni-td> <uni-td align="center">{{item.size}}</uni-td> - <uni-td align="center">{{item.matNo}}</uni-td> + <uni-td align="center">{{item.matnr}}</uni-td> <uni-td align="center">{{item.matName}}</uni-td> <uni-td align="center">{{item.seqNo}}</uni-td> <uni-td align="center">{{item.itemBatch}}</uni-td> @@ -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 @@ -260,17 +264,21 @@ }, addTableData(data){ this.matData=[]; - for(var i=0;i<data.length;i++){ - var toPush = true; - for(var j=0;j<this.matData.length;j++){ - if(data[i].matNo ===this.matData[j].matNo && data[i].itemBatch === this.matData[j].itemBatch && data[i].specs === this.matData[j].specs){ - this.matData[j].count = Number(this.matData[j].count) + Number(data[i].count); - toPush = false; - } - } - if(toPush) { - this.matData.push(data[i]); - } + // for(var i=0;i<data.length;i++){ + // var toPush = true; + // for(var j=0;j<this.matData.length;j++){ + // if(data[i].matnr ===this.matData[j].matnr && data[i].itemBatch === this.matData[j].itemBatch && data[i].specs === this.matData[j].specs){ + // this.matData[j].count = Number(this.matData[j].count) + Number(data[i].count); + // toPush = false; + // } + // } + // if(toPush) { + // // data[i].count = 0 + // this.matData.push(data[i]); + // } + // } + for (let k of data) { + this.matData.push(k); } }, @@ -314,11 +322,11 @@ that.messageText = '鎵樼洏鐮佸繀椤讳负8浣�' return; } - if(that.couChange){ - that.messageToggle('error') - that.messageText = '璇峰厛纭鍏ュ簱鏁伴噺' - return; - } + // if(that.couChange){ + // that.messageToggle('error') + // that.messageText = '璇峰厛纭鍏ュ簱鏁伴噺' + // return; + // } for (var i = 0; i < that.matData.length; i++){ if (that.matData[i].count === 0) { that.messageToggle('error') @@ -327,6 +335,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 = '缁勬墭鎴愬姛' + that.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) { @@ -350,7 +392,7 @@ that.couChange=true that.messageToggle('success') that.messageText = '缁勬墭鎴愬姛' - this.getFocus('firstFocus') + that.getFocus('firstFocus') } else if(res.data.code === 403){ uni.navigateBack({ delta: 1 @@ -389,7 +431,7 @@ that.couChange=true that.messageToggle('success') that.messageText = '缁勬墭鎴愬姛' - this.getFocus('firstFocus') + that.getFocus('firstFocus') } else if(res.data.code === 403){ uni.navigateBack({ delta: 1 @@ -425,7 +467,7 @@ that.couChange=true that.messageToggle('success') that.messageText = '缁勬墭鎴愬姛' - this.getFocus('firstFocus') + that.getFocus('firstFocus') } else if(res.data.code === 403){ uni.navigateBack({ delta: 1 -- Gitblit v1.9.1