导入控件

zhangtao
laozt 1 year ago
parent e9a8bf4b74
commit 72eea2f713

@ -1,9 +1,9 @@
###
# @Author: 张涛
# @Date: 2023-07-18 13:04:50
# @LastEditors: JC9527
# @LastEditTime: 2023-10-12 10:31:29
# @FilePath: \Mudu2PC\.env.development
# @LastEditors: 张涛
# @LastEditTime: 2023-10-12 13:12:38
# @FilePath: \suzhouyingjiPC\.env.development
###
# 页面标题
VUE_APP_TITLE = 苏州应急执法计划管理系统
@ -15,8 +15,10 @@ ENV = 'development'
# VUE_APP_BASE_API = 'http://39.101.188.84:9033'
# VUE_APP_BASE_API = 'http://192.168.0.106:9033'
VUE_APP_BASE_API = 'http://180.108.205.123:13002'
# VUE_APP_BASE_API = '/api'
VUE_APP_LOCATION = 'http://2.46.4.197:8090'
# 政务网
# VUE_APP_LOCATION = 'http://2.46.4.197:8090'
# 外网
VUE_APP_LOCATION = 'http://180.108.205.123:8090'
# 路由懒加载

Binary file not shown.

@ -51,13 +51,13 @@
<el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- <div
<div
class="showGLstyle"
v-if="roles && roles[0] == 'admin'"
@click="toNewPage"
>
进入管理平台
</div> -->
</div>
</header>
<div class="bottom-view">
<router-view></router-view>

@ -3,8 +3,8 @@
* @version:
* @Author: JC9527
* @Date: 2023-09-04 10:20:06
* @LastEditors: JC9527
* @LastEditTime: 2023-09-27 17:06:02
* @LastEditors: 张涛
* @LastEditTime: 2023-10-12 13:33:22
-->
<template>
<div class="container-main" ref="main">
@ -59,21 +59,14 @@
<div class="export" style="background: #f71052" @click="deleteItem">
<span>删除</span>
</div>
<el-upload
class="upload-demo"
action="1"
ref="uploadOver"
:http-request="exportFile"
:on-success="handleSuccess"
:multiple="false"
:show-file-list="false"
:limit="1"
:file-list="fileList"
<div
class="export"
@click="handleImport"
style="background-color: #28b384"
>
<div class="export export1">
<span>导入</span>
</div>
</el-upload>
<span>导入</span>
</div>
</div>
</div>
<div class="tables">
@ -107,8 +100,6 @@
header-align="center"
>
</el-table-column>
<!-- <el-table-column prop="type" label="企业类别" header-align="center">
</el-table-column> -->
<el-table-column label="操作" header-align="center">
<template slot-scope="scope">
@ -187,7 +178,7 @@
<el-date-picker
v-model="form.year"
type="year"
placeholder="请选择"
placeholder="请选择年份"
value-format="yyyy"
size="small"
>
@ -195,32 +186,6 @@
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>
<el-col>
<el-form-item label="企业类别:" prop="type">
<el-input
v-model="form.type"
size="small"
placeholder="请输入企业类别"
></el-input>
</el-form-item>
</el-col>
</el-row> -->
<!-- <el-row>
<el-col>
<el-form-item label="行政区划:" prop="type">
<el-cascader
size="small"
v-model="queryParmsdistrict"
placeholder="请选择"
:options="xzList"
:props="props"
:disabled="isNoneDivision"
>
</el-cascader>
</el-form-item>
</el-col>
</el-row> -->
<el-row>
<el-col>
<el-form-item label="备注:" prop="remark">
@ -293,6 +258,44 @@
</div>
</div>
</el-dialog>
<!-- 省重点导入对话框 -->
<el-dialog
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
href="/doc/szd_tl.xlsx"
target="_blank"
>下载模板</el-link
>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -310,6 +313,7 @@ import {
// xzTree,
} from "@/api/yingji/keyEnterprise.js";
// import { mapState } from "vuex";
import { getToken } from "@/utils/auth";
export default {
components: { myPagination, executive },
@ -407,6 +411,23 @@ export default {
//
total: 0,
fileList: [],
//
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() },
//
url:
process.env.VUE_APP_BASE_API +
"/pharmaceuticals/bKeyEnterprise/common/importExcel",
},
};
},
created() {
@ -420,60 +441,38 @@ export default {
// }),
// },
methods: {
//
// componendDistrict(district){
// let name
// this.options.map((item)=>{
// if(item.value == district) {
// name = item.label
// } else {
// item.children.map((itemTwo)=>{
// if(itemTwo.value == district) {
// name = item.label + '-' + itemTwo.label
// }
// })
// }
// })
// return name
// },
//
// quhuadizhi(district) {
// this.options = district
// },
// getTreeList() {
// xzTree().then((res1) => {
// if (this.dept.parentId == 0) {
// res1.data.forEach((value, index) => {
// this.xzList.push({
// value: value.county,
// label: value.institutionName,
// children: [],
// });
// if (value.children.length > 0) {
// value.children.forEach((value1, index1) => {
// this.xzList[index].children.push({
// value: value1.subdistrict,
// label: value1.institutionName,
// });
// });
// }
// });
// }
// });
// },
handleRemove() {},
// quhua(e) {
// this.district = e;
// },
handleImport() {
this.upload.title = "省重点企业导入";
this.upload.open = true;
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
},
searchList() {
this.searchBefore = {
pageSize: 10,
pageNum: 1,
};
this.$refs.mypagination.defaultPages();
// if (this.district) {
// this.queryParms.district = this.district;
// }
this.searchBefore = { ...this.searchBefore, ...this.queryParms };
this.getList();
},
@ -556,18 +555,6 @@ export default {
},
//
confirm() {
// if (this.queryParmsdistrict) {
// if (this.queryParmsdistrict.length == 1) {
// this.form.district = this.queryParmsdistrict[0];
// } else if (
// this.queryParmsdistrict.length == 2 &&
// this.queryParmsdistrict[0] == this.queryParmsdistrict[1]
// ) {
// this.form.district = this.queryParmsdistrict[0];
// } else {
// this.form.district = this.queryParmsdistrict[1];
// }
// }
this.$refs.form1.validate((valid) => {
if (valid) {
if (this.form.id != null) {
@ -639,42 +626,9 @@ export default {
this.getList();
},
handleSuccess() {},
//
exportFile(e) {
let downloadLoadingInstance = Loading.service({
text: "正在导入数据,请稍候",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
let a = new FormData();
a.append("file", e.file);
exportEnterprise(a)
.then((res) => {
downloadLoadingInstance.close();
this.queryParms.year = "";
this.searchBefore = {
pageSize: 10,
pageNum: 1,
};
this.$refs.mypagination.defaultPages();
this.getList();
this.$refs.uploadOver.clearFiles();
})
.catch(() => {
downloadLoadingInstance.close();
this.$model.msgError("导入失败");
});
},
},
mounted() {
this.checkListTwo = this.checkList;
// this.$nextTick(()=>{
// let dom = document.getElementsByClassName('tables');
// let height = dom[0].getBoundingClientRect();
// let windowHeight = window.innerHeight;
// let relativeHeight = windowHeight - height.top
// this.main.height = relativeHeight - 80
// })
},
};
</script>

Loading…
Cancel
Save