diff --git a/inventory-web/src/api/material_base.ts b/inventory-web/src/api/material_base.ts
index 4f315a1..3565b8e 100644
--- a/inventory-web/src/api/material_base.ts
+++ b/inventory-web/src/api/material_base.ts
@@ -71,6 +71,15 @@ export function batchSetInspection(data: { ids: number[], isInspectionRequired:
})
}
+// 6.1 批量设置“出库/借库需审批”
+export function batchSetApprovalRequired(data: { ids: number[], isApprovalRequired: boolean }) {
+ return request({
+ url: '/inbound/base/batch-approval',
+ method: 'post',
+ data
+ })
+}
+
// 7. 获取智能分组规格最大连号
export function getLatestSpecs() {
return request({
diff --git a/inventory-web/src/views/material/list.vue b/inventory-web/src/views/material/list.vue
index 284e60d..fc3b706 100644
--- a/inventory-web/src/views/material/list.vue
+++ b/inventory-web/src/views/material/list.vue
@@ -328,6 +328,15 @@
+
+
+ toggleApprovalRequired(scope.row, val)"
+ />
+
+
{{ scope.row.referencePrice?.toFixed(2) }}
@@ -729,6 +738,7 @@ import {
exportAssetStatistics,
batchSetWarning,
batchSetInspection,
+ batchSetApprovalRequired,
markWarningOrdered,
getMaterialUnitsAPI
} from '@/api/material_base';
@@ -958,6 +968,7 @@ const columns = reactive({
files: { visible: true },
isEnabled: { visible: true },
isInspectionRequired: { visible: true },
+ isApprovalRequired: { visible: true },
referencePrice: { visible: true },
warningStatus: { visible: true }
});
@@ -977,6 +988,7 @@ const permissionMap: Record = {
files: 'material_list:files',
isEnabled: 'material_list:isEnabled',
isInspectionRequired: 'material_list:operation',
+ isApprovalRequired: 'material_list:operation',
referencePrice: 'material_list:referencePrice',
warningStatus: 'material_list:view_warning'
};
@@ -1747,6 +1759,20 @@ const submitBatchInspection = async () => {
}
};
+// 单行切换“出库/借库需审批”
+const toggleApprovalRequired = async (row: any, val: boolean) => {
+ if (!row || !row.id) return;
+ const prev = !!row.isApprovalRequired;
+ row.isApprovalRequired = val; // 乐观更新
+ try {
+ await batchSetApprovalRequired({ ids: [row.id], isApprovalRequired: val });
+ ElMessage.success(val ? '已标记:该物料出库/借库需审批' : '已取消:该物料出库/借库免审批');
+ } catch (error: any) {
+ row.isApprovalRequired = prev;
+ ElMessage.error(error?.msg || '设置失败');
+ }
+};
+
// 表格行样式(根据预警状态)
const tableRowClassName = ({ row }: { row: MaterialBaseVO }) => {
if (row.warningStatus === 2) {