| | |
| | | </view> |
| | | <view class="square-content"> |
| | | <view class="content-input"> |
| | | <input v-model="barcode" type="text" placeholder="扫码 / 输入" maxlength="10" |
| | | :focus="barcodeFocus" @input="barcodeInput"> |
| | | <input v-model="barcode" type="text" placeholder="扫码 / 输入" placeholder-style="margin-top:10px" maxlength="10" |
| | | :focus="barcodeFocus" @confirm="barcodeInput()"> |
| | | <uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons> |
| | | </view> |
| | | </view> |
| | |
| | | <view class="title-text"><text>检索商品</text></view> |
| | | </view> |
| | | <view class="square-content"> |
| | | <view class="content-input-btn"> |
| | | <view class="content-input"> |
| | | <input v-model="matnr" type="text" placeholder="扫码 / 输入" @input="findMat()" |
| | | :focus="focus"> |
| | | :focus="focus" placeholder-style="margin-top:9px"> |
| | | <uni-icons type="closeempty" size="20" color="#dadada" @click="removeMatnr()"></uni-icons> |
| | | </view> |
| | | <view class="content-btn"> |
| | | <!-- <view class="content-btn"> |
| | | <button class="cu-btn bg-blue pda-btn" @click="selectMat()">+提取</button> |
| | | </view> |
| | | </view> --> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | </view> |
| | | </view> |
| | | <view class="data-list-right"> |
| | | <label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons></label> |
| | | <label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(index)"></uni-icons></label> |
| | | <label><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons></label> |
| | | </view> |
| | | </view> |
| | |
| | | |
| | | <!-- 弹窗 --> |
| | | <!-- 修改数量 --> |
| | | <uni-popup ref="revise" background-color="#fff" @change="change"> |
| | | |
| | | <uni-popup ref="revise" background-color="#fff"> |
| | | <view class="revise-box"> |
| | | <view class="revise-box-top"> |
| | | <view class="color-block-blue"></view> |
| | | <text class="title">组托数量</text> |
| | | </view> |
| | | <view class="text-box"> |
| | | <text>可组数量:{{enableQty}}</text> |
| | | <text>确认组托数量</text> |
| | | </view> |
| | | <view class="changeBox"> |
| | | <view class="num-box"> |
| | | <uni-number-box v-model="count" :min="minCount" :max="maxCount" color="#747474" @change="changeValue"/> |
| | | <uni-number-box :value="count" :max="999999999" color="#747474" @change="changeValue" /> |
| | | </view> |
| | | </view> |
| | | <view class="revise-box-buttom"> |
| | |
| | | result: '', |
| | | enableQty:'', |
| | | count:'', |
| | | counts:'', |
| | | minCount:0, |
| | | maxCount:'', |
| | | rowNum:'', |
| | |
| | | methods: { |
| | | // barcode input 事件 |
| | | barcodeInput() { |
| | | var len = this.barcode.length |
| | | if (len != 8) { |
| | | uni.showToast({title: '托盘码有误请重试', icon: "none", position: 'top'}); |
| | | this.barcodeFocuss() |
| | | return; |
| | | } |
| | | if (len == 8) { |
| | | this.focuss() |
| | | } |
| | | // 不设置定时器 会出现扫入的字符串不全 |
| | | setTimeout(()=>{ |
| | | var len = this.barcode.length |
| | | if (len != 8) { |
| | | uni.showToast({title: '托盘码有误请重试', icon: "none", position: 'top'}); |
| | | this.barcodeFocuss() |
| | | return; |
| | | } |
| | | if (len == 8) { |
| | | this.focuss() |
| | | } |
| | | },100) |
| | | |
| | | }, |
| | | // 托盘码有误重置 |
| | | barcodeFocuss() { |
| | |
| | | }, |
| | | remove(item,index) { |
| | | this.matList.splice(index,1) |
| | | |
| | | // for (var i = 0; i < this.matList.length; i++) { |
| | | // if (this.matList[i].checked == true) { |
| | | // this.matList.splice(i,1) |
| | | // } |
| | | // } |
| | | this.checkList(); |
| | | uni.vibrateShort(); |
| | | }, |
| | |
| | | 'token':uni.getStorageSync('token') |
| | | }, |
| | | success(result) { |
| | | console.log(result) |
| | | uni.hideLoading(); |
| | | var res = result.data |
| | | if (res.code === 200) { |
| | |
| | | }, |
| | | success: function(res) { |
| | | // 通过eventChannel向被打开页面传送数据 向另外一个页面传递值的 |
| | | res.eventChannel.emit('acceptDataFromOpenerPage', {baseIP:that.baseIP, basePORT:that.basePORT }) |
| | | res.eventChannel.emit('matData', {baseIP:that.baseIP, basePORT:that.basePORT }) |
| | | }, |
| | | |
| | | }); |
| | |
| | | 'token':uni.getStorageSync('token') |
| | | }, |
| | | success(result) { |
| | | console.log(result) |
| | | uni.vibrateShort(); |
| | | let res = result.data |
| | | if (res.code === 200 && res.data) { |
| | |
| | | events: { |
| | | // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 |
| | | matList: function(data) { |
| | | that.matList.push(data.data) |
| | | console.log(that.matList) |
| | | that.checkMat(data.data) |
| | | // that.matList.push(data.data) |
| | | }, |
| | | }, |
| | | success: function(res) { |
| | |
| | | }); |
| | | |
| | | }, |
| | | |
| | | // 添加商品 |
| | | addMat(mat) { |
| | | this.matList.unshift(mat) |
| | | }, |
| | | checkMat(mat) { |
| | | var len = this.matList.length |
| | | var add = true |
| | | for (var i = 0; i < len; i++) { |
| | | if (mat.matNo === this.matList[i].matNo) { |
| | | this.matList[i].count += mat.count |
| | | this.$forceUpdate() // 强制刷新 |
| | | add = false |
| | | } |
| | | } |
| | | if (add) { |
| | | this.matList.unshift(mat) |
| | | } |
| | | }, |
| | | change(e) { |
| | | console.log('当前模式:' + e.type + ',状态:' + e.show); |
| | | }, |
| | |
| | | this.$refs.goodsSearch.open(type) |
| | | }, |
| | | checkbox: function (e) { |
| | | var items = this.matList, |
| | | values = e.detail.value; |
| | | for (var i = 0, lenI = items.length; i < lenI; ++i) { |
| | | const item = items[i] |
| | | item.id = item.id + '' |
| | | if(values.indexOf(item.id) >= 0){ |
| | | this.$set(item,'checked',true) |
| | | }else{ |
| | | this.$set(item,'checked',false) |
| | | } |
| | | } |
| | | if (values.length == items.length) { |
| | | this.check = true |
| | | this.checkText = "取消全选" |
| | | } else { |
| | | this.check = false |
| | | this.checkText = "全选" |
| | | } |
| | | uni.vibrateShort(); |
| | | // var items = this.matList, |
| | | // values = e.detail.value; |
| | | // for (var i = 0, lenI = items.length; i < lenI; ++i) { |
| | | // const item = items[i] |
| | | // item.id = item.id + '' |
| | | // if(values.indexOf(item.id) >= 0){ |
| | | // this.$set(item,'checked',true) |
| | | // }else{ |
| | | // this.$set(item,'checked',false) |
| | | // } |
| | | // } |
| | | // if (values.length == items.length) { |
| | | // this.check = true |
| | | // this.checkText = "取消全选" |
| | | // } else { |
| | | // this.check = false |
| | | // this.checkText = "全选" |
| | | // } |
| | | // uni.vibrateShort(); |
| | | }, |
| | | revise(item,index) { |
| | | var maxCount = this.matList[index].maxCount |
| | | if (maxCount == undefined ) { |
| | | this.matList[index]["maxCount"] = item.enableQty |
| | | } |
| | | this.enableQty = item.enableQty |
| | | this.count = this.minCount |
| | | this.maxCount = item.maxCount |
| | | revise(index) { |
| | | this.rowNum = index |
| | | this.eject() |
| | | }, |
| | | eject(type) { |
| | | this.type = type |
| | | // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
| | | this.$refs.revise.open(type) |
| | | }, |
| | | changeValue() { |
| | | this.count = this.matList[this.rowNum].count |
| | | this.$refs.revise.open() |
| | | |
| | | }, |
| | | changeCount(e) { |
| | | |
| | | }, |
| | | changeValue(value) { |
| | | this.count = value |
| | | }, |
| | | // 确认组托数量 |
| | | confirm() { |
| | | this.matList[this.rowNum].anfme = this.count |
| | | this.matList[this.rowNum].count = this.count |
| | | this.$refs.revise.close() |
| | | this.$forceUpdate() // 强制刷新 |
| | | }, |
| | | // 列表反选 |
| | | reChecked() { |
| | |
| | | height: 180rpx; |
| | | margin: 15rpx; |
| | | border-radius: 20rpx; |
| | | font-size: 12px; |
| | | } |
| | | .data-list:first-child { |
| | | margin-top: 20rpx; |
| | | } |
| | | .data-list:last-child { |
| | | margin-bottom: 120rpx; |
| | | margin-bottom: 170rpx; |
| | | } |
| | | /* .data-list-left { |
| | | display: inline-block; |
| | |
| | | width: 80rpx; |
| | | height: 180rpx; |
| | | } |
| | | .revise-box { |
| | | width: 500rpx; |
| | | height: 500rpx; |
| | | } |
| | | .revise-box-top { |
| | | width: 100%; |
| | | height: 100rpx; |
| | | background-color: #fff; |
| | | padding: 10rpx; |
| | | } |
| | | .changeBox { |
| | | width: 100%; |
| | | height: 100rpx; |
| | | line-height: 120rpx; |
| | | text-align: center; |
| | | background-color: #FFF; |
| | | margin-top: 20rpx; |
| | | border-bottom: 1px solid #e3e3e3; |
| | | } |
| | | .text-box { |
| | | width: 100%; |
| | | height: 100rpx; |
| | | line-height: 120rpx; |
| | | text-align: center; |
| | | /* padding-left: 120rpx; */ |
| | | background-color: #FFF; |
| | | margin-top: 20rpx; |
| | | border-bottom: 1px solid #e3e3e3; |
| | | } |
| | | .changeBox .num-box { |
| | | display: inline-block; |
| | | /* float: left; */ |
| | | } |
| | | .changeBox button { |
| | | float: left; |
| | | } |
| | | .revise-box-buttom { |
| | | position: absolute; |
| | | width: 100%; |
| | | height: 100rpx; |
| | | line-height: 100rpx; |
| | | background-color: #FFFFFF; |
| | | bottom: 0; |
| | | text-align: center; |
| | | } |
| | | |
| | | </style> |