From db1adea70a803584c4678e182327affae43dcf85 Mon Sep 17 00:00:00 2001 From: qiaomu <3520484422@qq.com> Date: Mon, 17 Nov 2025 15:51:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E8=A1=A8=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=B7=B2=E7=BB=8F=E9=80=89=E6=8B=A9=E7=9A=84?= =?UTF-8?q?=E4=BA=92=E6=84=9F=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/searchSelect/index.js | 14 +++- .../components/installMeter/index.js | 74 +++++++++++++------ .../components/installMeter/index.wxml | 2 + pages/workBenchTodoList/index.js | 18 ++++- pages/workBenchTodoList/index.wxml | 3 +- 5 files changed, 81 insertions(+), 30 deletions(-) diff --git a/components/searchSelect/index.js b/components/searchSelect/index.js index 1e86c61..558a7ca 100644 --- a/components/searchSelect/index.js +++ b/components/searchSelect/index.js @@ -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() { diff --git a/pages/workBenchNew/components/installMeter/index.js b/pages/workBenchNew/components/installMeter/index.js index 2c02fe7..367a54e 100644 --- a/pages/workBenchNew/components/installMeter/index.js +++ b/pages/workBenchNew/components/installMeter/index.js @@ -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', }) diff --git a/pages/workBenchNew/components/installMeter/index.wxml b/pages/workBenchNew/components/installMeter/index.wxml index 3a1be0c..a103bd3 100644 --- a/pages/workBenchNew/components/installMeter/index.wxml +++ b/pages/workBenchNew/components/installMeter/index.wxml @@ -184,6 +184,8 @@ park="{{park}}" building="{{building}}" bindconfirm="onConfirm" + filterData="{{collections}}" + filterType="collection" bindcancel="onCancel" placeholder="{{placeholder}}" wx:if="{{show}}" diff --git a/pages/workBenchTodoList/index.js b/pages/workBenchTodoList/index.js index 0373ea6..6294e96 100644 --- a/pages/workBenchTodoList/index.js +++ b/pages/workBenchTodoList/index.js @@ -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) { diff --git a/pages/workBenchTodoList/index.wxml b/pages/workBenchTodoList/index.wxml index e0d8955..246edd4 100644 --- a/pages/workBenchTodoList/index.wxml +++ b/pages/workBenchTodoList/index.wxml @@ -63,13 +63,14 @@ {{ item.current_user_audit_status === 0 ? "处理中" : "已确认" }} - +