0a06b2d1
wuxw
开发完成投诉建议
|
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
|
<el-button type="primary" @click="selectComplaintRoom" style="margin-left:10px">
{{ $t('addComplaint.register') }}
</el-button>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item :label="$t('addComplaint.contact')" prop="complaintName">
<el-input v-model="addComplaintInfo.complaintName" :placeholder="$t('addComplaint.contactPlaceholder')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('addComplaint.phone')" prop="tel">
<el-input v-model="addComplaintInfo.tel" :placeholder="$t('addComplaint.phonePlaceholder')" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item :label="$t('addComplaint.content')" prop="context">
<el-input type="textarea" :rows="4" v-model="addComplaintInfo.context"
:placeholder="$t('addComplaint.contentPlaceholder')" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24" style="text-align:right">
<el-button type="warning" @click="goBack">{{ $t('common.back') }}</el-button>
<el-button type="primary" @click="saveComplaint">{{ $t('addComplaint.register') }}</el-button>
</el-col>
</el-row>
</el-form>
</el-card>
|
0a06b2d1
wuxw
开发完成投诉建议
|
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
|
export default {
name: 'AddComplaintList',
data() {
return {
addComplaintInfo: {
complaintTypes: [],
typeCd: '',
complaintName: '',
tel: '',
context: '',
communityId: '',
roomId: '',
roomName: '',
ownerId: '',
ownerName: ''
},
rules: {
typeCd: [{ required: true, message: this.$t('addComplaint.typeRequired'), trigger: 'blur' }],
complaintName: [
{ required: true, message: this.$t('addComplaint.contactRequired'), trigger: 'blur' },
{ max: 200, message: this.$t('addComplaint.contactMaxLength'), trigger: 'blur' }
],
tel: [
{ required: true, message: this.$t('addComplaint.phoneRequired'), trigger: 'blur' },
{ pattern: /^1[3-9]\d{9}$/, message: this.$t('addComplaint.phoneFormat'), trigger: 'blur' }
],
context: [
{ required: true, message: this.$t('addComplaint.contentRequired'), trigger: 'blur' },
{ max: 4000, message: this.$t('addComplaint.contentMaxLength'), trigger: 'blur' }
]
}
}
},
|
0a06b2d1
wuxw
开发完成投诉建议
|
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
this.listComplaintTypes()
},
methods: {
async listComplaintTypes() {
try {
const params = {
page: 1,
row: 100,
communityId: this.communityId
}
const { data } = await listComplaintTypes(params)
this.addComplaintInfo.complaintTypes = data
} catch (error) {
this.$message.error(this.$t('addComplaint.fetchTypesError'))
}
},
selectComplaintRoom() {
|
0a06b2d1
wuxw
开发完成投诉建议
|
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
|
},
async saveComplaint() {
await this.$refs.form.validate()
try {
this.addComplaintInfo.communityId = this.communityId
await saveComplaint(this.addComplaintInfo)
this.$message.success(this.$t('addComplaint.saveSuccess'))
this.goBack()
} catch (error) {
this.$message.error(error.message || this.$t('addComplaint.saveError'))
}
},
goBack() {
this.$router.go(-1)
}
}
}
</script>
<style scoped>
.add-complaint-container {
padding: 20px;
}
.box-card {
margin-bottom: 20px;
}
</style>
|