yubo
2026-04-12 3a77c6fbda3243c135f9a3b55ad205970fd9f6cb
src/views/user/components/EmpBaseEdit.vue
@@ -133,7 +133,7 @@
              <el-form-item label="姓名" prop="empName">
                <el-input v-model="empBaseInfoForm.empName" />
              </el-form-item>
              <el-form-item label="部门(护卫点)" required message="请选择护卫点" prop="deptId">
              <el-form-item label="部门(护卫点)" prop="deptId">
                <treeselect
                  v-model="empBaseInfoForm.deptId"
                  :multiple="false"
@@ -258,7 +258,7 @@
    </el-container>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="putEmpBase('empBaseInfoForm')">保 存</el-button>
      <el-button type="primary" @click="putEmpBaseContinue('empBaseInfoForm')">保存并继续新增</el-button>
      <el-button v-if="isAdd" type="primary" @click="putEmpBaseContinue('empBaseInfoForm')">保存并继续新增</el-button>
      <el-button @click="handleClose">取 消</el-button>
    </div>
@@ -494,8 +494,8 @@
          { min: 2, max: 50, message: this.$t('rules.noMoreThan50'), trigger: 'blur' }],
        empNumb: [{ required: true, message: '请输入员工编号', trigger: 'blur' },
          { min: 2, max: 20, message: this.$t('rules.noMoreThan20'), trigger: 'blur' }],
        deptName: [
          { required: true, message: '请选择护卫点', trigger: 'input' }
        deptId: [
          { required: true, message: '请选择护卫点', trigger: 'change' }
        ],
        certificateNumb: [{ required: true, message: '请输入身份证号', trigger: 'blur' }],
        jobName: [{ required: true, message: '请选择岗位', trigger: 'change' }],
@@ -531,6 +531,9 @@
          { min: 2, max: 50, message: this.$t('rules.noMoreThan50'), trigger: 'blur' }],
        empNumb: [{ required: true, message: '请输入员工编号', trigger: 'blur' },
          { min: 2, max: 20, message: this.$t('rules.noMoreThan20'), trigger: 'blur' }],
        deptId: [
          { required: true, message: '请选择护卫点', trigger: 'change' }
        ],
        certificateNumb: [{ required: true, message: '请输入身份证号', trigger: 'blur' }]
      }
    }
@@ -582,6 +585,11 @@
    }
  },
  watch: {
    isAdd() {
      this.$nextTick(() => {
        this.$refs.empBaseInfoForm && this.$refs.empBaseInfoForm.clearValidate()
      })
    },
    employeeData: {
      handler(newVal) {
        if (Object.keys(newVal).length > 0) {
@@ -675,25 +683,25 @@
      this.empBaseInfoForm.empId = ''
      this.empBaseInfoForm.customerId = ''
      this.empBaseInfoForm.archivesNumb = ''
      this.empBaseInfoForm.deptId = ''
      this.empBaseInfoForm.deptId = null
      this.empBaseInfoForm.deptName = ''
      this.empBaseInfoForm.empNumb = ''
      this.empBaseInfoForm.empName = ''
      this.empBaseInfoForm.sex = ''
      this.empBaseInfoForm.sex = '1'
      this.empBaseInfoForm.JobId = ''
      this.empBaseInfoForm.jobName = ''
      this.empBaseInfoForm.empType = ''
      this.empBaseInfoForm.empType = '01'
      this.empBaseInfoForm.certificateType = ''
      this.empBaseInfoForm.certificateNumb = ''
      this.empBaseInfoForm.nation = ''
      this.empBaseInfoForm.nation = '01'
      this.empBaseInfoForm.certificateValidity = ''
      this.empBaseInfoForm.marriage = ''
      this.empBaseInfoForm.marriage = '1'
      this.empBaseInfoForm.age = ''
      this.empBaseInfoForm.stature = ''
      this.empBaseInfoForm.birthdate = ''
      this.empBaseInfoForm.politics = ''
      this.empBaseInfoForm.politics = '13'
      this.empBaseInfoForm.entryDate = ''
      this.empBaseInfoForm.education = ''
      this.empBaseInfoForm.education = '17'
      this.empBaseInfoForm.seniority = ''
      this.empBaseInfoForm.nativePlace = ''
      this.empBaseInfoForm.nativePlaceName = ''
@@ -703,40 +711,41 @@
      this.empBaseInfoForm.telePhone = ''
      this.empBaseInfoForm.returnReceipt = ''
      this.empBaseInfoForm.introducer = ''
      this.empBaseInfoForm.archivesStatus = ''
      this.empBaseInfoForm.archivesStatus = '0'
      this.empBaseInfoForm.bankName = ''
      this.empBaseInfoForm.bankNumb = ''
      this.empBaseInfoForm.insuranceType = ''
      this.empBaseInfoForm.socialNumb = ''
      this.empBaseInfoForm.family = ''
      this.empBaseInfoForm.handbookStatus = ''
      this.empBaseInfoForm.handbookStatus = '0'
      this.empBaseInfoForm.urgencyPhone = ''
      this.empBaseInfoForm.empCardStatus = ''
      this.empBaseInfoForm.empCardStatus = '0'
      this.empBaseInfoForm.certificateList = ''
      this.empBaseInfoForm.createTime = ''
      this.empBaseInfoForm.creator = ''
      this.empBaseInfoForm.modifyTime = ''
      this.empBaseInfoForm.modifier = ''
      this.empBaseInfoForm.delFlag = ''
      this.empBaseInfoForm.delFlag = '0'
      this.empBaseInfoForm.version = ''
      this.empBaseInfoForm.imagePath = ''
      this.empBaseInfoImageUrl = ''
      this.$nextTick(() => {
        this.$refs.empBaseInfoForm && this.$refs.empBaseInfoForm.clearValidate()
      })
    },
    putEmpBase(formName) {
      const validateRules = this.isAdd ? this.addRules : this.rules
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.submitEmpInfo()
        }
      }, validateRules)
      })
    },
    putEmpBaseContinue(formName) {
      const validateRules = this.isAdd ? this.addRules : this.rules
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.submitEmpInfo(true)
        }
      }, validateRules)
      })
    },
    submitEmpInfo(continueAdd = false) {
      if (this.isAdd) {