New file |
| | |
| | | <template> |
| | | <view> |
| | | <view class="code"> |
| | | <view style="display: flex;align-items: center;"> |
| | | <view style="width: 70rpx;padding-left: 20rpx;">{{searchType}}</view> |
| | | <view style="flex: 1;margin-left: -8rpx;background-color: white;padding: 4px;margin: 4px;border-radius: 4px;"> |
| | | <!-- <uni-search-bar v-model="searchValue" |
| | | maxlength="500" ancel="cancel" @confirm="getMatList()" @clear="clear" placeholder="输入 / 扫描"> |
| | | </uni-search-bar> --> |
| | | <uni-combox :candidates="orderNoList" placeholder="请选择订单" v-model="orderNo" @input="getOrderDet"></uni-combox> |
| | | </view> |
| | | </view> |
| | | <view class="code-title"> |
| | | <view style="flex: 1;"></view> |
| | | <view style="width: 100%;text-align: center;margin: 16rpx 0;flex: 1;">{{searchValue}} 总数量:- {{dataList.length}} -</view> |
| | | <view style="flex: 1;display: flex;align-items: center;"><button size="mini" type="primary" @click="allSelect()">{{seltitle}}</button></view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="order__list" v-for="(orderDetl,index) in dataList" :key="index"> |
| | | <view class="order__list__left"> |
| | | <view>No:{{index + 1}}</view> |
| | | <view>订单号:{{orderDetl.orderNo}}</view> |
| | | <view>料号:{{orderDetl.matnr}}</view> |
| | | <view>批号:{{orderDetl.batch}}</view> |
| | | <view>可用数量:{{orderDetl.enableQty}}</view> |
| | | </view> |
| | | <view class="order__list__right"> |
| | | <!-- <uni-icons type="folder-add" size="25" color="#fff"></uni-icons> --> |
| | | <label @click="checkboxChange(orderDetl)"> |
| | | <checkbox :value="orderDetl.matnr" :checked="orderDetl.checked" style="transform:scale(0.7)" /><text></text> |
| | | </label> |
| | | </view> |
| | | </view> |
| | | <!-- 底部操作按钮 --> |
| | | <view class="buttom"> |
| | | <button size="mini" type="primary" @click="addItems()">提取</button> |
| | | </view> |
| | | <view style="height: 100rpx;width: 100%;text-align: center;line-height: 100rpx;">- 已经到底了 -</view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | baseUrl: '', |
| | | token: '', |
| | | storeId: 0, |
| | | store: '', |
| | | total: 0, |
| | | searchType: '订单', |
| | | searchValue: '', |
| | | dataList: [], |
| | | selectedList: [], |
| | | matnr: '', |
| | | orderNo: '', |
| | | orderNoList: [], |
| | | seltitle: '全选' |
| | | } |
| | | }, |
| | | onShow() { |
| | | let _this = this |
| | | this.baseUrl = uni.getStorageSync('baseUrl'); |
| | | this.token = uni.getStorageSync('token'); |
| | | this.storeId = uni.getStorageSync('store') |
| | | if (this.storeId == 1) { |
| | | this.store = '宁波仓' |
| | | } |
| | | if (this.storeId == 2) { |
| | | this.store = '新昌仓' |
| | | } |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | | eventChannel.on('item', function(data) { |
| | | _this.matnr = data.item.matnr |
| | | _this.getMatList() |
| | | }) |
| | | this.getOrderNoList() |
| | | }, |
| | | methods: { |
| | | addItems() { |
| | | let pickList = [] |
| | | for (let k of this.dataList) { |
| | | if (k.checked) { |
| | | pickList.push(k) |
| | | } |
| | | } |
| | | this.getOpenerEventChannel().emit('pickList', {data: pickList}); |
| | | uni.navigateBack({ |
| | | |
| | | }) |
| | | }, |
| | | checkboxChange(e) { |
| | | let items = this.dataList, |
| | | values = e.matnr; |
| | | if (e.checked) { |
| | | this.$set(e,'checked',false) |
| | | } else { |
| | | this.$set(e,'checked',true) |
| | | } |
| | | var count = 0 |
| | | for (let k of items) { |
| | | if (k.checked) { |
| | | count++ |
| | | } |
| | | } |
| | | if (count == items.length && count > 0) { |
| | | this.seltitle = '取消全选' |
| | | } else { |
| | | this.seltitle = '全选' |
| | | } |
| | | }, |
| | | allSelect() { |
| | | if (this.seltitle == '全选') { |
| | | for (let k of this.dataList) { |
| | | k.checked = true |
| | | } |
| | | this.seltitle = '取消全选' |
| | | } else { |
| | | for (let k of this.dataList) { |
| | | k.checked = false |
| | | } |
| | | this.seltitle = '全选' |
| | | } |
| | | |
| | | }, |
| | | getOrderDet() { |
| | | let that = this |
| | | uni.request({ |
| | | url: that.baseUrl + '/order/list/orderNo', |
| | | data: {orderNo: that.orderNo} , |
| | | method: 'GET', |
| | | success(res) { |
| | | res = res.data; |
| | | if (res.code === 200) { |
| | | that.dataList = res.data |
| | | for (var i = 0; i < that.dataList.length; i++) { |
| | | that.$set(that.dataList[i],'checked',false) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | getOrderNoList() { |
| | | let that = this |
| | | uni.request({ |
| | | url: this.baseUrl + '/order/comb/list/all', |
| | | header: { |
| | | 'token': uni.getStorageSync('token') |
| | | }, |
| | | method: 'POST', |
| | | success(res) { |
| | | res = res.data |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | that.orderNoList.push(res.data[i].order_no) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | clear() { |
| | | this.searchValue = '' |
| | | this.getOrderNoList(this.locNo) |
| | | }, |
| | | back() { uni.navigateBack({}) }, |
| | | set(e) { |
| | | var ck = this.dataList[e].checked |
| | | this.dataList[e].checked = ck ? false : true |
| | | }, |
| | | getMatList() { |
| | | let that = this |
| | | let searchParam = { |
| | | orderNo: that.searchValue, |
| | | matnr: that.matnr, |
| | | } |
| | | console.log(searchParam); |
| | | uni.request({ |
| | | url: that.baseUrl + '/mobile/outBound/mat/list', |
| | | header: { |
| | | 'token': uni.getStorageSync('token') |
| | | }, |
| | | data: searchParam, |
| | | method: 'GET', |
| | | success(res) { |
| | | res = res.data; |
| | | if (res.code === 200) { |
| | | that.total = res.data.length |
| | | const result1 = res.data.filter(obj1 => |
| | | !that.selectedList.some(obj2 => obj1.matnr === obj2.matnr && obj1.orderNo === obj2.orderNo) |
| | | ); |
| | | that.dataList = result1 |
| | | that.total = result1.length |
| | | } else if (res.code == 403) { |
| | | uni.showToast({ title: res.msg, icon: "error", position: 'center' }) |
| | | setTimeout(() => { uni.reLaunch({ url: '../login/login' }); }, 1000); |
| | | } else { |
| | | uni.showToast({ title: res.msg, icon: "error", position: 'center' }) |
| | | } |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | addItem(mat) { |
| | | this.getOpenerEventChannel().emit('sMat', {data: mat}); |
| | | uni.navigateBack({ |
| | | |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | @import url('../../static/css/wms.css/wms.css'); |
| | | .code { |
| | | background-color: #d9d9d9; |
| | | z-index: 99; |
| | | position: sticky; |
| | | top: 0rpx; |
| | | left: 0; |
| | | } |
| | | .code-title { |
| | | display: flex; |
| | | } |
| | | .order__list { |
| | | margin: 20rpx; |
| | | font-size: 14px; |
| | | background-color: #fff; |
| | | border-radius: 20rpx; |
| | | border: 1px solid #eeeeee; |
| | | display: flex; |
| | | position: relative; |
| | | background-color: #3eb689; |
| | | color: #FFF; |
| | | } |
| | | .order__list__left { |
| | | flex: 1; |
| | | padding: 20rpx; |
| | | position: relative; |
| | | } |
| | | .order__list__right { |
| | | width: 70rpx; |
| | | border-left: 1px solid #eeeeee; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | </style> |
| | | |