diff --git a/components/searchSelect/index.js b/components/searchSelect/index.js index 9b1c4bc..14279c1 100644 --- a/components/searchSelect/index.js +++ b/components/searchSelect/index.js @@ -1,5 +1,10 @@ import { getLoginParkList, getParkBuildingList } from "../../service/park" -import { getParkSimpleMeterList, getParkBoxList, getCardList, getCollectionList, getInventoryMeter, getCollectorList } from "../../service/meter" +import { + getParkSimpleMeterList, getParkBoxList, + getCardList, getCollectionList, + getInventoryMeter, getCollectorList, + getWorkOrderAllMeter, +} from "../../service/meter" import { alertInfo } from "../../utils/index"; import request from "../../utils/request" import { payWays, feeType, meterType, noticeFlowType, noticeFlowStatus, @@ -179,6 +184,9 @@ Component({ case "collector": this.onSearchCollector(); break; + case "workOrderMeter": + this.onSearchWorkOrderMeter(); + break; } }, async onSearchCollector() { @@ -193,6 +201,18 @@ Component({ list: data, }) }, + async onSearchWorkOrderMeter() { + const { searchText = "", park } = this.data; + const { code, message, data = [] } = await getWorkOrderAllMeter({keyword: searchText, park: park, page: 1, size: 20}); + if (code !== OK) { + alertInfo(message) + return + } + this.setData({ + columns: data?.map(item => `${item.address}-${item.meter_no}`), + list: data, + }) + }, async onSearchPark() { const { searchText = "" } = this.data; const { code, message, data: parks = [] } = await getLoginParkList({keyword: searchText}); diff --git a/pages/workBenchTodoList/index.js b/pages/workBenchTodoList/index.js index 84c5a6d..ecd4a4c 100644 --- a/pages/workBenchTodoList/index.js +++ b/pages/workBenchTodoList/index.js @@ -147,9 +147,9 @@ handleDoNoticeBtn(e) { }) }); break; - case "meter": + case "workOrderMeter": this.setData({ - meter: data.id, + meter: data.meter_id, meterName: data.address, meterInfo: data, page: 1, @@ -199,7 +199,7 @@ handleDoNoticeBtn(e) { this.setData({ show: true, title: "电表", - type: 'meter' + type: 'workOrderMeter' }) }, onChangePage(e) { diff --git a/service/meter.js b/service/meter.js index ab96a3a..e5ed6af 100644 --- a/service/meter.js +++ b/service/meter.js @@ -83,4 +83,9 @@ export const uninstallMeter = async function(data) { // 获取商户下的电表,后台 export const getCollectorList = async function(keyword) { return await GET(`/collector/list?collectorAddress=${replaceSpecialIcon(keyword)}`); +} + +// 微信工单列表查询所有电表 +export const getWorkOrderAllMeter = async function({ keyword, park, page = 1, size = 20 }) { + return await GET(`/vx/getAllMeter?keyword=${replaceSpecialIcon(keyword)}&pid=${park}&page=${page}&size=${size}`,); } \ No newline at end of file diff --git a/service/workBench.js b/service/workBench.js index a616200..e52212a 100644 --- a/service/workBench.js +++ b/service/workBench.js @@ -63,7 +63,8 @@ export const doNoticeFlow = async function(id) { return await PUT(`/noticeFlow/${id}/meter/dispose`,); } -// 确认当前流程 +// 当前流程详情 export const getNoticeFlowDetail = async function(id) { return await GET(`/noticeFlow/${id}/detail`,); } +