diff --git a/components/searchSelect/index.js b/components/searchSelect/index.js index b9b3870..9b1c4bc 100644 --- a/components/searchSelect/index.js +++ b/components/searchSelect/index.js @@ -1,5 +1,5 @@ import { getLoginParkList, getParkBuildingList } from "../../service/park" -import { getParkSimpleMeterList, getParkBoxList, getCardList, getCollectionList, getInventoryMeter } from "../../service/meter" +import { getParkSimpleMeterList, getParkBoxList, getCardList, getCollectionList, getInventoryMeter, getCollectorList } from "../../service/meter" import { alertInfo } from "../../utils/index"; import request from "../../utils/request" import { payWays, feeType, meterType, noticeFlowType, noticeFlowStatus, @@ -176,8 +176,23 @@ Component({ case "collection": this.onSearchCollection(); return; + case "collector": + this.onSearchCollector(); + break; } }, + async onSearchCollector() { + const { searchText = "", } = this.data; + const { code, message, data = [] } = await getCollectorList(searchText); + if (code !== OK) { + alertInfo(message) + return + } + this.setData({ + columns: data?.map(item => `${item.collectorAddress}-${item.manufacturer}`), + list: data, + }) + }, async onSearchPark() { const { searchText = "" } = this.data; const { code, message, data: parks = [] } = await getLoginParkList({keyword: searchText}); diff --git a/pages/workBenchNew/components/installMeter/index.js b/pages/workBenchNew/components/installMeter/index.js index b12503a..e69f17e 100644 --- a/pages/workBenchNew/components/installMeter/index.js +++ b/pages/workBenchNew/components/installMeter/index.js @@ -146,6 +146,27 @@ Page({ collection: "C" }) }, + onBindCollector() { + const { park } = this.data; + if (!park) { + alertInfo("请先选择园区") + return; + } + this.setData({ + show: true, + title: "采集器", + type: 'collector', + }) + }, + clearCollector() { + this.setData({ + show: false, + title: "", + type: 'collector', + collector: null, + collectorName: null, + }) + }, uploadImage() { const that = this; wx.chooseMedia({ @@ -204,6 +225,8 @@ Page({ flat: null, valley: null, area: null, + collector: null, + collectorName: null, collections: [], }) }, @@ -258,6 +281,12 @@ Page({ meterTypeName: data, }); break; + case "collector": + this.setData({ + collector: data?.id, + collectorName: `${data.collectorAddress}-${data.manufacturer}`, + }); + break; case "meter": this.setData({ meter: data.id, @@ -403,7 +432,7 @@ Page({ park, meter, address, building, meterBox, meterType, ratio, area, card, collectionA, collectionB, collectionC, tenement, sharp, peak, flat, valley, overall, url, sn, - collectionARatio, collectionBRatio, collectionCRatio + collectionARatio, collectionBRatio, collectionCRatio, collector, } = this.data; if (!park || !(meter || sn) || !address || meterType == null || !building || !meterBox || ratio == null) { alertInfo("请填写必填项后保存") @@ -434,7 +463,7 @@ Page({ flat: flat === "" ? null : flat, valley: valley === "" ? null : valley, overall: overall === "" ? null : overall, - url, sn + url, sn, collector }) if (code !== OK) { alertInfo(message) diff --git a/pages/workBenchNew/components/installMeter/index.wxml b/pages/workBenchNew/components/installMeter/index.wxml index a103bd3..8d12cdb 100644 --- a/pages/workBenchNew/components/installMeter/index.wxml +++ b/pages/workBenchNew/components/installMeter/index.wxml @@ -90,6 +90,14 @@ allowClear="{{true}}" bind:clear="clearCard" /> + - {{ noticeFlowType[item.types - 1] }} + {{ noticeFlowTypeList[item.types - 1] }} diff --git a/pages/workOrderDetail/index.js b/pages/workOrderDetail/index.js index e514826..bc67909 100644 --- a/pages/workOrderDetail/index.js +++ b/pages/workOrderDetail/index.js @@ -11,7 +11,12 @@ Page({ * 页面的初始数据 */ data: { - detail: {} + detail: {}, + header: [ + // { key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address }, + { title: '操作人',renderBody: (item) => { return item.user_name } }, + { title: '状态',renderBody: (item) => { return item.status === 0 ? "未确认" : "已确认" } }, + ], }, /** diff --git a/pages/workOrderDetail/index.json b/pages/workOrderDetail/index.json index 827f19a..c9ed298 100644 --- a/pages/workOrderDetail/index.json +++ b/pages/workOrderDetail/index.json @@ -3,7 +3,8 @@ "navigator": "/components/navigator/index", "van-popup": "@vant/weapp/popup/index", "van-field": "@vant/weapp/field/index", - "van-button": "@vant/weapp/button/index" + "van-button": "@vant/weapp/button/index", + "custom-table": "/components/table/table" }, "navigationStyle": "custom" } \ No newline at end of file diff --git a/pages/workOrderDetail/index.wxml b/pages/workOrderDetail/index.wxml index a369acc..a4c5f9e 100644 --- a/pages/workOrderDetail/index.wxml +++ b/pages/workOrderDetail/index.wxml @@ -36,6 +36,39 @@ - + + + + + + + + 确认 diff --git a/service/meter.js b/service/meter.js index ff1afe8..ab96a3a 100644 --- a/service/meter.js +++ b/service/meter.js @@ -78,4 +78,9 @@ export const installMeter = async function(data) { // 拆表 export const uninstallMeter = async function(data) { return await POST(`/flow/doMeterRemoveApproval`, data); +} + +// 获取商户下的电表,后台 +export const getCollectorList = async function(keyword) { + return await GET(`/collector/list?collectorAddress=${replaceSpecialIcon(keyword)}`); } \ No newline at end of file