xuhuajiao
2 years ago
6 changed files with 533 additions and 404 deletions
-
40src/views/archivesManage/archivesList/index.vue
-
665src/views/archivesManage/archivesList/mixins/archives.js
-
45src/views/archivesManage/archivesSearch/index.vue
-
80src/views/archivesManage/fileImport/dataImport/index.vue
-
106src/views/home.vue
-
1src/views/storeManage/warehouse3D/index.vue
@ -1,331 +1,334 @@ |
|||||
import qs from 'qs' |
|
||||
import { exportFile } from '@/utils/index' |
|
||||
import { FetchTableDisplayFields, FetchInitArchivesView, FetchFormDisplayFields } from '@/api/archivesManage/archivesList' |
|
||||
export const archivesCrud = { |
|
||||
// 组件共用属性
|
|
||||
data() { |
|
||||
return { |
|
||||
permission: { |
|
||||
add: ['admin', 'archivesList:add'], |
|
||||
edit: ['admin', 'archivesList:edit'], |
|
||||
del: ['admin', 'archivesList:del'], |
|
||||
download: ['admin', 'archivesList:download'] |
|
||||
}, |
|
||||
page: { |
|
||||
page: 1, |
|
||||
size: 10, |
|
||||
total: 0 |
|
||||
}, |
|
||||
storageTxt: [], |
|
||||
borrowTxt: [], |
|
||||
tableDisplayFields: [], // table-list-title字段
|
|
||||
getTableDisplayFieldsLoading: false, // table-loading
|
|
||||
projectTableHeight: null, |
|
||||
anjuanTableHeight: null, |
|
||||
juanneiTableHeight: null, |
|
||||
formVisible: false, |
|
||||
formTitle: '新建档案', |
|
||||
formPreviewData: [], // 预览界面data
|
|
||||
totalSumAll: 0, // 删除时,内部文件数据求和
|
|
||||
arrySort: [], // 多项sort-query
|
|
||||
selections: [], // table已选择的
|
|
||||
categoryId: null, // 上传附件使用
|
|
||||
parentsId: null, // 父id
|
|
||||
arcId: null, // 档案ID
|
|
||||
yearGroup: [], // 智能分类 - 年度
|
|
||||
uploadFileVisible: false, // 上传附件
|
|
||||
isDesFormType: null // 区分是门类得还是档案得
|
|
||||
} |
|
||||
}, |
|
||||
// 组件共用方法
|
|
||||
methods: { |
|
||||
// 搜索-select
|
|
||||
querySelect(name, val) { |
|
||||
this[name] = val |
|
||||
}, |
|
||||
rowKey(row) { |
|
||||
return row.id |
|
||||
}, |
|
||||
// table选中加上选中状态
|
|
||||
tableRowClassName({ row, rowIndex }) { |
|
||||
// console.log('添加类名', row, rowIndex)
|
|
||||
let color = '' |
|
||||
this.selections.forEach(item => { |
|
||||
if (item.id === row.id) { |
|
||||
color = 'rowStyle' |
|
||||
} |
|
||||
}) |
|
||||
return color |
|
||||
}, |
|
||||
// 案卷 / 卷内 / 文件 导出
|
|
||||
doExport(type) { |
|
||||
this.crud.downloadLoading = true |
|
||||
if (type === 0 && this.selectedCategory.isType === 2) { |
|
||||
this.parentsId = this.projectSelection.id |
|
||||
} else if (type === 1 && this.selectedCategory.isType === 2) { |
|
||||
this.parentsId = this.anjuanSelection.id |
|
||||
} else { |
|
||||
this.parentsId = null |
|
||||
} |
|
||||
const params = { |
|
||||
'categoryId': this.categoryId, |
|
||||
'parentsId': this.parentsId |
|
||||
} |
|
||||
exportFile(this.baseApi + '/api/archives/exportArchives?' + qs.stringify(params)) |
|
||||
this.crud.downloadLoading = false |
|
||||
}, |
|
||||
// table - 表头项
|
|
||||
getTableItemCommon(type) { |
|
||||
if (type === 0) { |
|
||||
this.categoryId = this.selectedCategory.id |
|
||||
} else if (type === 1) { |
|
||||
if (this.selectedCategory.isType === 2) { |
|
||||
if (this.selectedCategory.children.length !== 0) { |
|
||||
this.categoryId = this.selectedCategory.children[0].id |
|
||||
} |
|
||||
} else { |
|
||||
this.categoryId = this.selectedCategory.id |
|
||||
} |
|
||||
} else if (type === 2) { |
|
||||
if (this.selectedCategory.isType === 2) { |
|
||||
if (this.selectedCategory.children.length !== 0) { |
|
||||
if (this.selectedCategory.children[0].children.length !== 0) { |
|
||||
this.categoryId = this.selectedCategory.children[0].children[0].id |
|
||||
} |
|
||||
} |
|
||||
} else if (this.selectedCategory.isType === 3) { |
|
||||
if (this.selectedCategory.children.length !== 0) { |
|
||||
this.categoryId = this.selectedCategory.children[0].id |
|
||||
} |
|
||||
} else { |
|
||||
this.categoryId = this.selectedCategory.id |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
this.getTableDisplayFieldsLoading = true |
|
||||
this.selections = [] |
|
||||
FetchTableDisplayFields({ categoryId: this.categoryId }).then(data => { |
|
||||
if (data) { |
|
||||
this.arrySort = [] |
|
||||
this.tableDisplayFields = data |
|
||||
this.getTableDisplayFieldsLoading = false |
|
||||
const orderSortArry = this.tableDisplayFields.filter(item => item.queue).sort((a, b) => a.queue - b.queue) |
|
||||
orderSortArry.forEach(item => { |
|
||||
this.arrySort.push(item.fieldName + ',' + item.displayOrderBy) |
|
||||
}) |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
handleCurrentPage(val) { |
|
||||
this.page.page = val |
|
||||
// console.log(this.$refs.table.selection)
|
|
||||
this.getTableList() |
|
||||
this.$nextTick(() => { |
|
||||
this.selections = this.$refs.table.selection |
|
||||
}) |
|
||||
}, |
|
||||
// table - list
|
|
||||
getListCommon(name, heightName, type) { |
|
||||
if (type === 0) { |
|
||||
this.parentsId = null |
|
||||
} else if (type === 1) { |
|
||||
if (this.selectedCategory.isType === 3 || this.selectedCategory.isType === 5) { |
|
||||
this.parentsId = null |
|
||||
} else { |
|
||||
this.parentsId = this.projectSelection.id |
|
||||
} |
|
||||
} else if (type === 2) { |
|
||||
if (this.selectedCategory.isType !== 4) { |
|
||||
this.parentsId = this.anjuanSelection.id |
|
||||
} else { |
|
||||
this.parentsId = null |
|
||||
} |
|
||||
} |
|
||||
if (this.categoryId !== null) { // 防止项目下无案卷门类情况
|
|
||||
this.selections = [] |
|
||||
// this.page.page = isNaN(this.page.page - 1) ? 0 : this.page.page - 1
|
|
||||
this.formVisible = false |
|
||||
this.getTableDisplayFieldsLoading = true |
|
||||
const params = { |
|
||||
'categoryId': this.categoryId, |
|
||||
'parentsId': this.parentsId, |
|
||||
'isdel': this.recycleMain.isdel, |
|
||||
'page': this.page.page - 1, |
|
||||
'size': this.page.size, |
|
||||
'sort': this.arrySort, |
|
||||
'queryType': this.query.queryType, |
|
||||
'queryTitle': this.query.queryTitle, |
|
||||
'itemNo': this.query.itemNo, |
|
||||
'archiveCtgNo': this.query.archiveCtgNo, |
|
||||
'responsibleby': this.query.responsibleby, |
|
||||
'archiveNo': this.query.archiveNo, |
|
||||
'archiveYear': this.smartQuery.archiveYear, |
|
||||
'department': this.smartQuery.department, |
|
||||
'retention': this.smartQuery.retention, |
|
||||
'securityClass': this.smartQuery.securityClass, |
|
||||
'organizationMatter': this.smartQuery.organizationMatter |
|
||||
} |
|
||||
FetchInitArchivesView(params).then(data => { |
|
||||
this.getTableDisplayFieldsLoading = false |
|
||||
if (data) { |
|
||||
this[name] = data.list.content |
|
||||
this.yearGroup = data.yearGroup |
|
||||
this.page.total = data.list.totalElements |
|
||||
|
|
||||
// 自适应高度
|
|
||||
if (this[name].length === 0 || this[name].length < 10) { |
|
||||
this[heightName] = '' |
|
||||
} else { |
|
||||
const h = '100vh' |
|
||||
this[heightName] = `calc(${h} - 434px)` |
|
||||
} |
|
||||
|
|
||||
if (name === 'anjuanData' || name === 'junneiData') { |
|
||||
this[name].forEach((item, index) => { |
|
||||
// 入库状态
|
|
||||
if (item.is_storage === 0) { |
|
||||
this.storageTxt[index] = '未入' |
|
||||
if (item.is_borrow === '') { |
|
||||
this.borrowTxt[index] = '-' |
|
||||
} |
|
||||
} else if (item.is_storage === 1) { |
|
||||
this.storageTxt[index] = '待入' |
|
||||
if (item.is_borrow === '') { |
|
||||
this.borrowTxt[index] = '-' |
|
||||
} |
|
||||
} else if (item.is_storage === 2) { |
|
||||
this.storageTxt[index] = '已入' |
|
||||
if (item.is_borrow === '') { |
|
||||
this.borrowTxt[index] = '在库' |
|
||||
} |
|
||||
} else if (item.is_storage === 3) { |
|
||||
this.storageTxt[index] = '待出' |
|
||||
if (item.is_borrow === '') { |
|
||||
this.borrowTxt[index] = '-' |
|
||||
} |
|
||||
} else if (item.is_storage === '') { |
|
||||
this.storageTxt[index] = '未入' |
|
||||
if (item.is_borrow === '') { |
|
||||
this.borrowTxt[index] = '-' |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
// 借阅状态
|
|
||||
if (item.is_borrow === 1) { |
|
||||
this.borrowTxt[index] = '待借' |
|
||||
} else if (item.is_borrow === 2) { |
|
||||
this.borrowTxt[index] = '待借' |
|
||||
} else if (item.is_borrow === 3) { |
|
||||
this.borrowTxt[index] = '已借' |
|
||||
} else if (item.is_borrow === -1) { |
|
||||
this.borrowTxt[index] = '在库' |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
}, |
|
||||
// 著录界面-form/详情-api
|
|
||||
handleForm(type, title, isAnOrJuan) { |
|
||||
if (type === 'add') { |
|
||||
this.formTitle = '新增' + title |
|
||||
this.arcId = null |
|
||||
// this.parentsId = this[name].id //案卷和卷内有 不确定
|
|
||||
} else if (type === 'edit') { |
|
||||
this.arcId = this.selections[0].id |
|
||||
this.formTitle = '编辑' + title |
|
||||
} |
|
||||
this.formVisible = true |
|
||||
this.form.dictionaryConfigId = {} |
|
||||
this.formPreviewData = [] |
|
||||
// 档案预编辑获取字段
|
|
||||
const params = { |
|
||||
categoryId: this.categoryId, |
|
||||
archivesId: this.arcId |
|
||||
} |
|
||||
this.getFormInfo(params, type, isAnOrJuan) |
|
||||
}, |
|
||||
getFormInfo(params, type, isAnOrJuan) { |
|
||||
FetchFormDisplayFields(params).then(data => { |
|
||||
this.formPreviewData = data.showFiled |
|
||||
this.$nextTick(() => { |
|
||||
if (type === 'edit') { |
|
||||
this.$refs.previewForm.addOrUpdateForm = data.echo |
|
||||
} else { |
|
||||
if (this.recycleMain.selectedCategory.isType !== 5) { |
|
||||
// 新增时拿到项目和案卷的相同的字段的值
|
|
||||
this.formPreviewData.forEach(item => { |
|
||||
if (isAnOrJuan === 1) { |
|
||||
if (this.recycleMain.selectedCategory.isType !== 3) { |
|
||||
if (this.recycleMain.projectSelection[item.fieldName]) { |
|
||||
this.$refs.previewForm.addOrUpdateForm = JSON.parse(JSON.stringify(this.recycleMain.projectSelection)) |
|
||||
} |
|
||||
} |
|
||||
} else if (isAnOrJuan === 2) { |
|
||||
if (this.recycleMain.anjuanSelection[item.fieldName]) { |
|
||||
this.$refs.previewForm.addOrUpdateForm = JSON.parse(JSON.stringify(this.recycleMain.anjuanSelection)) |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
this.isDesFormType = 'arcives' |
|
||||
this.$refs.previewForm.FetchNoFormatField(this.categoryId) |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
// form - submit
|
|
||||
handlerArchivesSubmit() { |
|
||||
this.$refs.previewForm.submitForm('addOrUpdateForm', this.categoryId) |
|
||||
this.selections = [] |
|
||||
}, |
|
||||
// 选择删除
|
|
||||
toDelete(data) { |
|
||||
// 已装盒的档案不可删除
|
|
||||
const indexCaseBool = data.findIndex(item => item.case_no !== '') |
|
||||
if (indexCaseBool !== -1) { |
|
||||
this.$message.error('已装盒的档案不可删除!') |
|
||||
} else { |
|
||||
this.$refs.deltArchives.deleteVisible = true |
|
||||
this.getTotalSumAll() |
|
||||
} |
|
||||
}, |
|
||||
getTotalSumAll() { |
|
||||
this.totalSumAll = 0 |
|
||||
this.selections.map((item) => { if (!isNaN(item.children_num)) this.totalSumAll += item.children_num }) |
|
||||
if (isNaN(this.totalSumAll)) { |
|
||||
return 0 |
|
||||
} |
|
||||
return this.totalSumAll |
|
||||
}, |
|
||||
// 删除 - 关闭
|
|
||||
handleClose(done) { |
|
||||
this.formVisible = false |
|
||||
done() |
|
||||
}, |
|
||||
/* 重新渲染table组件 防止table-fixed 错位 配合watch-table数据 */ |
|
||||
doLayout() { |
|
||||
this.$nextTick(() => { |
|
||||
this.$refs.table.doLayout() |
|
||||
}) |
|
||||
}, |
|
||||
// 上传附件
|
|
||||
uploadFile() { |
|
||||
this.uploadFileVisible = true |
|
||||
this.arcId = this.selections[0].id |
|
||||
this.$nextTick(() => { |
|
||||
this.$refs.uploadFile.tableData = [] |
|
||||
this.$refs.uploadFile.getFileList() |
|
||||
}) |
|
||||
}, |
|
||||
// 还原
|
|
||||
handleRestore() { |
|
||||
this.$refs.restore.restoreVisible = true |
|
||||
} |
|
||||
}, |
|
||||
// 组件挂载时的共用方法
|
|
||||
mounted() { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
|
import qs from 'qs' |
||||
|
import { exportFile } from '@/utils/index' |
||||
|
import { FetchTableDisplayFields, FetchInitArchivesView, FetchFormDisplayFields } from '@/api/archivesManage/archivesList' |
||||
|
export const archivesCrud = { |
||||
|
// 组件共用属性
|
||||
|
data() { |
||||
|
return { |
||||
|
permission: { |
||||
|
add: ['admin', 'archivesList:add'], |
||||
|
edit: ['admin', 'archivesList:edit'], |
||||
|
del: ['admin', 'archivesList:del'], |
||||
|
download: ['admin', 'archivesList:download'] |
||||
|
}, |
||||
|
page: { |
||||
|
page: 1, |
||||
|
size: 10, |
||||
|
total: 0 |
||||
|
}, |
||||
|
storageTxt: [], |
||||
|
borrowTxt: [], |
||||
|
tableDisplayFields: [], // table-list-title字段
|
||||
|
getTableDisplayFieldsLoading: false, // table-loading
|
||||
|
projectTableHeight: null, |
||||
|
anjuanTableHeight: null, |
||||
|
juanneiTableHeight: null, |
||||
|
formVisible: false, |
||||
|
formTitle: '新建档案', |
||||
|
formPreviewData: [], // 预览界面data
|
||||
|
totalSumAll: 0, // 删除时,内部文件数据求和
|
||||
|
arrySort: [], // 多项sort-query
|
||||
|
selections: [], // table已选择的
|
||||
|
categoryId: null, // 上传附件使用
|
||||
|
parentsId: null, // 父id
|
||||
|
arcId: null, // 档案ID
|
||||
|
yearGroup: [], // 智能分类 - 年度
|
||||
|
uploadFileVisible: false, // 上传附件
|
||||
|
isDesFormType: null // 区分是门类得还是档案得
|
||||
|
} |
||||
|
}, |
||||
|
// 组件共用方法
|
||||
|
methods: { |
||||
|
// 搜索-select
|
||||
|
querySelect(name, val) { |
||||
|
this[name] = val |
||||
|
}, |
||||
|
rowKey(row) { |
||||
|
return row.id |
||||
|
}, |
||||
|
// table选中加上选中状态
|
||||
|
tableRowClassName({ row, rowIndex }) { |
||||
|
// console.log('添加类名', row, rowIndex)
|
||||
|
let color = '' |
||||
|
this.selections.forEach(item => { |
||||
|
if (item.id === row.id) { |
||||
|
color = 'rowStyle' |
||||
|
} |
||||
|
}) |
||||
|
return color |
||||
|
}, |
||||
|
// 案卷 / 卷内 / 文件 导出
|
||||
|
doExport(type) { |
||||
|
this.crud.downloadLoading = true |
||||
|
if (type === 0 && this.selectedCategory.isType === 2) { |
||||
|
this.parentsId = this.projectSelection.id |
||||
|
} else if (type === 1 && this.selectedCategory.isType === 2) { |
||||
|
this.parentsId = this.anjuanSelection.id |
||||
|
} else { |
||||
|
this.parentsId = null |
||||
|
} |
||||
|
const params = { |
||||
|
'categoryId': this.categoryId, |
||||
|
'parentsId': this.parentsId |
||||
|
} |
||||
|
exportFile(this.baseApi + '/api/archives/exportArchives?' + qs.stringify(params)) |
||||
|
this.crud.downloadLoading = false |
||||
|
}, |
||||
|
// table - 表头项
|
||||
|
getTableItemCommon(type) { |
||||
|
if (type === 0) { |
||||
|
this.categoryId = this.selectedCategory.id |
||||
|
} else if (type === 1) { |
||||
|
if (this.selectedCategory.isType === 2) { |
||||
|
if (this.selectedCategory.children.length !== 0) { |
||||
|
this.categoryId = this.selectedCategory.children[0].id |
||||
|
} |
||||
|
} else { |
||||
|
this.categoryId = this.selectedCategory.id |
||||
|
} |
||||
|
} else if (type === 2) { |
||||
|
if (this.selectedCategory.isType === 2) { |
||||
|
if (this.selectedCategory.children.length !== 0) { |
||||
|
if (this.selectedCategory.children[0].children.length !== 0) { |
||||
|
this.categoryId = this.selectedCategory.children[0].children[0].id |
||||
|
} |
||||
|
} |
||||
|
} else if (this.selectedCategory.isType === 3) { |
||||
|
if (this.selectedCategory.children.length !== 0) { |
||||
|
this.categoryId = this.selectedCategory.children[0].id |
||||
|
} |
||||
|
} else { |
||||
|
this.categoryId = this.selectedCategory.id |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
this.getTableDisplayFieldsLoading = true |
||||
|
this.selections = [] |
||||
|
FetchTableDisplayFields({ categoryId: this.categoryId }).then(data => { |
||||
|
if (data) { |
||||
|
this.arrySort = [] |
||||
|
this.tableDisplayFields = data |
||||
|
this.getTableDisplayFieldsLoading = false |
||||
|
const orderSortArry = this.tableDisplayFields.filter(item => item.queue).sort((a, b) => a.queue - b.queue) |
||||
|
orderSortArry.forEach(item => { |
||||
|
this.arrySort.push(item.fieldName + ',' + item.displayOrderBy) |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
handleCurrentPage(val) { |
||||
|
this.page.page = val |
||||
|
// console.log(this.$refs.table.selection)
|
||||
|
this.getTableList() |
||||
|
this.$nextTick(() => { |
||||
|
this.selections = this.$refs.table.selection |
||||
|
}) |
||||
|
}, |
||||
|
// table - list
|
||||
|
getListCommon(name, heightName, type) { |
||||
|
if (type === 0) { |
||||
|
this.parentsId = null |
||||
|
} else if (type === 1) { |
||||
|
if (this.selectedCategory.isType === 3 || this.selectedCategory.isType === 5) { |
||||
|
this.parentsId = null |
||||
|
} else { |
||||
|
this.parentsId = this.projectSelection.id |
||||
|
} |
||||
|
} else if (type === 2) { |
||||
|
if (this.selectedCategory.isType !== 4) { |
||||
|
this.parentsId = this.anjuanSelection.id |
||||
|
} else { |
||||
|
this.parentsId = null |
||||
|
} |
||||
|
} |
||||
|
if (this.categoryId !== null) { // 防止项目下无案卷门类情况
|
||||
|
this.selections = [] |
||||
|
// this.page.page = isNaN(this.page.page - 1) ? 0 : this.page.page - 1
|
||||
|
this.formVisible = false |
||||
|
this.getTableDisplayFieldsLoading = true |
||||
|
const params = { |
||||
|
'categoryId': this.categoryId, |
||||
|
'parentsId': this.parentsId, |
||||
|
'isdel': this.recycleMain.isdel, |
||||
|
'page': this.page.page - 1, |
||||
|
'size': this.page.size, |
||||
|
'sort': this.arrySort, |
||||
|
'queryType': this.query.queryType, |
||||
|
'queryTitle': this.query.queryTitle, |
||||
|
'itemNo': this.query.itemNo, |
||||
|
'archiveCtgNo': this.query.archiveCtgNo, |
||||
|
'responsibleby': this.query.responsibleby, |
||||
|
'archiveNo': this.query.archiveNo, |
||||
|
'archiveYear': this.smartQuery.archiveYear, |
||||
|
'department': this.smartQuery.department, |
||||
|
'retention': this.smartQuery.retention, |
||||
|
'securityClass': this.smartQuery.securityClass, |
||||
|
'organizationMatter': this.smartQuery.organizationMatter, |
||||
|
'fondsNo': this.smartQuery.fondsNo, |
||||
|
'recordType': this.smartQuery.recordType, |
||||
|
'mediumType': this.smartQuery.mediumType |
||||
|
} |
||||
|
FetchInitArchivesView(params).then(data => { |
||||
|
this.getTableDisplayFieldsLoading = false |
||||
|
if (data) { |
||||
|
this[name] = data.list.content |
||||
|
this.yearGroup = data.yearGroup |
||||
|
this.page.total = data.list.totalElements |
||||
|
|
||||
|
// 自适应高度
|
||||
|
if (this[name].length === 0 || this[name].length < 10) { |
||||
|
this[heightName] = '' |
||||
|
} else { |
||||
|
const h = '100vh' |
||||
|
this[heightName] = `calc(${h} - 434px)` |
||||
|
} |
||||
|
|
||||
|
if (name === 'anjuanData' || name === 'junneiData') { |
||||
|
this[name].forEach((item, index) => { |
||||
|
// 入库状态
|
||||
|
if (item.is_storage === 0) { |
||||
|
this.storageTxt[index] = '未入' |
||||
|
if (item.is_borrow === '') { |
||||
|
this.borrowTxt[index] = '-' |
||||
|
} |
||||
|
} else if (item.is_storage === 1) { |
||||
|
this.storageTxt[index] = '待入' |
||||
|
if (item.is_borrow === '') { |
||||
|
this.borrowTxt[index] = '-' |
||||
|
} |
||||
|
} else if (item.is_storage === 2) { |
||||
|
this.storageTxt[index] = '已入' |
||||
|
if (item.is_borrow === '') { |
||||
|
this.borrowTxt[index] = '在库' |
||||
|
} |
||||
|
} else if (item.is_storage === 3) { |
||||
|
this.storageTxt[index] = '待出' |
||||
|
if (item.is_borrow === '') { |
||||
|
this.borrowTxt[index] = '-' |
||||
|
} |
||||
|
} else if (item.is_storage === '') { |
||||
|
this.storageTxt[index] = '未入' |
||||
|
if (item.is_borrow === '') { |
||||
|
this.borrowTxt[index] = '-' |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 借阅状态
|
||||
|
if (item.is_borrow === 1) { |
||||
|
this.borrowTxt[index] = '待借' |
||||
|
} else if (item.is_borrow === 2) { |
||||
|
this.borrowTxt[index] = '待借' |
||||
|
} else if (item.is_borrow === 3) { |
||||
|
this.borrowTxt[index] = '已借' |
||||
|
} else if (item.is_borrow === -1) { |
||||
|
this.borrowTxt[index] = '在库' |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
// 著录界面-form/详情-api
|
||||
|
handleForm(type, title, isAnOrJuan) { |
||||
|
if (type === 'add') { |
||||
|
this.formTitle = '新增' + title |
||||
|
this.arcId = null |
||||
|
// this.parentsId = this[name].id //案卷和卷内有 不确定
|
||||
|
} else if (type === 'edit') { |
||||
|
this.arcId = this.selections[0].id |
||||
|
this.formTitle = '编辑' + title |
||||
|
} |
||||
|
this.formVisible = true |
||||
|
this.form.dictionaryConfigId = {} |
||||
|
this.formPreviewData = [] |
||||
|
// 档案预编辑获取字段
|
||||
|
const params = { |
||||
|
categoryId: this.categoryId, |
||||
|
archivesId: this.arcId |
||||
|
} |
||||
|
this.getFormInfo(params, type, isAnOrJuan) |
||||
|
}, |
||||
|
getFormInfo(params, type, isAnOrJuan) { |
||||
|
FetchFormDisplayFields(params).then(data => { |
||||
|
this.formPreviewData = data.showFiled |
||||
|
this.$nextTick(() => { |
||||
|
if (type === 'edit') { |
||||
|
this.$refs.previewForm.addOrUpdateForm = data.echo |
||||
|
} else { |
||||
|
if (this.recycleMain.selectedCategory.isType !== 5) { |
||||
|
// 新增时拿到项目和案卷的相同的字段的值
|
||||
|
this.formPreviewData.forEach(item => { |
||||
|
if (isAnOrJuan === 1) { |
||||
|
if (this.recycleMain.selectedCategory.isType !== 3) { |
||||
|
if (this.recycleMain.projectSelection[item.fieldName]) { |
||||
|
this.$refs.previewForm.addOrUpdateForm = JSON.parse(JSON.stringify(this.recycleMain.projectSelection)) |
||||
|
} |
||||
|
} |
||||
|
} else if (isAnOrJuan === 2) { |
||||
|
if (this.recycleMain.anjuanSelection[item.fieldName]) { |
||||
|
this.$refs.previewForm.addOrUpdateForm = JSON.parse(JSON.stringify(this.recycleMain.anjuanSelection)) |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
this.isDesFormType = 'arcives' |
||||
|
this.$refs.previewForm.FetchNoFormatField(this.categoryId) |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
// form - submit
|
||||
|
handlerArchivesSubmit() { |
||||
|
this.$refs.previewForm.submitForm('addOrUpdateForm', this.categoryId) |
||||
|
this.selections = [] |
||||
|
}, |
||||
|
// 选择删除
|
||||
|
toDelete(data) { |
||||
|
// 已装盒的档案不可删除
|
||||
|
const indexCaseBool = data.findIndex(item => item.case_no !== '') |
||||
|
if (indexCaseBool !== -1) { |
||||
|
this.$message.error('已装盒的档案不可删除!') |
||||
|
} else { |
||||
|
this.$refs.deltArchives.deleteVisible = true |
||||
|
this.getTotalSumAll() |
||||
|
} |
||||
|
}, |
||||
|
getTotalSumAll() { |
||||
|
this.totalSumAll = 0 |
||||
|
this.selections.map((item) => { if (!isNaN(item.children_num)) this.totalSumAll += item.children_num }) |
||||
|
if (isNaN(this.totalSumAll)) { |
||||
|
return 0 |
||||
|
} |
||||
|
return this.totalSumAll |
||||
|
}, |
||||
|
// 删除 - 关闭
|
||||
|
handleClose(done) { |
||||
|
this.formVisible = false |
||||
|
done() |
||||
|
}, |
||||
|
/* 重新渲染table组件 防止table-fixed 错位 配合watch-table数据 */ |
||||
|
doLayout() { |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.table.doLayout() |
||||
|
}) |
||||
|
}, |
||||
|
// 上传附件
|
||||
|
uploadFile() { |
||||
|
this.uploadFileVisible = true |
||||
|
this.arcId = this.selections[0].id |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.uploadFile.tableData = [] |
||||
|
this.$refs.uploadFile.getFileList() |
||||
|
}) |
||||
|
}, |
||||
|
// 还原
|
||||
|
handleRestore() { |
||||
|
this.$refs.restore.restoreVisible = true |
||||
|
} |
||||
|
}, |
||||
|
// 组件挂载时的共用方法
|
||||
|
mounted() { |
||||
|
|
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue