From 731b5ead2f69151e8c53906068de13b4a4acaf07 Mon Sep 17 00:00:00 2001
From: luoyb <412940104@qq.com>
Date: 星期六, 06 四月 2024 10:57:38 +0800
Subject: [PATCH] feat: 打开档案时增加了部门选择

---
 src/views/user/outemployess.vue |  128 +++++++++++++++++++++++++++++++-----------
 1 files changed, 95 insertions(+), 33 deletions(-)

diff --git a/src/views/user/outemployess.vue b/src/views/user/outemployess.vue
index d6900cf..a77365d 100644
--- a/src/views/user/outemployess.vue
+++ b/src/views/user/outemployess.vue
@@ -143,7 +143,7 @@
                     </td>
                   </tr>
                   <tr>
-                    <td class="td">保险类型:</td>
+                    <td class="td">社保档位:</td>
                     <td class="td-group">
                       <el-checkbox-group v-model="queryParams.insuranceType" class="fj-checkbox">
                         <el-checkbox label="" @change="selectAllInsuranceType">全部</el-checkbox>
@@ -183,13 +183,22 @@
                         <el-checkbox :label="1">合同期满</el-checkbox>
                         <el-checkbox :label="3">公司辞退</el-checkbox>
                         <el-checkbox :label="5">试用期内</el-checkbox>
-                        <!--                        <el-checkbox-->
-                        <!--                          v-for="data in dimissionTypeOptions"-->
-                        <!--                          :key="data.dicItemName"-->
-                        <!--                          :label="data.dicItemCode"-->
-                        <!--                        >-->
-                        <!--                          {{ data.dicItemName }}-->
-                        <!--                        </el-checkbox>-->
+                        <el-checkbox :label="7">到龄退休</el-checkbox>
+                      </el-checkbox-group>
+                    </td>
+                  </tr>
+                  <tr>
+                    <td class="td">相关证件:</td>
+                    <td class="td-group">
+                      <el-checkbox-group v-model="queryParams.certificateList" class="fj-checkbox">
+                        <el-checkbox label="" @change="selectAllCertificateList">全部</el-checkbox>
+                        <el-checkbox
+                          v-for="data in certificateListOptions"
+                          :key="data.dicItemName"
+                          :label="data.dicItemCode"
+                        >
+                          {{ data.dicItemName }}
+                        </el-checkbox>
                       </el-checkbox-group>
                     </td>
                   </tr>
@@ -253,15 +262,15 @@
               >编辑</span> -->
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip="true" prop="empNumb" label="编号" width="80" sortable="custom" :sort-orders="['ascending', 'descending']" />
-          <el-table-column show-overflow-tooltip="true" prop="allDeptName" label="部门(护卫点)" width="280" sortable="custom" :sort-orders="['ascending', 'descending']" />
-          <el-table-column show-overflow-tooltip="true" prop="jobName" label="岗位" width="80" />
-          <el-table-column show-overflow-tooltip="true" prop="empName" label="姓名" width="80" sortable="custom" :sort-orders="['ascending', 'descending']" />
-          <el-table-column show-overflow-tooltip="true" prop="certificateNumb" label="身份证号码" width="160" sortable="custom" :sort-orders="['ascending', 'descending']" />
-          <el-table-column show-overflow-tooltip="true" prop="sex" label="性别" width="50" :formatter="sexFormat" />
-          <el-table-column show-overflow-tooltip="true" prop="age" label="年龄" width="80" sortable="custom" :sort-orders="['ascending', 'descending']" />
+          <el-table-column show-overflow-tooltip prop="empNumb" label="编号" width="80" sortable="custom" :sort-orders="['ascending', 'descending']" />
+          <el-table-column show-overflow-tooltip prop="allDeptName" label="部门(护卫点)" width="280" sortable="custom" :sort-orders="['ascending', 'descending']" />
+          <el-table-column show-overflow-tooltip prop="jobName" label="岗位" width="80" />
+          <el-table-column show-overflow-tooltip prop="empName" label="姓名" width="80" sortable="custom" :sort-orders="['ascending', 'descending']" />
+          <el-table-column show-overflow-tooltip prop="certificateNumb" label="身份证号码" width="160" sortable="custom" :sort-orders="['ascending', 'descending']" />
+          <el-table-column show-overflow-tooltip prop="sex" label="性别" width="50" :formatter="sexFormat" />
+          <el-table-column show-overflow-tooltip prop="age" label="年龄" width="80" sortable="custom" :sort-orders="['ascending', 'descending']" />
           <el-table-column
