| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="square-3"> |
| | | <view class="square-2"> |
| | | <view class="square-title"> |
| | | <view class="title-sign"><view class="sign"></view></view> |
| | | <view class="title-text"><text>货品条码</text></view> |
| | | </view> |
| | | <view class="square-content"> |
| | | <text>站台:</text> |
| | | <view class="content-combox"> |
| | | <uni-combox emptyTips="暂无数据" :candidates="siteList" v-model="desc" placeholder="站台号" |
| | | @input="choseStaNo" disabled='true'></uni-combox> |
| | | </view> |
| | | </view> |
| | | <view class="square-content"> |
| | | <text>货品条码:</text> |
| | | <view class="content-input-combox"> |
| | | <input type="text" v-model="matnr" placeholder="扫码 / 输入" @input="findMat()":focus="focus" |
| | | <view class="content-input-combox" style="width: 94%;"> |
| | | <input style="width: 90%;" type="text" v-model="matnr" placeholder="扫码 / 输入" @input="findMat()":focus="focus" |
| | | @focus="focuss"> |
| | | <!-- @focus="focuss" --> |
| | | <uni-icons type="closeempty" size="20" color="#dadada" @click="removeMatnr()"></uni-icons> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="square-none" v-show="matList.length === 0"> |
| | | <view class="v-show">暂无更多数据...</view> |
| | | <view class="v-show">请扫码选取 {{matCount}} 件商品</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">No:{{listLen-index}}</view> |
| | | <view class="matnr">{{item.matnr}}-{{item.batch}}</view> |
| | | <view class="matnr" :style="item.color">No:{{listLen-index}}</view> |
| | | <view class="matnr" :style="item.color">{{item.matnr}}-{{item.batch}}</view> |
| | | </view> |
| | | <view class="data-list-right"> |
| | | <uni-icons type="trash" size="20" color="#a5a5a5" @click="remove(item,index)"></uni-icons> |
| | |
| | | <view> |
| | | <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> |
| | |
| | | searchBox: 'hide', |
| | | pick:'hide', |
| | | matnr:'', |
| | | matList:[{matnr:'1101842-10000',batch:'22047515999'}], |
| | | // matList:[{matnr:'1101842-10000',batch:'22047515999',color:{color:'red'}}], |
| | | matList:[], |
| | | result: '', |
| | | siteList:[], |
| | | desc:'', |
| | | staNoList:[], |
| | | satNo:'', |
| | | listLen:0, |
| | | msgType: 'success', |
| | | messageText: '这是一条成功提示', |
| | | fontColor:{color:'red'}, |
| | | matCount:'0' |
| | | } |
| | | }, |
| | | onReady() { |
| | | setInterval(function(){ |
| | | // console.log(this.matList) |
| | | // this.getMatListLen() |
| | | },1000) |
| | | }, |
| | | mounted(){ |
| | | const UIP = uni.getStorageSync('UIP'); |
| | | this.baseIP = UIP; |
| | | const UPORT = uni.getStorageSync('UPORT'); |
| | | this.basePORT = UPORT |
| | | this.getOutBound(); |
| | | |
| | | }, |
| | | methods: { |
| | | messageToggle(type) { |
| | |
| | | this.staNo = this.staNoList[i].siteId |
| | | } |
| | | } |
| | | }, |
| | | getMatListLen() { |
| | | // this.listLen = this.matList.length; |
| | | }, |
| | | focuss() { |
| | | // uni.hideKeyboard() |
| | |
| | | }); |
| | | }, |
| | | remove(item,index) { |
| | | this.matList.splice(index,1) |
| | | this.matList.splice(index,1); |
| | | this.listLen = this.matList.length |
| | | this.messageToggle('success') |
| | | this.messageText = '删除成功' |
| | | uni.vibrateShort(); |
| | | }, |
| | | |
| | | 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 = '' |
| | | }, |
| | | findBarcode() { |
| | | let that = this |
| | | uni.request({ |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/pakout/query/auth/v2', |
| | | data: { |
| | | barcode:that.barcode |
| | | }, |
| | | header: { |
| | | 'token':uni.getStorageSync('token'), |
| | | }, |
| | | success(result) { |
| | | var res = result.data; |
| | | if (res.code === 200) { |
| | | if (res.data) { |
| | | that.matCount = res.data.length |
| | | } |
| | | } else if (res.code === 403) { |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}) |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../login/login' |
| | | }); |
| | | }, 1000); |
| | | } else { |
| | | uni.showToast({title: res.msg, icon: "none",position: 'top'}) |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | | }, |
| | | findMat() { |
| | | let that = this |
| | | uni.request({ |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/pakout/query/auth/v2', |
| | | data: { |
| | | staNo:that.staNo, |
| | | matnr:that.matnr |
| | | }, |
| | | header: { |
| | | 'token':uni.getStorageSync('token') |
| | | }, |
| | | success(result) { |
| | | var res = result.data; |
| | | if(res.code === 200 ) { |
| | | if(res.data) { |
| | | for(let i = 0;i<that.matList.length;i++) { |
| | | for (let j = 0;j < res.data.length; j++) { |
| | | if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data[j])) { |
| | | res.data.splice(j,1) |
| | | } |
| | | } |
| | | } |
| | | if (that.matList.length < that.matCount) { |
| | | that.matList = res.data.concat(that.matList) |
| | | that.listLen = that.matList.length; |
| | | that.focus = false; |
| | | that.$nextTick(function() { |
| | | that.focus = true; |
| | | }); |
| | | that.matnr = '' |
| | | } else { |
| | | that.messageToggle('warn') |
| | | that.messageText = '商品已全部添加' |
| | | } |
| | | |
| | | } |
| | | } else if (res.code == 403) { |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}) |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../login/login' |
| | | }); |
| | | }, 1000); |
| | | } else { |
| | | uni.showToast({title: res.msg, icon: "none",position: 'top'}) |
| | | } |
| | | |
| | | } |
| | | }); |
| | | }, |
| | | comb() { |
| | | uni.vibrateShort(); |
| | | let that = this; |
| | | uni.showLoading(); |
| | | if (that.matList.length < that.matCount) { |
| | | var len = that.matCount - that.matList.length |
| | | that.messageToggle('error') |
| | | that.messageText = '还剩' + len + '件未扫描' |
| | | return; |
| | | } |
| | | uni.request({ |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/pakout/confirm/auth', |
| | | data: that.matList, |
| | |
| | | } |
| | | }); |
| | | }, |
| | | 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 |
| | | uni.request({ |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/pakout/query/auth', |
| | | data: { |
| | | staNo:that.staNo, |
| | | matnr:that.matnr |
| | | }, |
| | | header: { |
| | | 'token':uni.getStorageSync('token') |
| | | }, |
| | | success(result) { |
| | | var res = result.data; |
| | | if(res.code === 200 ) { |
| | | if(res.data) { |
| | | for(let i = 0;i<that.matList.length;i++) { |
| | | for (let j = 0;j < res.data.length; j++) { |
| | | if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data[j])) { |
| | | res.data.splice(j,1) |
| | | } |
| | | } |
| | | } |
| | | that.matList = res.data.concat(that.matList) |
| | | that.listLen = that.matList.length; |
| | | that.focus = false; |
| | | that.$nextTick(function() { |
| | | that.focus = true; |
| | | }); |
| | | that.matnr = '' |
| | | } |
| | | } else if (res.code == 403) { |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}) |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../login/login' |
| | | }); |
| | | }, 1000); |
| | | } else { |
| | | uni.showToast({title: res.msg, icon: "none",position: 'top'}) |
| | | } |
| | | |
| | | } |
| | | }); |
| | | }, |
| | | addMatList(mat) { |
| | | 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++) { |
| | | 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[0]) |
| | | } |
| | | |
| | | } |
| | | console.log(this.matList) |
| | | }, |
| | | findBarcode() { |
| | | let that = this |
| | | uni.request({ |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/pakout/query/auth', |
| | | data: { |
| | | barcode:that.barcode |
| | | }, |
| | | header: { |
| | | 'token':uni.getStorageSync('token'), |
| | | |
| | | }, |
| | | success(result) { |
| | | var res = result.data; |
| | | console.log(res) |
| | | if(res.data) { |
| | | for(let i = 0;i<that.matList.length;i++) { |
| | | for (let j = 0;j < res.data.length; j++) { |
| | | if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data[j])) { |
| | | res.data.splice(j,1) |
| | | } |
| | | } |
| | | } |
| | | that.matList = res.data.concat(that.matList) |
| | | // that.matList = that.matList.concat(res.data) |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | | }, |
| | | getOutBound() { // 获取出库口 |
| | | let that = this |
| | | uni.request({ |
| | | 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'}) |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../login/login' |
| | | }); |
| | | }, 1000); |
| | | } else { |
| | | uni.showToast({title: res.msg, icon: "none",position: 'top'}) |
| | | } |
| | | }, |
| | | }); |
| | | }, // getOutBound |
| | | getCheckDetl() { // 获取出库口货物信息 |
| | | let that = this |
| | | |
| | |
| | | } |
| | | .data-list { |
| | | border-bottom: 1px solid #d8d8d8; |
| | | height: 90rpx; |
| | | height: 130rpx; |
| | | margin: 15rpx; |
| | | border-radius: 20rpx; |
| | | } |
| | |
| | | margin-top: 20rpx; |
| | | } |
| | | .data-list:last-child { |
| | | margin-bottom: 120rpx; |
| | | margin-bottom: 200rpx; |
| | | } |
| | | /* .data-list-left { |
| | | display: inline-block; |
| | |
| | | display: inline-block; |
| | | float: left; |
| | | margin-left: 4%; |
| | | height: 90rpx; |
| | | height: 130rpx; |
| | | color: #676767; |
| | | } |
| | | .matnr { |
| | |
| | | width: 100%; |
| | | font-size: 14px; |
| | | font-weight: 700; |
| | | padding-top: 8rpx; |
| | | padding-top: 15rpx; |
| | | /* height: 130rpx; |
| | | line-height: 130rpx; */ |
| | | } |
| | |
| | | display: inline-block; |
| | | float: right; |
| | | width: 100rpx; |
| | | height: 90rpx; |
| | | line-height: 90rpx; |
| | | height: 130rpx; |
| | | line-height: 130rpx; |
| | | } |
| | | </style> |