Commit cd46dc34 authored by ytbdmhy's avatar ytbdmhy

归档version:0.3.0

parent e533bb0e
......@@ -4,8 +4,8 @@
v-loading.fullscreen.lock="loading"
:data="tableData"
border
style="width: 100%" >
<!-- @row-click="getFileList">-->
style="width: 100%">
<!-- @row-click="getFileList">-->
<el-table-column
align="center"
label="序号"
......@@ -124,7 +124,18 @@
label="案卷号"
width="70">
</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-button
class="fileButton"
type="primary"
@click="exportArchiveList">
导出案卷列表
</el-button>
<el-pagination
class="pone"
:page-size="pageSize"
......@@ -139,8 +150,9 @@
</template>
<script>
import CryptoJS from 'crypto-js'
import {Loading} from 'element-ui';
import {baseUrl} from "../../utils/global"
import axios from "axios"
import Cookies from "js-cookie";
export default {
data() {
......@@ -208,6 +220,55 @@
padding: CryptoJS.pad.Pkcs7
});
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() {
......@@ -235,6 +296,11 @@
margin-bottom: 20px;
}
.fileButton {
width: 10%;
margin-top: 10px;
}
.wrap {
overflow: hidden;
position: relative;
......
......@@ -206,6 +206,12 @@
</template>
</el-table-column>
</el-table>
<el-button
class="fileButton"
type="primary"
@click="fileEventLogs">
导出文件列表
</el-button>
<el-pagination
class="pone"
:page-size='pageSize'
......@@ -372,6 +378,11 @@
float: left;
margin-left: 20px;
}
.fileButton {
width: 10%;
margin-top: 10px;
}
.wrap {
overflow: hidden;
position: relative;
......
<template xmlns:v-popover="http://www.w3.org/1999/xhtml">
<div>
<div>
<el-alert
v-if="!showSelection"
align="left"
title="请选择一个业务类型进行归档"
type="warning"
:closable="false"
show-icon>
</el-alert>
</div>
<div class="op">
<div class="name">
<el-input v-model="name" size="mini" placeholder="请输入姓名"></el-input>
......@@ -12,7 +22,9 @@
size="mini"
:options="options"
:props="{ checkStrictly: true }"
clearable @change="handleChange">
placeholder="请选择业务类型"
clearable
@change="handleChange">
</el-cascader>
</div>
<el-button
......@@ -150,7 +162,8 @@
<el-button
v-if="showSelection"
class="fileButton"
type="primary" @click="fileEventLogs">
type="primary"
@click="fileEventLogs">
归档案卷
</el-button>
<el-pagination
......@@ -377,6 +390,15 @@
this.eventLogList = selection;
},
fileEventLogs() {
if (this.eventLogList.length === 0) {
this.$message({
showClose: true,
message: "请选择要归档的文件",
type: 'error',
duration: 5000
});
return;
}
this.loading = true;
const data = [{
eventType: this.eventType,
......@@ -472,6 +494,7 @@
display: flex;
align-items: center;
margin-bottom: 10px;
margin-top: 10px;
}
.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