|
|
@ -251,7 +251,7 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { getPurchaseOrderReceiptList, confirmQualifiedStorage, validateHandlingUnitForQualifiedStorage, getInboundHistory } from "@/api/po/po.js"; |
|
|
|
|
|
|
|
|
import { getPurchaseOrderReceiptList, confirmQualifiedStorage, validateHandlingUnitForQualifiedStorage, getInboundHistory, validateLocationForPicking } from "@/api/po/po.js"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
@ -369,12 +369,28 @@ export default { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 失去光标 |
|
|
|
|
|
|
|
|
// 校验库位类型 |
|
|
|
|
|
this.validateLocationForPickingType(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 校验库位是否为PICKING类型 |
|
|
|
|
|
async validateLocationForPickingType() { |
|
|
|
|
|
if (!this.targetLocationId.trim()) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
const { data } = await validateLocationForPicking({ |
|
|
|
|
|
site: this.site, |
|
|
|
|
|
locationId: this.targetLocationId.trim() |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (data.code === 0) { |
|
|
|
|
|
// 校验通过,失去光标并定位到页面底部 |
|
|
if (this.$refs.locationInput) { |
|
|
if (this.$refs.locationInput) { |
|
|
this.$refs.locationInput.blur(); |
|
|
this.$refs.locationInput.blur(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 定位到页面最底部 |
|
|
|
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
const bottomActions = document.querySelector('.bottom-actions'); |
|
|
const bottomActions = document.querySelector('.bottom-actions'); |
|
|
if (bottomActions) { |
|
|
if (bottomActions) { |
|
|
@ -384,6 +400,29 @@ export default { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(data.msg || '库位必须是PICKING类型'); |
|
|
|
|
|
// 清空库位输入 |
|
|
|
|
|
this.targetLocationId = ''; |
|
|
|
|
|
// 重新聚焦到库位输入框 |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
if (this.$refs.locationInput) { |
|
|
|
|
|
this.$refs.locationInput.focus(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error('库位校验失败:', error); |
|
|
|
|
|
this.$message.error('库位校验失败,请重试'); |
|
|
|
|
|
// 清空库位输入 |
|
|
|
|
|
this.targetLocationId = ''; |
|
|
|
|
|
// 重新聚焦到库位输入框 |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
if (this.$refs.locationInput) { |
|
|
|
|
|
this.$refs.locationInput.focus(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 验证标签并添加到列表 |
|
|
// 验证标签并添加到列表 |
|
|
@ -458,7 +497,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 确认入库 |
|
|
// 确认入库 |
|
|
confirmStorage() { |
|
|
|
|
|
|
|
|
async confirmStorage() { |
|
|
// 验证必填字段 |
|
|
// 验证必填字段 |
|
|
if (!this.targetLocationId) { |
|
|
if (!this.targetLocationId) { |
|
|
this.$message.error('请输入目标库位'); |
|
|
this.$message.error('请输入目标库位'); |
|
|
@ -470,6 +509,23 @@ export default { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 提交前再次校验库位类型 |
|
|
|
|
|
try { |
|
|
|
|
|
const { data } = await validateLocationForPicking({ |
|
|
|
|
|
site: this.site, |
|
|
|
|
|
locationId: this.targetLocationId.trim() |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (data.code !== 0) { |
|
|
|
|
|
this.$message.error(data.msg || '库位必须是PICKING类型'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error('库位校验失败:', error); |
|
|
|
|
|
this.$message.error('库位校验失败,请重试'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 计算HandlingUnit总数量 |
|
|
// 计算HandlingUnit总数量 |
|
|
const totalScannedQty = this.scannedItems.reduce((sum, item) => sum + (parseFloat(item.qty) || 0), 0); |
|
|
const totalScannedQty = this.scannedItems.reduce((sum, item) => sum + (parseFloat(item.qty) || 0), 0); |
|
|
const availableQty = this.getAvailableQty(); |
|
|
const availableQty = this.getAvailableQty(); |
|
|
@ -943,7 +999,7 @@ export default { |
|
|
left: 0; |
|
|
left: 0; |
|
|
right: 0; |
|
|
right: 0; |
|
|
bottom: 0; |
|
|
bottom: 0; |
|
|
background: rgba(255, 255, 255, 0.9); |
|
|
|
|
|
|
|
|
background: rgba(255, 255, 255, 0.5); |
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
|