From 3d643d5ee7c2161cb96d6a95f1e1430be65d55e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E8=BE=89?= <814457906@qq.com> Date: Fri, 26 Aug 2022 10:17:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/physique/index.vue | 128 +++++----- src/views/system/testScoreBatch/index.vue | 269 +++++++++++++++++----- 2 files changed, 277 insertions(+), 120 deletions(-) diff --git a/src/views/system/physique/index.vue b/src/views/system/physique/index.vue index 768ca9e..8010a6d 100644 --- a/src/views/system/physique/index.vue +++ b/src/views/system/physique/index.vue @@ -182,70 +182,6 @@ - - - - - - {{ - index == 0 ? null : "+" - }} - - {{ item.avgCategoryFraction }} - - {{ item.categoryName }} - - - - = - {{ - totalAvgFraction - }} - - (综合得分) - - - - - - - - 园所幼儿综合体质分析图 - - - - - + + + + + + {{ + index == 0 ? null : "+" + }} + + {{ item.avgCategoryFraction }} + + {{ item.categoryName }} + + + + = + {{ + totalAvgFraction + }} + + (综合得分) + + + + + + + + 园所幼儿综合体质分析图 + + + + + diff --git a/src/views/system/testScoreBatch/index.vue b/src/views/system/testScoreBatch/index.vue index ff8c238..9cddb1d 100644 --- a/src/views/system/testScoreBatch/index.vue +++ b/src/views/system/testScoreBatch/index.vue @@ -147,12 +147,7 @@ /> - + - - + - + {{ testname }} - - 继续添加测试项目添加测试项目 + + + + + + + + + + + + + {{ + scope.row.itemType == ResultType1.dictCode + ? ResultType1.dictLabel + : "" + }}{{ + scope.row.itemType == ResultType2.dictCode + ? ResultType2.dictLabel + : "" + }} + + + + 删除 + + + + - - + + - - - + 选择完成 + + + + + + + + + + + + {{ + scope.row.resultDictType == ResultType1.dictCode + ? ResultType1.dictLabel + : "" + }}{{ + scope.row.resultDictType == ResultType2.dictCode + ? ResultType2.dictLabel + : "" + }} + + + @@ -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 { }, }; + \ No newline at end of file