6ec243d6
wuxw
v1.9 点击提交后,成功提示没有...
|
1
|
<template>
|
a99eb7a5
wuxw
开发完成办公下功能
|
2
3
4
5
6
7
8
9
10
11
12
|
<div class="edit-examine-staff-container">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>{{ $t('editExamineStaff.title') }}</span>
<div class="header-tools">
<el-button type="primary" size="small" @click="_goBack">
<i class="el-icon-close"></i>{{ $t('common.back') }}
</el-button>
</div>
</div>
|
2e81c59f
wuxw
完成办公功能测试
|
13
|
<el-form ref="form" :model="editExamineStaffInfo" label-width="120px" class="text-left">
|
a99eb7a5
wuxw
开发完成办公下功能
|
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
|
<el-row>
<el-col :span="24">
<el-form-item :label="$t('editExamineStaff.staffName')">
<el-input v-model="editExamineStaffInfo.staffName" disabled
:placeholder="$t('editExamineStaff.staffNamePlaceholder')">
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item :label="$t('editExamineStaff.projects')">
<el-checkbox-group v-model="editExamineStaffInfo.projectIds">
<el-checkbox v-for="(item, index) in editExamineStaffInfo.allProjects" :key="index"
:label="item.projectId">
{{ item.name }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item :label="$t('editExamineStaff.staffPhoto')">
|
2e81c59f
wuxw
完成办公功能测试
|
40
|
<upload-image-url ref="uploadImage" :image-count="1" @notifyUploadCoverImage="handleUploadImage">
|
a99eb7a5
wuxw
开发完成办公下功能
|
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
|
</upload-image-url>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item :label="$t('editExamineStaff.post')">
<el-input v-model="editExamineStaffInfo.post" :placeholder="$t('editExamineStaff.postPlaceholder')">
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item :label="$t('editExamineStaff.introduction')">
<el-input type="textarea" :rows="5" v-model="editExamineStaffInfo.introduction">
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="footer-buttons">
<el-button type="warning" @click="_goBack">
<i class="el-icon-close"></i>{{ $t('common.back') }}
</el-button>
<el-button type="primary" @click="_updateExamineStaff">
<i class="el-icon-check"></i>{{ $t('common.submit') }}
</el-button>
</div>
</el-card>
</div>
</template>
<script>
import UploadImageUrl from '@/components/upload/UploadImageUrl'
import { updateExamineStaff, listExamineProjects, listExamineStaffs } from '@/api/oa/editExamineStaffApi'
import { getCommunityId } from '@/api/community/communityApi'
export default {
name: 'EditExamineStaffList',
components: {
UploadImageUrl
},
data() {
return {
editExamineStaffInfo: {
esId: '',
staffName: '',
staffId: '',
post: '',
introduction: '',
headerImg: '',
allProjects: [],
projectIds: []
},
communityId: ''
}
},
created() {
this.communityId = getCommunityId()
this.editExamineStaffInfo.esId = this.$route.query.esId
this._listExamineProjects()
this._listExamineStaffs()
},
methods: {
handleUploadImage(images) {
if (images.length > 0) {
|
2e81c59f
wuxw
完成办公功能测试
|
111
|
this.editExamineStaffInfo.headerImg = images[0]
|
a99eb7a5
wuxw
开发完成办公下功能
|
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
} else {
this.editExamineStaffInfo.headerImg = ''
}
},
async _updateExamineStaff() {
try {
if (!this.validateForm()) {
return
}
this.editExamineStaffInfo.communityId = this.communityId
const res = await updateExamineStaff(this.editExamineStaffInfo)
if (res.code === 0) {
|
6ec243d6
wuxw
v1.9 点击提交后,成功提示没有...
|
126
|
this.$message.success(this.$t('common.operationSuccess'))
|
a99eb7a5
wuxw
开发完成办公下功能
|
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
|
this._goBack()
} else {
this.$message.error(res.msg)
}
} catch (error) {
this.$message.error(this.$t('common.updateError'))
}
},
validateForm() {
if (!this.editExamineStaffInfo.staffId) {
this.$message.error(this.$t('editExamineStaff.staffNameRequired'))
return false
}
if (!this.editExamineStaffInfo.post) {
this.$message.error(this.$t('editExamineStaff.postRequired'))
return false
}
return true
},
async _listExamineProjects() {
try {
const params = {
page: 1,
row: 100,
communityId: this.communityId
}
const { data } = await listExamineProjects(params)
this.editExamineStaffInfo.allProjects = data
} catch (error) {
this.$message.error(this.$t('editExamineStaff.fetchProjectsError'))
}
},
async _listExamineStaffs() {
try {
const params = {
page: 1,
row: 1,
esId: this.editExamineStaffInfo.esId,
communityId: this.communityId
}
const { data } = await listExamineStaffs(params)
if (data && data.length > 0) {
Object.assign(this.editExamineStaffInfo, data[0])
this.editExamineStaffInfo.projectIds = data[0].projects.map(item => item.projectId)
if (this.editExamineStaffInfo.headerImg) {
|
32722b0a
wuxw
v1.9 优化办公和合同测试 部分...
|
174
|
this.$refs.uploadImage.setImages([this.editExamineStaffInfo.headerImg])
|
a99eb7a5
wuxw
开发完成办公下功能
|
175
176
177
|
}
}
} catch (error) {
|
32722b0a
wuxw
v1.9 优化办公和合同测试 部分...
|
178
|
console.error('请求失败:', error)
|
a99eb7a5
wuxw
开发完成办公下功能
|
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
|
this.$message.error(this.$t('editExamineStaff.fetchStaffError'))
}
},
_goBack() {
this.$router.go(-1)
}
}
}
</script>
<style lang="scss" scoped>
.edit-examine-staff-container {
padding: 20px;
.box-card {
width: 100%;
.clearfix {
display: flex;
justify-content: space-between;
align-items: center;
}
.header-tools {
float: right;
}
.footer-buttons {
text-align: right;
margin-top: 20px;
.el-button {
margin-left: 10px;
}
}
}
.el-form-item {
margin-bottom: 22px;
}
.el-checkbox {
margin-right: 15px;
}
}
</style>
|