From b080ebeee019ccd34e0fa2cd980220a326fa3611 Mon Sep 17 00:00:00 2001
From: miaojiale <1123971748@qq.com>
Date: Thu, 2 Feb 2023 16:43:17 +0800
Subject: [PATCH] =?UTF-8?q?1.=E5=88=A4=E6=96=AD=E6=96=B0=E5=A2=9E=E7=BC=96?=
 =?UTF-8?q?=E8=BE=91=E7=8A=B6=E6=80=81=202.=E5=85=A5=E9=80=89=E6=A0=87?=
 =?UTF-8?q?=E5=87=86=E9=A1=B5=E9=9D=A2=E6=8F=90=E4=BA=A4=203.=E5=8E=BB?=
 =?UTF-8?q?=E9=99=A4=E5=9B=A0=E4=B8=BA=E4=BE=A7=E8=BE=B9=E6=A0=8F=E5=AF=BC?=
 =?UTF-8?q?=E8=87=B4=E7=9A=84=E6=8A=A5=E9=94=99=204.=E8=87=AA=E5=AE=9A?=
 =?UTF-8?q?=E4=B9=89=E6=89=8B=E6=9C=BA=E5=8F=B7=E6=A0=A1=E9=AA=8C=E8=A7=84?=
 =?UTF-8?q?=E5=88=99=205.=E9=97=AE=E5=8D=B7=E8=B0=83=E6=9F=A5=E6=8F=90?=
 =?UTF-8?q?=E4=BA=A4=E6=B5=8B=E8=AF=95=206.=E5=AE=9E=E9=AA=8C=E5=AE=A4?=
 =?UTF-8?q?=E6=A3=80=E6=9F=A5=E9=80=9A=E8=BF=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 packages/config/input.vue                     |  38 ++++-
 src/App.vue                                   |   1 +
 ...45\215\267\350\260\203\346\237\245JSON.js" |   2 +
 .../zx-side-bar/components/SideBarItem.vue    |  36 ++---
 src/layouts/components/zx-side-bar/index.vue  |   3 +
 src/router/index.js                           |   1 +
 src/views/screening/ScreeningAdd.vue          |  15 +-
 .../screening/components/ConfigForms.vue      | 135 +++++++++++-------
 src/views/screening/components/FormTab.vue    |  20 ++-
 src/views/screening/components/mixin.js       |  11 +-
 ...02\347\272\247\345\205\263\347\263\273.md" |   5 +-
 11 files changed, 181 insertions(+), 86 deletions(-)
 create mode 100644 "src/components/FormComponents/CustomForm/\351\227\256\345\215\267\350\260\203\346\237\245JSON.js"
 rename "src/components/FormComponents/CustomForm/\345\261\202\347\272\247\345\205\263\347\263\273.md" => "\345\261\202\347\272\247\345\205\263\347\263\273.md" (84%)

diff --git a/packages/config/input.vue b/packages/config/input.vue
index 828e451..51ae1a4 100644
--- a/packages/config/input.vue
+++ b/packages/config/input.vue
@@ -35,6 +35,9 @@
     <el-form-item label="是否只读">
       <el-switch v-model="data.readonly"></el-switch>
     </el-form-item>
+    <el-form-item label="是否禁用">
+      <el-switch v-model="data.disabled"></el-switch>
+    </el-form-item>
     <el-form-item label="是否可见">
       <el-switch v-model="data.display"></el-switch>
     </el-form-item>
@@ -50,6 +53,18 @@
 </template>
 
 <script>
+let checkTel = (rule, value, callback) => {
+  if (!value) {
+    return callback(new Error("请输入手机号"))
+  }
+  const reg = /^1[3,4,5,6,7,8,9][0-9]{9}$/
+  reg.test(value)
+  if (!reg.test(value)) {
+    callback(new Error("请输入正确的手机号"))
+  } else {
+    callback()
+  }
+}
 export default {
   name: "config-input",
   props: ["data"],
@@ -71,6 +86,9 @@ export default {
       })
       this.data.rules = rules
     },
