Browse Source

档案利用

master
xuhuajiao 11 months ago
parent
commit
aff77025e8
  1. 2
      src/views/archiveUtilize/archiveSearch/index.vue
  2. 9
      src/views/archiveUtilize/archiveSearch/module/resultList.vue
  3. 4
      src/views/archiveUtilize/utillizeRecord/recordList.vue
  4. 14
      src/views/archivesManage/managementLibrary/module/archivesInfo/index.vue
  5. 2
      src/views/archivesManage/managementLibrary/module/collectHeader.vue
  6. 266
      src/views/archivesManage/managementLibrary/module/uploadFile/index.vue
  7. 30
      src/views/system/user/cart.vue

2
src/views/archiveUtilize/archiveSearch/index.vue

@ -11,7 +11,7 @@
<div v-if="isCommon" class="common-search">
<div class="search-input">
<!-- @keyup.enter.native="dimSearch" -->
<el-input v-model="keywords" placeholder="请输入检索关键字" class="input-with-select">
<el-input v-model="keywords" placeholder="请输入检索关键字" class="input-with-select" @keyup.enter.native="handleSearch">
<!-- <el-select slot="prepend" v-model="select" placeholder="请选择">
<el-option
v-for="item in options"

9
src/views/archiveUtilize/archiveSearch/module/resultList.vue

