|
|
@ -115,9 +115,20 @@ |
|
|
|
<span class="dialog-right-top" /> |
|
|
|
<span class="dialog-left-bottom" /> |
|
|
|
<div class="setting-dialog"> |
|
|
|
<!-- form --> |
|
|
|
<!-- @emitTableList="getTableList" --> |
|
|
|
<PreviewForm v-if="formPreviewData.length" ref="previewForm" :is-has-code="true" :is-disabled="false" :form-preview-data.sync="formPreviewData" :selected-category="selectedCategory" :parents-id="parentsId" :arc-id="arcId" :is-des-form-type="isDesFormType" /> |
|
|
|
<!-- form @emitTableList="getTableList" --> |
|
|
|
<PreviewForm |
|
|
|
v-if="formPreviewData.length" |
|
|
|
ref="previewForm" |
|
|
|
:is-has-code="true" |
|
|
|
:is-disabled="false" |
|
|
|
:form-preview-data.sync="formPreviewData" |
|
|
|
:selected-category="selectedCategory" |
|
|
|
:parents-id="parentsId" |
|
|
|
:arc-id="arcId" |
|
|
|
:is-des-form-type="isDesFormType" |
|
|
|
:collect-level="collectLevel" |
|
|
|
@close-dialog="closeDialog" |
|
|
|
/> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="handlerArchivesSubmit">保存</el-button> |
|
|
|
</div> |
|
|
@ -236,7 +247,7 @@ |
|
|
|
</div> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="text" @click="downloadVisible = false">取消</el-button> |
|
|
|
<el-button type="primary" @click.native="handleExportConfirm">确定</el-button> |
|
|
|
<el-button v-loading="delAllLoading" type="primary" @click.native="handleExportConfirm">确定</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
@ -291,13 +302,15 @@ |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
<div style="height: 30px; line-height: 30px; padding: 0 20px;"> <span v-if="(isTitleType !== 2 && selectedCategory.arrangeType === 3 ) || ((isTitleType === 4 || isTitleType === 6) && selectedCategory.arrangeType === 2) || (isTitleType === 6 && selectedCategory.arrangeType === 1)">{{ test }}</span></div> |
|
|
|
<div style="height: 30px; line-height: 30px; padding: 0 20px; font-size: 12px;"> <span v-if="(isTitleType !== 2 && selectedCategory.arrangeType === 3 ) || ((isTitleType === 4 || isTitleType === 6) && selectedCategory.arrangeType === 2) || (isTitleType === 6 && selectedCategory.arrangeType === 1)">{{ test }}</span></div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import CRUD from '@crud/crud' |
|
|
|
import { collectionLibraryCrud } from '../mixins/index' |
|
|
|
import { FetchInitCategoryInputFieldByPid } from '@/api/system/category/category' |
|
|
|
import { FetchDetailsById, collectDel } from '@/api/collect/collect' |
|
|
|
import { FetchArchivesClassTree } from '@/api/system/archivesClass' |
|
|
|
import { FetchDictionaryTree } from '@/api/system/dict' |
|
|
|
import Treeselect from '@riophae/vue-treeselect' |
|
|
@ -333,18 +346,10 @@ export default { |
|
|
|
type: Number, |
|
|
|
default: 2 |
|
|
|
}, |
|
|
|
arcId: { |
|
|
|
type: String, |
|
|
|
default: function() { |
|
|
|
return '' |
|
|
|
} |
|
|
|
selections: { |
|
|
|
type: Array, |
|
|
|
default: () => [] |
|
|
|
}, |
|
|
|
// selections: { |
|
|
|
// type: Array, |
|
|
|
// default: function() { |
|
|
|
// return [] |
|
|
|
// } |
|
|
|
// }, |
|
|
|
activeIndex: { |
|
|
|
type: Number, |
|
|
|
default: 0 |
|
|
@ -372,6 +377,7 @@ export default { |
|
|
|
}, |
|
|
|
projectOptions: [], |
|
|
|
classifyOptions: [], |
|
|
|
delAllLoading: false, |
|
|
|
deleteVisible: false, |
|
|
|
moveVisible: false, |
|
|
|
updateVisible: false, |
|
|
@ -383,7 +389,9 @@ export default { |
|
|
|
recoverVisible: false, |
|
|
|
completelyDeleteVisible: false, |
|
|
|
parentsId: null, // 父id |
|
|
|
isDesFormType: 'arcives' // 区分是门类得还是档案得 |
|
|
|
isDesFormType: 'arcives', // 区分是门类得还是档案得 |
|
|
|
collectLevel: null, |
|
|
|
arcId: null |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
@ -437,6 +445,31 @@ export default { |
|
|
|
this.getInitArchivesClass() |
|
|
|
this.getDictsList() |
|
|
|
} |
|
|
|
}, |
|
|
|
isTitleType: function(newValue, oldValue) { |
|
|
|
switch (newValue) { |
|
|
|
case 2: |
|
|
|
// 项目 |
|
|
|
this.collectLevel = 1 |
|
|
|
break |
|
|
|
case 3: |
|
|
|
if (this.selectedCategory.arrangeType === 1 || this.activeIndex === 1) { |
|
|
|
// 文件 |
|
|
|
this.collectLevel = 3 |
|
|
|
} else { |
|
|
|
// 案卷 |
|
|
|
this.collectLevel = 2 |
|
|
|
} |
|
|
|
break |
|
|
|
case 4: |
|
|
|
// 卷内 |
|
|
|
this.collectLevel = 3 |
|
|
|
break |
|
|
|
case 6: |
|
|
|
// 电子原文 |
|
|
|
this.collectLevel = 4 |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
@ -444,8 +477,10 @@ export default { |
|
|
|
mounted() { |
|
|
|
this.getInitArchivesClass() |
|
|
|
this.getDictsList() |
|
|
|
this.getLevel() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 筛选 - 档案分类 |
|
|
|
getInitArchivesClass() { |
|
|
|
this.classifyOptions = [] |
|
|
|
const params = { |
|
|
@ -467,16 +502,16 @@ export default { |
|
|
|
children: node.childArchivesClass |
|
|
|
} |
|
|
|
}, |
|
|
|
// 项目级别 - 阶段分类 |
|
|
|
getDictsList() { |
|
|
|
this.projectOptions = [] |
|
|
|
FetchDictionaryTree().then((res) => { |
|
|
|
console.log(res) |
|
|
|
const filterCodes = ['project_class'] |
|
|
|
let filteredItems = JSON.parse(JSON.stringify(res)).filter(item => filterCodes.includes(item.dictionaryCode)) |
|
|
|
filteredItems = this.addLevelToDictionaryList(filteredItems, 1) |
|
|
|
if (this.selectedCategory.arrangeType === 3 && this.isTitleType === 3) { |
|
|
|
this.projectOptions = filteredItems |
|
|
|
console.log(this.projectOptions) |
|
|
|
// console.log(this.projectOptions) |
|
|
|
} else { |
|
|
|
this.projectOptions = this.filterData(filteredItems, filteredItems[0].id) |
|
|
|
} |
|
|
@ -507,7 +542,7 @@ export default { |
|
|
|
return dictionaryList |
|
|
|
}, |
|
|
|
normalizerProject(node) { |
|
|
|
if (node.childDictionarys && !node.childDictionarys.length) { |
|
|
|
if ((node.childDictionarys && !node.childDictionarys.length) || node.childDictionarys === null) { |
|
|
|
delete node.childDictionarys |
|
|
|
} |
|
|
|
return { |
|
|
@ -525,10 +560,9 @@ export default { |
|
|
|
if (type === 'add') { |
|
|
|
this.formVisible = true |
|
|
|
this.formTitle = '新增' + this.collectTitle |
|
|
|
// this.arcId = null |
|
|
|
this.arcId = null |
|
|
|
} else if (type === 'edit') { |
|
|
|
console.log(this.selections) |
|
|
|
// this.arcId = this.selections[0].id |
|
|
|
this.arcId = this.selections[0].id |
|
|
|
if (this.selections.length === 0) { |
|
|
|
this.$message('您还未勾选需要操作的条目,请先确认!') |
|
|
|
return false |
|
|
@ -544,40 +578,71 @@ export default { |
|
|
|
// 档案预编辑获取字段 |
|
|
|
this.getFormInfo(type) |
|
|
|
}, |
|
|
|
handleFromEdit() { |
|
|
|
|
|
|
|
}, |
|
|
|
getLevel() { |
|
|
|
switch (this.isTitleType) { |
|
|
|
case 2: |
|
|
|
// 项目 |
|
|
|
this.collectLevel = 1 |
|
|
|
break |
|
|
|
case 3: |
|
|
|
if (this.selectedCategory.arrangeType === 1 || this.activeIndex === 1) { |
|
|
|
// 文件 |
|
|
|
this.collectLevel = 3 |
|
|
|
} else { |
|
|
|
// 案卷 |
|
|
|
this.collectLevel = 2 |
|
|
|
} |
|
|
|
break |
|
|
|
case 4: |
|
|
|
// 卷内 |
|
|
|
this.collectLevel = 3 |
|
|
|
break |
|
|
|
case 6: |
|
|
|
// 电子原文 |
|
|
|
this.collectLevel = 4 |
|
|
|
break |
|
|
|
} |
|
|
|
}, |
|
|
|
getFormInfo(type) { |
|
|
|
FetchInitCategoryInputFieldByPid({ categoryId: this.selectedCategory.id }).then(data => { |
|
|
|
this.formPreviewData = data |
|
|
|
this.$nextTick(() => { |
|
|
|
if (type === 'edit') { |
|
|
|
const params = { |
|
|
|
'categoryId': this.selectedCategory.id, |
|
|
|
'categoryLevel': this.collectLevel, |
|
|
|
'id': this.arcId |
|
|
|
} |
|
|
|
FetchDetailsById(params).then(data => { |
|
|
|
const showFiledAll = data.showFiled.filter(item => item.isSequence).sort((a, b) => a.isSequence - b.isSequence) |
|
|
|
this.$nextTick(() => { |
|
|
|
this.formPreviewData = showFiledAll |
|
|
|
this.isDesFormType = 'arcives' |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.previewForm.archivesType = 'edit' |
|
|
|
this.$refs.previewForm.addOrUpdateForm = data.echo |
|
|
|
this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} 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)) |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// } |
|
|
|
const params = { |
|
|
|
'categoryId': this.selectedCategory.id, |
|
|
|
'categoryLevel': this.collectLevel |
|
|
|
} |
|
|
|
FetchInitCategoryInputFieldByPid(params).then(data => { |
|
|
|
this.formPreviewData = data |
|
|
|
this.$nextTick(() => { |
|
|
|
this.isDesFormType = 'arcives' |
|
|
|
this.$refs.previewForm.archivesType = 'add' |
|
|
|
this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
// form - submit |
|
|
|
handlerArchivesSubmit() { |
|
|
|
this.formVisible = false |
|
|
|
this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id) |
|
|
|
this.selections = [] |
|
|
|
}, |
|
|
|
// 删除 - 关闭 |
|
|
|
handleClose(done) { |
|
|
@ -602,7 +667,25 @@ export default { |
|
|
|
}, |
|
|
|
// 删除 - 确认 |
|
|
|
handleDelConfirm() { |
|
|
|
this.delAllLoading = true |
|
|
|
const archivesIds = [] |
|
|
|
this.selections.forEach(val => { |
|
|
|
archivesIds.push(val.id) |
|
|
|
}) |
|
|
|
const params = { |
|
|
|
'categoryId': this.selectedCategory.id, |
|
|
|
'categoryLevel': this.collectLevel, |
|
|
|
'archivesIds': archivesIds |
|
|
|
} |
|
|
|
collectDel(params).then(() => { |
|
|
|
this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
|
|
|
this.deleteVisible = false |
|
|
|
this.crud.refresh() |
|
|
|
this.delAllLoading = false |
|
|
|
}).catch(err => { |
|
|
|
this.delAllLoading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 卷内 - 移除 确认 |
|
|
|
handleMoveConfirm() { |
|
|
@ -823,24 +906,14 @@ export default { |
|
|
|
}, |
|
|
|
handleCompletelyDelete() { |
|
|
|
this.completelyDeleteVisible = false |
|
|
|
}, |
|
|
|
closeDialog() { |
|
|
|
this.formVisible = false |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang='scss' scoped> |
|
|
|
.collect-filter{ |
|
|
|
display: flex; |
|
|
|
// width: 360px; |
|
|
|
height: 32px; |
|
|
|
justify-content: flex-end; |
|
|
|
::v-deep .vue-treeselect{ |
|
|
|
font-size: 12px; |
|
|
|
margin-right: 10px !important; |
|
|
|
.vue-treeselect__control{ |
|
|
|
height: 33px !important; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
</style> |