+    telRule() {
+      this.data.rules[1] = { validator: checkTel, trigger: "blur" }
+    },
   },
   watch: {
     "data.required": function (val) {
@@ -84,15 +102,21 @@ export default {
       this.generateRule()
     },
     "data.pattern": function (val) {
-      if (val)
-        this.validator.pattern = {
-          pattern: new RegExp(val),
-          message: `${this.data.label}格式不匹配`,
+      if (val) {
+        if (val == "checkTel") {
+          this.telRule()
+        } else {
+          this.validator.pattern = {
+            pattern: new RegExp(val),
+            message: `${this.data.label}格式不匹配`,
+          }
+          this.generateRule()
         }
-      else this.validator.pattern = null
-
+      } else {
+        this.validator.pattern = null
+        this.generateRule()
+      }
       // delete this.data.pattern
-      this.generateRule()
     },
   },
 }
diff --git a/src/App.vue b/src/App.vue
index 8c1ad6d..cce1dd5 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -19,6 +19,7 @@ export default {
 
 #vue-admin-beautiful {
   height: 100vh;
+  min-width: 1400px;
   overflow: auto;
   margin-right: calc(100% - 100vw);
 }
diff --git "a/src/components/FormComponents/CustomForm/\351\227\256\345\215\267\350\260\203\346\237\245JSON.js" "b/src/components/FormComponents/CustomForm/\351\227\256\345\215\267\350\260\203\346\237\245JSON.js"
new file mode 100644
index 0000000..0cb8ded
--- /dev/null
+++ "b/src/components/FormComponents/CustomForm/\351\227\256\345\215\267\350\260\203\346\237\245JSON.js"
@@ -0,0 +1,2 @@
+let formJson =
+{column:[],labelPosition:'left',labelSuffix:':',labelWidth:180,gutter:0,menuBtn:true,submitBtn:true,submitText:'下一步',emptyBtn:false,emptyText:'上一步',nextTabBtn:true,nextTabText:'下一页',menuPosition:'center',prevBtn:true,group:[{label:'个人信息',prop:'1669708504829_2651',arrow:true,collapse:true,display:true,labelWidth:8,column:[{type:'input',display:true,importantField:false,styles:{},prop:'name',label:'姓名',fieldType:'varchar',fieldLength:'15',tableName:'患者信息',tableCode:'gas_patient_info',tableId:'1595347991491833857',notFilter:false,cType:'',subfield:false,autoRequired:0,personalRequired:0,lg:12,span:12,width:24,xs:12,sm:12,md:12,readonly:false,required:true,rules:[{required:true,message:'姓名必须填写'}]},{type:'date',display:true,importantField:false,styles:{},format:'yyyy-MM-dd',valueFormat:'yyyy-MM-dd',prop:'survey_time',dicType:'',label:'调查时间',fieldType:'datetime',tableName:'问卷调查',tableCode:'gas_question',tableId:'1597462007689347074',notFilter:false,cType:'',subfield:false,span:12,xs:12,sm:12,md:12,lg:12,required:true,rules:[{required:true,message:'调查时间必须填写'}],personalRequired:0},{type:'input',display:true,importantField:false,styles:{},prop:'phone',label:'手机号',fieldType:'varchar',fieldLength:'15',tableName:'患者信息',tableCode:'gas_patient_info',tableId:'1595347991491833857',notFilter:false,cType:'',subfield:false,span:12,xs:12,sm:12,md:12,lg:12,required:true,rules:[{required:true,message:'手机号必须填写'},{validator:function checkTel(rule, value, callback) {\n  if (!value) {\n    return callback(new Error(\"请输入手机号\"));\n  }\n\n  var reg = /^1[3,4,5,6,7,8,9][0-9]{9}$/;\n  reg.test(value);\n\n  if (!reg.test(value)) {\n    callback(new Error(\"请输入正确的手机号\"));\n  } else {\n    callback();\n  }\n},trigger:'change'}],pattern:'checkTel'},{type:'input',display:true,importantField:false,styles:{},prop:'link_phone',label:'联系号码',fieldType:'varchar',fieldLength:'128',tableName:'患者信息',tableCode:'gas_patient_info',tableId:'1595347991491833857',notFilter:false,cType:'',subfield:false,span:12,xs:12,sm:12,md:12,lg:12,width:24,rules:[{required:true,message:'联系号码必须填写'}],required:true},{type:'date',display:true,importantField:false,styles:{},prop:'birthday',label:'出生日期',fieldType:'date',fieldLength:'',format:'yyyy-MM-dd',valueFormat:'yyyy-MM-dd',dicType:'',tableName:'患者信息',tableCode:'gas_patient_info',tableId:'1595347991491833857',notFilter:false,cType:'',subfield:false,span:12,xs:12,sm:12,md:12,lg:12,required:true,rules:[{required:true,message:'出生日期必须填写'}],disabled:true,value:' '},{type:'input',display:true,importantField:false,styles:{},prop:'age',label:'年龄',fieldType:'int',fieldLength:'11',tableName:'患者信息',tableCode:'gas_patient_info',tableId:'1595347991491833857',notFilter:false,cType:'',subfield:false,span:12,xs:12,sm:12,md:12,lg:12,required:true,rules:[{required:true,message:'年龄必须填写'}],readonly:false,disabled:true},{type:'radio',display:true,importantField:false,styles:{},autoRequired:0,personalRequired:0,prop:'sex',dicData:[{label:'女',value:'2',id:'1595351964546281474',parentId:''},{label:'男',value:'1',id:'1595351940139626497',parentId:''}],dynamicshSet:[],dicType:'d-sex',props:{label:'label',value:'value'},label:'性别',fieldType:'varchar',fieldLength:'20',tableName:'患者信息',tableCode:'gas_patient_info',tableId:'1595347991491833857',notFilter:false,cType:'',subfield:false,span:24,xs:24,sm:24,md:24,lg:24,required:true,rules:[{required:true,message:'请选择性别'}]}]},{label:'家族史',prop:'1669708827460_97007',arrow:true,collapse:true,display:true,labelWidth:8,column:[{type:'radio',display:true,importantField:false,styles:{},prop:'is_first_degree',label:'一级亲属(父母、子女、兄弟姐妹)罹患胃癌情况',dicData:[{label:'是',value:'1',id:'1595347527757000705',parentId:''},{label:'否',value:'0',id:'1595347502595371010',parentId:''}],dynamicshSet:[{value:'1',target:'family_count'},{value:'1',target:'min_age'}],dicType:'d-sf',props:{label:'label',value:'value'},fieldType:'tinyint',fieldLength:'2',tableName:'问卷调查',tableCode:'gas_question',tableId:'1597462007689347074',notFilter:false,cType:'',subfield:false,autoRequired:0,personalRequired:0,span:24,xs:24,sm:24,md:24,lg:24,required:true,rules:[{required:true,message:'请选择一级亲属(父母、子女、兄弟姐妹)罹患胃癌情况'}]},{type:'input',display:true,importantField:false,styles:{},prop:'family_count',label:'数量',fieldType:'int',fieldLength:'11',tableName:'问卷调查',tableCode:'gas_question',tableId:'1597462007689347074',notFilter:false,cType:'',subfield:false,span:24,labelSuffix:'(1)',xs:24,sm:24,md:24,lg:24,required:true,rules:[{required:true,message:'数量必须填写'}]},{type:'input',display:true,importantField:false,styles:{},prop:'min_age',label:'诊断时最小年龄',fieldType:'int',fieldLength:'11',tableName:'问卷调查',tableCode:'gas_question',tableId:'1597462007689347074',notFilter:false,cType:'',subfield:false,autoRequired:0,personalRequired:0,span:24,labelSuffix:'(2)',xs:24,sm:24,md:24,lg:24,width:24,rules:[{required:true,message:'诊断时最小年龄必须填写'}],required:true},{type:'radio',display:true,importantField:false,styles:{},prop:'is_other_sickness',label:'一级亲属罹患其他恶性肿瘤情况',fieldType:'tinyint',fieldLength:'2',dicData:[{label:'是',value:'1',id:'1595347527757000705',parentId:''},{label:'否',value:'0',id:'1595347502595371010',parentId:''}],dynamicshSet:[{value:'1',target:'family_other_count'},{value:'1',target:'other_sickness'}],dicType:'d-sf',props:{label:'label',value:'value'},tableName:'问卷调查',tableCode:'gas_question',tableId:'1597462007689347074',notFilter:false,cType:'',subfield:false,xs:24,sm:24,md:24,lg:24,span:24,width:24,rules:[{required:true,message:'请选择一级亲属罹患其他恶性肿瘤情况'}],required:true,autoRequired:0,personalRequired:0,labelSuffix:'2'},{type:'input',display:true,importantField:false,styles:{},prop:'family_other_count',label:'一级亲属罹患其他恶性肿瘤数量',fieldType:'int',fieldLength:'11',dicData:[{label:'是',value:'1',id:'1595347527757000705',parentId:''},{label:'否',value:'0',id:'1595347502595371010',parentId:''}],dynamicshSet:[],dicOption:'static',dicType:'',props:{label:'label',value:'value'},tableName:'问卷调查',tableCode:'gas_question',tableId:'1597462007689347074',notFilter:false,cType:'',subfield:false,lg:24,xs:24,sm:24,md:24,autoRequired:0,personalRequired:0,span:24,width:24,labelSuffix:'(1)',required:true,rules:[{required:true,message:'一级亲属罹患其他恶性肿瘤数量必须填写'}]},{type:'input',display:true,importantField:false,styles:{},prop:'other_sickness',label:'一级亲属罹患其它恶性肿瘤名称',fieldType:'varchar',fieldLength:'255',tableName:'问卷调查',tableCode:'gas_question',tableId:'1597462007689347074',notFilter:false,cType:'',subfield:false,autoRequired:0,personalRequired:0,span:24,labelSuffix:'(2)',xs:24,sm:24,md:24,lg:24,width:24,rules:[{required:true,message:'一级亲属罹患其它恶性肿瘤名称必须填写'}],required:true}]}]}
diff --git a/src/layouts/components/zx-side-bar/components/SideBarItem.vue b/src/layouts/components/zx-side-bar/components/SideBarItem.vue
index 427fe9f..2988ef0 100644
--- a/src/layouts/components/zx-side-bar/components/SideBarItem.vue
+++ b/src/layouts/components/zx-side-bar/components/SideBarItem.vue
@@ -63,9 +63,9 @@
 </template>
 
 <script>
-import path from "path";
-import { isExternal } from "@/utils/validate";
-import AppLink from "@/layouts/components/Link";
+import path from "path"
+import { isExternal } from "@/utils/validate"
+import AppLink from "@/layouts/components/Link"
 
 export default {
   name: "SideBarItem",
@@ -85,22 +85,22 @@ export default {
     },
   },
   data() {
-    this.onlyOneChild = null;
-    return {};
+    this.onlyOneChild = null
+    return {}
   },
   methods: {
     handleChildren(children = [], parent) {
-      if (children === null) children = [];
+      if (children === null) children = []
       const showChildren = children.filter((item) => {
         if (item.hidden) {
-          return false;
+          return false
         } else {
-          this.onlyOneChildren = item;
-          return true;
+          this.onlyOneChildren = item
+          return true
         }
-      });
+      })
       if (showChildren.length === 1) {
-        return true;
+        return true
       }
 
       if (showChildren.length === 0) {
@@ -108,22 +108,22 @@ export default {
           ...parent,
           path: "",
           notShowChildren: true,
-        };
-        return true;
+        }
+        return true
       }
-      return false;
+      return false
     },
     handlePath(routePath) {
       if (isExternal(routePath)) {
-        return routePath;
+        return routePath
       }
       if (isExternal(this.basePath)) {
-        return this.basePath;
+        return this.basePath
       }
-      return path.resolve(this.basePath, routePath);
+      return path.resolve(this.basePath, routePath)
     },
   },
-};
+}
 </script>
 
 <style lang="scss" scoped>
diff --git a/src/layouts/components/zx-side-bar/index.vue b/src/layouts/components/zx-side-bar/index.vue
index 19b685b..a7ef194 100644
--- a/src/layouts/components/zx-side-bar/index.vue
+++ b/src/layouts/components/zx-side-bar/index.vue
@@ -63,6 +63,9 @@ export default {
       return variables
     },
   },
+  // mounted() {
+  //   console.log(this.routes)
+  // },
 }
 </script>
 <style lang="scss" scoped>
diff --git a/src/router/index.js b/src/router/index.js
index 4354367..748a8cb 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -10,6 +10,7 @@ export const constantRoutes = [
     path: "/home",
     name: "Home",
     // redirect: "/home",
+    hidden: true,
     component: layout,
     children: [
       {
diff --git a/src/views/screening/ScreeningAdd.vue b/src/views/screening/ScreeningAdd.vue
index 4635a40..f583491 100644
--- a/src/views/screening/ScreeningAdd.vue
+++ b/src/views/screening/ScreeningAdd.vue
@@ -1,5 +1,5 @@
 <template>
-  <ConfigForms form-type="1" :prods="'add'"></ConfigForms>
+  <ConfigForms form-type="1" @addMethods="addMethods"></ConfigForms>
 </template>
 
 <script>
@@ -20,7 +20,18 @@ export default {
     return {}
   },
   created() {},
-  methods: {},
+  methods: {
+    // 处理部分逻辑
+    addMethods(v) {
+      console.log(v)
+      if (v.activeName == "index0") {
+        let data = {
+          birthday: v.form.birthday,
+        }
+        sessionStorage.setItem("index1Data", JSON.stringify(data))
+      }
+    },
+  },
 }
 </script>
 
diff --git a/src/views/screening/components/ConfigForms.vue b/src/views/screening/components/ConfigForms.vue
index eb45ef0..96a3df0 100644
--- a/src/views/screening/components/ConfigForms.vue
+++ b/src/views/screening/components/ConfigForms.vue
@@ -7,38 +7,40 @@
       <el-button
         v-if="!disabled"
         class="draftButton"
-        @click="onSubmit(formType)"
         :loading="loading"
+        @click="onSubmit(formType)"
         >{{ formType == 1 ? "临时保存" : "返回" }}</el-button
       >
       <el-tabs
         v-model="activeName"
+        v-loading="fromLoading"
         type="card"
         :style="{ width: formType == 1 ? '100%' : 'calc(100% - 200px)' }"
         class="publicTab"
-        v-loading="fromLoading"
         @tab-click="handleTabClick"
       >
         <el-tab-pane
-          :label="form.label"
-          :name="'index' + index"
           v-for="(form, index) in formTabs"
           :key="form.id"
+          :label="form.label"
+          :name="'index' + index"
         >
           <transition mode="out-in" name="fade-transform">
             <div v-show="activeName === 'index' + index">
               <template v-if="form.formId">
                 <form-tab
+                  ref="formTabs"
                   :patient-id="patientId"
                   :patient-standby-id="patientStandbyId"
+                  :newform-record-id="newformRecordId"
                   :form="form"
                   :disabled="disabled"
                   contrast
+                  :form-initial="formInitial"
+                  :survival-flag="survivalFlag"
                   @setFormJson="setFormJson"
                   @handleConfirm="handleConfirm"
                   @onPrev="onPrev"
-                  :formInitial="formInitial"
-                  :survivalFlag="survivalFlag"
                 ></form-tab>
               </template>
             </div>
@@ -80,8 +82,8 @@
           <el-button
             type="primary"
             :loading="loading"
-            @click="view"
             class="textBtn"
+            @click="view"
             >查看</el-button
           >
           <el-button type="primary" :loading="loading" @click="continueSubmit"
@@ -97,17 +99,17 @@
 import mixin from "./mixin"
 import CustomForm from "@/components/FormComponents/CustomForm/index"
 import publicDialog from "../../audit-detail/components/publicDialog.vue"
+import { getPatientDetail } from "@/api/patient.js"
 
 export default {
-  components: { publicDialog },
   name: "ConfigForms",
+  components: { publicDialog },
   mixins: [mixin],
   props: {
     disabled: Boolean,
     formType: String,
     patientId: String,
     formClass: String,
-    prods: String,
   },
   data() {
     return {
@@ -118,10 +120,85 @@ export default {
       formInitial: {}, // 第四步的数据
     }
   },
+  computed: {
+    survivalFlag() {
+      if (this.activeName == "index0" && this.formClass) {
+        return true
+      } else {
+        return false
+      }
+    },
+    showIndex() {
+      if (this.activeName == "index0" && this.formClass) {
+        return false
+      } else {
+        return true
+      }
+    },
+  },
+  watch: {
+    activeName(val) {
+      console.log(this.formId)
+      if (val == "index3") {
+        // 第四步风险评估
+        this.$nextTick(() => {
+          getPatientDetail({
+            formId: this.formId, // 每个大表单的id
+            patientId: this.patientId || this.patientStandbyId,
+            formRecordId: this.newformRecordId,
+          })
+            .then((res) => {
+              console.log(res)
+            })
+            .finally(() => {
+              this.loading = false
+            })
+          this.$nextTick(() => {
+            console.log("走了")
+            //!
+            // this.formInitial = {
+            //   risk_rank: "中危",
+            //   risk_score: "5分",
+            //   screening_advise: "立刻住院",
+            // }
+          })
+        })
+      } else if (val == "index1") {
+        // 第二步问卷调查
+        this.$nextTick(() => {
+          let { birthday } = JSON.parse(sessionStorage.getItem("index1Data"))
+          let date = new Date(String(birthday).replace(/-/g, "/"))
+          let d = new Date()
+          let age =
+            d.getFullYear() -
+            date.getFullYear() -
+            (d.getMonth() < date.getMonth() ||
+            (d.getMonth() == date.getMonth() && d.getDate() < date.getDate())
+              ? 1
+              : 0)
+          //!
+          this.formInitial = {
+            birthday,
+            age,
+          }
+        })
+      } else {
+        this.formInitial = false
+      }
+    },
+  },
+  created() {
+    // 字典formType 1 筛查表单
+    // console.log('回显2',this.formEdit)
+    this.getCurrentFormByType(this.formType)
+  },
   methods: {
-    view() {},
     handleConfirm(data, done, cb) {
       this.addPatient(data, done, cb)
+      this.$emit("addMethods", {
+        activeName: this.activeName,
+        form: data.data,
+      })
     },
     onPrev(done) {
       this.prevTab(done)
@@ -143,44 +220,6 @@ export default {
     dialogCancel() {},
     continueSubmit() {},
   },
-  created() {
-    // 字典formType 1 筛查表单
-    // console.log('回显2',this.formEdit)
-    this.getCurrentFormByType(this.formType)
-  },
-  watch: {
-    activeName(val) {
-      if (val == "index3") {
-        // 第四步风险评估
-        this.$nextTick(() => {
-          //!
-          // this.formInitial = {
-          //   risk_rank: "中危",
-          //   risk_score: "5分",
-          //   screening_advise: "立刻住院",
-          // }
-        })
-      } else {
-        this.formInitial = false
-      }
-    },
-  },
-  computed: {
-    survivalFlag() {
-      if (this.activeName == "index0" && this.formClass) {
-        return true
-      } else {
-        return false
-      }
-    },
-    showIndex() {
-      if (this.activeName == "index0" && this.formClass) {
-        return false
-      } else {
-        return true
-      }
-    },
-  },
   provide() {
     return {
       configForms: this,
diff --git a/src/views/screening/components/FormTab.vue b/src/views/screening/components/FormTab.vue
index fb57266..9e76cd4 100644
--- a/src/views/screening/components/FormTab.vue
+++ b/src/views/screening/components/FormTab.vue
@@ -89,6 +89,7 @@ export default {
     form: Object,
     patientId: String,
     patientStandbyId: String,
+    newformRecordId: String,
     getAll: Boolean, // 获取页面所有数据
     survivalFlag: Boolean, //存活的显示
     formEdit: {},
@@ -150,7 +151,6 @@ export default {
   },
   methods: {
     initData() {
-      console.log("有patientId,获取数据")
       this.formData.formRecordId = null
       this.formCacheList = []
       this.getPatientDetail()
@@ -166,6 +166,7 @@ export default {
     },
 
     handleAdd() {
+      console.log("触发新增", this.form)
       this.$refs.form && this.$refs.form.resetForm()
       this.formData = {
         formEdit: {},
@@ -231,16 +232,15 @@ export default {
         "handleConfirm",
         {
           data,
-          formId: this.form.formId,
+          formId: this.form.formId, // 每个大表单的id
           patientId: this.patientId || this.patientStandbyId,
-          formRecordId: this.formData.formRecordId,
+          formRecordId: this.formData.formRecordId || this.newformRecordId, // 是否为编辑的表单id
           statusMap: {
             patientFrom: this.$store.getters["table/selectedIndex"],
-            is_draft: 1,
-            check_status: 1,
+            is_draft: 1, //是否为草稿
+            check_status: 1, // 审核状态
           },
         },
-
         done,
         (res) => {
           // 多次填写的表单新增时,获取最新数据
@@ -362,7 +362,13 @@ export default {
     }
   },
   mounted() {
-    // console.log()
+    //! 设置新增判断
+    if (this.$route.path == "/screening/add") {
+      // this.handleAdd()
+      if (!this.formData.formRecordId) {
+        this.handleAdd()
+      }
+    }
   },
 }
 </script>
diff --git a/src/views/screening/components/mixin.js b/src/views/screening/components/mixin.js
index 03ba5a9..8f11768 100644
--- a/src/views/screening/components/mixin.js
+++ b/src/views/screening/components/mixin.js
@@ -10,7 +10,9 @@ export default {
       activeName: "index0",
       fromLoading: false,
       patientStandbyId: null, // 备用id
+      newformRecordId: null, //记录Id
       formTabs: [],
+      formId: "",
       formTabsList: [],
       isUpdated: false,
     }
@@ -41,6 +43,7 @@ export default {
     },
     handleTabClick({ index, name }) {
       const { formId, id, silent } = this.formTabs[index]
+      this.formId = this.formTabsList[index].formId
       console.log("表单项", this.formTabs[index])
       if (formId && silent) {
         this.formTabs[index]["silent"] = false //控制是否获取接口数据
@@ -55,11 +58,15 @@ export default {
     async addPatient(data, done, cb, type) {
       addPatient(data, type)
         .then((res) => {
-          this.$message.success("操作成功")
+          // this.$message.success("操作成功")
           if (res.data) {
             this.isUpdated = true
             this.patientStandbyId = res.data.patientId
-            if (cb && Object.prototype.toString.call(cb) === "[object Function]") {
+            this.newformRecordId = res.data.formRecordId
+            if (
+              cb &&
+              Object.prototype.toString.call(cb) === "[object Function]"
+            ) {
               cb(res)
             }
           }
diff --git "a/src/components/FormComponents/CustomForm/\345\261\202\347\272\247\345\205\263\347\263\273.md" "b/\345\261\202\347\272\247\345\205\263\347\263\273.md"
similarity index 84%
rename from "src/components/FormComponents/CustomForm/\345\261\202\347\272\247\345\205\263\347\263\273.md"
rename to "\345\261\202\347\272\247\345\205\263\347\263\273.md"
index 872c7c2..9f00c3c 100644
--- "a/src/components/FormComponents/CustomForm/\345\261\202\347\272\247\345\205\263\347\263\273.md"
+++ "b/\345\261\202\347\272\247\345\205\263\347\263\273.md"
@@ -11,9 +11,10 @@
 
 上一步下一步提交按钮触发:在CustomForm/index 最终处理实在ConfigForms以及同级中的mixin
 
+formId:表单id
+formRecordId:记录数
 
-
-
+数据在ConfigForms处理
 
 
 
-- 
2.22.0