| | |
| | | // this.getMatListLen() |
| | | },1000) |
| | | }, |
| | | onLoad() { |
| | | // #ifdef APP |
| | | setInterval(()=>{ |
| | | uni.hideKeyboard() |
| | | },20) |
| | | // #endif |
| | | }, |
| | | mounted(){ |
| | | const UIP = uni.getStorageSync('UIP'); |
| | | this.baseIP = UIP; |
| | |
| | | |
| | | }, |
| | | methods: { |
| | | huanghang() { |
| | | this.matnr = '' |
| | | this.focus = false; |
| | | this.$nextTick(function() { |
| | | this.focus = true; |
| | | }); |
| | | |
| | | }, |
| | | messageToggle(type) { |
| | | this.msgType = type |
| | | this.messageText = `这是一条${type}消息提示` |
| | |
| | | this.$nextTick(function() { |
| | | this.barcodeFocus = true; |
| | | }); |
| | | }, |
| | | foucss() { |
| | | // #ifdef APP |
| | | let that = this; |
| | | that.focus = false; |
| | | setTimeout(()=>{ |
| | | that.matnr = ''; |
| | | that.focus = true; |
| | | }, 100); |
| | | // #endif |
| | | }, |
| | | removeMatnr() { |
| | | this.matnr = '' |
| | |
| | | 'token':uni.getStorageSync('token'), |
| | | }, |
| | | success(result) { |
| | | console.log(result) |
| | | let res = result.data; |
| | | if (res.code === 200) { |
| | | if (res.data.ioType === 101) { |
| | | that.matList = res.data.list.concat(that.matList) |
| | | that.listLen = that.matList.length; |
| | | that.foucss(); |
| | | return; |
| | | } |
| | | if (res.data.ioType === 103 || res.data.ioType === 104 || res.data.ioType === 107) { |
| | | that.matCount = res.data.list.length |
| | | that.wrkNo = res.data.list[0].wrkNo |
| | | that.foucss(); |
| | | return; |
| | | } |
| | | // if (res.data) { |
| | | // that.matCount = res.data.length |
| | | // } |
| | | } else if (res.code === 403) { |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}) |
| | | setTimeout(() => { |
| | |
| | | 'token':uni.getStorageSync('token') |
| | | }, |
| | | success(result) { |
| | | console.log(result) |
| | | var res = result.data; |
| | | if(res.code === 200 ) { |
| | | if(res.data) { |
| | | if (that.matList.length == 0) { |
| | | that.matList.push(res.data) |
| | | that.listLen = that.matList.length; |
| | | that.huanghang(); |
| | | that.foucss(); |
| | | return; |
| | | } |
| | | for(let i = 0;i<that.matList.length;i++) { |
| | |
| | | if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data)) { |
| | | that.messageToggle('warn'); |
| | | that.messageText = '该商品已添加'; |
| | | that.huanghang(); |
| | | that.foucss(); |
| | | return; |
| | | } else { |
| | | that.matList.unshift(res.data); |
| | | that.listLen = that.matList.length; |
| | | that.huanghang(); |
| | | that.foucss(); |
| | | return; |
| | | } |
| | | } else { |
| | | that.messageToggle('warn'); |
| | | that.messageText = '已出全部商品,请确认出库'; |
| | | that.huanghang(); |
| | | that.foucss(); |
| | | return; |
| | | } |
| | | } |