@ -97,7 +97,7 @@
/>
</el-select> -->
<div class="search-input">
<el-input v-model="searchkeywords" placeholder="请输入检索关键字" class="input-with-select">
<el-input v-model="searchkeywords" placeholder="请输入检索关键字" class="input-with-select" @keyup.enter.native="handledResultSearch">
<el-button slot="append" icon="el-icon-search" @click="handledResultSearch">搜索</el-button>
</el-input>
</div>
@ -125,6 +125,8 @@
<span v-if="item.caseNo !== null">装盒</span>
<span v-if="item.folderLocation !== '' && item.folderLocation !== null">入库</span>
<span v-if="item.isBorrow">借阅</span>
<span v-if="item.processStatus > 1" style="color: #ff8329;border-color: #febd98;background-color: #fff3e5;">审批锁定</span>
<span v-else style="color: #a6adb6;border: 1px solid #e6e8ed;background-color: #f3f5f9;">空闲</span>
</div>
<div class="item-bottom-handle">
<span @click.stop="handleDetail(item)">查看详情</span>
@ -556,7 +558,7 @@ export default {
if (res) {
this.$message({ message: '加入借阅车成功', type: 'success', offset: 8 })
} else {
this.$message({ message: '加入借阅车失败', type: 'error', offset: 8 })
this.$message({ message: '当前所属档案已在借阅车,请勿重复操作', type: 'error', offset: 8 })
}
})
}).catch(() => {
@ -759,7 +761,8 @@ export default {
align-items: center;
span{
display: block;
width: 42px;
// width: 42px;
padding: 0 4px;
height: 22px;
line-height: 22px;
text-align: center;

4
src/views/archiveUtilize/utillizeRecord/recordList.vue

@ -85,10 +85,10 @@
<li><span>申请时间</span>{{ rowCurrent && rowCurrent.createTime }}</li>
<li><span>利用人</span>{{ rowCurrent && rowCurrent.applicant }}</li>
<li><span>申请部门</span>{{ rowCurrent && rowCurrent.deptsName }}</li>
<li><span>申请理由</span>{{ rowCurrent && rowCurrent.reason }}</li>
<li><span>申请理由</span>{{ rowCurrent && rowCurrent.borrowReason }}</li>
<li><span>开始时间</span>{{ rowCurrent && rowCurrent.giveStartTime | parseTime }}</li>
<li><span>结束时间</span>{{ rowCurrent && rowCurrent.giveEndTime | parseTime }}</li>
<li><span>审批意见</span>{{ rowCurrent && rowCurrent.opinion }}</li>
<!-- <li><span>审批意见</span>{{ rowCurrent && rowCurrent.opinion }}</li> -->
<li class="state-list">
<span v-if="rowCurrent && rowCurrent.status === 1" class="row-state ing-state">进行中</span>
<span v-if="rowCurrent && rowCurrent.status === 2" class="row-state case-cancel">已取消</span>

14
src/views/archivesManage/managementLibrary/module/archivesInfo/index.vue

@ -50,6 +50,7 @@
<script>
import { form } from '@crud/crud'
import { FetchDetailsById, FetchArchivesMetadata } from '@/api/collect/collect'
import { FetchIsAuthByLookType } from '@/api/archivesManage/library'
import UploadFile from '../uploadFile/index'
import FourTestInfo from '../fourTestInfo/index'
import HandleInfo from '../handleInfo/index'
@ -91,7 +92,8 @@ export default {
archivesTabIndex: 0,
archivesDetailsData: [],
archivesDetailsMetadata: [],
xml_show: null
xml_show: null,
authArcId: null
}
},
computed: {
@ -107,6 +109,7 @@ export default {
},
methods: {
getDetial(collectLevel, rowId) {
this.authArcId = rowId
const params = {
'categoryId': this.selectedCategory.id,
'categoryLevel': collectLevel,
@ -132,6 +135,14 @@ export default {
this.archivesDetailsMetadata = data
})
},
getIsAuthByLookType() {
const params = {
'archivesId': this.authArcId
}
FetchIsAuthByLookType(params).then(res => {
this.$refs.uploadFile.authUtilize = res
})
},
setXml() {
const xmlstr = this.archivesDetailsMetadata
this.xml_show = this.showXml(xmlstr)
@ -154,6 +165,7 @@ export default {
}
this.$nextTick(() => {
if (this.$refs.uploadFile) {
this.getIsAuthByLookType()
this.$refs.uploadFile.tableData = []
this.$refs.uploadFile.getFileList()
}

2
src/views/archivesManage/managementLibrary/module/collectHeader.vue

@ -136,7 +136,7 @@
</el-submenu>
</el-menu>
</div>
<!-- 利用权限操作 -->
<div v-if="!isRecycle && isTitleType === 6" class="collect-menu">
<el-button v-if="parentsData.authUtilize.look" class="filter-item" size="mini" type="success" @click="toPreview"><i class="iconfont icon-sulan" />预览</el-button>
<el-button v-if="parentsData.authUtilize.download" class="filter-item" size="mini" type="success" :disabled="selections.length !== 1" @click="handleOriginalDownload"><i class="iconfont icon-xiazai" :disabled="crud.selections.length !== 1" />下载</el-button>

266
src/views/archivesManage/managementLibrary/module/uploadFile/index.vue

@ -1,18 +1,12 @@
<template>
<div class="upload-file">
<!-- 上传附件curd -->
<div v-if="isUploadDetail" class="upload-curd">
<div class="upload-btn">
<el-button icon="el-icon-plus" size="small" type="primary">添加</el-button>
<input id="upFile" type="file" name="upFile" @change="changeFile($event)">
</div>
<el-button icon="el-icon-delete" :disabled="selections.length === 0" @click="toDelete(selections)">删除</el-button>
<el-button icon="el-icon-sort" @click="showSort">排序</el-button>
<div style="font-size: 12px; height: 30px; line-height: 30px; text-align: right; margin-top: -10px;">
<p v-if="authUtilize.endTime"><!-- 利用开始时间{{ parentsData.authUtilize.startTime | parseTime }} -->
利用结束时间{{ authUtilize.endTime | parseTime }}</p>
</div>
<!--表格渲染-->
<el-table
ref="table"
v-loading="tableLoading"
:data="tableData"
style="min-width: 100%"
height="calc(100vh - 382px)"
@ -28,12 +22,6 @@
{{ getFileSize(scope.row.file_size) }}
</template>
</el-table-column>
<!-- <el-table-column prop="file_dpi" label="分辨率" min-width="120" align="center">
<template slot-scope="scope">
<div v-if="!scope.row.file_dpi || scope.row.file_dpi === 'null'"> - </div>
<div v-else> {{ scope.row.file_dpi }} </div>
</template>
</el-table-column> -->
<el-table-column prop="file_thumbnail" label="缩略图" min-width="60" align="center">
<template slot-scope="scope">
<div v-if="scope.row.file_type === 'jpg' || scope.row.file_type === 'jpeg' || scope.row.file_type === 'png' || scope.row.file_type === 'bmp'|| scope.row.file_type === 'gif'">
@ -63,73 +51,27 @@
</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间" min-width="130" align="center" />
<el-table-column label="操作" min-width="80" align="center">
<template>
<el-table-column v-if="authUtilize.look || authUtilize.download || authUtilize.print" label="操作" min-width="80" align="center">
<template slot-scope="scope">
<div class="handle-btn">
<el-button class="iconfont icon-sulan" @click="toPreview" />
<el-button class="iconfont icon-xiazai" />
<el-button class="iconfont icon-dayin" />
<el-button v-if="authUtilize.look" class="iconfont icon-sulan" @click="toPreview" />
<el-button v-if="authUtilize.download" class="iconfont icon-xiazai" @click="downloadFile(scope.row)" />
<el-button v-if="authUtilize.print" class="iconfont icon-dayin" />
</div>
</template>
</el-table-column>
</el-table>
<!-- 点击缩略图看大图 -->
<el-dialog class="preview-dialog" :append-to-body="true" :close-on-click-modal="false" :before-close="handleClose" :visible="showCoverVisible" title="查看大图">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog" style="max-height:calc(100vh - 230px); overflow:auto;">
<img style="max-width:100%; object-fit: contain;" :src="previewSrc" :onerror="defaultImg">
</div>
</el-dialog>
<!-- 排序 -->
<el-dialog :close-on-click-modal="false" :append-to-body="true" title="排序" :visible.sync="sortVisible" @opened="opened">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<i class="drag-tip">提示请通过拖动鼠标来调整当前顺序</i>
<el-table :data="sortTableData" class="file-sort" style="width: 100%;max-height: 70vh;" row-key="id">
<el-table-column type="index" label="序号" width="100" align="center" />
<el-table-column prop="file_name" label="文件名称" />
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click.native="handleSort">保存</el-button>
</div>
</div>
</el-dialog>
<!-- 删除附件 -->
<el-dialog title="删除附件" :append-to-body="true" :close-on-click-modal="false" :visible.sync="deleteVisible" :before-close="handleClose">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<div class="dialog-delt">
<p><span>确定删除已选择的附件吗</span></p>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click.native="handleDeltConfirm">确定</el-button>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
// import { FetchInitArchiveFilesView, FetchEditFile, FetchDeleteFile, FetchFileSort } from '@/api/archivesManage/archivesList'
import { FetchInitFileCategoryView } from '@/api/collect/collect'
import { FetchIsAuthByLookType } from '@/api/archivesManage/library'
import { archivesUpload } from '@/utils/upload'
import { downloadFile, getCurrentTime } from '@/utils/index'
import { downloadFile } from '@/utils/index'
import { mapGetters } from 'vuex'
import { form } from '@crud/crud'
import Sortable from 'sortablejs'
export default {
name: 'UploadFile',
components: {},
mixins: [
form({})
],
mixins: [],
inject: ['parentsData'],
props: {
isUploadDetail: {
@ -151,23 +93,16 @@ export default {
},
data() {
return {
defaultImg: 'this.src="' + require('@/assets/images/cover-bg.png') + '"',
tableData: [], // list
selections: [], // table -
showCoverVisible: false, // dialog
sortTableData: [], // data
sortVisible: false, // dialog
deleteVisible: false, // dialog
deleteData: [], // data
file: null, // change
fileNames: '', // - name
formatType: '', // - type
postfix: '', // -
fileSize: '', // -
filePath: '', // - path
px: '', // -
nowDate: '', //
previewSrc: '' // src
tableLoading: false,
authUtilize: {
'look': false,
'download': false,
'print': false,
'endTime': null,
'startTime': null
}
}
},
computed: {
@ -189,103 +124,18 @@ export default {
const fileSizeInB = fileSize + 'B'
return (fileSize / 1024) <= 0.01 ? fileSizeInB : fileSizeInKB
},
//
async changeFile(e) {
this.file = e.target.files[0]
this.fileSize = this.file.size
this.formatType = this.file.type.substring(0, this.file.type.indexOf('/'))
this.fileNames = this.file.name
this.postfix = this.file.name.substring(
this.fileNames.lastIndexOf('.') + 1,
this.fileNames.length
)
if (this.formatType === 'image') {
const fileBase64 = await this.getBase64(this.file)
const res = await this.getImgPx(fileBase64)
this.px = res.width + 'px*' + res.height + 'px'
} else {
this.px = ''
}
//
archivesUpload(this.baseApi + '/api/archives/uploadFile', this.file, this.categoryId).then(res => {
if (res.data.code === 200) {
this.filePath = res.data.data
this.uploadSave()
}
})
},
// -
uploadSave() {
this.nowDate = getCurrentTime()
const json = {
'file_name': this.fileNames,
'file_size': this.fileSize,
'file_type': this.postfix,
'file_path': this.filePath,
'sequence': null,
'archive_id': this.arcId,
'file_dpi': this.px,
'file_thumbnail': '',
'create_time': this.nowDate,
'id': null
}
const arrayUpload = []
arrayUpload.push(json)
const params = {
'categoryId': this.categoryId,
'jsonString': JSON.stringify(arrayUpload)
}
console.log(params)
// FetchEditFile(params).then(data => {
// this.$message.success('!')
// this.crud.refresh()
// this.getFileList()
// })
},
// base64
getBase64(file) {
const reader = new FileReader()
reader.readAsDataURL(file)
return new Promise((resolve) => {
reader.onload = () => {
resolve(reader.result)
}
})
},
//
getImgPx(img) {
const image = new Image()
image.src = img
return new Promise((resolve) => {
image.onload = () => {
const width = image.width
const height = image.height
resolve({ width, height })
}
})
},
// list
getFileList() {
this.tableLoading = true
const params = {
'categoryId': this.selectedCategory.id,
'archivesId': this.arcId,
'page': 0,
'size': 10
}
console.log(params)
FetchInitFileCategoryView(params).then(data => {
console.log('darta', data)
this.tableData = data.returnlist
this.getIsAuthByLookType()
})
},
getIsAuthByLookType() {
const params = {
'archivesId': this.arcId
}
console.log(params)
FetchIsAuthByLookType(params).then(res => {
console.log('res', res)
this.tableLoading = false
})
},
//
@ -297,74 +147,6 @@ export default {
this.$message({ message: '下载文件失败', type: 'error', offset: 8 })
})
},
//
toDelete(data) {
this.deleteData = data
this.deleteVisible = true
},
//
handleDeltConfirm() {
this.deleteVisible = false
const ids = []
this.deleteData.forEach(val => {
ids.push(val.id)
})
const params = {
'ids': ids,
'categoryId': this.categoryId
}
console.log(params)
// fetch
// FetchDeleteFile(params).then(res => {
// this.crud.delAllLoading = false
// this.$message.success('!')
// this.crud.refresh()
// this.getFileList()
// })
},
// -
rowDrop(className, targetName) {
//
const tbody = document.querySelector('.' + className + ' .el-table__body-wrapper tbody')
const that = this
Sortable.create(tbody, {
//
draggable: '.el-table__row',
onEnd({ newIndex, oldIndex }) {
if (newIndex === oldIndex) return
that[targetName].splice(newIndex, 0, that[targetName].splice(oldIndex, 1)[0])
}
})
},
//
opened() {
this.rowDrop('file-sort', 'sortTableData')
},
showSort() {
this.sortVisible = true
this.sortTableData = JSON.parse(JSON.stringify(this.tableData))
},
// -
handleSort() {
const ids = []
const sequences = []
this.sortTableData.map((value, index) => {
ids.push(value.id)
sequences.push(index + 1)
})
const params = {
'categoryId': this.categoryId,
'ids': ids,
'sequences': sequences
}
console.log(params)
// FetchFileSort(params).then((res) => {
// this.sortVisible = false
// this.$message.success('!')
// this.crud.refresh()
// this.getFileList()
// })
},
// table
clickRowHandler(row) {
this.$refs.table.toggleRowSelection(row)
@ -375,13 +157,7 @@ export default {
},
// dialog - close
handleClose(done) {
this.showCoverVisible = false
done()
},
//
showCoverPreview(row) {
this.showCoverVisible = true
this.previewSrc = this.baseApi + '/downloadFile' + row.file_path
}
}
}

30
src/views/system/user/cart.vue

@ -31,6 +31,7 @@
<el-table
ref="table"
v-loading="crud.loading"
class="archives-table"
:data="crud.data"
row-key="id"
style="width: 100%;"
@ -49,6 +50,11 @@
<div>{{ scope.row.categoryLevel === 3 ? '文件' : '其他' }}</div>
</template>
</el-table-column>
<el-table-column prop="processStatus" label="审批锁定" align="center">
<template slot-scope="scope">
<span :class="['row-state', 'row-warehousing', scope.row.processStatus !== 1 ? 'state-active' : '' ]">{{ processedStatusText(scope.row.processStatus) }}</span>
</template>
</el-table-column>
<el-table-column prop="createTime" label="加入时间" width="200">
<template slot-scope="scope">
<div>{{ scope.row.createTime | parseTime }}</div>
@ -101,7 +107,28 @@ export default {
...mapGetters([
'user',
'baseApi'
])
]),
processedStatusText() {
return function(status) {
let text = ''
if (status === 1) {
text = '空闲'
} else if (status === 2) {
text = '退回'
} else if (status === 3) {
text = '开放'
} else if (status === 4) {
text = '销毁'
} else if (status === 5) {
text = '利用'
} else if (status === 6) {
text = '内部移交'
} else if (status === 7) {
text = '外部移交'
}
return text
}
}
},
watch: {
},
@ -195,6 +222,7 @@ export default {
closeDialog() {
this.keyWord = null
this.crud.toQuery()
this.$refs.table.clearSelection()
}
}
}

Loading…
Cancel
Save