-            show-overflow-tooltip="true"
+            show-overflow-tooltip
             prop="education"
             label="学历"
             width="60"
@@ -269,18 +278,18 @@
             ortable="custom"
             :sort-orders="['ascending', 'descending']"
           />
-          <el-table-column show-overflow-tooltip="true" prop="nativePlaceName" label="籍贯" width="70" />
-          <el-table-column show-overflow-tooltip="true" prop="telePhone" label="联系电话" width="110" />
+          <el-table-column show-overflow-tooltip prop="nativePlaceName" label="籍贯" width="70" />
+          <el-table-column show-overflow-tooltip prop="telePhone" label="联系电话" width="110" />
           <el-table-column
-            show-overflow-tooltip="true"
+            show-overflow-tooltip
             prop="empType"
             label="员工类型"
             width="80"
             :formatter="empTypeFormat"
           />
-          <el-table-column show-overflow-tooltip="true" prop="entryDate" label="入职日期" width="110" sortable="custom" :sort-orders="['ascending', 'descending']" />
-          <el-table-column show-overflow-tooltip="true" prop="dimissionDate" label="离职日期" width="110" sortable="custom" :sort-orders="['ascending', 'descending']" />
-          <el-table-column show-overflow-tooltip="true" prop="empStatus" label="员工状态" width="80">
+          <el-table-column show-overflow-tooltip prop="entryDate" label="入职日期" width="110" sortable="custom" :sort-orders="['ascending', 'descending']" />
+          <el-table-column show-overflow-tooltip prop="dimissionDate" label="离职日期" width="110" sortable="custom" :sort-orders="['ascending', 'descending']" />
+          <el-table-column show-overflow-tooltip prop="empStatus" label="员工状态" width="80">
             <template slot-scope="{row}">
               {{ transEmpStatus(row.empStatus) }}
             </template>
@@ -416,7 +425,7 @@
               <tr>
                 <td>入职日期</td>
                 <td>2020-01-02</td>
-                <td>保险类型</td>
+                <td>社保档位</td>
                 <td>深户(五险一档)</td>
                 <td>社保电脑号</td>
                 <td />
@@ -430,9 +439,9 @@
                 <td>已发</td>
               </tr>
               <tr>
-                <td>家庭成员及关系</td>
+                <td>家庭成员及关系1</td>
                 <td />
-                <td>紧急联系电话</td>
+                <td>家庭成员及关系2</td>
                 <td />
                 <td>员工手册</td>
                 <td>已发</td>
@@ -1004,6 +1013,17 @@
                 placeholder="选择打开日期"
               />
             </el-form-item>
+            <el-form-item label="部门(护卫点)" required message="请选择部门(护卫点)" prop="allDeptName">
+              <treeselect
+                v-model="baseicInformationForm.deptId"
+                :multiple="false"
+                :options="depts"
+                :clear-value-text="$t('common.clear')"
+                placeholder="请选择部门(护卫点)"
+                style="width:100%"
+                @select="DeptNameSelect"
+              />
+            </el-form-item>
             <el-form-item label="备注说明">
               <el-input v-model="baseicInformationForm.remark" type="textarea" :rows="4" />
             </el-form-item>
@@ -1144,7 +1164,7 @@
             </td>
           </tr>
           <tr>
-            <td>家庭成员及关系</td>
+            <td>家庭成员及关系1</td>
             <td>
               <el-checkbox label="family"><span /></el-checkbox>
             </td>
@@ -1162,7 +1182,7 @@
             <td>
               <el-checkbox label="entryDate"><span /></el-checkbox>
             </td>
-            <td>保险类型</td>
+            <td>社保档位</td>
             <td>
               <el-checkbox label="insuranceTypeName"><span /></el-checkbox>
             </td>
@@ -1188,9 +1208,9 @@
           <tr>
             <td>相关证件</td>
             <td>
-              <el-checkbox label="certificateList"><span /></el-checkbox>
+              <el-checkbox label="certificateListName"><span /></el-checkbox>
             </td>
-            <td>紧急联系电话</td>
+            <td>家庭成员及关系2</td>
             <td>
               <el-checkbox label="urgencyPhone"><span /></el-checkbox>
             </td>
@@ -1207,6 +1227,10 @@
             <td>离职类型</td>
             <td>
               <el-checkbox label="dimissionTypeName"><span /></el-checkbox>
+            </td>
+            <td>编号</td>
+            <td>
+              <el-checkbox label="empNumb"><span /></el-checkbox>
             </td>
           </tr>
         </el-checkbox-group>
