Pārlūkot izejas kodu

病历条目错误行高亮

zhouna 5 gadi atpakaļ
vecāks
revīzija
52c61d1337
1 mainītis faili ar 42 papildinājumiem un 21 dzēšanām
  1. 42 21
      src/components/recordInput/ManageItemBatch.vue

+ 42 - 21
src/components/recordInput/ManageItemBatch.vue

@@ -128,8 +128,7 @@
 </template>
 <script type="text/javascript">
  import api from '@api/records.js';
- import config from '@api/config.js';
-  import utils from '@api/utils.js';
+ import $ from 'jquery';
 
   export default {
     name:'ManageItemBatch',
@@ -154,7 +153,7 @@
         },
         multipleSelection: [],
         id:null,
-        activeLeftNames: ['1'],
+        activeLeftNames: [],
         modifier:''
       }
     },
@@ -340,27 +339,22 @@
                     showClose: true
                   });
         }
-        const values = Object.values(this.checkAllMap)
-        let casesEntryHospitals = []
+        const values = Object.values(this.checkAllMap);
+        let casesEntryHospitals = [],requiredValNull=[],valueTypeWr=[],tempItemIdx={};
+        $(".el-collapse .wrong").removeClass("wrong");
         for(let i = 0; i < values.length; i++){
           for(let j = 0; j < values[i].length;j++){
-            const value = values[i][j]
-            if(!value.msg||value.score==""){
-              this.$message({
-                message:'勾选项扣分值和提示信息不能为空',
-                type:'warning',
-                showClose: true
-              });
-              return
+            const value = values[i][j];
+            if(!valueTypeWr.length&&(!value.msg||value.score==="")){
+              tempItemIdx=this.caseLIst[i].qcCasesEntry.findIndex(item =>item.id === value.id);
+              requiredValNull.push(value.casesId);
+              $(".el-collapse .el-collapse-item:eq("+i+") table tr:eq("+(+tempItemIdx+1)+")").addClass("wrong");
             }
             var reg = new RegExp(/^\d+(\.\d)?$/);
-            if(!reg.test(value.score) || value.score >100){
-               this.$message({
-                message:'扣分值请输入≥0且≤100的数字,最多保留小数点后1位',
-                type:'warning',
-                showClose: true
-              });
-              return
+            if(!requiredValNull.length&&(!reg.test(value.score) || value.score >100)){
+              tempItemIdx=this.caseLIst[i].qcCasesEntry.findIndex(item =>item.id === value.id);
+              $(".el-collapse .el-collapse-item:eq("+i+") table tr:eq("+(+tempItemIdx+1)+")").addClass("wrong");
+              valueTypeWr.push(value.casesId);
             }
             let item = {
               "casesEntryId": value.id,
@@ -375,6 +369,23 @@
             casesEntryHospitals.push(item)
           }
         }
+        if(requiredValNull.length>0){
+          this.$message({
+            message:'勾选项扣分值和提示信息不能为空',
+            type:'warning',
+            showClose: true
+          });
+          this.activeLeftNames = requiredValNull;
+          return
+        }else if(valueTypeWr.length>0){
+          this.$message({
+            message:'扣分值请输入≥0且≤100的数字,最多保留小数点后1位',
+            type:'warning',
+            showClose: true
+          });
+          this.activeLeftNames = valueTypeWr;
+          return
+        }
         let param = {
           "casesEntryHospitals": casesEntryHospitals,
           "hospitalIds": [
@@ -517,7 +528,17 @@
           -webkit-transition: border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46);
           transition: border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46);
         }
-       
+        .wrong td{
+            border:1px #ff0000 solid;
+            border-right:none;
+            border-left:none;
+            &:last-child{
+                 border-right:1px #ff0000 solid;
+             }
+            &:first-child{
+                 border-left:1px #ff0000 solid;
+             }
+        }
         .active::after{
             -webkit-box-sizing: content-box;
             box-sizing: content-box;