用章
This commit is contained in:
parent
4ac4448649
commit
50a01dd9e5
@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -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,15 +27,17 @@
|
|||||||
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>
|
<template #default="scope">
|
||||||
|
<dict-tag :options="opr_yes_no" :value="scope.row.sealType" />
|
||||||
|
</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>
|
||||||
|
@ -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
|
||||||
|
@ -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;
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user