Browse Source

修改 hr

wolyshaw 4 years ago
parent
commit
3b7cbd7037
3 changed files with 93 additions and 80 deletions
  1. 14 0
      src/utils/vueFilter.js
  2. 59 55
      src/views/HumanResources/form.vue
  3. 20 25
      src/views/HumanResources/index.vue

+ 14 - 0
src/utils/vueFilter.js

@@ -557,3 +557,17 @@ Vue.filter('visiterType', value => {
   }
   }
   return template[value]
   return template[value]
 })
 })
+
+// 人力资源人员状态
+
+Vue.filter('hrStatus', value => {
+  let template = {
+    'NOT_EMPLOYED': "未录用",
+    'INTERVIEWING': "面试中",
+    'RESERVE': "储备",
+    'PART_TIME': "全职",
+    'FULL_TIME': "兼职",
+    'DIMISSION': "离职",
+  }
+  return template[value]
+})

+ 59 - 55
src/views/HumanResources/form.vue

@@ -17,7 +17,7 @@
               <th class="description-label">手机号</th>
               <th class="description-label">手机号</th>
               <td class="description-content">
               <td class="description-content">
                 <el-form-item prop="mobileNo">
                 <el-form-item prop="mobileNo">
-                  <el-input size="mini" v-model="form.mobileNo" placeholder="请输入手机号"/>
+                  <el-input size="mini" minlength="11" maxlength="11" v-model="form.mobileNo" placeholder="请输入手机号"/>
                 </el-form-item>
                 </el-form-item>
               </td>
               </td>
               <th class="description-label">微信号</th>
               <th class="description-label">微信号</th>
@@ -80,12 +80,14 @@
               </td>
               </td>
               <th class="description-label">声部</th>
               <th class="description-label">声部</th>
               <td class="description-content">
               <td class="description-content">
-                <el-form-item prop="subjectId">
+                <el-form-item prop="subjectIdList">
                   <el-select
                   <el-select
-                    v-model.trim="form.subjectId"
+                    v-model.trim="form.subjectIdList"
                     clearable
                     clearable
                     filterable
                     filterable
+                    multiple
                     size="mini"
                     size="mini"
+                    collapse-tags
                     placeholder='请选择声部'
                     placeholder='请选择声部'
                   >
                   >
                     <el-option-group v-for="group in subjectList"
                     <el-option-group v-for="group in subjectList"
@@ -94,7 +96,7 @@
                       <el-option v-for="item in group.options"
                       <el-option v-for="item in group.options"
                                   :key="item.value"
                                   :key="item.value"
                                   :label="item.label"
                                   :label="item.label"
-                                  :value="item.value">
+                                  :value="String(item.value)">
                       </el-option>
                       </el-option>
                     </el-option-group>
                     </el-option-group>
                   </el-select>
                   </el-select>
@@ -102,18 +104,10 @@
               </td>
               </td>
             </tr>
             </tr>
             <tr class="description-tr">
             <tr class="description-tr">
-              <th class="description-label">是否经过评估</th>
+              <th class="description-label">评估结果</th>
               <td class="description-content">
               <td class="description-content">
-                <el-form-item prop="isInterviewed">
-                  <el-select size="mini" v-model.trim="form.isInterviewed"
-                              clearable
-                              filterable
-                              placeholder="请选择是否经过评估">
-                    <el-option label="是"
-                                :value="true"></el-option>
-                    <el-option label="否"
-                                :value="false"></el-option>
-                  </el-select>
+                <el-form-item prop="assessmentResult">
+                  <el-input size="mini" v-model.trim="form.assessmentResult" placeholder="请输入评估结果"/>
                 </el-form-item>
                 </el-form-item>
               </td>
               </td>
               <th class="description-label">信息来源</th>
               <th class="description-label">信息来源</th>
@@ -122,6 +116,7 @@
                   <el-select v-model.trim="form.sourceFrom"
                   <el-select v-model.trim="form.sourceFrom"
                               clearable
                               clearable
                               filterable
                               filterable
+                              size="mini"
                               placeholder="请选择信息来源">
                               placeholder="请选择信息来源">
                     <el-option label="BOSS"
                     <el-option label="BOSS"
                                 value="BOSS"></el-option>
                                 value="BOSS"></el-option>
@@ -198,37 +193,46 @@
             <tr class="description-tr">
             <tr class="description-tr">
               <th class="description-label">员工类型</th>
               <th class="description-label">员工类型</th>
               <td class="description-content">
               <td class="description-content">
-                <el-form-item prop="jobNature">
-                  <el-select size="mini" v-model.trim="form.jobNature"
+                <el-form-item prop="isProbationPeriod">
+                  <el-select size="mini" v-model.trim="form.isProbationPeriod"
                               clearable
                               clearable
                               filterable
                               filterable
                               placeholder="请选择员工类型">
                               placeholder="请选择员工类型">
