| | |
| | | <checkbox :value="item.id+''" :checked="item.checked" style="display: block;" /> |
| | | </label> |
| | | <view class="data-list-left"> |
| | | <view class="matnr"><text style="width: 700rpx;">编码:{{item.matnr}}</text></view> |
| | | <view><text style="width: 700rpx;">品名:{{item.maktx}}</text></view> |
| | | <view><text style="width: 700rpx;">规格:{{item.specs}}</text></view> |
| | | <view> |
| | | <text style="width: 700rpx;">数量:{{item.anfme}}</text> |
| | | </view> |
| | | <view class="matnr"><text style="width: 500rpx;">编码:{{item.matnr}}</text> |
| | | <text style="margin-left: 100rpx;">名称:{{item.maktx}}</text></view> |
| | | <view><text style="width: 500rpx;">PO:{{item.standby1}}</text> |
| | | <text style="margin-left: 100rpx;">SKU:{{item.standby3}}</text></view> |
| | | <view><text style="width: 500rpx;">UPC:{{item.standby2}}</text></view> |
| | | <view><text style="width: 500rpx;">采购单:{{item.boxType3}}</text> |
| | | <text style="margin-left: 100rpx;">数量:{{item.anfme}}</text></view> |
| | | </view> |
| | | <view class="data-list-right"> |
| | | <label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons></label> |
| | |
| | | <text @click="reChecked()">反选</text> |
| | | </label> --> |
| | | |
| | | <label class="label-btn" style="width: 150rpx;"> |
| | | <label class="label-btn flex justify-center align-center"> |
| | | <button class="cu-btn" @click="resst()">重置</button> |
| | | </label> |
| | | <label class="label-btn"> |
| | | <label class="label-btn flex justify-center align-center"> |
| | | <button class="cu-btn bg-blue " @click="comb()">组托</button> |
| | | </label> |
| | | </view> |
| | |
| | | comb() { |
| | | uni.vibrateShort(); |
| | | let that = this; |
| | | |
| | | if (that.barcode === '') { |
| | | uni.showToast({title: '请扫描托盘条码', icon: "none", position: 'top'}); |
| | | uni.showToast({ title: '请扫描托盘条码', icon: "none", position: 'top' }); |
| | | return; |
| | | } |
| | | if (that.barcode.length !== 8) { |
| | | uni.showToast({title: '托盘码必须为8位', icon: "none", position: 'top'}); |
| | | if (that.barcode.length !== 6) { |
| | | uni.showToast({ title: '托盘码必须为6位', icon: "none", position: 'top' }); |
| | | return; |
| | | } |
| | | if (that.matList.length === 0) { |
| | | uni.showToast({title: '请添加商品列表', icon: "none", position: 'top'}); |
| | | uni.showToast({ title: '请添加商品列表', icon: "none", position: 'top' }); |
| | | return; |
| | | } |
| | | for (var i = 0; i < that.matList.length; i++) { |
| | | if (that.matList[i].anfme === 0) { |
| | | uni.showToast({title: '商品组托数量为0不能组托', icon: "none", position: 'top'}); |
| | | return; |
| | | } |
| | | |
| | | // 过滤出数量大于0的商品 |
| | | const validMats = that.matList.filter(item => item.anfme > 0); |
| | | |
| | | if (validMats.length === 0) { |
| | | uni.showToast({ title: '所有商品组托数量为0,无法组托', icon: "none", position: 'top' }); |
| | | return; |
| | | } |
| | | |
| | | // 删除数量为0的商品 |
| | | that.matList = validMats; |
| | | |
| | | uni.showLoading(); |
| | | |
| | | uni.request({ |
| | | url: that.commonUrl + '/mobile/comb/auth', |
| | | data: JSON.stringify({ |
| | | url: that.commonUrl + '/mobile/comb/auth', |
| | | data: JSON.stringify({ |
| | | billNo: that.orderNo, |
| | | orderNo: that.orderNo, |
| | | barcode: that.barcode, |
| | | combMats: that.matList |
| | | combMats: validMats |
| | | }), |
| | | method: 'POST', |
| | | header: { |
| | | 'token':uni.getStorageSync('token'), |
| | | }, |
| | | header: { |
| | | 'token': uni.getStorageSync('token'), |
| | | }, |
| | | success(result) { |
| | | uni.showLoading(); |
| | | var res = result.data |
| | | var res = result.data; |
| | | if (res.code === 200) { |
| | | uni.showToast({ |
| | | title: res.msg, |
| | | position: 'top', |
| | | duration: 1000 |
| | | }); |
| | | that.resst() |
| | | that.resst(); |
| | | } else if (res.code == 403) { |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}) |
| | | uni.showToast({ title: res.msg, icon: "none", position: 'top' }); |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../login/login' |
| | | }); |
| | | uni.reLaunch({ url: '../login/login' }); |
| | | }, 1000); |
| | | } else { |
| | | uni.showToast({title: res.msg, icon: "none",position: 'top'}) |
| | | uni.showToast({ title: res.msg, icon: "none", position: 'top' }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | findOrder() { |
| | | let that = this |
| | | uni.request({ |
| | |
| | | this.$refs.goodsSearch.open(type) |
| | | }, |
| | | // 列表选择 |
| | | checkbox: function (e) { |
| | | var items = this.matList, |
| | | values = e.detail.value; |
| | | for (var i = 0, lenI = items.length; i < lenI; ++i) { |
| | | const item = items[i] |
| | | item.id = item.id + '' |
| | | if(values.indexOf(item.id) >= 0){ |
| | | this.$set(item,'checked',true) |
| | | }else{ |
| | | this.$set(item,'checked',false) |
| | | } |
| | | } |
| | | if (values.length == items.length) { |
| | | this.check = true |
| | | this.checkText = "取消全选" |
| | | checkbox(e) { |
| | | const values = e.detail.value; |
| | | this.matList.forEach(item => { |
| | | // 确保 item.id 是字符串 |
| | | const itemId = item.id + ''; |
| | | item.checked = values.includes(itemId); |
| | | }); |
| | | |
| | | if (values.length === this.matList.length) { |
| | | this.check = true; |
| | | this.checkText = "取消全选"; |
| | | } else { |
| | | this.check = false |
| | | this.checkText = "全选" |
| | | this.check = false; |
| | | this.checkText = "全选"; |
| | | } |
| | | |
| | | uni.vibrateShort(); |
| | | }, |
| | | |
| | | // 列表反选 |
| | | reChecked() { |
| | | if (this.matList.length == 0) { |