Explorar el Código

修改人事管理的排序

余思翰 hace 10 meses
padre
commit
455ab17067

+ 1
- 1
oa-ui/src/views/flowable/form/components/print/borrowPrint.vue Ver fichero

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

+ 41
- 19
oa-ui/src/views/oa/staff/index.vue Ver fichero

@@ -72,7 +72,8 @@
72 72
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
73 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 77
           <el-table-column type="selection" width="50" align="center" />
77 78
           <el-table-column label="序号" width="50" align="center" prop="userId">
78 79
             <template slot-scope="scope">
@@ -89,7 +90,7 @@
89 90
             </template>
90 91
           </el-table-column>
91 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 94
             <template slot-scope="scope">
94 95
               {{ scope.row.sex == 0 ? '男' : '女' }}
95 96
             </template>
@@ -97,7 +98,7 @@
97 98
           <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[3].visible"
98 99
             width="120" />
99 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 102
           <el-table-column label="岗级" align="center" key="postLevel" v-if="columns[5].visible"
102 103
             :show-overflow-tooltip="true" sortable :sort-method="sortPostLevel">
103 104
             <template slot-scope="scope">
@@ -105,7 +106,7 @@
105 106
       selectDictLabel(dict.type.sys_user_salarylevel, scope.row.salaryLevel) }}
106 107
             </template>
107 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 110
             :show-overflow-tooltip="true"></el-table-column>
110 111
           <el-table-column label="职称" align="center" key="titles" prop="titles" v-if="columns[6].visible"
111 112
             :show-overflow-tooltip="true" sortable :sort-method="sortTitles">
@@ -114,45 +115,40 @@
114 115
             </template>
115 116
           </el-table-column>
116 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 119
           <el-table-column label="专业" align="center" key="major" prop="major" v-if="columns[11].visible" />
119 120
           <el-table-column label="学历" align="center" key="degree" prop="degree" :formatter="formatterDegree"
120 121
             v-if="columns[12].visible" />
121 122
           <el-table-column label="籍贯" align="center" key="nativePlace" prop="nativePlace" v-if="columns[13].visible" />
122 123
           <el-table-column label="政治面貌" align="center" key="politicalAffiliation"
123 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 128
             <template slot-scope="scope">
128 129
               <span>{{ parseTime(scope.row.entryDate, '{y}-{m}-{d}') }}</span>
129 130
             </template>
130 131
           </el-table-column>
131 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 134
             <template slot-scope="scope">
134 135
               <span>{{ parseTime(scope.row.contractSign, '{y}-{m}-{d}') }}</span>
135 136
             </template>
136 137
           </el-table-column>
137 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 140
             <template slot-scope="scope">
140 141
               <span>{{ parseTime(scope.row.contractExpire, '{y}-{m}-{d}') }}</span>
141 142
             </template>
142 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 146
             <template slot-scope="scope">
150 147
               <el-tag type="success" v-if="scope.row.status == 0">在职</el-tag>
151 148
               <el-tag type="danger" v-if="scope.row.status == 1">离职</el-tag>
152 149
               <el-tag type="warning" v-if="scope.row.status == 2">退休</el-tag>
153 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 152
             </template>
157 153
           </el-table-column>
158 154
 
@@ -351,7 +347,6 @@ import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUs
351 347
 import { getToken } from "@/utils/auth";
352 348
 import Treeselect from "@riophae/vue-treeselect";
353 349
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
354
-import { number } from 'echarts';
355 350
 
356 351
 export default {
357 352
   name: "Staff",
@@ -486,6 +481,7 @@ export default {
486 481
     }
487 482
   },
488 483
   created() {
484
+    console.log(this.dict.type.sys_post_status);
489 485
     this.getList();
490 486
     this.getDeptTree();
491 487
     this.getConfigKey("sys.user.initPassword").then(response => {
@@ -806,6 +802,25 @@ export default {
806 802
       }
807 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 824
     sortAge(a, b) {
810 825
       return this.getAgeByIdCard(a.idCard) - this.getAgeByIdCard(b.idCard);
811 826
     },
@@ -832,6 +847,13 @@ export default {
832 847
     sortTitles(a, b) {
833 848
       let res = Number(b.titles) - Number(a.titles)
834 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 858
     formatterDegree(row) {
837 859
       let v = this.selectDictLabel(this.dict.type.sys_user_degree, row.degree)

+ 8
- 12
oa-ui/src/views/oa/staff/info.vue Ver fichero

@@ -1,8 +1,8 @@
1 1
 <!--
2 2
  * @Author: ysh
3 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 7
 <template>
8 8
   <div class="bg" v-loading="loading">
@@ -22,8 +22,12 @@
22 22
           </div>
23 23
           <div class="user-name">{{ form.nickName }}</div>
24 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 31
           </div>
28 32
         </div>
29 33
         <div class="info-item">
@@ -225,14 +229,6 @@ export default {
225 229
         }
226 230
       }
227 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 233
     handleClick() {
238 234
 

Loading…
Cancelar
Guardar