|
|
@ -6,7 +6,7 @@ |
|
|
|
<draggable v-bind="{draggable:'.drag-item',animation:500}" :disabled="!isDraggable" @update="datadragEnd"> |
|
|
|
<el-col |
|
|
|
v-for="(item,index) in formPreviewData" |
|
|
|
v-show="item.fieldName !== 'barcode' && item.fieldName !== 'is_entity'" |
|
|
|
v-show="item.fieldName !== 'barcode' && item.fieldName !== 'is_entity' && item.fieldName !== 'host_department'" |
|
|
|
:key="index" |
|
|
|
:class="[ |
|
|
|
'drag-item', |
|
|
@ -76,6 +76,27 @@ |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row v-if="isDesFormType === 'miodLibrary' " class="preview-form-bottom miod-form-bottom "> |
|
|
|
<el-col> |
|
|
|
<el-form-item |
|
|
|
v-if="formPreviewData[hostDepartmentIndex] && formPreviewData[hostDepartmentIndex].fieldName === 'host_department'" |
|
|
|
:label="formPreviewData[hostDepartmentIndex].fieldCnName" |
|
|
|
:prop="formPreviewData[hostDepartmentIndex].fieldName" |
|
|
|
> |
|
|
|
<div class="miod-depts-input" style="height: 42px;" @click="showDeptsDialog(1)"> |
|
|
|
<el-tag |
|
|
|
v-for="tag in hostDepartmentTags" |
|
|
|
:key="tag.id" |
|
|
|
v-model="addOrUpdateForm[formPreviewData[hostDepartmentIndex].fieldName]" |
|
|
|
class="new-depts" |
|
|
|
closable |
|
|
|
:disable-transitions="false" |
|
|
|
@close="handleCloseDeptsTag(1, tag, $event)" |
|
|
|
> |
|
|
|
{{ tag.borrowName }} |
|
|
|
</el-tag> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col> |
|
|
|
<!-- :rules="[ |
|
|
|
{ required: true, message: '请选择', trigger: 'blur' } |
|
|
@ -85,7 +106,7 @@ |
|
|
|
prop="miodDepts" |
|
|
|
> |
|
|
|
<!-- :class="{'miod-depts-input null-input': miodDeptsTags.length === 0 && deptsValid, 'miod-depts-input': !deptsValid || miodDeptsTags.length !== 0}" 暂时先不必填 --> |
|
|
|
<div class="miod-depts-input" @click="showDeptsDialog"> |
|
|
|
<div class="miod-depts-input" @click="showDeptsDialog(2)"> |
|
|
|
<!-- :class="tag.readType === 0 ? 'no-depts' : tag.readType === 1 ? 'lending-depts' : ''" --> |
|
|
|
<el-tag |
|
|
|
v-for="tag in miodDeptsTags" |
|
|
@ -94,7 +115,7 @@ |
|
|
|
:class="(!tag.readType && tag.readType!==0) ? 'no-depts' : tag.readType === 0 ? 'no-depts' : tag.readType === 1 ? 'lending-depts' : ''" |
|
|
|
closable |
|
|
|
:disable-transitions="false" |
|
|
|
@close="handleCloseDeptsTag(tag, $event)" |
|
|
|
@close="handleCloseDeptsTag(2, tag, $event)" |
|
|
|
> |
|
|
|
{{ tag.borrowName }} |
|
|
|
</el-tag> |
|
|
@ -179,8 +200,10 @@ |
|
|
|
<span class="dialog-right-top" /> |
|
|
|
<span class="dialog-left-bottom" /> |
|
|
|
<div class="setting-dialog"> |
|
|
|
<!-- :class="item.readType === null ? '' : item.readType === 0 ? '' : item.readType === 1 ? 'lending-depts' : item.readType === 2 ? 'blue-depts' : ''" --> |
|
|
|
<div style="padding-bottom: 10px; "><el-checkbox v-model="allChecked" style=" color: #0c0e1e;">全选</el-checkbox></div> |
|
|
|
<ul class="checkbox-list-depts"> |
|
|
|
<li v-for="(item, index) in deptsMiodTable" :key="index" :class="item.readType === null ? '' : item.readType === 0 ? '' : item.readType === 1 ? 'lending-depts' : item.readType === 2 ? 'blue-depts' : ''"> |
|
|
|
<li v-for="(item, index) in deptsMiodTable" :key="index" :class="getDeptClass(item)"> |
|
|
|
<el-checkbox v-model="item.checked" @change="handleCheckChange(item)"> |
|
|
|
<div> |
|
|
|
<el-tooltip class="item" effect="dark" :content="item.borrowName" placement="top-start"> |
|
|
@ -319,6 +342,7 @@ export default { |
|
|
|
mergeFileCategory: null, |
|
|
|
activeIndex: null, |
|
|
|
entityIndex: null, |
|
|
|
hostDepartmentIndex: null, |
|
|
|
fileList: [], |
|
|
|
archivesSummaryResponse: {}, |
|
|
|
regNoArrayVal: [], |
|
|
@ -334,7 +358,12 @@ export default { |
|
|
|
deptsValid: false, |
|
|
|
// 待选中的ID列表 |
|
|
|
pendingSelectionIds: [], |
|
|
|
allTagStates: {} |
|
|
|
allTagStates: {}, |
|
|
|
hostDepartmentSelections: [], |
|
|
|
hostDepartmentTags: [], |
|
|
|
pendingSelectionHostIds: [], |
|
|
|
tagsType: null |
|
|
|
// allChecked: false |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
@ -363,6 +392,34 @@ export default { |
|
|
|
|
|
|
|
return row.level ? row.level === 3 : true |
|
|
|
} |
|
|
|
}, |
|
|
|
// 计算属性:用于判断是否所有部门都被选中 |
|
|
|
allChecked: { |
|
|
|
get() { |
|
|
|
if (this.tagsType === 1) { |
|
|
|
return this.hostDepartmentSelections.length === this.deptsMiodTable.length |
|
|
|
} else { |
|
|
|
return this.miodDeptsSelections.length === this.deptsMiodTable.length |
|
|
|
} |
|
|
|
}, |
|
|
|
set(newVal) { |
|
|
|
this.deptsMiodTable.forEach(item => { |
|
|
|
item.checked = newVal |
|
|
|
if (newVal) { |
|
|
|
if (this.tagsType === 1 && !this.hostDepartmentSelections.some(dept => dept.id === item.id)) { |
|
|
|
this.hostDepartmentSelections.push(item) |
|
|
|
} else if (this.tagsType !== 1 && !this.miodDeptsSelections.some(dept => dept.id === item.id)) { |
|
|
|
this.miodDeptsSelections.push(item) |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (this.tagsType === 1) { |
|
|
|
this.hostDepartmentSelections = this.hostDepartmentSelections.filter(dept => dept.id !== item.id) |
|
|
|
} else { |
|
|
|
this.miodDeptsSelections = this.miodDeptsSelections.filter(dept => dept.id !== item.id) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
@ -388,33 +445,72 @@ export default { |
|
|
|
mounted() { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getDeptClass(item) { |
|
|
|
if (item.startTime === null && item.actualReturnTime === null) { |
|
|
|
// 未传阅 |
|
|
|
return '' |
|
|
|
} else if (item.startTime !== null && item.actualReturnTime === null) { |
|
|
|
// 传阅中 |
|
|
|
return 'lending-depts' |
|
|
|
} else { |
|
|
|
// 已完成 |
|
|
|
return 'blue-depts' |
|
|
|
} |
|
|
|
}, |
|
|
|
onDialogOpen() { |
|
|
|
console.log('this.tagsType444', this.tagsType) |
|
|
|
// this.pendingSelectionIds = this.miodDeptsTags.map(tag => tag.id) |
|
|
|
// 初始化时保存所有标签的状态到allTagStates |
|
|
|
this.miodDeptsTags.forEach(tag => { |
|
|
|
this.allTagStates[tag.id] = { |
|
|
|
readType: tag.readType |
|
|
|
} |
|
|
|
}) |
|
|
|
if (this.tagsType === 1) { |
|
|
|
this.hostDepartmentTags.forEach(tag => { |
|
|
|
this.allTagStates[tag.id] = { |
|
|
|
readType: tag.readType |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.miodDeptsTags.forEach(tag => { |
|
|
|
this.allTagStates[tag.id] = { |
|
|
|
readType: tag.readType |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
this.pendingSelectionIds = this.miodDeptsTags |
|
|
|
this.pendingSelectionHostIds = this.hostDepartmentTags |
|
|
|
}, |
|
|
|
showDeptsDialog() { |
|
|
|
showDeptsDialog(tagsType) { |
|
|
|
this.deptsVisible = true |
|
|
|
this.tagsType = tagsType |
|
|
|
this.fetchDeptsList() |
|
|
|
}, |
|
|
|
// 获取部门/人员列表 |
|
|
|
fetchDeptsList() { |
|
|
|
// this.btnLoading = true |
|
|
|
FetchInitBorrowerListOrderNo() |
|
|
|
let documentId |
|
|
|
if (this.selectedDocument.isType === 2) { |
|
|
|
documentId = this.selectedDocument.id |
|
|
|
} else { |
|
|
|
documentId = this.selectedDocument.documentId |
|
|
|
} |
|
|
|
const param = { |
|
|
|
'archivesId': this.arcId, |
|
|
|
'documentId': documentId |
|
|
|
} |
|
|
|
console.log('param', param) |
|
|
|
FetchInitBorrowerListOrderNo(param) |
|
|
|
.then(res => { |
|
|
|
this.deptsMiodTable = res || [] |
|
|
|
// this.pageDepts.total = res.totalElements || 0 |
|
|
|
|
|
|
|
// 在恢复选中状态之前,先恢复所有项的readType |
|
|
|
this.restoreAllReadTypes() |
|
|
|
// this.restoreAllReadTypes() |
|
|
|
|
|
|
|
// 数据加载完成后恢复选中状态 |
|
|
|
this.restoreSelectionState() |
|
|
|
if (this.tagsType === 1) { |
|
|
|
this.restoreHostSelectionState() |
|
|
|
} else { |
|
|
|
this.restoreSelectionState() |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(error => { |
|
|
|
this.$message.error('获取数据失败,请稍后重试') |
|
|
@ -426,12 +522,21 @@ export default { |
|
|
|
}, |
|
|
|
handleCheckChange(item) { |
|
|
|
if (item.checked) { |
|
|
|
this.miodDeptsSelections.push(item) |
|
|
|
if (this.tagsType === 1) { |
|
|
|
this.hostDepartmentSelections.push(item) |
|
|
|
} else { |
|
|
|
this.miodDeptsSelections.push(item) |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 取消选中时从已选数组移除 |
|
|
|
this.miodDeptsSelections = this.miodDeptsSelections.filter( |
|
|
|
dept => dept.id !== item.id |
|
|
|
) |
|
|
|
if (this.tagsType === 1) { |
|
|
|
this.hostDepartmentSelections = this.hostDepartmentSelections.filter( |
|
|
|
dept => dept.id !== item.id |
|
|
|
) |
|
|
|
} else { |
|
|
|
this.miodDeptsSelections = this.miodDeptsSelections.filter( |
|
|
|
dept => dept.id !== item.id |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
restoreAllReadTypes() { |
|
|
@ -448,7 +553,34 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
restoreHostSelectionState() { |
|
|
|
this.$nextTick(() => { |
|
|
|
console.log('this.pendingSelectionHostIds', this.pendingSelectionHostIds) |
|
|
|
|
|
|
|
if (this.deptsMiodTable.length > 0 && this.pendingSelectionHostIds.length > 0) { |
|
|
|
// 初始化表格项的状态 |
|
|
|
this.deptsMiodTable.forEach(item => { |
|
|
|
this.$set(item, 'checked', false) |
|
|
|
}) |
|
|
|
|
|
|
|
// 恢复选中状态 |
|
|
|
this.hostDepartmentSelections = [] |
|
|
|
this.pendingSelectionHostIds.forEach(selection => { |
|
|
|
const tableItem = this.deptsMiodTable.find(item => String(item.id) === String(selection.id)) |
|
|
|
if (tableItem) { |
|
|
|
this.$set(tableItem, 'checked', true) |
|
|
|
this.hostDepartmentSelections.push(tableItem) |
|
|
|
} |
|
|
|
}) |
|
|
|
this.pendingSelectionHostIds = [] |
|
|
|
} else { |
|
|
|
this.deptsMiodTable.forEach(item => { |
|
|
|
this.$set(item, 'checked', false) |
|
|
|
}) |
|
|
|
this.hostDepartmentSelections = [] |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
restoreSelectionState() { |
|
|
|
this.$nextTick(() => { |
|
|
|
console.log('this.pendingSelectionIds', this.pendingSelectionIds) |
|
|
@ -468,7 +600,6 @@ export default { |
|
|
|
this.miodDeptsSelections.push(tableItem) |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log('this.deptsMiodTable', this.deptsMiodTable) |
|
|
|
this.pendingSelectionIds = [] |
|
|
|
} else { |
|
|
|
this.deptsMiodTable.forEach(item => { |
|
|
@ -478,26 +609,42 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleCloseDeptsTag(tag, event) { |
|
|
|
handleCloseDeptsTag(type, tag, event) { |
|
|
|
event.stopPropagation() |
|
|
|
// 在删除标签前,保存其状态 |
|
|
|
this.allTagStates[tag.id] = { |
|
|
|
readType: tag.readType |
|
|
|
// 可以保存其他需要的状态 |
|
|
|
} |
|
|
|
|
|
|
|
this.miodDeptsTags.splice(this.miodDeptsTags.indexOf(tag), 1) |
|
|
|
if (this.miodDeptsTags.length === 0) { |
|
|
|
this.$set(this.addOrUpdateForm, 'miodDepts', null) |
|
|
|
if (type === 1) { |
|
|
|
this.hostDepartmentTags.splice(this.hostDepartmentTags.indexOf(tag), 1) |
|
|
|
if (this.hostDepartmentTags.length === 0) { |
|
|
|
this.$set(this.addOrUpdateForm, 'host_department', null) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.miodDeptsTags.splice(this.miodDeptsTags.indexOf(tag), 1) |
|
|
|
if (this.miodDeptsTags.length === 0) { |
|
|
|
this.$set(this.addOrUpdateForm, 'miodDepts', null) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
handleComfireDepts() { |
|
|
|
if (this.miodDeptsSelections.length === 0) { |
|
|
|
this.$message.warning('请选择部门/人员') |
|
|
|
return |
|
|
|
if (this.tagsType === 1) { |
|
|
|
if (this.hostDepartmentSelections.length === 0) { |
|
|
|
this.$message.warning('请选择主办部门人员') |
|
|
|
return |
|
|
|
} |
|
|
|
this.hostDepartmentTags = [...this.hostDepartmentSelections] |
|
|
|
console.log('this.hostDepartmentTags', this.hostDepartmentTags) |
|
|
|
} else { |
|
|
|
if (this.miodDeptsSelections.length === 0) { |
|
|
|
this.$message.warning('请选择部门/人员') |
|
|
|
return |
|
|
|
} |
|
|
|
this.miodDeptsTags = [...this.miodDeptsSelections] |
|
|
|
console.log('this.miodDeptsTags', this.miodDeptsTags) |
|
|
|
} |
|
|
|
this.miodDeptsTags = [...this.miodDeptsSelections] |
|
|
|
console.log('this.miodDeptsTags', this.miodDeptsTags) |
|
|
|
|
|
|
|
this.deptsVisible = false |
|
|
|
}, |
|
|
|
refreshTreeList() { |
|
|
@ -1130,6 +1277,7 @@ export default { |
|
|
|
console.log('this.archivesType-editFormRow', this.archivesType) |
|
|
|
this.rules = {} |
|
|
|
this.entityIndex = this.formPreviewData.findIndex(item => item.fieldName === 'is_entity') |
|
|
|
this.hostDepartmentIndex = this.formPreviewData.findIndex(item => item.fieldName === 'host_department') |
|
|
|
if (this.isDesFormType === 'prearchiveLibrary' && this.archivesType === 'add') { |
|
|
|
this.$set(this.addOrUpdateForm, 'fileOriginal', null) |
|
|
|
} |
|
|
@ -1345,6 +1493,13 @@ export default { |
|
|
|
this.$set(this.addOrUpdateForm, 'miodDepts', null) |
|
|
|
} |
|
|
|
|
|
|
|
if (this.hostDepartmentTags.length !== 0) { |
|
|
|
const ids = this.hostDepartmentTags.map(item => item.id).join(',') |
|
|
|
this.$set(this.addOrUpdateForm, 'host_department', ids) |
|
|
|
} else { |
|
|
|
this.$set(this.addOrUpdateForm, 'host_department', null) |
|
|
|
} |
|
|
|
|
|
|
|
console.log('this.addOrUpdateForm', this.addOrUpdateForm) |
|
|
|
|
|
|
|
this.$refs[formName].validate((valid, fields) => { |
|
|
@ -1829,7 +1984,7 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
.library-form-miod{ |
|
|
|
height: calc(100vh - 410px) !important; |
|
|
|
height: calc(100vh - 486px) !important; |
|
|
|
overflow: hidden; |
|
|
|
overflow-y: scroll; |
|
|
|
} |
|
|
@ -1851,11 +2006,12 @@ export default { |
|
|
|
.miod-depts-input{ |
|
|
|
// width: 500px; |
|
|
|
width: 537px; |
|
|
|
height: 80px; |
|
|
|
height: 94px; |
|
|
|
padding: 5px 15px; |
|
|
|
border: 1px solid #e6e8ed; |
|
|
|
border-radius: 4px; |
|
|
|
margin-bottom: 4px; |
|
|
|
overflow-y: scroll; |
|
|
|
&.null-input{ |
|
|
|
border-color: #ed4a41; |
|
|
|
} |
|
|
@ -1930,7 +2086,7 @@ export default { |
|
|
|
width: calc(100% / 5 - 10px); |
|
|
|
height: 40px; |
|
|
|
margin-right: 10px; |
|
|
|
margin-bottom: 10px; |
|
|
|
margin-top: 10px; |
|
|
|
overflow: hidden; |
|
|
|
&:hover{ |
|
|
|
background-color: #EAF3FB; |
|
|
|