diff --git a/inventory-web/src/views/material/buyOdoo.vue b/inventory-web/src/views/material/buyOdoo.vue
index 7a5d556..49931e7 100644
--- a/inventory-web/src/views/material/buyOdoo.vue
+++ b/inventory-web/src/views/material/buyOdoo.vue
@@ -546,7 +546,8 @@
v-model="form.productImageRemark"
type="textarea"
:rows="1"
- placeholder="请输入产品图备注信息"
+ :disabled="!canEditRemark"
+ :placeholder="canEditRemark ? '请输入产品图备注信息' : '无编辑权限,仅可查看'"
style="margin-top: 8px;"
clearable
/>
@@ -600,7 +601,8 @@
v-model="form.manualLinkRemark"
type="textarea"
:rows="1"
- placeholder="请输入说明书备注信息"
+ :disabled="!canEditRemark"
+ :placeholder="canEditRemark ? '请输入说明书备注信息' : '无编辑权限,仅可查看'"
style="margin-top: 8px;"
clearable
/>
@@ -742,6 +744,16 @@ import { imageSearch as imageSearchApi, type ImageSearchItem } from '@/api/commo
const userStore = useUserStore();
const isSuperAdmin = computed(() => userStore.role === 'SUPER_ADMIN');
+// ★ 附件备注(产品图备注 / 说明书备注)的**写**权限,与读权限分离。
+// 与 list.vue、后端 base.py 三处同口径:
+// 读 → material_list:files (区块整体可见,6 个角色)
+// 写 → material_list:remark_edit (3 个核心管理角色)
+// 无写权限时输入框置灰但仍可见 —— 读权限决定可见性。
+const canEditRemark = computed(() => {
+ if (userStore.role === 'SUPER_ADMIN' || userStore.username === 'IRIS') return true;
+ return userStore.hasPermission('material_list:remark_edit');
+});
+
// --- 类型定义 ---
interface MaterialBaseVO {
id: number;
diff --git a/inventory-web/src/views/material/list.vue b/inventory-web/src/views/material/list.vue
index 83253cb..d5d358d 100644
--- a/inventory-web/src/views/material/list.vue
+++ b/inventory-web/src/views/material/list.vue
@@ -549,11 +549,16 @@
拍照
+
@@ -607,7 +612,8 @@
v-model="form.manualLinkRemark"
type="textarea"
:rows="1"
- placeholder="请输入说明书备注信息"
+ :disabled="!canEditRemark"
+ :placeholder="canEditRemark ? '请输入说明书备注信息' : '无编辑权限,仅可查看'"
style="margin-top: 8px;"
clearable
/>
@@ -1078,6 +1084,17 @@ const hasFieldPermission = (field: string) => {
return userStore.hasPermission(code);
};
+// ★ 附件备注(产品图备注 / 说明书备注)的**写**权限,与读权限分离。
+// 两端必须与后端同口径:
+// 读 → material_list:files (本区块整体可见,6 个角色)
+// 写 → material_list:remark_edit (后端 base.py 的 field_to_perm 同码,3 个角色)
+// 后端对无写权限者会**丢弃**该字段(而非写成空值),故前端置灰后
+// 既不会误提交,也不会误清既有内容。
+const canEditRemark = computed(() => {
+ if (userStore.role === 'SUPER_ADMIN' || userStore.username === 'IRIS') return true;
+ return userStore.hasPermission('material_list:remark_edit');
+});
+
// 表单全局禁用:没有 material_list:operation 权限时,所有表单字段不可编辑
const formDisabled = computed(() => {
if (userStore.role === 'SUPER_ADMIN' || userStore.username === 'IRIS') return false;