添加噪声导入模板下载
This commit is contained in:
BIN
public/template/功能区噪声-县.xlsx
Normal file
BIN
public/template/功能区噪声-县.xlsx
Normal file
Binary file not shown.
BIN
public/template/功能区噪声-市.xlsx
Normal file
BIN
public/template/功能区噪声-市.xlsx
Normal file
Binary file not shown.
BIN
public/template/区域噪声-县.xlsx
Normal file
BIN
public/template/区域噪声-县.xlsx
Normal file
Binary file not shown.
BIN
public/template/区域噪声-市.xlsx
Normal file
BIN
public/template/区域噪声-市.xlsx
Normal file
Binary file not shown.
BIN
public/template/道路交通噪声-县.xlsx
Normal file
BIN
public/template/道路交通噪声-县.xlsx
Normal file
Binary file not shown.
BIN
public/template/道路交通噪声-市.xlsx
Normal file
BIN
public/template/道路交通噪声-市.xlsx
Normal file
Binary file not shown.
@@ -3,20 +3,22 @@
|
|||||||
<a-card style="width: 100%" :bordered="false">
|
<a-card style="width: 100%" :bordered="false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<a-space>
|
<a-space>
|
||||||
|
<a-select
|
||||||
|
ref="select"
|
||||||
|
v-model:value="regionLevel"
|
||||||
|
style="width: 120px"
|
||||||
|
>
|
||||||
|
<a-select-option value="city">市</a-select-option>
|
||||||
|
<a-select-option value="county">县</a-select-option>
|
||||||
|
</a-select>
|
||||||
<a-upload
|
<a-upload
|
||||||
:before-upload="importFileCity"
|
:before-upload="importFile"
|
||||||
:showUploadList="false"
|
:showUploadList="false"
|
||||||
accept=".xls,.xlsx,.csv"
|
accept=".xls,.xlsx,.csv"
|
||||||
>
|
>
|
||||||
<a-button>市级导入</a-button>
|
<a-button type="primary">数据导入</a-button>
|
||||||
</a-upload>
|
|
||||||
<a-upload
|
|
||||||
:before-upload="importFileArea"
|
|
||||||
:showUploadList="false"
|
|
||||||
accept=".xls,.xlsx,.csv"
|
|
||||||
>
|
|
||||||
<a-button>县级导入</a-button>
|
|
||||||
</a-upload>
|
</a-upload>
|
||||||
|
<a-button @click="download">模板下载</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
<a-tabs v-model:activeKey="activeKey">
|
<a-tabs v-model:activeKey="activeKey">
|
||||||
@@ -31,9 +33,11 @@
|
|||||||
<script>
|
<script>
|
||||||
import XLSX from "xlsx";
|
import XLSX from "xlsx";
|
||||||
import utils from "./utils";
|
import utils from "./utils";
|
||||||
import { Modal } from "ant-design-vue";
|
import {Modal} from "ant-design-vue";
|
||||||
import NoiseBill from "./noise-bill.vue";
|
import NoiseBill from "./noise-bill.vue";
|
||||||
import { saveFunctionNoiseBill } from "@/api/ecology/noise/function-sound";
|
import {saveFunctionNoiseBill} from "@/api/ecology/noise/function-sound";
|
||||||
|
import {downloadTemplate} from "@/utils/excel-util";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "FunctionCollectIndex",
|
name: "FunctionCollectIndex",
|
||||||
components: {
|
components: {
|
||||||
@@ -42,9 +46,28 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeKey: "noise",
|
activeKey: "noise",
|
||||||
|
regionLevel: "city"
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
download() {
|
||||||
|
let filename = "功能区噪声-"
|
||||||
|
if (this.regionLevel == "city") {
|
||||||
|
filename += "市"
|
||||||
|
} else if (this.regionLevel == "county") {
|
||||||
|
filename += "县"
|
||||||
|
} else {
|
||||||
|
filename += "站点"
|
||||||
|
}
|
||||||
|
downloadTemplate(filename)
|
||||||
|
},
|
||||||
|
importFile(file) {
|
||||||
|
if (this.regionLevel == "city") {
|
||||||
|
this.importFileCity(file);
|
||||||
|
} else {
|
||||||
|
this.importFileCounty(file);
|
||||||
|
}
|
||||||
|
},
|
||||||
/* 导入本地excel文件 */
|
/* 导入本地excel文件 */
|
||||||
importFileCity(file) {
|
importFileCity(file) {
|
||||||
const hide = this.$message.loading("导入中..", 0);
|
const hide = this.$message.loading("导入中..", 0);
|
||||||
@@ -62,7 +85,7 @@ export default {
|
|||||||
let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], {
|
let aoa = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]], {
|
||||||
header: 1,
|
header: 1,
|
||||||
});
|
});
|
||||||
let aoa2= XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[1]], {
|
let aoa2 = XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[1]], {
|
||||||
header: 1,
|
header: 1,
|
||||||
});
|
});
|
||||||
const reportDate = aoa[1][0].replace(/[^\d]+/g, "-");
|
const reportDate = aoa[1][0].replace(/[^\d]+/g, "-");
|
||||||
@@ -139,7 +162,7 @@ export default {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
importFileArea(file) {
|
importFileCounty(file) {
|
||||||
const hide = this.$message.loading("导入中..", 0);
|
const hide = this.$message.loading("导入中..", 0);
|
||||||
|
|
||||||
let reader = new FileReader();
|
let reader = new FileReader();
|
||||||
|
|||||||
@@ -3,20 +3,22 @@
|
|||||||
<a-card style="width: 100%" :bordered="false">
|
<a-card style="width: 100%" :bordered="false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<a-space>
|
<a-space>
|
||||||
|
<a-select
|
||||||
|
ref="select"
|
||||||
|
v-model:value="regionLevel"
|
||||||
|
style="width: 120px"
|
||||||
|
>
|
||||||
|
<a-select-option value="city">市</a-select-option>
|
||||||
|
<a-select-option value="county">县</a-select-option>
|
||||||
|
</a-select>
|
||||||
<a-upload
|
<a-upload
|
||||||
:before-upload="importFileCity"
|
:before-upload="importFile"
|
||||||
:showUploadList="false"
|
:showUploadList="false"
|
||||||
accept=".xls,.xlsx,.csv"
|
accept=".xls,.xlsx,.csv"
|
||||||
>
|
>
|
||||||
<a-button>市级导入</a-button>
|
<a-button type="primary">数据导入</a-button>
|
||||||
</a-upload>
|
|
||||||
<a-upload
|
|
||||||
:before-upload="importFileArea"
|
|
||||||
:showUploadList="false"
|
|
||||||
accept=".xls,.xlsx,.csv"
|
|
||||||
>
|
|
||||||
<a-button>县级导入</a-button>
|
|
||||||
</a-upload>
|
</a-upload>
|
||||||
|
<a-button @click="download">模板下载</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
<a-tabs v-model:activeKey="activeKey">
|
<a-tabs v-model:activeKey="activeKey">
|
||||||
@@ -34,6 +36,7 @@ import utils from "./utils";
|
|||||||
import {Modal} from "ant-design-vue";
|
import {Modal} from "ant-design-vue";
|
||||||
import NoiseBill from "./noise-bill.vue";
|
import NoiseBill from "./noise-bill.vue";
|
||||||
import {saveRoadNoiseBill} from "@/api/ecology/noise/road-sound";
|
import {saveRoadNoiseBill} from "@/api/ecology/noise/road-sound";
|
||||||
|
import {downloadTemplate} from "@/utils/excel-util";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "RoadCollectIndex",
|
name: "RoadCollectIndex",
|
||||||
@@ -43,9 +46,28 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeKey: "noise",
|
activeKey: "noise",
|
||||||
|
regionLevel: "city"
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
download(){
|
||||||
|
let filename = "道路交通噪声-"
|
||||||
|
if (this.regionLevel == "city") {
|
||||||
|
filename += "市"
|
||||||
|
} else if (this.regionLevel == "county") {
|
||||||
|
filename += "县"
|
||||||
|
} else {
|
||||||
|
filename += "站点"
|
||||||
|
}
|
||||||
|
downloadTemplate(filename)
|
||||||
|
},
|
||||||
|
importFile(file){
|
||||||
|
if(this.regionLevel == "city"){
|
||||||
|
this.importFileCity(file);
|
||||||
|
}else {
|
||||||
|
this.importFileCounty(file);
|
||||||
|
}
|
||||||
|
},
|
||||||
/* 导入本地excel文件 */
|
/* 导入本地excel文件 */
|
||||||
importFileCity(file) {
|
importFileCity(file) {
|
||||||
const hide = this.$message.loading("导入中..", 0);
|
const hide = this.$message.loading("导入中..", 0);
|
||||||
@@ -172,7 +194,7 @@ export default {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
importFileArea(file) {
|
importFileCounty(file) {
|
||||||
const hide = this.$message.loading("导入中..", 0);
|
const hide = this.$message.loading("导入中..", 0);
|
||||||
|
|
||||||
let reader = new FileReader();
|
let reader = new FileReader();
|
||||||
|
|||||||
@@ -3,20 +3,22 @@
|
|||||||
<a-card style="width: 100%" :bordered="false">
|
<a-card style="width: 100%" :bordered="false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<a-space>
|
<a-space>
|
||||||
|
<a-select
|
||||||
|
ref="select"
|
||||||
|
v-model:value="regionLevel"
|
||||||
|
style="width: 120px"
|
||||||
|
>
|
||||||
|
<a-select-option value="city">市</a-select-option>
|
||||||
|
<a-select-option value="county">县</a-select-option>
|
||||||
|
</a-select>
|
||||||
<a-upload
|
<a-upload
|
||||||
:before-upload="importFileCity"
|
:before-upload="importFile"
|
||||||
:showUploadList="false"
|
:showUploadList="false"
|
||||||
accept=".xls,.xlsx,.csv"
|
accept=".xls,.xlsx,.csv"
|
||||||
>
|
>
|
||||||
<a-button>市级导入</a-button>
|
<a-button type="primary">数据导入</a-button>
|
||||||
</a-upload>
|
|
||||||
<a-upload
|
|
||||||
:before-upload="importFileArea"
|
|
||||||
:showUploadList="false"
|
|
||||||
accept=".xls,.xlsx,.csv"
|
|
||||||
>
|
|
||||||
<a-button>县级导入</a-button>
|
|
||||||
</a-upload>
|
</a-upload>
|
||||||
|
<a-button @click="download">模板下载</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
<a-tabs v-model:activeKey="activeKey">
|
<a-tabs v-model:activeKey="activeKey">
|
||||||
@@ -34,6 +36,7 @@ import utils from "./utils";
|
|||||||
import {Modal} from "ant-design-vue";
|
import {Modal} from "ant-design-vue";
|
||||||
import NoiseBill from "./noise-bill.vue";
|
import NoiseBill from "./noise-bill.vue";
|
||||||
import {saveZoneNoiseBill} from "@/api/ecology/noise/zone-sound";
|
import {saveZoneNoiseBill} from "@/api/ecology/noise/zone-sound";
|
||||||
|
import {downloadTemplate} from "@/utils/excel-util";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ZoneCollectIndex",
|
name: "ZoneCollectIndex",
|
||||||
@@ -43,9 +46,28 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeKey: "noise",
|
activeKey: "noise",
|
||||||
|
regionLevel: "city"
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
download() {
|
||||||
|
let filename = "区域噪声-"
|
||||||
|
if (this.regionLevel == "city") {
|
||||||
|
filename += "市"
|
||||||
|
} else if (this.regionLevel == "county") {
|
||||||
|
filename += "县"
|
||||||
|
} else {
|
||||||
|
filename += "站点"
|
||||||
|
}
|
||||||
|
downloadTemplate(filename)
|
||||||
|
},
|
||||||
|
importFile(file) {
|
||||||
|
if (this.regionLevel == "city") {
|
||||||
|
this.importFileCity(file);
|
||||||
|
} else {
|
||||||
|
this.importFileCounty(file);
|
||||||
|
}
|
||||||
|
},
|
||||||
/* 导入本地excel文件 */
|
/* 导入本地excel文件 */
|
||||||
importFileCity(file) {
|
importFileCity(file) {
|
||||||
const hide = this.$message.loading("导入中..", 0);
|
const hide = this.$message.loading("导入中..", 0);
|
||||||
@@ -152,7 +174,7 @@ export default {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
importFileArea(file) {
|
importFileCounty(file) {
|
||||||
const hide = this.$message.loading("导入中..", 0);
|
const hide = this.$message.loading("导入中..", 0);
|
||||||
|
|
||||||
let reader = new FileReader();
|
let reader = new FileReader();
|
||||||
|
|||||||
Reference in New Issue
Block a user