From dacc95761cf7090c628fc37a5d4f8bb825ccbbb0 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期六, 16 五月 2026 15:41:45 +0800
Subject: [PATCH] 企业新闻和通知公告
---
src/views/inventoryManagement/stockManagement/Subtract.vue | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/views/inventoryManagement/stockManagement/Subtract.vue b/src/views/inventoryManagement/stockManagement/Subtract.vue
index b0e83c6..2cdfcb6 100644
--- a/src/views/inventoryManagement/stockManagement/Subtract.vue
+++ b/src/views/inventoryManagement/stockManagement/Subtract.vue
@@ -49,8 +49,8 @@
]"
>
<el-select v-model="formState.type" placeholder="璇烽�夋嫨搴撳瓨绫诲瀷" @change="handleTypeChange">
- <el-option label="鍚堟牸搴撳瓨" value="qualified" :disabled="props.record.qualifiedUnLockedQuantity <= 0" />
- <el-option label="涓嶅悎鏍煎簱瀛�" value="unqualified" :disabled="props.record.unQualifiedUnLockedQuantity <= 0" />
+ <el-option label="鍚堟牸搴撳瓨" value="qualified" :disabled="(props.record.qualifiedUnLockedQuantity || 0) + (props.record.qualifiedPendingOutQuantity || 0) <= 0" />
+ <el-option label="涓嶅悎鏍煎簱瀛�" value="unqualified" :disabled="(props.record.unQualifiedUnLockedQuantity || 0) + (props.record.unQualifiedPendingOutQuantity || 0) <= 0" />
</el-select>
</el-form-item>
@@ -85,8 +85,8 @@
<script setup>
import {ref, computed, getCurrentInstance} from "vue";
import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue";
-import {subtractStockInventory} from "@/api/inventoryManagement/stockInventory.js";
-import {subtractStockUnInventory} from "@/api/inventoryManagement/stockUninventory.js";
+import {addStockOutRecordOnly} from "@/api/inventoryManagement/stockInventory.js";
+import {addUnqualifiedStockOutRecordOnly} from "@/api/inventoryManagement/stockUninventory.js";
const props = defineProps({
visible: {
@@ -106,14 +106,12 @@
})
const maxQuality = computed(() => {
- let max = 0;
if (formState.value.type === 'qualified') {
- max = props.record.qualifiedUnLockedQuantity ? props.record.qualifiedUnLockedQuantity : 0;
+ // 鍚堟牸鍙嚭 = 鏈喕缁撻噺 + 寰呭鏍稿嚭搴撻噺锛堝嵆宸茬敵璇蜂絾灏氭湭瀹℃壒鐨勬暟閲忥級
+ return Math.max(1, Number(props.record.qualifiedUnLockedQuantity || 0) + Number(props.record.qualifiedPendingOutQuantity || 0));
} else {
- max = props.record.unQualifiedUnLockedQuantity ? props.record.unQualifiedUnLockedQuantity : 0;
+ return Math.max(1, Number(props.record.unQualifiedUnLockedQuantity || 0) + Number(props.record.unQualifiedPendingOutQuantity || 0));
}
- // 纭繚 max 鑷冲皯涓� 1锛岄伩鍏� min > max 鐨勯敊璇�
- return Math.max(max, 1);
})
const handleTypeChange = () => {
@@ -192,7 +190,7 @@
return;
}
if (formState.value.type === 'qualified') {
- subtractStockInventory(formState.value).then(res => {
+ addStockOutRecordOnly(formState.value).then(res => {
// 鍏抽棴妯℃�佹
isShow.value = false;
// 鍛婄煡鐖剁粍浠跺凡瀹屾垚
@@ -200,7 +198,7 @@
proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
})
} else {
- subtractStockUnInventory(formState.value).then(res => {
+ addUnqualifiedStockOutRecordOnly(formState.value).then(res => {
// 鍏抽棴妯℃�佹
isShow.value = false;
// 鍛婄煡鐖剁粍浠跺凡瀹屾垚
--
Gitblit v1.9.3