From 755cd8a5a7f5be8e3e6d119fd68e24a1be590e0a Mon Sep 17 00:00:00 2001
From: luoyb <412940104@qq.com>
Date: 星期五, 05 二月 2021 15:29:24 +0800
Subject: [PATCH] feat(信息录入): 提交和翻页

---
 src/views/user/Informationinput.vue |   97 ++++++++++++++++++++++++------------------------
 1 files changed, 48 insertions(+), 49 deletions(-)

diff --git a/src/views/user/Informationinput.vue b/src/views/user/Informationinput.vue
index 313a469..6217a20 100644
--- a/src/views/user/Informationinput.vue
+++ b/src/views/user/Informationinput.vue
@@ -1747,7 +1747,7 @@
       </div>
     </el-dialog>
     <el-dialog title="备注信息" :visible.sync="dialogshowArr[13].show" width="50%">
-      <el-form :model="remarkInfoForm" :rules="rules" label-position="right" label-width="140px">
+      <el-form ref="remarkInfoForm" :model="remarkInfoForm" :rules="rules" label-position="right" label-width="140px">
         <el-row>
           <el-col :span="12">
             <el-form-item label="姓名" prop="empName">
@@ -1791,8 +1791,8 @@
         </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="putRemarkInfo()">保 存</el-button>
-        <el-button type="primary" @click="putRemarkInfoContinue()">保存并继续新增</el-button>
+        <el-button type="primary" @click="putRemarkInfo('remarkInfoForm')">保 存</el-button>
+        <el-button type="primary" @click="putRemarkInfoContinue('remarkInfoForm')">保存并继续新增</el-button>
         <el-button @click="dialogIsShow()">取 消</el-button>
       </div>
     </el-dialog>
@@ -4432,42 +4432,50 @@
       this.queryParams.delFlag = 2
       this.search()
     },
-    putRemarkInfo() {
-      if (this.isAdd) {
-        this.$post('hr/empRemarkInfo', { ...this.remarkInfoForm }).then(() => {
-          this.buttonLoading = false
-          this.$message({
-            message: this.$t('tips.createSuccess'),
-            type: 'success'
-          })
-          this.cleanRemarkInfo()
-          this.selectRemarkInfo()
-        })
-      } else {
-        this.$put('hr/empRemarkInfo', { ...this.remarkInfoForm }).then(() => {
-          this.$message({
-            message: this.$t('tips.updateSuccess'),
-            type: 'success'
-          })
-          this.$emit('success')
-          this.cleanRemarkInfo()
-          this.selectRemarkInfo()
-        })
-      }
-      this.dialogIsShow()
+    putRemarkInfo(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          if (this.isAdd) {
+            this.$post('hr/empRemarkInfo', { ...this.remarkInfoForm }).then(() => {
+              this.buttonLoading = false
+              this.$message({
+                message: this.$t('tips.createSuccess'),
+                type: 'success'
+              })
+              this.cleanRemarkInfo()
+              this.selectRemarkInfo()
+            })
+          } else {
+            this.$put('hr/empRemarkInfo', { ...this.remarkInfoForm }).then(() => {
+              this.$message({
+                message: this.$t('tips.updateSuccess'),
+                type: 'success'
+              })
+              this.$emit('success')
+              this.cleanRemarkInfo()
+              this.selectRemarkInfo()
+            })
+          }
+          this.dialogIsShow()
+        }
+      })
     },
-    putRemarkInfoContinue() {
-      if (this.isAdd) {
-        this.$post('hr/empRemarkInfo', { ...this.remarkInfoForm }).then(() => {
-          this.buttonLoading = false
-          this.$message({
-            message: this.$t('tips.createSuccess'),
-            type: 'success'
-          })
-          this.cleanRemarkInfo()
-          this.selectRemarkInfo()
-        })
-      }
+    putRemarkInfoContinue(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          if (this.isAdd) {
+            this.$post('hr/empRemarkInfo', { ...this.remarkInfoForm }).then(() => {
+              this.buttonLoading = false
+              this.$message({
+                message: this.$t('tips.createSuccess'),
+                type: 'success'
+              })
+              this.cleanRemarkInfo()
+              this.selectRemarkInfo()
+            })
+          }
+        }
+      })
     },
     cleanRemarkInfo() {
       this.remarkInfoForm.remarkId = ''
@@ -4562,12 +4570,13 @@
             this.inputForName = 'remarkInfoForm'
             break
         }
-        console.log(this[this.inputForName])
         this[this.inputForName].empId = data.empId
         this[this.inputForName].empName = data.empName
         this[this.inputForName].empNumb = data.empNumb
         this[this.inputForName].certificateNumb = data.certificateNumb
+        this[this.inputForName].deptId = data.deptId
         this[this.inputForName].deptName = data.deptName
+        this[this.inputForName].JobId = data.jobId
         this[this.inputForName].jobName = data.jobName
         this[this.inputForName].sex = data.sex === '0' ? '男' : '女'
       }
@@ -4605,16 +4614,6 @@
           this.empBaseInfoForm.age = userinfo.age
           this.empBaseInfoForm.birthdate = userinfo.birth
           this.empBaseInfoForm.sex = userinfo.sex
-          break
-        case 1:
-          this.workExperienceForm.age = userinfo.age
-          this.workExperienceForm.birthdate = userinfo.birth
-          this.workExperienceForm.sex = userinfo.sex
-          break
-        case 2:
-          this.physicalExamForm.age = userinfo.age
-          this.physicalExamForm.birthdate = userinfo.birth
-          this.physicalExamForm.sex = userinfo.sex
           break
       }
     }

--
Gitblit v1.8.0