| | |
| | | <view class="square-content"> |
| | | <view class="content-input"> |
| | | <input v-model="barcode" type="text" placeholder="扫码 / 输入" maxlength="8" |
| | | @input="findBarcode()" :focus="barcodeFocus" @focus="focuss"> |
| | | @input="findBarcode()" :focus="barcodeFocus" > |
| | | <!-- @focus="focuss" --> |
| | | <uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons> |
| | | </view> |
| | | </view> |
| | |
| | | </view> |
| | | <view class="square-content"> |
| | | <view class="content-combox"> |
| | | <uni-combox emptyTips="暂无数据" :candidates="staNoList" v-model="staNo" placeholder="站台号"></uni-combox> |
| | | <uni-combox emptyTips="暂无数据" :candidates="siteList" v-model="desc" placeholder="站台号" |
| | | @input="choseStaNo"></uni-combox> |
| | | </view> |
| | | <view class="content-input-combox"> |
| | | <input type="text" v-model="matnr" placeholder="扫码 / 输入" @input="findMat()" |
| | | :focus="focus" @focus="focuss"> |
| | | :focus="focus" > |
| | | <!-- @focus="focuss" --> |
| | | <uni-icons type="closeempty" size="20" color="#dadada" @click="removeMatnr()"></uni-icons> |
| | | </view> |
| | | </view> |
| | |
| | | <checkbox-group @change="checkbox"> |
| | | <view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" > |
| | | <view class="data-list-left"> |
| | | <view class="matnr">{{item.barcode}}</view> |
| | | <view class="matnr">{{item.matnr}}</view> |
| | | </view> |
| | | <view class="data-list-right"> |
| | | <uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons> |
| | |
| | | searchBox: 'hide', |
| | | pick:'hide', |
| | | matnr:'', |
| | | matList:[{barcode:'92992929292'}], |
| | | matList:[], |
| | | result: '', |
| | | siteList:[], |
| | | desc:'', |
| | | staNoList:[], |
| | | staNo:'', |
| | | satNo:'', |
| | | } |
| | | }, |
| | | mounted(){ |
| | |
| | | this.getOutBound(); |
| | | }, |
| | | methods: { |
| | | choseStaNo() { |
| | | for (var i = 0;i < this.staNoList.length; i++) { |
| | | if (this.desc == this.staNoList[i].desc) { |
| | | this.staNo = this.staNoList[i].siteId |
| | | } |
| | | } |
| | | }, |
| | | focuss() { |
| | | uni.hideKeyboard() |
| | | }, |
| | |
| | | this.matList = [] |
| | | this.barcode = '' |
| | | this.matnr = '' |
| | | this.desc = '' |
| | | uni.vibrateShort(); |
| | | }, |
| | | removeBarcode() { |
| | |
| | | comb() { |
| | | uni.vibrateShort(); |
| | | let that = this; |
| | | if (that.barcode === '') { |
| | | uni.showToast({title: '请扫描托盘条码', icon: "none", position: 'top'}); |
| | | return; |
| | | } |
| | | if (that.matList.length === 0) { |
| | | uni.showToast({title: '请添加商品列表', icon: "none", position: 'top'}); |
| | | return; |
| | | } |
| | | // if (that.barcode === '') { |
| | | // uni.showToast({title: '请扫描托盘条码', icon: "none", position: 'top'}); |
| | | // return; |
| | | // } |
| | | // if (that.matList.length === 0) { |
| | | // uni.showToast({title: '请添加商品列表', icon: "none", position: 'top'}); |
| | | // return; |
| | | // } |
| | | uni.showLoading(); |
| | | uni.request({ |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/comb/auth', |
| | | data: JSON.stringify({ |
| | | barcode: that.barcode, |
| | | combMats: that.matList |
| | | }), |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/pakout/confirm/auth', |
| | | data: that.matList, |
| | | method: 'POST', |
| | | header: { |
| | | 'token':uni.getStorageSync('token') |
| | |
| | | 'token':uni.getStorageSync('token') |
| | | }, |
| | | success(result) { |
| | | console.log(result) |
| | | var res = result.data; |
| | | if(res.data) { |
| | | let add = true; |
| | | for(let i = 0;i<that.matList.length;i++) { |
| | | for (let j = 0;j < that.res.data.length; j++) { |
| | | if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data[j])) { |
| | | res.data.splice(i,1) |
| | | // break; |
| | | } |
| | | } |
| | | // add = false; |
| | | } |
| | | that.matList = that.matList.concat(res.data) |
| | | // if (add) { |
| | | // that.matList = that.matList.concat(res.data) |
| | | // } |
| | | } |
| | | |
| | | // that.addMatList(res.data) |
| | | // that.matList = res.data |
| | | |
| | | } |
| | | }); |
| | | }, |
| | | addMatList(mat) { |
| | | let barcode = this.mat.barcode |
| | | console.log(mat) |
| | | if (this.matList.length == 0){ |
| | | |
| | | // this.matList.push(mat[0]) |
| | | // this.matList.prototype.push.apply(mat) |
| | | } else { |
| | | |
| | | let toUnshift = true |
| | | for (var i = 0; i < this.matList.length; i++) { |
| | | if (barcode === this.matList[i].barcode) { |
| | | this.messageToggle('warn') |
| | | this.messageText = barcode + '已经扫描,请勿重复扫描' |
| | | let matnr = this.matList[i].matnr |
| | | if (matnr == this.matList[i].matnr) { |
| | | // this.messageToggle('warn') |
| | | // this.messageText = matnr + '已经扫描,请勿重复扫描' |
| | | toUnshift = false |
| | | } |
| | | } |
| | | if (toUnshift) { |
| | | this.matList.unshift(mat) |
| | | this.matList.unshift(mat[0]) |
| | | } |
| | | |
| | | } |
| | | console.log(this.matList) |
| | | }, |
| | | findBarcode() { |
| | | let that = this |
| | |
| | | barcode:that.barcode |
| | | }, |
| | | header: { |
| | | 'token':uni.getStorageSync('token') |
| | | 'token':uni.getStorageSync('token'), |
| | | |
| | | }, |
| | | success(result) { |
| | | console.log(result) |
| | | var res = result.data; |
| | | if(res.data) { |
| | | let add = true; |
| | | for(let i = 0;i<that.matList.length;i++) { |
| | | for (let j = 0;j < that.res.data.length; j++) { |
| | | if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data[j])) { |
| | | res.data.splice(i,1) |
| | | // break; |
| | | } |
| | | } |
| | | // if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data[0])) { |
| | | // add = false; |
| | | // break; |
| | | // } |
| | | } |
| | | that.matList = that.matList.concat(res.data) |
| | | // if (add) { |
| | | // that.matList = that.matList.concat(res.data) |
| | | // } |
| | | } |
| | | |
| | | } |
| | | }); |
| | |
| | | getOutBound() { // 获取出库口 |
| | | let that = this |
| | | uni.request({ |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/available/take/check/site', |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/available/take/site', |
| | | method: 'POST', |
| | | header: { |
| | | 'token':uni.getStorageSync('token') |
| | |
| | | success(result) { |
| | | var res = result.data |
| | | if (res.code === 200) { |
| | | for (var i = 0; i < res.data.length; i++){ |
| | | that.siteList.push(res.data[i].desc) |
| | | } |
| | | that.staNoList = res.data |
| | | } else if (res.code == 403) { |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}) |
| | |
| | | |
| | | }, // getCheckDetl |
| | | change(e) { |
| | | console.log('当前模式:' + e.type + ',状态:' + e.show); |
| | | }, |
| | | toggle(type) { |
| | | this.type = type |