| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getFileCount,islegal, listMaterials, enload, getMaterials, delMaterials, addMaterials, updateMaterials } from "@/api/system/materials" |
| | | import {insertFile, getFileCount,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" |
| | |
| | | name: "Materials", |
| | | data() { |
| | | return { |
| | | totalPageCount: 0, |
| | | // 记录元素初始位置和状态 |
| | | originalOffsetLeft: 0, |
| | | originalWidth: 0, |
| | |
| | | created() { |
| | | //const roleId = this.$route.params && this.$route.params.roleId |
| | | const recordId = this.$route.params && this.$route.params.recordId |
| | | |
| | | this.totalPageCount = this.$route.params && this.$route.params.pageCount |
| | | //alert(this.totalPageCount) |
| | | //alert(recordId) |
| | | this.recordId = recordId; |
| | | this.uploadUrl = process.env.VUE_APP_BASE_API +'/system/materials/upload/'+this.recordId |
| | |
| | | }, |
| | | // 打开导入对话框 |
| | | handleImport() { |
| | | //生成新的记录 |
| | | insertFile(this.recordId, this.totalPageCount).then(response => { |
| | | console.log(response) |
| | | // alert(3245) |
| | | }) |
| | | this.importDialogVisible = true |
| | | }, |
| | | // 文件移除 |
| | |
| | | islegal(this.recordId).then(response => { |
| | | console.log(response.data) |
| | | var res = response.data.res |
| | | |
| | | //alert(response.data.total) |
| | | if(fileCount!==response.data.total) |
| | | if(fileCount!=this.totalPageCount) |
| | | { |
| | | this.$modal.msgWarning('请选择与记录数一致的文件') |
| | | return |