diff --git a/src/views/Department-entry/Drawer-Template.vue b/src/views/Department-entry/Drawer-Template.vue index a136e0b..15e8754 100644 --- a/src/views/Department-entry/Drawer-Template.vue +++ b/src/views/Department-entry/Drawer-Template.vue @@ -25,8 +25,8 @@ class="!w-160px" /> - - + + @@ -37,12 +37,12 @@ - - + + - + 搜索 重置 @@ -63,8 +63,8 @@ @row-click="handleRowClick" :header-cell-style="{ background: 'rgb(235, 241, 250)', height: '56px', color: '#333333' }" > - - + + @@ -158,6 +158,9 @@ const visible = computed({ watch(visible, (newVal) => { if (newVal) { Type.value = props.templateType + // 清除模板名称和部位的输入框内容 + queryParams.contentName = undefined + queryParams.category = undefined getList() getCategoryOptions() // 获取所有模板类别 } @@ -166,7 +169,15 @@ watch(visible, (newVal) => { /** 获取所有模板类别 */ const getCategoryOptions = async () => { try { - const categories = await TemplateApi.getAllCategories() + let categories; + if (Type.value = '汇总') { + // 如果是汇总标签页,调用getCategory接口但不传递类型参数 + categories = await TemplateApi.getAllCategories() + } else { + // 否则按模板类型获取相应的部位 + categories = await TemplateApi.getCategory(Type.value) + } + categoryOptions.value = categories.map(category => ({ label: category, value: category diff --git a/src/views/inspect/inspecttemplate/TemplateForm.vue b/src/views/inspect/inspecttemplate/TemplateForm.vue index a92e682..f63f8ec 100644 --- a/src/views/inspect/inspecttemplate/TemplateForm.vue +++ b/src/views/inspect/inspecttemplate/TemplateForm.vue @@ -7,8 +7,8 @@ label-width="100px" v-loading="formLoading" > - - + + @@ -19,12 +19,20 @@ - - - + + + - + @@ -34,17 +42,16 @@ - + - -