| | |
| | | export function getFileCount(recordId) |
| | | { |
| | | return request({ |
| | | url:'/system/materials/getFileCount/'+recordId, |
| | | url:'/system/materials/getFileCounts/'+recordId, |
| | | method:'get', |
| | | // headers:{ |
| | | |
| | |
| | | }) |
| | | } |
| | | //更新状态 |
| | | export function updateStatusById(status, id) |
| | | export function updateStatusById(status, id,operator) |
| | | { |
| | | return request({ |
| | | url: '/system/records/updateStatusById/' + status+"/"+id, |
| | | url: '/system/records/updateStatusById/' + status+"/"+id+"/"+operator, |
| | | method: 'get', |
| | | // data: data |
| | | }) |
| | |
| | | Vue.use(directive) |
| | | Vue.use(plugins) |
| | | DictData.install() |
| | | // 创建一个自定义指令 |
| | | Vue.directive('auto-height', { |
| | | bind(el, binding) { |
| | | const minRows = binding.value?.minRows || 1; |
| | | const maxRows = binding.value?.maxRows || 10; |
| | | |
| | | const resize = () => { |
| | | // 重置高度 |
| | | el.style.height = 'auto'; |
| | | |
| | | // 获取内容高度 |
| | | const scrollHeight = el.scrollHeight; |
| | | const lineHeight = parseInt(getComputedStyle(el).lineHeight); |
| | | |
| | | // 计算需要的行数 |
| | | let rows = Math.floor(scrollHeight / lineHeight); |
| | | rows = Math.max(minRows, Math.min(rows, maxRows)); |
| | | |
| | | // 设置行数 |
| | | el.setAttribute('rows', rows); |
| | | el.style.height = `${rows * lineHeight}px`; |
| | | }; |
| | | |
| | | // 监听输入事件 |
| | | el.addEventListener('input', resize); |
| | | // 初始化时调整一次 |
| | | resize(); |
| | | |
| | | // 保存resize函数以便卸载 |
| | | el._autoHeightResize = resize; |
| | | }, |
| | | |
| | | unbind(el) { |
| | | el.removeEventListener('input', el._autoHeightResize); |
| | | delete el._autoHeightResize; |
| | | } |
| | | }); |
| | | /** |
| | | * If you don't want to use mock-server |
| | | * you want to use MockJs for mock api |
| | |
| | | <div class="title-search-wrapper"> |
| | | <el-input |
| | | type="textarea" |
| | | rows="1" |
| | | rows="2" |
| | | v-auto-height="{ minRows: 2, maxRows: 10 }" |
| | | |
| | | v-model="form.creator" |
| | | placeholder="请输入责任者" |
| | | @input="handleCreatorInput" |
| | |
| | | <div class="title-search-wrapper"> |
| | | <el-input |
| | | type="textarea" |
| | | rows="1" |
| | | rows="2" |
| | | v-model="form.title" |
| | | placeholder="请输入文件题名" |
| | | @input="handleTitleInput" |
| | |
| | | //alert(this.totalPageCount) |
| | | //alert(recordId) |
| | | this.recordId = recordId; |
| | | this.uploadUrl = process.env.VUE_APP_BASE_API +'/system/materials/upload/'+this.recordId |
| | | this.uploadUrl = process.env.VUE_APP_BASE_API +'/system/materials/uploads/'+this.recordId |
| | | // alert('Bearer ' + getToken()) |
| | | this.reset() |
| | | this.form.securityLevel = '普通' // 设置对话框表单默认值 |
| | |
| | | // 打开导入对话框 |
| | | handleImport() { |
| | | //生成新的记录 |
| | | insertFile(this.recordId, this.totalPageCount).then(response => { |
| | | console.log(response) |
| | | // alert(3245) |
| | | }) |
| | | // insertFile(this.recordId, this.totalPageCount).then(response => { |
| | | // console.log(response) |
| | | // // alert(3245) |
| | | // }) |
| | | this.importDialogVisible = true |
| | | }, |
| | | // 文件移除 |
| | |
| | | // var res = response.data.res |
| | | // console.log(res) |
| | | //alert(response.data.total) |
| | | if(fileCount!=this.totalPageCount) |
| | | { |
| | | this.$modal.msgWarning('请选择与记录数一致的文件') |
| | | return |
| | | } |
| | | else |
| | | // if(fileCount!=this.totalPageCount) |
| | | // { |
| | | // this.$modal.msgWarning('请选择与记录数一致的文件') |
| | | // return |
| | | // } |
| | | // else |
| | | { |
| | | // 初始化上传状态计数 |
| | | this.uploadSuccessCount = 0; |
| | |
| | | this.totalUploadFiles = fileCount; |
| | | // 执行上传 |
| | | this.$refs.upload.submit() |
| | | this.getList() |
| | | // this.getList() |
| | | } |
| | | // else |
| | | // { |
| | |
| | | //修改案卷的状态 |
| | | // var id = row.id |
| | | var status = '未上传附件' |
| | | updateStatusById(status, recordId).then(response=>{ |
| | | updateStatusById(status, recordId, '退回管理员').then(response=>{ |
| | | // this.$modal.msgSuccess("提交成功") |
| | | // this.getList() |
| | | _this.$store.dispatch('tagsView/delView', this.$route); |
| | |
| | | import { listAllCategory } from "@/api/system/category" |
| | | import { listAllProjectName } from "@/api/system/projectName" |
| | | import { listPlaceName, listAllPlaceName } from "@/api/system/placeName" |
| | | import { judge } from "@/api/system/materials" |
| | | import { judge,getFileCount } from "@/api/system/materials" |
| | | import { UserRoleIdList,unallocatedUserList, authUserSelectAll } from "@/api/system/role" |
| | | import {authManyRecordsToUsers} from "@/api/system/archiverecordstouser" |
| | | |
| | |
| | | { |
| | | //alert(row.id) |
| | | var id = row.id |
| | | var pageCount = row.pageCount |
| | | if(pageCount===undefined||pageCount===0) |
| | | this.$modal.msgWarning('请先补充案卷页数!') |
| | | |
| | | // 在提交之前,调用后端接口检查是否已经上传附件 |
| | | judge(id).then(response => { |
| | | // console.log(response) |
| | | getFileCount(id).then(response => { |
| | | console.log(response) |
| | | // alert(response.data) |
| | | if (response.data===undefined||response.data === false) { |
| | | if (response.length===undefined||response.length === 0) { |
| | | // 如果文件数量为0,提示用户先上传附件 |
| | | this.$modal.msgWarning('请先上传附件,再进行提交操作') |
| | | } else { |
| | | } |
| | | else if(response.length===pageCount) |
| | | { |
| | | // 如果已经上传了附件,继续提交操作 |
| | | var status = '录入完成' |
| | | updateStatusById(status, id).then(response=>{ |
| | | updateStatusById(status, id, '提交案卷').then(response=>{ |
| | | this.$modal.msgSuccess("提交成功") |
| | | this.getList() |
| | | }) |
| | | } |
| | | else |
| | | { |
| | | this.$modal.msgWarning('附件数量上传不足,请继续上传!') |
| | | |
| | | } |
| | | }).catch(error => { |
| | | console.error('检查附件数量失败:', error) |
| | | this.$modal.msgError('检查附件数量失败,请稍后重试') |