diff --git a/src/api/oa/erp/projectInfo/index.ts b/src/api/oa/erp/projectInfo/index.ts
index 3c68c65..6676c7b 100644
--- a/src/api/oa/erp/projectInfo/index.ts
+++ b/src/api/oa/erp/projectInfo/index.ts
@@ -86,3 +86,6 @@ export function getErpProjectInfoList(query) {
params: query
});
}
+
+
+
diff --git a/src/api/wms/outStockDetails/index.ts b/src/api/wms/outStockDetails/index.ts
index 45f5372..6f9fc8c 100644
--- a/src/api/wms/outStockDetails/index.ts
+++ b/src/api/wms/outStockDetails/index.ts
@@ -74,3 +74,11 @@ export function getWmsOutStockDetailsList(query) {
params: query
});
}
+
+export function countUnOutStockDetails(query) {
+ return request({
+ url: '/wms/outStockDetails/countUnOutStockDetails',
+ method: 'get',
+ params: query
+ });
+}
diff --git a/src/components/WmsInventorySelect/index.vue b/src/components/WmsInventorySelect/index.vue
index b3df78a..2dbc3ac 100644
--- a/src/components/WmsInventorySelect/index.vue
+++ b/src/components/WmsInventorySelect/index.vue
@@ -81,6 +81,11 @@
+
+
+ {{ row.lockedAmount || 0 }}
+
+
@@ -111,6 +116,7 @@ import { VxeTableInstance } from 'vxe-table';
import useDialog from '@/hooks/useDialog';
import { computed, getCurrentInstance, nextTick, ref, watch } from 'vue';
import { getErpProjectInfoList } from '@/api/oa/erp/projectInfo';
+import { countUnOutStockDetails } from '@/api/wms/outStockDetails';
interface PropType {
modelValue?: InventoryDetailsVO[] | InventoryDetailsVO | undefined;
@@ -184,6 +190,18 @@ const getList = async () => {
try {
const res = await listInventoryDetails(queryParams.value);
inventoryDetailsList.value = res.rows;
+ // 查询每个物料的锁定库存数量
+ for (const item of inventoryDetailsList.value) {
+ try {
+ const lockRes = await countUnOutStockDetails({
+ inventoryDetailsId: item.inventoryDetailsId
+ });
+ item.lockedAmount = lockRes.data?.outStockAmount || 0;
+ } catch (error) {
+ console.error('查询锁定库存失败:', error);
+ item.lockedAmount = 0;
+ }
+ }
total.value = res.total;
} catch (error) {
console.error('查询库存明细列表失败:', error);
diff --git a/src/views/wms/outStockBill/index.vue b/src/views/wms/outStockBill/index.vue
index 06a2579..9ff65bb 100644
--- a/src/views/wms/outStockBill/index.vue
+++ b/src/views/wms/outStockBill/index.vue
@@ -81,7 +81,9 @@
+
+
+
+ {{ scope.row.lockedAmount || 0 }}
+
+
{
outStockBillList.value = res.rows;
total.value = res.total;
loading.value = false;
+ closeChildTable();
};
/** 取消按钮 */
@@ -695,7 +703,7 @@ const handleDelete = async (row?: OutStockBillVO) => {
return;
}
const _outStockBillIds = row?.outStockBillId || ids.value;
- await proxy?.$modal.confirm('是否确认删除出库单编号为"' + _outStockBillIds + '"的数据项?').finally(() => (loading.value = false));
+ await proxy?.$modal.confirm('是否确认删除出库单编号为"' + row?.outStockCode + '"的数据项?').finally(() => (loading.value = false));
await delOutStockBill(_outStockBillIds);
proxy?.$modal.msgSuccess('删除成功');
await getList();
@@ -703,7 +711,7 @@ const handleDelete = async (row?: OutStockBillVO) => {
/** 发货操作 */
const handleDeliver = async (row?: OutStockBillVO) => {
if (row.outStockBillStatus !== '0') {
- ElMessage.warning('不符合发货条件');
+ ElMessage.warning('不符合出库条件');
return;
}
try {
@@ -728,7 +736,16 @@ const handleExport = () => {
`outStockBill_${new Date().getTime()}.xlsx`
);
};
-
+// 添加表格引用
+const outStockTableRef = ref();
+// 关闭所有展开的子表
+const closeChildTable = () => {
+ if (outStockTableRef.value) {
+ outStockTableRef.value.store.states.expandRows.value.forEach((row) => {
+ outStockTableRef.value.toggleRowExpansion(row, false);
+ });
+ }
+};
onMounted(() => {
getList();
// 初始化下拉框数据