| | |
| | | <view> |
| | | <view class="code"> |
| | | <view class="item"> |
| | | <view class="code-decs">单据编号:</view> |
| | | <input type="text" placeholder=" 扫码 / 输入" v-model="orderNo" |
| | | @input="barcodeInput()"> |
| | | <view class="item-right"> |
| | | <button></button> |
| | | <text style="text-align: right;color: #409EFF;" @click="selectOrder()">提取+</text> |
| | | <uni-icons type="right" color="#c1c1c1"></uni-icons> |
| | | </view> |
| | | </view> |
| | | <view class="item"> |
| | | <view class="code-decs">托盘码:</view> |
| | | <input type="text" placeholder=" 扫码 / 输入" v-model="barcode" :focus="barcodeFocus" |
| | | @input="barcodeInput()"> |
| | |
| | | <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> |
| | | <uni-icons type="right" color="#c1c1c1"></uni-icons> |
| | | <!-- <text style="text-align: right;color: #409EFF;" @click="selectMat()">提取+</text> --> |
| | | <!-- <uni-icons type="right" color="#c1c1c1"></uni-icons> --> |
| | | </view> |
| | | </view> |
| | | <!-- <view class="item"> |
| | | <view class="code-decs">满托:</view> |
| | | <radio-group @change="isFrozen"> |
| | | <label> |
| | | <radio :checked="ck1" style="margin-left: 10rpx;"/><text>是</text> |
| | | </label> |
| | | <label> |
| | | <radio :checked="ck2" style="margin-left: 50rpx;"/><text>否</text> |
| | | </label> |
| | | </radio-group> |
| | | </view> --> |
| | | </view> |
| | | <view class="mat-list-title"> |
| | | 商品列表 |
| | |
| | | </view> |
| | | <view class="list-left-item"> |
| | | <view class="desc">品名:</view> |
| | | <view class="left-item">{{item.maktx}}</view> |
| | | <view class="left-item" style="word-break: break-all;">{{item.maktx}}</view> |
| | | </view> |
| | | <view class="list-left-item"> |
| | | <view class="desc">规格:</view> |
| | |
| | | <view class="desc">数量:</view> |
| | | <view class="left-item">{{item.anfme}}</view> |
| | | </view> |
| | | <view class="list-left-item"> |
| | | <view class="desc">条码:</view> |
| | | <view class="left-item">{{item.threeCode}}</view> |
| | | </view> |
| | | </view> |
| | | <view class="list-right"> |
| | | <uni-icons type="compose" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons> |
| | | <!-- <uni-icons type="compose" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons> --> |
| | | <uni-icons type="trash" color="#f58a8a" size="24" @click="remove(item,i,'warn')"></uni-icons> |
| | | </view> |
| | | </view> |
| | |
| | | dataList: [], |
| | | count: 0, |
| | | rowNum: '', |
| | | orderNo: '', |
| | | matnr: '', |
| | | matnr: '', |
| | | batch: '', |
| | | weight: '', |
| | |
| | | messageText: '', |
| | | title: '', |
| | | content: '', |
| | | barcodeFocus: true, |
| | | orderNoFocus: true, |
| | | barcodeFocus: false, |
| | | matFocus: false, |
| | | matData: '', |
| | | removeNum: 0, |
| | | ck1: true, |
| | | ck2: false, |
| | | isFull: true |
| | | } |
| | | }, |
| | | onLoad() { |
| | |
| | | this.token = uni.getStorageSync('token'); |
| | | }, |
| | | methods: { |
| | | isFrozen() { |
| | | this.isFull = !this.isFull |
| | | console.log(this.isFull); |
| | | }, |
| | | messageToggle(type) { |
| | | this.msgType1 = type |
| | | this.$refs.message.open() |
| | |
| | | // 不设置定时器 会出现扫入的字符串不全 |
| | | setTimeout(() => { |
| | | var len = this.barcode.length |
| | | if (len != 8) { |
| | | if (len >= 9 && len <=8) { |
| | | uni.showToast({ |
| | | title: '托盘码有误请重试', |
| | | icon: "none", |
| | |
| | | this.matFocus = true; |
| | | }, 100); |
| | | }, |
| | | |
| | | // 搜索物料 |
| | | findMat() { |
| | | let that = this |
| | | let that = this |
| | | let matnr1 = that.matnr |
| | | // let m = that.matnr.split(";") |
| | | // let matnr1 = m[0].slice(3) |
| | | // let batch1 = m[1].slice(3) |
| | | uni.request({ |
| | | url: that.baseUrl + '/mat/auth', |
| | | url: that.baseUrl + '/mat/tiaoma/auth', |
| | | data: { |
| | | matnr: that.matnr |
| | | matnr: matnr1, |
| | | orderNo: that.orderNo |
| | | }, |
| | | header: { |
| | | 'token': uni.getStorageSync('token') |
| | |
| | | if (result.code === 200 && result.data) { |
| | | that.matData = result.data |
| | | that.matnr = '' |
| | | that.matData['batch'] = '' |
| | | uni.navigateTo({ |
| | | url: "../mat/matSelected", |
| | | // 通过eventChannel向被打开页面传送数据 |
| | | success: function(res) { |
| | | res.eventChannel.emit('mat', { |
| | | data: result.data |
| | | }) |
| | | }, |
| | | // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 |
| | | events: { |
| | | matList: function(data) { |
| | | that.checkMat(data.data) |
| | | that.focuss() |
| | | }, |
| | | }, |
| | | }); |
| | | that.matData['batch'] = result.data.unit |
| | | that.matData['anfme'] = result.data.safeQty |
| | | that.matData['threeCode'] = result.data.memo |
| | | |
| | | that.checkMat(that.matData) |
| | | that.focuss() |
| | | // uni.navigateTo({ |
| | | // url: "../mat/matSelected", |
| | | // // 通过eventChannel向被打开页面传送数据 |
| | | // success: function(res) { |
| | | // res.eventChannel.emit('mat', { |
| | | // data: result.data, |
| | | // }) |
| | | // }, |
| | | // // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 |
| | | // events: { |
| | | // matList: function(data) { |
| | | // that.checkMat(data.data) |
| | | // that.focuss() |
| | | // }, |
| | | // }, |
| | | // }); |
| | | } else if (result.code == 403) { |
| | | uni.showToast({ |
| | | title: result.msg, |
| | |
| | | }); |
| | | that.matnr = '' |
| | | }, |
| | | selectOrder() { |
| | | let that = this |
| | | uni.navigateTo({ |
| | | url: "../order/orderList", |
| | | success: function(res) { |
| | | // 通过eventChannel向被打开页面传送数据 向另外一个页面传递值的 |
| | | res.eventChannel.emit('commonUrl', { |
| | | commonUrl: '' |
| | | }) |
| | | }, |
| | | events: { |
| | | // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 另外一个页面传过来的 |
| | | acceptDataFromOpenedPage: function(data) { |
| | | that.orderNo = data.data |
| | | //that.findMat(that.matnr) |
| | | }, |
| | | }, |
| | | |
| | | |
| | | }); |
| | | that.orderNo = '' |
| | | }, |
| | | checkMat(mat) { |
| | | var len = this.dataList.length |
| | | var add = true ,sameItem = false |
| | | for (var i = 0; i < len; i++) { |
| | | if (mat.matnr == this.dataList[i].matnr) { |
| | | for (var j = 0; j < len; j++) { |
| | | if (mat.batch == this.dataList[j].batch) { |
| | | sameItem = true |
| | | } |
| | | } |
| | | // 相同物料 不同批号 新加列表 |
| | | if (mat.batch != this.dataList[i].batch) { |
| | | this.$forceUpdate() // 强制刷新 |
| | | if (sameItem) { |
| | | add = false |
| | | } else { |
| | | add = true |
| | | } |
| | | // for (var i = 0; i < len; i++) { |
| | | // if (mat.matnr == this.dataList[i].matnr) { |
| | | // for (var j = 0; j < len; j++) { |
| | | // if (mat.batch == this.dataList[j].batch) { |
| | | // sameItem = true |
| | | // } |
| | | // } |
| | | // // 相同物料 不同批号 新加列表 |
| | | // if (mat.batch != this.dataList[i].batch) { |
| | | // this.$forceUpdate() // 强制刷新 |
| | | // if (sameItem) { |
| | | // add = false |
| | | // } else { |
| | | // add = true |
| | | // } |
| | | |
| | | } else { |
| | | // 相同物料相同批号 数量累加 |
| | | this.dataList[i].anfme += mat.anfme |
| | | this.$forceUpdate() // 强制刷新 |
| | | add = false |
| | | } |
| | | } |
| | | } |
| | | // } else { |
| | | // // 相同物料相同批号 数量累加 |
| | | // this.dataList[i].anfme += mat.anfme |
| | | // this.$forceUpdate() // 强制刷新 |
| | | // add = false |
| | | // } |
| | | // } |
| | | // } |
| | | if (add) { |
| | | this.dataList.unshift(mat) |
| | | } |
| | |
| | | comb() { |
| | | uni.vibrateShort(); |
| | | let that = this; |
| | | if (that.orderNo === '') { |
| | | this.messageText = "请扫描订单编号" |
| | | this.messageToggle('error') |
| | | return; |
| | | } |
| | | if (that.barcode === '') { |
| | | this.messageText = "请扫描托盘条码" |
| | | this.messageToggle('error') |
| | |
| | | url: that.baseUrl + '/mobile/comb/auth', |
| | | data: JSON.stringify({ |
| | | barcode: that.barcode, |
| | | orderNo: that.orderNo, |
| | | combMats: that.dataList |
| | | }), |
| | | method: 'POST', |
| | |
| | | z-index: 9; |
| | | /* border-top: 1px solid #DCDFE6; */ |
| | | text-align: center; |
| | | box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.2); |
| | | box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.5); |
| | | } |
| | | .list:first-child { |
| | | margin-top: 350rpx; |
| | | } |
| | | </style> |