|
|
@ -8,7 +8,7 @@ |
|
|
|
</view> |
|
|
|
<scroll-view :scroll-top="scrollTop" scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" |
|
|
|
@scroll="scroll" class="scroll-detail"> |
|
|
|
|
|
|
|
|
|
|
|
<view class="detail-list margin_top" v-for="(item, index) in details" :key="item.id"> |
|
|
|
<view class="detail-content"> |
|
|
|
<view class="choose_main"> |
|
|
@ -36,13 +36,14 @@ |
|
|
|
<text class="text_black">{{item.recommendQty}}({{item.uom}})</text> |
|
|
|
</uni-th> |
|
|
|
<uni-th width="120" align="center"> |
|
|
|
<view v-if="item.scaned" style="display: flex;flex-direction: row;justify-content:center;align-items: center;"> |
|
|
|
|
|
|
|
<com-number-box :ref="'comNumberBox_'+index" v-model="item.handledQty" :max="99999" :min="0" |
|
|
|
style='width: 100px;' @change="qtyChanged($event,item,index)"> |
|
|
|
<view v-if="item.scaned" |
|
|
|
style="display: flex;flex-direction: row;justify-content:center;align-items: center;"> |
|
|
|
|
|
|
|
<com-number-box :ref="'comNumberBox_'+index" v-model="item.handledQty" |
|
|
|
:max="99999" :min="0" style='width: 100px;' |
|
|
|
@change="qtyChanged($event,item,index)"> |
|
|
|
</com-number-box> |
|
|
|
<text |
|
|
|
class="text_black" >({{item.uom}})</text> |
|
|
|
<text class="text_black">({{item.uom}})</text> |
|
|
|
</view> |
|
|
|
</uni-th> |
|
|
|
</uni-tr> |
|
|
@ -74,7 +75,8 @@ |
|
|
|
<view class="text_black">{{ item.recommendFromLocationCode }}</view> |
|
|
|
</uni-th> |
|
|
|
<uni-th width="100" align="center"> |
|
|
|
<view class="text_black" v-if="item.scaned">{{ item.handledFromLocationCode }} |
|
|
|
<view class="text_black" v-if="item.scaned"> |
|
|
|
{{ item.handledFromLocationCode }} |
|
|
|
</view> |
|
|
|
</uni-th> |
|
|
|
</uni-tr> |
|
|
@ -97,7 +99,8 @@ |
|
|
|
<win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult'></win-scan-by-pack> |
|
|
|
|
|
|
|
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance> |
|
|
|
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()' @afterCloseScanMessage='closeScanMessage'></com-message> |
|
|
|
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()' |
|
|
|
@afterCloseScanMessage='closeScanMessage'></com-message> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
@ -253,7 +256,7 @@ |
|
|
|
// } |
|
|
|
this.allCount = that.details.length; |
|
|
|
this.scanCount = 0; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
uni.hideLoading(); |
|
|
|
}) |
|
|
@ -307,64 +310,140 @@ |
|
|
|
|
|
|
|
dyIssue(result, scaned) { |
|
|
|
let that = this; |
|
|
|
|
|
|
|
that.currentItem = that.details.find(r => { |
|
|
|
return r.itemCode === result.data.itemCode && |
|
|
|
r.recommendPackingCode === result.data.code && |
|
|
|
r.recommendLot === result.data.lot && |
|
|
|
var itemCode = that.details.find(r => { |
|
|
|
return r.itemCode === result.data.itemCode&& |
|
|
|
r.scaned === scaned |
|
|
|
}) |
|
|
|
if (itemCode == undefined) { |
|
|
|
that.showScanMessage('所扫描的箱码【' + result.data.code + '】对应的物料【' + result.data.itemCode + '】不在任务中'); |
|
|
|
}else { |
|
|
|
//零件号相同、箱码相同 |
|
|
|
var itemCode1 = that.details.find(r => { |
|
|
|
return r.itemCode === result.data.itemCode&& |
|
|
|
r.recommendPackingCode === result.data.code |
|
|
|
r.scaned === scaned |
|
|
|
}); |
|
|
|
|
|
|
|
//没找到符合的箱码 |
|
|
|
if (that.currentItem === undefined) { |
|
|
|
var itemCode = that.details.find(res=>{ |
|
|
|
return res.itemCode ===result.data.itemCode&& |
|
|
|
res.scaned === scaned |
|
|
|
}) |
|
|
|
//零件号相等 |
|
|
|
if(itemCode!=undefined){ |
|
|
|
var lot = that.details.find(res=>{ |
|
|
|
return res.itemCode===result.data.itemCode&& |
|
|
|
res.recommendLot ===result.data.lot&& |
|
|
|
res.scaned === scaned |
|
|
|
}) |
|
|
|
if(lot!=undefined){ |
|
|
|
//通过 |
|
|
|
that.currentItem =lot; |
|
|
|
that.afterScanPackLabel(result); |
|
|
|
}else { |
|
|
|
//批次不相等 |
|
|
|
// 提示未执行先进先出或者不是最先批次。 |
|
|
|
setTimeout(res=>{ |
|
|
|
showConfirmMsg('未执行先进先出或不是最先批次,是否继续?', confirm => { |
|
|
|
//零件号相同、箱码不相同 |
|
|
|
if(itemCode1 == undefined){ |
|
|
|
var itemCode2 = that.details.find(r => { |
|
|
|
return r.itemCode === result.data.itemCode&& |
|
|
|
r.recommendLot === result.data.lot |
|
|
|
&&r.scaned === scaned |
|
|
|
}) |
|
|
|
//零件号相同、箱码不相同、批次相同 |
|
|
|
if(itemCode2==undefined){ |
|
|
|
//零件号相同、箱码不相同、批次不相同 |
|
|
|
console.log("零件号相同、箱码不相同、批次不相同") |
|
|
|
setTimeout(res => { |
|
|
|
showConfirmMsg(itemCode.recommendPackingCode+'未执行先进先出或不是最先批次,是否继续?', confirm => { |
|
|
|
if (confirm) { |
|
|
|
that.currentItem = itemCode; |
|
|
|
that.afterScanPackLabel(result); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
that.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
}); |
|
|
|
},100) |
|
|
|
}, 100) |
|
|
|
|
|
|
|
}else { |
|
|
|
console.log("零件号相同、箱码不相同、批次相同") |
|
|
|
//零件号相同、箱码不相同、批次相同 |
|
|
|
that.currentItem = itemCode2; |
|
|
|
that.afterScanPackLabel(result); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
//零件号不相等 |
|
|
|
var lot = that.details.find(res=>{ |
|
|
|
return res.recommendLot ===result.data.lot&& |
|
|
|
res.scaned === scaned |
|
|
|
}) |
|
|
|
//批次相等 |
|
|
|
if(lot!=undefined){ |
|
|
|
// 在该任务中未找到零件。 |
|
|
|
that.showScanMessage('在该任务中未找到零件'); |
|
|
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
//零件号相同、箱码相同、批次相同 |
|
|
|
var itemCode3 = that.details.find(r => { |
|
|
|
return r.itemCode === result.data.itemCode&& |
|
|
|
r.recommendPackingCode === result.data.code&& |
|
|
|
r.recommendLot === result.data.lot |
|
|
|
&&r.scaned === scaned |
|
|
|
}) |
|
|
|
if(itemCode3==undefined){ |
|
|
|
//零件号相同、箱码相同、批次不同 |
|
|
|
console.log("零件号相同、箱码相同、批次不同") |
|
|
|
setTimeout(res => { |
|
|
|
showConfirmMsg(itemCode1.recommendPackingCode+'未执行先进先出或不是最先批次,是否继续?', confirm => { |
|
|
|
if (confirm) { |
|
|
|
that.currentItem = itemCode1; |
|
|
|
that.afterScanPackLabel(result); |
|
|
|
} else { |
|
|
|
that.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, 100) |
|
|
|
|
|
|
|
}else { |
|
|
|
//零件号不相等,批次不相等 |
|
|
|
that.showScanMessage('所扫描的物料不在任务中'); |
|
|
|
console.log("零件号相同、箱码相同、批次相同") |
|
|
|
//零件号相同、箱码相同、批次相同 |
|
|
|
that.currentItem = itemCode3; |
|
|
|
that.afterScanPackLabel(result); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
that.afterScanPackLabel(result); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// that.currentItem = that.details.find(r => { |
|
|
|
// return r.itemCode === result.data.itemCode && |
|
|
|
// r.recommendPackingCode === result.data.code && |
|
|
|
// r.recommendLot === result.data.lot && |
|
|
|
// r.scaned === scaned |
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //没找到符合的箱码、零件号、箱码、批次都相等 |
|
|
|
// if (that.currentItem === undefined) { |
|
|
|
// var itemCode = that.details.find(res => { |
|
|
|
// return res.itemCode === result.data.itemCode && |
|
|
|
// res.scaned === scaned |
|
|
|
// }) |
|
|
|
// //零件号相等 |
|
|
|
// if (itemCode != undefined) { |
|
|
|
// var lot = that.details.find(res => { |
|
|
|
// return res.itemCode === result.data.itemCode && |
|
|
|
// res.recommendLot === result.data.lot && |
|
|
|
// res.scaned === scaned |
|
|
|
// }) |
|
|
|
// if (lot != undefined) { |
|
|
|
// //通过 |
|
|
|
// that.currentItem = lot; |
|
|
|
// that.afterScanPackLabel(result); |
|
|
|
// } else { |
|
|
|
// //批次不相等 |
|
|
|
// // 提示未执行先进先出或者不是最先批次。 |
|
|
|
// setTimeout(res => { |
|
|
|
// showConfirmMsg('未执行先进先出或不是最先批次,是否继续?', confirm => { |
|
|
|
// if (confirm) { |
|
|
|
// that.currentItem = itemCode; |
|
|
|
// that.afterScanPackLabel(result); |
|
|
|
// } else { |
|
|
|
// that.scanPopupGetFocus(); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// }, 100) |
|
|
|
|
|
|
|
// } |
|
|
|
// } else { |
|
|
|
// //零件号不相等 |
|
|
|
// var lot = that.details.find(res => { |
|
|
|
// return res.recommendLot === result.data.lot && |
|
|
|
// res.scaned === scaned |
|
|
|
// }) |
|
|
|
// //批次相等 |
|
|
|
// if (lot != undefined) { |
|
|
|
// // 在该任务中未找到零件。 |
|
|
|
// that.showScanMessage('在该任务中未找到零件'); |
|
|
|
// } else { |
|
|
|
// //零件号不相等,批次不相等 |
|
|
|
// that.showScanMessage('所扫描的物料不在任务中'); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } else { |
|
|
|
// that.afterScanPackLabel(result); |
|
|
|
// } |
|
|
|
}, |
|
|
|
|
|
|
|
afterScanPackLabel(result) { |
|
|
@ -428,18 +507,18 @@ |
|
|
|
item.handledPackingCode = balanceItem.packingCode; |
|
|
|
item.handledBatch = balanceItem.batch; |
|
|
|
item.handledLot = balanceItem.lot; |
|
|
|
|
|
|
|
item.defaultHandleQty =balanceItem.qty; |
|
|
|
|
|
|
|
item.defaultHandleQty = balanceItem.qty; |
|
|
|
item.handledQty = balanceItem.qty; |
|
|
|
item.handledFromLocationCode = balanceItem.locationCode; |
|
|
|
item.handledFromLocationArea = balanceItem.locationArea; |
|
|
|
item.handledFromLocationGroup = balanceItem.locationErpCode; |
|
|
|
item.handledFromLocationErpCode = balanceItem.locationGroup; |
|
|
|
item.handledFromWarehouseCode = balanceItem.warehouseCode; |
|
|
|
|
|
|
|
item.toLocationArea =balanceItem.locationArea; |
|
|
|
item.toLocationGroup= balanceItem.locationGroup; |
|
|
|
item.toLocationErpCode= balanceItem.locationErpCode; |
|
|
|
|
|
|
|
item.toLocationArea = balanceItem.locationArea; |
|
|
|
item.toLocationGroup = balanceItem.locationGroup; |
|
|
|
item.toLocationErpCode = balanceItem.locationErpCode; |
|
|
|
|
|
|
|
//当前扫描标签的信息 |
|
|
|
item.scanItemCode = this.currentScanLebel.data.itemCode; |
|
|
@ -615,15 +694,15 @@ |
|
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
closeScanMessage() { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
scanPopupGetFocus() { |
|
|
|
this.$refs.scanPopup.getfocus(); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
scrollToTop() { |
|
|
|
let that = this; |
|
|
|
// 解决view层不同步的问题 |
|
|
@ -643,15 +722,15 @@ |
|
|
|
// console.log(e) |
|
|
|
this.old.scrollTop = e.detail.scrollTop; |
|
|
|
}, |
|
|
|
qtyChanged(value, item,index) { |
|
|
|
qtyChanged(value, item, index) { |
|
|
|
if (value <= 0) { |
|
|
|
this.showMessage('发料数量不能小于或等于0') |
|
|
|
item.handledQty =item.defaultHandleQty |
|
|
|
this.$refs['comNumberBox_'+index][0].setValue(item.handledQty); |
|
|
|
}else if(value>item.defaultHandleQty){ |
|
|
|
item.handledQty = item.defaultHandleQty |
|
|
|
this.showMessage('发料数量不能大于库存数量:'+item.handledQty) |
|
|
|
this.$refs['comNumberBox_'+index][0].setValue(item.handledQty); |
|
|
|
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|
|
|
} else if (value > item.defaultHandleQty) { |
|
|
|
item.handledQty = item.defaultHandleQty |
|
|
|
this.showMessage('发料数量不能大于库存数量:' + item.handledQty) |
|
|
|
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|