|
|
@@ -1,11 +1,6 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-button
|
|
|
- class="ml-10"
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- text
|
|
|
- @click="this.show = true"
|
|
|
+ <el-button class="ml-10" type="primary" text @click="this.show = true"
|
|
|
>归档
|
|
|
</el-button>
|
|
|
<el-dialog
|
|
|
@@ -14,8 +9,9 @@
|
|
|
width="960"
|
|
|
:close-on-click-modal="false"
|
|
|
:show-close="false"
|
|
|
+ @close="close"
|
|
|
>
|
|
|
- <el-form :model="form" label-width="100px" :rules="rules" ref="formRef">
|
|
|
+ <el-form :model="from" label-width="100px" :rules="rules" ref="formRef">
|
|
|
<div class="flex flex-col flex-justify-between border-bottom">
|
|
|
<div class="flex flex-center">
|
|
|
<el-form-item label="类别:">
|
|
|
@@ -70,7 +66,7 @@
|
|
|
<el-input
|
|
|
v-model="from.fileTitle"
|
|
|
placeholder="输入案卷标题"
|
|
|
- autosize
|
|
|
+ :rows="6"
|
|
|
type="textarea"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
@@ -90,8 +86,12 @@
|
|
|
<el-form-item style="width: 33.5%" label="编制单位:" prop="makeUnit">
|
|
|
<el-input v-model="from.makeUnit" placeholder="输入编制单位" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item style="width: 66.5%" label="编制日期:" prop="makeDate">
|
|
|
- <div class="flex flex-center">
|
|
|
+ <el-form-item
|
|
|
+ style="width: 66.5%"
|
|
|
+ label="编制日期:"
|
|
|
+ prop="makeStartDate"
|
|
|
+ >
|
|
|
+ <div class="flex flex-center flex-justify-start">
|
|
|
<el-col :span="10">
|
|
|
<el-form-item>
|
|
|
<el-date-picker
|
|
|
@@ -102,11 +102,11 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="3">
|
|
|
+ <el-col :span="4">
|
|
|
<span class="grey-6">至</span>
|
|
|
</el-col>
|
|
|
<el-col :span="10">
|
|
|
- <el-form-item>
|
|
|
+ <el-form-item prop="makeStartDate">
|
|
|
<el-date-picker
|
|
|
v-model="from.makeEndDate"
|
|
|
placeholder="结束日期"
|
|
|
@@ -202,13 +202,27 @@ export default {
|
|
|
default: ''
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ show: {
|
|
|
+ handler(val) {
|
|
|
+ if (val) {
|
|
|
+ this.getDic('archive-category')
|
|
|
+ this.getDic('file-genus')
|
|
|
+ this.getDic('archives-type')
|
|
|
+ this.getDic('retention-period')
|
|
|
+ this.getDic('file-classification')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
show: false,
|
|
|
from: {
|
|
|
folderId: '',
|
|
|
category: '1', // 类别
|
|
|
- classification: '', // 密级
|
|
|
+ classification: '1', // 密级
|
|
|
directoryNum: '', // 目录号
|
|
|
fileDate: '', // 归档日期
|
|
|
fileLocation: '', // 归档位置
|
|
|
@@ -219,7 +233,7 @@ export default {
|
|
|
makeUnit: '', // 编制单位
|
|
|
quanzongNum: '', // 全宗号
|
|
|
recordsNum: '', // 案卷号
|
|
|
- retentionPeriod: '', // 保管期限
|
|
|
+ retentionPeriod: '1', // 保管期限
|
|
|
genus: '1' // 属别
|
|
|
},
|
|
|
genus: [],
|
|
|
@@ -259,6 +273,13 @@ export default {
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
],
|
|
|
+ makeStartDate: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '编制时间不能为空!',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ],
|
|
|
fileDate: [
|
|
|
{
|
|
|
required: true,
|
|
|
@@ -290,13 +311,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
- this.getDic('archive-category')
|
|
|
- this.getDic('file-genus')
|
|
|
- this.getDic('archives-type')
|
|
|
- this.getDic('retention-period')
|
|
|
- this.getDic('file-classification')
|
|
|
- },
|
|
|
methods: {
|
|
|
getDic(code) {
|
|
|
this.$api.common.dicList({ code }).then(res => {
|
|
|
@@ -316,13 +330,53 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
archiveInduction() {
|
|
|
- // this.$refs.formRef.validate((valid, fields) => {
|
|
|
- // console.log(valid)
|
|
|
- // })
|
|
|
- this.from.folderId = this.folderId
|
|
|
- this.$api.resource.fileArchives(this.from).then(res => {
|
|
|
- console.log(res)
|
|
|
+ this.$refs.formRef.validate((valid, fields) => {
|
|
|
+ console.log(valid)
|
|
|
+ if (valid) {
|
|
|
+ this.from.folderId = this.folderId
|
|
|
+ this.$api.resource.fileArchives(this.from).then(res => {
|
|
|
+ if (Object.hasOwn(res, 'code')) {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.download(res)
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
+ },
|
|
|
+ download(res) {
|
|
|
+ const url = window.URL.createObjectURL(
|
|
|
+ new Blob([res], { type: 'application/vnd.ms-excel' })
|
|
|
+ )
|
|
|
+ const link = document.createElement('a')
|
|
|
+ link.style.display = 'none'
|
|
|
+ link.href = url
|
|
|
+ const excelName = this.from.fileTitle + '.docx'
|
|
|
+ link.setAttribute('download', excelName)
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ link.remove()
|
|
|
+ this.show = false
|
|
|
+ this.$message.success('导出成功')
|
|
|
+ },
|
|
|
+ close() {
|
|
|
+ this.from = {
|
|
|
+ folderId: '',
|
|
|
+ category: '1', // 类别
|
|
|
+ classification: '1', // 密级
|
|
|
+ directoryNum: '', // 目录号
|
|
|
+ fileDate: '', // 归档日期
|
|
|
+ fileLocation: '', // 归档位置
|
|
|
+ fileTitle: '', // 案卷标题
|
|
|
+ fileType: '1', // 档案类型
|
|
|
+ makeStartDate: '', // 编织开始时间
|
|
|
+ makeEndDate: '', // 编制结束时间
|
|
|
+ makeUnit: '', // 编制单位
|
|
|
+ quanzongNum: '', // 全宗号
|
|
|
+ recordsNum: '', // 案卷号
|
|
|
+ retentionPeriod: '1', // 保管期限
|
|
|
+ genus: '1' // 属别
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|