| | |
| | | }, |
| | | data: data |
| | | }) |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | export function islegal(recordId) |
| | | { |
| | | return request({ |
| | | url:'/system/materials/isPageNubLegal/'+recordId, |
| | | method:'get', |
| | | // headers:{ |
| | | |
| | | // } |
| | | }) |
| | | } |
| | |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | |
| | | |
| | | <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> |
| | | |
| | | <el-form ref="forms" :model="forms" :rules="rules" label-width="100px"> |
| | |
| | | <!-- <el-form-item label="页次" prop="pageOrder"> |
| | | <el-input v-model="forms.pageOrder" placeholder="请输入页次" /> |
| | | </el-form-item> --> |
| | | <el-form-item label="文字材料" prop="fileStyle"> |
| | | <el-form-item label="材料类型" prop="fileStyle"> |
| | | <el-select |
| | | v-model="forms.fileStyle" |
| | | |
| | | placeholder="请选择文字材料" |
| | | placeholder="请选择材料类型" |
| | | clearable |
| | | > |
| | | <el-option |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="页号" prop="pageNumber"> |
| | | <el-col :span="8"> |
| | | <el-input |
| | | v-model.number="forms.pageNumber" |
| | | placeholder="请输入页号(数字类型)" |
| | | clearable |
| | | type="number" |
| | | min="1" |
| | | oninput="value=value.replace(/[^\d]/g,'')" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-col> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remarks"> |
| | | <el-input v-model="forms.remarks" placeholder="请输入备注" /> |
| | | </el-form-item> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { listMaterials, enload, getMaterials, delMaterials, addMaterials, updateMaterials } from "@/api/system/materials" |
| | | import { islegal, listMaterials, enload, getMaterials, delMaterials, addMaterials, updateMaterials } from "@/api/system/materials" |
| | | import { getToken } from '@/utils/auth' |
| | | import store from '@/store' |
| | | import { updateStatusById } from "@/api/system/records" |
| | |
| | | this.$modal.msgWarning('请选择与记录数一致的文件') |
| | | return |
| | | } |
| | | // 执行上传 |
| | | this.$refs.upload.submit() |
| | | //判断页号与上传上传的文件的页号是不是一一对应的 |
| | | islegal(this.recordId).then(response => { |
| | | console.log(response.data) |
| | | var res = response.data |
| | | if(res) |
| | | { |
| | | // 执行上传 |
| | | this.$refs.upload.submit() |
| | | this.getList() |
| | | } |
| | | else |
| | | { |
| | | this.$modal.msgError("页号不连续,请修改为连续正确的页号!") |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | clearFileList() { |
| | | this.fileList = []; |
| | |
| | | icon="el-icon-edit" |
| | | @click="handleInfo(scope.row)" |
| | | v-hasPermi="['system:records:edit']" |
| | | >案卷详细信息</el-button> |
| | | >编辑卷内目录</el-button> |
| | | |
| | | <el-button |
| | | size="mini" |
| | |
| | | </div> |
| | | </div> |
| | | <!-- 优化的Excel预览组件 --> |
| | | <el-dialog class="excel-preview-wrapper" :visible.sync="showExcelPreview" :modal="false" width="80%"> |
| | | |
| | | <div > |
| | | <el-dialog class="excel-preview-wrapper" :visible.sync="showExcelPreview" :modal="false" width="80%" :show-close="true" @click="closeExcelPreviewDialog"> |
| | | <div @click.stop> |
| | | <!-- 主要预览组件 --> |
| | | <vue-office-excel |
| | | v-if="currentExcelUrl" |
| | |
| | | name: "Records", |
| | | data() { |
| | | return { |
| | | showExcelPreview: false, |
| | | excel: 'http://localhost:8080/profile/upload/12.xls', //设置文档网络地址,可以是相对地址 |
| | | |
| | | open_check: false, |
| | |
| | | /** 关闭Excel弹窗并清理资源 */ |
| | | closeExcelDialog() { |
| | | this.excelDialogVisible = false; |
| | | // alert(this.excelDialogVisible) |
| | | if (this.excelPreviewTimeout) { |
| | | clearTimeout(this.excelPreviewTimeout); |
| | | this.excelPreviewTimeout = null; |
| | |
| | | } |
| | | this.currentExcelBlob = null; |
| | | }, |
| | | closeExcelPreviewDialog() |
| | | { |
| | | |
| | | this.showExcelPreview = false; |
| | | }, |
| | | /** 处理预览按钮点击 */ |
| | | handlePreviewClick() { |
| | | this.showExcelPreview = true; |
| | | this.excelRenderError = ''; |
| | | var id = this.recordId ; |
| | | this.$modal.loading('正在获取Excel文件,请稍候...'); |
| | | alert(id) |
| | | |
| | | // 从后端获取Excel文件 |
| | | this.getExcelFile(id).then(blob => { |
| | | this.$modal.closeLoading(); |
| | |
| | | // 构建文件名,包含选项信息 |
| | | let filename = `record_${this.currentExcelId}`; |
| | | if (includeQrCode) filename += '_qr'; |
| | | if (selectedAnnotations.length > 0) { |
| | | filename += `_anno${selectedAnnotations.join('')}`; |
| | | } |
| | | // if (selectedAnnotations.length > 0) { |
| | | // filename += `_anno${selectedAnnotations.join('')}`; |
| | | // } |
| | | filename += `_${new Date().getTime()}.xlsx`; |
| | | |
| | | link.download = filename; |
| | |
| | | }); |
| | | }, |
| | | |
| | | /** 清理Excel预览相关资源 */ |
| | | /** 清理Excel预览相关资源并关闭对话框 */ |
| | | cleanupExcelPreview(iframe, url) { |
| | | setTimeout(() => { |
| | | if (iframe && iframe.parentNode) { |
| | |
| | | URL.revokeObjectURL(url); |
| | | } |
| | | this.excelRenderError = ''; |
| | | this.showExcelPreview = false; // 关闭预览对话框 |
| | | }, 1000); |
| | | }, |
| | | |