Merge remote-tracking branch 'origin/dev'

# Conflicts:
#	.env.development
This commit is contained in:
纪寒 2022-10-21 10:18:32 +08:00
commit f76bd21434
26 changed files with 4497 additions and 371 deletions

View File

@ -5,7 +5,7 @@ VUE_APP_TITLE = 智慧幼儿体质评估与促进系统
ENV = 'development' ENV = 'development'
# 智慧幼儿体质评估与促进系统/开发环境 # 智慧幼儿体质评估与促进系统/开发环境
VUE_APP_BASE_API = 'http://192.168.16.64:8080' VUE_APP_BASE_API = 'https://kindergarten.xinelu.cn'
#'/dev-api' #'/dev-api'
# 路由懒加载 # 路由懒加载

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,3 +1,3 @@
var baseurl = "https://kindergarten.xinelu.cn"; var baseurl = "http://192.168.16.64:8090";
export default baseurl export default baseurl

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.1 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="1350px"
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: 550px; 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="1350px" 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,
@ -550,7 +544,6 @@ export default {
listKindergartenInfo(this.kqueryParams).then((response) => { listKindergartenInfo(this.kqueryParams).then((response) => {
this.kindergartenList = response.rows; this.kindergartenList = response.rows;
this.total1 = response.total; this.total1 = response.total;
// console.log(this.kindergartenList);
}); });
}, },
// //
@ -582,7 +575,6 @@ export default {
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
console.log(this.queryParams);
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
this.info(); this.info();
}, },
@ -612,69 +604,106 @@ 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);
} 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"); //
var basepdf = PDF.output("datauristring"); // base64
// basepdf = basepdf.split("filename=generated.pdf;");
// base64 (blob)
let blob = this.dataURLtoBlob(basepdf);
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);
uploadKindergartenCheckReport(formData).then((res) => {
if (res.code == 200) {
this.$message({
message: "审核完成",
type: "success",
});
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(); this.loading = true;
setTimeout(() => {
this.openiframe = true; this.openiframe = true;
console.log(this.pdfurl); this.loading = false;
// window.open(this.pdfurl); }, 300);
});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport(row) { handleExport(row) {
// report(row.id).then((res) => {
// console.log(res);
// });
if (row.checkStatus == 0) { if (row.checkStatus == 0) {
this.$message.error("未审核,不可下载"); this.$message.error("未审核,不可下载");
} else if (row.checkStatus == 1) { } else if (row.checkStatus == 1) {
this.download( this.download(
`/system/kindergartenCheckReport/download?id=${row.id}`, `/system/kindergartenCheckReport/download?id=${row.id}`,
{}, {},
`幼儿园检测报告.pdf` row.reportName
); );
} }
}, },
@ -731,7 +760,6 @@ export default {
listKindergartenInfo(this.kqueryParams).then((response) => { listKindergartenInfo(this.kqueryParams).then((response) => {
this.kindergartenList = response.rows; this.kindergartenList = response.rows;
this.total1 = response.total; this.total1 = response.total;
// console.log(this.kindergartenList);
}); });
}, },
kinresetQuery() { kinresetQuery() {
@ -747,6 +775,20 @@ export default {
}; };
this.kinhandleQuery(); this.kinhandleQuery();
}, },
// /base64
dataURLtoBlob(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"
@ -607,7 +603,7 @@
<el-dialog <el-dialog
:title="title" :title="title"
:visible.sync="open" :visible.sync="open"
width="1200px" width="1050px"
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">
@ -617,45 +613,32 @@
<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
ref="pdfCotainer"
:src="pdfurl + '#toolbar=0'"
width="1150px"
height="550px"
></iframe>
<!-- <el-form-item label="学生姓名" prop="studentId">
<el-input v-model="form.studentId" placeholder="请输入学生姓名" />
</el-form-item>
<el-form-item label="批次编号" prop="batchCode">
<el-input v-model="form.batchCode" placeholder="请输入批次编号" />
</el-form-item>
<el-form-item label="报告编号" prop="reportCode">
<el-input v-model="form.reportCode" placeholder="请输入报告编号" />
</el-form-item>
<el-form-item label="报告名称" prop="reportName">
<el-input v-model="form.reportName" placeholder="请输入报告名称" />
</el-form-item> -->
</el-form> </el-form>
<div style="height: 550px; overflow: auto">
<personalecharts
v-if="open"
:itemlists="itemlist"
class="personal"
></personalecharts>
</div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- // -->
<el-dialog <el-dialog
title="预览" width="1300px"
: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 +654,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 +802,13 @@ export default {
name: "已审核", name: "已审核",
}, },
], ],
itemlist: {
pageNum: 1,
pageSize: 999,
studentId: "",
batchCode: "",
number: 1,
},
}; };
}, },
created() { created() {
@ -830,6 +816,18 @@ 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);
},
/** 查询个人体质检测报告列表 */ /** 查询个人体质检测报告列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -871,34 +869,22 @@ export default {
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
console.log(this.queryParams);
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) => {
// 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);
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
@ -930,33 +916,86 @@ export default {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
/** 提交按钮 */ // /base64
submitForm() { dataURLtoBlob(dataurl) {
var obj = { var arr = dataurl.split(","),
id: this.form.id, mime = arr[0].match(/:(.*?);/)[1],
checkStatus: this.form.checkStatus, bstr = atob(arr[1]),
}; n = bstr.length,
updatePersonalCheckReport(obj).then((response) => { u8arr = new Uint8Array(n);
this.$modal.msgSuccess("修改成功"); while (n--) {
this.queryParams = { u8arr[n] = bstr.charCodeAt(n);
pageNum: 1, }
pageSize: 10, return new Blob([u8arr], {
studentId: null, type: mime,
batchCode: null,
};
this.getList();
this.open = false;
}); });
}, },
// /** 提交按钮 */
lookhand(item) { submitForm() {
console.log(item); //pdf
checkReportreport(item.studentId, item.batchCode).then((res) => { this.open = false;
// this.pdfurl = window.URL.createObjectURL(res); let shareContent = document.querySelector(".personal"), //DOM
this.pdfurl = baseurl + res.data.downloadAddress; width = shareContent.clientWidth * 1.1, //dom
this.getList(); height = shareContent.clientHeight * 1.1, //dom
this.openiframe = true; canvas = document.createElement("canvas"), //canvas
// window.open(this.pdfurl); 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);
} 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);
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) => {
if (res.code == 200) {
this.$message({
message: "审核完成",
type: "success",
});
this.getList();
}
});
// PDF.save(".pdf"); //
}); });
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
@ -967,11 +1006,11 @@ export default {
this.download( this.download(
`/system/personalCheckReport/download?id=${row.id}`, `/system/personalCheckReport/download?id=${row.id}`,
{}, {},
`个人体质检测报告.pdf` row.reportName
); );
} }
}, },
// },
// //
classresetQuery() { classresetQuery() {
this.classqueryParams.className = ""; this.classqueryParams.className = "";
@ -999,7 +1038,6 @@ export default {
listKindergartenInfo(this.kqueryParams).then((response) => { listKindergartenInfo(this.kqueryParams).then((response) => {
this.kindergartenList = response.rows; this.kindergartenList = response.rows;
this.total1 = response.total; this.total1 = response.total;
// console.log(this.kindergartenList);
}); });
}, },
// //
@ -1037,7 +1075,6 @@ export default {
}, },
// //
batchCodeclick(row) { batchCodeclick(row) {
console.log(row);
this.batchCode = row.batchCode; this.batchCode = row.batchCode;
this.queryParams.batchCode = row.batchCode; this.queryParams.batchCode = row.batchCode;
this.batchName = row.batchName; this.batchName = row.batchName;
@ -1081,12 +1118,10 @@ export default {
listStudentInfo(this.studentqueryParams).then((res) => { listStudentInfo(this.studentqueryParams).then((res) => {
this.studentInfoList = res.rows; this.studentInfoList = res.rows;
this.total3 = res.total; this.total3 = res.total;
// console.log(this.studentInfoList);
}); });
}, },
// //
classshowclick() { classshowclick() {
console.log(this.classqueryParams);
if ( if (
this.classqueryParams.kindergartenId == "" || this.classqueryParams.kindergartenId == "" ||
this.classqueryParams.kindergartenId == null this.classqueryParams.kindergartenId == null
@ -1096,7 +1131,6 @@ export default {
this.classshow = true; this.classshow = true;
this.classinfo(); this.classinfo();
} }
// console.log(this.classqueryParams);
}, },
// //
studentcancel() { studentcancel() {
@ -1116,7 +1150,6 @@ export default {
}, },
// //
classclick(row) { classclick(row) {
// console.log(row);
this.className = row.className; this.className = row.className;
this.classId = row.id; this.classId = row.id;
this.studentqueryParams.classId = row.id; this.studentqueryParams.classId = row.id;
@ -1150,7 +1183,6 @@ export default {
listClassinfo(this.classqueryParams).then((response) => { listClassinfo(this.classqueryParams).then((response) => {
this.classinfoList = response.rows; this.classinfoList = response.rows;
this.total2 = response.total; this.total2 = response.total;
// console.log(this.classinfoList);
}); });
}, },
@ -1159,7 +1191,6 @@ export default {
listKindergartenInfo(this.kqueryParams).then((response) => { listKindergartenInfo(this.kqueryParams).then((response) => {
this.kindergartenList = response.rows; this.kindergartenList = response.rows;
this.total1 = response.total; this.total1 = response.total;
// console.log(this.kindergartenList);
}); });
}, },
// //
@ -1173,4 +1204,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

@ -623,7 +623,7 @@ export default {
this.innerVisible3 = false; this.innerVisible3 = false;
}, },
lookitem(item) { lookitem(item) {
console.log(item) console.log(item);
this.itemlist = []; this.itemlist = [];
this.items = []; this.items = [];
this.temqueryParams.batchId = item.id; this.temqueryParams.batchId = item.id;
@ -709,6 +709,12 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
batchCode: null,
batchName: null,
};
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
this.queryParams.className = ""; this.queryParams.className = "";

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;