Browse Source

需求更新优化

master
xuhuajiao 4 days ago
parent
commit
ae3be0e7ea
  1. 11
      src/api/system/documentArchives.js
  2. 19
      src/views/archivesMIOD/miodLibrary/index.vue
  3. 72
      src/views/archivesMIOD/miodLibrary/module/detail.vue
  4. 222
      src/views/components/category/PreviewForm.vue
  5. 3
      src/views/login.vue

11
src/api/system/documentArchives.js

@ -360,6 +360,14 @@ export function FetchBorrowerPassInit(data) {
})
}
// 根据借阅人id获取借阅人信息
export function FetchBorrowerdsByIds(params) {
return request({
url: 'api/documentArchives/getBorrowerdsByIds' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export default {
FetchInitDocumentParam,
updateDocumentParam,
@ -401,5 +409,6 @@ export default {
FetchArchivesDetailsBorrowLog,
FetchLend,
FetchDocumentReturn,
FetchBorrowerPassInit
FetchBorrowerPassInit,
FetchBorrowerdsByIds
}

19
src/views/archivesMIOD/miodLibrary/index.vue

@ -145,7 +145,7 @@
<script>
import CRUD, { presenter, header } from '@crud/crud'
import { miodLibraryCrud } from './mixins/index'
import crudDocumentArchives, { FetchDelArchives, FetchCompleteDelArchives, FetchRestoreArchives, FetchInitDistributorAllByDocumentId } from '@/api/system/documentArchives'
import crudDocumentArchives, { FetchDelArchives, FetchCompleteDelArchives, FetchRestoreArchives, FetchInitDistributorAllByDocumentId, FetchBorrowerdsByIds } from '@/api/system/documentArchives'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import TreeList from './treeList'
@ -350,7 +350,6 @@ export default {
getFormInfo(params, type) {
this.archivesType = type
crudDocumentArchives.FetchDoeditDocument(params).then(data => {
console.log('data', data)
const showFiledAll = data.showFiled.filter(item => item.isSequence).sort((a, b) => a.isSequence - b.isSequence)
this.$nextTick(() => {
this.formPreviewData = showFiledAll
@ -384,6 +383,22 @@ export default {
this.$set(this.$refs.previewForm.addOrUpdateForm, 'miodDepts', null)
}
})
console.log('data.echo', data.echo)
if (data.echo.host_department) {
const hostParams = {
'search': data.echo.host_department
}
FetchBorrowerdsByIds(hostParams).then(res => {
console.log('res', res)
if (res && res.length !== 0) {
this.$refs.previewForm.hostDepartmentTags = res
// const ids = res.map(item => item.id)
// this.$set(this.$refs.previewForm.addOrUpdateForm, 'miodDepts', ids)
} else {
// this.$set(this.$refs.previewForm.addOrUpdateForm, 'miodDepts', null)
}
})
}
} else {
console.log('add')
}

72
src/views/archivesMIOD/miodLibrary/module/detail.vue

@ -22,7 +22,7 @@
<!-- 基本信息 -->
<div v-if="archivesTabIndex===0" class="base-info-new item-content">
<el-row>
<el-col v-for="(item,index) in archivesDetailsData" :key="index" :span="item.isLine ? 24 : 12" class="base-info-item">
<el-col v-for="(item,index) in archivesDetailsData" v-show="item.fieldName !== 'host_department'" :key="index" :span="item.isLine ? 24 : 12" class="base-info-item">
<span>{{ item.fieldCnName }}</span>
<p :style="{ width: ( item.editLength ? item.editLength+'px' : '' ), flex: ( !item.editLength ? 1 : '' ), whiteSpace: 'pre-line'}">{{ item.context }}</p>
</el-col>
@ -31,8 +31,19 @@
<!-- v-if="borrowerList.length !== 0" -->
<div class="childDevice-info">
<!-- <span>{{ borrowerList | formatBorrowerList }}</span> -->
<p>
<i style="font-style:normal; font-weight: bold;">传阅者</i>
<div class="childDevice-item">
<i class="tag-name">主办部门</i>
<el-tag
v-for="tag in hostList"
:key="tag.id"
class="new-depts"
:disable-transitions="false"
>
{{ tag.borrowName }}
</el-tag>
</div>
<div class="childDevice-item">
<i class="tag-name">传阅者</i>
<el-tag
v-for="tag in borrowerList"
:key="tag.id"
@ -41,9 +52,9 @@
>
{{ tag.borrowName }}
</el-tag>
</p>
</div>
</div>
<div style="display: flex; justify-content: space-between; align-items: center; margin-top: 20px; margin-bottom: 10px; padding: 0 20px 0 10px;">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding: 0 20px 0 10px;">
<h4 style="font-size: 16px; color: #1c1c1c;">文件列表</h4>
<div v-if="archivesFiledata.length !== 0 && !isMidoRecord">
<el-tooltip class="item" effect="dark" content="新增复印件" placement="top">
@ -55,7 +66,7 @@
v-loading="archivesFiledataLoading"
:data="archivesFiledata"
style="min-width: 100%;"
height="calc(100vh - 716px)"
height="calc(100vh - 756px)"
>
<el-table-column prop="reg_no" label="登记号" show-overflow-tooltip min-width="140" />
<el-table-column prop="details_type" label="类型" min-width="85">
@ -258,7 +269,7 @@
<script>
// import { crud } from '@crud/crud'
import { FetchArchivesDetails, FetchInitDocumentDetailsList, FetchAddDocumentDetails, FetchDeleteDocumentDetails, FetchInitDistributorAllByDocumentId, FetchInitOperate, FetchReadGW, FetchBingdingLabel, FetchUnbindTag, FetchArchivesDetailsBorrowLog, FetchLend } from '@/api/system/documentArchives'
import { FetchArchivesDetails, FetchInitDocumentDetailsList, FetchAddDocumentDetails, FetchDeleteDocumentDetails, FetchInitDistributorAllByDocumentId, FetchInitOperate, FetchReadGW, FetchBingdingLabel, FetchUnbindTag, FetchArchivesDetailsBorrowLog, FetchLend, FetchBorrowerdsByIds } from '@/api/system/documentArchives'
import { FetchInitBorrowerList } from '@/api/system/borrower'
import { mapGetters } from 'vuex'
@ -351,7 +362,8 @@ export default {
total: 0
},
singleSelectedDept: null,
currentLendData: null
currentLendData: null,
hostList: []
}
},
computed: {
@ -432,6 +444,25 @@ export default {
console.log('archivesDetailsData', data)
if (data.code !== 500) {
this.archivesDetailsData = data
const hostDepartmentItem = this.archivesDetailsData.find(
item => item.fieldName === 'host_department'
)
console.log('hostDepartmentItem', hostDepartmentItem)
if (hostDepartmentItem) {
const hostParams = {
'search': hostDepartmentItem.context
}
FetchBorrowerdsByIds(hostParams).then(data => {
if (data && data.length !== 0) {
this.hostList = data
} else {
this.hostList = []
}
})
} else {
this.hostList = []
}
} else {
this.archivesDetailsData = []
}
@ -440,6 +471,7 @@ export default {
FetchInitDistributorAllByDocumentId(distributorParams).then(data => {
this.borrowerList = data
})
]).catch(error => {
console.error('请求出错:', error)
})
@ -880,8 +912,9 @@ export default {
}
.childDevice-info{
display: flex;
flex-direction: column;
justify-content: flex-start;
padding: 9px 12px 11px 12px;
padding: 12px;
// background: rgb(255, 243, 229);
// border-radius: 3px;
// border: 1px solid rgb(254, 189, 152);
@ -889,7 +922,16 @@ export default {
// span{
// color: #545B65;
// }
.childDevice-item{
padding-bottom: 10px;
.tag-name{
display: inline-block;
font-style:normal;
font-weight: bold;
width: 80px;
text-align: right;
}
}
.el-tag{
margin-right: 10px;
&.no-depts{
@ -908,8 +950,14 @@ export default {
color: #07A35A !important;
}
}
&.new-depts{
border-color: #FEBD98;
color: #FF8329;
background-color: #FFF3E5;
::v-deep .el-icon-close{
color: #FF8329 !important;
}
}
}
}
</style>

222
src/views/components/category/PreviewForm.vue

@ -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;

3
src/views/login.vue

@ -190,7 +190,8 @@ export default {
this.$message({ message: res.message, type: 'warning', duration: 5000, offset: 8 })
this.getCode()
} else {
this.$router.push({ path: this.redirect || '/' })
// this.$router.push({ path: this.redirect || '/' })
this.$router.push({ path: '/' })
}
}).catch(res => {
this.loading = false

Loading…
Cancel
Save