装表的时候过滤已经选择的互感器
This commit is contained in:
@@ -22,6 +22,8 @@ Component({
|
||||
building: String,
|
||||
isBack: Boolean,
|
||||
filterBind: Boolean,
|
||||
filterData: Array,
|
||||
filterType: String
|
||||
},
|
||||
observers: {
|
||||
"show,type,filterBind": function(newShow, newType) {
|
||||
@@ -189,15 +191,21 @@ Component({
|
||||
})
|
||||
},
|
||||
async onSearchCollection() {
|
||||
const { searchText = "" } = this.data;
|
||||
const { searchText = "", filterData, filterType } = this.data;
|
||||
const { code, message, data: parks = [] } = await getCollectionList({keyword: searchText, page: 1, status: 1});
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return
|
||||
}
|
||||
let columns = parks;
|
||||
if (filterType === 'collection') {
|
||||
columns = columns.filter(item => {
|
||||
return !filterData.includes(item.id)
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
columns: parks?.map(item => `${item.transformerId}-倍率:${item.ratio}-${item.manufacturer}`),
|
||||
list: parks,
|
||||
columns: columns?.map(item => `${item.transformerId}-倍率:${item.ratio}-${item.manufacturer}`),
|
||||
list: columns,
|
||||
})
|
||||
},
|
||||
async onSearchMeter() {
|
||||
|
||||
@@ -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',
|
||||
})
|
||||
|
||||
@@ -184,6 +184,8 @@
|
||||
park="{{park}}"
|
||||
building="{{building}}"
|
||||
bindconfirm="onConfirm"
|
||||
filterData="{{collections}}"
|
||||
filterType="collection"
|
||||
bindcancel="onCancel"
|
||||
placeholder="{{placeholder}}"
|
||||
wx:if="{{show}}"
|
||||
|
||||
@@ -19,8 +19,19 @@ Page({
|
||||
}],
|
||||
},
|
||||
showActionMenu(e) {
|
||||
const { id, status } = e.currentTarget.dataset;
|
||||
this.setData({
|
||||
currentActionSheet: e.currentTarget.dataset.id
|
||||
currentActionSheet: id,
|
||||
actionItems: status === 0 ? [{
|
||||
name: '详情',
|
||||
value: 'detail'
|
||||
}, {
|
||||
name: '确认',
|
||||
value: 'ok'
|
||||
}] : [{
|
||||
name: '详情',
|
||||
value: 'detail'
|
||||
}]
|
||||
});
|
||||
},
|
||||
onClearPark() {
|
||||
@@ -82,7 +93,10 @@ onMenuSelect(e) {
|
||||
return
|
||||
}
|
||||
alertSuccess("确认成功")
|
||||
this.init();
|
||||
const that = this;
|
||||
setTimeout(() => {
|
||||
that.init();
|
||||
}, 300)
|
||||
},
|
||||
jumpToDetail(id) {
|
||||
|
||||
|
||||
@@ -63,13 +63,14 @@
|
||||
{{ item.current_user_audit_status === 0 ? "处理中" : "已确认" }}
|
||||
</view>
|
||||
<view class="th" style="flex: 0 0 120rpx; justify-content: flex-end; display: flex; align-items: center;">
|
||||
<van-icon name="ellipsis" size="24px" bind:tap="showActionMenu" data-id="{{item.id}}" data-data="{{index}}" class="more-icon" />
|
||||
<van-icon name="ellipsis" size="24px" bind:tap="showActionMenu" data-id="{{item.id}}" data-data="{{index}}" data-status="{{item.current_user_audit_status}}" class="more-icon" />
|
||||
<van-action-sheet
|
||||
show="{{ currentActionSheet === item.id }}"
|
||||
actions="{{ actionItems }}"
|
||||
bind:close="hideActionMenu"
|
||||
bind:select="onMenuSelect"
|
||||
data-id="{{item.id}}"
|
||||
|
||||
close-on-click-action
|
||||
/>
|
||||
<!-- <view
|
||||
|
||||
Reference in New Issue
Block a user