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