v1.9 优化添加小区因为提示bug

This commit is contained in:
wuxw 2025-11-28 14:37:55 +08:00
parent 16b469fe4b
commit b783cddda1
2 changed files with 63 additions and 14 deletions

View File

@ -1,26 +1,26 @@
<template> <template>
<el-dialog :title="$t('addCommunity.title')" :visible.sync="visible" width="40%" @close="clearAddCommunityInfo"> <el-dialog :title="$t('addCommunity.title')" :visible.sync="visible" width="40%" @close="clearAddCommunityInfo">
<el-form ref="form" :model="addCommunityInfo" label-width="120px" class="text-left"> <el-form ref="form" :model="addCommunityInfo" :rules="rules" label-width="120px" class="text-left">
<el-form-item :label="$t('addCommunity.name')" prop="name" required> <el-form-item :label="$t('addCommunity.name')" prop="name" >
<el-input v-model="addCommunityInfo.name" :placeholder="$t('addCommunity.name')" /> <el-input v-model="addCommunityInfo.name" :placeholder="$t('addCommunity.name')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('addCommunity.area')" prop="area"> <el-form-item :label="$t('addCommunity.area')" prop="area">
<area-select ref="areaSelectRef" @selectArea="selectArea" /> <area-select ref="areaSelectRef" @selectArea="selectArea" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('addCommunity.address')" prop="tmpAddress" required> <el-form-item :label="$t('addCommunity.address')" prop="tmpAddress" >
<el-input v-model="addCommunityInfo.tmpAddress" :placeholder="$t('addCommunity.address')" /> <el-input v-model="addCommunityInfo.tmpAddress" :placeholder="$t('addCommunity.address')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('addCommunity.nearbyLandmarks')" prop="nearbyLandmarks" required> <el-form-item :label="$t('addCommunity.nearbyLandmarks')" prop="nearbyLandmarks" >
<el-input v-model="addCommunityInfo.nearbyLandmarks" <el-input v-model="addCommunityInfo.nearbyLandmarks"
:placeholder="$t('addCommunity.nearbyLandmarks')" /> :placeholder="$t('addCommunity.nearbyLandmarks')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('addCommunity.tel')" prop="tel" required> <el-form-item :label="$t('addCommunity.tel')" prop="tel" >
<el-input v-model="addCommunityInfo.tel" :placeholder="$t('addCommunity.tel')" /> <el-input v-model="addCommunityInfo.tel" :placeholder="$t('addCommunity.tel')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('addCommunity.payFeeMonth')" prop="payFeeMonth" required> <el-form-item :label="$t('addCommunity.payFeeMonth')" prop="payFeeMonth" >
<el-input v-model="addCommunityInfo.payFeeMonth" :placeholder="$t('addCommunity.payFeeMonth')" /> <el-input v-model="addCommunityInfo.payFeeMonth" :placeholder="$t('addCommunity.payFeeMonth')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('addCommunity.feePrice')" prop="feePrice" required> <el-form-item :label="$t('addCommunity.feePrice')" prop="feePrice" >
<el-input v-model="addCommunityInfo.feePrice" :placeholder="$t('addCommunity.feePrice')" /> <el-input v-model="addCommunityInfo.feePrice" :placeholder="$t('addCommunity.feePrice')" />
</el-form-item> </el-form-item>
<el-form-item v-for="(item, index) in addCommunityInfo.attrs" :key="index" :label="item.specName" <el-form-item v-for="(item, index) in addCommunityInfo.attrs" :key="index" :label="item.specName"
@ -50,6 +50,32 @@ export default {
data() { data() {
return { return {
visible: false, visible: false,
rules: {
name: [
{ required: true, message: this.$t('addCommunity.validate.name'), trigger: 'blur' }
],
cityCode: [
{ required: true, message: this.$t('addCommunity.validate.cityCode'), trigger: 'blur' }
],
address: [
{ required: true, message: this.$t('addCommunity.validate.address'), trigger: 'blur' }
],
nearbyLandmarks: [
{ required: true, message: this.$t('addCommunity.validate.nearbyLandmarks'), trigger: 'blur' }
],
tel: [
{ required: true, message: this.$t('addCommunity.validate.tel'), trigger: 'blur' }
],
payFeeMonth: [
{ required: true, message: this.$t('addCommunity.validate.payFeeMonth'), trigger: 'blur' }
],
feePrice: [
{ required: true, message: this.$t('addCommunity.validate.feePrice'), trigger: 'blur' }
],
attrs: [
{ required: true, message: this.$t('addCommunity.validate.attrs'), trigger: 'blur' }
]
},
addCommunityInfo: { addCommunityInfo: {
name: '', name: '',
address: '', address: '',

View File

@ -1,23 +1,23 @@
<template> <template>
<el-dialog :title="$t('editCommunity.title')" :visible.sync="visible" width="60%" @close="refreshEditCommunityInfo"> <el-dialog :title="$t('editCommunity.title')" :visible.sync="visible" width="60%" @close="refreshEditCommunityInfo">
<el-form ref="form" :model="editCommunityInfo" label-width="120px"> <el-form ref="form" :model="editCommunityInfo" :rules="rules" class="text-left" label-width="120px">
<el-form-item :label="$t('editCommunity.name')" prop="name" required> <el-form-item :label="$t('editCommunity.name')" prop="name" >
<el-input v-model="editCommunityInfo.name" :placeholder="$t('editCommunity.namePlaceholder')" /> <el-input v-model="editCommunityInfo.name" :placeholder="$t('editCommunity.namePlaceholder')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('editCommunity.address')" prop="address" required> <el-form-item :label="$t('editCommunity.address')" prop="address" >
<el-input v-model="editCommunityInfo.address" :placeholder="$t('editCommunity.addressPlaceholder')" /> <el-input v-model="editCommunityInfo.address" :placeholder="$t('editCommunity.addressPlaceholder')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('editCommunity.nearbyLandmarks')" prop="nearbyLandmarks" required> <el-form-item :label="$t('editCommunity.nearbyLandmarks')" prop="nearbyLandmarks" >
<el-input v-model="editCommunityInfo.nearbyLandmarks" <el-input v-model="editCommunityInfo.nearbyLandmarks"
:placeholder="$t('editCommunity.nearbyLandmarksPlaceholder')" /> :placeholder="$t('editCommunity.nearbyLandmarksPlaceholder')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('editCommunity.payFeeMonth')" prop="payFeeMonth" required> <el-form-item :label="$t('editCommunity.payFeeMonth')" prop="payFeeMonth" >
<el-input v-model="editCommunityInfo.payFeeMonth" :placeholder="$t('editCommunity.payFeeMonthPlaceholder')" /> <el-input v-model="editCommunityInfo.payFeeMonth" :placeholder="$t('editCommunity.payFeeMonthPlaceholder')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('editCommunity.feePrice')" prop="feePrice" required> <el-form-item :label="$t('editCommunity.feePrice')" prop="feePrice" >
<el-input v-model="editCommunityInfo.feePrice" :placeholder="$t('editCommunity.feePricePlaceholder')" /> <el-input v-model="editCommunityInfo.feePrice" :placeholder="$t('editCommunity.feePricePlaceholder')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('editCommunity.tel')" prop="tel" required> <el-form-item :label="$t('editCommunity.tel')" prop="tel" >
<el-input v-model="editCommunityInfo.tel" :placeholder="$t('editCommunity.telPlaceholder')" /> <el-input v-model="editCommunityInfo.tel" :placeholder="$t('editCommunity.telPlaceholder')" />
</el-form-item> </el-form-item>
<el-form-item v-for="(item, index) in editCommunityInfo.attrs" :key="index" :label="item.specName" <el-form-item v-for="(item, index) in editCommunityInfo.attrs" :key="index" :label="item.specName"
@ -46,6 +46,29 @@ export default {
data() { data() {
return { return {
visible: false, visible: false,
rules: {
name: [
{ required: true, message: this.$t('editCommunity.validate.name'), trigger: 'blur' }
],
address: [
{ required: true, message: this.$t('editCommunity.validate.address'), trigger: 'blur' }
],
nearbyLandmarks: [
{ required: true, message: this.$t('editCommunity.validate.nearbyLandmarks'), trigger: 'blur' }
],
payFeeMonth: [
{ required: true, message: this.$t('editCommunity.validate.payFeeMonth'), trigger: 'blur' }
],
feePrice: [
{ required: true, message: this.$t('editCommunity.validate.feePrice'), trigger: 'blur' }
],
tel: [
{ required: true, message: this.$t('editCommunity.validate.tel'), trigger: 'blur' }
],
attrs: [
{ required: true, message: this.$t('editCommunity.validate.attrs'), trigger: 'blur' }
]
},
editCommunityInfo: { editCommunityInfo: {
communityId: '', communityId: '',
name: '', name: '',