diff --git a/src/views/materials/materialsInventory/index.vue b/src/views/materials/materialsInventory/index.vue index dc7b9ec..5cba59e 100644 --- a/src/views/materials/materialsInventory/index.vue +++ b/src/views/materials/materialsInventory/index.vue @@ -1,16 +1,20 @@ --> - + @@ -109,7 +130,8 @@ - + @@ -154,7 +176,9 @@ import { } from '@/api/materials/materialsInventory'; import { MaterialsInventoryForm, MaterialsInventoryQuery, MaterialsInventoryVO } from '@/api/materials/materialsInventory/types'; import { useUserStoreHook } from '@/store/modules/user'; - +import { + listMaterialsUseRecord, +} from '@/api/materials/materialsUseRecord'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { out_put_type } = toRefs(proxy?.useDict('out_put_type')); @@ -170,7 +194,9 @@ const ids = ref>([]); const single = ref(true); const multiple = ref(true); const total = ref(0); - +const loadingChild = ref(true); +const totalChild = ref(0); +const materialsUseRecordList = ref([]); const queryFormRef = ref(); const materialsInventoryFormRef = ref(); @@ -194,7 +220,7 @@ const initFormData: MaterialsInventoryForm = { shipper: undefined, remark: undefined }; -const data = reactive>({ +const data = reactive({ form: { ...initFormData }, queryParams: { pageNum: 1, @@ -212,14 +238,38 @@ const data = reactive> shipper: undefined, params: {} }, + queryParamsChild: { + pageNum: 1, + pageSize: 10, + inventoryId: undefined, + usePart: undefined, + useNumber: undefined, + residueNumber: undefined + }, rules: { id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }], materialsId: [{ required: true, message: '材料id不能为空', trigger: 'blur' }] } }); -const { queryParams, form, rules } = toRefs(data); +const { queryParams, form, rules, queryParamsChild } = toRefs(data); const materialsOptions = ref([]); +/** 处理外层表格展开/折叠:记录当前展开行的inventoryId */ +const handleExpandChange = (row: any) => { + queryParamsChild.value.inventoryId = row.id; + getListChild(); +}; +/** 查询材料子级登记列表(内层列表) */ +const getListChild = async () => { + loadingChild.value = true; + try { + const res = await listMaterialsUseRecord(queryParamsChild.value); + materialsUseRecordList.value = res.rows; + totalChild.value = res.total; + } finally { + loadingChild.value = false; + } +}; /** 查询材料出/入库列表 */ const getList = async () => { diff --git a/src/views/materials/materialsUseRecord/index.vue b/src/views/materials/materialsUseRecord/index.vue index c4a7866..18c0679 100644 --- a/src/views/materials/materialsUseRecord/index.vue +++ b/src/views/materials/materialsUseRecord/index.vue @@ -1,6 +1,7 @@