This commit is contained in:
曹辉 2022-09-30 14:32:59 +08:00
parent e621393740
commit c620698570
5 changed files with 219 additions and 201 deletions

View File

@ -1,3 +1,3 @@
var baseurl = "http://192.168.16.81:8081";
var baseurl = "http://192.168.16.62:8080";
export default baseurl

View File

@ -29,11 +29,10 @@ export function updateKindergartenCheckReport(data) {
})
}
// 幼儿园报告下载/预览
export function report(id) {
// 幼儿园报告预览
export function report(kindergartenId, batchCode) {
return request({
url: `/system/kindergartenCheckReport/download/report?id=${id}`,
method: 'POST',
responseType: 'blob'
url: `/system/checkReport/kindergarten/constitution?kindergartenId=${kindergartenId}&batchCode=${batchCode}`,
method: 'get'
})
}

View File

@ -343,198 +343,212 @@ export default {
if (res.code == 500) {
this.itemshow2 = true;
this.itemshow = false;
} else if (res.data == []) {
this.itemshow2 = true;
this.itemshow = false;
} else if (!res.data) {
this.itemshow2 = true;
this.itemshow = false;
} else {
this.listname = [];
this.totalAvgFraction = res.data.totalAvgFraction;
this.categoryTableNameList = res.data.categoryTableNameList;
this.categoryAgeFractionList = res.data.categoryAgeFractionList;
this.categoryScoreList = res.data.categoryScoreList;
var list = [];
this.categoryTableNameList.forEach((e) => {
e.childrenTableNameList.forEach((el) => {
list.push(el.categoryId);
});
});
let yname = [];
this.categoryScoreList.forEach((el) => {
yname.push(el.className);
var listname = list.map((e) => {
var num = 0;
var number = el.categoryScoreList.findIndex(
(o) => o.categoryId == e
);
if (number != -1) {
num = el.categoryScoreList[number].categoryName;
}
return num;
});
this.listname = listname;
var list1 = list.map((e) => {
var num = 0;
var number = el.categoryScoreList.findIndex(
(o) => o.categoryId == e
);
if (number != -1) {
num = el.categoryScoreList[number].avgScore;
}
return num;
});
el.list = list1;
});
console.log(this.categoryScoreList);
console.log(this.listname);
for (var i = 0; i < this.listname.length; i++) {
name = this.categoryScoreList[0].categoryScoreList[i].categoryName;
ydata = [
this.categoryScoreList[0].list[i],
this.categoryScoreList[1].list[i],
this.categoryScoreList[2].list[i],
];
var obj = {
name: name,
type: "bar",
label: labelOption,
emphasis: {
focus: "series",
},
data: ydata,
};
console.log(ydata);
yseries.push(obj);
names.push(name);
if (res.data.totalAvgFraction) {
this.totalAvgFraction = res.data.totalAvgFraction;
}
console.log(yseries);
var myChart = echarts.init(document.getElementById("chart"));
var option;
const posList = [
"left",
"right",
"top",
"bottom",
"inside",
"insideTop",
"insideLeft",
"insideRight",
"insideBottom",
"insideTopLeft",
"insideTopRight",
"insideBottomLeft",
"insideBottomRight",
];
app.configParameters = {
rotate: {
min: 0,
max: 90,
},
align: {
options: {
left: "left",
center: "center",
right: "right",
},
},
verticalAlign: {
options: {
top: "top",
middle: "middle",
bottom: "bottom",
},
},
position: {
options: posList.reduce(function (map, pos) {
map[pos] = pos;
return map;
}, {}),
},
distance: {
min: 0,
max: 100,
},
};
app.config = {
rotate: 0,
align: "center",
verticalAlign: "middle",
position: "top",
distance: 15,
onChange: function () {
const labelOption = {
rotate: app.config.rotate,
align: app.config.align,
verticalAlign: app.config.verticalAlign,
position: app.config.position,
distance: app.config.distance,
};
myChart.setOption({
series: [
{
label: labelOption,
},
{
label: labelOption,
},
{
label: labelOption,
},
{
label: labelOption,
},
],
if (res.data.categoryAgeFractionList) {
this.categoryAgeFractionList = res.data.categoryAgeFractionList;
}
var list = [];
if (res.data.categoryTableNameList && res.data.categoryScoreList) {
this.categoryTableNameList = res.data.categoryTableNameList;
this.categoryTableNameList.forEach((e) => {
e.childrenTableNameList.forEach((el) => {
list.push(el.categoryId);
});
},
};
const labelOption = {
show: true,
position: app.config.position,
distance: app.config.distance,
align: app.config.align,
verticalAlign: app.config.verticalAlign,
rotate: app.config.rotate,
formatter: "{c}",
fontSize: 16,
rich: {
name: {},
},
};
});
console.log(list);
option = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "",
},
},
legend: {
data: names,
},
xAxis: [
{
type: "category",
axisTick: { show: false },
data: yname,
},
],
yAxis: [
{
type: "value",
},
],
series: yseries,
};
this.categoryScoreList = res.data.categoryScoreList;
let yname = [];
console.log(this.categoryScoreList);
this.categoryScoreList.forEach((el) => {
yname.push(el.className);
var listname = list.map((e) => {
var num = 0;
var number = el.categoryScoreList.findIndex(
(o) => o.categoryId == e
);
if (number != -1) {
num = el.categoryScoreList[number].categoryName;
}
return num;
});
this.listname = listname;
console.log(list);
var list1 = list.map((e) => {
var num = 0;
var number = el.categoryScoreList.findIndex(
(o) => o.categoryId == e
);
if (number != -1) {
num = el.categoryScoreList[number].avgScore;
}
if (num == null) {
num = 0;
return num;
}
console.log(num);
return num;
});
el.list = list1;
});
console.log(this.categoryScoreList);
console.log(this.listname);
for (var i = 0; i < this.listname.length; i++) {
name =
this.categoryScoreList[0].categoryScoreList[i].categoryName;
ydata = [
this.categoryScoreList[0].list[i],
this.categoryScoreList[1].list[i],
this.categoryScoreList[2].list[i],
];
var obj = {
name: name,
type: "bar",
label: labelOption,
emphasis: {
focus: "series",
},
data: ydata,
};
console.log(ydata);
yseries.push(obj);
names.push(name);
}
option && myChart.setOption(option, true);
this.itemshow2 = false;
this.itemshow = true;
this.listname = [];
console.log(yseries);
var myChart = echarts.init(document.getElementById("chart"));
var option;
const posList = [
"left",
"right",
"top",
"bottom",
"inside",
"insideTop",
"insideLeft",
"insideRight",
"insideBottom",
"insideTopLeft",
"insideTopRight",
"insideBottomLeft",
"insideBottomRight",
];
app.configParameters = {
rotate: {
min: 0,
max: 90,
},
align: {
options: {
left: "left",
center: "center",
right: "right",
},
},
verticalAlign: {
options: {
top: "top",
middle: "middle",
bottom: "bottom",
},
},
position: {
options: posList.reduce(function (map, pos) {
map[pos] = pos;
return map;
}, {}),
},
distance: {
min: 0,
max: 100,
},
};
app.config = {
rotate: 0,
align: "center",
verticalAlign: "middle",
position: "top",
distance: 15,
onChange: function () {
const labelOption = {
rotate: app.config.rotate,
align: app.config.align,
verticalAlign: app.config.verticalAlign,
position: app.config.position,
distance: app.config.distance,
};
myChart.setOption({
series: [
{
label: labelOption,
},
{
label: labelOption,
},
{
label: labelOption,
},
{
label: labelOption,
},
],
});
},
};
const labelOption = {
show: true,
position: app.config.position,
distance: app.config.distance,
align: app.config.align,
verticalAlign: app.config.verticalAlign,
rotate: app.config.rotate,
formatter: "{c}",
fontSize: 16,
rich: {
name: {},
},
};
option = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "",
},
},
legend: {
data: names,
},
xAxis: [
{
type: "category",
axisTick: { show: false },
data: yname,
},
],
yAxis: [
{
type: "value",
},
],
series: yseries,
};
option && myChart.setOption(option, true);
this.itemshow2 = false;
this.itemshow = true;
}
}
});
},

