修改
This commit is contained in:
parent
aac2245214
commit
ba2b5e8722
@ -46,9 +46,11 @@
|
||||
"file-saver": "2.0.5",
|
||||
"fuse.js": "6.4.3",
|
||||
"highlight.js": "9.18.5",
|
||||
"html2canvas": "^1.4.1",
|
||||
"js-beautify": "1.13.0",
|
||||
"js-cookie": "3.0.1",
|
||||
"jsencrypt": "3.0.0-rc.1",
|
||||
"jspdf": "^2.5.1",
|
||||
"nprogress": "0.2.0",
|
||||
"quill": "1.3.7",
|
||||
"screenfull": "5.0.2",
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询
|
||||
export function analysis(query) {
|
||||
export function KindergartenPhysicalTestanalysis(query) {
|
||||
return request({
|
||||
url: '/kindergarten/side/analysis',
|
||||
method: 'get',
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询
|
||||
export function analysis(query) {
|
||||
export function constitution(query) {
|
||||
return request({
|
||||
url: '/children/ranking/analysis',
|
||||
method: 'get',
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询
|
||||
export function analysis(query) {
|
||||
export function developmentanalysis(query) {
|
||||
return request({
|
||||
url: '/physical/action/analysis',
|
||||
method: 'get',
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询
|
||||
export function analysis(query) {
|
||||
export function heightAndWeightanalysis(query) {
|
||||
return request({
|
||||
url: '/average/heightAndWeight/analysis',
|
||||
method: 'get',
|
||||
|
||||
@ -36,3 +36,13 @@ export function report(kindergartenId, batchCode) {
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
// 幼儿园报告上传接口
|
||||
|
||||
export function uploadKindergartenCheckReport(data) {
|
||||
return request({
|
||||
url: `/system/kindergartenCheckReport/uploadKindergartenCheckReport`,
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
@ -53,3 +53,14 @@ export function report(id) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 幼儿个人报告上传接口
|
||||
export function uploadPersonalCheckReport(data) {
|
||||
return request({
|
||||
url: `/system/personalCheckReport/uploadPersonalCheckReport `,
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询
|
||||
export function analysis(query) {
|
||||
export function physiqueanalysis(query) {
|
||||
return request({
|
||||
url: '/kindergarten/physique/analysis',
|
||||
method: 'get',
|
||||
|
||||
BIN
src/icons/kind.jpg
Normal file
BIN
src/icons/kind.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
BIN
src/icons/pernoal.jpg
Normal file
BIN
src/icons/pernoal.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
@ -77,7 +77,6 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
$route(to, from) {
|
||||
console.log(to.path, from.path);
|
||||
if (to.path != "/index") {
|
||||
this.show = false;
|
||||
} else {
|
||||
@ -87,8 +86,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
info() {
|
||||
console.log(this.$router.path);
|
||||
console.log(this.$route.path);
|
||||
if (this.$route.path != "/index") {
|
||||
this.show = false;
|
||||
} else {
|
||||
|
||||
@ -18,7 +18,7 @@ const service = axios.create({
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BASE_API, //'http://192.168.16.64:8080',
|
||||
// 超时
|
||||
timeout: 10000
|
||||
timeout: 20000
|
||||
})
|
||||
|
||||
// request拦截器
|
||||
|
||||
@ -133,7 +133,7 @@
|
||||
import * as echarts from "echarts";
|
||||
import { tKindergartenInfo } from "@/api/system/kindergartenInfo";
|
||||
import { getRoleInfo } from "@/api/system/quality";
|
||||
import { analysis } from "@/api/system/KindergartenPhysicalTest";
|
||||
import { KindergartenPhysicalTestanalysis } from "@/api/system/KindergartenPhysicalTest";
|
||||
import Kindergarten from "../../assembly/kindergarten.vue";
|
||||
|
||||
export default {
|
||||
@ -176,7 +176,7 @@ export default {
|
||||
},
|
||||
|
||||
analysisinfo() {
|
||||
analysis(this.analysisqueryParams).then((res) => {
|
||||
KindergartenPhysicalTestanalysis(this.analysisqueryParams).then((res) => {
|
||||
if (res.data == [] || !res.data) {
|
||||
this.itemshow2 = true;
|
||||
this.itemshow = false;
|
||||
|
||||
@ -127,17 +127,19 @@
|
||||
|
||||
<el-row v-show="itemshow">
|
||||
<el-col :span="24" :offset="0">
|
||||
<div style="margin: 0 autu; font-size: 14px">
|
||||
<div style="margin: 0 auto; width: 1000px">
|
||||
<div style="font-size: 12px; width: 100%; overflow: auto">
|
||||
<div
|
||||
style="
|
||||
line-height: 60px;
|
||||
display: flex;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
justify-content: flex-start;
|
||||
color: black;
|
||||
font-weight: 550;
|
||||
"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
style="
|
||||
width: 120px;
|
||||
@ -147,6 +149,9 @@
|
||||
>
|
||||
年龄
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div
|
||||
style="
|
||||
width: 120px;
|
||||
@ -156,6 +161,8 @@
|
||||
>
|
||||
平均总分
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-for="item in categoryTableNameList" :key="item.prentId">
|
||||
<div
|
||||
style="
|
||||
@ -191,18 +198,22 @@
|
||||
style="
|
||||
text-align: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
justify-content: flex-start;
|
||||
line-height: 50px;
|
||||
"
|
||||
v-for="item in categoryScoreList"
|
||||
:key="item.prentId"
|
||||
>
|
||||
<div style="width: 120px; border: 1px solid #f0f0f0">
|
||||
<div style="border: 1px solid #f0f0f0">
|
||||
<div style="width: 120px">
|
||||
{{ item.className }}
|
||||
</div>
|
||||
<div style="width: 120px; border: 1px solid #f0f0f0">
|
||||
</div>
|
||||
<div style="border: 1px solid #f0f0f0">
|
||||
<div style="width: 120px">
|
||||
{{ item.totalAvScore }}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="display: flex; line-height: 60px">
|
||||
<div
|
||||
@ -218,6 +229,7 @@
|
||||
</div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0">
|
||||
<div style="text-align: center">
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
import * as echarts from "echarts";
|
||||
import student from "@/views/assembly/student.vue";
|
||||
import { getRoleInfo } from "@/api/system/quality";
|
||||
import { analysis } from "@/api/system/constitution";
|
||||
import { constitution } from "@/api/system/constitution";
|
||||
export default {
|
||||
name: "constitution",
|
||||
components: {
|
||||
@ -131,7 +131,6 @@ export default {
|
||||
this.analysislist.itemScoreList[i].schoolAvgScore,
|
||||
this.analysislist.itemScoreList[i].cityAvgScore,
|
||||
];
|
||||
|
||||
var textname = this.analysislist.itemScoreList[i].itemName;
|
||||
// console.log(ydata);
|
||||
var myChart = echarts.init(myEchart[i]);
|
||||
@ -224,7 +223,7 @@ export default {
|
||||
},
|
||||
//综合体质分析
|
||||
analysislists() {
|
||||
analysis(this.analysisqueryParams).then((res) => {
|
||||
constitution(this.analysisqueryParams).then((res) => {
|
||||
console.log(res);
|
||||
if (!res.data || res.data == "") {
|
||||
this.itemshow2 = true;
|
||||
|
||||
@ -144,7 +144,7 @@
|
||||
<script>
|
||||
import { tKindergartenInfo } from "@/api/system/kindergartenInfo";
|
||||
import { getRoleInfo } from "@/api/system/quality";
|
||||
import { analysis } from "@/api/system/development";
|
||||
import { developmentanalysis } from "@/api/system/development";
|
||||
import kindergarten from "../../assembly/kindergarten.vue";
|
||||
export default {
|
||||
components: { kindergarten },
|
||||
@ -191,7 +191,7 @@ export default {
|
||||
},
|
||||
//动作发展状况
|
||||
analysisinfo() {
|
||||
analysis(this.analysislist).then((res) => {
|
||||
developmentanalysis(this.analysislist).then((res) => {
|
||||
if (res.data) {
|
||||
var obj = res.data;
|
||||
this.physicalActionList = obj.physicalActionList;
|
||||
|
||||
@ -84,7 +84,7 @@
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import { getRoleInfo } from "@/api/system/quality";
|
||||
import { analysis } from "@/api/system/heightAndWeight";
|
||||
import { heightAndWeightanalysis } from "@/api/system/heightAndWeight";
|
||||
import Kindergarten from "../../assembly/kindergarten.vue";
|
||||
|
||||
export default {
|
||||
@ -124,7 +124,7 @@ export default {
|
||||
},
|
||||
|
||||
analysisinfo() {
|
||||
analysis(this.analysisqueryParams).then((res) => {
|
||||
heightAndWeightanalysis(this.analysisqueryParams).then((res) => {
|
||||
if (!res.data) {
|
||||
this.itemshow2 = true;
|
||||
this.itemshow = false;
|
||||
|
||||
@ -176,7 +176,7 @@
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="open"
|
||||
width="1200px"
|
||||
width="1600px"
|
||||
append-to-body
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
@ -186,14 +186,13 @@
|
||||
<el-radio :label="1">已审核</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="报告内容" prop="reportName">
|
||||
<iframe
|
||||
ref="pdfCotainer"
|
||||
:src="pdfurl + '#toolbar=0'"
|
||||
width="1000px"
|
||||
height="550px"
|
||||
></iframe>
|
||||
</el-form-item>
|
||||
<div style="height: 600px; overflow: auto">
|
||||
<kindergartenEcharts
|
||||
v-if="open"
|
||||
:itemlists="itemlist"
|
||||
class="personal"
|
||||
></kindergartenEcharts>
|
||||
</div>
|
||||
<!-- <el-form-item label="幼儿园名称" prop="kindergartenName">
|
||||
<el-input v-model="form.kindergartenName" />
|
||||
</el-form-item>
|
||||
@ -213,20 +212,13 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="预览"
|
||||
:visible.sync="openiframe"
|
||||
width="1050px"
|
||||
append-to-body
|
||||
>
|
||||
<div style="height: 600px">
|
||||
<iframe
|
||||
ref="pdfCotainer"
|
||||
:src="pdfurl + '#toolbar=0'"
|
||||
width="1000px"
|
||||
height="600px"
|
||||
frameborder="0"
|
||||
></iframe>
|
||||
<el-dialog :visible.sync="openiframe" width="1600px" append-to-body>
|
||||
<div style="height: 680px; overflow: auto">
|
||||
<kindergartenEcharts
|
||||
:itemlists="itemlist"
|
||||
class="personal"
|
||||
v-if="openiframe"
|
||||
></kindergartenEcharts>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="openiframe = false">关闭</el-button>
|
||||
@ -429,23 +421,25 @@
|
||||
<script>
|
||||
import {
|
||||
listKindergartenCheckReport,
|
||||
existKindergartenCheckReport,
|
||||
updateKindergartenCheckReport,
|
||||
report,
|
||||
uploadKindergartenCheckReport,
|
||||
} from "@/api/system/kindergartenCheckReport";
|
||||
import kindergarten from "../../assembly/kindergarten.vue";
|
||||
import baseurl from "@/api/baseurl.js";
|
||||
import {
|
||||
listKindergartenInfo,
|
||||
tKindergartenInfo,
|
||||
} from "@/api/system/kindergartenInfo";
|
||||
import { getRoleInfo, testScoreBatch } from "@/api/system/quality";
|
||||
|
||||
import { listKindergartenInfo } from "@/api/system/kindergartenInfo";
|
||||
import { testScoreBatch } from "@/api/system/quality";
|
||||
import kindergartenEcharts from "../kindergartenEcharts/index.vue";
|
||||
import html2canvas from "html2canvas";
|
||||
import JsPDF from "jspdf";
|
||||
export default {
|
||||
components: { kindergarten },
|
||||
components: { kindergarten, kindergartenEcharts },
|
||||
name: "KindergartenCheckReport",
|
||||
data() {
|
||||
return {
|
||||
//itemlist
|
||||
itemlist: {
|
||||
kindergartenId: "",
|
||||
batchCode: "",
|
||||
number: 1,
|
||||
},
|
||||
checkStatuslist: [
|
||||
{
|
||||
value: 0,
|
||||
@ -612,56 +606,125 @@ export default {
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 审核按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.form = JSON.parse(JSON.stringify(row));
|
||||
existKindergartenCheckReport(row.kindergartenId, row.batchCode).then(
|
||||
(response) => {
|
||||
if (response.data.existFlag) {
|
||||
handleUpdate(item) {
|
||||
this.itemlist.kindergartenId = item.kindergartenId;
|
||||
this.itemlist.batchCode = item.batchCode;
|
||||
this.itemlist.number++;
|
||||
this.loading = true;
|
||||
setTimeout(() => {
|
||||
this.form = JSON.parse(JSON.stringify(item));
|
||||
this.title = "修改幼儿园检测报告审批状态";
|
||||
this.pdfurl = baseurl + response.data.downloadAddress;
|
||||
this.open = true;
|
||||
} else {
|
||||
report(row.kindergartenId, row.batchCode).then((res) => {
|
||||
this.pdfurl = baseurl + res.data.downloadAddress;
|
||||
this.form.id = res.data.id;
|
||||
// this.pdfurl = window.URL.createObjectURL(res);
|
||||
// window.open(this.pdfurl);
|
||||
this.info();
|
||||
this.open = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
this.loading = false;
|
||||
}, 300);
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
var obj = {
|
||||
id: this.form.id,
|
||||
checkStatus: this.form.checkStatus,
|
||||
};
|
||||
updateKindergartenCheckReport(obj).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
//转pdf
|
||||
this.open = false;
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
kindergartenId: null,
|
||||
batchCode: null,
|
||||
let shareContent = document.querySelector(".personal"), //需要截图的包裹的(原生的)DOM 对象
|
||||
width = shareContent.clientWidth * 1.1, //获取dom 宽度
|
||||
height = shareContent.clientHeight * 1.1, //获取dom 高度
|
||||
canvas = document.createElement("canvas"), //创建一个canvas节点
|
||||
scale = 1.1; //定义任意放大倍数 支持小数
|
||||
// width = 2000;
|
||||
canvas.width = width * scale; //定义canvas 宽度 * 缩放
|
||||
canvas.height = height * scale; //定义canvas高度 *缩放
|
||||
canvas.style.width = shareContent.clientWidth * scale + "px";
|
||||
canvas.style.height = shareContent.clientHeight * scale + "px";
|
||||
canvas.style.backgroundColor = "#ffffff";
|
||||
canvas.getContext("2d").scale(scale, scale); //获取context,设置scale
|
||||
let opts = {
|
||||
scale: scale, // 添加的scale 参数
|
||||
canvas: canvas, //自定义 canvas
|
||||
logging: false, //日志开关,便于查看html2canvas的内部执行流程
|
||||
width: width, //dom 原始宽度
|
||||
height: height,
|
||||
useCORS: true, // 【重要】开启跨域配置
|
||||
};
|
||||
this.info();
|
||||
html2canvas(shareContent, opts).then(() => {
|
||||
var contentWidth = canvas.width;
|
||||
var contentHeight = canvas.height; //一页pdf显示html页面生成的canvas高度;
|
||||
var pageHeight = (contentWidth / 592.28) * 841.89; //未生成pdf的html页面高度
|
||||
var leftHeight = contentHeight; //页面偏移
|
||||
var position = 0; //a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高
|
||||
var imgWidth = 595.28;
|
||||
var imgHeight = (592.28 / contentWidth) * contentHeight;
|
||||
var pageData = canvas.toDataURL("image/jpeg", 1.0);
|
||||
var PDF = new JsPDF("", "pt", "a4");
|
||||
if (leftHeight < pageHeight) {
|
||||
PDF.addImage(pageData, "JPEG", 0, 0, imgWidth, imgHeight);
|
||||
console.log(PDF);
|
||||
} else {
|
||||
while (leftHeight > 0) {
|
||||
PDF.addImage(pageData, "JPEG", 0, position, imgWidth, imgHeight);
|
||||
leftHeight -= pageHeight;
|
||||
position -= 841.89;
|
||||
if (leftHeight > 0) {
|
||||
PDF.addPage();
|
||||
}
|
||||
}
|
||||
}
|
||||
// PDF.save("体质检测报告.pdf"); // 这里是导出的文件名
|
||||
console.log(this.form);
|
||||
|
||||
var basepdf = PDF.output("datauristring"); // 转base64
|
||||
// basepdf = basepdf.split("filename=generated.pdf;");
|
||||
// base64 转 二进制流(blob)
|
||||
let blob = this.dataURLtoBlob(basepdf);
|
||||
// console.log(blob, "blob");
|
||||
let formData = new FormData();
|
||||
formData.append("kindergartenFile", blob);
|
||||
formData.append("kindergartenId", this.form.kindergartenId);
|
||||
formData.append("kindergartenName", this.form.kindergartenName);
|
||||
formData.append("batchCode", this.form.batchCode);
|
||||
formData.append("checkStatus", this.form.checkStatus);
|
||||
console.log(this.form);
|
||||
uploadKindergartenCheckReport(formData).then((res) => {
|
||||
console.log(res);
|
||||
if (res.code == 200) {
|
||||
this.$message({
|
||||
message: "审核成功",
|
||||
type: "success",
|
||||
});
|
||||
this.info();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// updateKindergartenCheckReport(obj).then((response) => {
|
||||
// this.$modal.msgSuccess("修改成功");
|
||||
// this.open = false;
|
||||
// this.queryParams = {
|
||||
// pageNum: 1,
|
||||
// pageSize: 10,
|
||||
// kindergartenId: null,
|
||||
// batchCode: null,
|
||||
// };
|
||||
// this.info();
|
||||
// });
|
||||
},
|
||||
//预览
|
||||
lookhand(item) {
|
||||
report(item.kindergartenId, item.batchCode).then((res) => {
|
||||
// this.pdfurl = window.URL.createObjectURL(res);
|
||||
this.pdfurl = baseurl + res.data.downloadAddress;
|
||||
this.info();
|
||||
this.itemlist.kindergartenId = item.kindergartenId;
|
||||
this.itemlist.batchCode = item.batchCode;
|
||||
this.itemlist.number++;
|
||||
console.log(item);
|
||||
this.loading = true;
|
||||
|
||||
setTimeout(() => {
|
||||
this.openiframe = true;
|
||||
console.log(this.pdfurl);
|
||||
// window.open(this.pdfurl);
|
||||
});
|
||||
this.loading = false;
|
||||
}, 300);
|
||||
|
||||
// report(item.kindergartenId, item.batchCode).then((res) => {
|
||||
// // this.pdfurl = window.URL.createObjectURL(res);
|
||||
// this.pdfurl = baseurl + res.data.downloadAddress;
|
||||
// this.info();
|
||||
// this.openiframe = true;
|
||||
// console.log(this.pdfurl);
|
||||
// // window.open(this.pdfurl);
|
||||
// });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport(row) {
|
||||
@ -674,7 +737,7 @@ export default {
|
||||
this.download(
|
||||
`/system/kindergartenCheckReport/download?id=${row.id}`,
|
||||
{},
|
||||
`幼儿园检测报告.pdf`
|
||||
row.reportName + `.pdf`
|
||||
);
|
||||
}
|
||||
},
|
||||
@ -747,6 +810,21 @@ export default {
|
||||
};
|
||||
this.kinhandleQuery();
|
||||
},
|
||||
// /base64转二进制
|
||||
dataURLtoBlob(dataurl) {
|
||||
// console.log(dataurl);
|
||||
var arr = dataurl.split(","),
|
||||
mime = arr[0].match(/:(.*?);/)[1],
|
||||
bstr = atob(arr[1]),
|
||||
n = bstr.length,
|
||||
u8arr = new Uint8Array(n);
|
||||
while (n--) {
|
||||
u8arr[n] = bstr.charCodeAt(n);
|
||||
}
|
||||
return new Blob([u8arr], {
|
||||
type: mime,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
2342
src/views/system/kindergartenEcharts/index.vue
Normal file
2342
src/views/system/kindergartenEcharts/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -149,7 +149,6 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
@ -302,7 +301,6 @@
|
||||
@pagination="studentlist"
|
||||
/>
|
||||
</el-dialog>
|
||||
|
||||
<!-- //幼儿园 -->
|
||||
<el-dialog
|
||||
width="860px"
|
||||
@ -403,7 +401,6 @@
|
||||
@pagination="listKindergartenInfoetList"
|
||||
/>
|
||||
</el-dialog>
|
||||
|
||||
<!-- //班级 -->
|
||||
<el-dialog
|
||||
width="1050px"
|
||||
@ -513,7 +510,6 @@
|
||||
@pagination="classinfo"
|
||||
/>
|
||||
</el-dialog>
|
||||
|
||||
<!-- //批次 -->
|
||||
<el-dialog
|
||||
width="700px"
|
||||
@ -617,13 +613,18 @@
|
||||
<el-radio :label="1">已审核</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<iframe
|
||||
ref="pdfCotainer"
|
||||
:src="pdfurl + '#toolbar=0'"
|
||||
width="1150px"
|
||||
height="550px"
|
||||
></iframe>
|
||||
|
||||
</el-form>
|
||||
<div style="height: 650px; overflow: auto">
|
||||
<personalecharts
|
||||
v-if="open"
|
||||
:itemlists="itemlist"
|
||||
class="personal"
|
||||
></personalecharts>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
<!-- <el-form-item label="学生姓名" prop="studentId">
|
||||
<el-input v-model="form.studentId" placeholder="请输入学生姓名" />
|
||||
</el-form-item>
|
||||
@ -636,26 +637,20 @@
|
||||
<el-form-item label="报告名称" prop="reportName">
|
||||
<el-input v-model="form.reportName" placeholder="请输入报告名称" />
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- //预览 -->
|
||||
<el-dialog
|
||||
title="预览"
|
||||
:visible.sync="openiframe"
|
||||
width="1050px"
|
||||
width="1200px"
|
||||
style="height: 95%"
|
||||
append-to-body
|
||||
:visible.sync="openiframe"
|
||||
>
|
||||
<div>
|
||||
<iframe
|
||||
ref="pdfCotainer"
|
||||
:src="pdfurl + '#toolbar=0'"
|
||||
width="1000px"
|
||||
height="600px"
|
||||
></iframe>
|
||||
<div style="height: 700px; overflow: auto">
|
||||
<personalecharts
|
||||
v-if="openiframe"
|
||||
:itemlists="itemlist"
|
||||
class="personal"
|
||||
></personalecharts>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="openiframe = false">关闭</el-button>
|
||||
@ -671,23 +666,19 @@ import {
|
||||
} from "@/api/system/kindergartenInfo";
|
||||
import { listStudentInfo } from "@/api/system/studentInfo";
|
||||
import { listClassinfo } from "@/api/system/classinfo";
|
||||
import { getRoleInfo, testScoreBatch } from "@/api/system/quality";
|
||||
import { testScoreBatch } from "@/api/system/quality";
|
||||
import {
|
||||
listPersonalCheckReport,
|
||||
updatePersonalCheckReport,
|
||||
checkReportreport,
|
||||
existCheckReport,
|
||||
uploadPersonalCheckReport,
|
||||
} from "@/api/system/personalCheckReport";
|
||||
import student from "../../assembly/student.vue";
|
||||
import baseurl from "@/api/baseurl.js";
|
||||
|
||||
import personalecharts from "../personalecharts/index.vue";
|
||||
import html2canvas from "html2canvas";
|
||||
import JsPDF from "jspdf";
|
||||
export default {
|
||||
components: { student },
|
||||
components: { personalecharts },
|
||||
name: "PersonalCheckReport",
|
||||
data() {
|
||||
return {
|
||||
itemshow: false,
|
||||
itemshow2: false,
|
||||
total1: 0,
|
||||
total2: 0,
|
||||
total3: 0,
|
||||
@ -823,6 +814,13 @@ export default {
|
||||
name: "已审核",
|
||||
},
|
||||
],
|
||||
itemlist: {
|
||||
pageNum: 1,
|
||||
pageSize: 999,
|
||||
studentId: "",
|
||||
batchCode: "",
|
||||
number: 1,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -830,6 +828,26 @@ export default {
|
||||
this.listKindergartenInfoetList();
|
||||
},
|
||||
methods: {
|
||||
//预览
|
||||
lookhand(item) {
|
||||
this.itemlist.studentId = item.studentId;
|
||||
this.itemlist.batchCode = item.batchCode;
|
||||
this.itemlist.number++;
|
||||
this.loading = true;
|
||||
setTimeout(() => {
|
||||
this.form = JSON.parse(JSON.stringify(item));
|
||||
this.openiframe = true;
|
||||
this.loading = false;
|
||||
}, 300);
|
||||
|
||||
// checkReportreport(item.studentId, item.batchCode).then((res) => {
|
||||
// // this.pdfurl = window.URL.createObjectURL(res);
|
||||
// this.pdfurl = baseurl + res.data.downloadAddress;
|
||||
// this.getList();
|
||||
// this.openiframe = true;
|
||||
// // window.open(this.pdfurl);
|
||||
// });
|
||||
},
|
||||
/** 查询个人体质检测报告列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
@ -875,30 +893,39 @@ export default {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
/** 审核按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
this.itemlist.studentId = row.studentId;
|
||||
this.itemlist.batchCode = row.batchCode;
|
||||
this.itemlist.number++;
|
||||
this.loading = true;
|
||||
setTimeout(() => {
|
||||
this.form = JSON.parse(JSON.stringify(row));
|
||||
console.log(this.form);
|
||||
// this.form = row;
|
||||
this.title = "修改个人体质检测报告";
|
||||
existCheckReport(row.studentId, row.batchCode).then((res) => {
|
||||
if (res.data.existFlag) {
|
||||
this.pdfurl = baseurl + res.data.downloadAddress;
|
||||
this.title = "审核个人体质检测报告";
|
||||
this.open = true;
|
||||
} else {
|
||||
checkReportreport(row.studentId, row.batchCode).then((res) => {
|
||||
// this.pdfurl = window.URL.createObjectURL(res);
|
||||
this.pdfurl = baseurl + res.data.downloadAddress;
|
||||
this.form.id = res.data.id;
|
||||
this.getList();
|
||||
this.open = true;
|
||||
// window.open(this.pdfurl);
|
||||
});
|
||||
}
|
||||
});
|
||||
console.log(this.form);
|
||||
this.loading = false;
|
||||
}, 300);
|
||||
// existCheckReport(row.studentId, row.batchCode).then((res) => {
|
||||
// if (res.code == 200) {
|
||||
// if (res.data.existFlag) {
|
||||
// this.loading = false;
|
||||
// this.open = true;
|
||||
// } else {
|
||||
// checkReportreport(row.studentId, row.batchCode).then((res) => {
|
||||
// // this.pdfurl = window.URL.createObjectURL(res);
|
||||
// this.form.id = res.data.id;
|
||||
// this.getList();
|
||||
// this.loading = false;
|
||||
// this.open = true;
|
||||
// // window.open(this.pdfurl);
|
||||
// });
|
||||
// }
|
||||
// } else if (res.code == 500) {
|
||||
// this.loading = false;
|
||||
// this.$message.error("获取审核信息失败");
|
||||
// }
|
||||
// });
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
@ -930,33 +957,100 @@ export default {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
var obj = {
|
||||
id: this.form.id,
|
||||
checkStatus: this.form.checkStatus,
|
||||
};
|
||||
updatePersonalCheckReport(obj).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
studentId: null,
|
||||
batchCode: null,
|
||||
};
|
||||
this.getList();
|
||||
this.open = false;
|
||||
// /base64转二进制
|
||||
dataURLtoBlob(dataurl) {
|
||||
console.log(dataurl);
|
||||
var arr = dataurl.split(","),
|
||||
mime = arr[0].match(/:(.*?);/)[1],
|
||||
bstr = atob(arr[1]),
|
||||
n = bstr.length,
|
||||
u8arr = new Uint8Array(n);
|
||||
while (n--) {
|
||||
u8arr[n] = bstr.charCodeAt(n);
|
||||
}
|
||||
return new Blob([u8arr], {
|
||||
type: mime,
|
||||
});
|
||||
},
|
||||
//预览
|
||||
lookhand(item) {
|
||||
console.log(item);
|
||||
checkReportreport(item.studentId, item.batchCode).then((res) => {
|
||||
// this.pdfurl = window.URL.createObjectURL(res);
|
||||
this.pdfurl = baseurl + res.data.downloadAddress;
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
// updatePersonalCheckReport(obj).then((res) => {
|
||||
// if (res.code == 200) {
|
||||
// this.$modal.msgSuccess("修改成功");
|
||||
// this.queryParams = {
|
||||
// pageNum: 1,
|
||||
// pageSize: 10,
|
||||
// studentId: null,
|
||||
// batchCode: null,
|
||||
// };
|
||||
// this.getList();
|
||||
// this.open = false;
|
||||
// } else {
|
||||
// this.$modal.msgSuccess("修改失败");
|
||||
// }
|
||||
// });
|
||||
//转pdf
|
||||
this.open = false;
|
||||
let shareContent = document.querySelector(".personal"), //需要截图的包裹的(原生的)DOM 对象
|
||||
width = shareContent.clientWidth * 1.1, //获取dom 宽度
|
||||
height = shareContent.clientHeight * 1.1, //获取dom 高度
|
||||
canvas = document.createElement("canvas"), //创建一个canvas节点
|
||||
scale = 1.1; //定义任意放大倍数 支持小数
|
||||
// width = 2000;
|
||||
canvas.width = width * scale; //定义canvas 宽度 * 缩放
|
||||
canvas.height = height * scale; //定义canvas高度 *缩放
|
||||
canvas.style.width = shareContent.clientWidth * scale + "px";
|
||||
canvas.style.height = shareContent.clientHeight * scale + "px";
|
||||
canvas.style.backgroundColor = "#ffffff";
|
||||
canvas.getContext("2d").scale(scale, scale); //获取context,设置scale
|
||||
let opts = {
|
||||
scale: scale, // 添加的scale 参数
|
||||
canvas: canvas, //自定义 canvas
|
||||
logging: false, //日志开关,便于查看html2canvas的内部执行流程
|
||||
width: width, //dom 原始宽度
|
||||
height: height,
|
||||
useCORS: true, // 【重要】开启跨域配置
|
||||
};
|
||||
html2canvas(shareContent, opts).then(() => {
|
||||
var contentWidth = canvas.width;
|
||||
var contentHeight = canvas.height; //一页pdf显示html页面生成的canvas高度;
|
||||
var pageHeight = (contentWidth / 592.28) * 841.89; //未生成pdf的html页面高度
|
||||
var leftHeight = contentHeight; //页面偏移
|
||||
var position = 0; //a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高
|
||||
var imgWidth = 595.28;
|
||||
var imgHeight = (592.28 / contentWidth) * contentHeight;
|
||||
var pageData = canvas.toDataURL("image/jpeg", 1.0);
|
||||
var PDF = new JsPDF("", "pt", "a4");
|
||||
if (leftHeight < pageHeight) {
|
||||
PDF.addImage(pageData, "JPEG", 0, 0, imgWidth, imgHeight);
|
||||
console.log(PDF);
|
||||
} else {
|
||||
while (leftHeight > 0) {
|
||||
PDF.addImage(pageData, "JPEG", 0, position, imgWidth, imgHeight);
|
||||
leftHeight -= pageHeight;
|
||||
position -= 841.89;
|
||||
if (leftHeight > 0) {
|
||||
PDF.addPage();
|
||||
}
|
||||
}
|
||||
}
|
||||
var basepdf = PDF.output("datauristring"); // 转base64
|
||||
// basepdf = basepdf.split("filename=generated.pdf;");
|
||||
// base64 转 二进制流(blob)
|
||||
let blob = this.dataURLtoBlob(basepdf);
|
||||
console.log(blob, "blob");
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append("personalFile", blob);
|
||||
formData.append("studentId", this.form.studentId);
|
||||
formData.append("studentName", this.form.studentName);
|
||||
formData.append("batchCode", this.form.batchCode);
|
||||
formData.append("checkStatus", this.form.checkStatus);
|
||||
uploadPersonalCheckReport(formData).then((res) => {
|
||||
console.log(res);
|
||||
this.getList();
|
||||
this.openiframe = true;
|
||||
// window.open(this.pdfurl);
|
||||
});
|
||||
// PDF.save("幼儿体质检测报告.pdf"); // 这里是导出的文件名
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
@ -967,11 +1061,11 @@ export default {
|
||||
this.download(
|
||||
`/system/personalCheckReport/download?id=${row.id}`,
|
||||
{},
|
||||
`个人体质检测报告.pdf`
|
||||
row.reportName + `.pdf`
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
// },
|
||||
//班级
|
||||
classresetQuery() {
|
||||
this.classqueryParams.className = "";
|
||||
@ -1173,4 +1267,7 @@ export default {
|
||||
::v-deep .el-form {
|
||||
display: inline;
|
||||
}
|
||||
.personal {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
1709
src/views/system/personalecharts/index.vue
Normal file
1709
src/views/system/personalecharts/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -114,7 +114,10 @@
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0">
|
||||
<div style="margin: 0 auto">
|
||||
<div style="margin: 0 auto; width: 100%; line-height: 60px">
|
||||
<div
|
||||
style="font-size: 12px; width: 100%; overflow: auto; height: 400px"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
display: flex;
|
||||
@ -123,27 +126,14 @@
|
||||
color: black;
|
||||
"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
width: 120px;
|
||||
line-height: 60px;
|
||||
border: 1px solid #f0f0f0;
|
||||
background: #f5f7fa;
|
||||
"
|
||||
>
|
||||
年龄
|
||||
<div style="border: 0.5px solid #f0f0f0; background: #f5f7fa">
|
||||
<div style="width: 90px; line-height: 58px">年龄</div>
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
width: 120px;
|
||||
line-height: 60px;
|
||||
border: 1px solid #f0f0f0;
|
||||
background: #f5f7fa;
|
||||
color: black;
|
||||
"
|
||||
>
|
||||
平均总分
|
||||
|
||||
<div style="border: 0.5px solid #f0f0f0; background: #f5f7fa">
|
||||
<div style="width: 90px; line-height: 58px">平均总分</div>
|
||||
</div>
|
||||
|
||||
<div v-for="item in categoryTableNameList" :key="item.prentId">
|
||||
<div
|
||||
style="
|
||||
@ -159,7 +149,7 @@
|
||||
<div
|
||||
style="
|
||||
display: flex;
|
||||
line-height: 30px;
|
||||
line-height: 32px;
|
||||
border: 1px solid #f0f0f0;
|
||||
background: #f5f7fa;
|
||||
color: black;
|
||||
@ -168,7 +158,7 @@
|
||||
<div
|
||||
v-for="uitem in item.childrenTableNameList"
|
||||
:key="uitem.categoryId"
|
||||
style="width: 120px"
|
||||
style="width: 90px"
|
||||
>
|
||||
{{ uitem.categoryName }}
|
||||
</div>
|
||||
@ -186,39 +176,38 @@
|
||||
v-for="item in categoryAgeFractionList"
|
||||
:key="item.prentId"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
width: 120px;
|
||||
line-height: 50px;
|
||||
border: 1px solid #f0f0f0;
|
||||
"
|
||||
>
|
||||
<div style="border: 1px solid #f0f0f0">
|
||||
<div style="width: 90px; line-height: 50px">
|
||||
{{ item.studentAge }}
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
width: 120px;
|
||||
line-height: 50px;
|
||||
border: 1px solid #f0f0f0;
|
||||
"
|
||||
>
|
||||
</div>
|
||||
<div style="border: 1px solid #f0f0f0">
|
||||
<div style="width: 90px; line-height: 50px; height: 50px">
|
||||
{{ item.totalAvgFraction }}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="display: flex; line-height: 50px">
|
||||
<div
|
||||
v-for="uitem in item.list"
|
||||
:key="uitem.categoryId"
|
||||
style="width: 120px; border: 0.5px solid #f0f0f0"
|
||||
style="
|
||||
width: 90px;
|
||||
border: 0.5px solid #f0f0f0;
|
||||
line-height: 52px;
|
||||
height: 52px;
|
||||
"
|
||||
>
|
||||
{{ uitem }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@ -239,7 +228,7 @@
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import { getRoleInfo } from "@/api/system/quality";
|
||||
import { analysis } from "@/api/system/physique";
|
||||
import { physiqueanalysis } from "@/api/system/physique";
|
||||
import Kindergarten from "../../assembly/kindergarten.vue";
|
||||
|
||||
export default {
|
||||
@ -296,7 +285,7 @@ export default {
|
||||
},
|
||||
|
||||
analysisinfo() {
|
||||
analysis(this.analysisqueryParams).then((res) => {
|
||||
physiqueanalysis(this.analysisqueryParams).then((res) => {
|
||||
if (res.data == [] || !res.data) {
|
||||
this.itemshow2 = true;
|
||||
this.itemshow = false;
|
||||
|
||||
@ -124,6 +124,7 @@ export default {
|
||||
this.$refs.cropper.getCropBlob(data => {
|
||||
let formData = new FormData();
|
||||
formData.append("avatarfile", data);
|
||||
console.log(data)
|
||||
uploadAvatar(formData).then(response => {
|
||||
this.open = false;
|
||||
this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user