Bladeren bron

Merge branch 'iteration_0802' into test

lex-xin 3 jaren geleden
bovenliggende
commit
ce890ef633
1 gewijzigde bestanden met toevoegingen van 8 en 3 verwijderingen
  1. 8 3
      src/views/HumanResources/form.vue

+ 8 - 3
src/views/HumanResources/form.vue

@@ -549,6 +549,7 @@ export default {
         realName: '',
         resignationDate: '',
         subjectIdList: [],
+        jobSubjectIdList: [],
         wechatNo: '',
         organId: '',
         sourceFrom: '',
@@ -606,7 +607,8 @@ export default {
     updateData() {
       if (this.detail) {
         try {
-          this.detail.subjectIdList = this.detail.subjectIdList.split(',')
+          this.detail.subjectIdList = this.detail.subjectIdList ? this.detail.subjectIdList.split(',') : []
+          this.detail.jobSubjectIdList = this.detail.jobSubjectIdList ? this.detail.jobSubjectIdList.split(',') : []
         } catch (error) {}
         if (this.detail.organId === 0) {
           this.detail.organId = ''
@@ -624,10 +626,13 @@ export default {
           }
           this.form = {...this.form}
         } catch (error) {}
+
+        console.log(this.form)
       } else {
         this.form.educations = [{level: '', school: '', year: '', subject: ''}]
         this.form = {...this.form}
       }
+      
       this.$refs['ruleForm'].resetFields()
     },
     addEducation() {
@@ -644,9 +649,9 @@ export default {
         if (valid) {
           const { $message } = this
           this.form.educationalBackground = JSON.stringify(this.form.educations)
-          const {educations, subjectIdList, ...rest} = this.form
+          const {educations, subjectIdList, jobSubjectIdList, ...rest} = this.form
           if (this.detail && this.detail.id) {
-            employeeUpdate(Object.assign({id: this.detail.id, subjectIdList: (subjectIdList || []).join(',')}, rest))
+            employeeUpdate(Object.assign({id: this.detail.id, subjectIdList: (subjectIdList || []).join(','), jobSubjectIdList: (jobSubjectIdList || []).join(',')}, rest))
             .then(res => {
               if (res.code === 200) {
                 $message.success('修改成功')