This commit is contained in:
曹辉 2022-10-20 15:36:56 +08:00
parent aac2245214
commit ba2b5e8722
23 changed files with 4593 additions and 346 deletions

View File

@ -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",

View File

@ -1,10 +1,10 @@
import request from '@/utils/request'
// 查询
export function analysis(query) {
export function KindergartenPhysicalTestanalysis(query) {
return request({
url: '/kindergarten/side/analysis',
method: 'get',
params: query
})
}
}

View File

@ -1,10 +1,10 @@
import request from '@/utils/request'
// 查询
export function analysis(query) {
export function constitution(query) {
return request({
url: '/children/ranking/analysis',
method: 'get',
params: query
})
}
}

View File

@ -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',

View File

@ -1,10 +1,10 @@
import request from '@/utils/request'
// 查询
export function analysis(query) {
export function heightAndWeightanalysis(query) {
return request({
url: '/average/heightAndWeight/analysis',
method: 'get',
params: query
})
}
}

View File

@ -35,4 +35,14 @@ export function report(kindergartenId, batchCode) {
url: `/system/checkReport/kindergarten/constitution?kindergartenId=${kindergartenId}&batchCode=${batchCode}`,
method: 'POST'
})
}
// 幼儿园报告上传接口
export function uploadKindergartenCheckReport(data) {
return request({
url: `/system/kindergartenCheckReport/uploadKindergartenCheckReport`,
method: 'POST',
data
})
}

View File

@ -52,4 +52,15 @@ export function report(id) {
method: 'POST',
responseType: 'blob'
})
}
// 幼儿个人报告上传接口
export function uploadPersonalCheckReport(data) {
return request({
url: `/system/personalCheckReport/uploadPersonalCheckReport `,
method: 'POST',
data
})
}

View File

