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,7 +57,9 @@ onMounted(() => { | ||
| 57 | * @callback checkCard~checkCallback | 57 | * @callback checkCard~checkCallback |
| 58 | */ | 58 | */ |
| 59 | const checkPrice = (rules, value, callback) => { | 59 | const checkPrice = (rules, value, callback) => { |
| 60 | - if (price(value)) { | 60 | + if ([undefined, "", null].includes(value)) { |
| 61 | + callback(); | ||
| 62 | + } else if (price(value)) { | ||
| 61 | if (value > 50000) { | 63 | if (value > 50000) { |
| 62 | callback(new Error("请输入正确的数值")); | 64 | callback(new Error("请输入正确的数值")); |
| 63 | } else { | 65 | } else { |
| @@ -90,7 +92,12 @@ const rules = reactive({ | @@ -90,7 +92,12 @@ const rules = reactive({ | ||
| 90 | message: "请输入单元数", | 92 | message: "请输入单元数", |
| 91 | trigger: "blur", | 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 | createTime: [ | 102 | createTime: [ |
| 96 | { | 103 | { |
| @@ -101,7 +108,7 @@ const rules = reactive({ | @@ -101,7 +108,7 @@ const rules = reactive({ | ||
| 101 | ], | 108 | ], |
| 102 | grossArea: [ | 109 | grossArea: [ |
| 103 | { | 110 | { |
| 104 | - required: true, | 111 | + required: false, |
| 105 | message: "请输入建筑面积", | 112 | message: "请输入建筑面积", |
| 106 | trigger: "blur", | 113 | trigger: "blur", |
| 107 | }, | 114 | }, |
| @@ -115,11 +122,16 @@ const rules = reactive({ | @@ -115,11 +122,16 @@ const rules = reactive({ | ||
| 115 | message: "请输入总房屋数量", | 122 | message: "请输入总房屋数量", |
| 116 | trigger: "blur", | 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 | employArea: [ | 132 | employArea: [ |
| 121 | { | 133 | { |
| 122 | - required: true, | 134 | + required: false, |
| 123 | message: "请输入使用面积", | 135 | message: "请输入使用面积", |
| 124 | trigger: "blur", | 136 | trigger: "blur", |
| 125 | }, | 137 | }, |
| @@ -219,12 +231,17 @@ defineExpose({ | @@ -219,12 +231,17 @@ defineExpose({ | ||
| 219 | <el-form-item label="建成日期:" prop="createTime"> | 231 | <el-form-item label="建成日期:" prop="createTime"> |
| 220 | <el-date-picker | 232 | <el-date-picker |
| 221 | v-model="props.formObj.createTime" | 233 | v-model="props.formObj.createTime" |
| 222 | - type="date" | 234 | + type="year" |
| 223 | placeholder="请选择" | 235 | placeholder="请选择" |
| 224 | style="width: 200px" | 236 | style="width: 200px" |
| 225 | ></el-date-picker> | 237 | ></el-date-picker> |
| 226 | </el-form-item> | 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 | <el-form-item label="建筑面积:" prop="grossArea"> | 245 | <el-form-item label="建筑面积:" prop="grossArea"> |
| 229 | <el-input | 246 | <el-input |
| 230 | v-model="props.formObj.grossArea" | 247 | v-model="props.formObj.grossArea" |
| @@ -232,12 +249,6 @@ defineExpose({ | @@ -232,12 +249,6 @@ defineExpose({ | ||
| 232 | ></el-input> | 249 | ></el-input> |
| 233 | </el-form-item> | 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 | <el-form-item label="使用面积:" prop="employArea"> | 252 | <el-form-item label="使用面积:" prop="employArea"> |
| 242 | <el-input | 253 | <el-input |
| 243 | v-model="props.formObj.employArea" | 254 | v-model="props.formObj.employArea" |
src/views/community/housekeeper/index.vue
| @@ -188,7 +188,7 @@ watchEffect(() => { | @@ -188,7 +188,7 @@ watchEffect(() => { | ||
| 188 | <el-table-column label="总房屋数量" prop="houseCount"></el-table-column> | 188 | <el-table-column label="总房屋数量" prop="houseCount"></el-table-column> |
| 189 | <el-table-column label="建成日期" prop="createTime"> | 189 | <el-table-column label="建成日期" prop="createTime"> |
| 190 | <template #default="scope"> | 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 | </template> | 192 | </template> |
| 193 | </el-table-column> | 193 | </el-table-column> |
| 194 | <el-table-column label="建筑面积" prop="grossArea"></el-table-column> | 194 | <el-table-column label="建筑面积" prop="grossArea"></el-table-column> |