修改bug

This commit is contained in:
曹辉 2022-08-26 10:17:44 +08:00
parent ee4e38e5ce
commit 3d643d5ee7
2 changed files with 277 additions and 120 deletions

View File

@ -182,70 +182,6 @@
</el-dialog>
<el-row v-show="itemshow">
<el-col :span="24" :offset="0">
<div style="text-align: center; height: 100px">
<div
class="el-table--enable-row-hover el-table--medium"
style="margin: 20px auto; height: 40px; text-align: center"
>
<div style="display: inline-block">
<span
style="
position: relative;
display: inline-block;
width: 120px;
text-align: center;
"
v-for="(item, index) in firstCategoryScoreList"
:key="index"
>
<span :style="index == 0 ? '' : 'margin-right:20px'">{{
index == 0 ? null : "+"
}}</span>
<span>
{{ item.avgCategoryFraction }}
</span>
<span
:style="index != 0 ? 'left:18px' : ''"
style="position: absolute; left: 0px; top: 20px; width: 120px"
>{{ item.categoryName }}</span
>
</span>
</div>
<div style="display: inline-block; position: relative">
<span style="margin: 0 20px">= </span>
<span style="display: inline-block; width: 100px">{{
totalAvgFraction
}}</span>
<span
style="
display: inline-block;
position: absolute;
top: 20px;
width: 100px;
left: 40px;
margin: 0 20px;
"
>(综合得分)</span
>
</div>
</div>
</div>
</el-col>
<el-col :span="24" :offset="0">
<div style="text-align: center">
<span>园所幼儿综合体质分析图</span>
</div>
<div class="el-table el-table--enable-row-hover el-table--medium">
<div
ref="chart"
id="chart"
style="width: 1000px; height: 600px; margin: 0 auto"
></div>
</div>
</el-col>
<el-col :span="24" :offset="0">
<div style="margin: 0 auto">
<div
@ -332,6 +268,70 @@
<div></div>
</div>
</el-col>
<el-col :span="24" :offset="0" style="margin-top:30px">
<div style="text-align: center; height: 100px">
<div
class="el-table--enable-row-hover el-table--medium"
style="margin: 20px auto; height: 40px; text-align: center"
>
<div style="display: inline-block">
<span
style="
position: relative;
display: inline-block;
width: 120px;
text-align: center;
"
v-for="(item, index) in firstCategoryScoreList"
:key="index"
>
<span :style="index == 0 ? '' : 'margin-right:20px'">{{
index == 0 ? null : "+"
}}</span>
<span>
{{ item.avgCategoryFraction }}
</span>
<span
:style="index != 0 ? 'left:18px' : ''"
style="position: absolute; left: 0px; top: 20px; width: 120px"
>{{ item.categoryName }}</span
>
</span>
</div>
<div style="display: inline-block; position: relative">
<span style="margin: 0 20px">= </span>
<span style="display: inline-block; width: 100px">{{
totalAvgFraction
}}</span>
<span
style="
display: inline-block;
position: absolute;
top: 20px;
width: 100px;
left: 40px;
margin: 0 20px;
"
>(综合得分)</span
>
</div>
</div>
</div>
</el-col>
<el-col :span="24" :offset="0">
<div style="text-align: center">
<span>园所幼儿综合体质分析图</span>
</div>
<div class="el-table el-table--enable-row-hover el-table--medium">
<div
ref="chart"
id="chart"
style="width: 1000px; height: 600px; margin: 0 auto"
></div>
</div>
</el-col>
</el-row>
<el-row :gutter="20" v-if="itemshow2">

View File

