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", "file-saver": "2.0.5",
"fuse.js": "6.4.3", "fuse.js": "6.4.3",
"highlight.js": "9.18.5", "highlight.js": "9.18.5",
"html2canvas": "^1.4.1",
"js-beautify": "1.13.0", "js-beautify": "1.13.0",
"js-cookie": "3.0.1", "js-cookie": "3.0.1",
"jsencrypt": "3.0.0-rc.1", "jsencrypt": "3.0.0-rc.1",
"jspdf": "^2.5.1",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"quill": "1.3.7", "quill": "1.3.7",
"screenfull": "5.0.2", "screenfull": "5.0.2",

View File

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

View File

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

View File

@ -1,7 +1,7 @@
import request from '@/utils/request' import request from '@/utils/request'
// 查询 // 查询
export function analysis(query) { export function developmentanalysis(query) {
return request({ return request({
url: '/physical/action/analysis', url: '/physical/action/analysis',
method: 'get', method: 'get',

View File

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

View File

@ -35,4 +35,14 @@ export function report(kindergartenId, batchCode) {
url: `/system/checkReport/kindergarten/constitution?kindergartenId=${kindergartenId}&batchCode=${batchCode}`, url: `/system/checkReport/kindergarten/constitution?kindergartenId=${kindergartenId}&batchCode=${batchCode}`,
method: 'POST' 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', method: 'POST',
responseType: 'blob' 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' import request from '@/utils/request'
// 查询 // 查询
export function analysis(query) { export function physiqueanalysis(query) {
return request({ return request({
url: '/kindergarten/physique/analysis', url: '/kindergarten/physique/analysis',
method: 'get', method: 'get',
params: query 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: { watch: {
$route(to, from) { $route(to, from) {
console.log(to.path, from.path);
if (to.path != "/index") { if (to.path != "/index") {
this.show = false; this.show = false;
} else { } else {
@ -87,8 +86,6 @@ export default {
}, },
methods: { methods: {
info() { info() {
console.log(this.$router.path);
console.log(this.$route.path);
if (this.$route.path != "/index") { if (this.$route.path != "/index") {
this.show = false; this.show = false;
} else { } else {

View File

@ -18,7 +18,7 @@ const service = axios.create({
// axios中请求配置有baseURL选项表示请求URL公共部分 // axios中请求配置有baseURL选项表示请求URL公共部分
baseURL: process.env.VUE_APP_BASE_API, //'http://192.168.16.64:8080', baseURL: process.env.VUE_APP_BASE_API, //'http://192.168.16.64:8080',
// 超时 // 超时
timeout: 10000 timeout: 20000
}) })
// request拦截器 // request拦截器

View File

@ -133,7 +133,7 @@
import * as echarts from "echarts"; import * as echarts from "echarts";
import { tKindergartenInfo } from "@/api/system/kindergartenInfo"; import { tKindergartenInfo } from "@/api/system/kindergartenInfo";
import { getRoleInfo } from "@/api/system/quality"; import { getRoleInfo } from "@/api/system/quality";
import { analysis } from "@/api/system/KindergartenPhysicalTest"; import { KindergartenPhysicalTestanalysis } from "@/api/system/KindergartenPhysicalTest";
import Kindergarten from "../../assembly/kindergarten.vue"; import Kindergarten from "../../assembly/kindergarten.vue";
export default { export default {
@ -176,7 +176,7 @@ export default {
}, },
analysisinfo() { analysisinfo() {
analysis(this.analysisqueryParams).then((res) => { KindergartenPhysicalTestanalysis(this.analysisqueryParams).then((res) => {
if (res.data == [] || !res.data) { if (res.data == [] || !res.data) {
this.itemshow2 = true; this.itemshow2 = true;
this.itemshow = false; this.itemshow = false;

View File

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

View File

@ -89,7 +89,7 @@
import * as echarts from "echarts"; import * as echarts from "echarts";
import student from "@/views/assembly/student.vue"; import student from "@/views/assembly/student.vue";
import { getRoleInfo } from "@/api/system/quality"; import { getRoleInfo } from "@/api/system/quality";
import { analysis } from "@/api/system/constitution"; import { constitution } from "@/api/system/constitution";
export default { export default {
name: "constitution", name: "constitution",
components: { components: {
@ -131,7 +131,6 @@ export default {
this.analysislist.itemScoreList[i].schoolAvgScore, this.analysislist.itemScoreList[i].schoolAvgScore,
this.analysislist.itemScoreList[i].cityAvgScore, this.analysislist.itemScoreList[i].cityAvgScore,
]; ];
var textname = this.analysislist.itemScoreList[i].itemName; var textname = this.analysislist.itemScoreList[i].itemName;
// console.log(ydata); // console.log(ydata);
var myChart = echarts.init(myEchart[i]); var myChart = echarts.init(myEchart[i]);
@ -224,7 +223,7 @@ export default {
}, },
// //
analysislists() { analysislists() {
analysis(this.analysisqueryParams).then((res) => { constitution(this.analysisqueryParams).then((res) => {
console.log(res); console.log(res);
if (!res.data || res.data == "") { if (!res.data || res.data == "") {
this.itemshow2 = true; this.itemshow2 = true;

View File

@ -144,7 +144,7 @@
<script> <script>
import { tKindergartenInfo } from "@/api/system/kindergartenInfo"; import { tKindergartenInfo } from "@/api/system/kindergartenInfo";
import { getRoleInfo } from "@/api/system/quality"; import { getRoleInfo } from "@/api/system/quality";
import { analysis } from "@/api/system/development"; import { developmentanalysis } from "@/api/system/development";
import kindergarten from "../../assembly/kindergarten.vue"; import kindergarten from "../../assembly/kindergarten.vue";
export default { export default {
components: { kindergarten }, components: { kindergarten },
@ -191,7 +191,7 @@ export default {
}, },
// //
analysisinfo() { analysisinfo() {
analysis(this.analysislist).then((res) => { developmentanalysis(this.analysislist).then((res) => {
if (res.data) { if (res.data) {
var obj = res.data; var obj = res.data;
this.physicalActionList = obj.physicalActionList; this.physicalActionList = obj.physicalActionList;

View File

@ -84,7 +84,7 @@
<script> <script>
import * as echarts from "echarts"; import * as echarts from "echarts";
import { getRoleInfo } from "@/api/system/quality"; import { getRoleInfo } from "@/api/system/quality";
import { analysis } from "@/api/system/heightAndWeight"; import { heightAndWeightanalysis } from "@/api/system/heightAndWeight";
import Kindergarten from "../../assembly/kindergarten.vue"; import Kindergarten from "../../assembly/kindergarten.vue";
export default { export default {
@ -124,7 +124,7 @@ export default {
}, },
analysisinfo() { analysisinfo() {
analysis(this.analysisqueryParams).then((res) => { heightAndWeightanalysis(this.analysisqueryParams).then((res) => {
if (!res.data) { if (!res.data) {
this.itemshow2 = true; this.itemshow2 = true;
this.itemshow = false; this.itemshow = false;

View File

@ -176,7 +176,7 @@
<el-dialog <el-dialog
:title="title" :title="title"
:visible.sync="open" :visible.sync="open"
width="1200px" width="1600px"
append-to-body append-to-body
> >
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
@ -186,14 +186,13 @@
<el-radio :label="1">已审核</el-radio> <el-radio :label="1">已审核</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="报告内容" prop="reportName"> <div style="height: 600px; overflow: auto">
<iframe <kindergartenEcharts
ref="pdfCotainer" v-if="open"
:src="pdfurl + '#toolbar=0'" :itemlists="itemlist"
width="1000px" class="personal"
height="550px" ></kindergartenEcharts>
></iframe> </div>
</el-form-item>
<!-- <el-form-item label="幼儿园名称" prop="kindergartenName"> <!-- <el-form-item label="幼儿园名称" prop="kindergartenName">
<el-input v-model="form.kindergartenName" /> <el-input v-model="form.kindergartenName" />
</el-form-item> </el-form-item>
@ -213,20 +212,13 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog :visible.sync="openiframe" width="1600px" append-to-body>
title="预览" <div style="height: 680px; overflow: auto">
:visible.sync="openiframe" <kindergartenEcharts
width="1050px" :itemlists="itemlist"
append-to-body class="personal"
> v-if="openiframe"
<div style="height: 600px"> ></kindergartenEcharts>
<iframe
ref="pdfCotainer"
:src="pdfurl + '#toolbar=0'"
width="1000px"
height="600px"
frameborder="0"
></iframe>
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="openiframe = false">关闭</el-button> <el-button type="primary" @click="openiframe = false">关闭</el-button>
@ -429,23 +421,25 @@
<script> <script>
import { import {
listKindergartenCheckReport, listKindergartenCheckReport,
existKindergartenCheckReport, uploadKindergartenCheckReport,
updateKindergartenCheckReport,
report,
} from "@/api/system/kindergartenCheckReport"; } from "@/api/system/kindergartenCheckReport";
import kindergarten from "../../assembly/kindergarten.vue"; import kindergarten from "../../assembly/kindergarten.vue";
import baseurl from "@/api/baseurl.js"; import { listKindergartenInfo } from "@/api/system/kindergartenInfo";
import { import { testScoreBatch } from "@/api/system/quality";
listKindergartenInfo, import kindergartenEcharts from "../kindergartenEcharts/index.vue";
tKindergartenInfo, import html2canvas from "html2canvas";
} from "@/api/system/kindergartenInfo"; import JsPDF from "jspdf";
import { getRoleInfo, testScoreBatch } from "@/api/system/quality";
export default { export default {
components: { kindergarten }, components: { kindergarten, kindergartenEcharts },
name: "KindergartenCheckReport", name: "KindergartenCheckReport",
data() { data() {
return { return {
//itemlist
itemlist: {
kindergartenId: "",
batchCode: "",
number: 1,
},
checkStatuslist: [ checkStatuslist: [
{ {
value: 0, value: 0,
@ -612,56 +606,125 @@ export default {
this.handleQuery(); this.handleQuery();
}, },
/** 审核按钮操作 */ /** 审核按钮操作 */
handleUpdate(row) { handleUpdate(item) {
this.reset(); this.itemlist.kindergartenId = item.kindergartenId;
this.form = JSON.parse(JSON.stringify(row)); this.itemlist.batchCode = item.batchCode;
existKindergartenCheckReport(row.kindergartenId, row.batchCode).then( this.itemlist.number++;
(response) => { this.loading = true;
if (response.data.existFlag) { setTimeout(() => {
this.title = "修改幼儿园检测报告审批状态"; this.form = JSON.parse(JSON.stringify(item));
this.pdfurl = baseurl + response.data.downloadAddress; this.title = "修改幼儿园检测报告审批状态";
this.open = true; this.open = true;
} else { this.loading = false;
report(row.kindergartenId, row.batchCode).then((res) => { }, 300);
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;
});
}
}
);
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
var obj = { //pdf
id: this.form.id, this.open = false;
checkStatus: this.form.checkStatus, 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) => { html2canvas(shareContent, opts).then(() => {
this.$modal.msgSuccess("修改成功"); var contentWidth = canvas.width;
this.open = false; var contentHeight = canvas.height; //pdfhtmlcanvas;
this.queryParams = { var pageHeight = (contentWidth / 592.28) * 841.89; //pdfhtml
pageNum: 1, var leftHeight = contentHeight; //
pageSize: 10, var position = 0; //a4[595.28,841.89]htmlcanvaspdf
kindergartenId: null, var imgWidth = 595.28;
batchCode: null, var imgHeight = (592.28 / contentWidth) * contentHeight;
}; var pageData = canvas.toDataURL("image/jpeg", 1.0);
this.info(); 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) { lookhand(item) {
report(item.kindergartenId, item.batchCode).then((res) => { this.itemlist.kindergartenId = item.kindergartenId;
// this.pdfurl = window.URL.createObjectURL(res); this.itemlist.batchCode = item.batchCode;
this.pdfurl = baseurl + res.data.downloadAddress; this.itemlist.number++;
this.info(); console.log(item);
this.loading = true;
setTimeout(() => {
this.openiframe = true; this.openiframe = true;
console.log(this.pdfurl); this.loading = false;
// window.open(this.pdfurl); }, 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) { handleExport(row) {
@ -674,7 +737,7 @@ export default {
this.download( this.download(
`/system/kindergartenCheckReport/download?id=${row.id}`, `/system/kindergartenCheckReport/download?id=${row.id}`,
{}, {},
`幼儿园检测报告.pdf` row.reportName + `.pdf`
); );
} }
}, },
@ -747,6 +810,21 @@ export default {
}; };
this.kinhandleQuery(); 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> </script>

File diff suppressed because it is too large Load Diff

View File

@ -149,7 +149,6 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
:total="total" :total="total"
@ -302,7 +301,6 @@
@pagination="studentlist" @pagination="studentlist"
/> />
</el-dialog> </el-dialog>
<!-- // --> <!-- // -->
<el-dialog <el-dialog
width="860px" width="860px"
@ -403,7 +401,6 @@
@pagination="listKindergartenInfoetList" @pagination="listKindergartenInfoetList"
/> />
</el-dialog> </el-dialog>
<!-- // --> <!-- // -->
<el-dialog <el-dialog
width="1050px" width="1050px"
@ -513,7 +510,6 @@
@pagination="classinfo" @pagination="classinfo"
/> />
</el-dialog> </el-dialog>
<!-- // --> <!-- // -->
<el-dialog <el-dialog
width="700px" width="700px"
@ -617,14 +613,19 @@
<el-radio :label="1">已审核</el-radio> <el-radio :label="1">已审核</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<iframe </el-form>
ref="pdfCotainer" <div style="height: 650px; overflow: auto">
:src="pdfurl + '#toolbar=0'" <personalecharts
width="1150px" v-if="open"
height="550px" :itemlists="itemlist"
></iframe> class="personal"
></personalecharts>
<!-- <el-form-item label="学生姓名" prop="studentId"> </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-input v-model="form.studentId" placeholder="请输入学生姓名" />
</el-form-item> </el-form-item>
<el-form-item label="批次编号" prop="batchCode"> <el-form-item label="批次编号" prop="batchCode">
@ -636,26 +637,20 @@
<el-form-item label="报告名称" prop="reportName"> <el-form-item label="报告名称" prop="reportName">
<el-input v-model="form.reportName" placeholder="请输入报告名称" /> <el-input v-model="form.reportName" placeholder="请输入报告名称" />
</el-form-item> --> </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>
<!-- // -->
<el-dialog <el-dialog
title="预览" width="1200px"
:visible.sync="openiframe" style="height: 95%"
width="1050px"
append-to-body append-to-body
:visible.sync="openiframe"
> >
<div> <div style="height: 700px; overflow: auto">
<iframe <personalecharts
ref="pdfCotainer" v-if="openiframe"
:src="pdfurl + '#toolbar=0'" :itemlists="itemlist"
width="1000px" class="personal"
height="600px" ></personalecharts>
></iframe>
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="openiframe = false">关闭</el-button> <el-button type="primary" @click="openiframe = false">关闭</el-button>
@ -671,23 +666,19 @@ import {
} from "@/api/system/kindergartenInfo"; } from "@/api/system/kindergartenInfo";
import { listStudentInfo } from "@/api/system/studentInfo"; import { listStudentInfo } from "@/api/system/studentInfo";
import { listClassinfo } from "@/api/system/classinfo"; import { listClassinfo } from "@/api/system/classinfo";
import { getRoleInfo, testScoreBatch } from "@/api/system/quality"; import { testScoreBatch } from "@/api/system/quality";
import { import {
listPersonalCheckReport, listPersonalCheckReport,
updatePersonalCheckReport, uploadPersonalCheckReport,
checkReportreport,
existCheckReport,
} from "@/api/system/personalCheckReport"; } from "@/api/system/personalCheckReport";
import student from "../../assembly/student.vue"; import personalecharts from "../personalecharts/index.vue";
import baseurl from "@/api/baseurl.js"; import html2canvas from "html2canvas";
import JsPDF from "jspdf";
export default { export default {
components: { student }, components: { personalecharts },
name: "PersonalCheckReport", name: "PersonalCheckReport",
data() { data() {
return { return {
itemshow: false,
itemshow2: false,
total1: 0, total1: 0,
total2: 0, total2: 0,
total3: 0, total3: 0,
@ -823,6 +814,13 @@ export default {
name: "已审核", name: "已审核",
}, },
], ],
itemlist: {
pageNum: 1,
pageSize: 999,
studentId: "",
batchCode: "",
number: 1,
},
}; };
}, },
created() { created() {
@ -830,6 +828,26 @@ export default {
this.listKindergartenInfoetList(); this.listKindergartenInfoetList();
}, },
methods: { 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() { getList() {
this.loading = true; this.loading = true;
@ -875,30 +893,39 @@ export default {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
/** 修改按钮操作 */ /** 审核按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.itemlist.studentId = row.studentId;
const id = row.id || this.ids; this.itemlist.batchCode = row.batchCode;
this.form = JSON.parse(JSON.stringify(row)); this.itemlist.number++;
console.log(this.form); this.loading = true;
// this.form = row; setTimeout(() => {
this.title = "修改个人体质检测报告"; this.form = JSON.parse(JSON.stringify(row));
existCheckReport(row.studentId, row.batchCode).then((res) => { // this.form = row;
if (res.data.existFlag) { this.title = "审核个人体质检测报告";
this.pdfurl = baseurl + res.data.downloadAddress; this.open = true;
this.open = true; this.loading = false;
} else { }, 300);
checkReportreport(row.studentId, row.batchCode).then((res) => { // existCheckReport(row.studentId, row.batchCode).then((res) => {
// this.pdfurl = window.URL.createObjectURL(res); // if (res.code == 200) {
this.pdfurl = baseurl + res.data.downloadAddress; // if (res.data.existFlag) {
this.form.id = res.data.id; // this.loading = false;
this.getList(); // this.open = true;
this.open = true; // } else {
// window.open(this.pdfurl); // checkReportreport(row.studentId, row.batchCode).then((res) => {
}); // // this.pdfurl = window.URL.createObjectURL(res);
} // this.form.id = res.data.id;
}); // this.getList();
console.log(this.form); // this.loading = false;
// this.open = true;
// // window.open(this.pdfurl);
// });
// }
// } else if (res.code == 500) {
// this.loading = false;
// this.$message.error("");
// }
// });
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
@ -930,33 +957,100 @@ export default {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
/** 提交按钮 */ // /base64
submitForm() { dataURLtoBlob(dataurl) {
var obj = { console.log(dataurl);
id: this.form.id, var arr = dataurl.split(","),
checkStatus: this.form.checkStatus, mime = arr[0].match(/:(.*?);/)[1],
}; bstr = atob(arr[1]),
updatePersonalCheckReport(obj).then((response) => { n = bstr.length,
this.$modal.msgSuccess("修改成功"); u8arr = new Uint8Array(n);
this.queryParams = { while (n--) {
pageNum: 1, u8arr[n] = bstr.charCodeAt(n);
pageSize: 10, }
studentId: null, return new Blob([u8arr], {
batchCode: null, type: mime,
};
this.getList();
this.open = false;
}); });
}, },
// /** 提交按钮 */
lookhand(item) { submitForm() {
console.log(item); // updatePersonalCheckReport(obj).then((res) => {
checkReportreport(item.studentId, item.batchCode).then((res) => { // if (res.code == 200) {
// this.pdfurl = window.URL.createObjectURL(res); // this.$modal.msgSuccess("");
this.pdfurl = baseurl + res.data.downloadAddress; // this.queryParams = {
this.getList(); // pageNum: 1,
this.openiframe = true; // pageSize: 10,
// window.open(this.pdfurl); // 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( this.download(
`/system/personalCheckReport/download?id=${row.id}`, `/system/personalCheckReport/download?id=${row.id}`,
{}, {},
`个人体质检测报告.pdf` row.reportName + `.pdf`
); );
} }
}, },
// },
// //
classresetQuery() { classresetQuery() {
this.classqueryParams.className = ""; this.classqueryParams.className = "";
@ -1173,4 +1267,7 @@ export default {
::v-deep .el-form { ::v-deep .el-form {
display: inline; display: inline;
} }
.personal {
background-color: #fff;
}
</style> </style>

File diff suppressed because it is too large Load Diff

View File

@ -114,110 +114,99 @@
</div> </div>
</el-col> </el-col>
<el-col :span="24" :offset="0"> <el-col :span="24" :offset="0">
<div style="margin: 0 auto"> <div style="margin: 0 auto; width: 100%; line-height: 60px">
<div <div
style=" style="font-size: 12px; width: 100%; overflow: auto; height: 400px"
display: flex;
text-align: center;
justify-content: center;
color: black;
"
> >
<div <div
style=" style="
width: 120px; display: flex;
line-height: 60px; text-align: center;
border: 1px solid #f0f0f0; justify-content: center;
background: #f5f7fa;
"
>
年龄
</div>
<div
style="
width: 120px;
line-height: 60px;
border: 1px solid #f0f0f0;
background: #f5f7fa;
color: black; color: black;
" "
> >
平均总分 <div style="border: 0.5px solid #f0f0f0; background: #f5f7fa">
</div> <div style="width: 90px; line-height: 58px">年龄</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> </div>
<div
style=" <div style="border: 0.5px solid #f0f0f0; background: #f5f7fa">
display: flex; <div style="width: 90px; line-height: 58px">平均总分</div>
line-height: 30px; </div>
border: 1px solid #f0f0f0;
background: #f5f7fa; <div v-for="item in categoryTableNameList" :key="item.prentId">
color: black;
"
>
<div <div
v-for="uitem in item.childrenTableNameList" style="
:key="uitem.categoryId" text-align: center;
style="width: 120px" line-height: 30px;
border: 1px solid #f0f0f0;
background: #f5f7fa;
color: black;
"
> >
{{ uitem.categoryName }} {{ item.parentName }}
</div> </div>
</div> <div
</div> style="
</div> display: flex;
<div> line-height: 32px;
<div border: 1px solid #f0f0f0;
style=" background: #f5f7fa;
text-align: center; color: black;
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 <div
v-for="uitem in item.list" v-for="uitem in item.childrenTableNameList"
:key="uitem.categoryId" :key="uitem.categoryId"
style="width: 120px; border: 0.5px solid #f0f0f0" style="width: 90px"
> >
{{ uitem }} {{ uitem.categoryName }}
</div> </div>
</div> </div>
</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>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -239,7 +228,7 @@
<script> <script>
import * as echarts from "echarts"; import * as echarts from "echarts";
import { getRoleInfo } from "@/api/system/quality"; import { getRoleInfo } from "@/api/system/quality";
import { analysis } from "@/api/system/physique"; import { physiqueanalysis } from "@/api/system/physique";
import Kindergarten from "../../assembly/kindergarten.vue"; import Kindergarten from "../../assembly/kindergarten.vue";
export default { export default {
@ -296,7 +285,7 @@ export default {
}, },
analysisinfo() { analysisinfo() {
analysis(this.analysisqueryParams).then((res) => { physiqueanalysis(this.analysisqueryParams).then((res) => {
if (res.data == [] || !res.data) { if (res.data == [] || !res.data) {
this.itemshow2 = true; this.itemshow2 = true;
this.itemshow = false; this.itemshow = false;

View File

@ -124,6 +124,7 @@ export default {
this.$refs.cropper.getCropBlob(data => { this.$refs.cropper.getCropBlob(data => {
let formData = new FormData(); let formData = new FormData();
formData.append("avatarfile", data); formData.append("avatarfile", data);
console.log(data)
uploadAvatar(formData).then(response => { uploadAvatar(formData).then(response => {
this.open = false; this.open = false;
this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl; this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;