导入控件

zhangtao
laozt 1 year ago
parent e9a8bf4b74
commit 72eea2f713

@ -1,9 +1,9 @@
### ###
# @Author: 张涛 # @Author: 张涛
# @Date: 2023-07-18 13:04:50 # @Date: 2023-07-18 13:04:50
# @LastEditors: JC9527 # @LastEditors: 张涛
# @LastEditTime: 2023-10-12 10:31:29 # @LastEditTime: 2023-10-12 13:12:38
# @FilePath: \Mudu2PC\.env.development # @FilePath: \suzhouyingjiPC\.env.development
### ###
# 页面标题 # 页面标题
VUE_APP_TITLE = 苏州应急执法计划管理系统 VUE_APP_TITLE = 苏州应急执法计划管理系统
@ -15,8 +15,10 @@ ENV = 'development'
# VUE_APP_BASE_API = 'http://39.101.188.84:9033' # 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://192.168.0.106:9033'
VUE_APP_BASE_API = 'http://180.108.205.123:13002' 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-item @click.native="logout">退出登录</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<!-- <div <div
class="showGLstyle" class="showGLstyle"
v-if="roles && roles[0] == 'admin'" v-if="roles && roles[0] == 'admin'"
@click="toNewPage" @click="toNewPage"
> >
进入管理平台 进入管理平台
</div> --> </div>
</header> </header>
<div class="bottom-view"> <div class="bottom-view">
<router-view></router-view> <router-view></router-view>

@ -3,8 +3,8 @@
* @version: * @version:
* @Author: JC9527 * @Author: JC9527
* @Date: 2023-09-04 10:20:06 * @Date: 2023-09-04 10:20:06
* @LastEditors: JC9527 * @LastEditors: 张涛
* @LastEditTime: 2023-09-27 17:06:02 * @LastEditTime: 2023-10-12 13:33:22
--> -->
<template> <template>
<div class="container-main" ref="main"> <div class="container-main" ref="main">
@ -59,21 +59,14 @@
<div class="export" style="background: #f71052" @click="deleteItem"> <div class="export" style="background: #f71052" @click="deleteItem">
<span>删除</span> <span>删除</span>
</div> </div>
<el-upload
class="upload-demo" <div
action="1" class="export"
ref="uploadOver" @click="handleImport"
:http-request="exportFile" style="background-color: #28b384"
:on-success="handleSuccess"
:multiple="false"
:show-file-list="false"
:limit="1"
:file-list="fileList"
> >
<div class="export export1"> <span>导入</span>
<span>导入</span> </div>
</div>
</el-upload>
</div> </div>
</div> </div>
<div class="tables"> <div class="tables">
@ -107,8 +100,6 @@
header-align="center" header-align="center"
> >
</el-table-column> </el-table-column>
<!-- <el-table-column prop="type" label="企业类别" header-align="center">
</el-table-column> -->
<el-table-column label="操作" header-align="center"> <el-table-column label="操作" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -187,7 +178,7 @@
<el-date-picker <el-date-picker
v-model="form.year" v-model="form.year"
type="year" type="year"
placeholder="请选择" placeholder="请选择年份"
value-format="yyyy" value-format="yyyy"
size="small" size="small"
> >
@ -195,32 +186,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </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-row>
<el-col> <el-col>
<el-form-item label="备注:" prop="remark"> <el-form-item label="备注:" prop="remark">
@ -293,6 +258,44 @@
</div> </div>
</div> </div>
</el-dialog> </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> </div>
</template> </template>
@ -310,6 +313,7 @@ import {
// xzTree, // xzTree,
} from "@/api/yingji/keyEnterprise.js"; } from "@/api/yingji/keyEnterprise.js";
// import { mapState } from "vuex"; // import { mapState } from "vuex";
import { getToken } from "@/utils/auth";
export default { export default {
components: { myPagination, executive }, components: { myPagination, executive },
@ -407,6 +411,23 @@ export default {
// //
total: 0, total: 0,
fileList: [], 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() { created() {
@ -420,60 +441,38 @@ export default {
// }), // }),
// }, // },
methods: { methods: {
// handleImport() {
// componendDistrict(district){ this.upload.title = "省重点企业导入";
// let name this.upload.open = true;
// this.options.map((item)=>{ },
// if(item.value == district) { //
// name = item.label handleFileUploadProgress(event, file, fileList) {
// } else { this.upload.isUploading = true;
// item.children.map((itemTwo)=>{ },
// if(itemTwo.value == district) { //
// name = item.label + '-' + itemTwo.label handleFileSuccess(response, file, fileList) {
// } this.upload.open = false;
// }) this.upload.isUploading = false;
// } this.$refs.upload.clearFiles();
// }) this.$alert(
// return name "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
// }, response.msg +
// "</div>",
// quhuadizhi(district) { "导入结果",
// this.options = district { dangerouslyUseHTMLString: true }
// }, );
// getTreeList() { this.getList();
// xzTree().then((res1) => { },
// if (this.dept.parentId == 0) { //
// res1.data.forEach((value, index) => { submitFileForm() {
// this.xzList.push({ this.$refs.upload.submit();
// 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;
// },
searchList() { searchList() {
this.searchBefore = { this.searchBefore = {
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1,
}; };
this.$refs.mypagination.defaultPages(); this.$refs.mypagination.defaultPages();
// if (this.district) {
// this.queryParms.district = this.district;
// }
this.searchBefore = { ...this.searchBefore, ...this.queryParms }; this.searchBefore = { ...this.searchBefore, ...this.queryParms };
this.getList(); this.getList();
}, },
@ -556,18 +555,6 @@ export default {
}, },
// //
confirm() { 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) => { this.$refs.form1.validate((valid) => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
@ -639,42 +626,9 @@ export default {
this.getList(); this.getList();
}, },
handleSuccess() {}, 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() { mounted() {
this.checkListTwo = this.checkList; 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> </script>

Loading…
Cancel
Save