浏览代码

修改人事管理的排序

余思翰 10 个月前
父节点
当前提交
455ab17067

+ 1
- 1
oa-ui/src/views/flowable/form/components/print/borrowPrint.vue 查看文件

157
                 签名:<span class="auditor">{{ getUserName(form.cwUserId) }}</span>
157
                 签名:<span class="auditor">{{ getUserName(form.cwUserId) }}</span>
158
               </el-col>
158
               </el-col>
159
               <el-col :span="6">
159
               <el-col :span="6">
160
-                支付日期:<span>{{ form.cwTime }}</span>
160
+                支付日期:<span>{{ form.lendTime }}</span>
161
               </el-col>
161
               </el-col>
162
             </el-row>
162
             </el-row>
163
           </td>
163
           </td>

+ 41
- 19
oa-ui/src/views/oa/staff/index.vue 查看文件

72
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
72
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
73
         </el-row>
73
         </el-row>
74
 
74
 
75
-        <el-table v-loading="loading" border :data="userList" @selection-change="handleSelectionChange">
75
+        <el-table v-loading="loading" border :data="userList" @selection-change="handleSelectionChange"
76
+          @sort-change="handleSortChange">
76
           <el-table-column type="selection" width="50" align="center" />
77
           <el-table-column type="selection" width="50" align="center" />
77
           <el-table-column label="序号" width="50" align="center" prop="userId">
78
           <el-table-column label="序号" width="50" align="center" prop="userId">
78
             <template slot-scope="scope">
79
             <template slot-scope="scope">
89
             </template>
90
             </template>
90
           </el-table-column>
91
           </el-table-column>
91
           <el-table-column label="性别" align="center" key="sex" prop="sex" v-if="columns[2].visible"
92
           <el-table-column label="性别" align="center" key="sex" prop="sex" v-if="columns[2].visible"
92
-            :show-overflow-tooltip="true">
93
+            :show-overflow-tooltip="true" sortable>
93
             <template slot-scope="scope">
94
             <template slot-scope="scope">
94
               {{ scope.row.sex == 0 ? '男' : '女' }}
95
               {{ scope.row.sex == 0 ? '男' : '女' }}
95
             </template>
96
             </template>
97
           <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[3].visible"
98
           <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[3].visible"
98
             width="120" />
99
             width="120" />
99
           <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[4].visible"
100
           <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[4].visible"
100
-            :show-overflow-tooltip="true" />
101
+            :show-overflow-tooltip="true" sortable />
101
           <el-table-column label="岗级" align="center" key="postLevel" v-if="columns[5].visible"
102
           <el-table-column label="岗级" align="center" key="postLevel" v-if="columns[5].visible"
102
             :show-overflow-tooltip="true" sortable :sort-method="sortPostLevel">
103
             :show-overflow-tooltip="true" sortable :sort-method="sortPostLevel">
103
             <template slot-scope="scope">
104
             <template slot-scope="scope">
105
       selectDictLabel(dict.type.sys_user_salarylevel, scope.row.salaryLevel) }}
106
       selectDictLabel(dict.type.sys_user_salarylevel, scope.row.salaryLevel) }}
106
             </template>
107
             </template>
107
           </el-table-column>
108
           </el-table-column>
108
-          <el-table-column label="职务" align="center" key="postName" prop="postName" v-if="columns[17].visible"
109
+          <el-table-column label="职务" align="center" key="postNames" prop="postNames" v-if="columns[17].visible"
109
             :show-overflow-tooltip="true"></el-table-column>
110
             :show-overflow-tooltip="true"></el-table-column>
110
           <el-table-column label="职称" align="center" key="titles" prop="titles" v-if="columns[6].visible"
111
           <el-table-column label="职称" align="center" key="titles" prop="titles" v-if="columns[6].visible"
111
             :show-overflow-tooltip="true" sortable :sort-method="sortTitles">
112
             :show-overflow-tooltip="true" sortable :sort-method="sortTitles">
114
             </template>
115
             </template>
115
           </el-table-column>
116
           </el-table-column>
116
           <el-table-column label="毕业院校" align="center" key="graduateSchool" prop="graduateSchool"
117
           <el-table-column label="毕业院校" align="center" key="graduateSchool" prop="graduateSchool"
117
-            v-if="columns[10].visible" />
118
+            v-if="columns[10].visible" sortable="custom" />
118
           <el-table-column label="专业" align="center" key="major" prop="major" v-if="columns[11].visible" />
119
           <el-table-column label="专业" align="center" key="major" prop="major" v-if="columns[11].visible" />
119
           <el-table-column label="学历" align="center" key="degree" prop="degree" :formatter="formatterDegree"
120
           <el-table-column label="学历" align="center" key="degree" prop="degree" :formatter="formatterDegree"
120
             v-if="columns[12].visible" />
121
             v-if="columns[12].visible" />
121
           <el-table-column label="籍贯" align="center" key="nativePlace" prop="nativePlace" v-if="columns[13].visible" />
