Browse Source

批量成件

master
xuhuajiao 2 years ago
parent
commit
f79c81be2d
  1. 11
      src/api/prearchiveLibrary/prearchiveLibrary.js
  2. 5
      src/views/prearchiveLibrary/index.vue
  3. 197
      src/views/prearchiveLibrary/module/batchFile.vue
  4. 9
      src/views/prearchiveLibrary/module/scope.vue
  5. 15
      src/views/system/fieldCorresManage/index.vue

11
src/api/prearchiveLibrary/prearchiveLibrary.js

@ -56,4 +56,13 @@ export function FetchReDoeditIsRepeat(params) {
})
}
export default { add, prearchEdit, del, FetchInitPreDocument, FetchInitDocumentsViewTable, FetchDoeditDocument }
// 批量成件
export function FetchBatchToFile(data) {
return request({
url: 'api/re-document/batchToFile',
method: 'post',
data
})
}
export default { add, prearchEdit, del, FetchInitPreDocument, FetchInitDocumentsViewTable, FetchDoeditDocument, FetchBatchToFile }

5
src/views/prearchiveLibrary/index.vue

@ -28,8 +28,8 @@
</template>
<template v-slot:rightButtonGroup>
<div>
<el-button size="mini" :disabled="crud.selections.length === 0" @click="handleBatch"><i class="iconfont icon-piliangchengjian" />批量成件</el-button>
<el-button size="mini" :disabled="crud.selections.length === 0" @click="handelMerge"><i class="iconfont icon-hebingchengjian" />合并成件</el-button>
<el-button size="mini" :disabled="crud.selections.length === 0" @click="handleBatch(crud.selections)"><i class="iconfont icon-piliangchengjian" />批量成件</el-button>
<el-button size="mini" :disabled="crud.selections.length === 0" @click="handelMerge(crud.selections)"><i class="iconfont icon-hebingchengjian" />合并成件</el-button>
<el-button size="mini" :disabled="crud.selections.length === 0" @click="handleMove"><i class="iconfont icon-yidong" />移动</el-button>
</div>
</template>
@ -311,7 +311,6 @@ export default {
}).catch(() => {
})
},
handleBatch() {
this.$refs.batchForm.batchVisible = true
},

197
src/views/prearchiveLibrary/module/batchFile.vue

