This commit is contained in:
123 2025-05-16 18:31:47 +08:00
parent 4ac4448649
commit 50a01dd9e5
4 changed files with 104 additions and 32 deletions

View File

@ -80,6 +80,11 @@ export interface SealVO {
*/ */
takeOutAddress?: string; takeOutAddress?: string;
/**
*
*/
sealInfos?: Array<SealInfo>;
} }
export interface SealForm extends BaseEntity { export interface SealForm extends BaseEntity {
@ -131,7 +136,12 @@ export interface SealForm extends BaseEntity {
/** /**
* *
*/ */
sealName?: string | number; sealNames?: string;
/**
*
*/
sealInfos?: Array<object>;
/** /**
* *
@ -244,5 +254,18 @@ export interface SealQuery extends PageQuery {
} }
export interface SealInfo extends BaseEntity {
/**
* id
*/
sealId?: string | number;
/**
* id
*/
sealName?: string | number;
}

View File

@ -6,12 +6,12 @@
width="60%" width="60%"
> >
<!-- 搜索条件 --> <!-- 搜索条件 -->
<el-form :inline="true" :model="searchForm" class="demo-form-inline"> <el-form :inline="true" :model="queryParams" class="demo-form-inline">
<el-form-item label="公章名称"> <el-form-item label="公章名称">
<el-input v-model="searchForm.name" placeholder="请输入公章名称" /> <el-input v-model="queryParams.name" placeholder="请输入公章名称" />
</el-form-item> </el-form-item>
<el-form-item label="公章编号"> <el-form-item label="公章编号">
<el-input v-model="searchForm.code" placeholder="请输入公章编号" /> <el-input v-model="queryParams.code" placeholder="请输入公章编号" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleSearchList">查询</el-button> <el-button type="primary" @click="handleSearchList">查询</el-button>
@ -27,14 +27,16 @@
ref="multipleTable" ref="multipleTable"
> >
<el-table-column type="selection" width="55" /> <!-- 勾选列 --> <el-table-column type="selection" width="55" /> <!-- 勾选列 -->
<el-table-column prop="id" label="ID" width="80" /> <!-- <el-table-column prop="id" label="ID" width="80" /> -->
<el-table-column prop="name" label="公章名称" /> <el-table-column prop="sealName" label="公章名称" />
<el-table-column prop="code" label="公章编号" /> <el-table-column prop="sealType" label="公章类型" >
<el-table-column prop="status" label="状态"> <template #default="scope">
<template #default="{ row }"> <dict-tag :options="opr_seal_type" :value="scope.row.sealType" />
<el-tag :type="row.status === '1' ? 'success' : 'danger'"> </template>
{{ row.status === '1' ? '启用' : '禁用' }} </el-table-column>
</el-tag> <el-table-column prop="status" label="是否启用">
<template #default="scope">
<dict-tag :options="opr_yes_no" :value="scope.row.sealType" />
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -72,7 +74,10 @@ const props = defineProps({
}); });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const emit = defineEmits(['update:visible', 'confirm']); 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<any>(proxy?.useDict('opr_seal_type','opr_yes_no'));
// //
const dialogVisible = computed({ const dialogVisible = computed({
get: () => props.visible, get: () => props.visible,
@ -99,19 +104,33 @@ const handleSelectionChange = (val) => {
selectedRows.value = val; selectedRows.value = val;
}; };
const data = reactive<PageData<MaterialSealForm, MaterialSealQuery>>({
form: {
},
queryParams: {
pageNum: 1,
pageSize: 10
// ,
// startSealDays: undefined,
// endSealDays: undefined
},
rules: {}
});
const { queryParams } = toRefs(data);
// API // API
const fetchData = async () => { const getList = async () => {
const mockData = [ loading.value = true;
{ id: '1', name: '公章A', code: 'GA001', status: '1' }, const res = await listMaterialSeal(queryParams.value);
{ id: '2', name: '公章B', code: 'GA002', status: '0' }, tableData.value = res.rows;
]; total.value = res.total;
tableData.value = mockData; loading.value = false;
total.value = mockData.length;
}; };
// //
const handleSearchList = () => { const handleSearchList = () => {
fetchData(); getList();
}; };
// //
@ -121,7 +140,7 @@ const resetSearchForm = () => {
code: '', code: '',
}; };
currentPage.value = 1; currentPage.value = 1;
fetchData(); getList();
}; };
// //
@ -130,15 +149,31 @@ const handleConfirm = () => {
proxy?.$modal.msgError('请至少选择一项!'); proxy?.$modal.msgError('请至少选择一项!');
return; 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; dialogVisible.value = false;
}; };
// //
const handlePageChange = (page) => { const handlePageChange = (page) => {
currentPage.value = page; currentPage.value = page;
fetchData(); getList();
}; };
//
watch(
() => props.visible,
(newVal) => {
if (newVal) {
getList();
}
},
{ immediate: true } //
);
</script> </script>
<style scoped> <style scoped>

