处方增加禁用修改

This commit is contained in:
2026-06-04 15:11:16 +08:00
parent cdf8b1f76d
commit 123e9075dd
9 changed files with 342 additions and 34 deletions
+27 -1
View File
@@ -71,6 +71,13 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="禁用修改" min-width="100">
<template #default="{ row }">
<el-tag :type="row.disable_edit ? 'danger' : 'info'">
{{ row.disable_edit ? '已禁用' : '可修改' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="创建人" prop="creator_name" min-width="100" />
<el-table-column label="创建时间" prop="create_time" min-width="160" />
<el-table-column label="操作" width="180" fixed="right">
@@ -193,6 +200,21 @@
勾选后所有医生都可以查看和使用此处方模板
</div>
</el-form-item>
<el-form-item label="禁用修改" prop="disable_edit">
<div class="flex flex-col gap-1 leading-none">
<el-switch
v-model="editForm.disable_edit"
:active-value="1"
:inactive-value="0"
active-text="开启"
inactive-text="关闭"
/>
<div class="text-xs text-gray-400 leading-relaxed">
开启后导入此模板到处方时将锁定整张处方的药材不可增删改只能再次导入覆盖
</div>
</div>
</el-form-item>
</el-form>
<template #footer v-if="editMode !== 'view'">
@@ -236,7 +258,8 @@ const editForm = reactive({
prescription_name: '',
formula_type: '主方',
herbs: [] as Array<{ name: string; dosage: number }>,
is_public: 0
is_public: 0,
disable_edit: 0
})
// 表单验证规则
@@ -293,6 +316,7 @@ const resetForm = () => {
editForm.formula_type = '主方'
editForm.herbs = []
editForm.is_public = 0
editForm.disable_edit = 0
}
// 新增处方
@@ -310,6 +334,7 @@ const handleView = (row: any) => {
editForm.formula_type = row.formula_type || '主方'
editForm.herbs = row.herbs ? JSON.parse(JSON.stringify(row.herbs)) : []
editForm.is_public = row.is_public ?? 0
editForm.disable_edit = row.disable_edit ?? 0
showEdit.value = true
}
@@ -321,6 +346,7 @@ const handleEdit = (row: any) => {
editForm.formula_type = row.formula_type || '主方'
editForm.herbs = row.herbs ? JSON.parse(JSON.stringify(row.herbs)) : []
editForm.is_public = row.is_public ?? 0
editForm.disable_edit = row.disable_edit ?? 0
showEdit.value = true
}