Browse Source

EHR-绩效:绩效填写-提交,业务组业务指标权重总和不得低于80%;

001295 1 năm trước cách đây
mục cha
commit
2a417f97de
1 tập tin đã thay đổi với 15 bổ sung4 xóa
  1. 15 4
      src/views/business/ehr/pm/myPm/detail.vue

+ 15 - 4
src/views/business/ehr/pm/myPm/detail.vue

@@ -305,10 +305,10 @@ export default {
         this.$modal.msgWarning("已勾选加减分项,不允许有权重!");
         return;
       }
-      if(this.form.staffDivide == 'C1' && this.rowData.aspect == 0 && this.rowData.weight < 80){
-        this.$modal.msgWarning("业务组的业绩考核权重不能低于80!");
-        return;
-      }
+      // if(this.form.staffDivide == 'C1' && this.rowData.aspect == 0 && this.rowData.weight < 80){
+      //   this.$modal.msgWarning("业务组的业绩考核权重不能低于80!");
+      //   return;
+      // }
       let sum = 100;
       if(this.rowData.id){
         let arr = this.form.performanceItem.filter(ele => ele.id != this.rowData.id);
@@ -385,6 +385,17 @@ export default {
           this.$modal.msgWarning("权重不为100%无法提交!");
           return;
         }
+        //业务组的业务指标不得小于80
+        if(this.form.staffDivide == 'C1'){
+          let arr = this.form.performanceItem.filter(ele => ele.aspect == '0');
+          console.log('arr',arr);
+          let weight = arr.reduce((sum, e) => sum + (Number(e.weight || 0)), 0);
+          console.log('weight',weight);
+          if(weight < 80){
+            this.$modal.msgWarning("业务组的业绩考核总权重不能低于80!");
+            return;
+          }
+        }
         let that = this;
         this.$modal.confirm('确认提交吗?').then(async function() {
           that.loading = true;