diff --git a/plus-ui/src/api/machinery/machineryDetail/types.ts b/plus-ui/src/api/machinery/machineryDetail/types.ts index 79811170..6383ef37 100644 --- a/plus-ui/src/api/machinery/machineryDetail/types.ts +++ b/plus-ui/src/api/machinery/machineryDetail/types.ts @@ -48,7 +48,6 @@ export interface MachineryDetailVO { * 机械主键id */ machineryId: string | number; - } export interface MachineryDetailForm extends BaseEntity { @@ -101,11 +100,9 @@ export interface MachineryDetailForm extends BaseEntity { * 机械主键id */ machineryId?: string | number; - } -export interface MachineryDetailQuery extends PageQuery { - +export interface MachineryDetailQuery extends PageRequest { /** * 检验证编号 */ @@ -146,11 +143,8 @@ export interface MachineryDetailQuery extends PageQuery { */ machineryId?: string | number; - /** - * 日期范围参数 - */ - params?: any; + /** + * 日期范围参数 + */ + params?: any; } - - - diff --git a/plus-ui/src/views/machinery/component/MachineryDetailAddDialog.vue b/plus-ui/src/views/machinery/component/MachineryDetailAddDialog.vue new file mode 100644 index 00000000..88b0a478 --- /dev/null +++ b/plus-ui/src/views/machinery/component/MachineryDetailAddDialog.vue @@ -0,0 +1,113 @@ + + diff --git a/plus-ui/src/views/machinery/component/MachineryDetailTable.vue b/plus-ui/src/views/machinery/component/MachineryDetailTable.vue new file mode 100644 index 00000000..5efe79ca --- /dev/null +++ b/plus-ui/src/views/machinery/component/MachineryDetailTable.vue @@ -0,0 +1,186 @@ + + + diff --git a/plus-ui/src/views/machinery/index.vue b/plus-ui/src/views/machinery/index.vue index ede377c3..1de8b708 100644 --- a/plus-ui/src/views/machinery/index.vue +++ b/plus-ui/src/views/machinery/index.vue @@ -7,9 +7,6 @@ - - - @@ -29,13 +26,13 @@ 新增 - 修改 + + 修改 - 删除 + + 删除 @@ -45,7 +42,19 @@ - + + + + @@ -55,12 +64,13 @@ @@ -93,6 +103,7 @@ + @@ -101,6 +112,8 @@ import { addMachinery, delMachinery, getMachinery, listMachinery, updateMachiner import { MachineryForm, MachineryQuery, MachineryVO } from '@/api/machinery/machinery/types'; import { useUserStoreHook } from '@/store/modules/user'; +import MachineryDetailTable from '@/views/machinery/component/MachineryDetailTable.vue'; +import MachineryDetailAddDialog from '@/views/machinery/component/MachineryDetailAddDialog.vue'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -247,6 +260,29 @@ const handleExport = () => { ); }; +// 存储当前展开行的 key 数组(只允许一个展开) +const expandedRowKeys = ref([]); +// row-key 函数:返回每一行的唯一标识 +const getRowKey = (row: any) => row.id; +/** 展开选中数据 */ +const handleExpandChange = async (selection: MachineryVO, expanded: any) => { + if (expanded) { + // 展开当前行时,将其他展开行关闭,只保留当前行 id + expandedRowKeys.value = [selection.id]; + } else { + // 收起当前行时,从 expandedRowKeys 中移除 + expandedRowKeys.value = expandedRowKeys.value.filter((key) => key !== selection.id); + } +}; + +const dialogRef = ref(); +const currentMachineryId = ref(0); +/** 添加机械出入场详情 */ +const handleAddMachineryDetail = (row?: MachineryVO) => { + currentMachineryId.value = row.id ?? 0; + dialogRef.value.openDialog(); +}; + onMounted(() => { getList(); }); diff --git a/plus-ui/src/views/machinery/machineryDetail/index.vue b/plus-ui/src/views/machinery/machineryDetail/index.vue deleted file mode 100644 index 178a0398..00000000 --- a/plus-ui/src/views/machinery/machineryDetail/index.vue +++ /dev/null @@ -1,281 +0,0 @@ - - - diff --git a/plus-ui/src/views/materials/materials/component/MaterialsInventoryAddDialog.vue b/plus-ui/src/views/materials/materials/component/MaterialsInventoryAddDialog.vue index e6f2bc8e..8eeac26d 100644 --- a/plus-ui/src/views/materials/materials/component/MaterialsInventoryAddDialog.vue +++ b/plus-ui/src/views/materials/materials/component/MaterialsInventoryAddDialog.vue @@ -2,7 +2,7 @@ - + @@ -66,7 +66,7 @@ const loading = ref(false); const form = reactive({ materialsId: props.materialsId, projectId: props.projectId, - outPut: '0', + outPut: undefined, number: 1, outPutTime: '', residue: '',