-                    <el-option label="全职"
-                                value="FULL_TIME"></el-option>
-                    <el-option label="兼职"
-                                value="PART_TIME"></el-option>
-                    <el-option label="临时"
-                                value="TEMPORARY"></el-option>
+                    <el-option label="正式"
+                                :value="true"></el-option>
+                    <el-option label="试用"
+                                :value="false"></el-option>
                   </el-select>
                   </el-select>
                 </el-form-item>
                 </el-form-item>
               </td>
               </td>
-              <th class="description-label">员状态</th>
+              <th class="description-label">员状态</th>
               <td class="description-content">
               <td class="description-content">
-                <el-form-item prop="isProbationPeriod">
-                  <el-select size="mini" v-model.trim="form.isProbationPeriod"
+                <el-form-item prop="status">
+                  <el-select size="mini" v-model.trim="form.status"
                               clearable
                               clearable
                               filterable
                               filterable
-                              placeholder="请选择员工状态">
-                    <el-option label="正式"
-                                :value="true"></el-option>
-                    <el-option label="试用"
-                                :value="false"></el-option>
+                              placeholder="请选择人员状态">
+                    <el-option label="未录用"
+                                value="NOT_EMPLOYED"></el-option>
+                    <el-option label="面试中"
+                                value="INTERVIEWING"></el-option>
+                    <el-option label="储备"
+                                value="RESERVE"></el-option>
+                    <el-option label="全职"
+                                value="PART_TIME"></el-option>
+                    <el-option label="兼职"
+                                value="FULL_TIME"></el-option>
+                    <el-option label="离职"
+                                value="DIMISSION"></el-option>
                   </el-select>
                   </el-select>
                 </el-form-item>
                 </el-form-item>
               </td>
               </td>
               <th class="description-label">离职日期</th>
               <th class="description-label">离职日期</th>
               <td class="description-content">
               <td class="description-content">
-                <el-form-item prop="resignationDate">
+                <el-form-item
+                  prop="resignationDate"
+                  :rules="{ required: form.status === 'DIMISSION', message: '请选择离职日期', trigger: 'blur' }"
+                >
                   <el-date-picker
                   <el-date-picker
                     type="date"
                     type="date"
                     placeholder="选择离职日期"
                     placeholder="选择离职日期"
@@ -298,7 +302,7 @@
               <th class="description-label">紧急联系人电话</th>
               <th class="description-label">紧急联系人电话</th>
               <td class="description-content">
               <td class="description-content">
                 <el-form-item prop="emergencyContactPhone">
                 <el-form-item prop="emergencyContactPhone">
-                  <el-input size="mini" v-model.trim="form.emergencyContactPhone" placeholder="请输入紧急联系人电话"/>
+                  <el-input size="mini" v-model.trim="form.emergencyContactPhone" minlength="11" maxlength="11" placeholder="请输入紧急联系人电话"/>
                 </el-form-item>
                 </el-form-item>
               </td>
               </td>
             </tr>
             </tr>
