feat(ctr): 新增合同附件列表功能并优化合同创建流程

- 在支出合同和收入合同页面添加查看附件列表功能
- 实现合同创建的多步骤流程,包括合同信息填写和付款信息填写
- 增加表单验证,确保合同信息和付款信息的完整性
- 优化合同类型切换逻辑,支持收入合同和支出合同的创建
- 在合同创建过程中添加临时数据保存功能,防止数据丢失
This commit is contained in:
tcy
2025-08-21 11:32:31 +08:00
parent 7c1f07eb7d
commit 6359daba49
6 changed files with 355 additions and 76 deletions

View File

@ -0,0 +1,56 @@
<template>
<el-dialog v-model="dialogVisible" title="附件列表" width="45%">
<el-table :data="fileList" style="width: 100%">
<el-table-column prop="fileName" label="文件名" />
<el-table-column prop="type" label="操作">
<template #default="scope">
<el-button link type="success" @click="viewFile(scope.row)" icon="View">查看文件</el-button>
<el-button link type="primary" @click="downloadFile(scope.row)" icon="download">下载文件</el-button>
</template>
</el-table-column>
</el-table>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="dialogVisible = false">
关闭
</el-button>
</div>
</template>
</el-dialog>
<el-dialog width="80%" v-model="viewFileVisible" title="查看文件" append-to-body>
<iframe :src="fileUrl" frameborder="0" width="100%" height="800"></iframe>
<template #footer>
<div class="dialog-footer">
<el-button @click="viewFileVisible = false" type="primary">关闭</el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
const { proxy } = getCurrentInstance();
const dialogVisible = defineModel();
const props = defineProps(['fileList'])
const viewFileVisible = ref(false)
const fileUrl = ref('')
const downloadFile = async (data) => {
// 这里可以添加下载文件的逻辑
await proxy?.download(data.fileUrl, {}, data.fileName);
proxy?.$message({
message: '下载成功',
type: 'success'
});
};
const viewFile = (data) => {
// 这里可以添加查看文件的逻辑
fileUrl.value = data.fileUrl;
viewFileVisible.value = true;
}
const adjustIframe = () => {
const iframe = document.querySelector('iframe');
if (iframe) {
iframe.style.height = `${iframe.contentWindow.document.body.scrollHeight}px`;
}
};
</script>