|  |  |  | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="item"> | 
|---|
|  |  |  | <view class="code-decs">暂存位:</view> | 
|---|
|  |  |  | <input type="text" placeholder=" 扫码 / 输入" v-model="stationCode" :focus="matFocus"> | 
|---|
|  |  |  | <input type="text" placeholder=" 扫码 / 输入" v-model="stationCode" :focus="stationCodeFocus" | 
|---|
|  |  |  | @input="stationCodeInput()"> | 
|---|
|  |  |  | <view class="item-right"> | 
|---|
|  |  |  | <button></button> | 
|---|
|  |  |  | <!-- <text style="text-align: right;color: #409EFF;" @click="selectMat()">提取+</text> --> | 
|---|
|  |  |  | 
|---|
|  |  |  | <view class="left-item">{{i + 1}}</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="list-left-item"> | 
|---|
|  |  |  | <view class="desc">编码:</view> | 
|---|
|  |  |  | <view class="desc">料号:</view> | 
|---|
|  |  |  | <view class="left-item"> | 
|---|
|  |  |  | <uni-tag :text="item.matnr" type="primary"></uni-tag> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | 
|---|
|  |  |  | <uni-tag :text="item.batch" type="warning"></uni-tag> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="list-left-item"> | 
|---|
|  |  |  | <!-- <view class="list-left-item"> | 
|---|
|  |  |  | <view class="desc">重量:</view> | 
|---|
|  |  |  | <view class="left-item"> | 
|---|
|  |  |  | <uni-tag :text="item.weight" type="warning"></uni-tag> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> --> | 
|---|
|  |  |  | <view class="list-left-item"> | 
|---|
|  |  |  | <view class="desc">数量:</view> | 
|---|
|  |  |  | <view class="left-item">{{item.anfme}}</view> | 
|---|
|  |  |  | 
|---|
|  |  |  | <!-- 底部操作按钮 --> | 
|---|
|  |  |  | <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 class="title">修改</view> | 
|---|
|  |  |  | <view class="popup-item"> | 
|---|
|  |  |  | <view class="popup-item-left">编码:</view> | 
|---|
|  |  |  | <view class="popup-item-left">料号:</view> | 
|---|
|  |  |  | <view class="popup-item-right"> | 
|---|
|  |  |  | <input type="text" v-model="matnr" disabled="true" | 
|---|
|  |  |  | style="background-color: #f7f7f7;padding: 0;color: #d5d5d5;"> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <!-- <view class="popup-item"> | 
|---|
|  |  |  | <view class="popup-item"> | 
|---|
|  |  |  | <view class="popup-item-left">批号:</view> | 
|---|
|  |  |  | <view class="popup-item-right"><input type="text" v-model="batch"></view> | 
|---|
|  |  |  | </view> --> | 
|---|
|  |  |  | <view class="popup-item"> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <!-- <view class="popup-item"> | 
|---|
|  |  |  | <view class="popup-item-left">重量:</view> | 
|---|
|  |  |  | <view class="popup-item-right"><input type="text" v-model="weight"></view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> --> | 
|---|
|  |  |  | <view class="popup-item"> | 
|---|
|  |  |  | <view class="popup-item-left">数量:</view> | 
|---|
|  |  |  | <view class="popup-item-right" style="border: none;justify-content: center;"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <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" | 
|---|
|  |  |  | 
|---|
|  |  |  | token: '', | 
|---|
|  |  |  | barcode: '', | 
|---|
|  |  |  | stationCode: '', | 
|---|
|  |  |  | stationCodeFocus: false, | 
|---|
|  |  |  | dataList: [], | 
|---|
|  |  |  | count: 0, | 
|---|
|  |  |  | rowNum: '', | 
|---|
|  |  |  | 
|---|
|  |  |  | this.msgType1 = type | 
|---|
|  |  |  | this.$refs.message.open() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | stationCodeInput() { | 
|---|
|  |  |  | setTimeout(() => { | 
|---|
|  |  |  | var len = this.stationCode.length | 
|---|
|  |  |  | if (len != 15) { | 
|---|
|  |  |  | this.stationCode = '' | 
|---|
|  |  |  | this.stationCodeFocus = true | 
|---|
|  |  |  | uni.showToast({ | 
|---|
|  |  |  | title: '暂存码有误请重试', | 
|---|
|  |  |  | icon: "none", | 
|---|
|  |  |  | position: 'top' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.focuss() | 
|---|
|  |  |  | }, 200) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // barcode input 事件 | 
|---|
|  |  |  | barcodeInput() { | 
|---|
|  |  |  | // 不设置定时器 会出现扫入的字符串不全 | 
|---|
|  |  |  | setTimeout(() => { | 
|---|
|  |  |  | var len = this.barcode.length | 
|---|
|  |  |  | if (len != 8) { | 
|---|
|  |  |  | if (len != 10) { | 
|---|
|  |  |  | uni.showToast({ | 
|---|
|  |  |  | title: '托盘码有误请重试', | 
|---|
|  |  |  | icon: "none", | 
|---|
|  |  |  | 
|---|
|  |  |  | this.barcodeFocuss() | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.focuss() | 
|---|
|  |  |  | this.stationCodeFocuss() | 
|---|
|  |  |  | }, 200) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 暂存位有误重置 | 
|---|
|  |  |  | stationCodeFocuss() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | that.stationCodeFocus = false; | 
|---|
|  |  |  | setTimeout(() => { | 
|---|
|  |  |  | that.stationCodeFocus = true; | 
|---|
|  |  |  | }, 100); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 托盘码有误重置 | 
|---|
|  |  |  | barcodeFocuss() { | 
|---|
|  |  |  | 
|---|
|  |  |  | combConfirm(type) { | 
|---|
|  |  |  | this.msgType = type | 
|---|
|  |  |  | this.title = '警告' | 
|---|
|  |  |  | this.content = '是否现在上架!' | 
|---|
|  |  |  | this.content = '是否现在绑定!' | 
|---|
|  |  |  | this.$refs.combConfirm.open() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | combClose() { | 
|---|
|  |  |  | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | uni.request({ | 
|---|
|  |  |  | url: that.baseUrl + '/mobile/combBinging/auth', | 
|---|
|  |  |  | url: that.baseUrl + '/agvMobile/combBinging/auth', | 
|---|
|  |  |  | data: JSON.stringify({ | 
|---|
|  |  |  | barcode: that.barcode, | 
|---|
|  |  |  | stationCode: that.stationCode | 
|---|
|  |  |  | 
|---|
|  |  |  | 'token': uni.getStorageSync('token') | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | success(result) { | 
|---|
|  |  |  | console.log(result); | 
|---|
|  |  |  | 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'; | 
|---|
|  |  |  | 
|---|
|  |  |  | // 确认重置 | 
|---|
|  |  |  | resetConfirm() { | 
|---|
|  |  |  | this.dataList = [] | 
|---|
|  |  |  | this.barcode = '' | 
|---|
|  |  |  | this.stationCode = '' | 
|---|
|  |  |  | this.messageText = "重置完成" | 
|---|
|  |  |  | this.messageToggle('success') | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | resst() { | 
|---|
|  |  |  | this.dataList = [] | 
|---|
|  |  |  | this.barcode = '' | 
|---|
|  |  |  | this.stationCode = '' | 
|---|
|  |  |  | this.barcodeFocuss() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | } | 
|---|