@@ -340,16 +344,16 @@ export default {
         gender: true,
         gender: true,
         idCard: '',
         idCard: '',
         intentionCity: '',
         intentionCity: '',
-        isInterviewed: true,
-        isProbationPeriod: true,
-        jobNature: '',
+        assessmentResult: '',
+        status: '',
+        isProbationPeriod: '',
         liveCity: '',
         liveCity: '',
         mobileNo: '',
         mobileNo: '',
         otherComment: '',
         otherComment: '',
         position: '',
         position: '',
         realName: '',
         realName: '',
         resignationDate: '',
         resignationDate: '',
-        subjectId: '',
+        subjectIdList: [],
         wechatNo: '',
         wechatNo: '',
         organId: '',
         organId: '',
         sourceFrom: '',
         sourceFrom: '',
@@ -392,13 +396,10 @@ export default {
         intentionCity: [
         intentionCity: [
           { required: true, message: '请输入工作意向', trigger: 'blur' },
           { required: true, message: '请输入工作意向', trigger: 'blur' },
         ],
         ],
-        isInterviewed: [
-          { required: true, message: '请选择是否经过评估', trigger: 'blur' },
-        ],
-        isProbationPeriod: [
+        status: [
           { required: true, message: '请选择员工状态', trigger: 'blur' },
           { required: true, message: '请选择员工状态', trigger: 'blur' },
         ],
         ],
-        jobNature: [
+        isProbationPeriod: [
           { required: true, message: '请选择员工类型', trigger: 'blur' },
           { required: true, message: '请选择员工类型', trigger: 'blur' },
         ],
         ],
         liveCity: [
         liveCity: [
@@ -416,17 +417,14 @@ export default {
         realName: [
         realName: [
           { required: true, message: '请输入姓名', trigger: 'blur' },
           { required: true, message: '请输入姓名', trigger: 'blur' },
         ],
         ],
-        resignationDate: [
-          { required: true, message: '请选择离职日期', trigger: 'blur' },
-        ],
-        subjectId: [
+        subjectIdList: [
           { required: true, message: '请选择声部', trigger: 'blur' },
           { required: true, message: '请选择声部', trigger: 'blur' },
         ],
         ],
         organId: [
         organId: [
           { required: true, message: '请选择分部', trigger: 'blur' },
           { required: true, message: '请选择分部', trigger: 'blur' },
         ],
         ],
-        wechatNo: [
-          { required: true, message: '请输入微信号', trigger: 'blur' },
+        assessmentResult: [
+          { required: true, message: '请输入评估结果', trigger: 'blur' },
         ],
         ],
       }
       }
     }
     }
@@ -442,17 +440,23 @@ export default {
   methods: {
   methods: {
     updateData() {
     updateData() {
       if (this.detail) {
       if (this.detail) {
-        this.form = Object.assign({}, this.detail)
+        try {
+          this.detail.subjectIdList = this.detail.subjectIdList.split(',')
+        } catch (error) {}
+        this.form = Object.assign({
+          educations: [{level: '', school: '', year: ''}]
+        }, this.detail)
         try {
         try {
           this.form.educations = JSON.parse(this.detail.educationalBackground)
           this.form.educations = JSON.parse(this.detail.educationalBackground)
           if (this.form.educations.length < 1) {
           if (this.form.educations.length < 1) {
             this.form.educations = [{level: '', school: '', year: ''}]
             this.form.educations = [{level: '', school: '', year: ''}]
           }
           }
+          this.form = {...this.form}
         } catch (error) {}
         } catch (error) {}
       } else {
       } else {
         this.form.educations = [{level: '', school: '', year: ''}]
         this.form.educations = [{level: '', school: '', year: ''}]
+        this.form = {...this.form}
       }
       }
-      this.form = {...this.form}
     },
     },
     addEducation() {
     addEducation() {
       this.form.educations = [...this.form.educations, {level: '', school: '', year: ''}]
       this.form.educations = [...this.form.educations, {level: '', school: '', year: ''}]
@@ -467,10 +471,10 @@ export default {
       this.$refs['ruleForm'].validate(valid => {
       this.$refs['ruleForm'].validate(valid => {
         if (valid) {
         if (valid) {
           const { $message } = this
           const { $message } = this
-          const {educations, ...rest} = this.form
-          this.form.educationalBackground = JSON.stringify(educations)
-          if (this.detail) {
-            employeeUpdate(Object.assign({id: this.detail.id}, rest))
+          this.form.educationalBackground = JSON.stringify(this.form.educations)
+          const {educations, subjectIdList, ...rest} = this.form
+          if (this.detail && this.detail.id) {
+            employeeUpdate(Object.assign({id: this.detail.id, subjectIdList: (subjectIdList || []).join(',')}, rest))
             .then(res => {
             .then(res => {
               if (res.code === 200) {
               if (res.code === 200) {
                 $message.success('修改成功')
                 $message.success('修改成功')
@@ -479,7 +483,7 @@ export default {
               }
               }
             })
             })
           } else {
           } else {
-            employeeCreate(rest)
+            employeeCreate({subjectIdList: (subjectIdList || []).join(','), ...rest})
             .then(res => {
             .then(res => {
               if (res.code === 200) {
               if (res.code === 200) {
                 $message.success('创建成功')
                 $message.success('创建成功')

+ 20 - 25
src/views/HumanResources/index.vue

@@ -23,16 +23,22 @@
           </el-select>
           </el-select>
         </el-form-item>
         </el-form-item>
         <el-form-item>
         <el-form-item>
-          <el-select v-model.trim="searchForm.jobNature"
+          <el-select v-model.trim="searchForm.status"
                      clearable
                      clearable
                      filterable
                      filterable
-                     placeholder="请选择员工类型">
+                     placeholder="请选择人员状态">
+            <el-option label="未录用"
+                        value="NOT_EMPLOYED"></el-option>
+            <el-option label="面试中"
+                        value="INTERVIEWING"></el-option>
+            <el-option label="储备"
+                        value="RESERVE"></el-option>
             <el-option label="全职"
             <el-option label="全职"
-                       value="FULL_TIME"></el-option>
+                        value="PART_TIME"></el-option>
             <el-option label="兼职"
             <el-option label="兼职"
-                       value="PART_TIME"></el-option>
-            <el-option label="临时"
-                       value="TEMPORARY"></el-option>
+                        value="FULL_TIME"></el-option>
+            <el-option label="离职"
+                        value="DIMISSION"></el-option>
           </el-select>
           </el-select>
         </el-form-item>
         </el-form-item>
         <el-form-item>
         <el-form-item>
@@ -100,18 +106,10 @@
               <el-button @click="openEducation(scope.row)" type="text">查看学历</el-button>
               <el-button @click="openEducation(scope.row)" type="text">查看学历</el-button>
             </template>
             </template>
           </el-table-column>
           </el-table-column>
-          <el-table-column align="center" prop="subjectId" label="声部">
-            <template slot-scope="scope">
-              {{ subjectListObj[scope.row.subjectId] }}
-            </template>
-          </el-table-column>
+          <el-table-column align="center" prop="subjectName" label="声部"></el-table-column>
           <el-table-column align="center" prop="liveCity" label="所在城市"></el-table-column>
           <el-table-column align="center" prop="liveCity" label="所在城市"></el-table-column>
           <el-table-column align="center" prop="intentionCity" label="工作意向"></el-table-column>
           <el-table-column align="center" prop="intentionCity" label="工作意向"></el-table-column>
-          <el-table-column align="center" prop="isInterviewed" label="是否经过评估">
-            <template slot-scope="scope">
-              {{ scope.row.gender ? '是' : '否' }}
-            </template>
-          </el-table-column>
+          <el-table-column align="center" prop="assessmentResult" label="评估结果"></el-table-column>
           <el-table-column align="center" prop="otherComment" label="其它综合情况"></el-table-column>
           <el-table-column align="center" prop="otherComment" label="其它综合情况"></el-table-column>
           <el-table-column align="center" prop="sourceFrom" label="信息来源"></el-table-column>
           <el-table-column align="center" prop="sourceFrom" label="信息来源"></el-table-column>
           <el-table-column align="center" prop="entryDate" label="入职时间">
           <el-table-column align="center" prop="entryDate" label="入职时间">
@@ -124,19 +122,15 @@
               {{ scope.row.position | jobType }}
               {{ scope.row.position | jobType }}
             </template>
             </template>
           </el-table-column>
           </el-table-column>
-          <el-table-column align="center" prop="organId" label="分部">
-            <template slot-scope="scope">
-              {{ organListObj[scope.row.organId] }}
-            </template>
-          </el-table-column>
-          <el-table-column align="center" prop="jobNature" label="员工类型">
+          <el-table-column align="center" prop="organName" label="分部"></el-table-column>
+          <el-table-column align="center" prop="isProbationPeriod" label="员工类型">
             <template slot-scope="scope">
             <template slot-scope="scope">
-              {{ scope.row.jobNature | jobNature }}
+              {{ scope.row.gender ? '正式' : '试用' }}
             </template>
             </template>
           </el-table-column>
           </el-table-column>
-          <el-table-column align="center" prop="isProbationPeriod" label="员工状态">
+          <el-table-column align="center" prop="status" label="人员状态">
             <template slot-scope="scope">
             <template slot-scope="scope">
-              {{ scope.row.isProbationPeriod ? '正式' : '试用' }}
+              {{ scope.row.status | hrStatus }}
             </template>
             </template>
           </el-table-column>
           </el-table-column>
           <el-table-column align="center" prop="idCard" label="证件号码"></el-table-column>
           <el-table-column align="center" prop="idCard" label="证件号码"></el-table-column>
@@ -152,6 +146,7 @@
           <el-table-column align="center" prop="emergencyContactRelation" label="紧急联系人关系"></el-table-column>
           <el-table-column align="center" prop="emergencyContactRelation" label="紧急联系人关系"></el-table-column>
           <el-table-column align="center" prop="emergencyContactPhone" label="紧急联系人电话"></el-table-column>
           <el-table-column align="center" prop="emergencyContactPhone" label="紧急联系人电话"></el-table-column>
           <el-table-column align="center" prop="updateTime" label="最后一次操作时间时间"></el-table-column>
           <el-table-column align="center" prop="updateTime" label="最后一次操作时间时间"></el-table-column>
+          <el-table-column align="center" prop="operatorName" label="归属管理HR"></el-table-column>
           <el-table-column align="center" prop="resignationDate" label="离职时间">
           <el-table-column align="center" prop="resignationDate" label="离职时间">
             <template slot-scope="scope">
             <template slot-scope="scope">
               {{ scope.row.resignationDate | dayjsFormat}}
               {{ scope.row.resignationDate | dayjsFormat}}