| | |
| | | <view> |
| | | <view class="code"> |
| | | <view class="item"> |
| | | <view class="code-decs">Bom号:</view> |
| | | <view style="flex: 1;"> |
| | | <input type="text" placeholder=" --" disabled="true" v-model="orderNo" :focus="orderNoFocus"> |
| | | </view> |
| | | <view style="height:100%;line-height:2;width:40rpx;margin-right: 20rpx;"> |
| | | <!-- <uni-icons type="clear" color="#c1c1c1" @click="clearOrderNo()"></uni-icons> --> |
| | | </view> |
| | | </view> |
| | | <view class="item"> |
| | | <view class="code-decs">托盘码:</view> |
| | | <input type="text" placeholder=" 扫码 / 输入" v-model="barcode" :focus="barcodeFocus" |
| | | @input="barcodeInput()"> |
| | | </view> |
| | | <view class="item"> |
| | | <view class="code-decs">物料码:</view> |
| | | <input type="text" placeholder=" 扫码 / 输入" v-model="matnr" :focus="matFocus" @input="checkBom()"> |
| | | <input type="text" placeholder=" 扫码 / 输入" v-model="matnr" :focus="matFocus" @input="findMat()"> |
| | | <view class="item-right"> |
| | | <button></button> |
| | | <text style="text-align: right;color: #409EFF;" @click="selectMat()">提取+</text> |
| | |
| | | <view class="left-item">{{item.specs}}</view> |
| | | </view> |
| | | <view class="list-left-item"> |
| | | <view class="desc">批号:</view> |
| | | <view class="desc" style="width: 38%;">批号:</view> |
| | | <view class="left-item"> |
| | | <uni-tag :text="item.batch" type="warning"></uni-tag> |
| | | </view> |
| | |
| | | </view> |
| | | </view> --> |
| | | <view class="list-left-item"> |
| | | <view class="left-item">数量:{{item.anfme}}</view> |
| | | </view> |
| | | <view class="list-left-item"> |
| | | <view class="desc">数量:</view> |
| | | <view class="left-item">{{item.anfme}}</view> |
| | | </view> |
| | | </view> |
| | | <view class="list-right"> |
| | |
| | | <!-- 底部操作按钮 --> |
| | | <view class="buttom"> |
| | | <button size="mini" @click="reset('warn')">重置</button> |
| | | <button size="mini" type="primary" @click="combConfirm('warn')">组托</button> |
| | | <button size="mini" type="primary" @click="combConfirm('warn')">并托</button> |
| | | </view> |
| | | <!-- 弹窗 --> |
| | | <!-- 修改数量 --> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="popup-item"> |
| | | <view class="popup-item-left">批号:</view> |
| | | <view class="popup-item-right"><input type="text" v-model="batch"></view> |
| | | <view class="popup-item-left" style="width: 20vw;">备注:</view> |
| | | <view class="popup-item-right" style="width: 46vw;"><input type="text" v-model="memo"></view> |
| | | </view> |
| | | <!-- <view class="popup-item"> |
| | | <view class="popup-item-left">重量:</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='1' :max="maxAn" color="#747474" @change="changeValue" /> |
| | | <uni-number-box :value="count" :step='0.01' :max="9999999" color="#747474" @change="changeValue" /> |
| | | </view> |
| | | </view> |
| | | <view class="btn"> |
| | |
| | | <uni-popup-message :type="msgType1" :message="messageText" :duration="2000"></uni-popup-message> |
| | | </uni-popup> |
| | | </view> |
| | | <!-- 确认组托 --> |
| | | <!-- 确认并托 --> |
| | | <view> |
| | | <uni-popup ref="combConfirm" type="dialog"> |
| | | <uni-popup-dialog :type="msgType" cancelText="取消" confirmText="确认" :title="title" :content="content" |
| | |
| | | baseUrl: '', |
| | | token: '', |
| | | barcode: '', |
| | | orderNo: '', |
| | | memo: '', |
| | | dataList: [], |
| | | count: 0, |
| | | rowNum: '', |
| | |
| | | messageText: '', |
| | | title: '', |
| | | content: '', |
| | | orderNoFocus: false, |
| | | barcodeFocus: true, |
| | | matFocus: false, |
| | | matData: '', |
| | | removeNum: 0, |
| | | enterCount: 0, |
| | | maxAnfme: 0, |
| | | maxAn: 0 |
| | | } |
| | | }, |
| | | onLoad() { |
| | |
| | | this.msgType1 = type |
| | | this.$refs.message.open() |
| | | }, |
| | | clearOrderNo() { |
| | | this.orderNo = '' |
| | | let that = this; |
| | | that.orderNoFocus = false; |
| | | setTimeout(() => { |
| | | that.orderNo = ''; |
| | | that.orderNoFocus = true; |
| | | }, 100); |
| | | }, |
| | | orderNoInput() { |
| | | // 不设置定时器 会出现扫入的字符串不全 |
| | | setTimeout(() => { |
| | | var len = this.orderNo.length |
| | | this.barcodeFocuss() |
| | | }, 200) |
| | | }, |
| | | // barcode input 事件 |
| | | barcodeInput() { |
| | | let _this = this |
| | | uni.request({ |
| | | url: _this.baseUrl + '/mobile/check/mergeStore/barcode', |
| | | data: {barcode: _this.barcode}, |
| | | header: { 'token':uni.getStorageSync('token') }, |
| | | success(res) { |
| | | res = res.data |
| | | if (res.code === 200) { |
| | | _this.focuss() |
| | | _this.orderNo = res.data |
| | | uni.showToast({ title: '操作成功', icon: "none", position: 'top' }) |
| | | } else if (res.code === 403) { |
| | | uni.showToast({ title: res.msg, icon: "none", position: 'top' }) |
| | | this.barcode = this.barcode.replace(/^\{|\}$/g, '') |
| | | // 不设置定时器 会出现扫入的字符串不全 |
| | | setTimeout(() => { |
| | | uni.reLaunch({ url: '../login/login' }); |
| | | }, 1000); |
| | | } else { |
| | | _this.barcodeFocuss() |
| | | uni.showToast({ title: res.msg, icon: "none", position: 'top' }) |
| | | var len = this.barcode.length |
| | | if (len != 8) { |
| | | uni.showToast({ |
| | | title: '托盘码有误请重试', |
| | | icon: "none", |
| | | position: 'top' |
| | | }); |
| | | this.barcodeFocuss() |
| | | return; |
| | | } |
| | | } |
| | | }) |
| | | this.focuss() |
| | | }, 200) |
| | | }, |
| | | // 托盘码有误重置 |
| | | barcodeFocuss() { |
| | |
| | | }, |
| | | // 商品光标清空重置 |
| | | focuss() { |
| | | this.focus = false; |
| | | this.barcodeFocus = false; |
| | | this.matFocus = false; |
| | | setTimeout(() => { |
| | | this.matnr = ''; |
| | | this.matFocus = true; |
| | | }, 100); |
| | | }, |
| | | // 检验当前物料是否是在当前Bom表中 |
| | | checkBom() { |
| | | let _this = this |
| | | uni.request({ |
| | | url: _this.baseUrl + '/mobile/comb/checkBom', |
| | | data: JSON.stringify({ |
| | | bomCode: _this.orderNo, |
| | | 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' |
| | | }) |
| | | } |
| | | |
| | | } |
| | | }) |
| | | }, |
| | | // 搜索物料 |
| | | findMat() { |
| | | let that = this |
| | | var mat = that.matnr |
| | | let submitMat |
| | | let newMatnr |
| | | if (mat.includes(';')) { |
| | | newMatnr = mat.split(';') |
| | | submitMat = newMatnr[1] |
| | | } else { |
| | | submitMat = mat |
| | | } |
| | | uni.request({ |
| | | url: that.baseUrl + '/mat/auth', |
| | | data: { |
| | | matnr: that.matnr |
| | | matnr: submitMat |
| | | }, |
| | | header: { |
| | | 'token': uni.getStorageSync('token') |
| | |
| | | that.matData = result.data |
| | | that.matnr = '' |
| | | that.matData['batch'] = '' |
| | | if (that.maxAnfme > 0) { |
| | | that.matData['maxNum'] = that.maxAnfme |
| | | } else if (that.maxAnfme == 0){ |
| | | that.matData['maxNum'] = 0 |
| | | } |
| | | uni.navigateTo({ |
| | | url: "../mat/matSelected", |
| | | // 通过eventChannel向被打开页面传送数据 |
| | |
| | | // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 |
| | | events: { |
| | | matList: function(data) { |
| | | console.log(data); |
| | | that.checkMat(data.data) |
| | | that.focuss() |
| | | }, |
| | |
| | | } |
| | | } |
| | | if (add) { |
| | | // if (this.maxAnfme) { |
| | | // mat['maxAnfme'] = this.maxAnfme |
| | | // mat.anfme = this.maxAnfme |
| | | |
| | | // } |
| | | this.dataList.unshift(mat) |
| | | } |
| | | this.maxAnfme = '' |
| | | this.$forceUpdate() // 强制刷新 |
| | | }, |
| | | // 修改批号 |
| | | revise(item, i) { |
| | | this.matnr = this.dataList[i].matnr |
| | | this.count = this.dataList[i].anfme |
| | | this.batch = this.dataList[i].batch |
| | | this.memo = this.dataList[i].memo |
| | | this.weight = this.dataList[i].weight |
| | | this.maxAn = this.dataList[i].maxNum |
| | | this.rowNum = i |
| | | this.eject() |
| | | }, |
| | |
| | | combConfirm(type) { |
| | | this.msgType = type |
| | | this.title = '警告' |
| | | this.content = '是否现在组托!' |
| | | this.content = '是否现在并托!' |
| | | this.$refs.combConfirm.open() |
| | | }, |
| | | combClose() { |
| | |
| | | comb() { |
| | | uni.vibrateShort(); |
| | | let that = this; |
| | | if (that.orderNo === '') { |
| | | this.messageText = "请输入订单条码" |
| | | this.messageToggle('error') |
| | | return; |
| | | } |
| | | if (that.barcode === '') { |
| | | this.messageText = "请扫描托盘条码" |
| | | this.messageToggle('error') |
| | |
| | | } |
| | | for (var i = 0; i < that.dataList.length; i++) { |
| | | if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') { |
| | | this.messageText = that.dataList[i].matnr + '组托数量不能为0' |
| | | this.messageText = that.dataList[i].matnr + '并托数量不能为0' |
| | | this.messageToggle('error') |
| | | return; |
| | | } |
| | | } |
| | | uni.request({ |
| | | url: that.baseUrl + '/mobile/merge/comb/auth', |
| | | url: that.baseUrl + '/mobile/combMeger/auth', |
| | | data: JSON.stringify({ |
| | | bomCode: that.orderNo, |
| | | barcode: that.barcode, |
| | | combMats: that.dataList |
| | | }), |
| | |
| | | var res = result.data |
| | | if (res.code === 200) { |
| | | that.resst(); |
| | | that.messageText = "组托成功" |
| | | that.messageText = "并托成功" |
| | | that.messageToggle('success') |
| | | const innerAudioContext = uni.createInnerAudioContext(); |
| | | innerAudioContext.src = '/static/music/pakinOk.mp3'; |
| | |
| | | }, |
| | | // 清空 |
| | | resst() { |
| | | this.orderNo = '' |
| | | this.dataList = [] |
| | | this.barcode = '' |
| | | let that = this; |
| | | that.orderNoFocus = false; |
| | | setTimeout(() => { |
| | | that.orderNo = ''; |
| | | that.orderNoFocus = true; |
| | | }, 100); |
| | | this.barcodeFocuss() |
| | | }, |
| | | } |
| | | } |
| | |
| | | .code { |
| | | width: 100%; |
| | | position: fixed; |
| | | min-height: 140rpx; |
| | | min-height: 200rpx; |
| | | background-color: #FFF; |
| | | z-index: 10; |
| | | } |
| | |
| | | .item { |
| | | display: flex; |
| | | align-items: center; |
| | | height: 70rpx; |
| | | height: 100rpx; |
| | | margin-left: 20rpx; |
| | | border-bottom: 1px solid #DCDFE6; |
| | | } |
| | |
| | | width: 100%; |
| | | background-color: white; |
| | | position: fixed; |
| | | margin-top: 210rpx; |
| | | margin-top: 200rpx; |
| | | z-index: 9; |
| | | /* border-top: 1px solid #DCDFE6; */ |
| | | text-align: center; |