122
           <el-table-column label="籍贯" align="center" key="nativePlace" prop="nativePlace" v-if="columns[13].visible" />
122
           <el-table-column label="政治面貌" align="center" key="politicalAffiliation"
123
           <el-table-column label="政治面貌" align="center" key="politicalAffiliation"
123
             :formatter="formatterPoliticalAffiliation" prop="politicalAffiliation" v-if="columns[14].visible" />
124
             :formatter="formatterPoliticalAffiliation" prop="politicalAffiliation" v-if="columns[14].visible" />
124
-          <el-table-column label="民族" align="center" key="ethnic" prop="ethnic" v-if="columns[15].visible" />
125
-          <el-table-column label="入职时间" sortable align="center" key="entryDate" prop="entryDate" v-if="columns[16].visible"
126
-            :show-overflow-tooltip="true">
125
+          <el-table-column label="民族" align="center" key="ethnic" prop="ethnic" v-if="columns[15].visible" sortable />
126
+          <el-table-column label="入职时间" sortable align="center" key="entryDate" prop="entryDate"
127
+            v-if="columns[16].visible" :show-overflow-tooltip="true">
127
             <template slot-scope="scope">
128
             <template slot-scope="scope">
128
               <span>{{ parseTime(scope.row.entryDate, '{y}-{m}-{d}') }}</span>
129
               <span>{{ parseTime(scope.row.entryDate, '{y}-{m}-{d}') }}</span>
129
             </template>
130
             </template>
130
           </el-table-column>
131
           </el-table-column>
131
           <el-table-column label="合同签订" align="center" key="contractSign" prop="contractSign" v-if="columns[7].visible"
132
           <el-table-column label="合同签订" align="center" key="contractSign" prop="contractSign" v-if="columns[7].visible"
132
-            :show-overflow-tooltip="true">
133
+            :show-overflow-tooltip="true" sortable>
133
             <template slot-scope="scope">
134
             <template slot-scope="scope">
134
               <span>{{ parseTime(scope.row.contractSign, '{y}-{m}-{d}') }}</span>
135
               <span>{{ parseTime(scope.row.contractSign, '{y}-{m}-{d}') }}</span>
135
             </template>
136
             </template>
136
           </el-table-column>
137
           </el-table-column>
137
           <el-table-column label="合同期满" align="center" key="contractExpire" prop="contractExpire"
138
           <el-table-column label="合同期满" align="center" key="contractExpire" prop="contractExpire"
138
-            v-if="columns[8].visible" :show-overflow-tooltip="true">
139
+            v-if="columns[8].visible" :show-overflow-tooltip="true" sortable>
139
             <template slot-scope="scope">
140
             <template slot-scope="scope">
140
               <span>{{ parseTime(scope.row.contractExpire, '{y}-{m}-{d}') }}</span>
141
               <span>{{ parseTime(scope.row.contractExpire, '{y}-{m}-{d}') }}</span>
141
             </template>
142
             </template>
142
           </el-table-column>
143
           </el-table-column>
143
-          <!-- <el-table-column label="间接成本(天)" align="center" key="salary" prop="salary.salary" :show-overflow-tooltip="true">
144
-          <template slot-scope="scope">
145
-            {{ scope.row.salary ? scope.row.salary.salary : "" }}
146
-          </template>
147
-        </el-table-column> -->
148
-          <el-table-column label="状态" align="center" key="status" v-if="columns[9].visible">
144
+          <el-table-column label="状态" align="center" key="status" v-if="columns[9].visible" sortable
145
+            :sort-method="sortStatus">
149
             <template slot-scope="scope">
146
             <template slot-scope="scope">
150
               <el-tag type="success" v-if="scope.row.status == 0">在职</el-tag>
147
               <el-tag type="success" v-if="scope.row.status == 0">在职</el-tag>
151
               <el-tag type="danger" v-if="scope.row.status == 1">离职</el-tag>
148
               <el-tag type="danger" v-if="scope.row.status == 1">离职</el-tag>
152
               <el-tag type="warning" v-if="scope.row.status == 2">退休</el-tag>
149
               <el-tag type="warning" v-if="scope.row.status == 2">退休</el-tag>
153
               <el-tag type="primary" v-if="scope.row.status == 3">试用</el-tag>
150
               <el-tag type="primary" v-if="scope.row.status == 3">试用</el-tag>
154
-              <!-- <el-switch v-model="scope.row.status" active-value="0" inactive-value="1"
155
-              @change="handleStatusChange(scope.row)"></el-switch> -->
151
+              <el-tag type="info" v-if="scope.row.status == 4">返聘</el-tag>
156
             </template>
152
             </template>
157
           </el-table-column>
153
           </el-table-column>
158
 
154
 
351
 import { getToken } from "@/utils/auth";
347
 import { getToken } from "@/utils/auth";
352
 import Treeselect from "@riophae/vue-treeselect";