@ -44,7 +44,7 @@
</div>
<div class="field-list">
<div v-for="(item, index) in selectStatus" :key="index" class="field-item">
<el-select :key="index" v-model="item.fiedType">
<el-select :key="index" v-model="item.fiedType" @change="selectChangeFiedType(index)">
<el-option
v-for="v in fiedOption"
:key="v.value"
@ -60,7 +60,7 @@
<p>源分类文件库-文件表</p>
<span>{{ form.documentName }}</span>
</div>
<div class="field-list">
<div v-loading="leftLoading" class="field-list">
<div v-for="(item, index) in selectStatus" :key="index" class="field-item">
<el-select v-if="item.mode" :key="index" v-model="item.value" @change="selectChange(index)">
<el-option value="">请选择</el-option>
@ -82,10 +82,18 @@
<p>目标门类整理库/管理库-文件表</p>
<span>{{ selectedCategoryName }}</span>
</div>
<div class="field-list">
<div v-for="(item,index) in allFieldData" :key="index" class="field-item">
<p>{{ item.categoryFieldId.fieldCnName }}</p>
<div class="field-state"><span :class=" item.categoryFieldId.isInput ? 'is-select' : 'is-hide'">{{ item.categoryFieldId.isInput ? '显示': '隐藏' }}</span></div>
<div v-loading="rightLoading" class="field-list">
<div v-if="isCorrField">
<div v-for="(item,index) in allFieldData" :key="index" class="field-item">
<p>{{ item.categoryFieldId.fieldCnName }}</p>
<div class="field-state"><span :class=" item.categoryFieldId.isInput ? 'is-select' : 'is-hide'">{{ item.categoryFieldId.isInput ? '显示': '隐藏' }}</span></div>
</div>
</div>
<div v-else>
<div v-for="(item,index) in allCorrField" :key="index" class="field-item">
<p>{{ item.fieldCnName }}</p>
<div class="field-state"><span :class=" item.isInput ? 'is-select' : 'is-hide'">{{ item.isInput ? '显示': '隐藏' }}</span></div>
</div>
</div>
</div>
</div>
@ -93,7 +101,7 @@
</div>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="batchVisible = false">取消</el-button>
<el-button type="primary" @click="batchVisible = false">确定</el-button>
<el-button type="primary" @click="handleComfirmBatchToFile">确定</el-button>
</div>
</div>
</el-dialog>
@ -103,11 +111,12 @@
<script>
import { preLibraryCrud } from '../mixins/index'
// FetchInitFieldMateList
import { FetchInitFieldMate, FetchMateByDocumentId, FetchDetailsByDocumentIdAndCategoryId } from '@/api/system/fieldMate'
import { FetchDocumentMenu } from '@/api/system/fileLibrary/fileLibrary'
import { FetchCategoryMenu } from '@/api/system/category/category'
import { FetchInitDocumentFieldByPid } from '@/api/system/fileLibrary/fileLibrary'
import { FetchCategoryMenu, FetchInitCategoryFieldByPid } from '@/api/system/category/category'
import { FetchArchivesScopeByCategoryId } from '@/api/system/archivesScope'
import { FetchCheckRepeat } from '@/api/system/fieldMate'
// import { FetchBatchToFile } from '@/api/prearchiveLibrary/prearchiveLibrary'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
// import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
@ -136,7 +145,7 @@ export default {
documentName: '',
categoryId: null
},
selectedCategory: {},
batchCategory: {},
selectedCategoryName: null,
scopeVisible: false,
loadSource: [],
@ -147,10 +156,10 @@ export default {
},
fiedOption: [{
'label': '默认值',
'value': 1
'value': 2
}, {
'label': '字段值',
'value': 2
'value': 1
}],
fiedType: null,
selectStatus: [],
@ -160,7 +169,9 @@ export default {
allFieldData: [],
targetData: [],
leftLoading: false,
rightLoading: false
rightLoading: false,
isCorrField: true,
allCorrField: []
}
},
watch: {
@ -171,8 +182,6 @@ export default {
}
},
created() {
// this.getInitFieldMateList()
// this.getDocumentDataTree()
},
mounted() {
},
@ -194,7 +203,7 @@ export default {
getInitDetail(id) {
FetchInitFieldMate({ 'id': id }).then((res) => {
this.selectedCategoryName = res.categoryName
this.selectedCategory = res.fieldMateDetails[0].pid.categoryId
this.batchCategory = res.fieldMateDetails[0].pid.categoryId
this.form.categoryId = res.fieldMateDetails[0].pid.categoryId.pid
this.getArchivesScopeByCategoryId()
}).catch(err => {
@ -204,10 +213,9 @@ export default {
selectRules(val) {
this.getInitDetail(val)
this.selectStatus = []
// this.targetData = fieldData
// this.targetData.forEach((item, index) => {
// this.selectStatus.push({ mode: true, value: '' })
// })
this.allFieldData = []
this.allCorrField = []
this.isCorrField = true
},
//
getCategoryDataTree() {
@ -215,9 +223,37 @@ export default {
this.categoryTree = this.filterData(res)
})
},
getDocumentDataTree() {
FetchDocumentMenu().then(res => {
this.documentTree = this.filterData(res)
// pid
initDocunmentFiledList(documentId) {
//
this.leftLoading = true
FetchInitDocumentFieldByPid({ documentId: documentId, isType: 2 }).then((res) => {
this.options = res.sort((a, b) => {
if (a.isInput !== b.isInput) {
return a.isInput ? -1 : 1
} else {
return a.isSequence - b.isSequence
}
})
this.leftLoading = false
})
},
// pid
initCategoryFiledList(categoryId) {
//
this.rightLoading = true
FetchInitCategoryFieldByPid({ categoryId: categoryId, isType: 2 }).then((res) => {
this.allCorrField = res.sort((a, b) => {
if (a.isInput !== b.isInput) {
return a.isInput ? -1 : 1
} else {
return a.isSequence - b.isSequence
}
})
res.forEach((item, index) => {
this.selectStatus.push({ mode: true, fiedType: 2, value: '', field: item, isInput: item.isInput })
})
this.rightLoading = false
})
},
//
@ -227,10 +263,11 @@ export default {
'categoryId': this.form.categoryId,
'documentId': this.selectedDocument.id
}
this.initDocunmentFiledList(this.selectedDocument.id,)
FetchDetailsByDocumentIdAndCategoryId(params).then(res => {
this.allFieldData = res
res.forEach((item, index) => {
this.selectStatus.push({ mode: false, fiedType: item.categoryFieldId.isDefaultValue === '' ? 2 : 1, value: item.categoryFieldId.isDefaultValue === '' ? item.documentFieldId.fieldCnName : item.categoryFieldId.isDefaultValue, field: item.documentFieldId, isInput: item.documentFieldId.isInput })
this.selectStatus.push({ mode: false, fiedType: item.categoryFieldId.isDefaultValue === '' ? 1 : 2, value: item.categoryFieldId.isDefaultValue === '' ? item.documentFieldId.fieldCnName : item.categoryFieldId.isDefaultValue, field: item.documentFieldId, isInput: item.documentFieldId.isInput })
})
this.fieldLoading = false
})
@ -245,9 +282,10 @@ export default {
if (Array.isArray(res) && res.length === 1) {
this.form.scope = res[0].scopeName
} else {
this.getDetailsByDocumentIdAndCategoryId()
this.form.scope = null
console.log('有多个“归档范围”')
}
this.getDetailsByDocumentIdAndCategoryId()
})
},
handleSelectCategory(val) {
@ -259,32 +297,127 @@ export default {
this.$nextTick(() => {
if (this.form.categoryId) {
this.$refs.scopeModule.$refs.tree2.setCurrentKey(this.form.categoryId)
this.$refs.scopeModule.handleNodeClick2(this.selectedCategory)
console.log(this.batchCategory)
this.$refs.scopeModule.handleNodeClick2(this.batchCategory)
}
})
},
hanleScopeSelect(val, category) {
console.log('category', category)
if (val.length !== 0) {
this.form.scope = val[0].scopeName
console.log('val', val)
this.form.categoryId = category.id
this.batchCategory = category
this.selectedCategoryName = category.cnName
this.$nextTick(() => {
this.getCheckRepeat()
})
}
},
getCheckRepeat() {
const params = {
'categoryId': this.form.categoryId,
'documentId': this.selectedDocument.id
}
this.fieldLoading = true
FetchCheckRepeat(params).then((res) => {
if (JSON.stringify(res) === JSON.stringify({})) {
console.log('不存在对应关系')
this.isCorrField = false
this.$message({
message: '目标门类与当前源分类不存在对应关系',
type: 'warning'
})
this.form.ruleName = null
this.selectStatus = []
this.initDocunmentFiledList(this.selectedDocument.id)
this.initCategoryFiledList(this.form.categoryId)
} else {
console.log('存在对应关系')
this.isCorrField = true
this.selectStatus = []
this.allFieldData = []
this.form.ruleName = res.id
this.getDetailsByDocumentIdAndCategoryId()
}
this.fieldLoading = false
})
},
// "" / ""
selectChangeFiedType(index) {
this.options.forEach((item) => {
if (this.selectStatus[index].fiedType === 1) {
this.selectStatus.splice(index, 1, { mode: false, fiedType: this.selectStatus[index].fiedType, value: this.allFieldData[index].categoryFieldId.isDefaultValue, field: item, isInput: item.isInput })
} else {
this.selectStatus.splice(index, 1, { mode: true, fiedType: this.selectStatus[index].fiedType, value: '', field: item, isInput: item.isInput })
}
})
},
selectChange(index) {
this.options.forEach((item) => {
if (item.fieldCnName === this.selectStatus[index].value) {
this.selectStatus.splice(index, 1, { mode: false, value: this.selectStatus[index].value, field: item, isInput: item.isInput })
if (this.selectStatus[index].fiedType === 1) {
this.selectStatus.splice(index, 1, { mode: false, fiedType: 1, value: this.selectStatus[index].value, field: item, isInput: item.isInput })
} else {
if (item.fieldCnName === this.selectStatus[index].value) {
this.selectStatus.splice(index, 1, { mode: false, fiedType: this.allFieldData[index].categoryFieldId.isDefaultValue === '' ? 1 : 2, value: this.allFieldData[index].categoryFieldId.isDefaultValue === '' ? this.selectStatus[index].value : this.allFieldData[index].categoryFieldId.isDefaultValue, field: item, isInput: item.isInput })
}
}
})
},
textMode(index) {
this.selectStatus.splice(index, 1, { mode: true, value: this.selectStatus[index].value, field: null, isInput: this.selectStatus[index].isInput })
if (this.selectStatus[index].fiedType === 1) {
this.selectStatus.splice(index, 1, { mode: true, fiedType: 1, value: this.selectStatus[index].value, field: null, isInput: this.selectStatus[index].isInput })
}
},
handleClose(done) {
this.batchVisible = false
Object.assign(this.form, {
ruleName: null,
scope: null,
documentId: null,
categoryId: null
})
this.selectedCategoryName = null
this.allFieldData = []
done()
},
handleComfirmBatchToFile() {
// const getIndicesByMode = (modeValue) => {
// return this.selectStatus.reduce((indices, item, index) => {
// if (item.mode === modeValue) {
// indices.push(index)
// }
// return indices
// }, [])
// }
// const indices = getIndicesByMode(false)
console.log(this.selectStatus)
const filteredDocumentList = this.selectStatus.map(item => {
if (item.hasOwnProperty('field')) {
const fieldValue = item['field'] //
return {
...fieldValue, // field
getType: item.fiedType // fieldgetType
}
} else {
return item
}
})
console.log('filteredDocumentList', filteredDocumentList)
console.log(this.allFieldData)
const filteredCategoryList = this.allFieldData.map(item => {
})
console.log(filteredCategoryList)
const params = {
'archivesIds': [],
'categoryId': this.selectedDocument.id,
'documentId': this.form.categoryId,
'dtos': []
}
console.log(params)
// FetchBatchToFile().then((res) => {
// })
},
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children

9
src/views/prearchiveLibrary/module/scope.vue

@ -117,8 +117,8 @@ export default {
},
//
handleNodeClick2(val) {
console.log('222', val)
console.log('33', val.isType)
console.log('handleNodeClick2', val)
console.log('handleNodeClick233', val.isType)
if (val) {
this.selectedCategory = val
if (val.pid !== '0') {
@ -131,11 +131,11 @@ export default {
let params
if (data.isType !== 3) {
params = {
'categoryId': this.selectedCategory.id
'categoryId': data.id
}
} else {
params = {
'categoryId': this.selectedCategory.pid
'categoryId': data.pid
}
}
FetchInitArchivesScope(params).then(res => {
@ -186,6 +186,7 @@ export default {
},
confirmedScope() {
this.scopeVisible = false
console.log('confirmedScope', this.selectedCategory)
this.$emit('getScope', this.selections, this.selectedCategory)
},
handleClose(done) {

15
src/views/system/fieldCorresManage/index.vue

@ -209,7 +209,8 @@ export default {
if (JSON.stringify(res) === JSON.stringify({})) {
//
this.$refs.corresForm.corresVisible = true
this.$refs.corresForm.documentName = this.selectedDocumentName
this.$refs.corresForm.title = '新增对应关系'
this.$refs.corresForm.documentName = null
this.$refs.corresForm.cuform.documentId = this.form.documentId
this.$refs.corresForm.categoryName = this.selectedCategoryName
this.$refs.corresForm.cuform.categoryId = this.form.categoryId
@ -291,6 +292,13 @@ export default {
}
})
this.$refs.corresForm.leftLoading = false
this.$nextTick(() => {
this.$refs.corresForm.title = '编辑对应关系'
this.$refs.corresForm.corresVisible = true
this.$nextTick(() => {
this.editGetMate(row.id)
})
})
})
//
FetchInitCategoryField({ categoryId: row.category_id, isType: 2 }).then((res) => {
@ -306,11 +314,6 @@ export default {
})
this.$refs.corresForm.rightLoading = false
})
this.$nextTick(() => {
this.$refs.corresForm.title = '编辑对应关系'
this.$refs.corresForm.corresVisible = true
this.editGetMate(row.id)
})
},
editGetMate(id) {
crudFieldMate.FetchInitFieldMate({ id: id }).then((res) => {

Loading…
Cancel
Save