修改问题

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