Browse Source

园区内企业基础数据,表单过长处理

gks 1 year ago
parent
commit
71c459f2ca
1 changed files with 44 additions and 27 deletions
  1. 44 27
      src/views/GARDENBASEDATA/index.vue

+ 44 - 27
src/views/GARDENBASEDATA/index.vue

@@ -6,8 +6,17 @@
       size="small"
       :inline="true"
       v-show="showSearch"
-      label-width="68px"
+      label-width="88px"
     >
+      <el-form-item label="部门名称" prop="deptName">
+        <el-input
+          v-model="queryParams.deptName"
+          placeholder="请输入"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="法定代表人" prop="fddbr">
+        <el-input v-model="queryParams.fddbr" placeholder="请输入"></el-input>
+      </el-form-item>
       <el-form-item>
         <el-select v-model="queryParams.deptId" placeholder="请选择">
           <el-option
@@ -200,14 +209,9 @@
 
     <!-- 添加或修改园区内企业基础数据对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="35%" append-to-body>
-      <div class="title">
-        <div class="msg" @click="changeIsShowStatus"></div>
-        <div class="msg" @click="changeIsShowStatus"></div>
-      </div>
-      <el-tabs @tab-click="handleTabClick"  type="border-card">
-        <el-tab-pane  label="企业基本信息">
-          <el-form ref="form" :model="form" :rules="rules" label-width="180px">
-          <template v-show="tabValue == 0">
+      <el-tabs @tab-click="handleTabClick" type="border-card">
+        <el-tab-pane label="企业基本信息">
+          <el-form ref="forms" :model="form" :rules="rules" label-width="180px">
             <el-form-item label="法定代表人" prop="fddbr">
               <el-input
                 v-model="form.fddbr"
@@ -250,7 +254,6 @@
                 placeholder="请输入企业类型 "
               ></el-input>
             </el-form-item>
-
             <el-form-item label="经营状态 " prop="jyzt">
               <el-input
                 v-model="form.jyzt"
@@ -294,16 +297,19 @@
                 placeholder="请输入经营范围  "
               ></el-input>
             </el-form-item>
-          </template>
-          <template v-show="tabValue == 1">
-            
+          </el-form>
+        </el-tab-pane>
+
+        <!-- 额外信息 -->
+        <el-tab-pane label="额外信息">
+          <el-form ref="form" :model="form" :rules="rules" label-width="180px">
             <el-form-item label="控股企业 " prop="kgqy">
               <el-input
                 v-model="form.kgqy"
                 placeholder="请输入控股企业 "
               ></el-input>
             </el-form-item>
-    
+
             <el-form-item label="行业大类 " prop="hydl">
               <el-input
                 v-model="form.hydl"
@@ -316,21 +322,21 @@
                 placeholder="请输入行业小类 "
               ></el-input>
             </el-form-item>
-    
+
             <el-form-item label="是否外资企业 " prop="sfwzqy">
               <el-input
                 v-model="form.sfwzqy"
                 placeholder="请输入是否外资企业 "
               ></el-input>
             </el-form-item>
-    
+
             <el-form-item label="企业海关编码 " prop="qyhgbm">
               <el-input
                 v-model="form.qyhgbm"
                 placeholder="请输入企业海关编码 "
               ></el-input>
             </el-form-item>
-    
+
             <el-form-item label="投产时间 " prop="tcsj">
               <!-- <el-input  v-model="form.tcsj" placeholder="请输入投产时间 "></el-input> -->
               <el-date-picker
@@ -354,14 +360,14 @@
                 placeholder="请输入经营期限至 "
               ></el-input>
             </el-form-item>
-    
+
             <el-form-item label="主营业务 " prop="zyyw">
               <el-input
                 v-model="form.zyyw"
                 placeholder="请输入主营业务 "
               ></el-input>
             </el-form-item>
-    
+
             <el-form-item label="企业资质  " prop="qyzz">
               <el-input
                 v-model="form.qyzz"
@@ -401,13 +407,7 @@
                 placeholder="请输入检测、服务外包、文化服务创新   "
               ></el-input>
             </el-form-item>
-          </template>
-        </el-form>
-
-        </el-tab-pane>
-
-        <!-- 额外信息 -->
-        <el-tab-pane  label="额外信息">
+          </el-form>
         </el-tab-pane>
       </el-tabs>
       <!-- <el-form> 
@@ -619,7 +619,8 @@ export default {
   },
   methods: {
     handleTabClick(val) {
-      this.tabValue = val;
+      this.tabValue = val.index;
+      console.log(this.tabValue);
     },
     changeIsShowStatus(val) {
       this.isShowStatus = val;
@@ -717,6 +718,19 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      let is;
+      this.$refs["forms"].validate((valid)=>{
+        if (valid) {
+        
+        }else{
+          this.$message.error("请补齐企业基本信息")
+          is = true;
+          return;
+        }
+      });
+      
+      if (is) return;
+
       this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.id != null) {
@@ -732,6 +746,9 @@ export default {
               this.getList();
             });
           }
+        }else{
+          this.$message.error("请补齐额外信息");
+          return;
         }
       });
     },