1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<template>
<!-- 弹出框表单 -->
<el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
size="50%"
>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field
label="员工ID"
prop="staffId"
v-model="form.staffId"
placeholder="请输入员工ID"
/>
<Field
label="员工姓名"
prop="staffName"
v-model="form.staffName"
placeholder="请输入员工姓名"
/>
<Field
label="性别"
prop="gender"
v-model="form.gender"
type="select"
:enumData="dict.gender"
placeholder="请选择性别"
/>
<Field
label="出生日期"
prop="birthday"
v-model="form.birthday"
type="date"
/>
<Field
label="照片"
prop="photoPath"
v-model="form.photoPath"
type="textarea"
placeholder="请输入照片"
/>
<Field
label="联系电话"
prop="phoneNumber"
v-model="form.phoneNumber"
placeholder="请输入联系电话"
/>
<Field
label="身份证号码"
prop="idCard"
v-model="form.idCard"
placeholder="请输入身份证号码"
/>
<Field
label="工号"
prop="workNum"
v-model="form.workNum"
placeholder="请输入工号"
/>
<Field
label="政治面貌 "
prop="politicalstatus"
v-model="form.politicalstatus"
type="select"
:enumData="dict.politicalstatus"
placeholder="请选择政治面貌 "
/>
<Field
label="所属部门"
prop="deptId"
v-model="form.deptId"
placeholder="请输入所属部门"
/>
<Field
label="所属部门名称"
prop="deptName"
v-model="form.deptName"
placeholder="请输入所属部门名称"
/>
<Field
label="职位ID"
prop="jobId"
v-model="form.jobId"
placeholder="请输入职位ID"
/>
<Field
label="职位名称"
prop="jobName"
v-model="form.jobName"
placeholder="请输入职位名称"
/>
<Field
label="员工类型"
prop="staffType"
v-model="form.staffType"
type="select"
:enumData="dict.staffType"
placeholder="请选择员工类型"
/>
<Field
label="员工状态"
prop="status"
v-model="form.status"
type="select"
:enumData="dict.status"
placeholder="请选择员工状态"
/>
<Field
label="入职时间"
prop="entryDate"
v-model="form.entryDate"
type="date"
/>
<Field
label="计划转正时间"
prop="regularDate"
v-model="form.regularDate"
type="date"
/>
<Field
label="审核状态"
prop="auditStatus"
v-model="form.auditStatus"
type="select"
:enumData="dict.auditStatus"
placeholder="请选择审核状态"
/>
</el-row>
<form-buttons @submit="submitForm" noCancelBtn />
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
export default {
name: "StaffRegularDetail",
mixins: [form],
components: {},
created() {
this.changePath("staff/regular");
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "员工转正信息",
// 是否显示弹出层
open: false,
direction: "rtl",
toString: [
"gender",
"politicalstatus",
"staffType",
"status",
"auditStatus",
],
toDate: ["birthday", "entryDate", "regularDate"],
// 表单校验
rules: {
staffName: [
{ required: true, message: "请输入员工姓名", trigger: "blur" },
{ max: 64, message: "最多只能录入64个字符", trigger: "blur" },
],
createTime: [{ required: true, message: "请选择创建时间" }],
},
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "staff/regular/edit";
this.getData();
this.pageInfo.type = "edit";
this.title = "修改员工转正信息";
},
/** 新增 */
add(row) {
this.reset();
this.urls.currUrl = "staff/regular/add";
this.getData();
this.pageInfo.type = "add";
this.title = "新增员工转正信息";
},
/** 查看*/
view(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "staff/regular/view";
this.getData();
this.pageInfo.type = "view";
this.title = "员工转正信息详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
staffId: null,
staffName: "",
gender: 1,
birthday: null,
photoPath: "",
phoneNumber: "",
idCard: "",
workNum: "",
politicalstatus: 1,
deptId: null,
deptName: "",
jobId: null,
jobName: "",
staffType: 1,
status: 1,
entryDate: null,
regularDate: null,
auditStatus: 0,
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>