| | |
| | | <view class="square-none" v-show="matList.length === 0"> |
| | | <view class="v-show">暂无更多数据...</view> |
| | | </view> |
| | | <checkbox-group @change="checkbox"> |
| | | <checkbox-group > |
| | | <view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" > |
| | | <view class="data-list-left"> |
| | | <text>No:{{listLen-index}}</text> |
| | | <view class="matnr">No:{{listLen-index}}</view> |
| | | <view class="matnr">{{item.matnr}}-{{item.batch}}</view> |
| | | </view> |
| | | <view class="data-list-right"> |
| | |
| | | searchBox: 'hide', |
| | | pick:'hide', |
| | | matnr:'', |
| | | matList:[], |
| | | matList:[{matnr:'1101842-10000',batch:'22047515999'}], |
| | | result: '', |
| | | listLen:0, |
| | | msgType: 'success', |
| | |
| | | this.messageText = `这是一条${type}消息提示` |
| | | this.$refs.message.open() |
| | | }, |
| | | getListLength() { // 下角标倒序 |
| | | this.listLen = this.matList.length |
| | | }, |
| | | focuss() { |
| | | uni.hideKeyboard() |
| | | // setInterval(function(){ |
| | | // uni.hideKeyboard() |
| | | // },20) |
| | | // uni.hideKeyboard() |
| | | }, |
| | | resst() { |
| | | this.matList = [] |
| | |
| | | }); |
| | | }, |
| | | removeMatnr() { |
| | | this.matnr = '' |
| | | |
| | | this.focus = false; |
| | | this.$nextTick(function() { |
| | | this.focus = true; |
| | | }); |
| | | this.matnr = '' |
| | | uni.vibrateShort(); |
| | | }, |
| | | remove(item,index) { |
| | |
| | | position: 'bottom', |
| | | duration: 1000 |
| | | }); |
| | | that.barcode = ''; |
| | | that.matList = ''; |
| | | that.matList = []; |
| | | } else if (res.code == 403) { |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}) |
| | | setTimeout(() => { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | selectMat() { |
| | | let that = this |
| | | uni.vibrateShort(); |
| | | uni.showLoading(); |
| | | uni.navigateTo({ |
| | | url: "matSelect", |
| | | events: { |
| | | // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 |
| | | acceptDataFromOpenedPage: function(data) { |
| | | that.matnr = data.data |
| | | that.findMat(that.matnr) |
| | | }, |
| | | }, |
| | | success: function(res) { |
| | | // 通过eventChannel向被打开页面传送数据 |
| | | res.eventChannel.emit('acceptDataFromOpenerPage', {baseIP:that.baseIP, basePORT:that.basePORT }) |
| | | } |
| | | }); |
| | | that.matnr = '' |
| | | }, |
| | | |
| | | findMat() { |
| | | let that = this |
| | | let str = that.matnr.split('-') |
| | | that.matnr = str[0]+'-'+str[1] |
| | | uni.showLoading(); |
| | | uni.request({ |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mat/auth', |
| | | data: { |
| | |
| | | uni.vibrateShort(); |
| | | let res = result.data |
| | | if (res.code === 200 && res.data) { |
| | | that.matnr = '' |
| | | let add = true; |
| | | if(res.data) { |
| | | let mat = res.data; |
| | |
| | | if(that.matList[i].batch == str[2]) { |
| | | that.messageToggle('warn'); |
| | | that.messageText = '重复扫描'; |
| | | that.focus = false; |
| | | that.$nextTick(function() { |
| | | that.focus = true; |
| | | }); |
| | | add = false; |
| | | break; |
| | | } |
| | |
| | | that.$nextTick(function() { |
| | | that.focus = true; |
| | | }); |
| | | that.listLen = that.matList.length; |
| | | uni.hideKeyboard(); |
| | | // uni.hideKeyboard(); |
| | | that.matList.unshift(res.data) |
| | | } |
| | | that.matnr = '' |
| | | that.listLen = that.matList.length; |
| | | uni.hideLoading(); |
| | | } else if (res.code == 403) { |
| | | that.messageToggle('error') |
| | | that.messageText = res.msg |
| | |
| | | change(e) { |
| | | console.log('当前模式:' + e.type + ',状态:' + e.show); |
| | | }, |
| | | toggle(type) { |
| | | this.type = type |
| | | // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
| | | this.$refs.goodsSearch.open(type) |
| | | }, |
| | | checkbox: function (e) { |
| | | var items = this.data, |
| | | 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 = "取消全选" |
| | | } else { |
| | | this.check = false |
| | | this.checkText = "全选" |
| | | } |
| | | uni.vibrateShort(); |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | |
| | | |
| | | <style> |
| | | /* @import "../../colorui/main.css"; |
| | |
| | | display: inline-block; |
| | | float: left; |
| | | margin-left: 6%; |
| | | height: 90rpx; |
| | | height: 100rpx; |
| | | /* line-height: 100rpx; */ |
| | | color: #676767; |
| | | } |
| | | .matnr { |
| | | padding-top: 10rpx; |
| | | padding-top: 8rpx; |
| | | } |
| | | .data-list-right { |
| | | display: inline-block; |
| | | float: right; |
| | | height: 90rpx; |
| | | line-height: 90rpx; |
| | | height: 100rpx; |
| | | line-height: 100rpx; |
| | | margin-right: 10%; |
| | | } |
| | | </style> |