Commit 687378c6fe55a2570a4d6ab397afc75d1b1b9dec
1 parent
6146e04f
fix bug
Showing
2 changed files
with
25 additions
and
14 deletions
src/views/community/housekeeper/houseDetail.vue
| ... | ... | @@ -57,7 +57,9 @@ onMounted(() => { |
| 57 | 57 | * @callback checkCard~checkCallback |
| 58 | 58 | */ |
| 59 | 59 | const checkPrice = (rules, value, callback) => { |
| 60 | - if (price(value)) { | |
| 60 | + if ([undefined, "", null].includes(value)) { | |
| 61 | + callback(); | |
| 62 | + } else if (price(value)) { | |
| 61 | 63 | if (value > 50000) { |
| 62 | 64 | callback(new Error("请输入正确的数值")); |
| 63 | 65 | } else { |
| ... | ... | @@ -90,7 +92,12 @@ const rules = reactive({ |
| 90 | 92 | message: "请输入单元数", |
| 91 | 93 | trigger: "blur", |
| 92 | 94 | }, |
| 93 | - { type: "number", message: "请输入正确数值,最大值不能超过10", max: 10,min:1 }, | |
| 95 | + { | |
| 96 | + type: "number", | |
| 97 | + message: "请输入正确数值,最大值不能超过10", | |
| 98 | + max: 10, | |
| 99 | + min: 1, | |
| 100 | + }, | |
| 94 | 101 | ], |
| 95 | 102 | createTime: [ |
| 96 | 103 | { |
| ... | ... | @@ -101,7 +108,7 @@ const rules = reactive({ |
| 101 | 108 | ], |
| 102 | 109 | grossArea: [ |
| 103 | 110 | { |
| 104 | - required: true, | |
| 111 | + required: false, | |
| 105 | 112 | message: "请输入建筑面积", |
| 106 | 113 | trigger: "blur", |
| 107 | 114 | }, |
| ... | ... | @@ -115,11 +122,16 @@ const rules = reactive({ |
| 115 | 122 | message: "请输入总房屋数量", |
| 116 | 123 | trigger: "blur", |
| 117 | 124 | }, |
| 118 | - { type: "number", message: "请输入数字,最大值不能超过10000", max: 10000,min:1 }, | |
| 125 | + { | |
| 126 | + type: "number", | |
| 127 | + message: "请输入数字,最大值不能超过10000", | |
| 128 | + max: 10000, | |
| 129 | + min: 1, | |
| 130 | + }, | |
| 119 | 131 | ], |
| 120 | 132 | employArea: [ |
| 121 | 133 | { |
| 122 | - required: true, | |
| 134 | + required: false, | |
| 123 | 135 | message: "请输入使用面积", |
| 124 | 136 | trigger: "blur", |
| 125 | 137 | }, |
| ... | ... | @@ -219,12 +231,17 @@ defineExpose({ |
| 219 | 231 | <el-form-item label="建成日期:" prop="createTime"> |
| 220 | 232 | <el-date-picker |
| 221 | 233 | v-model="props.formObj.createTime" |
| 222 | - type="date" | |
| 234 | + type="year" | |
| 223 | 235 | placeholder="请选择" |
| 224 | 236 | style="width: 200px" |
| 225 | 237 | ></el-date-picker> |
| 226 | 238 | </el-form-item> |
| 227 | - | |
| 239 | + <el-form-item label="总房屋数量:" prop="houseCount"> | |
| 240 | + <el-input | |
| 241 | + v-model.number="props.formObj.houseCount" | |
| 242 | + placeholder="请输入总房屋数量" | |
| 243 | + ></el-input> | |
| 244 | + </el-form-item> | |
| 228 | 245 | <el-form-item label="建筑面积:" prop="grossArea"> |
| 229 | 246 | <el-input |
| 230 | 247 | v-model="props.formObj.grossArea" |
| ... | ... | @@ -232,12 +249,6 @@ defineExpose({ |
| 232 | 249 | ></el-input> |
| 233 | 250 | </el-form-item> |
| 234 | 251 | |
| 235 | - <el-form-item label="总房屋数量:" prop="houseCount"> | |
| 236 | - <el-input | |
| 237 | - v-model.number="props.formObj.houseCount" | |
| 238 | - placeholder="请输入总房屋数量" | |
| 239 | - ></el-input> | |
| 240 | - </el-form-item> | |
| 241 | 252 | <el-form-item label="使用面积:" prop="employArea"> |
| 242 | 253 | <el-input |
| 243 | 254 | v-model="props.formObj.employArea" | ... | ... |
src/views/community/housekeeper/index.vue
| ... | ... | @@ -188,7 +188,7 @@ watchEffect(() => { |
| 188 | 188 | <el-table-column label="总房屋数量" prop="houseCount"></el-table-column> |
| 189 | 189 | <el-table-column label="建成日期" prop="createTime"> |
| 190 | 190 | <template #default="scope"> |
| 191 | - <span>{{ parseTime(new Date(scope.row.createTime).getTime()).split(' ')[0] }}</span> | |
| 191 | + <span>{{ parseTime(new Date(scope.row.createTime).getTime()).split(' ')[0].split('-')[0] }}</span> | |
| 192 | 192 | </template> |
| 193 | 193 | </el-table-column> |
| 194 | 194 | <el-table-column label="建筑面积" prop="grossArea"></el-table-column> | ... | ... |