348
 import Treeselect from "@riophae/vue-treeselect";
353
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
349
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
354
-import { number } from 'echarts';
355
 
350
 
356
 export default {
351
 export default {
357
   name: "Staff",
352
   name: "Staff",
486
     }
481
     }
487
   },
482
   },
488
   created() {
483
   created() {
484
+    console.log(this.dict.type.sys_post_status);
489
     this.getList();
485
     this.getList();
490
     this.getDeptTree();
486
     this.getDeptTree();
491
     this.getConfigKey("sys.user.initPassword").then(response => {
487
     this.getConfigKey("sys.user.initPassword").then(response => {
806
       }
802
       }
807
       return newStr
803
       return newStr
808
     },
804
     },
805
+    handleSortChange({ prop, order }) {
806
+      if (prop == 'graduateSchool') {
807
+        // 自定义排序  
808
+        this.userList.sort((a, b) => {
809
+          let valueA = a[prop];
810
+          let valueB = b[prop];
811
+          // 检查值是否为字符串,如果不是,则将其视为空字符串(或根据需要处理)  
812
+          if (typeof valueA !== 'string') valueA = '';
813
+          if (typeof valueB !== 'string') valueB = '';
814
+
815
+          if (order === 'ascending') {
816
+            return valueA.localeCompare(valueB, 'zh-Hans-CN', { sensitivity: 'base' });
817
+          } else if (order === 'descending') {
818
+            return valueB.localeCompare(valueA, 'zh-Hans-CN', { sensitivity: 'base' });
819
+          }
820
+          return 0; // 如果没有指定排序顺序,则不改变数组顺序  
821
+        });
822
+      }
823
+    },
809
     sortAge(a, b) {
824
     sortAge(a, b) {
810
       return this.getAgeByIdCard(a.idCard) - this.getAgeByIdCard(b.idCard);
825
       return this.getAgeByIdCard(a.idCard) - this.getAgeByIdCard(b.idCard);
811
     },
826
     },
832
     sortTitles(a, b) {
847
     sortTitles(a, b) {
833
       let res = Number(b.titles) - Number(a.titles)
848
       let res = Number(b.titles) - Number(a.titles)
834
       return res
849
       return res
850
+    },
851
+    sortStatus(a, b) {
852
+      let res = Number(a.status) - Number(b.status)
853
+      return res
854
+    },
855
+    sortGraduateSchool(a, b) {
856
+
835
     },
857
     },
836
     formatterDegree(row) {
858
     formatterDegree(row) {
837
       let v = this.selectDictLabel(this.dict.type.sys_user_degree, row.degree)
859
       let v = this.selectDictLabel(this.dict.type.sys_user_degree, row.degree)

+ 8
- 12
oa-ui/src/views/oa/staff/info.vue 查看文件

1
 <!--
1
 <!--
2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-03-22 14:50:46
3
  * @Date: 2024-03-22 14:50:46
4
- * @LastEditors: wrh
5
- * @LastEditTime: 2024-07-25 15:21:12
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-08-08 10:42:03
6
 -->
6
 -->
7
 <template>
7
 <template>
8
   <div class="bg" v-loading="loading">
8
   <div class="bg" v-loading="loading">
22
           </div>
22
           </div>
23
           <div class="user-name">{{ form.nickName }}</div>
23
           <div class="user-name">{{ form.nickName }}</div>
24
           <div class="user-sex">
24
           <div class="user-sex">
25
-            {{ getAgeByIdCard(form.idCard) + '岁' }} {{ form.sex == '0' ? ' 男' : ' 女' }}
26
-            <el-tag :type="form.status == '在职' ? 'success' : 'warning'">{{ form.status }}</el-tag>
25
+            <span class="mr10">{{ getAgeByIdCard(form.idCard) + '岁' }} {{ form.sex == '0' ? ' 男' : ' 女' }}</span>
26
+            <el-tag type="success" v-if="form.status == '0'">在职</el-tag>
27
+            <el-tag type="danger" v-if="form.status == '1'">离职</el-tag>
28
+            <el-tag type="warning" v-if="form.status == '2'">退休</el-tag>
29
+            <el-tag type="primary" v-if="form.status == '3'">试用</el-tag>
30
+            <el-tag type="info" v-if="form.status == '4'">返聘</el-tag>
27
           </div>
31
           </div>
28
         </div>
32
         </div>
29
         <div class="info-item">
33
         <div class="info-item">
225
         }
229
         }
226
       }
230
       }
227
       this.postData = postArr.join('/')
231
       this.postData = postArr.join('/')
228
-
229
-      if (this.form.status == '0') {
230
-        this.form.status = '在职'
231
-      } else if (this.form.status == '1') {
232
-        this.form.status = '离职'
233
-      } else {
234
-        this.form.status = '退休'
235
-      }
236
     },
232
     },
237
     handleClick() {
233
     handleClick() {
238
 
234
 

正在加载...
取消
保存