@ -1,10 +1,10 @@
import request from '@/utils/request'
// 查询
export function analysis(query) {
export function physiqueanalysis(query) {
return request({
url: '/kindergarten/physique/analysis',
method: 'get',
params: query
})
}
}

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -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 {

View File

@ -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拦截器

View File

@ -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;

View File

@ -127,96 +127,108 @@
<el-row v-show="itemshow">
<el-col :span="24" :offset="0">
<div style="margin: 0 autu; font-size: 14px">
<div
style="
line-height: 60px;
display: flex;
text-align: center;
justify-content: center;
color: black;
font-weight: 550;
"
>
<div style="margin: 0 auto; width: 1000px">
<div style="font-size: 12px; width: 100%; overflow: auto">
<div
style="
width: 120px;
border: 1px solid #f0f0f0;
background: #f5f7fa;
line-height: 60px;
display: flex;
text-align: center;
justify-content: flex-start;
color: black;
font-weight: 550;
"
>
年龄
</div>
<div
style="
width: 120px;
border: 1px solid #f0f0f0;
background: #f5f7fa;
"
>
平均总分
</div>
<div v-for="item in categoryTableNameList" :key="item.prentId">
<div
style="
text-align: center;
line-height: 30px;
border: 1px solid #f0f0f0;
background: #f5f7fa;
"
>
{{ item.parentName }}
</div>
<div
style="
display: flex;
line-height: 30px;
border: 1px solid #f0f0f0;
background: #f5f7fa;
font-size: 12px;
"
>
<div>
<div
v-for="uitem in item.childrenTableNameList"
:key="uitem.categoryId"
style="width: 120px"
style="
width: 120px;
border: 1px solid #f0f0f0;
background: #f5f7fa;
"
>
{{ uitem.categoryName }}
年龄
</div>
</div>
</div>
</div>
<div style="font-size: 14px">
<div
style="
text-align: center;
display: flex;
justify-content: center;
line-height: 50px;
"
v-for="item in categoryScoreList"
:key="item.prentId"
>
<div style="width: 120px; border: 1px solid #f0f0f0">
{{ item.className }}
</div>
<div style="width: 120px; border: 1px solid #f0f0f0">
{{ item.totalAvScore }}
</div>
<div>
<div style="display: flex; line-height: 60px">
<div
style="
width: 120px;
border: 1px solid #f0f0f0;
background: #f5f7fa;
"
>
平均总分
</div>
</div>
<div v-for="item in categoryTableNameList" :key="item.prentId">
<div
style="
text-align: center;
line-height: 30px;
border: 1px solid #f0f0f0;
background: #f5f7fa;
"
>
{{ item.parentName }}
</div>
<div
style="
display: flex;
line-height: 30px;
border: 1px solid #f0f0f0;
background: #f5f7fa;
font-size: 12px;
"
>
<div
v-for="uitem in item.list"
v-for="uitem in item.childrenTableNameList"
:key="uitem.categoryId"
style="width: 120px; border: 0.5px solid #f0f0f0"
style="width: 120px"
>
{{ uitem }}
{{ uitem.categoryName }}
</div>
</div>
</div>
</div>
<div style="font-size: 14px">
<div
style="
text-align: center;
display: flex;
justify-content: flex-start;
line-height: 50px;
"
v-for="item in categoryScoreList"
:key="item.prentId"
>
<div style="border: 1px solid #f0f0f0">
<div style="width: 120px">
{{ item.className }}
</div>
</div>
<div style="border: 1px solid #f0f0f0">
<div style="width: 120px">
{{ item.totalAvScore }}
</div>
</div>
<div>
<div style="display: flex; line-height: 60px">
<div
v-for="uitem in item.list"
:key="uitem.categoryId"
style="width: 120px; border: 0.5px solid #f0f0f0"
>
{{ uitem }}
</div>
</div>
</div>
</div>
</div>
<div></div>
</div>
<div></div>
</div>
</el-col>
<el-col :span="24" :offset="0">

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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) {
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;
});
}
}
);
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.open = true;
this.loading = false;
}, 300);
},
/** 提交按钮 */
submitForm() {
var obj = {
id: this.form.id,
checkStatus: this.form.checkStatus,
//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, //
};
updateKindergartenCheckReport(obj).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.queryParams = {
pageNum: 1,
pageSize: 10,
kindergartenId: null,
batchCode: null,
};
this.info();
html2canvas(shareContent, opts).then(() => {
var contentWidth = canvas.width;
var contentHeight = canvas.height; //pdfhtmlcanvas;
var pageHeight = (contentWidth / 592.28) * 841.89; //pdfhtml
var leftHeight = contentHeight; //
var position = 0; //a4[595.28,841.89]htmlcanvaspdf
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>

File diff suppressed because it is too large Load Diff

View File

@ -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,14 +613,19 @@
<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-item label="学生姓名" prop="studentId">
</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>
<el-form-item label="批次编号" prop="batchCode">
@ -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.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.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.itemlist.studentId = row.studentId;
this.itemlist.batchCode = row.batchCode;
this.itemlist.number++;
this.loading = true;
setTimeout(() => {
this.form = JSON.parse(JSON.stringify(row));
// this.form = row;
this.title = "审核个人体质检测报告";
this.open = true;
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;
this.getList();
this.openiframe = true;
// window.open(this.pdfurl);
/** 提交按钮 */
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; //pdfhtmlcanvas;
var pageHeight = (contentWidth / 592.28) * 841.89; //pdfhtml
var leftHeight = contentHeight; //
var position = 0; //a4[595.28,841.89]htmlcanvaspdf
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();
});
// 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>

File diff suppressed because it is too large Load Diff

View File

@ -114,110 +114,99 @@
</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="
display: flex;
text-align: center;
justify-content: center;
color: black;
"
style="font-size: 12px; width: 100%; overflow: auto; height: 400px"
>
<div
style="
width: 120px;
line-height: 60px;
border: 1px solid #f0f0f0;
background: #f5f7fa;
"
>
年龄
</div>
<div
style="
width: 120px;
line-height: 60px;
border: 1px solid #f0f0f0;
background: #f5f7fa;
display: flex;
text-align: center;
justify-content: center;
color: black;
"
>
平均总分
</div>
<div v-for="item in categoryTableNameList" :key="item.prentId">
<div
style="
text-align: center;
line-height: 30px;
border: 1px solid #f0f0f0;
background: #f5f7fa;
color: black;
"
>
{{ item.parentName }}
<div style="border: 0.5px solid #f0f0f0; background: #f5f7fa">
<div style="width: 90px; line-height: 58px">年龄</div>
</div>
<div
style="
display: flex;
line-height: 30px;
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
v-for="uitem in item.childrenTableNameList"
:key="uitem.categoryId"
style="width: 120px"
style="
text-align: center;
line-height: 30px;
border: 1px solid #f0f0f0;
background: #f5f7fa;
color: black;
"
>
{{ uitem.categoryName }}
{{ item.parentName }}
</div>
</div>
</div>
</div>
<div>
<div
style="
text-align: center;
display: flex;
justify-content: center;
font-size: 14px;
"
v-for="item in categoryAgeFractionList"
:key="item.prentId"
>
<div
style="
width: 120px;
line-height: 50px;
border: 1px solid #f0f0f0;
"
>
{{ item.studentAge }}
</div>
<div
style="
width: 120px;
line-height: 50px;
border: 1px solid #f0f0f0;
"
>
{{ item.totalAvgFraction }}
</div>
<div>
<div style="display: flex; line-height: 50px">
<div
style="
display: flex;
line-height: 32px;
border: 1px solid #f0f0f0;
background: #f5f7fa;
color: black;
"
>
<div
v-for="uitem in item.list"
v-for="uitem in item.childrenTableNameList"
:key="uitem.categoryId"
style="width: 120px; border: 0.5px solid #f0f0f0"
style="width: 90px"
>
{{ uitem }}
{{ uitem.categoryName }}
</div>
</div>
</div>
</div>
<div>
<div
style="
text-align: center;
display: flex;
justify-content: center;
font-size: 14px;
"
v-for="item in categoryAgeFractionList"
:key="item.prentId"
>
<div style="border: 1px solid #f0f0f0">
<div style="width: 90px; line-height: 50px">
{{ item.studentAge }}
</div>
</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: 90px;
border: 0.5px solid #f0f0f0;
line-height: 52px;
height: 52px;
"
>
{{ uitem }}
</div>
</div>
</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;

View File

@ -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;