| | |
| | | <!-- <!– <text class='cuIcon-search text-blue' @click="search"></text> –>--> |
| | | <!-- </view>--> |
| | | <view class="cu-form-group"> |
| | | <view class="title">ASN单号</view> |
| | | <input placeholder="请输入ASN单号" v-model="asnCode" @input="onAsnCodeInput" @confirm="onAsnCodeConfirm"></input> |
| | | <view class="title">WMS单号</view> |
| | | <input placeholder="请输入WMS单号" v-model="asnCode" @input="onAsnCodeInput" @confirm="onAsnCodeConfirm"></input> |
| | | </view> |
| | | </form> |
| | | <view class="flex solid-bottom padding-sm justify-between"> |
| | |
| | | } |
| | | }, |
| | | onAsnCodeInput(e) { |
| | | // 扫描ASN单号时自动触发查询 |
| | | // 扫描WMS单号时自动触发查询 |
| | | if (e.detail && e.detail.value && e.detail.value.trim() !== '') { |
| | | this.asnCode = e.detail.value; |
| | | // 延迟一下再查询,避免频繁请求 |
| | |
| | | clearTimeout(this.asnCodeTimer); |
| | | } |
| | | this.asnCodeTimer = setTimeout(() => { |
| | | // 扫描ASN单号时,自动加载该订单的物料信息 |
| | | // 扫描WMS单号时,自动加载该订单的物料信息 |
| | | this.getDet(); |
| | | }, 500); |
| | | } |
| | | }, |
| | | onAsnCodeConfirm() { |
| | | // 确认输入ASN单号时,立即触发查询 |
| | | // 确认输入WMS单号时,立即触发查询 |
| | | if (this.asnCode && this.asnCode.trim() !== '') { |
| | | this.getDet(); |
| | | } |
| | |
| | | if ((!that.matnrCode || that.matnrCode.trim() === '') && |
| | | (!that.asnCode || that.asnCode.trim() === '')) { |
| | | uni.showToast({ |
| | | title: "请输入物料编码或ASN单号", |
| | | title: "请输入物料编码或WMS单号", |
| | | icon: "none", |
| | | position: 'top' |
| | | }) |
| | |
| | | // 都有跟踪码,跟踪码相同则认为是同一物料 |
| | | return existingItem.trackCode === item.trackCode; |
| | | } |
| | | // 物料编码相同,检查ASN单号(如果有ASN单号,ASN单号不同则允许添加) |
| | | // 物料编码相同,检查WMS单号(如果有单号,单号不同则允许添加) |
| | | if (existingItem.asnCode && item.asnCode) { |
| | | // 都有ASN单号,ASN单号相同则认为是同一物料 |
| | | // 都有WMS单号,单号相同则认为是同一物料 |
| | | return existingItem.asnCode === item.asnCode; |
| | | } |
| | | // 物料编码相同,但都没有跟踪码和ASN单号(都是从物料信息表获取的),认为是同一物料 |
| | | // 物料编码相同,但都没有跟踪码和WMS单号(都是从物料信息表获取的),认为是同一物料 |
| | | if (existingItem.matnrCode === item.matnrCode && |
| | | !existingItem.trackCode && !item.trackCode && |
| | | !existingItem.asnCode && !item.asnCode) { |