| | |
| | | <view class="form-item"> |
| | | <view class="form-item-desc"><text>数量</text></view> |
| | | <view class="form-item-content"> |
| | | <uni-number-box :value="mat.anfme" :max="99999999" :step='1' color="#747474" @change="changeValue" /> |
| | | <uni-number-box :value="mat.anfme" :max="max" :step='1' color="#747474" @change="changeValue" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | }, |
| | | baseIP:'', |
| | | basePORT:'', |
| | | max: 99999999 |
| | | } |
| | | }, |
| | | onLoad(option) { |
| | |
| | | // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据 |
| | | eventChannel.on('mat', function(data) { |
| | | that.mat = data.data |
| | | that.mat.anfme = 0 |
| | | console.log(data.data); |
| | | if (data.data.maxNum) { |
| | | that.mat.anfme = data.data.maxNum |
| | | } else { |
| | | that.mat.anfme = 0 |
| | | } |
| | | |
| | | }) |
| | | |
| | | |
| | |
| | | <view class="item"> |
| | | <view class="code-decs">bom号:</view> |
| | | <input type="text" placeholder=" 扫码 / 输入" v-model="bomCode" :focus="bomCodeFocus" |
| | | @input="bomInput()"> |
| | | @confirm="bomInput()"> |
| | | </view> |
| | | <view class="item"> |
| | | <view class="code-decs">托盘码:</view> |
| | |
| | | <view class="popup-item"> |
| | | <view class="popup-item-left">数量:</view> |
| | | <view class="popup-item-right" style="border: none;justify-content: center;"> |
| | | <uni-number-box :value="count" :step='0.01' :max="9999999" color="#747474" @change="changeValue" /> |
| | | <uni-number-box :value="count" :step='1' :max="maxAn" color="#747474" @change="changeValue" /> |
| | | </view> |
| | | </view> |
| | | <view class="btn"> |
| | |
| | | messageText: '', |
| | | title: '', |
| | | content: '', |
| | | barcodeFocus: true, |
| | | barcodeFocus: false, |
| | | matFocus: false, |
| | | matData: '', |
| | | removeNum: 0, |
| | | bomCode: '', |
| | | bomCodeFocus: false |
| | | bomCodeFocus: true, |
| | | maxAn: 0 |
| | | } |
| | | }, |
| | | onLoad() { |
| | |
| | | this.$refs.message.open() |
| | | }, |
| | | bomInput() { |
| | | |
| | | setTimeout(() => { |
| | | this.barcodeFocuss() |
| | | }, 200) |
| | | }, |
| | | bomFocuss() { |
| | | let that = this; |
| | | that.bomCodeFocus = false; |
| | | setTimeout(() => { |
| | | that.bomCode = ''; |
| | | that.bomCodeFocus = true; |
| | | }, 100); |
| | | }, |
| | | // barcode input 事件 |
| | | barcodeInput() { |
| | |
| | | checkBom() { |
| | | let _this = this |
| | | uni.request({ |
| | | url: that.baseUrl + '/mobile/comb/checkBom', |
| | | url: _this.baseUrl + '/mobile/comb/checkBom', |
| | | data: JSON.stringify({ |
| | | bomCode: that.bomCode, |
| | | matnr: that.matnr |
| | | bomCode: _this.bomCode, |
| | | matnr: _this.matnr |
| | | }), |
| | | method: 'POST', |
| | | header: { 'token': uni.getStorageSync('token') }, |
| | | success(res) { |
| | | console.log(res); |
| | | res = res.data |
| | | if (res.code === 200) { |
| | | if (res.data) { |
| | | _this.maxAnfme = res.data.zpalletAnfme |
| | | _this.findMat() |
| | | } else { |
| | | _this.findMat() |
| | | } |
| | | } else if (res.code == 403) { |
| | | uni.showToast({ |
| | | title: res.msg, |
| | | icon: "none", |
| | | position: 'top' |
| | | }) |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../login/login' |
| | | }); |
| | | }, 1000); |
| | | } else { |
| | | _this.matnr = '' |
| | | uni.showToast({ |
| | | title: res.msg, |
| | | icon: "none", |
| | | position: 'top' |
| | | }) |
| | | } |
| | | |
| | | } |
| | | }) |
| | | }, |
| | |
| | | that.matData = result.data |
| | | that.matnr = '' |
| | | that.matData['batch'] = '' |
| | | if (that.maxAnfme) { |
| | | that.matData['maxNum'] = that.maxAnfme |
| | | } |
| | | uni.navigateTo({ |
| | | url: "../mat/matSelected", |
| | | // 通过eventChannel向被打开页面传送数据 |
| | |
| | | |
| | | } else { |
| | | // 相同物料相同批号 数量累加 |
| | | this.dataList[i].anfme += mat.anfme |
| | | |
| | | if (this.maxAnfme) { |
| | | this.dataList[i].anfme = this.maxAnfme |
| | | } else { |
| | | this.dataList[i].anfme += mat.anfme |
| | | } |
| | | this.$forceUpdate() // 强制刷新 |
| | | add = false |
| | | } |
| | | } |
| | | } |
| | | if (add) { |
| | | if (this.maxAnfme) { |
| | | mat['maxAnfme'] = this.maxAnfme |
| | | mat.anfme = this.maxAnfme |
| | | } |
| | | this.dataList.unshift(mat) |
| | | } |
| | | this.$forceUpdate() // 强制刷新 |
| | | this.maxAnfme = '' |
| | | }, |
| | | // 修改批号 |
| | | revise(item, i) { |
| | |
| | | this.count = this.dataList[i].anfme |
| | | this.batch = this.dataList[i].batch |
| | | this.weight = this.dataList[i].weight |
| | | this.maxAn = this.dataList[i].maxNum |
| | | this.rowNum = i |
| | | this.eject() |
| | | }, |
| | |
| | | // 确认重置 |
| | | resetConfirm() { |
| | | this.dataList = [] |
| | | this.barcode = '' |
| | | this.bomCode = '' |
| | | this.messageText = "重置完成" |
| | | this.messageToggle('success') |
| | | this.bomFocuss() |
| | | }, |
| | | // 取消重置 |
| | | resetClose() { |
| | |
| | | resst() { |
| | | this.dataList = [] |
| | | this.barcode = '' |
| | | this.barcodeFocuss() |
| | | this.bomCode = '' |
| | | this.bomFocuss() |
| | | }, |
| | | } |
| | | } |