diff --git a/pages/workBenchNew/components/installMeter/index.js b/pages/workBenchNew/components/installMeter/index.js index 8118ae9..f53ca81 100644 --- a/pages/workBenchNew/components/installMeter/index.js +++ b/pages/workBenchNew/components/installMeter/index.js @@ -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; }