装表的时候过滤已经选择的互感器

This commit is contained in:
2025-11-17 15:51:41 +08:00
parent 771bacdafa
commit db1adea70a
5 changed files with 81 additions and 30 deletions

View File

@@ -15,6 +15,7 @@ Page({
time: "",
area: "",
placeholder: "",
collections: [],
},
/**
@@ -179,6 +180,33 @@ Page({
sn: e.detail,
})
},
clearData() {
this.setData({
tenement: null,
tenementName: null,
building: null,
buildingName: null,
meterBox: null,
meterBoxName: null,
meter: null,
meterName: null,
card: null,
cardName: null,
collectionA: null,
collectionAName: null,
collectionB: null,
collectionBName: null,
collectionB: null,
collectionBName: null,
address: null,
sharp: null,
peak: null,
flat: null,
valley: null,
area: null,
collections: [],
})
},
onConfirm(e) {
console.log("e", e)
const { type, data = {}, way } = e.detail;
@@ -191,30 +219,7 @@ Page({
selfManagement: data.selfManagement,
})
if (park !== data.id) {
this.setData({
tenement: null,
tenementName: null,
building: null,
buildingName: null,
meterBox: null,
meterBoxName: null,
meter: null,
meterName: null,
card: null,
cardName: null,
collectionA: null,
collectionAName: null,
collectionB: null,
collectionBName: null,
collectionB: null,
collectionBName: null,
address: null,
sharp: null,
peak: null,
flat: null,
valley: null,
area: null,
})
this.clearData()
}
break;
case "tenement":
@@ -266,26 +271,33 @@ Page({
});
break;
case "collection":
const newCollects = this.data.collections;
let newData = {}
if (collection === "A") {
newCollects[0] = data.id
newData = {
collectionA: data.id,
collectionAName: `${data.transformerId}-倍率:${data.ratio}-${data.manufacturer}`,
collectionARatio: data.ratio,
collections: newCollects
}
}
if (collection === "B") {
newCollects[1] = data.id
newData = {
collectionB: data.id,
collectionBName: `${data.transformerId}-倍率:${data.ratio}-${data.manufacturer}`,
collectionBRatio: data.ratio,
collections: newCollects
}
}
if (collection === "C") {
newCollects[2] = data.id
newData = {
collectionC: data.id,
collectionCName: `${data.transformerId}-倍率:${data.ratio}-${data.manufacturer}`,
collectionCRatio: data.ratio,
collections: newCollects
}
}
this.setData(newData);
@@ -300,21 +312,30 @@ Page({
})
},
clearCollectionA() {
const newCollects = this.data.collections;
newCollects[0] = null;
this.setData({
collectionA: null,
collectionAName: null,
collections: newCollects,
})
},
clearCollectionB() {
const newCollects = this.data.collections;
newCollects[1] = null;
this.setData({
collectionB: null,
collectionBName: null,
collections: newCollects,
})
},
clearCollectionC() {
const newCollects = this.data.collections;
newCollects[2] = null;
this.setData({
collectionC: null,
collectionCName: null,
collections: newCollects,
})
},
changeAddress(e) {
@@ -414,6 +435,11 @@ Page({
return;
}
alertSuccess("新增成功")
this.setData({
park: null,
parkName: null,
})
this.clearData()
wx.navigateTo({
url: '/pages/workBenchTodoList/index',
})