Commit cd46dc34 authored by ytbdmhy's avatar ytbdmhy

归档version:0.3.0

parent e533bb0e
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
v-loading.fullscreen.lock="loading" v-loading.fullscreen.lock="loading"
:data="tableData" :data="tableData"
border border
style="width: 100%" > style="width: 100%">
<!-- @row-click="getFileList">--> <!-- @row-click="getFileList">-->
<el-table-column <el-table-column
align="center" align="center"
label="序号" label="序号"
...@@ -124,7 +124,18 @@ ...@@ -124,7 +124,18 @@
label="案卷号" label="案卷号"
width="70"> width="70">
</el-table-column> </el-table-column>
<el-table-column align="center" fixed="right" label="操作" width="100">
<template slot-scope="scope">
<el-button type="primary" size="mini" plain @click="exportArchive(scope.row)">导出</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<el-button
class="fileButton"
type="primary"
@click="exportArchiveList">
导出案卷列表
</el-button>
<el-pagination <el-pagination
class="pone" class="pone"
:page-size="pageSize" :page-size="pageSize"
...@@ -139,8 +150,9 @@ ...@@ -139,8 +150,9 @@
</template> </template>
<script> <script>
import CryptoJS from 'crypto-js' import CryptoJS from 'crypto-js'
import {baseUrl} from "../../utils/global"
import {Loading} from 'element-ui'; import axios from "axios"
import Cookies from "js-cookie";
export default { export default {
data() { data() {
...@@ -208,6 +220,55 @@ ...@@ -208,6 +220,55 @@
padding: CryptoJS.pad.Pkcs7 padding: CryptoJS.pad.Pkcs7
}); });
return decrypted.toString(CryptoJS.enc.Utf8); return decrypted.toString(CryptoJS.enc.Utf8);
},
exportArchive(archive) {
this.loading = true;
axios.get(baseUrl + '/archive/getArchivePdf', {
headers: {
"token": Cookies.get("token")
},
params: {
archiveId: archive.id
},
responseType: 'blob' //告诉服务器我们需要的响应格式
})
.then(res => {
let a = document.createElement("a");
let blob = new Blob([res.data], {
type: 'application/vnd.ms-excel' //将会被放入到blob中的数组内容的MIME类型
});
a.href = URL.createObjectURL(blob); //生成一个url
a.download = archive.title + ".rar";
a.click();
this.loading = false;
})
.catch(err => {
console.log(err);
this.loading = false;
});
},
exportArchiveList() {
this.loading = true;
axios.get(baseUrl + '/exportExcel/archiveList', {
headers: {
"token": Cookies.get("token")
},
responseType: 'blob' //告诉服务器我们需要的响应格式
})
.then(res => {
let a = document.createElement("a");
let blob = new Blob([res.data], {
type: 'application/vnd.ms-excel' //将会被放入到blob中的数组内容的MIME类型
});
a.href = URL.createObjectURL(blob); //生成一个url
a.download = "归档案卷列表" + Date.now() + ".xlsx";
a.click();
this.loading = false;
})
.catch(err => {
console.log(err);
this.loading = false;
});
} }
}, },
created() { created() {
...@@ -235,6 +296,11 @@ ...@@ -235,6 +296,11 @@
margin-bottom: 20px; margin-bottom: 20px;
} }
.fileButton {
width: 10%;
margin-top: 10px;
}
.wrap { .wrap {
overflow: hidden; overflow: hidden;
position: relative; position: relative;
......
...@@ -206,6 +206,12 @@ ...@@ -206,6 +206,12 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-button
class="fileButton"
type="primary"
@click="fileEventLogs">
导出文件列表
</el-button>
<el-pagination <el-pagination
class="pone" class="pone"
:page-size='pageSize' :page-size='pageSize'
...@@ -372,6 +378,11 @@ ...@@ -372,6 +378,11 @@
float: left; float: left;
margin-left: 20px; margin-left: 20px;
} }
.fileButton {
width: 10%;
margin-top: 10px;
}
.wrap { .wrap {
overflow: hidden; overflow: hidden;
position: relative; position: relative;
......
<template xmlns:v-popover="http://www.w3.org/1999/xhtml"> <template xmlns:v-popover="http://www.w3.org/1999/xhtml">
<div> <div>
<div>
<el-alert
v-if="!showSelection"
align="left"
title="请选择一个业务类型进行归档"
type="warning"
:closable="false"
show-icon>
</el-alert>
</div>
<div class="op"> <div class="op">
<div class="name"> <div class="name">
<el-input v-model="name" size="mini" placeholder="请输入姓名"></el-input> <el-input v-model="name" size="mini" placeholder="请输入姓名"></el-input>
...@@ -12,7 +22,9 @@ ...@@ -12,7 +22,9 @@
size="mini" size="mini"
:options="options" :options="options"
:props="{ checkStrictly: true }" :props="{ checkStrictly: true }"
clearable @change="handleChange"> placeholder="请选择业务类型"
clearable
@change="handleChange">
</el-cascader> </el-cascader>
</div> </div>
<el-button <el-button
...@@ -150,7 +162,8 @@ ...@@ -150,7 +162,8 @@
<el-button <el-button
v-if="showSelection" v-if="showSelection"
class="fileButton" class="fileButton"
type="primary" @click="fileEventLogs"> type="primary"
@click="fileEventLogs">
归档案卷 归档案卷
</el-button> </el-button>
<el-pagination <el-pagination
...@@ -377,6 +390,15 @@ ...@@ -377,6 +390,15 @@
this.eventLogList = selection; this.eventLogList = selection;
}, },
fileEventLogs() { fileEventLogs() {
if (this.eventLogList.length === 0) {
this.$message({
showClose: true,
message: "请选择要归档的文件",
type: 'error',
duration: 5000
});
return;
}
this.loading = true; this.loading = true;
const data = [{ const data = [{
eventType: this.eventType, eventType: this.eventType,
...@@ -472,6 +494,7 @@ ...@@ -472,6 +494,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 10px; margin-bottom: 10px;
margin-top: 10px;
} }
.idCard { .idCard {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment