From 71891f73bdab2d994fe6d8f4ed4078e9972a28d9 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Wed, 27 Oct 2021 17:09:41 +0800
Subject: [PATCH] 导出数据
---
src/views/qualificationExamination/qualificationExamination.vue | 61 ++++++++++++
src/views/onSiteInspection/company.vue | 66 +++++++-----
src/components/map/main.vue | 4
src/views/onSiteInspection/securityStaff.vue | 65 +++++++-----
src/views/qualificationExamination/scoreInquiry.vue | 71 +++++++++++++
5 files changed, 206 insertions(+), 61 deletions(-)
diff --git a/src/components/map/main.vue b/src/components/map/main.vue
index e493011..faf0396 100644
--- a/src/components/map/main.vue
+++ b/src/components/map/main.vue
@@ -93,8 +93,8 @@
},
mounted() {
//建立地图
- // this.createmap(1); //1为本地
- this.createmap(); //空或其他是外网
+ this.createmap(1); //1为本地
+ // this.createmap(); //空或其他是外网
this.parentParameter();
diff --git a/src/views/onSiteInspection/company.vue b/src/views/onSiteInspection/company.vue
index e1f107a..76ea045 100644
--- a/src/views/onSiteInspection/company.vue
+++ b/src/views/onSiteInspection/company.vue
@@ -19,6 +19,7 @@
@row-save="rowSave"
@row-del="rowDel"
@search-change="searchChange"
+ :search.sync="query"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@@ -213,34 +214,43 @@
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
- }).then(() => {
- //获取查询条件
- // console.log(this.userInfo, 456);
- // return;
- var data = {
- startTime: this.query.startTime,
- endTime: this.query.endTime,
- reviewedDeptName: this.query.reviewedDeptName,
- realName: this.query.realName,
- jurisdiction: this.userInfo.jurisdiction,
- };
- //导出
- // if (
- // this.userInfo.role_name == "保安公司管理员" ||
- // this.userInfo.role_name == "保安"
- // ) {
- // //如果是保安公司管理员
- // data["deptId"] = this.userInfo.dept_id;
- // }
- // if (this.userInfo.role_name == "培训公司管理员") {
- // //如果是培训公司管理员
- // data["trainUnitId"] = this.userInfo.dept_id;
- // }
- // data["examType"] = 2;
- //序列号url形式,用&拼接
- data = Qs.stringify(data);
- window.open(`/api/coinspect/export-coinspect?` + data);
- });
+ })
+ .then(() => {
+ //获取查询条件
+ // console.log(this.userInfo, 456);
+ // return;
+ var data = {
+ startTime: this.query.startTime,
+ endTime: this.query.endTime,
+ reviewedDeptName: this.query.reviewedDeptName,
+ realName: this.query.realName,
+ jurisdiction: this.userInfo.jurisdiction,
+ };
+ //导出
+ // if (
+ // this.userInfo.role_name == "保安公司管理员" ||
+ // this.userInfo.role_name == "保安"
+ // ) {
+ // //如果是保安公司管理员
+ // data["deptId"] = this.userInfo.dept_id;
+ // }
+ // if (this.userInfo.role_name == "培训公司管理员") {
+ // //如果是培训公司管理员
+ // data["trainUnitId"] = this.userInfo.dept_id;
+ // }
+ // data["examType"] = 2;
+ //序列号url形式,用&拼接
+ data = Qs.stringify(data);
+ window.open(`/api/coinspect/export-coinspect?` + data);
+ })
+ .catch((action) => {
+ // this.$message({
+ // type: 'info',
+ // message: action === 'cancel'
+ // ? '放弃保存并离开页面'
+ // : '停留在当前页面'
+ // })
+ });
},
getStartTime() {
if (
diff --git a/src/views/onSiteInspection/securityStaff.vue b/src/views/onSiteInspection/securityStaff.vue
index 9e9fde2..a3d5986 100644
--- a/src/views/onSiteInspection/securityStaff.vue
+++ b/src/views/onSiteInspection/securityStaff.vue
@@ -323,34 +323,43 @@
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
- }).then(() => {
- //获取查询条件
- // console.log(this.userInfo, 456);
- // return;
- var data = {
- startTime: this.query.startTime,
- endTime: this.query.endTime,
- realName: this.query.realName,
- securityName: this.query.securityName,
- jurisdiction: this.userInfo.jurisdiction,
- };
- //导出
- // if (
- // this.userInfo.role_name == "保安公司管理员" ||
- // this.userInfo.role_name == "保安"
- // ) {
- // //如果是保安公司管理员
- // data["deptId"] = this.userInfo.dept_id;
- // }
- // if (this.userInfo.role_name == "培训公司管理员") {
- // //如果是培训公司管理员
- // data["trainUnitId"] = this.userInfo.dept_id;
- // }
- // data["examType"] = 2;
- //序列号url形式,用&拼接
- data = Qs.stringify(data);
- window.open(`/api/seinspect/export-seinspect?` + data);
- });
+ })
+ .then(() => {
+ //获取查询条件
+ // console.log(this.userInfo, 456);
+ // return;
+ var data = {
+ startTime: this.query.startTime,
+ endTime: this.query.endTime,
+ realName: this.query.realName,
+ securityName: this.query.securityName,
+ jurisdiction: this.userInfo.jurisdiction,
+ };
+ //导出
+ // if (
+ // this.userInfo.role_name == "保安公司管理员" ||
+ // this.userInfo.role_name == "保安"
+ // ) {
+ // //如果是保安公司管理员
+ // data["deptId"] = this.userInfo.dept_id;
+ // }
+ // if (this.userInfo.role_name == "培训公司管理员") {
+ // //如果是培训公司管理员
+ // data["trainUnitId"] = this.userInfo.dept_id;
+ // }
+ // data["examType"] = 2;
+ //序列号url形式,用&拼接
+ data = Qs.stringify(data);
+ window.open(`/api/seinspect/export-seinspect?` + data);
+ })
+ .catch((action) => {
+ // this.$message({
+ // type: 'info',
+ // message: action === 'cancel'
+ // ? '放弃保存并离开页面'
+ // : '停留在当前页面'
+ // })
+ });
},
getStartTime() {
if (
diff --git a/src/views/qualificationExamination/qualificationExamination.vue b/src/views/qualificationExamination/qualificationExamination.vue
index 3db89e8..59211dc 100644
--- a/src/views/qualificationExamination/qualificationExamination.vue
+++ b/src/views/qualificationExamination/qualificationExamination.vue
@@ -27,6 +27,17 @@
@on-load="onLoad"
@sort-change="sortChange"
>
+ <!-- 自定义按钮 -->
+ <template slot="menuLeft">
+ <el-button
+ type="warning"
+ size="small"
+ plain
+ icon="el-icon-download"
+ @click="handleExport"
+ >导出
+ </el-button>
+ </template>
</avue-crud>
</basic-container>
</template>
@@ -43,6 +54,7 @@
import { datasing } from "./dataqualificationExamination";
// import { getList } from "@/api/qualificationExamination/qualificationExamination";
import { getListSecurity } from "@/api/system/user";
+import Qs from "qs";
export default {
data() {
@@ -303,7 +315,7 @@
};
},
computed: {
- ...mapGetters(["permission"]),
+ ...mapGetters(["permission", "userInfo"]),
permissionList() {
return {
addBtn: this.vaildData(this.permission.post_add, false),
@@ -321,6 +333,53 @@
},
},
methods: {
+ //导出
+ handleExport() {
+ this.$confirm("是否导出审查信息?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ //获取查询条件
+ // console.log(this.userInfo, 456);
+ // console.log(this.query, 456);
+ // return;
+ var data = {
+ cardid: this.query.cardid,
+ realName: this.query.realName,
+ securitynumber: this.query.securitynumber,
+ status: this.query.status,
+ endTime: this.query.endTime,
+ startTime: this.query.startTime,
+ jurisdiction: this.userInfo.jurisdiction,
+ };
+ //导出
+ // if (
+ // this.userInfo.role_name == "保安公司管理员" ||
+ // this.userInfo.role_name == "保安"
+ // ) {
+ // //如果是保安公司管理员
+ // data["deptId"] = this.userInfo.dept_id;
+ // }
+ // if (this.userInfo.role_name == "培训公司管理员") {
+ // //如果是培训公司管理员
+ // data["trainUnitId"] = this.userInfo.dept_id;
+ // }
+ // data["examType"] = 2;
+ //序列号url形式,用&拼接
+ data = Qs.stringify(data);
+ window.open(`/api/blade-user/export-security?` + data);
+ })
+ .catch((action) => {
+ // this.$message({
+ // type: 'info',
+ // message: action === 'cancel'
+ // ? '放弃保存并离开页面'
+ // : '停留在当前页面'
+ // })
+ });
+ },
getStartTime() {
if (
this.$route.query.startTime != undefined &&
diff --git a/src/views/qualificationExamination/scoreInquiry.vue b/src/views/qualificationExamination/scoreInquiry.vue
index 6affe39..04216f4 100644
--- a/src/views/qualificationExamination/scoreInquiry.vue
+++ b/src/views/qualificationExamination/scoreInquiry.vue
@@ -18,6 +18,7 @@
@row-update="rowUpdates"
@row-save="rowSave"
@row-del="rowDel"
+ :search.sync="query"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@@ -26,6 +27,17 @@
@refresh-change="refreshChange"
@on-load="onLoad"
>
+ <!-- 自定义按钮 -->
+ <template slot="menuLeft">
+ <el-button
+ type="warning"
+ size="small"
+ plain
+ icon="el-icon-download"
+ @click="handleExport"
+ >导出
+ </el-button>
+ </template>
</avue-crud>
</basic-container>
</template>
@@ -42,7 +54,7 @@
import { datasing } from "./dataqualificationExamination";
// import { getList } from "@/api/qualificationExamination/qualificationExamination";
import { getLisperexamScore } from "@/api/qualificationExamination/scoreInquiry";
-
+import Qs from "qs";
export default {
data() {
return {
@@ -208,6 +220,10 @@
// slot: true,
// display: false,
},
+ {
+ label: "是否发证",
+ prop: "isFazheng",
+ },
],
},
data: [
@@ -223,7 +239,7 @@
};
},
computed: {
- ...mapGetters(["permission"]),
+ ...mapGetters(["permission", "userInfo"]),
permissionList() {
return {
addBtn: this.vaildData(this.permission.post_add, false),
@@ -241,6 +257,52 @@
},
},
methods: {
+ //导出
+ handleExport() {
+ this.$confirm("是否导出成绩信息?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ //获取查询条件
+ // console.log(this.userInfo, 456);
+ // console.log(this.query, 456);
+ // return;
+ var data = {
+ startTime: this.query.startTime,
+ endTime: this.query.endTime,
+ qualified: this.query.qualified,
+ examName: this.query.examName,
+ securityName: this.query.securityName,
+ jurisdiction: this.userInfo.jurisdiction,
+ };
+ //导出
+ // if (
+ // this.userInfo.role_name == "保安公司管理员" ||
+ // this.userInfo.role_name == "保安"
+ // ) {
+ // //如果是保安公司管理员
+ // data["deptId"] = this.userInfo.dept_id;
+ // }
+ // if (this.userInfo.role_name == "培训公司管理员") {
+ // //如果是培训公司管理员
+ // data["trainUnitId"] = this.userInfo.dept_id;
+ // }
+ // data["examType"] = 2;
+ //序列号url形式,用&拼接
+ data = Qs.stringify(data);
+ window.open(`/api/examScore/export-examScore?` + data);
+ })
+ .catch((action) => {
+ // this.$message({
+ // type: 'info',
+ // message: action === 'cancel'
+ // ? '放弃保存并离开页面'
+ // : '停留在当前页面'
+ // })
+ });
+ },
getStartTime() {
if (
this.$route.query.startTime != undefined &&
@@ -360,6 +422,11 @@
this.page.total = data.total;
this.data = data.records;
for (var k in this.data) {
+ if (this.data[k].qualified == 0) {
+ this.data[k]["isFazheng"] = "已发证";
+ } else {
+ this.data[k]["isFazheng"] = "未发证";
+ }
for (var m in this.data[k]) {
if (this.data[k][m] == -1) {
this.data[k][m] = "";
--
Gitblit v1.9.3