1178232204@qq.com 3 gadi atpakaļ
vecāks
revīzija
e94f0bfa80
1 mainītis faili ar 6 papildinājumiem un 13 dzēšanām
  1. 6 13
      src/components/icss/sonhospital/SonHospital.vue

+ 6 - 13
src/components/icss/sonhospital/SonHospital.vue

@@ -156,21 +156,16 @@ export default {
       });
     },
     onSubmit() {
-      this.form.hospitalRelationVOList.forEach((item, index) => {
-        if (item.name == '' && item.code == '') {
-          this.form.hospitalRelationVOList.splice(index, 1);
-          this.$refs.form.clearValidate();
-        }
-        item.errorOther = false;
-        item.errorCurrent = false;
-      });
-      this.$nextTick(() => {
-        this.$refs.form.validate(valid => {
+      this.$refs.form.validate(valid => {
         if (valid) {
           this.saveDisable = true;
           let params = {
             hospitalRelationVOList: this.form.hospitalRelationVOList
           };
+          this.form.hospitalRelationVOList.forEach((item, index) => {
+            item.errorOther = false;
+            item.errorCurrent = false;
+          });
           api.saveHospitalRelation(params).then(res => {
             if (res.data.code === '0') {
               this.$message({
@@ -206,8 +201,6 @@ export default {
           });
         }
       });
-      });
-      
     },
     getIndex(data, list) {
       let arr2Map = {};
@@ -369,7 +362,7 @@ export default {
     height: 32px;
     margin-bottom: 18px;
   }
-  /deep/ .is-error .el-form-item__error{
+  /deep/ .is-error .el-form-item__error {
     top: 34px;
   }
   .operation {