Browse Source

移动端:更新人事管理

余思翰 2 days ago
parent
commit
728167a6db

+ 77
- 68
oa-ui-app/pages.json View File

1
 {
1
 {
2
-	"pages": [{
2
+	"pages": [
3
+		{
3
 			"path": "pages/login",
4
 			"path": "pages/login",
4
 			"style": {
5
 			"style": {
5
 				"navigationBarTitleText": "登录"
6
 				"navigationBarTitleText": "登录"
6
 			}
7
 			}
7
-		}, {
8
+		},
9
+		{
8
 			"path": "pages/index",
10
 			"path": "pages/index",
9
 			"style": {
11
 			"style": {
10
 				"navigationBarTitleText": "CMC智联云枢办公系统移动端",
12
 				"navigationBarTitleText": "CMC智联云枢办公系统移动端",
11
 				"navigationStyle": "custom"
13
 				"navigationStyle": "custom"
12
 			}
14
 			}
13
-		}, {
15
+		},
16
+		{
14
 			"path": "pages/work/index",
17
 			"path": "pages/work/index",
15
 			"style": {
18
 			"style": {
16
 				"navigationBarTitleText": "工作台"
19
 				"navigationBarTitleText": "工作台"
17
 			}
20
 			}
18
-		}, {
21
+		},
22
+		{
19
 			"path": "pages/mine/index",
23
 			"path": "pages/mine/index",
20
 			"style": {
24
 			"style": {
21
 				"navigationBarTitleText": "我的"
25
 				"navigationBarTitleText": "我的"
22
 			}
26
 			}
23
-		}, {
27
+		},
28
+		{
24
 			"path": "pages/mine/avatar/index",
29
 			"path": "pages/mine/avatar/index",
25
 			"style": {
30
 			"style": {
26
 				"navigationBarTitleText": "修改头像"
31
 				"navigationBarTitleText": "修改头像"
27
 			}
32
 			}
28
-		}, {
33
+		},
34
+		{
29
 			"path": "pages/mine/info/index",
35
 			"path": "pages/mine/info/index",
30
 			"style": {
36
 			"style": {
31
 				"navigationBarTitleText": "个人信息"
37
 				"navigationBarTitleText": "个人信息"
32
 			}
38
 			}
33
-		}, {
39
+		},
40
+		{
34
 			"path": "pages/mine/info/edit",
41
 			"path": "pages/mine/info/edit",
35
 			"style": {
42
 			"style": {
36
 				"navigationBarTitleText": "编辑资料"
43
 				"navigationBarTitleText": "编辑资料"
37
 			}
44
 			}
38
-		}, {
45
+		},
46
+		{
39
 			"path": "pages/mine/pwd/index",
47
 			"path": "pages/mine/pwd/index",
40
 			"style": {
48
 			"style": {
41
 				"navigationBarTitleText": "修改密码"
49
 				"navigationBarTitleText": "修改密码"
42
 			}
50
 			}
43
-		}, {
51
+		},
52
+		{
44
 			"path": "pages/mine/setting/index",
53
 			"path": "pages/mine/setting/index",
45
 			"style": {
54
 			"style": {
46
 				"navigationBarTitleText": "应用设置"
55
 				"navigationBarTitleText": "应用设置"
47
 			}
56
 			}
48
-		}, {
57
+		},
58
+		{
49
 			"path": "pages/mine/help/index",
59
 			"path": "pages/mine/help/index",
50
 			"style": {
60
 			"style": {
51
 				"navigationBarTitleText": "常见问题"
61
 				"navigationBarTitleText": "常见问题"
52
 			}
62
 			}
53
-		}, {
63
+		},
64
+		{
54
 			"path": "pages/mine/about/index",
65
 			"path": "pages/mine/about/index",
55
 			"style": {
66
 			"style": {
56
 				"navigationBarTitleText": "关于我们"
67
 				"navigationBarTitleText": "关于我们"
57
 			}
68
 			}
58
-		}, {
69
+		},
70
+		{
59
 			"path": "pages/common/webview/index",
71
 			"path": "pages/common/webview/index",
60
 			"style": {
72
 			"style": {
61
 				"navigationBarTitleText": "浏览网页"
73
 				"navigationBarTitleText": "浏览网页"
62
 			}
74
 			}
63
-		}, {
75
+		},
76
+		{
64
 			"path": "pages/common/textview/index",
77
 			"path": "pages/common/textview/index",
65
 			"style": {
78
 			"style": {
66
 				"navigationBarTitleText": "浏览文本"
79
 				"navigationBarTitleText": "浏览文本"
95
 			}
108
 			}
96
 		},
109
 		},
97
 		{
110
 		{
98
-			"path" : "pages/message/apply/detail",
99
-			"style" : 
100
-			{
101
-				"navigationBarTitleText" : "表单信息"
111
+			"path": "pages/message/apply/detail",
112
+			"style": {
113
+				"navigationBarTitleText": "表单信息"
102
 			}
114
 			}
103
 		},
115
 		},
104
 		{
116
 		{
105
-			"path" : "pages/form/declare/declare",
106
-			"style" : 
107
-			{
108
-				"navigationBarTitleText" : "工作填报"
117
+			"path": "pages/form/declare/declare",
118
+			"style": {
119
+				"navigationBarTitleText": "工作填报"
109
 			}
120
 			}
110
 		},
121
 		},
111
 		{
122
 		{
112
-			"path" : "pages/form/borrow/borrow",
113
-			"style" : 
114
-			{
115
-				"navigationBarTitleText" : "借款审批"
123
+			"path": "pages/form/borrow/borrow",
124
+			"style": {
125
+				"navigationBarTitleText": "借款审批"
116
 			}
126
 			}
117
 		},
127
 		},
118
 		{
128
 		{
119
-			"path" : "pages/project/projectInfo",
120
-			"style" : 
121
-			{
122
-				"navigationBarTitleText" : "项目详情"
129
+			"path": "pages/project/projectInfo",
130
+			"style": {
131
+				"navigationBarTitleText": "项目详情"
123
 			}
132
 			}
124
 		},
133
 		},
125
 		{
134
 		{
126
-			"path" : "pages/oa/budget/budgetInfo",
127
-			"style" : 
128
-			{
129
-				"navigationBarTitleText" : "项目预算表"
135
+			"path": "pages/oa/budget/budgetInfo",
136
+			"style": {
137
+				"navigationBarTitleText": "项目预算表"
130
 			}
138
 			}
131
 		},
139
 		},
132
 		{
140
 		{
133
-			"path" : "pages/oa/borrow/borrowList",
134
-			"style" : 
135
-			{
136
-				"navigationBarTitleText" : "借款管理",
141
+			"path": "pages/oa/borrow/borrowList",
142
+			"style": {
143
+				"navigationBarTitleText": "借款管理",
137
 				"enablePullDownRefresh": true
144
 				"enablePullDownRefresh": true
138
 			}
145
 			}
139
 		},
146
 		},
140
 		{
147
 		{
141
-			"path" : "pages/oa/car/carList",
142
-			"style" : 
143
-			{
144
-				"navigationBarTitleText" : "用车管理",
148
+			"path": "pages/oa/car/carList",
149
+			"style": {
150
+				"navigationBarTitleText": "用车管理",
145
 				"enablePullDownRefresh": true
151
 				"enablePullDownRefresh": true
146
 			}
152
 			}
147
 		},
153
 		},
148
 		{
154
 		{
149
-			"path" : "pages/oa/car/useCarList",
150
-			"style" : 
151
-			{
152
-				"navigationBarTitleText" : "派出记录",
155
+			"path": "pages/oa/car/useCarList",
156
+			"style": {
157
+				"navigationBarTitleText": "派出记录",
153
 				"enablePullDownRefresh": true
158
 				"enablePullDownRefresh": true
154
 			}
159
 			}
155
 		},
160
 		},
156
 		{
161
 		{
157
-			"path" : "pages/oa/device/deviceLog",
158
-			"style" : 
159
-			{
160
-				"navigationBarTitleText" : "设备作业记录"
162
+			"path": "pages/oa/device/deviceLog",
163
+			"style": {
164
+				"navigationBarTitleText": "设备作业记录"
161
 			}
165
 			}
162
 		},
166
 		},
163
 		{
167
 		{
164
-			"path" : "pages/oa/device/instrumentsList",
165
-			"style" : 
166
-			{
167
-				"navigationBarTitleText" : "仪器设备管理"
168
+			"path": "pages/oa/device/instrumentsList",
169
+			"style": {
170
+				"navigationBarTitleText": "仪器设备管理"
168
 			}
171
 			}
169
 		},
172
 		},
170
 		{
173
 		{
171
-			"path" : "pages/oa/declare/declareList",
172
-			"style" : 
173
-			{
174
-				"navigationBarTitleText" : "工作填报列表",
174
+			"path": "pages/oa/declare/declareList",
175
+			"style": {
176
+				"navigationBarTitleText": "工作填报列表",
175
 				"enablePullDownRefresh": true
177
 				"enablePullDownRefresh": true
176
 			}
178
 			}
177
 		},
179
 		},
178
 		{
180
 		{
179
-			"path" : "pages/oa/staff/staffList",
180
-			"style" : 
181
-			{
182
-				"navigationBarTitleText" : "人事管理",
181
+			"path": "pages/oa/staff/staffList",
182
+			"style": {
183
+				"navigationBarTitleText": "人事管理",
183
 				"enablePullDownRefresh": true
184
 				"enablePullDownRefresh": true
184
 			}
185
 			}
185
 		},
186
 		},
186
 		{
187
 		{
187
-			"path" : "pages/components/formInfo",
188
-			"style" : 
189
-			{
190
-				"navigationBarTitleText" : "表单信息"
188
+			"path": "pages/oa/staff/staffDetail",
189
+			"style": {
190
+				"navigationBarTitleText": "员工信息"
191
+			}
192
+		},
193
+		{
194
+			"path": "pages/components/formInfo",
195
+			"style": {
196
+				"navigationBarTitleText": "表单信息"
191
 			}
197
 			}
192
 		}
198
 		}
193
 	],
199
 	],
196
 		"selectedColor": "#000000",
202
 		"selectedColor": "#000000",
197
 		"borderStyle": "white",
203
 		"borderStyle": "white",
198
 		"backgroundColor": "#ffffff",
204
 		"backgroundColor": "#ffffff",
199
-		"list": [{
205
+		"list": [
206
+			{
200
 				"pagePath": "pages/message/index",
207
 				"pagePath": "pages/message/index",
201
 				"iconPath": "static/images/tabbar/msg_1.png",
208
 				"iconPath": "static/images/tabbar/msg_1.png",
202
 				"selectedIconPath": "static/images/tabbar/msg_2.png",
209
 				"selectedIconPath": "static/images/tabbar/msg_2.png",
207
 				"iconPath": "static/images/tabbar/home.png",
214
 				"iconPath": "static/images/tabbar/home.png",
208
 				"selectedIconPath": "static/images/tabbar/home_.png",
215
 				"selectedIconPath": "static/images/tabbar/home_.png",
209
 				"text": "项目"
216
 				"text": "项目"
210
-			}, {
217
+			},
218
+			{
211
 				"pagePath": "pages/work/index",
219
 				"pagePath": "pages/work/index",
212
 				"iconPath": "static/images/tabbar/apply_1.png",
220
 				"iconPath": "static/images/tabbar/apply_1.png",
213
 				"selectedIconPath": "static/images/tabbar/apply_2.png",
221
 				"selectedIconPath": "static/images/tabbar/apply_2.png",
214
 				"text": "工作台"
222
 				"text": "工作台"
215
-			}, {
223
+			},
224
+			{
216
 				"pagePath": "pages/mine/index",
225
 				"pagePath": "pages/mine/index",
217
 				"iconPath": "static/images/tabbar/my_1.png",
226
 				"iconPath": "static/images/tabbar/my_1.png",
218
 				"selectedIconPath": "static/images/tabbar/my_2.png",
227
 				"selectedIconPath": "static/images/tabbar/my_2.png",

+ 154
- 151
oa-ui-app/pages/oa/staff/staffDetail.vue View File

3
     <!-- 头部信息 -->
3
     <!-- 头部信息 -->
4
     <view class="header-section">
4
     <view class="header-section">
5
       <view class="avatar-section">
5
       <view class="avatar-section">
6
-        <uv-avatar 
7
-          :src="staffInfo.avatar || '/static/images/user.png'"
8
-          size="120"
9
-        />
6
+        <uv-avatar :src="staffInfo.avatar || '/static/images/user.png'" size="120" />
10
       </view>
7
       </view>
11
       <view class="basic-info">
8
       <view class="basic-info">
12
         <view class="name">{{ staffInfo.nickName }}</view>
9
         <view class="name">{{ staffInfo.nickName }}</view>
13
-        <view class="dept">{{ staffInfo.dept?.deptName || '未分配部门' }}</view>
10
+        <view class="dept">{{ staffInfo.dept ? staffInfo.dept.deptName : '未分配部门' }}</view>
14
         <view class="status">
11
         <view class="status">
15
-          <uv-tag 
16
-            :text="getStatusText(staffInfo.status)" 
17
-            :type="getStatusType(staffInfo.status)"
18
-          />
12
+          <u-tag :text="getStatusText(staffInfo.status)" :type="getStatusType(staffInfo.status)" />
19
         </view>
13
         </view>
20
       </view>
14
       </view>
21
     </view>
15
     </view>
22
-
23
     <!-- 基本信息 -->
16
     <!-- 基本信息 -->
24
     <view class="info-section">
17
     <view class="info-section">
25
       <view class="section-title">基本信息</view>
18
       <view class="section-title">基本信息</view>
30
         </view>
23
         </view>
31
         <view class="info-item">
24
         <view class="info-item">
32
           <text class="label">年龄</text>
25
           <text class="label">年龄</text>
33
-          <text class="value">{{ String(getAgeByIdCard(staffInfo.idCard)).slice(0,2) }}岁</text>
26
+          <text class="value">{{ String(getAgeByIdCard(staffInfo.idCard)).slice(0, 2) }}岁</text>
34
         </view>
27
         </view>
35
         <view class="info-item">
28
         <view class="info-item">
36
           <text class="label">性别</text>
29
           <text class="label">性别</text>
38
         </view>
31
         </view>
39
         <view class="info-item">
32
         <view class="info-item">
40
           <text class="label">手机号码</text>
33
           <text class="label">手机号码</text>
41
-          <text class="value">{{ staffInfo.phonenumber || '未填写' }}</text>
34
+          <text class="value">{{ staffInfo.phonenumber || '' }}</text>
42
         </view>
35
         </view>
43
         <view class="info-item">
36
         <view class="info-item">
44
           <text class="label">身份证</text>
37
           <text class="label">身份证</text>
45
-          <text class="value">{{ staffInfo.idCard || '未填写' }}</text>
38
+          <text class="value">{{ staffInfo.idCard || '' }}</text>
46
         </view>
39
         </view>
47
         <view class="info-item">
40
         <view class="info-item">
48
           <text class="label">籍贯</text>
41
           <text class="label">籍贯</text>
49
-          <text class="value">{{ staffInfo.nativePlace || '未填写' }}</text>
42
+          <text class="value">{{ staffInfo.nativePlace || '' }}</text>
50
         </view>
43
         </view>
51
         <view class="info-item">
44
         <view class="info-item">
52
           <text class="label">民族</text>
45
           <text class="label">民族</text>
53
-          <text class="value">{{ staffInfo.ethnic || '未填写' }}</text>
46
+          <text class="value">{{ staffInfo.ethnic || '' }}</text>
54
         </view>
47
         </view>
55
         <view class="info-item">
48
         <view class="info-item">
56
           <text class="label">政治面貌</text>
49
           <text class="label">政治面貌</text>
57
-          <text class="value">{{ getPoliticalText(staffInfo.politicalAffiliation) || '未填写' }}</text>
50
+          <text class="value">{{ getPoliticalText(staffInfo.politicalAffiliation) || '' }}</text>
58
         </view>
51
         </view>
59
       </view>
52
       </view>
60
     </view>
53
     </view>
65
       <view class="info-grid">
58
       <view class="info-grid">
66
         <view class="info-item">
59
         <view class="info-item">
67
           <text class="label">部门</text>
60
           <text class="label">部门</text>
68
-          <text class="value">{{ staffInfo.dept?.deptName || '未分配部门' }}</text>
61
+          <text class="value">{{ staffInfo.dept ? staffInfo.dept.deptName : '未分配部门' }}</text>
69
         </view>
62
         </view>
70
         <view class="info-item">
63
         <view class="info-item">
71
           <text class="label">职务</text>
64
           <text class="label">职务</text>
72
-          <text class="value">{{ staffInfo.postNames || '未填写' }}</text>
65
+          <text class="value">{{ postData || '' }}</text>
73
         </view>
66
         </view>
74
         <view class="info-item">
67
         <view class="info-item">
75
           <text class="label">职称</text>
68
           <text class="label">职称</text>
76
-          <text class="value">{{ getTitleText(staffInfo.titles) || '未填写' }}</text>
69
+          <text class="value">{{ titlesMap[staffInfo.titles] || '' }}</text>
77
         </view>
70
         </view>
78
         <view class="info-item">
71
         <view class="info-item">
79
           <text class="label">职业资格</text>
72
           <text class="label">职业资格</text>
80
-          <text class="value">{{ getCertificateText(staffInfo.certificates) || '未填写' }}</text>
73
+          <text class="value">{{ getCertificateText(staffInfo.certificates) || '' }}</text>
81
         </view>
74
         </view>
82
         <view class="info-item">
75
         <view class="info-item">
83
           <text class="label">岗级</text>
76
           <text class="label">岗级</text>
84
-          <text class="value">{{ getPostLevelText(staffInfo.postLevel, staffInfo.salaryLevel) || '未填写' }}</text>
77
+          <text class="value">{{ getPostLevelText(staffInfo.postLevel, staffInfo.salaryLevel) || '' }}</text>
78
+        </view>
79
+        <view class="info-item">
80
+          <text class="label">工程师岗级</text>
81
+          <text class="value">{{ engineerLevelData[staffInfo.engineerLevel] || '' }}</text>
82
+        </view>
83
+        <view class="info-item">
84
+          <text class="label">技工等级</text>
85
+          <text class="value">{{ operatorLevelData[staffInfo.operatorLevel] || '' }}</text>
86
+        </view>
87
+        <view class="info-item">
88
+          <text class="label">项目经理等级</text>
89
+          <text class="value">{{ pmLevelData[staffInfo.pmLevel] || '' }}</text>
85
         </view>
90
         </view>
86
         <view class="info-item">
91
         <view class="info-item">
87
           <text class="label">入职时间</text>
92
           <text class="label">入职时间</text>
88
-          <text class="value">{{ formatDate(staffInfo.entryDate) || '未填写' }}</text>
93
+          <text class="value">{{ parseTime(staffInfo.entryDate, "{y}-{m}-{d}") || '' }}</text>
89
         </view>
94
         </view>
90
         <view class="info-item">
95
         <view class="info-item">
91
           <text class="label">合同签订</text>
96
           <text class="label">合同签订</text>
92
-          <text class="value">{{ formatDate(staffInfo.contractSign) || '未填写' }}</text>
97
+          <text class="value">{{ parseTime(staffInfo.contractSign, "{y}-{m}-{d}") || '' }}</text>
93
         </view>
98
         </view>
94
         <view class="info-item">
99
         <view class="info-item">
95
           <text class="label">合同期满</text>
100
           <text class="label">合同期满</text>
96
-          <text class="value">{{ formatDate(staffInfo.contractExpire) || '未填写' }}</text>
101
+          <text class="value">{{ parseTime(staffInfo.contractExpire, "{y}-{m}-{d}") || '' }}</text>
97
         </view>
102
         </view>
98
       </view>
103
       </view>
99
     </view>
104
     </view>
104
       <view class="info-grid">
109
       <view class="info-grid">
105
         <view class="info-item">
110
         <view class="info-item">
106
           <text class="label">最高学历</text>
111
           <text class="label">最高学历</text>
107
-          <text class="value">{{ getDegreeText(staffInfo.degree) || '未填写' }}</text>
112
+          <text class="value">{{ getDegreeText(staffInfo.degree) || '' }}</text>
108
         </view>
113
         </view>
109
         <view class="info-item">
114
         <view class="info-item">
110
           <text class="label">最高学历专业</text>
115
           <text class="label">最高学历专业</text>
111
-          <text class="value">{{ staffInfo.major || '未填写' }}</text>
116
+          <text class="value">{{ staffInfo.major || '' }}</text>
112
         </view>
117
         </view>
113
         <view class="info-item">
118
         <view class="info-item">
114
           <text class="label">最高学历毕业院校</text>
119
           <text class="label">最高学历毕业院校</text>
115
-          <text class="value">{{ staffInfo.graduateSchool || '未填写' }}</text>
120
+          <text class="value">{{ staffInfo.graduateSchool || '' }}</text>
116
         </view>
121
         </view>
117
         <view class="info-item">
122
         <view class="info-item">
118
           <text class="label">初始学历</text>
123
           <text class="label">初始学历</text>
119
-          <text class="value">{{ getDegreeText(staffInfo.initialDegree) || '未填写' }}</text>
124
+          <text class="value">{{ getDegreeText(staffInfo.initialDegree) || '' }}</text>
120
         </view>
125
         </view>
121
         <view class="info-item">
126
         <view class="info-item">
122
           <text class="label">初始学历专业</text>
127
           <text class="label">初始学历专业</text>
123
-          <text class="value">{{ staffInfo.initialMajor || '未填写' }}</text>
128
+          <text class="value">{{ staffInfo.initialMajor || '' }}</text>
124
         </view>
129
         </view>
125
         <view class="info-item">
130
         <view class="info-item">
126
           <text class="label">初始学历毕业院校</text>
131
           <text class="label">初始学历毕业院校</text>
127
-          <text class="value">{{ staffInfo.initialSchool || '未填写' }}</text>
132
+          <text class="value">{{ staffInfo.initialSchool || '' }}</text>
128
         </view>
133
         </view>
129
       </view>
134
       </view>
130
     </view>
135
     </view>
131
 
136
 
137
+
132
     <!-- 其他信息 -->
138
     <!-- 其他信息 -->
133
     <view class="info-section">
139
     <view class="info-section">
134
       <view class="section-title">其他信息</view>
140
       <view class="section-title">其他信息</view>
135
       <view class="info-grid">
141
       <view class="info-grid">
136
         <view class="info-item">
142
         <view class="info-item">
137
           <text class="label">家庭住址</text>
143
           <text class="label">家庭住址</text>
138
-          <text class="value">{{ staffInfo.homePlace || '未填写' }}</text>
144
+          <text class="value">{{ staffInfo.homePlace || '' }}</text>
139
         </view>
145
         </view>
140
         <view class="info-item">
146
         <view class="info-item">
141
           <text class="label">紧急联系人</text>
147
           <text class="label">紧急联系人</text>
142
-          <text class="value">{{ staffInfo.contact || '未填写' }}</text>
148
+          <text class="value">{{ staffInfo.contact || '' }}</text>
143
         </view>
149
         </view>
144
         <view class="info-item">
150
         <view class="info-item">
145
           <text class="label">紧急联系电话</text>
151
           <text class="label">紧急联系电话</text>
146
-          <text class="value">{{ staffInfo.telephone || '未填写' }}</text>
152
+          <text class="value">{{ staffInfo.telephone || '' }}</text>
147
         </view>
153
         </view>
148
         <view class="info-item">
154
         <view class="info-item">
149
           <text class="label">备注</text>
155
           <text class="label">备注</text>
151
         </view>
157
         </view>
152
       </view>
158
       </view>
153
     </view>
159
     </view>
154
-
155
-    <!-- 操作按钮 -->
156
-    <view class="action-section">
157
-      <uv-button type="primary" @click="handleEdit">编辑信息</uv-button>
158
-    </view>
159
   </view>
160
   </view>
160
 </template>
161
 </template>
161
 
162
 
162
 <script>
163
 <script>
163
-import { getUser } from "@/api/system/user";
164
+import { parseTime } from "@/utils/common.js"
165
+import { getUser } from "@/api/system/user"
166
+import { listType, getType } from "@/api/system/dict/type"
167
+import { listData } from "@/api/system/dict/data"
164
 
168
 
165
 export default {
169
 export default {
166
   data() {
170
   data() {
167
     return {
171
     return {
168
       staffInfo: {},
172
       staffInfo: {},
169
       userId: '',
173
       userId: '',
170
-      nickName: ''
174
+      nickName: '',
175
+      postData: '',
176
+      engineerLevelData: {},
177
+      operatorLevelData: {},
178
+      pmLevelData: {},
179
+      politicalMap: {},
180
+      titlesMap: {},
181
+      certificateMap: {},
182
+      postLevelMap: {},
183
+      salaryLevelMap: {}
171
     }
184
     }
172
   },
185
   },
173
-  
174
   onLoad(options) {
186
   onLoad(options) {
175
-    this.userId = options.userId;
176
-    this.nickName = options.nickName;
187
+    this.userId = options.userId
188
+    this.nickName = options.nickName
189
+    this.getDictLabelValue();
177
     this.getStaffInfo();
190
     this.getStaffInfo();
178
   },
191
   },
179
-  
180
   methods: {
192
   methods: {
193
+    parseTime,
181
     // 获取员工信息
194
     // 获取员工信息
182
     async getStaffInfo() {
195
     async getStaffInfo() {
183
       try {
196
       try {
184
         const res = await getUser(this.userId);
197
         const res = await getUser(this.userId);
185
         this.staffInfo = res.data;
198
         this.staffInfo = res.data;
199
+        let postArr = [];
200
+        for (let post of res.posts) {
201
+          for (let postid of res.postIds) {
202
+            if (postid == post.postId) {
203
+              postArr.push(post.postName)
204
+            }
205
+          }
206
+        }
207
+        this.postData = postArr.join('/')
186
       } catch (error) {
208
       } catch (error) {
187
         console.error('获取员工信息失败:', error);
209
         console.error('获取员工信息失败:', error);
188
         uni.showToast({
210
         uni.showToast({
191
         });
213
         });
192
       }
214
       }
193
     },
215
     },
194
-    
216
+    getDictLabelValue() {
217
+      listData({ pageSize: 100, dictType: 'sys_user_engineerlevel' }).then(res => {
218
+        res.rows.map(item => {
219
+          this.engineerLevelData[item.dictValue] = item.dictLabel
220
+        })
221
+      })
222
+      listData({ pageSize: 100, dictType: 'sys_user_operatorlevel' }).then(res => {
223
+        res.rows.map(item => {
224
+          this.operatorLevelData[item.dictValue] = item.dictLabel
225
+        })
226
+      })
227
+      listData({ pageSize: 100, dictType: 'sys_user_pmlevel' }).then(res => {
228
+        res.rows.map(item => {
229
+          this.pmLevelData[item.dictValue] = item.dictLabel
230
+        })
231
+      })
232
+      listData({ pageSize: 100, dictType: 'sys_user_political' }).then(res => {
233
+        res.rows.map(item => {
234
+          this.politicalMap[item.dictValue] = item.dictLabel
235
+        })
236
+      })
237
+      listData({ pageSize: 100, dictType: 'sys_user_titles' }).then(res => {
238
+        res.rows.map(item => {
239
+          this.titlesMap[item.dictValue] = item.dictLabel
240
+        })
241
+      })
242
+      listData({ pageSize: 100, dictType: 'sys_user_certificates' }).then(res => {
243
+        res.rows.map(item => {
244
+          this.certificateMap[item.dictValue] = item.dictLabel
245
+        })
246
+      })
247
+      listData({ pageSize: 100, dictType: 'sys_user_postlevel' }).then(res => {
248
+        res.rows.map(item => {
249
+          this.postLevelMap[item.dictValue] = item.dictLabel
250
+        })
251
+      })
252
+      listData({ pageSize: 100, dictType: 'sys_user_salarylevel' }).then(res => {
253
+        res.rows.map(item => {
254
+          this.salaryLevelMap[item.dictValue] = item.dictLabel
255
+        })
256
+      })
257
+    },
195
     // 获取状态文本
258
     // 获取状态文本
196
     getStatusText(status) {
259
     getStatusText(status) {
197
       const statusMap = {
260
       const statusMap = {
203
       };
266
       };
204
       return statusMap[status] || '未知';
267
       return statusMap[status] || '未知';
205
     },
268
     },
206
-    
207
     // 获取状态类型
269
     // 获取状态类型
208
     getStatusType(status) {
270
     getStatusType(status) {
209
       const typeMap = {
271
       const typeMap = {
215
       };
277
       };
216
       return typeMap[status] || 'default';
278
       return typeMap[status] || 'default';
217
     },
279
     },
218
-    
219
-    // 获取职称文本
220
-    getTitleText(titles) {
221
-      const titleMap = {
222
-        '1': '高级工程师',
223
-        '2': '工程师',
224
-        '3': '助理工程师',
225
-        '4': '技术员'
226
-      };
227
-      return titleMap[titles] || '';
228
-    },
229
-    
230
-    // 获取职业资格文本
231
-    getCertificateText(certificates) {
232
-      if (!certificates) return '';
233
-      const certificateMap = {
234
-        '1': '注册测绘师',
235
-        '2': '注册建筑师',
236
-        '3': '注册结构师',
237
-        '4': '注册造价师'
238
-      };
239
-      const certArray = certificates.split(',');
240
-      return certArray.map(cert => certificateMap[cert] || cert).join('、');
241
-    },
242
-    
243
-    // 获取学历文本
244
-    getDegreeText(degree) {
245
-      const degreeMap = {
246
-        '1': '博士',
247
-        '2': '硕士',
248
-        '3': '本科',
249
-        '4': '专科',
250
-        '5': '高中'
251
-      };
252
-      return degreeMap[degree] || '';
253
-    },
254
-    
255
-    // 获取政治面貌文本
256
-    getPoliticalText(politicalAffiliation) {
257
-      if (!politicalAffiliation) return '';
258
-      const politicalMap = {
259
-        '1': '中共党员',
260
-        '2': '中共预备党员',
261
-        '3': '共青团员',
262
-        '4': '民革党员',
263
-        '5': '民盟盟员',
264
-        '6': '民建会员',
265
-        '7': '民进会员',
266
-        '8': '农工党党员',
267
-        '9': '致公党党员',
268
-        '10': '九三学社社员',
269
-        '11': '台盟盟员',
270
-        '12': '无党派人士',
271
-        '13': '群众'
272
-      };
273
-      const politicalArray = politicalAffiliation.split(',');
274
-      return politicalArray.map(political => politicalMap[political] || political).join('、');
275
-    },
276
-    
277
-    // 获取岗级文本
278
-    getPostLevelText(postLevel, salaryLevel) {
279
-      const postLevelMap = {
280
-        '1': '一级',
281
-        '2': '二级',
282
-        '3': '三级',
283
-        '4': '四级',
284
-        '5': '五级'
285
-      };
286
-      const salaryLevelMap = {
287
-        '1': 'A',
288
-        '2': 'B',
289
-        '3': 'C',
290
-        '4': 'D',
291
-        '5': 'E'
292
-      };
293
-      const postText = postLevelMap[postLevel] || '';
294
-      const salaryText = salaryLevelMap[salaryLevel] || '';
295
-      return postText && salaryText ? `${postText}${salaryText}` : '';
296
-    },
297
-    
298
     // 根据身份证计算年龄
280
     // 根据身份证计算年龄
299
     getAgeByIdCard(idCard) {
281
     getAgeByIdCard(idCard) {
300
       if (!idCard) return 0;
282
       if (!idCard) return 0;
311
       }
293
       }
312
       return age;
294
       return age;
313
     },
295
     },
314
-    
315
-    // 格式化日期
316
-    formatDate(dateStr) {
317
-      if (!dateStr) return '';
318
-      const date = new Date(dateStr);
319
-      return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;
296
+    // 获取政治面貌文本
297
+    getPoliticalText(politicalAffiliation) {
298
+      if (!politicalAffiliation) return '';
299
+      const politicalArray = politicalAffiliation.split(',');
300
+      let politicalText = politicalArray.map(political => this.politicalMap[political] || political).join('、');
301
+      return politicalText;
320
     },
302
     },
321
-    
322
-    // 编辑信息
323
-    handleEdit() {
324
-      uni.navigateTo({
325
-        url: `/pages/oa/staff/staffEdit?userId=${this.userId}`
326
-      });
327
-    }
328
-  }
303
+
304
+    // 获取职业资格文本
305
+    getCertificateText(certificates) {
306
+      if (!certificates) return '';
307
+      const certArray = certificates.split(',');
308
+      return certArray.map(cert => this.certificateMap[cert] || cert).join('、');
309
+    },
310
+
311
+    // 获取岗级文本
312
+    getPostLevelText(postLevel, salaryLevel) {
313
+      const postText = this.postLevelMap[postLevel] || '';
314
+      const salaryText = this.salaryLevelMap[salaryLevel] || '';
315
+      return postText && salaryText ? `${postText}${salaryText}` : '';
316
+    },
317
+    // 获取学历文本
318
+    getDegreeText(degree) {
319
+      const degreeMap = {
320
+        '0': '博士',
321
+        '1': '硕士',
322
+        '2': '本科',
323
+        '3': '专科',
324
+        '4': '高中',
325
+        '5': '中专',
326
+        '6': '初中'
327
+      };
328
+      return degreeMap[degree] || '';
329
+    },
330
+  },
329
 }
331
 }
330
 </script>
332
 </script>
331
 
333
 
333
 .container {
335
 .container {
334
   background-color: #f5f5f5;
336
   background-color: #f5f5f5;
335
   min-height: 100vh;
337
   min-height: 100vh;
338
+  padding: 30rpx;
336
   padding-bottom: 120rpx;
339
   padding-bottom: 120rpx;
337
 }
340
 }
338
 
341
 
342
   display: flex;
345
   display: flex;
343
   align-items: center;
346
   align-items: center;
344
   margin-bottom: 20rpx;
347
   margin-bottom: 20rpx;
345
-  
348
+
346
   .avatar-section {
349
   .avatar-section {
347
     margin-right: 30rpx;
350
     margin-right: 30rpx;
348
   }
351
   }
349
-  
352
+
350
   .basic-info {
353
   .basic-info {
351
     flex: 1;
354
     flex: 1;
352
-    
355
+
353
     .name {
356
     .name {
354
       font-size: 36rpx;
357
       font-size: 36rpx;
355
       font-weight: bold;
358
       font-weight: bold;
356
       color: #333;
359
       color: #333;
357
       margin-bottom: 10rpx;
360
       margin-bottom: 10rpx;
358
     }
361
     }
359
-    
362
+
360
     .dept {
363
     .dept {
361
       font-size: 28rpx;
364
       font-size: 28rpx;
362
       color: #666;
365
       color: #666;
363
       margin-bottom: 15rpx;
366
       margin-bottom: 15rpx;
364
     }
367
     }
365
-    
368
+
366
     .status {
369
     .status {
367
       display: inline-block;
370
       display: inline-block;
368
     }
371
     }
373
   background-color: #fff;
376
   background-color: #fff;
374
   margin-bottom: 20rpx;
377
   margin-bottom: 20rpx;
375
   padding: 30rpx;
378
   padding: 30rpx;
376
-  
379
+
377
   .section-title {
380
   .section-title {
378
     font-size: 32rpx;
381
     font-size: 32rpx;
379
     font-weight: bold;
382
     font-weight: bold;
382
     border-left: 6rpx solid #007aff;
385
     border-left: 6rpx solid #007aff;
383
     padding-left: 20rpx;
386
     padding-left: 20rpx;
384
   }
387
   }
385
-  
388
+
386
   .info-grid {
389
   .info-grid {
387
     .info-item {
390
     .info-item {
388
       display: flex;
391
       display: flex;
389
       margin-bottom: 25rpx;
392
       margin-bottom: 25rpx;
390
-      
393
+
391
       .label {
394
       .label {
392
         width: 200rpx;
395
         width: 200rpx;
393
         font-size: 28rpx;
396
         font-size: 28rpx;
394
         color: #666;
397
         color: #666;
395
       }
398
       }
396
-      
399
+
397
       .value {
400
       .value {
398
         flex: 1;
401
         flex: 1;
399
         font-size: 28rpx;
402
         font-size: 28rpx;
412
   background-color: #fff;
415
   background-color: #fff;
413
   padding: 20rpx 30rpx;
416
   padding: 20rpx 30rpx;
414
   border-top: 1rpx solid #eee;
417
   border-top: 1rpx solid #eee;
415
-  
418
+
416
   .uv-button {
419
   .uv-button {
417
     width: 100%;
420
     width: 100%;
418
   }
421
   }
419
 }
422
 }
420
-</style>
423
+</style>

+ 0
- 419
oa-ui-app/pages/oa/staff/staffEdit.vue View File

1
-<template>
2
-  <view class="container">
3
-    <uv-form ref="form" :model="form" :rules="rules" label-width="200rpx">
4
-      <!-- 基本信息 -->
5
-      <view class="form-section">
6
-        <view class="section-title">基本信息</view>
7
-        <view class="form-item">
8
-          <uv-form-item label="姓名" prop="nickName">
9
-            <uv-input v-model="form.nickName" placeholder="请输入姓名" />
10
-          </uv-form-item>
11
-        </view>
12
-        <view class="form-item">
13
-          <uv-form-item label="性别">
14
-            <uv-radio-group v-model="form.sex">
15
-              <uv-radio label="0">男</uv-radio>
16
-              <uv-radio label="1">女</uv-radio>
17
-            </uv-radio-group>
18
-          </uv-form-item>
19
-        </view>
20
-        <view class="form-item">
21
-          <uv-form-item label="手机号码" prop="phonenumber">
22
-            <uv-input v-model="form.phonenumber" placeholder="请输入手机号码" />
23
-          </uv-form-item>
24
-        </view>
25
-        <view class="form-item">
26
-          <uv-form-item label="身份证" prop="idCard">
27
-            <uv-input v-model="form.idCard" placeholder="请输入身份证号码" />
28
-          </uv-form-item>
29
-        </view>
30
-        <view class="form-item">
31
-          <uv-form-item label="籍贯">
32
-            <uv-input v-model="form.nativePlace" placeholder="请输入籍贯" />
33
-          </uv-form-item>
34
-        </view>
35
-        <view class="form-item">
36
-          <uv-form-item label="民族">
37
-            <uv-input v-model="form.ethnic" placeholder="请输入民族" />
38
-          </uv-form-item>
39
-        </view>
40
-        <view class="form-item">
41
-          <uv-form-item label="政治面貌">
42
-            <uv-select v-model="form.politicalAffiliation" :options="politicalOptions" placeholder="请选择政治面貌" multiple />
43
-          </uv-form-item>
44
-        </view>
45
-      </view>
46
-
47
-      <!-- 工作信息 -->
48
-      <view class="form-section">
49
-        <view class="section-title">工作信息</view>
50
-        <view class="form-item">
51
-          <uv-form-item label="归属部门" prop="deptId">
52
-            <uv-select v-model="form.deptId" :options="deptOptions" placeholder="请选择归属部门" />
53
-          </uv-form-item>
54
-        </view>
55
-        <view class="form-item">
56
-          <uv-form-item label="入职时间">
57
-            <uv-datetime-picker v-model="form.entryDate" mode="date" placeholder="请选择入职时间" />
58
-          </uv-form-item>
59
-        </view>
60
-        <view class="form-item">
61
-          <uv-form-item label="合同签订">
62
-            <uv-datetime-picker v-model="form.contractSign" mode="date" placeholder="请选择合同签订时间" />
63
-          </uv-form-item>
64
-        </view>
65
-        <view class="form-item">
66
-          <uv-form-item label="合同期满">
67
-            <uv-datetime-picker v-model="form.contractExpire" mode="date" placeholder="请选择合同期满时间" />
68
-          </uv-form-item>
69
-        </view>
70
-        <view class="form-item">
71
-          <uv-form-item label="技术职称">
72
-            <uv-select v-model="form.titles" :options="titleOptions" placeholder="请选择技术职称" />
73
-          </uv-form-item>
74
-        </view>
75
-        <view class="form-item">
76
-          <uv-form-item label="职称专业">
77
-            <uv-input v-model="form.titleProfession" placeholder="请输入职称专业" />
78
-          </uv-form-item>
79
-        </view>
80
-        <view class="form-item">
81
-          <uv-form-item label="职业资格">
82
-            <uv-select v-model="form.certificates" :options="certificateOptions" placeholder="请选择职业资格" multiple />
83
-          </uv-form-item>
84
-        </view>
85
-        <view class="form-item">
86
-          <uv-form-item label="岗级">
87
-            <view class="level-group">
88
-              <uv-select v-model="form.postLevel" :options="postLevelOptions" placeholder="请选择岗级" />
89
-              <uv-select v-model="form.salaryLevel" :options="salaryLevelOptions" placeholder="请选择薪级" />
90
-            </view>
91
-          </uv-form-item>
92
-        </view>
93
-        <view class="form-item">
94
-          <uv-form-item label="状态">
95
-            <uv-radio-group v-model="form.status">
96
-              <uv-radio label="0">在职</uv-radio>
97
-              <uv-radio label="1">离职</uv-radio>
98
-              <uv-radio label="2">退休</uv-radio>
99
-              <uv-radio label="3">试用</uv-radio>
100
-              <uv-radio label="4">返聘</uv-radio>
101
-            </uv-radio-group>
102
-          </uv-form-item>
103
-        </view>
104
-      </view>
105
-
106
-      <!-- 教育背景 -->
107
-      <view class="form-section">
108
-        <view class="section-title">教育背景</view>
109
-        <view class="form-item">
110
-          <uv-form-item label="最高学历">
111
-            <uv-select v-model="form.degree" :options="degreeOptions" placeholder="请选择最高学历" />
112
-          </uv-form-item>
113
-        </view>
114
-        <view class="form-item">
115
-          <uv-form-item label="最高学历专业">
116
-            <uv-input v-model="form.major" placeholder="请输入最高学历专业" />
117
-          </uv-form-item>
118
-        </view>
119
-        <view class="form-item">
120
-          <uv-form-item label="最高学历毕业学校">
121
-            <uv-input v-model="form.graduateSchool" placeholder="请输入最高学历毕业学校" />
122
-          </uv-form-item>
123
-        </view>
124
-        <view class="form-item">
125
-          <uv-form-item label="初始学历">
126
-            <uv-select v-model="form.initialDegree" :options="degreeOptions" placeholder="请选择初始学历" />
127
-          </uv-form-item>
128
-        </view>
129
-        <view class="form-item">
130
-          <uv-form-item label="初始学历专业">
131
-            <uv-input v-model="form.initialMajor" placeholder="请输入初始学历专业" />
132
-          </uv-form-item>
133
-        </view>
134
-        <view class="form-item">
135
-          <uv-form-item label="初始学历毕业学校">
136
-            <uv-input v-model="form.initialSchool" placeholder="请输入初始学历毕业学校" />
137
-          </uv-form-item>
138
-        </view>
139
-      </view>
140
-
141
-      <!-- 其他信息 -->
142
-      <view class="form-section">
143
-        <view class="section-title">其他信息</view>
144
-        <view class="form-item">
145
-          <uv-form-item label="家庭住址">
146
-            <uv-textarea v-model="form.homePlace" placeholder="请输入家庭住址" />
147
-          </uv-form-item>
148
-        </view>
149
-        <view class="form-item">
150
-          <uv-form-item label="紧急联系人">
151
-            <uv-input v-model="form.contact" placeholder="请输入紧急联系人" />
152
-          </uv-form-item>
153
-        </view>
154
-        <view class="form-item">
155
-          <uv-form-item label="紧急联系电话">
156
-            <uv-input v-model="form.telephone" placeholder="请输入紧急联系电话" />
157
-          </uv-form-item>
158
-        </view>
159
-        <view class="form-item">
160
-          <uv-form-item label="备注">
161
-            <uv-textarea v-model="form.remark" placeholder="请输入备注信息" />
162
-          </uv-form-item>
163
-        </view>
164
-      </view>
165
-    </uv-form>
166
-
167
-    <!-- 操作按钮 -->
168
-    <view class="action-section">
169
-      <uv-button type="default" @click="handleCancel">取消</uv-button>
170
-      <uv-button type="primary" @click="handleSubmit">保存</uv-button>
171
-    </view>
172
-  </view>
173
-</template>
174
-
175
-<script>
176
-import { getUser, updateUser, addUser } from "@/api/system/user";
177
-import { deptTreeSelectNew } from "@/api/system/dept";
178
-
179
-export default {
180
-  data() {
181
-    return {
182
-      form: {
183
-        userId: undefined,
184
-        nickName: '',
185
-        sex: '0',
186
-        phonenumber: '',
187
-        idCard: '',
188
-        nativePlace: '',
189
-        ethnic: '',
190
-        politicalAffiliation: [],
191
-        deptId: undefined,
192
-        entryDate: '',
193
-        contractSign: '',
194
-        contractExpire: '',
195
-        titles: '',
196
-        titleProfession: '',
197
-        certificates: [],
198
-        postLevel: '',
199
-        salaryLevel: '',
200
-        status: '0',
201
-        degree: '',
202
-        major: '',
203
-        graduateSchool: '',
204
-        initialDegree: '',
205
-        initialMajor: '',
206
-        initialSchool: '',
207
-        homePlace: '',
208
-        contact: '',
209
-        telephone: '',
210
-        remark: ''
211
-      },
212
-      deptOptions: [],
213
-      politicalOptions: [
214
-        { label: '中共党员', value: '1' },
215
-        { label: '中共预备党员', value: '2' },
216
-        { label: '共青团员', value: '3' },
217
-        { label: '民革党员', value: '4' },
218
-        { label: '民盟盟员', value: '5' },
219
-        { label: '民建会员', value: '6' },
220
-        { label: '民进会员', value: '7' },
221
-        { label: '农工党党员', value: '8' },
222
-        { label: '致公党党员', value: '9' },
223
-        { label: '九三学社社员', value: '10' },
224
-        { label: '台盟盟员', value: '11' },
225
-        { label: '无党派人士', value: '12' },
226
-        { label: '群众', value: '13' }
227
-      ],
228
-      titleOptions: [
229
-        { label: '高级工程师', value: '1' },
230
-        { label: '工程师', value: '2' },
231
-        { label: '助理工程师', value: '3' },
232
-        { label: '技术员', value: '4' }
233
-      ],
234
-      certificateOptions: [
235
-        { label: '注册测绘师', value: '1' },
236
-        { label: '注册建筑师', value: '2' },
237
-        { label: '注册结构师', value: '3' },
238
-        { label: '注册造价师', value: '4' }
239
-      ],
240
-      degreeOptions: [
241
-        { label: '博士', value: '1' },
242
-        { label: '硕士', value: '2' },
243
-        { label: '本科', value: '3' },
244
-        { label: '专科', value: '4' },
245
-        { label: '高中', value: '5' }
246
-      ],
247
-      postLevelOptions: [
248
-        { label: '一级', value: '1' },
249
-        { label: '二级', value: '2' },
250
-        { label: '三级', value: '3' },
251
-        { label: '四级', value: '4' },
252
-        { label: '五级', value: '5' }
253
-      ],
254
-      salaryLevelOptions: [
255
-        { label: 'A', value: '1' },
256
-        { label: 'B', value: '2' },
257
-        { label: 'C', value: '3' },
258
-        { label: 'D', value: '4' },
259
-        { label: 'E', value: '5' }
260
-      ],
261
-      rules: {
262
-        nickName: [
263
-          { required: true, message: '请输入姓名', trigger: 'blur' }
264
-        ],
265
-        phonenumber: [
266
-          { pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: '请输入正确的手机号码', trigger: 'blur' }
267
-        ],
268
-        idCard: [
269
-          { pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '请输入正确的身份证号码', trigger: 'blur' }
270
-        ],
271
-        deptId: [
272
-          { required: true, message: '请选择归属部门', trigger: 'change' }
273
-        ]
274
-      }
275
-    }
276
-  },
277
-  
278
-  onLoad(options) {
279
-    this.getDeptTree();
280
-    if (options.userId) {
281
-      this.getStaffInfo(options.userId);
282
-    }
283
-  },
284
-  
285
-  methods: {
286
-    // 获取部门树
287
-    async getDeptTree() {
288
-      try {
289
-        const res = await deptTreeSelectNew();
290
-        this.deptOptions = res.data || [];
291
-      } catch (error) {
292
-        console.error('获取部门树失败:', error);
293
-      }
294
-    },
295
-    
296
-    // 获取员工信息
297
-    async getStaffInfo(userId) {
298
-      try {
299
-        const res = await getUser(userId);
300
-        this.form = { ...this.form, ...res.data };
301
-        
302
-        // 处理政治面貌数组
303
-        if (this.form.politicalAffiliation) {
304
-          this.form.politicalAffiliation = this.form.politicalAffiliation.split(',');
305
-        }
306
-        
307
-        // 处理职业资格数组
308
-        if (this.form.certificates) {
309
-          this.form.certificates = this.form.certificates.split(',');
310
-        }
311
-      } catch (error) {
312
-        console.error('获取员工信息失败:', error);
313
-        uni.showToast({
314
-          title: '获取员工信息失败',
315
-          icon: 'none'
316
-        });
317
-      }
318
-    },
319
-    
320
-    // 提交表单
321
-    handleSubmit() {
322
-      this.$refs.form.validate(async (valid) => {
323
-        if (valid) {
324
-          try {
325
-            // 处理数组字段
326
-            const submitData = { ...this.form };
327
-            submitData.politicalAffiliation = this.form.politicalAffiliation.join(',');
328
-            submitData.certificates = this.form.certificates.join(',');
329
-            
330
-            if (this.form.userId) {
331
-              // 更新
332
-              await updateUser(submitData);
333
-              uni.showToast({
334
-                title: '更新成功',
335
-                icon: 'success'
336
-              });
337
-            } else {
338
-              // 新增
339
-              await addUser(submitData);
340
-              uni.showToast({
341
-                title: '添加成功',
342
-                icon: 'success'
343
-              });
344
-            }
345
-            
346
-            // 返回上一页
347
-            setTimeout(() => {
348
-              uni.navigateBack();
349
-            }, 1500);
350
-          } catch (error) {
351
-            console.error('保存失败:', error);
352
-            uni.showToast({
353
-              title: '保存失败',
354
-              icon: 'none'
355
-            });
356
-          }
357
-        }
358
-      });
359
-    },
360
-    
361
-    // 取消
362
-    handleCancel() {
363
-      uni.navigateBack();
364
-    }
365
-  }
366
-}
367
-</script>
368
-
369
-<style lang="scss" scoped>
370
-.container {
371
-  background-color: #f5f5f5;
372
-  min-height: 100vh;
373
-  padding-bottom: 120rpx;
374
-}
375
-
376
-.form-section {
377
-  background-color: #fff;
378
-  margin-bottom: 20rpx;
379
-  padding: 30rpx;
380
-  
381
-  .section-title {
382
-    font-size: 32rpx;
383
-    font-weight: bold;
384
-    color: #333;
385
-    margin-bottom: 30rpx;
386
-    border-left: 6rpx solid #007aff;
387
-    padding-left: 20rpx;
388
-  }
389
-  
390
-  .form-item {
391
-    margin-bottom: 30rpx;
392
-  }
393
-  
394
-  .level-group {
395
-    display: flex;
396
-    gap: 20rpx;
397
-    
398
-    .uv-select {
399
-      flex: 1;
400
-    }
401
-  }
402
-}
403
-
404
-.action-section {
405
-  position: fixed;
406
-  bottom: 0;
407
-  left: 0;
408
-  right: 0;
409
-  background-color: #fff;
410
-  padding: 20rpx 30rpx;
411
-  border-top: 1rpx solid #eee;
412
-  display: flex;
413
-  gap: 20rpx;
414
-  
415
-  .uv-button {
416
-    flex: 1;
417
-  }
418
-}
419
-</style>

+ 40
- 167
oa-ui-app/pages/oa/staff/staffList.vue View File

6
         <input class="search-input-field" v-model="queryParams.nickName" placeholder="请输入姓名搜索" @input="handleQuery"
6
         <input class="search-input-field" v-model="queryParams.nickName" placeholder="请输入姓名搜索" @input="handleQuery"
7
           @confirm="handleQuery" />
7
           @confirm="handleQuery" />
8
       </view>
8
       </view>
9
-      <view class="filter-btn" @click="showFilter = true">
10
-        <text class="filter-icon">筛选</text>
11
-      </view>
12
     </view>
9
     </view>
13
 
10
 
14
     <!-- 部门选择 -->
11
     <!-- 部门选择 -->
51
       </scroll-view>
48
       </scroll-view>
52
     </view>
49
     </view>
53
 
50
 
54
-    <!-- 筛选弹窗 -->
55
-    <view v-if="showFilter" class="filter-overlay" @click="showFilter = false">
56
-      <view class="filter-popup" @click.stop>
57
-        <view class="filter-header">
58
-          <text class="filter-title">筛选条件</text>
59
-          <view class="filter-close" @click="showFilter = false">
60
-            <text>✕</text>
61
-          </view>
62
-        </view>
63
-        <view class="filter-content">
64
-          <view class="filter-item">
65
-            <text class="filter-label">职称</text>
66
-            <picker v-model="queryParams.titles" :range="titleOptions" range-key="label" @change="onTitleChange">
67
-              <view class="picker-view">
68
-                {{ getTitleLabel(queryParams.titles) || '请选择职称' }}
69
-              </view>
70
-            </picker>
71
-          </view>
72
-          <view class="filter-item">
73
-            <text class="filter-label">状态</text>
74
-            <picker v-model="queryParams.status" :range="statusOptions" range-key="label" @change="onStatusChange">
75
-              <view class="picker-view">
76
-                {{ getStatusLabel(queryParams.status) || '请选择状态' }}
77
-              </view>
78
-            </picker>
79
-          </view>
80
-        </view>
81
-        <view class="filter-actions">
82
-          <button class="btn-default" @click="resetQuery">重置</button>
83
-          <button class="btn-primary" @click="applyFilter">确定</button>
84
-        </view>
85
-      </view>
86
-    </view>
87
-
88
     <!-- 员工列表 -->
51
     <!-- 员工列表 -->
89
     <mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption"
52
     <mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption"
90
       :up="upOption" :fixed="false" :top="10" style="padding: 30rpx;">
53
       :up="upOption" :fixed="false" :top="10" style="padding: 30rpx;">
104
               </view>
67
               </view>
105
             </view>
68
             </view>
106
             <view class="staff-actions">
69
             <view class="staff-actions">
107
-              <text class="arrow-icon">></text>
70
+              <text class="arrow-icon" @click="goToDetail(item)">详情</text>
108
             </view>
71
             </view>
109
           </view>
72
           </view>
110
 
73
 
119
             </view>
82
             </view>
120
             <view class="detail-item">
83
             <view class="detail-item">
121
               <text class="detail-label">手机:</text>
84
               <text class="detail-label">手机:</text>
122
-              <text class="detail-value">{{ item.phonenumber || '未填写' }}</text>
85
+              <text class="detail-value">{{ item.phonenumber || '' }}</text>
123
             </view>
86
             </view>
124
             <view class="detail-item">
87
             <view class="detail-item">
125
               <text class="detail-label">职称:</text>
88
               <text class="detail-label">职称:</text>
126
-              <text class="detail-value">{{ getTitleText(item.titles) || '未填写' }}</text>
89
+              <text class="detail-value">{{ getTitleText(item.titles) || '' }}</text>
127
             </view>
90
             </view>
128
             <view class="detail-item">
91
             <view class="detail-item">
129
               <text class="detail-label">职务:</text>
92
               <text class="detail-label">职务:</text>
130
-              <text class="detail-value">{{ item.postNames || '未填写' }}</text>
93
+              <text class="detail-value">{{ item.postNames || '无' }}</text>
94
+            </view>
95
+            <view class="detail-item">
96
+              <text class="detail-label">岗级:</text>
97
+              <text class="detail-value">{{ formatPostLevel(item.postLevel, item.salaryLevel) || '无' }}</text>
131
             </view>
98
             </view>
132
             <view class="detail-item">
99
             <view class="detail-item">
133
               <text class="detail-label">入职时间:</text>
100
               <text class="detail-label">入职时间:</text>
134
-              <text class="detail-value">{{ formatDate(item.entryDate) || '未填写' }}</text>
101
+              <text class="detail-value">{{ formatDate(item.entryDate) || '' }}</text>
135
             </view>
102
             </view>
136
           </view>
103
           </view>
137
         </view>
104
         </view>
165
       staffList: [],
132
       staffList: [],
166
       deptOptions: [],
133
       deptOptions: [],
167
       currentDeptName: '',
134
       currentDeptName: '',
168
-      showFilter: false,
169
       queryParams: {
135
       queryParams: {
170
         pageNum: 1,
136
         pageNum: 1,
171
         pageSize: 10,
137
         pageSize: 10,
178
       },
144
       },
179
       // 筛选选项
145
       // 筛选选项
180
       titleOptions: [
146
       titleOptions: [
147
+        { label: '正高级工程师', value: '0' },
181
         { label: '高级工程师', value: '1' },
148
         { label: '高级工程师', value: '1' },
182
         { label: '工程师', value: '2' },
149
         { label: '工程师', value: '2' },
183
         { label: '助理工程师', value: '3' },
150
         { label: '助理工程师', value: '3' },
242
     handleQuery() {
209
     handleQuery() {
243
       this.queryParams.pageNum = 1;
210
       this.queryParams.pageNum = 1;
244
       this.staffList = [];
211
       this.staffList = [];
245
-      this.mescroll.resetUpScroll();
212
+      this.downCallback();
246
     },
213
     },
247
 
214
 
248
     // 重置查询
215
     // 重置查询
258
         deptId: undefined
225
         deptId: undefined
259
       };
226
       };
260
       this.currentDeptName = '';
227
       this.currentDeptName = '';
261
-      this.showFilter = false;
262
-      this.handleQuery();
263
-    },
264
-
265
-    // 应用筛选
266
-    applyFilter() {
267
-      this.showFilter = false;
268
       this.handleQuery();
228
       this.handleQuery();
269
     },
229
     },
270
 
230
 
271
-    // 处理职称选择变化
272
-    onTitleChange(e) {
273
-      const option = this.titleOptions[e.detail.value];
274
-      this.queryParams.titles = option ? option.value : '';
275
-    },
276
-
277
-    // 处理状态选择变化
278
-    onStatusChange(e) {
279
-      const option = this.statusOptions[e.detail.value];
280
-      this.queryParams.status = option ? option.value : '';
281
-    },
282
-
283
     // 获取职称标签
231
     // 获取职称标签
284
     getTitleLabel(value) {
232
     getTitleLabel(value) {
285
       const item = this.titleOptions.find(item => item.value === value);
233
       const item = this.titleOptions.find(item => item.value === value);
363
     // 获取职称文本
311
     // 获取职称文本
364
     getTitleText(titles) {
312
     getTitleText(titles) {
365
       const titleMap = {
313
       const titleMap = {
314
+        '0': '正高级工程师',
366
         '1': '高级工程师',
315
         '1': '高级工程师',
367
         '2': '工程师',
316
         '2': '工程师',
368
         '3': '助理工程师',
317
         '3': '助理工程师',
393
       if (!dateStr) return '';
342
       if (!dateStr) return '';
394
       const date = new Date(dateStr);
343
       const date = new Date(dateStr);
395
       return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;
344
       return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;
345
+    },
346
+
347
+    // 格式化岗级
348
+    formatPostLevel(postLevel, salaryLevel) {
349
+      const postLevelMap = {
350
+        '0': '一岗',
351
+        '1': '二岗',
352
+        '2': '三岗',
353
+        '3': '四岗',
354
+        '4': '五岗',
355
+        '5': '六岗',
356
+        '6': '七岗',
357
+        '7': '八岗',
358
+      };
359
+      const salaryLevelMap = {
360
+        '0': '一级',
361
+        '1': '二级',
362
+        '2': '三级',
363
+        '3': '四级',
364
+      };
365
+      return postLevelMap[postLevel] + salaryLevelMap[salaryLevel] || '';
366
+    },
367
+    goToDetail(item) {
368
+      uni.navigateTo({
369
+        url: `/pages/oa/staff/staffDetail?userId=${item.userId}&nickName=${item.nickName}`
370
+      });
396
     }
371
     }
397
   },
372
   },
398
 }
373
 }
416
 
391
 
417
   .search-input {
392
   .search-input {
418
     flex: 1;
393
     flex: 1;
419
-    margin-right: 20rpx;
420
 
394
 
421
     .search-input-field {
395
     .search-input-field {
422
       width: 100%;
396
       width: 100%;
427
       font-size: 28rpx;
401
       font-size: 28rpx;
428
     }
402
     }
429
   }
403
   }
430
-
431
-  .filter-btn {
432
-    padding: 10rpx 20rpx;
433
-    background-color: #f5f5f5;
434
-    border-radius: 20rpx;
435
-
436
-    .filter-icon {
437
-      font-size: 26rpx;
438
-      color: #666;
439
-    }
440
-  }
441
 }
404
 }
442
 
405
 
443
 .dept-section {
406
 .dept-section {
536
   }
499
   }
537
 }
500
 }
538
 
501
 
539
-.filter-overlay {
540
-  position: fixed;
541
-  top: 0;
542
-  left: 0;
543
-  right: 0;
544
-  bottom: 0;
545
-  background-color: rgba(0, 0, 0, 0.5);
546
-  z-index: 1000;
547
-  display: flex;
548
-  align-items: flex-end;
549
-}
550
-
551
-.filter-popup {
552
-  background-color: #fff;
553
-  border-radius: 20rpx 20rpx 0 0;
554
-  padding: 40rpx;
555
-  width: 100%;
556
-  max-height: 80vh;
557
-
558
-  .filter-header {
559
-    display: flex;
560
-    justify-content: space-between;
561
-    align-items: center;
562
-    margin-bottom: 40rpx;
563
-
564
-    .filter-title {
565
-      font-size: 32rpx;
566
-      font-weight: bold;
567
-      color: #333;
568
-    }
569
-
570
-    .filter-close {
571
-      padding: 10rpx;
572
-
573
-      text {
574
-        font-size: 24rpx;
575
-        color: #999;
576
-      }
577
-    }
578
-  }
579
-
580
-  .filter-content {
581
-    .filter-item {
582
-      margin-bottom: 30rpx;
583
-
584
-      .filter-label {
585
-        display: block;
586
-        font-size: 28rpx;
587
-        color: #333;
588
-        margin-bottom: 10rpx;
589
-      }
590
-
591
-      picker {
592
-        .picker-view {
593
-          padding: 20rpx;
594
-          background-color: #f5f5f5;
595
-          border-radius: 10rpx;
596
-          font-size: 28rpx;
597
-          color: #333;
598
-        }
599
-      }
600
-    }
601
-  }
602
-
603
-  .filter-actions {
604
-    display: flex;
605
-    justify-content: space-between;
606
-    margin-top: 40rpx;
607
-    gap: 20rpx;
608
-
609
-    button {
610
-      flex: 1;
611
-      height: 80rpx;
612
-      border-radius: 10rpx;
613
-      font-size: 28rpx;
614
-      border: none;
615
-
616
-      &.btn-default {
617
-        background-color: #f5f5f5;
618
-        color: #666;
619
-      }
620
-
621
-      &.btn-primary {
622
-        background-color: #007aff;
623
-        color: #fff;
624
-      }
625
-    }
626
-  }
627
-}
628
-
629
 .staff-list {
502
 .staff-list {
630
   .staff-card {
503
   .staff-card {
631
     background-color: #fff;
504
     background-color: #fff;
675
 
548
 
676
             &.status-0 {
549
             &.status-0 {
677
               background-color: #e6f7ff;
550
               background-color: #e6f7ff;
678
-              color: #1890ff;
551
+              color: #52c41a;
679
             }
552
             }
680
 
553
 
681
             &.status-1 {
554
             &.status-1 {
685
 
558
 
686
             &.status-2 {
559
             &.status-2 {
687
               background-color: #f6ffed;
560
               background-color: #f6ffed;
688
-              color: #52c41a;
561
+              color: #1890ff;
689
             }
562
             }
690
 
563
 
691
             &.status-3 {
564
             &.status-3 {

+ 2
- 2
oa-ui-app/pages/work/index.vue View File

2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2025-01-16 11:17:08
3
  * @Date: 2025-01-16 11:17:08
4
  * @LastEditors: Please set LastEditors
4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-08-07 13:47:32
5
+ * @LastEditTime: 2025-09-03 16:38:56
6
 -->
6
 -->
7
 <template>
7
 <template>
8
   <view class="work-container">
8
   <view class="work-container">
101
           name: '人事管理',
101
           name: '人事管理',
102
           icon: '/static/images/work/staff.png',
102
           icon: '/static/images/work/staff.png',
103
           url: 'staff',
103
           url: 'staff',
104
-          hasPermi: checkPermi(['system:user:list'])
104
+          hasPermi: checkRole(['staff','leader'])
105
         }
105
         }
106
       ],
106
       ],
107
       flowList: ['借款审批', '用车审批', '设备审批', '工作填报'],
107
       flowList: ['借款审批', '用车审批', '设备审批', '工作填报'],

Loading…
Cancel
Save