|
@@ -14,6 +14,7 @@
|
|
|
<script src="../../static/kj/jquery.min.js"></script>
|
|
|
<script src="../../static/kj/layer/layer.js"></script>
|
|
|
<script src="../../static/sa.js"></script>
|
|
|
+ <script src="../../static/kj/upload-util.js"></script>
|
|
|
</head>
|
|
|
<body>
|
|
|
<div class="vue-box" style="display: none;" :style="'display: block;'">
|
|
@@ -33,6 +34,9 @@
|
|
|
@click="p.name='',p.type='',p.idCard='',p.judgeState='',f5()">重置</el-button>
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="add" v-if="sa.isAuth('tb-person-filing-add')">
|
|
|
新增</el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-upload" @click="importFn"
|
|
|
+ v-if="sa.isAuth('tb-person-filing-import')">
|
|
|
+ 导入</el-button>
|
|
|
</el-form>
|
|
|
|
|
|
<!-- ------------- 数据列表 ------------- -->
|
|
@@ -51,8 +55,8 @@
|
|
|
<sa-td name="更新时间" prop="updateTime" width="140"></sa-td>
|
|
|
<el-table-column label="操作" fixed="right" width="240px">
|
|
|
<template slot-scope="s">
|
|
|
- <el-button v-if="sa.isAuth('tb-person-filing-judge')&&s.row.judgeState==0" class="c-btn" type="success"
|
|
|
- @click="judgeFn(s.row)">审核
|
|
|
+ <el-button v-if="sa.isAuth('tb-person-filing-judge')&&s.row.judgeState==0" class="c-btn"
|
|
|
+ type="success" @click="judgeFn(s.row)">审核
|
|
|
</el-button>
|
|
|
<el-button class="c-btn" type="success" @click="get(s.row)">查看
|
|
|
</el-button>
|
|
@@ -69,6 +73,31 @@
|
|
|
<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
|
|
|
</sa-item>
|
|
|
</div>
|
|
|
+ <el-dialog title="批量导入" :visible.sync="form.visible" width="30%">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <el-button style="float: right; padding-bottom: 10px" type="text" @click="downTemplate">模板下载</el-button>
|
|
|
+ </div>
|
|
|
+ <el-upload
|
|
|
+ class="upload-demo"
|
|
|
+ ref="importExcel"
|
|
|
+ :headers="headers"
|
|
|
+ drag
|
|
|
+ :auto-upload="false"
|
|
|
+ accept=".xls,.xlsx"
|
|
|
+ :on-success="onSuccess"
|
|
|
+ :action="importUrl"
|
|
|
+ >
|
|
|
+ <i class="el-icon-upload"></i>
|
|
|
+ <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
+ <div class="el-upload__tip" slot="tip">只能上传excel文件</div>
|
|
|
+ </el-upload>
|
|
|
+ </el-card>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="cancelImport">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="sureImport">确定导入</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
<script>
|
|
|
var app = new Vue({
|
|
@@ -78,6 +107,15 @@
|
|
|
},
|
|
|
el: '.vue-box',
|
|
|
data: {
|
|
|
+ form: {
|
|
|
+ visible: false,
|
|
|
+ deptId:''
|
|
|
+ },
|
|
|
+ importUrl:sa.cfg.api_url+'/TbPersonFiling/import',
|
|
|
+ headers:{
|
|
|
+ 'satoken':sessionStorage.satoken
|
|
|
+ },
|
|
|
+ deptList:[],
|
|
|
p: { // 查询参数
|
|
|
id: '', //
|
|
|
judgeState: '', // 部门ID
|
|
@@ -91,6 +129,41 @@
|
|
|
dataList: [], // 数据集合
|
|
|
},
|
|
|
methods: {
|
|
|
+ importFn() {
|
|
|
+ this.form.visible=true;
|
|
|
+ this.getDeptList()
|
|
|
+ },
|
|
|
+ downTemplate(){
|
|
|
+ window.location.href='../../static/template/'+encodeURIComponent('备案导入模板.xlsx')
|
|
|
+ },
|
|
|
+ cancelImport(){
|
|
|
+ this.$refs.importExcel.clearFiles();
|
|
|
+ this.form.visible=false;
|
|
|
+ },
|
|
|
+ sureImport(){
|
|
|
+ sa.loading('正在上传');
|
|
|
+ this.$refs.importExcel.submit();
|
|
|
+ },
|
|
|
+ onSuccess(resp){
|
|
|
+ sa.hideLoading();
|
|
|
+ if(resp.code!==200){
|
|
|
+ sa.error(resp.msg);
|
|
|
+ }else{
|
|
|
+ sa.alert('导入成功',this.cancelImport());
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.f5();
|
|
|
+ },1000)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getDeptList() {
|
|
|
+ sa.ajax('/TbDept/getList', {
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 100
|
|
|
+ }, function(resp) {
|
|
|
+ let list = resp.data;
|
|
|
+ this.deptList = list;
|
|
|
+ }.bind(this))
|
|
|
+ },
|
|
|
judgeFn(data) {
|
|
|
sa.showIframe('审核', 'tb-person-filing-judge.html?id=' + data.id, '700px', '70%');
|
|
|
},
|
|
@@ -155,6 +228,7 @@
|
|
|
created: function() {
|
|
|
this.f5();
|
|
|
sa.onInputEnter();
|
|
|
+ console.log()
|
|
|
}
|
|
|
})
|
|
|
</script>
|