diff --git a/src/main/resources/static/pages/evaluate/outsourcerEvaluation/evaluationForm.html b/src/main/resources/static/pages/evaluate/outsourcerEvaluation/evaluationForm.html index cbfc126..f1c1622 100644 --- a/src/main/resources/static/pages/evaluate/outsourcerEvaluation/evaluationForm.html +++ b/src/main/resources/static/pages/evaluate/outsourcerEvaluation/evaluationForm.html @@ -189,6 +189,29 @@ }); } }); + // 单元格普通编辑事件 + table.on('edit(baseTable)', function(obj){ + var value = obj.value // 得到修改后的值 + var data = obj.data // 得到所在行所有键值 + var field = obj.field; // 得到字段 + //判断修改的是当前行的第几个单元格 + let index = headerRows[2].findIndex(item => item.field === field); + //获取其对应的二级标题 用于计算 + let currentItem = headerRows[1][index]; + let standardScore = Number(currentItem.standardScore); + if (value > standardScore) { + layer.msg('输入值不能大于标准值'); + //清空当前单元格 + obj.update({ + [field]: '' + }); + return; + } + // // 更新数据中对应的字段 + let update = {}; + update[field] = value; + obj.update(update); + }); }