评估优化

This commit is contained in:
zhanglipeng 2021-01-07 17:10:01 +08:00
parent ab9fab9465
commit 09462d74a5
5 changed files with 55 additions and 34 deletions

View File

@ -28,6 +28,7 @@ import 'video.js/dist/video-js.css';
import 'vue-video-player/src/custom-theme.css';
import Print from '@/utils/print'
import PrintECharts from '@/utils/print_echarts'
import { preventReClick } from '@/utils/plugins';
// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey

View File

@ -0,0 +1,17 @@
import Vue from 'vue'
// 防止重复提交指令
const preventReClick = Vue.directive('preventReClick', {
inserted (el, binding) {
el.addEventListener('click', () => {
if (!el.disabled) {
el.disabled = true
setTimeout(() => {
el.disabled = false
}, binding.value || 3000)
}
})
}
})
export { preventReClick }

View File

@ -14,6 +14,7 @@
size="mini"
@click="submitForm"
v-hasPermi="['benyi:assessmentchild:add']"
v-prevent-re-click
>生成图表</el-button
>
</div>
@ -39,7 +40,7 @@
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane
v-for="itemLy in assessmentcontentList.filter(
p => p.parentId == this.assessmentscope
(p) => p.parentId == this.assessmentscope
)"
:key="itemLy.id"
:label="itemLy.name"
@ -49,7 +50,7 @@
v-loading="loading"
class="block"
v-for="itemFzly in assessmentcontentList.filter(
p => p.parentId == itemLy.id
(p) => p.parentId == itemLy.id
)"
:key="itemFzly.id"
>
@ -59,7 +60,7 @@
<ul class="block-content">
<li
v-for="itemMb in assessmentcontentList.filter(
p => p.parentId == itemFzly.id
(p) => p.parentId == itemFzly.id
)"
:key="itemMb.id"
>
@ -69,15 +70,12 @@
<div
class="checkbox-content"
v-for="itemYs in assessmentcontentList.filter(
p => p.parentId == itemMb.id
(p) => p.parentId == itemMb.id
)"
:key="itemYs.id"
>
<p class="checkbox-item flex align-center">
<el-checkbox-group
v-model="checkList"
@change="handlecheckedItemsChange"
>
<el-checkbox-group v-model="checkList">
<el-checkbox :label="itemYs.id" :key="itemYs.id">{{
itemYs.name
}}</el-checkbox>
@ -159,14 +157,11 @@ import {
delAssessmentcontent,
addAssessmentcontent,
updateAssessmentcontent,
exportAssessmentcontent
exportAssessmentcontent,
} from "@/api/benyi/assessmentcontent";
import { getChildByAssessment } from "@/api/benyi/child";
import {
addAssessmentchild,
updateAssessmentchild
} from "@/api/benyi/assessmentchild";
import { addAssessmentchild } from "@/api/benyi/assessmentchild";
export default {
name: "Assessmentstudent",
@ -195,11 +190,11 @@ export default {
name: undefined,
iselement: undefined,
scope: undefined,
sort: undefined
sort: undefined,
},
activeName: "健康",
checked: false,
checkList: []
checkList: [],
};
},
created() {
@ -211,7 +206,7 @@ export default {
},
methods: {
getChild(childId) {
getChildByAssessment(childId).then(response => {
getChildByAssessment(childId).then((response) => {
// console.log(response);
if (response.code == "200") {
this.childName = response.data.name;
@ -220,7 +215,7 @@ export default {
this.bjmc = response.data.bjmc;
this.classid = response.data.classid;
this.zbjsxm = response.data.zbjsmc;
response.ByAssessmentchild.forEach(item =>
response.ByAssessmentchild.forEach((item) =>
this.checkList.push(item.contentid)
);
if (response.isAssessment == "0") {
@ -237,7 +232,7 @@ export default {
/** 查询评估内容列表 */
getList() {
this.loading = true;
listAssessmentcontent(this.queryParams).then(response => {
listAssessmentcontent(this.queryParams).then((response) => {
// console.log("rows:" + response.rows);
this.assessmentcontentList = response.rows;
this.loading = false;
@ -258,16 +253,16 @@ export default {
// this.resetForm("form");
// },
/** 提交按钮 */
submitForm: function() {
submitForm: function () {
this.$confirm("确认生成图表数据?生成后数据不能取消", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
callback: action => {
callback: (action) => {
if (action === "confirm") {
// console.log(' ')
var items = "";
this.checkList.forEach(item => {
this.checkList.forEach((item) => {
//
items = items + item + ",";
});
@ -282,29 +277,33 @@ export default {
this.form.type = "Y";
this.form.xn = this.trem;
this.form.scope = this.assessmentscope;
addAssessmentchild(this.form).then(response => {
addAssessmentchild(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("评估成功");
this.$router.push({
path:
"/benyi/assessmentchildhistory/student/" + this.childId,
});
}
});
}
} else {
}
}
},
});
},
handleClick(tab) {
// this.activeName = tab
},
handlecheckedItemsChange(value) {
// var items = "";
// this.checkList.forEach((item) => {
// //
// items = items + item + ",";
// });
// console.log(items);
}
}
// handlecheckedItemsChange(value) {
// // var items = "";
// // this.checkList.forEach((item) => {
// // //
// // items = items + item + ",";
// // });
// // console.log(items);
// },
},
};
</script>
<style lang="scss" scoped>

View File

@ -111,8 +111,12 @@ public class ByAssessmentchildController extends BaseController {
}
}
}
if (iCount > 0) {
return toAjax(iCount);
} else {
return AjaxResult.error("选择的评估数据无变化");
}
return toAjax(iCount);
}
/**

View File

@ -27,7 +27,7 @@
<if test="classid != null and classid != ''">and classid = #{classid}</if>
<if test="contentid != null ">and contentid = #{contentid}</if>
<if test="type != null and type != ''">and type = #{type}</if>
<if test="xn != null and xn != ''">and xn = #{xn}</if>
<!-- <if test="xn != null and xn != ''">and xn = #{xn}</if>-->
<if test="userid != null ">and userid = #{userid}</if>
</where>
</select>