diff --git a/.env.development b/.env.development index 6a5988e..9cd36f7 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,7 @@ VUE_APP_TITLE = 幼儿园体质检测管理系统 ENV = 'development' # 若依管理系统/开发环境 -VUE_APP_BASE_API = 'http://192.168.16.64:8080' +VUE_APP_BASE_API = 'http://192.168.16.62:8089' #'/dev-api' # 路由懒加载 diff --git a/src/api/system/quality.js b/src/api/system/quality.js index f991d11..44ac476 100644 --- a/src/api/system/quality.js +++ b/src/api/system/quality.js @@ -3,7 +3,7 @@ import request from '@/utils/request' //查询用户权限 export function getRoleInfo() { return request({ - url: 'common/getRoleInfo', + url: '/common/getRoleInfo', method: 'get' }) } diff --git a/src/views/system/action/index.vue b/src/views/system/action/index.vue index 80cf64b..dff9634 100644 --- a/src/views/system/action/index.vue +++ b/src/views/system/action/index.vue @@ -7,7 +7,7 @@ v-show="showSearch" label-width="90px" > - + - + { console.log(res); + this.classqueryParams.kindergartenId = res.data.kindergartenId; + var user = res.data.roleKeys; + console.log(user); + if (user.includes("enchou")) { + this.showyey = false; + return; + } else if (user.includes("teacher")) { + this.showyey = false; + return; + } else if (user.includes("parent")) { + this.showyey = false; + this.showbj = false; + return; + } }); //获取幼儿园list listKindergartenInfo(this.kqueryParams).then((response) => { diff --git a/src/views/system/classconstitution/index.vue b/src/views/system/classconstitution/index.vue index 9d162b6..9f40d0d 100644 --- a/src/views/system/classconstitution/index.vue +++ b/src/views/system/classconstitution/index.vue @@ -7,7 +7,7 @@ v-show="showSearch" label-width="90px" > - + - + { console.log(res); + this.ClassListlist.kindergartenId = res.data.kindergartenId; + this.classqueryParams.kindergartenId = res.data.kindergartenId; + + var user = res.data.roleKeys; + console.log(user); + if (user.includes("enchou")) { + this.showyey = false; + return; + } else if (user.includes("teacher")) { + this.showyey = false; + return; + } else if (user.includes("parent")) { + this.showyey = false; + this.showbj = false; + return; + } }); //获取幼儿园list listKindergartenInfo(this.kqueryParams).then((response) => { diff --git a/src/views/system/classinfo/index.vue b/src/views/system/classinfo/index.vue index 441e39f..e88b6ba 100644 --- a/src/views/system/classinfo/index.vue +++ b/src/views/system/classinfo/index.vue @@ -212,7 +212,7 @@ @@ -359,6 +359,8 @@ export default { data() { // 验证手机号的规则 var checkMobile = (rule, value, cb) => { + console.log(value); + console.log(value.length); // 验证手机号的正则表达式 const regMobile = /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/; diff --git a/src/views/system/comprehensive/index.vue b/src/views/system/comprehensive/index.vue index e6c2a5b..5736d40 100644 --- a/src/views/system/comprehensive/index.vue +++ b/src/views/system/comprehensive/index.vue @@ -7,7 +7,7 @@ v-show="showSearch" label-width="90px" > - + - + { // console.log(el.categoryScore); seriesData.push(el.categoryScore); - if(el.levelName==null){ - el.levelName='暂无' + if (el.levelName == null) { + el.levelName = "暂无"; } yindicator.push({ name: el.categoryName + " " + "(" + el.levelName + "" + ")", @@ -881,7 +888,20 @@ export default { getList() { //用户权限 getRoleInfo().then((res) => { - console.log(res); + this.classqueryParams.kindergartenId = res.data.kindergartenId; + var user = res.data.roleKeys; + console.log(user); + if (user.includes("enchou")) { + this.showyey = false; + return; + } else if (user.includes("teacher")) { + this.showyey = false; + return; + } else if (user.includes("parent")) { + this.showyey = false; + this.showbj = false; + return; + } }); //获取幼儿园list listKindergartenInfo(this.kqueryParams).then((response) => { diff --git a/src/views/system/constitution/index.vue b/src/views/system/constitution/index.vue index 851ef1a..c49ab95 100644 --- a/src/views/system/constitution/index.vue +++ b/src/views/system/constitution/index.vue @@ -7,7 +7,7 @@ v-show="showSearch" label-width="90px" > - + - + { console.log(res); + this.classqueryParams.kindergartenId = res.data.kindergartenId; + var user = res.data.roleKeys; + console.log(user); + if (user.includes("enchou")) { + this.showyey = false; + return; + } else if (user.includes("teacher")) { + this.showyey = false; + return; + } else if (user.includes("parent")) { + this.showyey = false; + this.showbj = false; + return; + } }); //获取幼儿园list listKindergartenInfo(this.kqueryParams).then((response) => { diff --git a/src/views/system/motionInfo/index.vue b/src/views/system/motionInfo/index.vue index 0c9a85a..418ca2d 100644 --- a/src/views/system/motionInfo/index.vue +++ b/src/views/system/motionInfo/index.vue @@ -16,7 +16,7 @@ @keyup.enter.native="handleQuery" /> - + @@ -167,8 +168,8 @@ label-width="230px" > - 普通 - 会员 + 普通 + 会员 @@ -211,13 +212,15 @@ export default { title: "", // 是否显示弹出层 open: false, + applyCrowd1: 0, + applyCrowd2: 1, options: [ { - applyCrowd: "0", + applyCrowd: 0, label: "普通", }, { - applyCrowd: "1", + applyCrowd: 1, label: "会员", }, ], @@ -242,7 +245,7 @@ export default { methods: { /** 查询运动处方字典列表 */ getList() { - console.log(this.queryParams) + console.log(this.queryParams); this.loading = true; listMotionInfo(this.queryParams).then((response) => { this.motionInfoList = response.rows; diff --git a/src/views/system/parentInfo/index.vue b/src/views/system/parentInfo/index.vue index d5b5ba3..7d005b1 100644 --- a/src/views/system/parentInfo/index.vue +++ b/src/views/system/parentInfo/index.vue @@ -235,6 +235,14 @@ export default { created() { this.getList(); }, + watch: { + $route(to, from) { + console.log(to.path, from.path); + if (to.path == "/baseInfo/parentInfo") { + this.getList(); + } + }, + }, methods: { /** 查询家长信息列表 */ getList() { diff --git a/src/views/system/physique/index.vue b/src/views/system/physique/index.vue index 3a0fa4c..5540e82 100644 --- a/src/views/system/physique/index.vue +++ b/src/views/system/physique/index.vue @@ -7,7 +7,7 @@ v-show="showSearch" label-width="90px" > - + { console.log(res); + this.analysisqueryParams.kindergartenId = res.data.kindergartenId; + var user = res.data.roleKeys; + console.log(user); + if (user.includes("enchou")) { + this.showyey = false; + return; + } else if (user.includes("teacher")) { + this.showyey = false; + return; + } else if (user.includes("parent")) { + this.showyey = false; + return; + } }); //获取幼儿园list listKindergartenInfo(this.kqueryParams).then((response) => { diff --git a/src/views/system/quality/index.vue b/src/views/system/quality/index.vue index c9cbc69..d56830d 100644 --- a/src/views/system/quality/index.vue +++ b/src/views/system/quality/index.vue @@ -7,7 +7,7 @@ v-show="showSearch" label-width="90px" > - + - + - + }} + {{ item.measureUnit == "kg" ? "千克" : "" }} + {{ item.measureUnit == "g" ? "克" : "" }}({{ item.measureUnit }}) + 评价
@@ -457,13 +463,7 @@ width: 32px; " > - {{ - ((((item.maxScore - item.minScore) / item.minScore) * - item.minScore) / - 5) * - 4 + - item.minScore - }} + {{ ((item.maxScore - item.minScore) / 5) * 4 + item.minScore }}
- {{ - ((((item.maxScore - item.minScore) / item.minScore) * - item.minScore) / - 5) * - 3 + - item.minScore - }} + {{ ((item.maxScore - item.minScore) / 5) * 3 + item.minScore }}
- {{ - ((((item.maxScore - item.minScore) / item.minScore) * - item.minScore) / - 5) * - 2 + - item.minScore - }} + {{ ((item.maxScore - item.minScore) / 5) * 2 + item.minScore }}
- {{ - ((((item.maxScore - item.minScore) / item.minScore) * - item.minScore) / - 5) * - 1 + - item.minScore - }} + {{ ((item.maxScore - item.minScore) / 5) * 1 + item.minScore }}
{ console.log(res); + this.classqueryParams.kindergartenId = res.data.kindergartenId; + var user = res.data.roleKeys; + console.log(user); + if (user.includes("enchou")) { + this.showyey = false; + return; + } else if (user.includes("teacher")) { + this.showyey = false; + return; + } else if (user.includes("parent")) { + this.showyey = false; + this.showbj = false; + return; + } }); //获取幼儿园list listKindergartenInfo(this.kqueryParams).then((response) => { diff --git a/src/views/system/shape/index.vue b/src/views/system/shape/index.vue index ea511bf..c6be1f4 100644 --- a/src/views/system/shape/index.vue +++ b/src/views/system/shape/index.vue @@ -7,7 +7,7 @@ v-show="showSearch" label-width="90px" > - + - +
{ console.log(res); + this.classqueryParams.kindergartenId = res.data.kindergartenId; + var user = res.data.roleKeys; + console.log(user); + if (user.includes("enchou")) { + this.showyey = false; + return; + } else if (user.includes("teacher")) { + this.showyey = false; + return; + } else if (user.includes("parent")) { + this.showyey = false; + this.showbj = false; + return; + } }); //获取幼儿园list listKindergartenInfo(this.kqueryParams).then((response) => { diff --git a/src/views/system/survey/index.vue b/src/views/system/survey/index.vue index 425d6f1..2c73a53 100644 --- a/src/views/system/survey/index.vue +++ b/src/views/system/survey/index.vue @@ -7,7 +7,7 @@ v-show="showSearch" label-width="90px" > - + -
该学生此批次暂没数据
+
该批次暂无数据
@@ -249,6 +249,7 @@ export default { return { itemshow: false, itemshow2: false, + showyey: true, total1: 0, total4: 0, @@ -294,20 +295,20 @@ export default { studentlist: [], //查询传值 classqueryParams: { - // kindergartenId: "", - // batchCode: "", + kindergartenId: "", + batchCode: "", pageNum: 1, pageSize: 10, - kindergartenId: "12", - batchCode: "PC202208030005", + // kindergartenId: "12", + // batchCode: "PC202208030005", }, studentlistqueryParams: { - // kindergartenId: "", - // batchCode: "", + kindergartenId: "", + batchCode: "", pageNum: 1, pageSize: 10, - kindergartenId: "1", - batchCode: "PC202208030005", + // kindergartenId: "1", + // batchCode: "PC202208030005", }, LARGECLASS: "LARGE_CLASS", MIDDLECLASS: "MIDDLE_CLASS", @@ -320,258 +321,270 @@ export default { mounted() {}, created() { this.getList(); - this.StudentListinfo(); - this.ClassListinfo(); + // this.StudentListinfo(); + // this.ClassListinfo(); }, methods: { ClassListinfo() { ClassList(this.classqueryParams).then((res) => { - var classscore1 = []; - var classscore2 = []; - var classscore3 = []; - res.rows.forEach((e) => { - if (e.classType == this.LARGECLASS) { - this.yclassname1.push(e.className); - if ( - e.itemScoreAll == "" || - !e.itemScoreAll || - e.itemScoreAll == null - ) { - classscore1.push(0); - } else { - classscore1.push(e.itemScoreAll); + if (res.rows == [] || !res.rows) { + this.itemshow2 = true; + this.itemshow = false; + } else { + var classscore1 = []; + var classscore2 = []; + var classscore3 = []; + res.rows.forEach((e) => { + if (e.classType == this.LARGECLASS) { + this.yclassname1.push(e.className); + if ( + e.itemScoreAll == "" || + !e.itemScoreAll || + e.itemScoreAll == null + ) { + classscore1.push(0); + } else { + classscore1.push(e.itemScoreAll); + } + } else if (e.classType == this.MIDDLECLASS) { + this.yclassname2.push(e.className); + if ( + e.itemScoreAll == "" || + !e.itemScoreAll || + e.itemScoreAll == null + ) { + classscore2.push(0); + } else { + classscore2.push(e.itemScoreAll); + } + } else if (e.classType == this.SMALLCLASS) { + this.yclassname3.push(e.className); + if ( + e.itemScoreAll == "" || + !e.itemScoreAll || + e.itemScoreAll == null + ) { + classscore3.push(0); + } else { + classscore3.push(e.itemScoreAll); + } } - } else if (e.classType == this.MIDDLECLASS) { - this.yclassname2.push(e.className); - if ( - e.itemScoreAll == "" || - !e.itemScoreAll || - e.itemScoreAll == null - ) { - classscore2.push(0); - } else { - classscore2.push(e.itemScoreAll); - } - } else if (e.classType == this.SMALLCLASS) { - this.yclassname3.push(e.className); - if ( - e.itemScoreAll == "" || - !e.itemScoreAll || - e.itemScoreAll == null - ) { - classscore3.push(0); - } else { - classscore3.push(e.itemScoreAll); - } - } - }); - var app = {}; - var myChart = echarts.init(document.getElementById("main")); - var myChart2 = echarts.init(document.getElementById("main2")); - var myChart3 = echarts.init(document.getElementById("main3")); - var option; - var option2; - var option3; - 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", + }); + var app = {}; + var myChart = echarts.init(document.getElementById("main")); + var myChart2 = echarts.init(document.getElementById("main2")); + var myChart3 = echarts.init(document.getElementById("main3")); + var option; + var option2; + var option3; + const posList = [ + "left", + "right", + "top", + "bottom", + "inside", + "insideTop", + "insideLeft", + "insideRight", + "insideBottom", + "insideTopLeft", + "insideTopRight", + "insideBottomLeft", + "insideBottomRight", + ]; + app.configParameters = { + rotate: { + min: 0, + max: 90, }, - }, - 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: "shadow", - }, - }, - legend: {}, - xAxis: [ - { - type: "category", - axisTick: { show: false }, - data: this.yclassname1, - }, - ], - yAxis: [ - { - type: "value", - }, - ], - series: [ - { - type: "bar", - barGap: 0, - color: "#00B050", - label: labelOption, - emphasis: { - focus: "series", + align: { + options: { + left: "left", + center: "center", + right: "right", }, - data: classscore1, }, - ], - }; - option2 = { - tooltip: { - trigger: "axis", - axisPointer: { - type: "shadow", - }, - }, - legend: {}, - xAxis: [ - { - type: "category", - axisTick: { show: false }, - data: this.yclassname2, - }, - ], - yAxis: [ - { - type: "value", - }, - ], - series: [ - { - type: "bar", - barGap: 0, - color: "#00B050", - label: labelOption, - emphasis: { - focus: "series", + verticalAlign: { + options: { + top: "top", + middle: "middle", + bottom: "bottom", }, - data: classscore2, }, - ], - }; - option3 = { - tooltip: { - trigger: "axis", - axisPointer: { - type: "shadow", + position: { + options: posList.reduce(function (map, pos) { + map[pos] = pos; + return map; + }, {}), }, - }, - legend: {}, - xAxis: [ - { - type: "category", - axisTick: { show: false }, - data: this.yclassname3, + distance: { + min: 0, + max: 100, }, - ], - yAxis: [ - { - type: "value", + }; + 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, + }, + ], + }); }, - ], - series: [ - { - type: "bar", - barGap: 0, - color: "#00B050", - label: labelOption, - emphasis: { - focus: "series", + }; + 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: "shadow", }, - data: classscore3, }, - ], - }; + legend: {}, + xAxis: [ + { + type: "category", + axisTick: { show: false }, + data: this.yclassname1, + }, + ], + yAxis: [ + { + type: "value", + }, + ], + series: [ + { + type: "bar", + barGap: 0, + color: "#00B050", + label: labelOption, + emphasis: { + focus: "series", + }, + data: classscore1, + }, + ], + }; + option2 = { + tooltip: { + trigger: "axis", + axisPointer: { + type: "shadow", + }, + }, + legend: {}, + xAxis: [ + { + type: "category", + axisTick: { show: false }, + data: this.yclassname2, + }, + ], + yAxis: [ + { + type: "value", + }, + ], + series: [ + { + type: "bar", + barGap: 0, + color: "#00B050", + label: labelOption, + emphasis: { + focus: "series", + }, + data: classscore2, + }, + ], + }; + option3 = { + tooltip: { + trigger: "axis", + axisPointer: { + type: "shadow", + }, + }, + legend: {}, + xAxis: [ + { + type: "category", + axisTick: { show: false }, + data: this.yclassname3, + }, + ], + yAxis: [ + { + type: "value", + }, + ], + series: [ + { + type: "bar", + barGap: 0, + color: "#00B050", + label: labelOption, + emphasis: { + focus: "series", + }, + data: classscore3, + }, + ], + }; - option && myChart.setOption(option); - option2 && myChart2.setOption(option2); - option3 && myChart3.setOption(option3); - this.itemshow = true; - this.itemshow2 = false; + option && myChart.setOption(option); + option2 && myChart2.setOption(option2); + option3 && myChart3.setOption(option3); + this.itemshow = true; + this.itemshow2 = false; + } }); }, StudentListinfo() { StudentList(this.studentlistqueryParams).then((res) => { - this.studentlist = res.rows; + if (res.rows == [] || !res.rows) { + this.itemshow2 = true; + this.itemshow = false; + } else { + this.studentlist = res.rows; + this.itemshow2 = false; + this.itemshow = true; + } }); }, //点击批次左边 @@ -579,7 +592,9 @@ export default { this.batchCodeName = row.batchName; this.batchCodeId = row.id; this.classqueryParams.batchCode = row.batchCode; + this.studentlistqueryParams.batchCode = row.batchCode; this.batchCodeshow = false; + this.StudentListinfo(); this.ClassListinfo(); }, //点击批次 @@ -609,6 +624,7 @@ export default { //幼儿园左侧点击 kindergartenNameclick(row) { this.classqueryParams.kindergartenId = row.id; + this.studentlistqueryParams.kindergartenId = row.id; this.kindergartenName = row.kindergartenName; this.kindergartenId = row.id; this.kindergartenshow = false; @@ -622,6 +638,21 @@ export default { //用户权限 getRoleInfo().then((res) => { console.log(res); + this.studentlistqueryParams.kindergartenId = res.data.kindergartenId; + this.classqueryParams.kindergartenId = res.data.kindergartenId; + + var user = res.data.roleKeys; + console.log(user); + if (user.includes("enchou")) { + this.showyey = false; + return; + } else if (user.includes("teacher")) { + this.showyey = false; + return; + } else if (user.includes("parent")) { + this.showyey = false; + return; + } }); //获取幼儿园list listKindergartenInfo(this.kqueryParams).then((response) => { diff --git a/src/views/system/testItemCityScore/index.vue b/src/views/system/testItemCityScore/index.vue index 1978ac7..30ca91b 100644 --- a/src/views/system/testItemCityScore/index.vue +++ b/src/views/system/testItemCityScore/index.vue @@ -26,7 +26,7 @@ style="width: 228px" />
- + - + - + - { - if (Number.isNaN(Number.parseFloat(value))) { - callback(new Error("请输入数字")); - } else if (!this.form2.itemScore) { - callback(new Error("不能为空")); - } else if (this.form2.itemScore * 1 > 99999999) { - callback(new Error("最大99999999")); // 限制最大额度 + var str = value; + var str_ = ""; + var str2 = ""; + str_ = str.substr(str.indexOf(".")).length; + if (value.includes(".")) { + str2 = str.substr(0, str.indexOf(".")).length; + console.log(str2); + if (Number.isNaN(Number.parseFloat(value))) { + callback(new Error("请输入数字")); + } else if (!this.form2.itemScore) { + callback(new Error("不能为空")); + } else if (this.form2.itemScore * 1 > 99999999) { + callback(new Error("最大99999999")); // 限制最大额度 + } else if (this.form2.itemScore == "0") { + callback(new Error("请输入成绩")); // 限制最大额度 + } else if (str_ > 3) { + callback(new Error("小数点后两位")); // 限制最大额度 + } else if (str2 > 3) { + callback(new Error("整数为三位")); // 限制最大额度 + } else { + callback(); + } } else { - callback(); + str2 = str.length; + console.log(str2); + if (Number.isNaN(Number.parseFloat(value))) { + callback(new Error("请输入数字")); + } else if (!this.form2.itemScore) { + callback(new Error("不能为空")); + } else if (this.form2.itemScore * 1 > 99999999) { + callback(new Error("最大99999999")); // 限制最大额度 + } else if (this.form2.itemScore == "0") { + callback(new Error("请输入成绩")); // 限制最大额度 + } else if (str2 > 3) { + callback(new Error("整数为三位")); // 限制最大额度 + } else { + callback(); + } } }; var roleMoeny2 = (rule, value, callback) => { - if (Number.isNaN(Number.parseFloat(value))) { - callback(new Error("请输入数字")); - } else if (!this.form2.itemFraction) { - callback(new Error("不能为空")); - } else if (this.form2.itemFraction * 1 > 99999999) { - callback(new Error("最大99999999")); // 限制最大额度 + var str = value; + console.log(str); + var str_ = ""; + var str2 = ""; + str_ = str.substr(str.indexOf(".")).length; + if (value.includes(".")) { + str2 = str.substr(0, str.indexOf(".")).length; + console.log(str2); + if (Number.isNaN(Number.parseFloat(value))) { + callback(new Error("请输入数字")); + } else if (!this.form2.itemFraction) { + callback(new Error("不能为空")); + } else if (this.form2.itemFraction * 1 > 99999999) { + callback(new Error("最大99999999")); // 限制最大额度 + } else if (this.form2.itemFraction == "0") { + callback(new Error("请输入成绩")); // 限制最大额度 + } else if (str_ > 3) { + callback(new Error("小数点后两位")); // 限制最大额度 + } else if (str2 > 3) { + callback(new Error("整数为三位")); // 限制最大额度 + } else { + callback(); + } } else { - callback(); + str2 = str.length; + console.log(str2); + if (Number.isNaN(Number.parseFloat(value))) { + callback(new Error("请输入数字")); + } else if (!this.form2.itemFraction) { + callback(new Error("不能为空")); + } else if (this.form2.itemFraction * 1 > 99999999) { + callback(new Error("最大99999999")); // 限制最大额度 + } else if (this.form2.itemFraction == "0") { + callback(new Error("请输入成绩")); // 限制最大额度 + } else if (str2 > 3) { + callback(new Error("整数为三位")); // 限制最大额度 + } else { + callback(); + } } }; var roleMoeny3 = (rule, value, callback) => { - if (Number.isNaN(Number.parseFloat(value))) { - callback(new Error("请输入数字")); - } else if (!this.form.itemFraction) { - callback(new Error("不能为空")); - } else if (this.form.itemFraction * 1 > 99999999) { - callback(new Error("最大99999999")); // 限制最大额度 + var str = this.form.itemScore; + console.log(str); + var str_ = ""; + var str2 = ""; + str_ = str.substr(str.indexOf(".")).length; + if (value.includes(".")) { + str2 = str.substr(0, str.indexOf(".")).length; + console.log(str2); + if (Number.isNaN(Number.parseFloat(value))) { + callback(new Error("请输入数字")); + } else if (!this.form.itemScore) { + callback(new Error("不能为空")); + } else if (this.form.itemScore * 1 > 99999999) { + callback(new Error("最大99999999")); // 限制最大额度 + } else if (this.form.itemScore == "0") { + callback(new Error("请输入成绩")); // 限制最大额度 + } else if (str_ > 3) { + callback(new Error("小数点后两位")); // 限制最大额度 + } else if (str2 > 3) { + callback(new Error("整数为三位")); // 限制最大额度 + } else { + callback(); + } } else { - callback(); + str2 = str.length; + console.log(str2); + if (Number.isNaN(Number.parseFloat(value))) { + callback(new Error("请输入数字")); + } else if (!this.form.itemScore) { + callback(new Error("不能为空")); + } else if (this.form.itemScore * 1 > 99999999) { + callback(new Error("最大99999999")); // 限制最大额度 + } else if (this.form.itemScore == "0") { + callback(new Error("请输入成绩")); // 限制最大额度 + } else if (str2 > 3) { + callback(new Error("整数为三位")); // 限制最大额度 + } else { + callback(); + } } }; var roleMoeny4 = (rule, value, callback) => { - if (Number.isNaN(Number.parseFloat(value))) { - callback(new Error("请输入数字")); - } else if (!this.form.itemFraction) { - callback(new Error("不能为空")); - } else if (this.form.itemFraction * 1 > 99999999) { - callback(new Error("最大99999999")); // 限制最大额度 + var str = this.form.itemFraction; + console.log(str); + var str_ = ""; + var str2 = ""; + str_ = str.substr(str.indexOf(".")).length; + if (value.includes(".")) { + str2 = str.substr(0, str.indexOf(".")).length; + console.log(str2); + if (Number.isNaN(Number.parseFloat(value))) { + callback(new Error("请输入数字")); + } else if (!this.form.itemFraction) { + callback(new Error("不能为空")); + } else if (this.form.itemFraction * 1 > 99999999) { + callback(new Error("最大99999999")); // 限制最大额度 + } else if (this.form.itemFraction == "0") { + callback(new Error("请输入成绩")); // 限制最大额度 + } else if (str_ > 3) { + callback(new Error("小数点后两位")); // 限制最大额度 + } else if (str2 > 3) { + callback(new Error("整数为三位")); // 限制最大额度 + } else { + callback(); + } } else { - callback(); + str2 = str.length; + console.log(str2); + if (Number.isNaN(Number.parseFloat(value))) { + callback(new Error("请输入数字")); + } else if (!this.form.itemFraction) { + callback(new Error("不能为空")); + } else if (this.form.itemFraction * 1 > 99999999) { + callback(new Error("最大99999999")); // 限制最大额度 + } else if (this.form.itemFraction == "0") { + callback(new Error("请输入成绩")); // 限制最大额度 + } else if (str2 > 3) { + callback(new Error("整数为三位")); // 限制最大额度 + } else { + callback(); + } } }; return { + value: "", //项目测试类型 itemResultType: "item_result_type", //字典类型 @@ -1294,16 +1394,13 @@ export default { yryinnerVisible: false, testItemScoreLists: [], xmname: "请选择所属班级", - studentInfos: [], innerVisible: false, stname: "请选择学生姓名", innerVisible2: false, - testItemss: [], innerVisible3: false, testname: "请选择测试项目名称", - testScoreBatchs: [], innerVisible4: false, itemNumbername: "请选择批次编号", @@ -1326,7 +1423,6 @@ export default { kindergartenId: "", // 选中数组 ids: [], - // 非单个禁用 single: true, // 非多个禁用 @@ -1353,7 +1449,6 @@ export default { itemId3: "", itemId4: "", itemId5: "", - // 查询参数 queryParams: { pageNum: 1, @@ -1474,12 +1569,12 @@ export default { trigger: "blur", }, ], - syntheticalAssess: [ { required: true, message: "综合评价不能为空", trigger: "blur" }, ], }, realVal: "", + realVal2: "", }; }, created() { @@ -1499,83 +1594,6 @@ export default { kindergartencancel() { this.yryinnerVisible = false; }, - //只能输入一位小数点 - NumberCheck(num) { - let str = this.form2.itemScore; - //限制只能输入一个小数点 - if (Number.isNaN(Number.parseFloat(str))) { - } else { - //限制只能输入一个小数点 - if (str.indexOf(".") != -1) { - var str_ = str.substr(str.indexOf(".") + 1); - if (str_.indexOf(".") != -1) { - str = str.substr(0, str.indexOf(".") + str_.indexOf(".") + 1); - } - } - - str = parseFloat(str).toFixed(3); - this.realVal = str.substring(0, str.length - 1); - } - }, - //个人成绩得分只能输入一个小数点 - NumberCheck2(num) { - let str = this.form2.itemFraction; - //限制只能输入一个小数点 - if (Number.isNaN(Number.parseFloat(str))) { - } else { - //限制只能输入一个小数点 - if (str.indexOf(".") != -1) { - var str_ = str.substr(str.indexOf(".") + 1); - if (str_.indexOf(".") != -1) { - str = str.substr(0, str.indexOf(".") + str_.indexOf(".") + 1); - } - } - - str = parseFloat(str).toFixed(3); - this.realVal = str.substring(0, str.length - 1); - } - }, - NumberCheck3(num) { - let str = this.form.itemScore; - //限制只能输入一个小数点 - if (Number.isNaN(Number.parseFloat(str))) { - } else { - //限制只能输入一个小数点 - if (str.indexOf(".") != -1) { - var str_ = str.substr(str.indexOf(".") + 1); - if (str_.indexOf(".") != -1) { - str = str.substr(0, str.indexOf(".") + str_.indexOf(".") + 1); - } - } - //正则替换,保留数字和小数点 - str = parseFloat(str).toFixed(3); - this.realVal = str.substring(0, str.length - 1); - - // str = str.replace(/[^\d^\.]+/g, ""); - // this.form.itemAvgScore = str; - console.log(this.realVal); - } - }, - NumberCheck4(num) { - let str = this.form.itemFraction; - //限制只能输入一个小数点 - if (Number.isNaN(Number.parseFloat(str))) { - } else { - //限制只能输入一个小数点 - if (str.indexOf(".") != -1) { - var str_ = str.substr(str.indexOf(".") + 1); - if (str_.indexOf(".") != -1) { - str = str.substr(0, str.indexOf(".") + str_.indexOf(".") + 1); - } - } - //正则替换,保留数字和小数点 - str = parseFloat(str).toFixed(3); - this.realVal = str.substring(0, str.length - 1); - - // str = str.replace(/[^\d^\.]+/g, ""); - // this.form.itemAvgScore = str; - } - }, // 班级信息 xmclick(row) { console.log(row); @@ -1858,10 +1876,6 @@ export default { }, /** 提交按钮 */ submitForm() { - this.form2.itemScore = this.realVal; - this.form.itemFraction = this.realVal; - this.form.itemScore = this.realVal; - this.form2.itemFraction = this.realVal; console.log(this.form2); this.$refs["form"].validate((valid) => { if (valid) { @@ -1884,6 +1898,9 @@ export default { this.itemId3 = ""; this.itemId4 = ""; this.itemId5 = ""; + this.kindergartenName = "请选择幼儿园"; + this.kindergartenId = ""; + this.queryParams2.kindergartenId = ""; }); } } diff --git a/src/views/system/testItems/index.vue b/src/views/system/testItems/index.vue index 6ea01c8..d2dd1c8 100644 --- a/src/views/system/testItems/index.vue +++ b/src/views/system/testItems/index.vue @@ -372,23 +372,23 @@ --> - +