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
<template>
<div>
<a-form-model ref="form" :model="formData" :rules="rules">
<a-form-model-item label="姓 名" prop="personName">
<a-input v-model="formData.personName" :maxLength="30" style="width:180px;" />
</a-form-model-item>
<a-form-model-item label="民 族" prop="nation">
<para-select v-model="formData.nation" :width="180" :typeId="11" />
</a-form-model-item>
<a-form-model-item label="职 称" prop="title">
<para-multi-select :width="180" v-model="formData.title" :typeId="7" />
</a-form-model-item>
<a-form-model-item label="专 业" prop="spec">
<para-multi-select :width="180" v-model="formData.spec" :typeId="57" />
</a-form-model-item>
<a-form-model-item label="学 位" prop="degree">
<para-select v-model="formData.degree" :width="180" :typeId="9" />
</a-form-model-item>
<a-form-model-item label="职 务" prop="duty">
<a-input v-model="formData.duty" :maxLength="30" style="width:180px;" />
</a-form-model-item>
<a-form-model-item label="联系电话" prop="telephone">
<a-input v-model="formData.telephone" :maxLength="30" style="width:180px;" />
</a-form-model-item>
<a-form-model-item label="传 真" prop="fax">
<a-input v-model="formData.fax" :maxLength="30" style="width:180px;" />
</a-form-model-item>
<a-form-model-item label="邮 箱" prop="email">
<a-input v-model="formData.email" :maxLength="30" style="width:180px;" />
</a-form-model-item>
<a-form-model-item label="通讯地址" prop="address">
<a-input v-model="formData.address" :maxLength="60" style="width:180px;" />
</a-form-model-item>
</a-form-model>
</div>
</template>
<script>
import { isEmptyParams, hideIdCard, hidePhone, checkEmail } from "@/views/utils/common"
export default {
name: "infoEdit",
components: {
},
data () {
return {
rules: {
personName: [{ required: true, message: '*', trigger: 'blur' },],
nation: [{ required: true, message: '*', trigger: 'change' }],
title: [{ required: true, message: '*', trigger: 'change' }],
spec: [{ required: true, message: '*', trigger: 'change' }],
degree: [{ required: true, message: '*', trigger: 'change' }],
duty: [{ required: true, message: '*', trigger: 'blur' }],
telephone: [{ required: true, message: '*', trigger: 'blur' },],
fax: [{ required: true, message: '*', trigger: 'blur' },],
email: [{ required: true, message: '*', trigger: 'blur' },],
address: [{ required: true, message: '*', trigger: 'blur' },],
},
}
},
props: {
formData: {
type: Object,
default: () => {
return null
}
},
},
created () {
},
methods: {
submit () {
this.$refs.form.validate(valid => {
if (valid) {
this.$emit('load', true)
let pars = isEmptyParams(this.formData)
let par = { ...pars }
this.$api.person.updatePerson(par).then(({ data = {} }) => {
if (data) {
this.$message.success('成功!')
}
this.$emit('load', false)
}).catch(() => { this.$emit('load', false) })
} else {
this.$message.warn('信息未填写完全!')
return false
}
});
},
}
}
</script>
<style scoped lang="less">
.app-content {
padding: 10px 8px 10px 8px;
min-width: 920px;
.border-style {
border-radius: 4px;
border: 1px solid #e6ebf5;
background-color: #ffffff;
overflow: hidden;
color: #303133;
-webkit-transition: 0.3s;
transition: 0.3s;
}
.card-left {
float: left;
width: 300px;
height: 600px;
margin-right: 6px;
.holder-photo {
margin: 20px 0px 10px 0px;
text-align: center;
}
.holder-photo > img {
width: 104px;
height: 104px;
margin-bottom: 10px;
}
.holder-info {
padding: 0px 10px 0px 10px;
.ant-row .ant-col {
padding: 3px 5px 3px 5px;
}
}
.title {
text-align: right;
}
}
.card-right {
float: left;
width: calc(100% - 320px);
min-width: 600px;
min-height: 200px;
padding: 0px 15px 15px 15px;
.ant-form-item {
margin-bottom: 0px;
}
::v-deep .ant-row {
.ant-col {
display: inline-block;
}
.ant-form-item-label {
width: 70px;
}
.ant-form-item-control-wrapper {
width: calc(100% - 70px);
}
.ant-form-explain {
margin-left: 5px;
display: inline-block;
}
}
}
}
</style>