arms-app 1.0.63 → 1.0.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/view/4.vue +407 -0
package/package.json
CHANGED
package/view/4.vue
ADDED
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="person-table-page">
|
|
3
|
+
<h1>人员信息表</h1>
|
|
4
|
+
<div class="toolbar">
|
|
5
|
+
<el-button type="primary" size="mini" @click="onOpenAdd">新增</el-button>
|
|
6
|
+
</div>
|
|
7
|
+
<el-table
|
|
8
|
+
:data="rows"
|
|
9
|
+
border
|
|
10
|
+
stripe
|
|
11
|
+
size="small"
|
|
12
|
+
style="width: 100%"
|
|
13
|
+
>
|
|
14
|
+
<el-table-column type="index" label="序号" width="60" align="center" header-align="center" />
|
|
15
|
+
<el-table-column prop="name" label="人员姓名" min-width="100" align="center" header-align="center" />
|
|
16
|
+
<el-table-column label="性别" width="80" align="center" header-align="center">
|
|
17
|
+
<template slot-scope="scope">
|
|
18
|
+
{{ formatSex(scope.row.sex) }}
|
|
19
|
+
</template>
|
|
20
|
+
</el-table-column>
|
|
21
|
+
<el-table-column prop="postName" label="岗位" min-width="80" align="center" header-align="center" />
|
|
22
|
+
<el-table-column prop="happenPerio" label="入行日期" min-width="110" align="center" header-align="center" />
|
|
23
|
+
<el-table-column prop="telNo" label="联系方式" min-width="130" align="center" header-align="center" />
|
|
24
|
+
<el-table-column prop="dtlAddr" label="现居住地" min-width="120" align="center" header-align="center" />
|
|
25
|
+
<el-table-column prop="emergContactPersonName" label="紧急联系人" min-width="100" align="center" header-align="center" />
|
|
26
|
+
<el-table-column prop="emergContactPhoneNo" label="紧急联系方式" min-width="130" align="center" header-align="center" />
|
|
27
|
+
<el-table-column prop="birthDt" label="出生日期" min-width="110" align="center" header-align="center" />
|
|
28
|
+
<el-table-column prop="highestEduDegreeDesc" label="最高学历" min-width="90" align="center" header-align="center" />
|
|
29
|
+
<el-table-column prop="createTm" label="创建日期" min-width="110" align="center" header-align="center" />
|
|
30
|
+
<el-table-column prop="rmk" label="备注" min-width="120" align="center" header-align="center" />
|
|
31
|
+
<el-table-column label="操作" width="200" align="center" header-align="center">
|
|
32
|
+
<template slot-scope="scope">
|
|
33
|
+
<el-button type="text" size="mini" @click="onView(scope.row)">详情</el-button>
|
|
34
|
+
<el-button type="text" size="mini" @click="onEdit(scope.row)">编辑</el-button>
|
|
35
|
+
<el-button type="text" size="mini" @click="onRemove(scope.row)">删除</el-button>
|
|
36
|
+
</template>
|
|
37
|
+
</el-table-column>
|
|
38
|
+
</el-table>
|
|
39
|
+
|
|
40
|
+
<el-dialog
|
|
41
|
+
:title="dialogTitle"
|
|
42
|
+
:visible.sync="dialogVisible"
|
|
43
|
+
width="720px"
|
|
44
|
+
>
|
|
45
|
+
<el-form
|
|
46
|
+
ref="addForm"
|
|
47
|
+
:model="form"
|
|
48
|
+
:rules="rules"
|
|
49
|
+
label-width="90px"
|
|
50
|
+
size="small"
|
|
51
|
+
>
|
|
52
|
+
<el-row :gutter="16">
|
|
53
|
+
<el-col :span="12">
|
|
54
|
+
<el-form-item label="人员姓名" prop="name">
|
|
55
|
+
<el-input v-model="form.name" placeholder="请输入" :disabled="isView" />
|
|
56
|
+
</el-form-item>
|
|
57
|
+
</el-col>
|
|
58
|
+
<el-col :span="12">
|
|
59
|
+
<el-form-item label="岗位" prop="postName">
|
|
60
|
+
<el-select v-model="form.postName" placeholder="请选择" style="width: 100%" :disabled="isView">
|
|
61
|
+
<el-option
|
|
62
|
+
v-for="opt in postOptions"
|
|
63
|
+
:key="opt"
|
|
64
|
+
:label="opt"
|
|
65
|
+
:value="opt"
|
|
66
|
+
/>
|
|
67
|
+
</el-select>
|
|
68
|
+
</el-form-item>
|
|
69
|
+
</el-col>
|
|
70
|
+
</el-row>
|
|
71
|
+
<el-row :gutter="16">
|
|
72
|
+
<el-col :span="12">
|
|
73
|
+
<el-form-item label="入行日期" prop="happenPerio">
|
|
74
|
+
<el-date-picker
|
|
75
|
+
v-model="form.happenPerio"
|
|
76
|
+
type="date"
|
|
77
|
+
placeholder="请选择"
|
|
78
|
+
value-format="yyyy-MM-dd"
|
|
79
|
+
style="width: 100%"
|
|
80
|
+
:disabled="isView"
|
|
81
|
+
/>
|
|
82
|
+
</el-form-item>
|
|
83
|
+
</el-col>
|
|
84
|
+
<el-col :span="12">
|
|
85
|
+
<el-form-item label="性别" prop="sex">
|
|
86
|
+
<el-select v-model="form.sex" placeholder="请选择" style="width: 100%" :disabled="isView">
|
|
87
|
+
<el-option label="男" value="1" />
|
|
88
|
+
<el-option label="女" value="2" />
|
|
89
|
+
</el-select>
|
|
90
|
+
</el-form-item>
|
|
91
|
+
</el-col>
|
|
92
|
+
</el-row>
|
|
93
|
+
<el-row :gutter="16">
|
|
94
|
+
<el-col :span="12">
|
|
95
|
+
<el-form-item label="联系方式" prop="telNo">
|
|
96
|
+
<el-input v-model="form.telNo" placeholder="请输入" :disabled="isView" />
|
|
97
|
+
</el-form-item>
|
|
98
|
+
</el-col>
|
|
99
|
+
<el-col :span="12">
|
|
100
|
+
<el-form-item label="出生日期" prop="birthDt">
|
|
101
|
+
<el-date-picker
|
|
102
|
+
v-model="form.birthDt"
|
|
103
|
+
type="date"
|
|
104
|
+
placeholder="请选择"
|
|
105
|
+
value-format="yyyy-MM-dd"
|
|
106
|
+
style="width: 100%"
|
|
107
|
+
:disabled="isView"
|
|
108
|
+
/>
|
|
109
|
+
</el-form-item>
|
|
110
|
+
</el-col>
|
|
111
|
+
</el-row>
|
|
112
|
+
<el-row :gutter="16">
|
|
113
|
+
<el-col :span="24">
|
|
114
|
+
<el-form-item label="家庭住址" prop="dtlAddr">
|
|
115
|
+
<el-input v-model="form.dtlAddr" placeholder="请输入" :disabled="isView" />
|
|
116
|
+
</el-form-item>
|
|
117
|
+
</el-col>
|
|
118
|
+
</el-row>
|
|
119
|
+
<el-row :gutter="16">
|
|
120
|
+
<el-col :span="12">
|
|
121
|
+
<el-form-item label="紧急联系人" prop="emergContactPersonName">
|
|
122
|
+
<el-input v-model="form.emergContactPersonName" placeholder="请输入" :disabled="isView" />
|
|
123
|
+
</el-form-item>
|
|
124
|
+
</el-col>
|
|
125
|
+
<el-col :span="12">
|
|
126
|
+
<el-form-item label="紧急联系方式" prop="emergContactPhoneNo">
|
|
127
|
+
<el-input v-model="form.emergContactPhoneNo" placeholder="请输入" :disabled="isView" />
|
|
128
|
+
</el-form-item>
|
|
129
|
+
</el-col>
|
|
130
|
+
</el-row>
|
|
131
|
+
<el-row :gutter="16">
|
|
132
|
+
<el-col :span="12">
|
|
133
|
+
<el-form-item label="最高学历" prop="highestEduDegreeDesc">
|
|
134
|
+
<el-select v-model="form.highestEduDegreeDesc" placeholder="请选择" style="width: 100%" :disabled="isView">
|
|
135
|
+
<el-option
|
|
136
|
+
v-for="opt in eduOptions"
|
|
137
|
+
:key="opt"
|
|
138
|
+
:label="opt"
|
|
139
|
+
:value="opt"
|
|
140
|
+
/>
|
|
141
|
+
</el-select>
|
|
142
|
+
</el-form-item>
|
|
143
|
+
</el-col>
|
|
144
|
+
<el-col :span="12">
|
|
145
|
+
<el-form-item label="备注" prop="rmk">
|
|
146
|
+
<el-input
|
|
147
|
+
v-model="form.rmk"
|
|
148
|
+
type="textarea"
|
|
149
|
+
:rows="3"
|
|
150
|
+
maxlength="100"
|
|
151
|
+
show-word-limit
|
|
152
|
+
placeholder="请输入"
|
|
153
|
+
:disabled="isView"
|
|
154
|
+
/>
|
|
155
|
+
</el-form-item>
|
|
156
|
+
</el-col>
|
|
157
|
+
</el-row>
|
|
158
|
+
<el-row :gutter="16">
|
|
159
|
+
<el-col :span="24">
|
|
160
|
+
<el-form-item label="选择文件">
|
|
161
|
+
<el-upload
|
|
162
|
+
class="upload-block"
|
|
163
|
+
drag
|
|
164
|
+
action="#"
|
|
165
|
+
:auto-upload="false"
|
|
166
|
+
:file-list="fileList"
|
|
167
|
+
:on-change="onFileChange"
|
|
168
|
+
:on-remove="onFileRemove"
|
|
169
|
+
:disabled="isView"
|
|
170
|
+
>
|
|
171
|
+
<el-button type="primary" plain>上传文件</el-button>
|
|
172
|
+
<div slot="tip" class="el-upload__tip">
|
|
173
|
+
支持格式:png/jpg/docx/pdf,单个文件不能超过10mb
|
|
174
|
+
</div>
|
|
175
|
+
</el-upload>
|
|
176
|
+
</el-form-item>
|
|
177
|
+
</el-col>
|
|
178
|
+
</el-row>
|
|
179
|
+
</el-form>
|
|
180
|
+
<span slot="footer" class="dialog-footer">
|
|
181
|
+
<el-button @click="dialogVisible = false">取消</el-button>
|
|
182
|
+
<el-button
|
|
183
|
+
v-if="dialogMode !== 'view'"
|
|
184
|
+
type="primary"
|
|
185
|
+
@click="onSave"
|
|
186
|
+
>
|
|
187
|
+
保存
|
|
188
|
+
</el-button>
|
|
189
|
+
</span>
|
|
190
|
+
</el-dialog>
|
|
191
|
+
</section>
|
|
192
|
+
</template>
|
|
193
|
+
|
|
194
|
+
<script>
|
|
195
|
+
export default {
|
|
196
|
+
name: "PersonTableView",
|
|
197
|
+
data() {
|
|
198
|
+
return {
|
|
199
|
+
rows: [
|
|
200
|
+
{
|
|
201
|
+
id: 3286648151643648,
|
|
202
|
+
name: "李白",
|
|
203
|
+
sex: "1",
|
|
204
|
+
postName: "保洁",
|
|
205
|
+
happenPerio: "2002-02-02",
|
|
206
|
+
telNo: "18966541247",
|
|
207
|
+
dtlAddr: "北京",
|
|
208
|
+
emergContactPersonName: "王安石",
|
|
209
|
+
emergContactPhoneNo: "15466257489",
|
|
210
|
+
birthDt: "2000-02-02",
|
|
211
|
+
highestEduDegreeDesc: "硕士",
|
|
212
|
+
createTm: "2025-12-25",
|
|
213
|
+
rmk: "好人",
|
|
214
|
+
beloOrgNO: "000291",
|
|
215
|
+
creatorNo: "022171",
|
|
216
|
+
delFlag: "0",
|
|
217
|
+
},
|
|
218
|
+
],
|
|
219
|
+
dialogVisible: false,
|
|
220
|
+
dialogMode: "add",
|
|
221
|
+
editingId: null,
|
|
222
|
+
form: {
|
|
223
|
+
name: "",
|
|
224
|
+
sex: "",
|
|
225
|
+
postName: "",
|
|
226
|
+
happenPerio: "",
|
|
227
|
+
telNo: "",
|
|
228
|
+
dtlAddr: "",
|
|
229
|
+
emergContactPersonName: "",
|
|
230
|
+
emergContactPhoneNo: "",
|
|
231
|
+
birthDt: "",
|
|
232
|
+
highestEduDegreeDesc: "",
|
|
233
|
+
rmk: "",
|
|
234
|
+
},
|
|
235
|
+
rules: {
|
|
236
|
+
name: [{ required: true, message: "请输入人员姓名", trigger: "blur" }],
|
|
237
|
+
postName: [{ required: true, message: "请选择岗位", trigger: "change" }],
|
|
238
|
+
sex: [{ required: true, message: "请选择性别", trigger: "change" }],
|
|
239
|
+
happenPerio: [{ required: true, message: "请选择入行日期", trigger: "change" }],
|
|
240
|
+
telNo: [{ required: true, message: "请输入联系方式", trigger: "blur" }],
|
|
241
|
+
emergContactPersonName: [{ required: true, message: "请输入紧急联系人", trigger: "blur" }],
|
|
242
|
+
emergContactPhoneNo: [{ required: true, message: "请输入紧急联系方式", trigger: "blur" }],
|
|
243
|
+
},
|
|
244
|
+
postOptions: ["保洁", "柜员", "客户经理", "运营专员"],
|
|
245
|
+
eduOptions: ["大专", "本科", "硕士", "博士"],
|
|
246
|
+
fileList: [],
|
|
247
|
+
};
|
|
248
|
+
},
|
|
249
|
+
computed: {
|
|
250
|
+
dialogTitle() {
|
|
251
|
+
if (this.dialogMode === "edit") return "编辑";
|
|
252
|
+
if (this.dialogMode === "view") return "详情";
|
|
253
|
+
return "新增";
|
|
254
|
+
},
|
|
255
|
+
isView() {
|
|
256
|
+
return this.dialogMode === "view";
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
methods: {
|
|
260
|
+
formatSex(v) {
|
|
261
|
+
if (v === "1" || v === 1) return "男";
|
|
262
|
+
if (v === "2" || v === 2) return "女";
|
|
263
|
+
return "";
|
|
264
|
+
},
|
|
265
|
+
onOpenAdd() {
|
|
266
|
+
this.dialogVisible = true;
|
|
267
|
+
this.dialogMode = "add";
|
|
268
|
+
this.editingId = null;
|
|
269
|
+
this.resetForm();
|
|
270
|
+
},
|
|
271
|
+
onEdit(row) {
|
|
272
|
+
this.dialogMode = "edit";
|
|
273
|
+
this.editingId = row.id;
|
|
274
|
+
this.dialogVisible = true;
|
|
275
|
+
this.form = {
|
|
276
|
+
name: row.name || "",
|
|
277
|
+
sex: row.sex || "",
|
|
278
|
+
postName: row.postName || "",
|
|
279
|
+
happenPerio: row.happenPerio || "",
|
|
280
|
+
telNo: row.telNo || "",
|
|
281
|
+
dtlAddr: row.dtlAddr || "",
|
|
282
|
+
emergContactPersonName: row.emergContactPersonName || "",
|
|
283
|
+
emergContactPhoneNo: row.emergContactPhoneNo || "",
|
|
284
|
+
birthDt: row.birthDt || "",
|
|
285
|
+
highestEduDegreeDesc: row.highestEduDegreeDesc || "",
|
|
286
|
+
rmk: row.rmk || "",
|
|
287
|
+
createTm: row.createTm || "",
|
|
288
|
+
};
|
|
289
|
+
this.fileList = [];
|
|
290
|
+
if (this.$refs.addForm) {
|
|
291
|
+
this.$refs.addForm.clearValidate();
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
onView(row) {
|
|
295
|
+
this.dialogMode = "view";
|
|
296
|
+
this.editingId = row.id;
|
|
297
|
+
this.dialogVisible = true;
|
|
298
|
+
this.form = {
|
|
299
|
+
name: row.name || "",
|
|
300
|
+
sex: row.sex || "",
|
|
301
|
+
postName: row.postName || "",
|
|
302
|
+
happenPerio: row.happenPerio || "",
|
|
303
|
+
telNo: row.telNo || "",
|
|
304
|
+
dtlAddr: row.dtlAddr || "",
|
|
305
|
+
emergContactPersonName: row.emergContactPersonName || "",
|
|
306
|
+
emergContactPhoneNo: row.emergContactPhoneNo || "",
|
|
307
|
+
birthDt: row.birthDt || "",
|
|
308
|
+
highestEduDegreeDesc: row.highestEduDegreeDesc || "",
|
|
309
|
+
rmk: row.rmk || "",
|
|
310
|
+
createTm: row.createTm || "",
|
|
311
|
+
};
|
|
312
|
+
this.fileList = [];
|
|
313
|
+
if (this.$refs.addForm) {
|
|
314
|
+
this.$refs.addForm.clearValidate();
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
resetForm() {
|
|
318
|
+
this.form = {
|
|
319
|
+
name: "",
|
|
320
|
+
sex: "",
|
|
321
|
+
postName: "",
|
|
322
|
+
happenPerio: "",
|
|
323
|
+
telNo: "",
|
|
324
|
+
dtlAddr: "",
|
|
325
|
+
emergContactPersonName: "",
|
|
326
|
+
emergContactPhoneNo: "",
|
|
327
|
+
birthDt: "",
|
|
328
|
+
highestEduDegreeDesc: "",
|
|
329
|
+
rmk: "",
|
|
330
|
+
};
|
|
331
|
+
this.fileList = [];
|
|
332
|
+
if (this.$refs.addForm) {
|
|
333
|
+
this.$refs.addForm.clearValidate();
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
onFileChange(file, fileList) {
|
|
337
|
+
this.fileList = fileList.slice();
|
|
338
|
+
},
|
|
339
|
+
onFileRemove(file, fileList) {
|
|
340
|
+
this.fileList = fileList.slice();
|
|
341
|
+
},
|
|
342
|
+
onSave() {
|
|
343
|
+
if (!this.$refs.addForm) return;
|
|
344
|
+
this.$refs.addForm.validate((valid) => {
|
|
345
|
+
if (!valid) return;
|
|
346
|
+
const now = new Date();
|
|
347
|
+
const createTm =
|
|
348
|
+
this.form.createTm ||
|
|
349
|
+
`${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(
|
|
350
|
+
now.getDate()
|
|
351
|
+
).padStart(2, "0")}`;
|
|
352
|
+
const base = {
|
|
353
|
+
name: this.form.name,
|
|
354
|
+
sex: this.form.sex,
|
|
355
|
+
postName: this.form.postName,
|
|
356
|
+
happenPerio: this.form.happenPerio,
|
|
357
|
+
telNo: this.form.telNo,
|
|
358
|
+
dtlAddr: this.form.dtlAddr,
|
|
359
|
+
emergContactPersonName: this.form.emergContactPersonName,
|
|
360
|
+
emergContactPhoneNo: this.form.emergContactPhoneNo,
|
|
361
|
+
birthDt: this.form.birthDt,
|
|
362
|
+
highestEduDegreeDesc: this.form.highestEduDegreeDesc,
|
|
363
|
+
createTm,
|
|
364
|
+
rmk: this.form.rmk,
|
|
365
|
+
beloOrgNO: "",
|
|
366
|
+
creatorNo: "",
|
|
367
|
+
delFlag: "0",
|
|
368
|
+
};
|
|
369
|
+
if (this.dialogMode === "edit" && this.editingId) {
|
|
370
|
+
this.rows = this.rows.map((r) =>
|
|
371
|
+
r.id === this.editingId
|
|
372
|
+
? Object.assign({}, r, base, { id: r.id })
|
|
373
|
+
: r
|
|
374
|
+
);
|
|
375
|
+
} else {
|
|
376
|
+
const row = Object.assign({}, base, { id: Date.now() });
|
|
377
|
+
this.rows = this.rows.concat(row);
|
|
378
|
+
}
|
|
379
|
+
this.dialogVisible = false;
|
|
380
|
+
});
|
|
381
|
+
},
|
|
382
|
+
onRemove(row) {
|
|
383
|
+
if (!row || !row.id) return;
|
|
384
|
+
this.$confirm("确认删除该人员吗?", "提示", { type: "warning" })
|
|
385
|
+
.then(() => {
|
|
386
|
+
this.rows = this.rows.filter((r) => r.id !== row.id);
|
|
387
|
+
})
|
|
388
|
+
.catch(() => {});
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
};
|
|
392
|
+
</script>
|
|
393
|
+
|
|
394
|
+
<style scoped>
|
|
395
|
+
.person-table-page {
|
|
396
|
+
padding: 24px;
|
|
397
|
+
}
|
|
398
|
+
.toolbar {
|
|
399
|
+
margin-bottom: 12px;
|
|
400
|
+
}
|
|
401
|
+
.upload-block {
|
|
402
|
+
width: 100%;
|
|
403
|
+
}
|
|
404
|
+
.dialog-footer {
|
|
405
|
+
text-align: center;
|
|
406
|
+
}
|
|
407
|
+
</style>
|