@@ -68,8 +67,18 @@
-
-
+
+
@@ -227,7 +236,7 @@ import {
importMaterialsExcel,
exportMaterialsExcel
} from '@/api/material'
-import { fetchSubcategories } from '@/api/category'
+import { fetchCategories, fetchSubcategories } from '@/api/category'
import { fetchBrands } from '@/api/brand'
import { fetchFactories } from '@/api/factory'
import MaterialForm from '@/views/material/MaterialForm.vue'
@@ -275,7 +284,7 @@ const filters = reactive({
})
const advancedKeys = [
- 'major_category', 'material_category', 'stage', 'importance_level',
+ 'brand', 'stage', 'importance_level',
'factory', 'factory__cooperation_mode', 'landing_project',
'cost_compare__gte', 'cost_compare__lte', 'score_level__gte',
'contact_person', 'handler',
@@ -299,6 +308,7 @@ const importanceLevelOptions = ref([])
const cooperationModeOptions = ref([])
const applicationSceneChoices = ref([])
const advantageChoices = ref([])
+const filterCategoryOptions = ref([])
const filterSubcategoryOptions = ref([])
// 列显隐
@@ -410,6 +420,15 @@ const loadChoices = async () => {
advantageChoices.value = data.advantage || []
}
+const loadFilterCategories = async () => {
+ const data = await fetchCategories()
+ filterCategoryOptions.value = (data.results || data).map((item) => ({
+ id: item.id,
+ name: item.name,
+ value: item.value
+ }))
+}
+
const loadFilterSubcategories = async () => {
const data = await fetchSubcategories({})
filterSubcategoryOptions.value = (data.results || data).map((item) => ({
@@ -607,6 +626,7 @@ const onPageSizeChange = (size) => {
onMounted(() => {
loadChoices()
+ loadFilterCategories()
loadFilterSubcategories()
loadBrandFilterOptions()
loadFactoryFilterOptions()
diff --git a/frontend/src/views/material/materialColumns.js b/frontend/src/views/material/materialColumns.js
index 4b67a4b..330b5ba 100644
--- a/frontend/src/views/material/materialColumns.js
+++ b/frontend/src/views/material/materialColumns.js
@@ -10,7 +10,7 @@ export const MATERIAL_COLUMNS = [
// ==== A. 材料信息 ====
{ group: 'material', key: 'name', label: '材料名称', minWidth: 180, showOverflowTooltip: true },
{ group: 'material', key: 'major_category_display', label: '材料大类', width: 100 },
- { group: 'material', key: 'material_category', label: '细分种类', minWidth: 140, showOverflowTooltip: true },
+ { group: 'material', key: 'material_category', label: '材料种类', minWidth: 140, showOverflowTooltip: true },
{ group: 'material', key: 'material_subcategory', label: '材料子类', minWidth: 140, showOverflowTooltip: true },
{ group: 'material', key: 'stage_display', label: '阶段', width: 130, showOverflowTooltip: true },
{ group: 'material', key: 'importance_level_display', label: '重要等级', width: 110 },