@ -147,12 +147,7 @@
/>
<!-- 添加或修改测试批次对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
width="1000px"
append-to-body
>
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form
ref="form"
:model="form"
@ -160,59 +155,98 @@
label-width="80px"
:inline="true"
>
<!-- <el-form-item label="批次编号" prop="batchCode">
<el-input v-model.number="form.batchCode" placeholder="请输入批次编号" />
</el-form-item> -->
<el-form-item label="批次名称" prop="batchName">
<el-input
style="width: 250px"
v-model="form.batchName"
placeholder="请输入批次名称"
maxlength="30"
/>
</el-form-item>
<el-form-item label="备注信息" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注信息" />
<el-input
v-model="form.remark"
placeholder="请输入备注信息"
style="width: 250px"
/>
</el-form-item>
<el-form-item label="测试项目名称" prop="itemName" label-width="110px">
<el-form-item label="测试项目" prop="itemBatchInfoIdList">
<el-button
this.testname="row.itemName;"
type=""
v-if="testname == '请添加测试项目'"
size="small"
@click="innerVisible3 = true"
style="
width: 209px;
text-align: left;
height: 36px;
color: #c0c4cc;
padding-left: -10px;
"
>{{ testname }}</el-button
>
<el-button
this.testname="row.itemName;"
type=""
@click="innerVisible3 = true"
v-else
style="
width: 209px;
text-align: left;
height: 36px;
padding-left: -10px;
"
>继续添加测试项目</el-button
type="primary"
plain
>添加测试项目</el-button
>
</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>
<div>
<el-table
ref="singleTable"
:data="items"
style="width: 95%; margin: 20px auto"
>
<el-table-column type="index" width="80" align="center">
</el-table-column>
<el-table-column
property="itemCode"
label="项目编号"
width="230"
align="center"
>
</el-table-column>
<el-table-column
property="itemName"
label="项目名称"
width="230"
align="center"
>
</el-table-column>
<el-table-column
property="itemType"
label="字典类型"
align="center"
width="180"
>
<template slot-scope="scope">
{{
scope.row.itemType == ResultType1.dictCode
? ResultType1.dictLabel
: ""
}}{{
scope.row.itemType == ResultType2.dictCode
? ResultType2.dictLabel
: ""
}}</template
>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="delitem(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
</el-dialog>
<!-- 测试项目弹窗 -->
<el-dialog
width="1000px"
title="选择测试项目名称"
@ -266,7 +300,13 @@
></el-button>
</template>
</el-table-column>
<el-table-column
property="itemCode"
label="项目编号"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="itemName"
label="项目名称"
@ -287,13 +327,6 @@
}}</template
>
</el-table-column>
<el-table-column
property="itemCode"
label="测试项目编号"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="itemContent"
label="项目内容"
@ -379,7 +412,14 @@
>
</el-table-column>
</el-table>
<el-button
type="success"
plain
size="mini"
@click="itemclick"
style="margin-top: 30px; margin-left: 20px"
>选择完成</el-button
>
<pagination
v-show="total4 > 0"
:total="total4"
@ -388,6 +428,51 @@
@pagination="getList"
/>
</el-dialog>
<el-dialog
width="680px"
title="查看测试项目"
:visible.sync="innerVisible"
append-to-body
style="margin-top: 100px"
>
<el-table ref="singleTable" :data="itemlist" style="width: 100%">
<el-table-column type="index" width="100" align="center">
</el-table-column>
<el-table-column
property="itemCode"
label="项目编号"
width="180"
align="center"
>
</el-table-column>
<el-table-column
property="itemName"
label="项目名称"
width="180"
align="center"
>
</el-table-column>
<el-table-column
property="resultDictType"
label="字典类型"
width="180"
align="center"
>
<template slot-scope="scope">
{{
scope.row.resultDictType == ResultType1.dictCode
? ResultType1.dictLabel
: ""
}}{{
scope.row.resultDictType == ResultType2.dictCode
? ResultType2.dictLabel
: ""
}}</template
>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>
@ -405,10 +490,20 @@ import { tKindergartenInfo } from "@/api/system/kindergartenInfo";
export default {
name: "TestScoreBatch",
data() {
var itembatch = (rule, value, callback) => {
var str = this.form.itemBatchInfoIdList;
console.log(str);
if (str.length > 0) {
callback();
} else {
return callback(new Error("请添加测试项目"));
}
};
return {
itemResultType: "item_result_type",
ResultType1: "", //numberLeixing
ResultType2: "", //textleixing
innerVisible: false,
innerVisible3: false,
//
loading: true,
@ -423,7 +518,6 @@ export default {
//
total: 0,
testItemss: [],
testname: "请添加测试项目",
total4: 0,
//
testScoreBatchList: [],
@ -451,39 +545,79 @@ export default {
// batchCode: [
// { required: true, message: "" },
// { type: "number", message: "", trigger: "blur" },
// ],
itemName: [{ required: true, message: "请添加测试项目" }],
// ],type:
itemBatchInfoIdList: [
{
required: true,
validator: itembatch,
message: "",
trigger: "blur",
},
],
batchName: [{ required: true, message: "批次名称不能为空" }],
remark: [{ required: true, message: "备注信息不能为空" }],
},
items: [],
itemlist: [],
};
},
created() {
this.getList();
},
methods: {
delitem(item) {
console.log(item);
this.items = this.items.filter((e) => {
return e.itemId != item.itemId;
});
},
deltestitem(item) {
console.log(item);
this.items = this.items.filter((e) => {
return e.itemId != item.id;
});
},
addtestitem(item) {
var id = {
itemId: item.id,
addtestitem(row) {
var item = {
itemId: row.id,
itemName: row.itemName,
itemType: row.resultDictType,
itemCode: row.itemCode,
};
this.items.push(id);
this.form.ItemBatchInfoIdList.push(id);
this.items.push(item);
// this.form.itemBatchInfoIdList.push(row.id);
console.log(this.items);
},
seeitem(item) {
itemclick() {
this.innerVisible3 = false;
},
lookitem(item) {
this.itemlist = [];
this.items = [];
var id = {
batchId: item.id,
};
temBatchInfoList(id).then((res) => {
console.log(res);
if (res.rows.length != 0) {
this.itemlist = res.rows;
this.items = res.rows;
this.items.forEach((e) => {
e.itemType = e.resultDictType;
e.itemId = e.id;
});
}
console.log(this.items);
});
},
seeitem(item) {
this.lookitem(item);
console.log(this.items);
if (this.items != []) {
this.innerVisible = true;
}
},
handleQuery4() {
this.queryParams4.pageNum = 1;
testItems(this.queryParams4).then((response) => {
@ -516,6 +650,7 @@ export default {
},
//
cancel() {
this.items = [];
this.open = false;
this.reset();
},
@ -531,7 +666,7 @@ export default {
createTime: null,
updateBy: null,
updateTime: null,
ItemBatchInfoIdList: [],
itemBatchInfoIdList: [],
};
this.resetForm("form");
},
@ -557,12 +692,14 @@ export default {
handleAdd() {
this.reset();
this.open = true;
this.items = [];
this.title = "添加测试成绩批次";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
this.lookitem(row);
getTestScoreBatch(id).then((response) => {
this.form = response.data;
this.open = true;
@ -571,6 +708,11 @@ export default {
},
/** 提交按钮 */
submitForm() {
this.form.itemBatchInfoIdList = [];
this.items.forEach((e) => {
this.form.itemBatchInfoIdList.push(e.itemId);
});
console.log(this.form);
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
@ -616,3 +758,18 @@ export default {
},
};
</script>
<style scoped='scss'>
.title {
font-size: 600;
}
.text {
margin-left: 10px;
margin-right: 10px;
font-weight: 500;
display: inline-block;
width: 100px;
border: 1px solid #f0f0f0;
text-align: center;
border-radius: 4px;
}
</style>