@@ -1228,9 +1252,11 @@
 <script>
 import Pagination from '@/components/Pagination'
 import ArchivesChange from './archivesChange'
+import Treeselect from '@riophae/vue-treeselect'
 
 export default {
   components: {
+    Treeselect,
     ArchivesChange,
     Pagination
   },
@@ -1254,13 +1280,15 @@
         insuranceType: [],
         empStatus: [],
         dimissionType: [],
-        empType: []
+        empType: [],
+        certificateList: []
       }, // 查询参数
       sort: {}, // 排序
       pagination: { // 分页参数
         size: 15,
         num: 1
       },
+      depts: [],
       headerHeight: '30px',
       advancedQueryShow: false,
       dialogTableVisible: false,
@@ -1284,7 +1312,7 @@
       archivesStatusOptions: [],
       sexOptions: [],
       empTypeOptions: [],
-      cityOptions: ['archivesNumb', 'allDeptName', 'jobName', 'empName', 'certificateNumb', 'certificateValidity', 'sexName', 'nationName', 'age', 'marriageName', 'stature', 'birthdate', 'politicsName', 'empTypeName', 'educationName', 'nativePlaceName', 'censusAddress', 'currentAddress', 'guardNumb', 'returnReceipt', 'archivesStatusName', 'bankName', 'bankNumb', 'telePhone', 'entryDate', 'insuranceTypeName', 'socialNumb', 'introducer', 'seniority', 'empCardStatusName', 'certificateList', 'urgencyPhone', 'handbookStatusName', 'family', 'empStatusName', 'dimissionDate', 'entryTypeName', 'dimissionTypeName'],
+      cityOptions: ['archivesNumb', 'allDeptName', 'jobName', 'empName', 'certificateNumb', 'certificateValidity', 'sexName', 'nationName', 'age', 'marriageName', 'stature', 'birthdate', 'politicsName', 'empTypeName', 'educationName', 'nativePlaceName', 'censusAddress', 'currentAddress', 'guardNumb', 'returnReceipt', 'archivesStatusName', 'bankName', 'bankNumb', 'telePhone', 'entryDate', 'insuranceTypeName', 'socialNumb', 'introducer', 'seniority', 'empCardStatusName', 'certificateListName', 'urgencyPhone', 'handbookStatusName', 'family', 'empStatusName', 'dimissionDate', 'entryTypeName', 'dimissionTypeName', 'empNumb'],
       checkedCities: []
     }
   },
@@ -1311,8 +1339,29 @@
     this.getDicts('EMPTYPE').then(response => {
       this.empTypeOptions = response.data
     })
+    this.getDicts('certificateList').then(response => {
+      this.certificateListOptions = response.data
+    })
+    this.initDept()
   },
   methods: {
+    initDept() {
+      this.$get('system/dept').then((r) => {
+        this.depts = r.data.data.rows
+        this.deptTree = this.depts
+      }).catch((error) => {
+        console.error(error)
+        this.$message({
+          message: this.$t('tips.getDataFail'),
+          type: 'error'
+        })
+      })
+    },
+    DeptNameSelect(val) {
+      this.baseicInformationForm.deptId = val.deptId
+      this.baseicInformationForm.deptName = val.label
+      this.baseicInformationForm.allDeptName = val.allDeptName
+    },
     exportExcel() {
       this.queryParams.baseKey = this.queryParams.vague
       var params = this.queryParams
@@ -1495,6 +1544,9 @@
             var id = selection[0].empId
             var name = selection[0].empName
             var number = selection[0].certificateNumb
+            var deptName = selection[0].deptName
+            var deptId = selection[0].deptId
+            var allDeptName = selection[0].allDeptName
             const nowDate = new Date()
             const year = nowDate.getFullYear()
             const month = nowDate.getMonth() + 1
@@ -1503,9 +1555,12 @@
               empId: id,
               empName: name,
               certificateNumb: number,
-              openType: 5,
+              openType: 21,
               openDate: year + '-' + month + '-' + day,
-              remark: ''
+              remark: '',
+              deptId: deptId,
+              deptName: deptName,
+              allDeptName: allDeptName
             }
             this.dialogShowDkda = true
           } else {
@@ -1641,6 +1696,13 @@
       this.checkedCities = val ? this.cityOptions : []
       this.isIndeterminate = false
     },
+    selectAllCertificateList(val) {
+      if (val) {
+        this.queryParams.certificateList = this.dicListToArr(this.certificateListOptions)
+      } else {
+        this.queryParams.certificateList = []
+      }
+    },
     showDcyg(operate) {
       switch (operate) {
         case 0:

--
Gitblit v1.8.0