V3.39版本推送,出库选单依据BOM子件0的逻辑修改
This commit is contained in:
@ -239,7 +239,7 @@ const handleLogout = () => {
|
||||
<footer v-if="!isLoginPage" class="app-footer">
|
||||
<span class="version-tag">
|
||||
<el-icon style="vertical-align: middle; margin-right: 4px"><InfoFilled /></el-icon>
|
||||
当前版本:V3.38
|
||||
当前版本:V3.39
|
||||
</span>
|
||||
</footer>
|
||||
|
||||
|
||||
@ -527,12 +527,14 @@ const totalExportCount = computed(() => {
|
||||
// --- BOM 齐套性分析计算属性(使用后端已计算的 current_stock,O(N),无嵌套循环)---
|
||||
const maxBuildableSets = computed(() => {
|
||||
if (!currentBomDetail.value?.length) return 0
|
||||
return currentBomDetail.value.reduce((minSets, bomItem: any) => {
|
||||
const result = currentBomDetail.value.reduce((minSets, bomItem: any) => {
|
||||
const dosage = parseFloat(bomItem.dosage) || 0
|
||||
if (dosage <= 0) return minSets
|
||||
const stock = parseFloat(bomItem.current_stock) || 0
|
||||
return Math.min(minSets, Math.floor(stock / dosage))
|
||||
}, Infinity)
|
||||
|
||||
return result === Infinity ? 0 : result
|
||||
})
|
||||
|
||||
const shortageList = computed(() => {
|
||||
@ -723,8 +725,8 @@ watch(selectedBomNo, async (newBomNo) => {
|
||||
const confirmBomAdd = async () => {
|
||||
if (!selectedBomNo.value) return ElMessage.warning('请选择 BOM')
|
||||
|
||||
if (allStockData.value.length === 0) {
|
||||
await ensureAllStockLoaded()
|
||||
if (stockList.value.length === 0) {
|
||||
await loadStockList()
|
||||
}
|
||||
|
||||
if (currentBomDetail.value.length === 0) {
|
||||
@ -745,7 +747,7 @@ const confirmBomAdd = async () => {
|
||||
const dosage = parseFloat(bomItem.dosage) || 0
|
||||
const needQty = dosage * bomSets.value
|
||||
|
||||
const stockCandidate = allStockData.value.find(s =>
|
||||
const stockCandidate = stockList.value.find(s =>
|
||||
(s.base_id && s.base_id == bomItem.child_id)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user