Browse Source

公文

master
xuhuajiao 1 month ago
parent
commit
6c0a5589fc
  1. 25
      src/api/system/documentArchives.js
  2. BIN
      src/assets/images/errRecord.png
  3. 19
      src/views/archivesMIOD/miodLibrary/index.vue
  4. 213
      src/views/archivesMIOD/miodLibrary/module/detail.vue
  5. 17
      src/views/archivesMIOD/miodLibrary/treeList.vue
  6. 45
      src/views/components/category/PreviewForm.vue

25
src/api/system/documentArchives.js

@ -116,15 +116,32 @@ export function FetchInitDocumentDetailsList(params) {
})
}
// 添加公文文件
export function FetchAddDocumentDetails(data) {
return request({
url: 'api/documentArchives/addDocumentDetails',
method: 'post',
data
})
}
// 删除公文文件
export function FetchDelelteDocumentDetails(data) {
export function FetchDeleteDocumentDetails(data) {
return request({
url: 'api/documentArchives/delelteDocumentDetails',
url: 'api/documentArchives/deleteDocumentDetails',
method: 'post',
data
})
}
// 根据公文id获取需阅读者信息
export function FetchInitDistributorByDocumentId(params) {
return request({
url: 'api/documentArchives/initDistributorByDocumentId' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export default {
FetchInitDocumentParam,
updateDocumentParam,
@ -139,5 +156,7 @@ export default {
FetchArchivesDetails,
FetchHandleDocument,
FetchInitDocumentDetailsList,
FetchDelelteDocumentDetails
FetchAddDocumentDetails,
FetchDeleteDocumentDetails,
FetchInitDistributorByDocumentId
}

BIN
src/assets/images/errRecord.png

After

Width: 200  |  Height: 200  |  Size: 4.2 KiB

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

@ -141,7 +141,7 @@
<script>
import CRUD, { presenter, header } from '@crud/crud'
import { miodLibraryCrud } from './mixins/index'
import crudDocumentArchives, { FetchDelArchives, FetchCompleteDelArchives, FetchRestoreArchives } from '@/api/system/documentArchives'
import crudDocumentArchives, { FetchDelArchives, FetchCompleteDelArchives, FetchRestoreArchives, FetchInitDistributorByDocumentId } from '@/api/system/documentArchives'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
@ -372,15 +372,24 @@ export default {
if (type === 'edit') {
this.$refs.previewForm.archivesType = 'edit'
this.$refs.previewForm.addOrUpdateForm = data.echo
if (data.fileecho) {
const fileecho = []
fileecho.push(data.fileecho)
this.$refs.previewForm.fileOriginal = fileecho[0].file_name
this.$refs.previewForm.fileJsonString = JSON.stringify(fileecho)
this.$refs.previewForm.fileOriginal = data.fileecho.file_name || null
this.$refs.previewForm.fileJsonString = JSON.stringify([data.fileecho])
} else {
this.$refs.previewForm.fileOriginal = ''
this.$refs.previewForm.fileJsonString = ''
}
//
FetchInitDistributorByDocumentId(params).then(res => {
if (res && res.length !== 0) {
this.$refs.previewForm.miodDeptsTags = 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 {
this.$refs.previewForm.archivesType = 'add'
}

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

@ -11,38 +11,42 @@
<li :class="{'active-tab-nav': archivesTabIndex == 2}" @click="changeActiveTab(2)">操作记录</li>
</ul>
<div style="position: absolute; right: 0; top:0;">
<span class="row-state defalut-state">未传阅</span>
<!-- <span class="row-state soon-state">传阅中</span> -->
<!-- <span class="row-state end-state">已传阅</span> -->
<span
class="row-state"
:class="getStateClass(readStatus)"
>
{{ readStatus || '未传阅' }}
</span>
</div>
<!-- 基本信息 -->
<div v-if="archivesTabIndex===0" class="base-info item-content">
<el-row>
<el-col v-for="(item,index) in archivesDetailsData" :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 : '' )}">{{ item.context }}</p>
<p :style="{ width: ( item.editLength ? item.editLength+'px' : '' ), flex: ( !item.editLength ? 1 : '' ), whiteSpace: 'pre-line'}">{{ item.context }}</p>
</el-col>
</el-row>
<div>
<div class="childDevice-info">
<p><i style="font-style:normal; font-weight: bold;">待传阅者</i><span>张三李四</span></p>
<div v-if="borrowerList.length !== 0" class="childDevice-info">
<p><i style="font-style:normal; font-weight: bold;">待传阅者</i><span>{{ borrowerList | formatBorrowerList }}</span></p>
</div>
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding: 0 20px 0 10px;">
<div style="display: flex; justify-content: space-between; align-items: center; margin-top: 20px; margin-bottom: 10px; padding: 0 20px 0 10px;">
<h4 style="font-size: 16px; color: #1c1c1c;">文件列表</h4>
<el-button size="mini" style="padding: 7px 7px 7px 10px; ">
<el-button v-if="archivesFiledata.length !== 0" size="mini" style="padding: 7px 7px 7px 10px; " @click="handleAddDocDetails">
<i class="iconfont icon-tianjiawenjian" />
</el-button>
</div>
<el-table
v-loading="archivesFiledataLoading"
:data="archivesFiledata"
style="min-width: 100%"
style="min-width: 100%;"
height="calc(100vh - 716px)"
>
<el-table-column prop="reg_no" label="登记号" show-overflow-tooltip min-width="140" />
<el-table-column prop="details_type" label="类型" min-width="85">
<template slot-scope="scope">
<el-tag v-if="scope.row.details_type === 1" type="success">原件</el-tag>
<el-tag v-else type="info">复印件</el-tag>
<el-tag v-if="scope.row.details_type === 1">原件</el-tag>
<el-tag v-else>复印件</el-tag>
</template>
</el-table-column>
<el-table-column prop="pass_location" label="传阅所在位置" min-width="180" />
@ -120,12 +124,17 @@
<script>
import { form } from '@crud/crud'
import { FetchArchivesDetails, FetchInitDocumentDetailsList } from '@/api/system/documentArchives'
import { FetchArchivesDetails, FetchInitDocumentDetailsList, FetchAddDocumentDetails, FetchDeleteDocumentDetails, FetchInitDistributorByDocumentId } from '@/api/system/documentArchives'
import { mapGetters } from 'vuex'
import BindingTagDlg from '@/views/components/BindingTagDlg'
export default {
name: 'PrearchiveLibraryDetail',
filters: {
formatBorrowerList(list) {
return list.map(item => item.borrowName).join('、')
}
},
components: { BindingTagDlg },
mixins: [
form({})
@ -152,6 +161,9 @@ export default {
tableData: [],
parentInfo: null,
handleTableData: [],
currentArchivesId: null,
archivesFiledataLoading: false,
borrowerList: [],
page: {
page: 0,
size: 10,
@ -183,13 +195,32 @@ export default {
computed: {
...mapGetters([
'baseApi'
])
]),
//
readStatus() {
const readTypeItem = this.archivesDetailsData.find(
item => item.fieldName === 'read_type'
)
return readTypeItem ? readTypeItem.context : '未传阅'
}
},
created() {
},
mounted() {
},
methods: {
getStateClass(status) {
switch (status) {
case '未传阅':
return 'defalut-state'
case '传阅中':
return 'soon-state'
case '已传阅':
return 'end-state'
default:
return 'defalut-state'
}
},
changeActiveTab(index) {
this.archivesTabIndex = index
},
@ -197,27 +228,96 @@ export default {
return this.operateTypeMap[type] || '-'
},
getDetial(rowId) {
let documentId
if (this.selectedDocument.isType === 2) {
documentId = this.selectedDocument.id
} else {
documentId = this.selectedDocument.documentId
}
const params = {
documentId: documentId,
this.currentArchivesId = rowId
const documentId = this.selectedDocument.isType === 2
? this.selectedDocument.id
: this.selectedDocument.documentId
const commonParams = {
documentId,
archivesId: rowId
}
FetchArchivesDetails(params).then(data => {
this.archivesDetailsData = data
Promise.all([
//
FetchArchivesDetails(commonParams).then(data => {
this.archivesDetailsData = data
}),
//
FetchInitDistributorByDocumentId(commonParams).then(data => {
this.borrowerList = data
})
]).catch(error => {
console.error('请求出错:', error)
})
this.getInitDocumentDetailsList()
},
getInitDocumentDetailsList() {
this.archivesFiledataLoading = true
const documentId = this.selectedDocument.isType === 2
? this.selectedDocument.id
: this.selectedDocument.documentId
const params = {
documentId,
archivesId: this.currentArchivesId
}
FetchInitDocumentDetailsList(params).then(data => {
// id,parents_id,reg_no,details_type,pass_location,read_type,tid,is_destroy,create_by,create_time,update_by,update_time
// idid1. 2.tid
const jsonData = this.convertData(data)
this.archivesFiledata = jsonData
console.log(jsonData)
this.archivesFiledataLoading = false
}).catch(error => {
console.error('获取文档详情列表失败:', error)
this.archivesFiledataLoading = false
})
},
// getDetial(rowId) {
// this.currentArchivesId = rowId
// let documentId
// if (this.selectedDocument.isType === 2) {
// documentId = this.selectedDocument.id
// } else {
// documentId = this.selectedDocument.documentId
// }
// const params = {
// documentId: documentId,
// archivesId: rowId
// }
// FetchArchivesDetails(params).then(data => {
// this.archivesDetailsData = data
// })
// this.getInitDocumentDetailsList()
// FetchInitDistributorByDocumentId(params).then(data => {
// this.borrowerList = data
// })
// },
// getInitDocumentDetailsList() {
// this.archivesFiledataLoading = true
// let documentId
// if (this.selectedDocument.isType === 2) {
// documentId = this.selectedDocument.id
// } else {
// documentId = this.selectedDocument.documentId
// }
// const params = {
// documentId: documentId,
// archivesId: this.currentArchivesId
// }
// FetchInitDocumentDetailsList(params).then(data => {
// // id,parents_id,reg_no,details_type,pass_location,read_type,tid,is_destroy,create_by,create_time,update_by,update_time
// // idid1. 2.tid
// const jsonData = this.convertData(data)
// this.archivesFiledata = jsonData
// console.log(jsonData)
// this.archivesFiledataLoading = false
// })
// },
convertData(data) {
return data.map(item => {
const fieldNames = [
@ -232,7 +332,28 @@ export default {
return obj
})
},
handleAddDocDetails() {
let documentId
if (this.selectedDocument.isType === 2) {
documentId = this.selectedDocument.id
} else {
documentId = this.selectedDocument.documentId
}
const params = {
documentId: documentId,
archivesId: this.currentArchivesId,
regNo: this.archivesFiledata[0].reg_no
}
FetchAddDocumentDetails(params).then(data => {
if (data) {
this.getInitDocumentDetailsList()
} else {
this.$message({ message: '添加失败', type: 'error', offset: 8 })
}
}).catch(error => {
this.$message({ message: error, type: 'error', offset: 8 })
})
},
bindingTag(data) {
if (data.tid) {
this.$refs.bindingTag.isBinding = true
@ -264,23 +385,34 @@ export default {
})
},
toDelete(datas) {
this.$confirm('此操作将删除当前所选' + this.crud.title + '<span>你是否还要继续?</span>', '提示', {
console.log('datas', datas)
this.$confirm('此操作将删除当前所选公文文件' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
this.crud.delAllLoading = true
const ids = datas.map(item => item.id)
console.log('ids', ids)
// FetchDelelteDocumentDetails(ids).then(() => {
// this.$message({ message: '', type: 'success', offset: 8 })
// this.crud.delAllLoading = false
// this.crud.refresh()
// }).catch(err => {
// this.crud.delAllLoading = false
// console.log(err)
// })
let documentId
if (this.selectedDocument.isType === 2) {
documentId = this.selectedDocument.id
} else {
documentId = this.selectedDocument.documentId
}
const params = {
documentId: documentId,
archivesId: datas.id, // this.currentArchivesId,
isDestroy: true
}
console.log('ids', params)
FetchDeleteDocumentDetails(params).then((res) => {
console.log('res', res)
this.$message({ message: '删除成功', type: 'success', offset: 8 })
this.getInitDocumentDetailsList()
}).catch(err => {
this.crud.delAllLoading = false
console.log(err)
})
}).catch(() => {
})
},
@ -309,9 +441,9 @@ export default {
.el-row{
padding: 20px 0 0 0;
background-color: #F6F8FC;
// height: calc(100vh / 2 - 200px);
// overflow: hidden;
// overflow-y: scroll;
height: calc(100vh / 2 - 80px);
overflow: hidden;
overflow-y: scroll;
}
.base-info-item{
display: flex;
@ -337,7 +469,6 @@ export default {
display: flex;
justify-content: flex-start;
padding: 9px 12px 11px 12px;
margin-bottom: 24px;
background: rgba(151,199,255,0.2);
border-radius: 3px;
border: 1px solid #97C7FF;

17
src/views/archivesMIOD/miodLibrary/treeList.vue

@ -95,16 +95,19 @@ export default {
documentId: child.id,
dictionaryId: department.dictionaryId,
dictionaryCode: department.dictionaryCode,
children: department.yearGroup.map(year => ({
documentId: child.id,
dictionaryName: department.dictionaryName,
label: year,
id: year,
isType: 4
}))
children: department.yearGroup
.sort((a, b) => b - a) //
.map(year => ({
documentId: child.id,
dictionaryName: department.dictionaryName,
label: year,
id: year,
isType: 4
}))
}))
}))
}))
console.log(' this.crud.data', this.crud.data)
// document
this.$nextTick(() => {
const defaultSelectedNode = this.findFirstIsType2Node(this.crud.data)

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

@ -2,7 +2,7 @@
<!-- :style="`padding: ${isDesFormType === 'arcives' ? '20px 0 100px 0 !important' : ''};` -->
<div class="preview-content right-preview">
<el-form ref="addOrUpdateForm" :model="addOrUpdateForm" :rules="rules" :validate-on-rule-change="false" label-width="125px">
<el-row :gutter="4" style="padding:0 20px" :class="isDesFormType === 'prearchiveLibrary' ? 'library-form' :''">
<el-row :gutter="4" style="padding:0 20px" :class="isDesFormType === 'prearchiveLibrary' || isDesFormType === 'miodLibrary' ? 'library-form' :''">
<draggable v-bind="{draggable:'.drag-item',animation:500}" :disabled="!isDraggable" @update="datadragEnd">
<el-col
v-for="(item,index) in formPreviewData"
@ -47,10 +47,10 @@
<el-input
v-if="item.isInputClass !== 'select' && item.isInputClass !== 'date' && item.fieldName !== 'barcode' "
v-model="addOrUpdateForm[item.fieldName]"
:type="item.isInputClass === 'popover' && item.isLine ? 'textarea' : (item.isInputClass === 'popover' ? 'text' : item.isInputClass)"
:rows="item.isInputClass === 'textarea' || (item.isInputClass === 'popover' && item.isLine) ? 3 : ''"
:class="{'input-popover':(item.isInputClass === 'popover'),'mulit-input':(item.isInputClass === 'popover' && item.isLine)}"
:style="[{ width: item.editLength+'px'},item.isInputClass === 'popover' && item.isLine ? 'height:60px': '']"
:type="item.isInputClass === 'popover' && item.isLine && item.isRadio ? 'textarea' : (item.isInputClass === 'popover' ? 'text' : item.isInputClass)"
:rows="item.isInputClass === 'textarea' || (item.isInputClass === 'popover' && item.isLine && item.isRadio) ? 3 : ''"
:class="{'input-popover':(item.isInputClass === 'popover'),'mulit-input':(item.isInputClass === 'popover' && item.isLine && item.isRadio)}"
:style="[{ width: item.editLength+'px'},item.isInputClass === 'popover' && item.isLine && item.isRadio ? 'height:60px': '']"
:disabled="isDisabled || (item.fieldName === 'archival_category_code') || (item.fieldName === 'fonds_no' && isDesFormType !== 'category') || (item.fieldName === 'doc_department'&& archivesType === 'edit' ) || (item.fieldName === 'reg_no'&& archivesType === 'edit' )"
:validate-event="!isDisabled"
@mousewheel.native.prevent
@ -61,7 +61,7 @@
>
<i v-if="item.isInputClass === 'popover'" slot="suffix" class="el-input__icon iconfont icon-gengduo1" @click="handleCurrentFieldName(item)" />
</el-input>
<i v-if="item.isInputClass === 'popover' && item.isLine" class="mulit-input-icon el-input__icon iconfont icon-gengduo1" @click="handleCurrentFieldName(item)" />
<i v-if="item.isInputClass === 'popover' && item.isLine && item.isRadio" :class="[ isDesFormType === 'miodLibrary' ? 'mulit-input-icon' : 'mulit-input-setting','el-input__icon iconfont icon-gengduo1']" @click="handleCurrentFieldName(item)" />
<!-- date -->
<el-date-picker v-if="item.isInputClass === 'date'" v-model="addOrUpdateForm[item.fieldName]" type="date" align="right" format="yyyy-MM-dd" placeholder="" :clearable="false" :style="{ width: item.editLength+'px'}" :disabled="isDisabled" :validate-event="!isDisabled" />
</el-form-item>
@ -75,7 +75,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row v-if="isDesFormType === 'miodLibrary' " class="preview-form-bottom miod-form-bottom">
<el-row v-if="isDesFormType === 'miodLibrary' " class="preview-form-bottom miod-form-bottom ">
<el-col>
<el-form-item
label="需要传阅领导及部门"
@ -134,7 +134,7 @@
<el-table-column prop="dictionaryRemarks" label="内容说明" show-overflow-tooltip />
</el-table>
</div>
<div slot="footer" class="dialog-footer">
<div v-if="currentField && currentField.isRadio && currentField.isLine" slot="footer" class="dialog-footer">
<el-button type="text" @click="handleClose">取消</el-button>
<el-button type="primary" @click.native="handleComfirePopover">确定</el-button>
</div>
@ -150,7 +150,7 @@
<el-table-column prop="fondsOrders" label="排序" width="60" />
</el-table>
</div>
<div slot="footer" class="dialog-footer">
<div v-if="currentField && currentField.isRadio && currentField.isLine" slot="footer" class="dialog-footer">
<el-button type="text" @click="handleClose">取消</el-button>
<!-- @click.native="handleComfireDepts" -->
<el-button type="primary">确定</el-button>
@ -168,7 +168,7 @@
<el-table-column label="所属门类" prop="categoryName" show-overflow-tooltip />
</el-table>
</div>
<div slot="footer" class="dialog-footer">
<div v-if="currentField && currentField.isRadio && currentField.isLine" slot="footer" class="dialog-footer">
<el-button type="text" @click="handleClose">取消</el-button>
<!-- @click.native="handleComfireDepts" -->
<el-button type="primary">确定</el-button>
@ -321,6 +321,7 @@ export default {
popoverTableDataFonds: [],
popoverFondsVisible: false,
currentFieldName: null, // popover fieldName
currentField: null,
treeCurrentFiled: null,
categoryId: null,
result: null,
@ -374,10 +375,13 @@ export default {
console.log('currentFieldName', this.currentFieldName)
const findField = this.formPreviewData.find(item => item.fieldName === this.currentFieldName)
console.log('findField', findField)
if (findField.isRadio) {
return false // checkbox
}
return row.level ? row.level === 3 : true //
// if (!findField.isRadio) {
// return false // checkbox
// } else {
// }
return row.level ? row.level === 3 : true
}
}
},
@ -1073,6 +1077,7 @@ export default {
},
// popover -
handleCurrentFieldName(item) {
this.currentField = item
this.currentFieldName = item.fieldName
if (item.fieldName === 'fonds_no' && this.isDesFormType !== 'category') {
return false
@ -1320,6 +1325,7 @@ export default {
this.$refs[formName].validate((valid, fields) => {
if (valid && isValid) {
delete this.addOrUpdateForm.id
delete this.addOrUpdateForm.miodDepts
this.$emit('formLoadingShow', true)
//
if (this.isDesFormType === 'miodLibrary') {
@ -1331,7 +1337,8 @@ export default {
'jsonString': JSON.stringify(this.addOrUpdateForm),
'fileJsonString': null,
// 'fondsAffiliation': this.selectedDocument.fondsId
'fondsAffiliation': null
'fondsAffiliation': null,
'borrowerId': this.miodDeptsTags.map(item => item.id)
}
console.log('params', params)
miodEditDocument(params).then(res => {
@ -1506,7 +1513,7 @@ export default {
this.popoverTableDataClassify = []
this.popoverTableDataFonds = []
this.deptsVisible = false
done()
// done()
},
//
async changeFile(e) {
@ -1840,4 +1847,10 @@ export default {
right: -303px;
top: -17px;
}
.mulit-input-setting{
position: absolute;
right: 20px;
top: -17px;
}
</style>
Loading…
Cancel
Save