arms-app 1.0.64 → 1.0.66
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 +413 -14
package/package.json
CHANGED
package/view/4.vue
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<!-- 人员信息表页面 -->
|
|
2
3
|
<section class="person-table-page">
|
|
4
|
+
<!-- 页面标题 -->
|
|
3
5
|
<h1>人员信息表</h1>
|
|
6
|
+
<!-- 工具栏:新增按钮 -->
|
|
7
|
+
<div class="toolbar">
|
|
8
|
+
<el-button type="primary" size="mini" @click="onOpenAdd">新增</el-button>
|
|
9
|
+
</div>
|
|
10
|
+
<!-- 人员信息表格 -->
|
|
4
11
|
<el-table
|
|
5
12
|
:data="rows"
|
|
6
13
|
border
|
|
@@ -8,24 +15,196 @@
|
|
|
8
15
|
size="small"
|
|
9
16
|
style="width: 100%"
|
|
10
17
|
>
|
|
11
|
-
|
|
12
|
-
<el-table-column
|
|
13
|
-
|
|
18
|
+
<!-- 序号列 -->
|
|
19
|
+
<el-table-column type="index" label="序号" width="60" align="center" header-align="center" />
|
|
20
|
+
<!-- 基础信息列 -->
|
|
21
|
+
<el-table-column prop="name" label="人员姓名" min-width="100" align="center" header-align="center" />
|
|
22
|
+
<el-table-column label="性别" width="80" align="center" header-align="center">
|
|
14
23
|
<template slot-scope="scope">
|
|
15
24
|
{{ formatSex(scope.row.sex) }}
|
|
16
25
|
</template>
|
|
17
26
|
</el-table-column>
|
|
18
|
-
<el-table-column prop="postName" label="岗位" min-width="80" />
|
|
19
|
-
<el-table-column prop="happenPerio" label="入行日期" min-width="110" />
|
|
20
|
-
<el-table-column prop="telNo" label="联系方式" min-width="130" />
|
|
21
|
-
<el-table-column prop="dtlAddr" label="现居住地" min-width="120" />
|
|
22
|
-
<el-table-column prop="emergContactPersonName" label="紧急联系人" min-width="100" />
|
|
23
|
-
<el-table-column prop="emergContactPhoneNo" label="紧急联系方式" min-width="130" />
|
|
24
|
-
<el-table-column prop="birthDt" label="出生日期" min-width="110" />
|
|
25
|
-
<el-table-column prop="
|
|
26
|
-
<el-table-column prop="createTm" label="创建日期" min-width="110" />
|
|
27
|
-
<el-table-column prop="rmk" label="备注" min-width="120" />
|
|
27
|
+
<el-table-column prop="postName" label="岗位" min-width="80" align="center" header-align="center" />
|
|
28
|
+
<el-table-column prop="happenPerio" label="入行日期" min-width="110" align="center" header-align="center" />
|
|
29
|
+
<el-table-column prop="telNo" label="联系方式" min-width="130" align="center" header-align="center" />
|
|
30
|
+
<el-table-column prop="dtlAddr" label="现居住地" min-width="120" align="center" header-align="center" />
|
|
31
|
+
<el-table-column prop="emergContactPersonName" label="紧急联系人" min-width="100" align="center" header-align="center" />
|
|
32
|
+
<el-table-column prop="emergContactPhoneNo" label="紧急联系方式" min-width="130" align="center" header-align="center" />
|
|
33
|
+
<el-table-column prop="birthDt" label="出生日期" min-width="110" align="center" header-align="center" />
|
|
34
|
+
<el-table-column prop="最高EduDegreeDesc" label="最高学历" min-width="90" align="center" header-align="center" />
|
|
35
|
+
<el-table-column prop="createTm" label="创建日期" min-width="110" align="center" header-align="center" />
|
|
36
|
+
<el-table-column prop="rmk" label="备注" min-width="120" align="center" header-align="center" />
|
|
37
|
+
<!-- 操作列:详情、编辑、删除 -->
|
|
38
|
+
<el-table-column label="操作" width="200" align="center" header-align="center">
|
|
39
|
+
<template slot-scope="scope">
|
|
40
|
+
<el-button type="text" size="mini" @click="onView(scope.row)">详情</el-button>
|
|
41
|
+
<el-button type="text" size="mini" @click="onEdit(scope.row)">编辑</el-button>
|
|
42
|
+
<el-button type="text" size="mini" @click="onRemove(scope.row)">删除</el-button>
|
|
43
|
+
</template>
|
|
44
|
+
</el-table-column>
|
|
28
45
|
</el-table>
|
|
46
|
+
|
|
47
|
+
<!-- 新增/编辑/查看 弹窗 -->
|
|
48
|
+
<el-dialog
|
|
49
|
+
:title="dialogTitle"
|
|
50
|
+
:visible.sync="dialogVisible"
|
|
51
|
+
width="720px"
|
|
52
|
+
>
|
|
53
|
+
<!-- 人员信息表单 -->
|
|
54
|
+
<el-form
|
|
55
|
+
ref="addForm"
|
|
56
|
+
:model="form"
|
|
57
|
+
:rules="rules"
|
|
58
|
+
label-width="90px"
|
|
59
|
+
size="small"
|
|
60
|
+
>
|
|
61
|
+
<!-- 第一行:姓名、岗位 -->
|
|
62
|
+
<el-row :gutter="16">
|
|
63
|
+
<el-col :span="12">
|
|
64
|
+
<el-form-item label="人员姓名" prop="name">
|
|
65
|
+
<el-input v-model="form.name" placeholder="请输入" :disabled="isView" />
|
|
66
|
+
</el-form-item>
|
|
67
|
+
</el-col>
|
|
68
|
+
<el-col :span="12">
|
|
69
|
+
<el-form-item label="岗位" prop="postName">
|
|
70
|
+
<el-select v-model="form.postName" placeholder="请选择" style="width: 100%" :disabled="isView">
|
|
71
|
+
<el-option
|
|
72
|
+
v-for="opt in postOptions"
|
|
73
|
+
:key="opt"
|
|
74
|
+
:label="opt"
|
|
75
|
+
:value="opt"
|
|
76
|
+
/>
|
|
77
|
+
</el-select>
|
|
78
|
+
</el-form-item>
|
|
79
|
+
</el-col>
|
|
80
|
+
</el-row>
|
|
81
|
+
<!-- 第二行:入行日期、性别 -->
|
|
82
|
+
<el-row :gutter="16">
|
|
83
|
+
<el-col :span="12">
|
|
84
|
+
<el-form-item label="入行日期" prop="happenPerio">
|
|
85
|
+
<el-date-picker
|
|
86
|
+
v-model="form.happenPerio"
|
|
87
|
+
type="date"
|
|
88
|
+
placeholder="请选择"
|
|
89
|
+
value-format="yyyy-MM-dd"
|
|
90
|
+
style="width: 100%"
|
|
91
|
+
:disabled="isView"
|
|
92
|
+
/>
|
|
93
|
+
</el-form-item>
|
|
94
|
+
</el-col>
|
|
95
|
+
<el-col :span="12">
|
|
96
|
+
<el-form-item label="性别" prop="sex">
|
|
97
|
+
<el-select v-model="form.sex" placeholder="请选择" style="width: 100%" :disabled="isView">
|
|
98
|
+
<el-option label="男" value="1" />
|
|
99
|
+
<el-option label="女" value="2" />
|
|
100
|
+
</el-select>
|
|
101
|
+
</el-form-item>
|
|
102
|
+
</el-col>
|
|
103
|
+
</el-row>
|
|
104
|
+
<!-- 第三行:联系方式、出生日期 -->
|
|
105
|
+
<el-row :gutter="16">
|
|
106
|
+
<el-col :span="12">
|
|
107
|
+
<el-form-item label="联系方式" prop="telNo">
|
|
108
|
+
<el-input v-model="form.telNo" placeholder="请输入" :disabled="isView" />
|
|
109
|
+
</el-form-item>
|
|
110
|
+
</el-col>
|
|
111
|
+
<el-col :span="12">
|
|
112
|
+
<el-form-item label="出生日期" prop="birthDt">
|
|
113
|
+
<el-date-picker
|
|
114
|
+
v-model="form.birthDt"
|
|
115
|
+
type="date"
|
|
116
|
+
placeholder="请选择"
|
|
117
|
+
value-format="yyyy-MM-dd"
|
|
118
|
+
style="width: 100%"
|
|
119
|
+
:disabled="isView"
|
|
120
|
+
/>
|
|
121
|
+
</el-form-item>
|
|
122
|
+
</el-col>
|
|
123
|
+
</el-row>
|
|
124
|
+
<!-- 第四行:家庭住址 -->
|
|
125
|
+
<el-row :gutter="16">
|
|
126
|
+
<el-col :span="24">
|
|
127
|
+
<el-form-item label="家庭住址" prop="dtlAddr">
|
|
128
|
+
<el-input v-model="form.dtlAddr" placeholder="请输入" :disabled="isView" />
|
|
129
|
+
</el-form-item>
|
|
130
|
+
</el-col>
|
|
131
|
+
</el-row>
|
|
132
|
+
<!-- 第五行:紧急联系人及联系方式 -->
|
|
133
|
+
<el-row :gutter="16">
|
|
134
|
+
<el-col :span="12">
|
|
135
|
+
<el-form-item label="紧急联系人" prop="emergContactPersonName">
|
|
136
|
+
<el-input v-model="form.emergContactPersonName" placeholder="请输入" :disabled="isView" />
|
|
137
|
+
</el-form-item>
|
|
138
|
+
</el-col>
|
|
139
|
+
<el-col :span="12">
|
|
140
|
+
<el-form-item label="紧急联系方式" prop="emergContactPhoneNo">
|
|
141
|
+
<el-input v-model="form.emergContactPhoneNo" placeholder="请输入" :disabled="isView" />
|
|
142
|
+
</el-form-item>
|
|
143
|
+
</el-col>
|
|
144
|
+
</el-row>
|
|
145
|
+
<!-- 第六行:最高学历、备注 -->
|
|
146
|
+
<el-row :gutter="16">
|
|
147
|
+
<el-col :span="12">
|
|
148
|
+
<el-form-item label="最高学历" prop="highestEduDegreeDesc">
|
|
149
|
+
<el-select v-model="form.highestEduDegreeDesc" placeholder="请选择" style="width: 100%" :disabled="isView">
|
|
150
|
+
<el-option
|
|
151
|
+
v-for="opt in eduOptions"
|
|
152
|
+
:key="opt"
|
|
153
|
+
:label="opt"
|
|
154
|
+
:value="opt"
|
|
155
|
+
/>
|
|
156
|
+
</el-select>
|
|
157
|
+
</el-form-item>
|
|
158
|
+
</el-col>
|
|
159
|
+
<el-col :span="12">
|
|
160
|
+
<el-form-item label="备注" prop="rmk">
|
|
161
|
+
<el-input
|
|
162
|
+
v-model="form.rmk"
|
|
163
|
+
type="textarea"
|
|
164
|
+
:rows="3"
|
|
165
|
+
maxlength="100"
|
|
166
|
+
show-word-limit
|
|
167
|
+
placeholder="请输入"
|
|
168
|
+
:disabled="isView"
|
|
169
|
+
/>
|
|
170
|
+
</el-form-item>
|
|
171
|
+
</el-col>
|
|
172
|
+
</el-row>
|
|
173
|
+
<!-- 第七行:附件上传 -->
|
|
174
|
+
<el-row :gutter="16">
|
|
175
|
+
<el-col :span="24">
|
|
176
|
+
<el-form-item label="选择文件">
|
|
177
|
+
<el-upload
|
|
178
|
+
class="upload-block"
|
|
179
|
+
drag
|
|
180
|
+
action="#"
|
|
181
|
+
:auto-upload="false"
|
|
182
|
+
:file-list="fileList"
|
|
183
|
+
:on-change="onFileChange"
|
|
184
|
+
:on-remove="onFileRemove"
|
|
185
|
+
:disabled="isView"
|
|
186
|
+
>
|
|
187
|
+
<el-button type="primary" plain>上传文件</el-button>
|
|
188
|
+
<div slot="tip" class="el-upload__tip">
|
|
189
|
+
支持格式:png/jpg/docx/pdf,单个文件不能超过10mb
|
|
190
|
+
</div>
|
|
191
|
+
</el-upload>
|
|
192
|
+
</el-form-item>
|
|
193
|
+
</el-col>
|
|
194
|
+
</el-row>
|
|
195
|
+
</el-form>
|
|
196
|
+
<!-- 弹窗底部按钮 -->
|
|
197
|
+
<span slot="footer" class="dialog-footer">
|
|
198
|
+
<el-button @click="dialogVisible = false">取消</el-button>
|
|
199
|
+
<el-button
|
|
200
|
+
v-if="dialogMode !== 'view'"
|
|
201
|
+
type="primary"
|
|
202
|
+
@click="onSave"
|
|
203
|
+
>
|
|
204
|
+
保存
|
|
205
|
+
</el-button>
|
|
206
|
+
</span>
|
|
207
|
+
</el-dialog>
|
|
29
208
|
</section>
|
|
30
209
|
</template>
|
|
31
210
|
|
|
@@ -34,34 +213,246 @@ export default {
|
|
|
34
213
|
name: "PersonTableView",
|
|
35
214
|
data() {
|
|
36
215
|
return {
|
|
216
|
+
// 表格数据源:人员列表
|
|
37
217
|
rows: [
|
|
38
218
|
{
|
|
219
|
+
// 唯一标识
|
|
39
220
|
id: 3286648151643648,
|
|
221
|
+
// 人员姓名
|
|
40
222
|
name: "李白",
|
|
223
|
+
// 性别:1-男,2-女
|
|
41
224
|
sex: "1",
|
|
225
|
+
// 岗位名称
|
|
42
226
|
postName: "保洁",
|
|
227
|
+
// 入行日期(yyyy-MM-dd)
|
|
43
228
|
happenPerio: "2002-02-02",
|
|
229
|
+
// 联系电话
|
|
44
230
|
telNo: "18966541247",
|
|
231
|
+
// 现居住地
|
|
45
232
|
dtlAddr: "北京",
|
|
233
|
+
// 紧急联系人姓名
|
|
46
234
|
emergContactPersonName: "王安石",
|
|
235
|
+
// 紧急联系人电话
|
|
47
236
|
emergContactPhoneNo: "15466257489",
|
|
237
|
+
// 出生日期(yyyy-MM-dd)
|
|
48
238
|
birthDt: "2000-02-02",
|
|
239
|
+
// 最高学历说明
|
|
49
240
|
highestEduDegreeDesc: "硕士",
|
|
241
|
+
// 创建日期(yyyy-MM-dd)
|
|
50
242
|
createTm: "2025-12-25",
|
|
243
|
+
// 备注信息
|
|
51
244
|
rmk: "好人",
|
|
245
|
+
// 所属机构号
|
|
52
246
|
beloOrgNO: "000291",
|
|
247
|
+
// 创建人工号
|
|
53
248
|
creatorNo: "022171",
|
|
249
|
+
// 删除标识:0-正常 1-删除
|
|
54
250
|
delFlag: "0",
|
|
55
251
|
},
|
|
56
252
|
],
|
|
253
|
+
// 弹窗显隐状态
|
|
254
|
+
dialogVisible: false,
|
|
255
|
+
// 弹窗模式:add 新增 / edit 编辑 / view 查看
|
|
256
|
+
dialogMode: "add",
|
|
257
|
+
// 当前编辑或查看的人员ID
|
|
258
|
+
editingId: null,
|
|
259
|
+
// 表单数据模型
|
|
260
|
+
form: {
|
|
261
|
+
// 人员姓名
|
|
262
|
+
name: "",
|
|
263
|
+
// 性别:1-男,2-女
|
|
264
|
+
sex: "",
|
|
265
|
+
// 岗位名称
|
|
266
|
+
postName: "",
|
|
267
|
+
// 入行日期
|
|
268
|
+
happenPerio: "",
|
|
269
|
+
// 联系电话
|
|
270
|
+
telNo: "",
|
|
271
|
+
// 家庭住址
|
|
272
|
+
dtlAddr: "",
|
|
273
|
+
// 紧急联系人姓名
|
|
274
|
+
emergContactPersonName: "",
|
|
275
|
+
// 紧急联系人电话
|
|
276
|
+
emergContactPhoneNo: "",
|
|
277
|
+
// 出生日期
|
|
278
|
+
birthDt: "",
|
|
279
|
+
// 最高学历说明
|
|
280
|
+
highestEduDegreeDesc: "",
|
|
281
|
+
// 备注信息
|
|
282
|
+
rmk: "",
|
|
283
|
+
},
|
|
284
|
+
// 表单校验规则
|
|
285
|
+
rules: {
|
|
286
|
+
name: [{ required: true, message: "请输入人员姓名", trigger: "blur" }],
|
|
287
|
+
postName: [{ required: true, message: "请选择岗位", trigger: "change" }],
|
|
288
|
+
sex: [{ required: true, message: "请选择性别", trigger: "change" }],
|
|
289
|
+
happenPerio: [{ required: true, message: "请选择入行日期", trigger: "change" }],
|
|
290
|
+
telNo: [{ required: true, message: "请输入联系方式", trigger: "blur" }],
|
|
291
|
+
emergContactPersonName: [{ required: true, message: "请输入紧急联系人", trigger: "blur" }],
|
|
292
|
+
emergContactPhoneNo: [{ required: true, message: "请输入紧急联系方式", trigger: "blur" }],
|
|
293
|
+
},
|
|
294
|
+
// 岗位下拉选项
|
|
295
|
+
postOptions: ["保洁", "柜员", "客户经理", "运营专员"],
|
|
296
|
+
// 学历下拉选项
|
|
297
|
+
eduOptions: ["大专", "本科", "硕士", "博士"],
|
|
298
|
+
// 上传的附件列表
|
|
299
|
+
fileList: [],
|
|
57
300
|
};
|
|
58
301
|
},
|
|
302
|
+
computed: {
|
|
303
|
+
// 弹窗标题文案
|
|
304
|
+
dialogTitle() {
|
|
305
|
+
if (this.dialogMode === "edit") return "编辑";
|
|
306
|
+
if (this.dialogMode === "view") return "详情";
|
|
307
|
+
return "新增";
|
|
308
|
+
},
|
|
309
|
+
// 是否为只读查看模式
|
|
310
|
+
isView() {
|
|
311
|
+
return this.dialogMode === "view";
|
|
312
|
+
},
|
|
313
|
+
},
|
|
59
314
|
methods: {
|
|
315
|
+
// 性别字段格式化显示
|
|
60
316
|
formatSex(v) {
|
|
61
317
|
if (v === "1" || v === 1) return "男";
|
|
62
318
|
if (v === "2" || v === 2) return "女";
|
|
63
319
|
return "";
|
|
64
320
|
},
|
|
321
|
+
// 打开新增弹窗
|
|
322
|
+
onOpenAdd() {
|
|
323
|
+
this.dialogVisible = true;
|
|
324
|
+
this.dialogMode = "add";
|
|
325
|
+
this.editingId = null;
|
|
326
|
+
this.resetForm();
|
|
327
|
+
},
|
|
328
|
+
// 打开编辑弹窗并回显数据
|
|
329
|
+
onEdit(row) {
|
|
330
|
+
this.dialogMode = "edit";
|
|
331
|
+
this.editingId = row.id;
|
|
332
|
+
this.dialogVisible = true;
|
|
333
|
+
this.form = {
|
|
334
|
+
name: row.name || "",
|
|
335
|
+
sex: row.sex || "",
|
|
336
|
+
postName: row.postName || "",
|
|
337
|
+
happenPerio: row.happenPerio || "",
|
|
338
|
+
telNo: row.telNo || "",
|
|
339
|
+
dtlAddr: row.dtlAddr || "",
|
|
340
|
+
emergContactPersonName: row.emergContactPersonName || "",
|
|
341
|
+
emergContactPhoneNo: row.emergContactPhoneNo || "",
|
|
342
|
+
birthDt: row.birthDt || "",
|
|
343
|
+
highestEduDegreeDesc: row.highestEduDegreeDesc || "",
|
|
344
|
+
rmk: row.rmk || "",
|
|
345
|
+
createTm: row.createTm || "",
|
|
346
|
+
};
|
|
347
|
+
this.fileList = [];
|
|
348
|
+
if (this.$refs.addForm) {
|
|
349
|
+
this.$refs.addForm.clearValidate();
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
// 打开详情弹窗(只读)
|
|
353
|
+
onView(row) {
|
|
354
|
+
this.dialogMode = "view";
|
|
355
|
+
this.editingId = row.id;
|
|
356
|
+
this.dialogVisible = true;
|
|
357
|
+
this.form = {
|
|
358
|
+
name: row.name || "",
|
|
359
|
+
sex: row.sex || "",
|
|
360
|
+
postName: row.postName || "",
|
|
361
|
+
happenPerio: row.happenPerio || "",
|
|
362
|
+
telNo: row.telNo || "",
|
|
363
|
+
dtlAddr: row.dtlAddr || "",
|
|
364
|
+
emergContactPersonName: row.emergContactPersonName || "",
|
|
365
|
+
emergContactPhoneNo: row.emergContactPhoneNo || "",
|
|
366
|
+
birthDt: row.birthDt || "",
|
|
367
|
+
highestEduDegreeDesc: row.highestEduDegreeDesc || "",
|
|
368
|
+
rmk: row.rmk || "",
|
|
369
|
+
createTm: row.createTm || "",
|
|
370
|
+
};
|
|
371
|
+
this.fileList = [];
|
|
372
|
+
if (this.$refs.addForm) {
|
|
373
|
+
this.$refs.addForm.clearValidate();
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
// 重置表单数据及校验
|
|
377
|
+
resetForm() {
|
|
378
|
+
this.form = {
|
|
379
|
+
name: "",
|
|
380
|
+
sex: "",
|
|
381
|
+
postName: "",
|
|
382
|
+
happenPerio: "",
|
|
383
|
+
telNo: "",
|
|
384
|
+
dtlAddr: "",
|
|
385
|
+
emergContactPersonName: "",
|
|
386
|
+
emergContactPhoneNo: "",
|
|
387
|
+
birthDt: "",
|
|
388
|
+
highestEduDegreeDesc: "",
|
|
389
|
+
rmk: "",
|
|
390
|
+
};
|
|
391
|
+
this.fileList = [];
|
|
392
|
+
if (this.$refs.addForm) {
|
|
393
|
+
this.$refs.addForm.clearValidate();
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
// 文件选择变更回调
|
|
397
|
+
onFileChange(file, fileList) {
|
|
398
|
+
this.fileList = fileList.slice();
|
|
399
|
+
},
|
|
400
|
+
// 文件移除回调
|
|
401
|
+
onFileRemove(file, fileList) {
|
|
402
|
+
this.fileList = fileList.slice();
|
|
403
|
+
},
|
|
404
|
+
// 保存(新增或编辑)人员信息
|
|
405
|
+
onSave() {
|
|
406
|
+
if (!this.$refs.addForm) return;
|
|
407
|
+
this.$refs.addForm.validate((valid) => {
|
|
408
|
+
if (!valid) return;
|
|
409
|
+
const now = new Date();
|
|
410
|
+
const createTm =
|
|
411
|
+
this.form.createTm ||
|
|
412
|
+
`${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(
|
|
413
|
+
now.getDate()
|
|
414
|
+
).padStart(2, "0")}`;
|
|
415
|
+
const base = {
|
|
416
|
+
name: this.form.name,
|
|
417
|
+
sex: this.form.sex,
|
|
418
|
+
postName: this.form.postName,
|
|
419
|
+
happenPerio: this.form.happenPerio,
|
|
420
|
+
telNo: this.form.telNo,
|
|
421
|
+
dtlAddr: this.form.dtlAddr,
|
|
422
|
+
emergContactPersonName: this.form.emergContactPersonName,
|
|
423
|
+
emergContactPhoneNo: this.form.emergContactPhoneNo,
|
|
424
|
+
birthDt: this.form.birthDt,
|
|
425
|
+
highestEduDegreeDesc: this.form.highestEduDegreeDesc,
|
|
426
|
+
createTm,
|
|
427
|
+
rmk: this.form.rmk,
|
|
428
|
+
beloOrgNO: "",
|
|
429
|
+
creatorNo: "",
|
|
430
|
+
delFlag: "0",
|
|
431
|
+
};
|
|
432
|
+
if (this.dialogMode === "edit" && this.editingId) {
|
|
433
|
+
// 编辑模式:更新原有记录
|
|
434
|
+
this.rows = this.rows.map((r) =>
|
|
435
|
+
r.id === this.editingId
|
|
436
|
+
? Object.assign({}, r, base, { id: r.id })
|
|
437
|
+
: r
|
|
438
|
+
);
|
|
439
|
+
} else {
|
|
440
|
+
// 新增模式:追加新记录
|
|
441
|
+
const row = Object.assign({}, base, { id: Date.now() });
|
|
442
|
+
this.rows = this.rows.concat(row);
|
|
443
|
+
}
|
|
444
|
+
this.dialogVisible = false;
|
|
445
|
+
});
|
|
446
|
+
},
|
|
447
|
+
// 删除人员信息
|
|
448
|
+
onRemove(row) {
|
|
449
|
+
if (!row || !row.id) return;
|
|
450
|
+
this.$confirm("确认删除该人员吗?", "提示", { type: "warning" })
|
|
451
|
+
.then(() => {
|
|
452
|
+
this.rows = this.rows.filter((r) => r.id !== row.id);
|
|
453
|
+
})
|
|
454
|
+
.catch(() => {});
|
|
455
|
+
},
|
|
65
456
|
},
|
|
66
457
|
};
|
|
67
458
|
</script>
|
|
@@ -70,5 +461,13 @@ export default {
|
|
|
70
461
|
.person-table-page {
|
|
71
462
|
padding: 24px;
|
|
72
463
|
}
|
|
464
|
+
.toolbar {
|
|
465
|
+
margin-bottom: 12px;
|
|
466
|
+
}
|
|
467
|
+
.upload-block {
|
|
468
|
+
width: 100%;
|
|
469
|
+
}
|
|
470
|
+
.dialog-footer {
|
|
471
|
+
text-align: center;
|
|
472
|
+
}
|
|
73
473
|
</style>
|
|
74
|
-
|