From 5e985136d59734a3821e6043fa429b7fdd420239 Mon Sep 17 00:00:00 2001
From: cqf
Date: Wed, 15 Jun 2022 17:17:22 +0800
Subject: [PATCH] 样式修改
---
src/views/hiddenDangerRegistration/index.vue | 72 ++++++++++++++++++-----------------
1 files changed, 37 insertions(+), 35 deletions(-)
diff --git a/src/views/hiddenDangerRegistration/index.vue b/src/views/hiddenDangerRegistration/index.vue
index 5a6057f..dabdfb3 100644
--- a/src/views/hiddenDangerRegistration/index.vue
+++ b/src/views/hiddenDangerRegistration/index.vue
@@ -140,42 +140,45 @@
</el-form-item>
</el-form>
<el-row class="title-center">
- <el-col :span="fileSpan">
+ <el-col :span="14">
<el-form ref="form" :inline="true" :model="form" label-width="100px">
<el-form-item label="EXCEL导入">
<!-- <el-input v-model="form.name" placeholder="未选择文件"></el-input>-->
<el-upload
class="upload-demo inline-block margin-right-10"
ref="upload"
+ action=""
:http-request="uploadSectionFile"
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList"
:before-upload="beforeUpload"
- :auto-upload="true"
+ :auto-upload="false"
>
<el-button type="primary" size="small" class="btns">选择文件</el-button>
+ <el-button
+ type="primary"
+ class="btns"
+ size="small"
+ icon="el-icon-bottom"
+ @click="dangerImport"
+ >导入</el-button
+ >
+ <el-button
+ type="primary"
+ class="btns"
+ size="small"
+ icon="el-icon-download"
+ @click="downloadTemplate"
+ >下载模板</el-button
+ >
</el-upload>
</el-form-item>
</el-form>
</el-col>
- <el-col :span="14-fileSpan">
- <el-button
- type="primary"
- class="btns"
- size="small"
- icon="el-icon-bottom"
- >导入</el-button
- >
- <el-button
- type="primary"
- class="btns"
- size="small"
- icon="el-icon-download"
- @click="downloadTemplate"
- >下载模板</el-button
- >
- </el-col>
+<!-- <el-col :span="14-fileSpan">-->
+<!-- -->
+<!-- </el-col>-->
<el-col :span="10" style="text-align: right">
<el-button
class="btns"
@@ -284,7 +287,7 @@
</div>
</template>
<script>
-import {getPageList,delDanger,analogy_export_do,downloadFile} from "@/api/sgyhpczl/hiddenDangerRegistration";
+import {getPageList,delDanger,analogy_export_do,downloadFile,danger_import_do} from "@/api/sgyhpczl/hiddenDangerRegistration";
import {initJCBM ,initYHLX, initBC ,initJCLB ,initYHBM ,initYHJB,initLlr} from "@/api/sgyhpczl/initSelect";
export default {
data() {
@@ -474,26 +477,25 @@
return false;
}
},
+ //上传
uploadSectionFile(param) {
+ console.log(param)
let form = new FormData();
- var that = this;
form.append('file', param.file);
- //隐患延期申请附件
- form.append('type', "0");
- uploadFile(form).then(res => {
- var data = res.data;
- if (data.ok) {
- var fileName = data.data.fileName[0];
- if (!fileName.endsWith("a62b")) {
- fileName = fileName + "a62b";
- }
- var fileObj = {
- "fileName": fileName,
- "uid": param.file.uid
- }
- this.fileNameList.push(fileObj);
+ danger_import_do(form).then(res=>{
+ if (res.data.ok==1){
+ console.log(res.data)
+ } else{
+ this.$message({type:'error', message:res.data.msg, duration:3000})
}
+ }).catch(err => {
+ console.log(err)
})
+
+ },
+ //导入
+ dangerImport(){
+ this.$refs.upload.submit();
},
//下载模板
downloadTemplate(){
--
Gitblit v1.9.2