View File

@ -616,19 +616,22 @@ export default {
this.reset();
const id = row.id || this.ids;
this.form = row;
var code = "";
existKindergartenCheckReport(row.kindergartenId, row.batchCode).then(
(response) => {
console.log(this.form);
if (response.code == 200) {
console.log(response);
code = response.code;
if (response.data.existFlag) {
this.title = "修改幼儿园检测报告审批状态";
this.pdfurl = baseurl + response.data.downloadAddress;
this.open = true;
} else if (response.code == 500) {
report(row.id).then((res) => {
} 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);
console.log(this.form)
this.open = true;
});
}
@ -639,7 +642,11 @@ export default {
submitForm() {
console.log(this.form);
if (this.form.id != null) {
updateKindergartenCheckReport(this.form).then((response) => {
var obj = {
id: this.form.id,
checkStatus: this.form.checkStatus,
};
updateKindergartenCheckReport(obj).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.queryParams = {
@ -654,8 +661,9 @@ export default {
},
//
lookhand(item) {
report(item.id).then((res) => {
this.pdfurl = window.URL.createObjectURL(res);
report(item.kindergartenId, item.batchCode).then((res) => {
// this.pdfurl = window.URL.createObjectURL(res);
this.pdfurl = baseurl + res.data.downloadAddress;
this.openiframe = true;
console.log(this.pdfurl);
// window.open(this.pdfurl);
@ -676,9 +684,6 @@ export default {
);
}
},
kinbatlist(kindergartenId, batchCode) {
console.log(kindergartenId, batchCode);
},
//
kindergartenNameclick(row) {

View File

@ -884,7 +884,7 @@ export default {
// this.form = row;
this.title = "修改个人体质检测报告";
existCheckReport(row.studentId, row.batchCode).then((res) => {
if (res.code == 200) {
if (res.data.existFlag) {
this.pdfurl = baseurl + res.data.downloadAddress;
this.open = true;
} else {