diff --git a/src/api/workflow/seal/types.ts b/src/api/workflow/seal/types.ts index fbbff4d..3aa5113 100644 --- a/src/api/workflow/seal/types.ts +++ b/src/api/workflow/seal/types.ts @@ -80,6 +80,11 @@ export interface SealVO { */ takeOutAddress?: string; + /** + * 公章名称 + */ + sealInfos?: Array; + } export interface SealForm extends BaseEntity { @@ -131,7 +136,12 @@ export interface SealForm extends BaseEntity { /** * 公章名称 */ - sealName?: string | number; + sealNames?: string; + + /** + * 公章名称 + */ + sealInfos?: Array; /** * 文件名称 @@ -244,5 +254,18 @@ export interface SealQuery extends PageQuery { } +export interface SealInfo extends BaseEntity { + /** + * 公章id + */ + sealId?: string | number; + + /** + * 公章id + */ + sealName?: string | number; + +} + diff --git a/src/components/SealSearchDialog/index.vue b/src/components/SealSearchDialog/index.vue index 31f5249..21cb6d9 100644 --- a/src/components/SealSearchDialog/index.vue +++ b/src/components/SealSearchDialog/index.vue @@ -6,12 +6,12 @@ width="60%" > - + - + - + 查询 @@ -27,15 +27,17 @@ ref="multipleTable" > - - - - - + + + + + + + @@ -72,7 +74,10 @@ const props = defineProps({ }); const { proxy } = getCurrentInstance() as ComponentInternalInstance; const emit = defineEmits(['update:visible', 'confirm']); - +const loading = ref(true); +import { listMaterialSeal } from '@/api/operate/materialSeal'; +import { MaterialSealVO, MaterialSealQuery, MaterialSealForm } from '@/api/operate/materialSeal/types'; +const { opr_seal_type ,opr_yes_no} = toRefs(proxy?.useDict('opr_seal_type','opr_yes_no')); // 表单数据 const dialogVisible = computed({ get: () => props.visible, @@ -99,19 +104,33 @@ const handleSelectionChange = (val) => { selectedRows.value = val; }; +const data = reactive>({ + form: { + }, + queryParams: { + pageNum: 1, + pageSize: 10 + // , + // startSealDays: undefined, + // endSealDays: undefined + }, + rules: {} +}); + +const { queryParams } = toRefs(data); + // 模拟 API 请求(替换为实际接口) -const fetchData = async () => { - const mockData = [ - { id: '1', name: '公章A', code: 'GA001', status: '1' }, - { id: '2', name: '公章B', code: 'GA002', status: '0' }, - ]; - tableData.value = mockData; - total.value = mockData.length; +const getList = async () => { +loading.value = true; + const res = await listMaterialSeal(queryParams.value); + tableData.value = res.rows; + total.value = res.total; + loading.value = false; }; // 查询列表数据 const handleSearchList = () => { - fetchData(); + getList(); }; // 重置搜索条件 @@ -121,7 +140,7 @@ const resetSearchForm = () => { code: '', }; currentPage.value = 1; - fetchData(); + getList(); }; // 点击确认按钮 @@ -130,15 +149,31 @@ const handleConfirm = () => { proxy?.$modal.msgError('请至少选择一项!'); return; } - emit('confirm', selectedRows.value.map(row => row.id)); // 返回选中的 ID 数组 + // 合并为对象数组 + const selectedItems = selectedRows.value.map(row => ({ + id: row.id, + name: row.sealName + })); + + emit('confirm', selectedItems); dialogVisible.value = false; }; // 分页切换 const handlePageChange = (page) => { currentPage.value = page; - fetchData(); + getList(); }; +// 监听弹窗打开事件,自动查询数据 +watch( + () => props.visible, + (newVal) => { + if (newVal) { + getList(); + } + }, + { immediate: true } // 立即执行一次,确保初始加载时也查询 +);