View File

@ -135,7 +135,9 @@ const { business_type , opr_yes_no , opr_seal_type } = toRefs<any>(proxy?.useDic
const queryFormRef = ref<ElFormInstance>(); const queryFormRef = ref<ElFormInstance>();
const data = reactive<PageData<SealForm, SealQuery>>({ const data = reactive<PageData<SealForm, SealQuery>>({
form: {}, form: {
sealIds:undefined
},
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10

View File

@ -34,8 +34,8 @@
:default-time="new Date()" :default-time="new Date()"
/> />
</el-form-item> </el-form-item>
<el-form-item label="企业公章" prop="sealId"> <el-form-item label="企业公章" prop="sealIds">
<el-input v-model="form.sealIds" type="text" placeholder="请输入企业公章" style="width: 220px;margin-right: 8px;" readonly/> <el-input v-model="form.sealNames" type="text" placeholder="请输入企业公章" style="width: 220px;margin-right: 8px;" readonly/>
<el-button type="primary" @click="openSealDialog">搜索</el-button> <el-button type="primary" @click="openSealDialog">搜索</el-button>
<!-- icon="el-icon-search" --> <!-- icon="el-icon-search" -->
<!-- 引入独立的 SealSearchDialog 组件 --> <!-- 引入独立的 SealSearchDialog 组件 -->
@ -78,6 +78,11 @@
</el-form-item> </el-form-item>
<el-form-item label="附件" prop="attachment"> <el-form-item label="附件" prop="attachment">
<imageUpload v-model="form.attachment" /> <imageUpload v-model="form.attachment" />
</el-form-item>
<el-form-item label="发起人类别" prop="initiatorType">
<el-select v-model="form.initiatorType" placeholder="请选择发起人类别" style="width: 100%">
<el-option v-for="item in oa_seal_initiator_type" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入备注" /> <el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入备注" />
@ -118,7 +123,7 @@ const loading = ref(true);
const takeOutDate = ref<Array<string>>([]); const takeOutDate = ref<Array<string>>([]);
// //
const routeParams = ref<Record<string, any>>({}); const routeParams = ref<Record<string, any>>({});
const { business_type,opr_yes_no } = toRefs<any>(proxy?.useDict('business_type','opr_yes_no')); const { business_type,opr_yes_no,oa_seal_initiator_type } = toRefs<any>(proxy?.useDict('business_type','opr_yes_no','oa_seal_initiator_type'));
const dialogVisibleSeal = ref(false); const dialogVisibleSeal = ref(false);
// //
const openSealDialog = () => { const openSealDialog = () => {
@ -197,6 +202,7 @@ const initFormData: SealForm = {
// endDate: undefined, // endDate: undefined,
// tripDays: undefined, // tripDays: undefined,
remark: undefined, remark: undefined,
sealIds:undefined,
status: undefined status: undefined
}; };
const data = reactive<PageData<SealForm, SealQuery>>({ const data = reactive<PageData<SealForm, SealQuery>>({
@ -217,9 +223,11 @@ const data = reactive<PageData<SealForm, SealQuery>>({
}); });
const selectedSealIds = ref([]); const selectedSealIds = ref([]);
const handleSealSelect = (ids) => { const handleSealSelect = (items)=> {
selectedSealIds.value = ids; console.log(items)
console.log('选中的公章ID:', ids); // ID
form.value.sealIds = items.map(item => item.id);
form.value.sealNames = items.map(item => item.name).join(', ');
}; };
const handleClose = () => { const handleClose = () => {
@ -252,6 +260,10 @@ const getInfo = () => {
takeOutDate.value = []; takeOutDate.value = [];
takeOutDate.value.push(form.value.takeOutStartDate); takeOutDate.value.push(form.value.takeOutStartDate);
takeOutDate.value.push(form.value.takeOutEndDate); takeOutDate.value.push(form.value.takeOutEndDate);
form.value.sealIds = res.data.sealInfos.map(item => item.sealId);
form.value.sealNames = res.data.sealInfos.map(item => item.sealName).join(', ');
// console.log( res.data.sealInfos)
// console.log( form.value.sealIds)
loading.value = false; loading.value = false;
buttonLoading.value = false; buttonLoading.value = false;
}); });