| | |
| | | <button class="cu-btn lg pakin-btn bg-blue" @click="comb()">组托</button> |
| | | </view> |
| | | </view> |
| | | <view> |
| | | <!-- 提示信息弹窗 --> |
| | | <uni-popup ref="message" type="message"> |
| | | <uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message> |
| | | </uni-popup> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | matnr:'', |
| | | matList:[], |
| | | result: '', |
| | | listLen:0 |
| | | listLen:0, |
| | | msgType: 'success', |
| | | messageText: '这是一条成功提示', |
| | | } |
| | | }, |
| | | mounted(){ |
| | |
| | | this.basePORT = UPORT |
| | | }, |
| | | methods: { |
| | | getListLength() { |
| | | messageToggle(type) { |
| | | this.msgType = type |
| | | this.messageText = `这是一条${type}消息提示` |
| | | this.$refs.message.open() |
| | | }, |
| | | getListLength() { // 下角标倒序 |
| | | this.listLen = this.matList.length |
| | | }, |
| | | focuss() { |
| | |
| | | }, |
| | | removeMatnr() { |
| | | this.matnr = '' |
| | | uni.vibrateShort(); |
| | | this.focus = false; |
| | | this.$nextTick(function() { |
| | | this.focus = true; |
| | | }); |
| | | uni.vibrateShort(); |
| | | }, |
| | | remove(item,index) { |
| | | this.matList.splice(index,1) |
| | | this.listLen = this.matList.length |
| | | this.messageToggle('success') |
| | | this.messageText = '删除成功' |
| | | uni.vibrateShort(); |
| | | }, |
| | | comb() { |
| | |
| | | mat['anfme'] = 1 |
| | | for(let i = 0;i < that.matList.length;i++) { |
| | | if(that.matList[i].batch == str[2]) { |
| | | that.messageToggle('warn'); |
| | | that.messageText = '重复扫描'; |
| | | add = false; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if(add) { |
| | | that.messageToggle('success'); |
| | | that.messageText = '检索成功'; |
| | | that.focus = false; |
| | | that.$nextTick(function() { |
| | | that.focus = true; |
| | | }); |
| | | that.listLen = that.matList.length; |
| | | uni.hideKeyboard(); |
| | | that.matList.unshift(res.data) |
| | | } |
| | | that.focus = false; |
| | | that.$nextTick(function() { |
| | | that.focus = true; |
| | | }); |
| | | uni.hideKeyboard(); |
| | | that.listLen = that.matList.length |
| | | } else if (res.code == 403) { |
| | | that.messageToggle('warn') |
| | | that.messageToggle('error') |
| | | that.messageText = res.msg |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | |
| | | }); |
| | | }, 1000); |
| | | } else { |
| | | that.messageToggle('warn') |
| | | that.messageToggle('error') |
| | | that.messageText = res.msg |
| | | // uni.showToast({title: res.msg, icon: "none",position: 'top'}) |
| | | } |