fix(sign): 补齐模板查询院区参数
This commit is contained in:
@@ -23,6 +23,7 @@ import type {
|
||||
|
||||
export interface UseSigningTaskFormOptions {
|
||||
campus: MaybeRefOrGetter<WorkbenchCampus>
|
||||
campusId: MaybeRefOrGetter<string>
|
||||
initialTemplate?: MaybeRefOrGetter<SigningTemplate | null | undefined>
|
||||
}
|
||||
|
||||
@@ -85,6 +86,7 @@ export function useSigningTaskForm(options: UseSigningTaskFormOptions) {
|
||||
/** 左列选中的科室与分类(原型 ntDeptSel / ntCatSel) */
|
||||
const selectedDepartment = ref('')
|
||||
const selectedCategory = ref('')
|
||||
let loadedTemplateCampusId = ''
|
||||
|
||||
const errors = reactive({
|
||||
patient: '',
|
||||
@@ -382,11 +384,26 @@ export function useSigningTaskForm(options: UseSigningTaskFormOptions) {
|
||||
}
|
||||
|
||||
async function loadTemplates() {
|
||||
if (!templates.value.length) {
|
||||
const campusId = toValue(options.campusId)
|
||||
if (!campusId) {
|
||||
templates.value = []
|
||||
loadedTemplateCampusId = ''
|
||||
ElMessage.error('请先选择院区,再加载文书模板')
|
||||
return
|
||||
}
|
||||
|
||||
if (loadedTemplateCampusId !== campusId) {
|
||||
if (loadedTemplateCampusId) {
|
||||
selectedTemplateId.value = ''
|
||||
selectedDepartment.value = ''
|
||||
selectedCategory.value = ''
|
||||
}
|
||||
|
||||
loadingTemplates.value = true
|
||||
|
||||
try {
|
||||
templates.value = await getSigningTemplates()
|
||||
templates.value = await getSigningTemplates({ campusId })
|
||||
loadedTemplateCampusId = campusId
|
||||
} catch {
|
||||
ElMessage.error('文档模板加载失败,请稍后重试')
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user