| | |
| | | <div class="search-area"> |
| | | <el-form :inline="true" :model="queryParams" class="search-form"> |
| | | <el-form-item label="镇街"> |
| | | <el-input |
| | | v-model="queryParams.street" |
| | | placeholder="请输入" |
| | | clearable |
| | | size="small" |
| | | /> |
| | | <el-input v-model="queryParams.street" placeholder="请输入" clearable size="small" /> |
| | | </el-form-item> |
| | | <el-form-item label="资料名称"> |
| | | <el-input |
| | | v-model="queryParams.name" |
| | | placeholder="请输入" |
| | | clearable |
| | | size="small" |
| | | /> |
| | | <el-input v-model="queryParams.name" placeholder="请输入" clearable size="small" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="default" @click="resetQuery">重置</el-button> |
| | |
| | | </div> |
| | | |
| | | <!-- 表格区域 --> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="tableData" |
| | | border |
| | | style="width: 100%" |
| | | > |
| | | <el-table-column prop="batchNo" label="镇/街道" min-width="120" align="center" /> |
| | | <el-table-column prop="totalApplications" label="资料名称" min-width="100" align="center" > |
| | | <el-table v-loading="loading" :data="tableData" border style="width: 100%"> |
| | | <el-table-column prop="street" label="镇/街道" min-width="120" align="center" /> |
| | | <el-table-column prop="name" label="资料名称" min-width="100" align="center"> |
| | | |
| | | </el-table-column> |
| | | <el-table-column prop="totalApplicants" label="附件内容" min-width="100" align="center" > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | @click="handleView(scope.row, 'view')" |
| | | >查看</el-button> |
| | | <el-button type="text" @click="handleDownload(scope.row)">{{ scope.row.attachName }}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="totalApplicants" label="附件内容" min-width="100" align="center" /> |
| | | <el-table-column prop="compensationAmount" label="更新时间" min-width="150" align="center" /> |
| | | |
| | | <el-table-column prop="updateTime" label="更新时间" min-width="150" align="center" /> |
| | | |
| | | <el-table-column label="操作" width="180" align="center" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <template> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | @click="handleView(scope.row, 'detail')" |
| | | >详情</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | @click="handleView(scope.row, 'detail')" |
| | | >编辑</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | @click="handleDelete(scope.row)" |
| | | >删除</el-button> |
| | | <el-button size="mini" type="text" @click="handleView(scope.row, 'detail')">详情</el-button> |
| | | <el-button size="mini" type="text" @click="handleView(scope.row, 'edit')">编辑</el-button> |
| | | <el-button size="mini" type="text" @click="handleDelete(scope.row)">删除</el-button> |
| | | </template> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | |
| | | <!-- 分页区域 --> |
| | | <div class="pagination-container"> |
| | | <el-pagination |
| | | background |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="queryParams.pageNum" |
| | | :page-sizes="[10, 20, 30, 40]" |
| | | :page-size="queryParams.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total" |
| | | > |
| | | <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" |
| | | :current-page="queryParams.pageNum" :page-sizes="[10, 20, 30, 40]" :page-size="queryParams.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" :total="total"> |
| | | </el-pagination> |
| | | </div> |
| | | |
| | | <!-- 审核对话框 --> |
| | | <approval-dialog |
| | | ref="approvalDialog" |
| | | :visible.sync="approvalDialogVisible" |
| | | :type="approvalType" |
| | | :row-data="currentRow" |
| | | @audit-submit="handleApprovalSubmit" |
| | | /> |
| | | <approval-dialog ref="approvalDialog" :visible.sync="approvalDialogVisible" :type="approvalType" |
| | | :row-data="currentRow" @audit-submit="handleApprovalSubmit" /> |
| | | |
| | | <!-- 上传组件 --> |
| | | <upload-dialog |
| | | ref="uploadDialog" |
| | | :visible.sync="uploadDialogVisible" |
| | | :type="uploadType" |
| | | @success="handleUploadSuccess" |
| | | /> |
| | | <upload-dialog ref="uploadDialog" :visible.sync="uploadDialogVisible" :type="uploadType" :streetOptions="streetOptions" |
| | | @success="handleUploadSuccess" /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import UploadDialog from "./components/UploadDialog"; |
| | | import ApprovalDialog from "./components/ApprovalDialog"; |
| | | import { list, add, del, update } from "@/api/storing-data"; |
| | | |
| | | import { getDictData } from '@/api/placement' |
| | | |
| | | export default { |
| | | name: "StoringData", |
| | |
| | | street: undefined, |
| | | name: undefined |
| | | }, |
| | | streetOptions: [] |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | // 镇(街道) |
| | | getDictData('street').then(response => { |
| | | this.streetOptions = response.data |
| | | }) |
| | | }, |
| | | methods: { |
| | | /** 查询列表 */ |
| | |
| | | handleImport() { |
| | | // 实现下载逻辑 |
| | | }, |
| | | handleSizeChange(size) { |
| | | this.queryParams.pageSize = size; |
| | | this.getList(); |
| | | }, |
| | | handleCurrentChange(page) { |
| | | this.queryParams.pageNum = page; |
| | | this.getList(); |
| | | }, |
| | | /** 批量导入按钮操作 */ |
| | | handleBatchImport() { |
| | | this.uploadType = "batch"; |
| | |
| | | }, |
| | | /** 统一的查看/详情按钮操作 */ |
| | | handleView(row, type) { |
| | | this.$router.push({ |
| | | path: "/applicationBatchList/detail", |
| | | query: { |
| | | batchNo: row.batchNo, |
| | | type: type // 'audit'/'view'/'detail' |
| | | }, |
| | | }); |
| | | this.$refs.uploadDialog.form = JSON.parse(JSON.stringify(row)); |
| | | this.$refs.uploadDialog.fileList = [{name: row.attachName, url: row.attachUrl}]; |
| | | this.uploadType = type; |
| | | this.uploadDialogVisible = true; |
| | | }, |
| | | /** 审核提交处理 */ |
| | | handleApprovalSubmit(data) { |
| | |
| | | }, |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | | this.$confirm("是否确认删除该批次数据?", "警告", { |
| | | this.$confirm("是否确认删除该资料?", "警告", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | // 这里添加删除逻辑 |
| | | this.$message({ |
| | | type: "success", |
| | | message: "删除成功!", |
| | | }); |
| | | this.getList(); |
| | | }) |
| | | .catch(() => {}); |
| | | del({id: row.id}).then(res => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "删除成功!", |
| | | }); |
| | | this.getList(); |
| | | }) |
| | | .catch(() => { }); |
| | | }) |
| | | .catch(() => { }); |
| | | }, |
| | | /** 上传成功回调 */ |
| | | handleUploadSuccess() { |
| | |
| | | this.$message({ |
| | | type: "success", |
| | | message: this.uploadType === "add" ? "新增成功!" : "批量导入成功!", |
| | | }); |
| | | }, |
| | | // 处理文件下载 |
| | | handleDownload(row) { |
| | | if (!row.attachUrl) { |
| | | this.$message.error('文件不存在'); |
| | | return; |
| | | } |
| | | |
| | | // 显示加载提示 |
| | | this.loading = true; |
| | | |
| | | // 使用fetch获取文件内容 |
| | | fetch(row.attachUrl) |
| | | .then(response => response.blob()) |
| | | .then(blob => { |
| | | // 创建blob URL |
| | | const url = window.URL.createObjectURL(blob); |
| | | // 创建临时a标签 |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = row.attachName || '下载文件'; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | // 清理 |
| | | document.body.removeChild(link); |
| | | window.URL.revokeObjectURL(url); |
| | | }) |
| | | .catch(error => { |
| | | console.error('下载失败:', error); |
| | | this.$message.error('文件下载失败'); |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | }, |
| | |
| | | .search-form { |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | |
| | | .el-form-item { |
| | | margin-bottom: 0; |
| | | margin-right: 20px; |
| | |
| | | |
| | | .action-buttons { |
| | | margin-bottom: 20px; |
| | | |
| | | |
| | | .el-button { |
| | | margin-right: 10px; |
| | | } |
| | |
| | | |
| | | .el-table { |
| | | margin-bottom: 20px; |
| | | |
| | | |
| | | .el-button--text { |
| | | padding: 0 8px; |
| | | |
| | | |
| | | &:not(:last-child) { |
| | | border-right: 1px solid #dcdfe6; |
| | | } |