修改问题

This commit is contained in:
2025-11-04 16:00:47 +08:00
parent 750f2d8d39
commit 5573c78b23

View File

@@ -176,13 +176,25 @@ Page({
},
onConfirm(e) {
const { type, data = {} } = e.detail;
const {collection} = this.data;
const {collection, park, tenement} = this.data;
switch(type) {
case "park":
this.setData({
park: data.id,
parkName: data.name,
})
if (park !== data.id) {
this.setData({
tenement: null,
tenementName: null,
building: null,
buildingName: null,
meterBox: null,
meterBoxName: null,
meter: null,
meterName: null,
})
}
break;
case "tenement":
this.setData({
@@ -323,7 +335,7 @@ Page({
ratio, area, card, collectionA, collectionB, collectionC,
tenement, sharp, peak, flat, valley, overall, url
} = this.data;
if (!park || !meter || !address || !meterType) {
if (!park || !meter || !address || meterType == null) {
alertInfo("请填写必填项后保存")
return;
}