fix: BUG修改

This commit is contained in:
kun 2024-05-20 11:43:36 +08:00
parent a6d5200ce5
commit 30e02139cf
7 changed files with 113 additions and 5 deletions

View File

@ -458,3 +458,8 @@ export const getProjectInfo = (params: any) => {
export const downModel = (params: any) => {
return http.post(`/xmgl/governmentConfig/queryById`, params);
};
// 质量、安全导出功能
export const exportXlsApi = (params: any) => {
return http.post(`/gov/inspectRecord/exportXls`, params, { responseType: "blob" });
};

View File

@ -28,12 +28,20 @@
// height: 80%;
overflow: auto;
background-color: transparent;
color: #c4c4c4;
.el-tree-node__content {
color: #ffffff;
height: auto;
margin-bottom: 5px;
}
.el-tree-node__content:hover {
background: #09405f;
color: #ffffff;
font-size: 20px;
}
.el-tree-node__children .el-tree-node__content {
color: #c4c4c4;
}
.el-tree-node__children .el-tree-node__content:hover {
background: #09405f;
color: #0bc4f0;
font-size: 20px;

View File

@ -238,14 +238,14 @@ onMounted(async () => {});
}
td.el-table__cell {
background-color: transparent !important;
border-bottom: 0 !important;
// border-bottom: 0 !important;
color: var(--el-menu-text-color);
font-size: 20px !important;
border-right: 2px solid #252526;
}
th.el-table__cell {
background-color: transparent;
border-bottom: 0 !important;
// border-bottom: 0 !important;
border-right: 2px solid #252526;
}
.el-table__inner-wrapper::before {

View File

@ -1,10 +1,13 @@
<template>
<div class="overview">
<el-dialog :show-close="false" v-model="visible1" :style="dialogStyle" @close="closeMain">
<el-dialog id="contentPrint" :show-close="false" v-model="visible1" :style="dialogStyle" @close="closeMain">
<template #title>
<div class="title-detail">
<img src="@/assets/images/tableIcon/look.png" alt="" />
<span>查看隐患整改信息</span>
<el-button type="primary" @click="submitPrint" style="margin-right: 20px">
<span>打印</span>
</el-button>
<el-icon>
<close @click="closeMain" />
</el-icon>
@ -320,6 +323,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
import type { FormInstance, UploadProps } from "element-plus";
import { relativeInfo, timeLineData, singleOptionAudit, allOptionAudit } from "@/api/modules/goverment";
import { submitReform } from "@/api/modules/project";
import printJS from "print-js";
const props = defineProps({
detailsDialog: Boolean,
relativeId: String
@ -349,6 +353,16 @@ const reformInfo = ref({
solveImage: []
});
const baseUrl = import.meta.env.VITE_API_URL;
//
const submitPrint = async () => {
printJS({
printable: "contentPrint",
type: "html",
targetStyles: ["*"],
maxWidth: 5000,
style: "@page{size:auto; margin: 0;}" + "@media print { @page {size: landscape; } }"
});
};
//
const submitForm = async () => {
reformInfo.value.solveImage = JSON.stringify(reformInfo.value.solveImage);

View File

@ -44,6 +44,7 @@
>
<template #formButton="scope">
<el-button v-auth="'quality_inspect_add'" class="btnStyle" @click="handleAddItem">新增</el-button>
<el-button class="btnStyle" @click="handleExport">导出</el-button>
</template>
<template #operation="{ row }">
<el-button type="primary" link @click="handleLookItem(row)">
@ -100,6 +101,7 @@ import orderAdd from "./components/orderAdd.vue";
import { statisticsTable } from "@/api/modules/goverment";
import LeftMenu from "@/components/LeftMenu/LeftMenu.vue";
import { getDustprojectPage, getDustengineeringPage } from "@/api/modules/goverment";
import { exportXlsApi } from "@/api/modules/huizhou";
import { sendIframeMessage } from "@/utils/util";
import { GlobalStore } from "@/stores";
const route = useRoute();
@ -188,6 +190,38 @@ const searchSn = ref("");
const searchName = ref("");
// ProTable 便
const proTable = ref();
const baseUrl = import.meta.env.VITE_API_URL;
//
const handleExport = () => {
let requestData = {
engineeringSn: searchSn.value,
pageNo: pages.value.pageNo,
pageSize: pages.value.pageSize,
engineeringName: proTable.value.searchParam.engineeringName,
state: proTable.value.searchParam.state,
type: 2
};
exportXlsApi(requestData).then((res: any) => {
console.log(res);
let url = window.URL.createObjectURL(res);
let a = document.createElement("a");
console.log(url);
a.href = url;
a.download = "质量检查.xlsx";
a.click();
document.removeChild(a);
});
// window.location.href =
// baseUrl +
// "/gov/inspectRecord/exportXls?engineeringSn=" +
// searchSn.value +
// "&pageNo=" +
// pages.value.pageNo +
// "&pageSize=" +
// pages.value.pageSize +
// "&engineeringName=" +
// proTable.value.searchParam.engineeringName;
};
//
const handleAddItem = () => {
orderDialog.value = true;

View File

@ -1,10 +1,13 @@
<template>
<div class="overview">
<el-dialog :show-close="false" v-model="visible1" :style="dialogStyle" @close="closeMain">
<el-dialog id="contentPrint" :show-close="false" v-model="visible1" :style="dialogStyle" @close="closeMain">
<template #title>
<div class="title-detail">
<img src="@/assets/images/tableIcon/look.png" alt="" />
<span>查看隐患整改信息</span>
<el-button type="primary" @click="submitPrint" style="margin-right: 20px">
<span>打印</span>
</el-button>
<el-icon>
<close @click="closeMain" />
</el-icon>
@ -313,6 +316,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
import type { FormInstance, UploadProps } from "element-plus";
import { relativeInfo, timeLineData, singleOptionAudit, allOptionAudit } from "@/api/modules/goverment";
import { submitReform } from "@/api/modules/project";
import printJS from "print-js";
const baseUrl = import.meta.env.VITE_API_URL;
const props = defineProps({
detailsDialog: Boolean,
@ -341,6 +345,16 @@ const auditForm = ref({
const auditAgainForm = ref({
content: ""
});
//
const submitPrint = async () => {
printJS({
printable: "contentPrint",
type: "html",
targetStyles: ["*"],
maxWidth: 5000,
style: "@page{size:auto; margin: 0;}" + "@media print { @page {size: landscape; } }"
});
};
//
const submitForm = async () => {
reformInfo.value.solveImage = JSON.stringify(reformInfo.value.solveImage);

View File

@ -45,6 +45,7 @@
>
<template #formButton="scope">
<el-button v-auth="'safe_inspect_add'" class="btnStyle" @click="handleAddItem">新增</el-button>
<el-button class="btnStyle" @click="handleExport">导出</el-button>
</template>
<template #operation="{ row }">
<el-button type="primary" link @click="handleLookItem(row)">
@ -101,6 +102,7 @@ import orderAdd from "./components/orderAdd.vue";
import { statisticsTable } from "@/api/modules/goverment";
import LeftMenu from "@/components/LeftMenu/LeftMenu.vue";
import { getDustprojectPage, getDustengineeringPage } from "@/api/modules/goverment";
import { exportXlsApi } from "@/api/modules/huizhou";
import { sendIframeMessage } from "@/utils/util";
import { GlobalStore } from "@/stores";
const route = useRoute();
@ -189,6 +191,37 @@ const searchSn = ref("");
const searchName = ref("");
// ProTable 便
const proTable = ref();
//
const handleExport = () => {
let requestData = {
engineeringSn: searchSn.value,
pageNo: pages.value.pageNo,
pageSize: pages.value.pageSize,
engineeringName: proTable.value.searchParam.engineeringName,
state: proTable.value.searchParam.state,
type: 1
};
exportXlsApi(requestData).then((res: any) => {
console.log(res);
let url = window.URL.createObjectURL(res);
let a = document.createElement("a");
console.log(url);
a.href = url;
a.download = "质量检查.xlsx";
a.click();
document.removeChild(a);
});
// window.location.href =
// baseUrl +
// "/gov/inspectRecord/exportXls?engineeringSn=" +
// searchSn.value +
// "&pageNo=" +
// pages.value.pageNo +
// "&pageSize=" +
// pages.value.pageSize +
// "&engineeringName=" +
// proTable.value.searchParam.engineeringName;
};
//
const handleAddItem = () => {
orderDialog.value = true;