工单详情增加部分字段,装表新增采集器,修改工单列表查询的问题
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { getLoginParkList, getParkBuildingList } from "../../service/park"
|
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 { alertInfo } from "../../utils/index";
|
||||||
import request from "../../utils/request"
|
import request from "../../utils/request"
|
||||||
import { payWays, feeType, meterType, noticeFlowType, noticeFlowStatus,
|
import { payWays, feeType, meterType, noticeFlowType, noticeFlowStatus,
|
||||||
@@ -176,8 +176,23 @@ Component({
|
|||||||
case "collection":
|
case "collection":
|
||||||
this.onSearchCollection();
|
this.onSearchCollection();
|
||||||
return;
|
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() {
|
async onSearchPark() {
|
||||||
const { searchText = "" } = this.data;
|
const { searchText = "" } = this.data;
|
||||||
const { code, message, data: parks = [] } = await getLoginParkList({keyword: searchText});
|
const { code, message, data: parks = [] } = await getLoginParkList({keyword: searchText});
|
||||||
|
|||||||
@@ -146,6 +146,27 @@ Page({
|
|||||||
collection: "C"
|
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() {
|
uploadImage() {
|
||||||
const that = this;
|
const that = this;
|
||||||
wx.chooseMedia({
|
wx.chooseMedia({
|
||||||
@@ -204,6 +225,8 @@ Page({
|
|||||||
flat: null,
|
flat: null,
|
||||||
valley: null,
|
valley: null,
|
||||||
area: null,
|
area: null,
|
||||||
|
collector: null,
|
||||||
|
collectorName: null,
|
||||||
collections: [],
|
collections: [],
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -258,6 +281,12 @@ Page({
|
|||||||
meterTypeName: data,
|
meterTypeName: data,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case "collector":
|
||||||
|
this.setData({
|
||||||
|
collector: data?.id,
|
||||||
|
collectorName: `${data.collectorAddress}-${data.manufacturer}`,
|
||||||
|
});
|
||||||
|
break;
|
||||||
case "meter":
|
case "meter":
|
||||||
this.setData({
|
this.setData({
|
||||||
meter: data.id,
|
meter: data.id,
|
||||||
@@ -403,7 +432,7 @@ Page({
|
|||||||
park, meter, address, building, meterBox, meterType,
|
park, meter, address, building, meterBox, meterType,
|
||||||
ratio, area, card, collectionA, collectionB, collectionC,
|
ratio, area, card, collectionA, collectionB, collectionC,
|
||||||
tenement, sharp, peak, flat, valley, overall, url, sn,
|
tenement, sharp, peak, flat, valley, overall, url, sn,
|
||||||
collectionARatio, collectionBRatio, collectionCRatio
|
collectionARatio, collectionBRatio, collectionCRatio, collector,
|
||||||
} = this.data;
|
} = this.data;
|
||||||
if (!park || !(meter || sn) || !address || meterType == null || !building || !meterBox || ratio == null) {
|
if (!park || !(meter || sn) || !address || meterType == null || !building || !meterBox || ratio == null) {
|
||||||
alertInfo("请填写必填项后保存")
|
alertInfo("请填写必填项后保存")
|
||||||
@@ -434,7 +463,7 @@ Page({
|
|||||||
flat: flat === "" ? null : flat,
|
flat: flat === "" ? null : flat,
|
||||||
valley: valley === "" ? null : valley,
|
valley: valley === "" ? null : valley,
|
||||||
overall: overall === "" ? null : overall,
|
overall: overall === "" ? null : overall,
|
||||||
url, sn
|
url, sn, collector
|
||||||
})
|
})
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
alertInfo(message)
|
alertInfo(message)
|
||||||
|
|||||||
@@ -90,6 +90,14 @@
|
|||||||
allowClear="{{true}}"
|
allowClear="{{true}}"
|
||||||
bind:clear="clearCard"
|
bind:clear="clearCard"
|
||||||
/>
|
/>
|
||||||
|
<searchSelectWrapper
|
||||||
|
label="采集器"
|
||||||
|
placeholder="请选择采集器绑定"
|
||||||
|
text="{{collectorName}}"
|
||||||
|
bind:search="onBindCollector"
|
||||||
|
allowClear="{{true}}"
|
||||||
|
bind:clear="clearCollector"
|
||||||
|
/>
|
||||||
<searchSelectWrapper
|
<searchSelectWrapper
|
||||||
label="互感器A"
|
label="互感器A"
|
||||||
placeholder="请选择互感器绑定"
|
placeholder="请选择互感器绑定"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import request from "../../utils/request"
|
import request from "../../utils/request"
|
||||||
import { getWorkOrderList, doNoticeFlow } from "../../service/workBench"
|
import { getWorkOrderList, doNoticeFlow } from "../../service/workBench"
|
||||||
import { alertInfo, alertSuccess, loadingFunc } from "../../utils/index";
|
import { alertInfo, alertSuccess, loadingFunc } from "../../utils/index";
|
||||||
import { noticeFlowType } from "../../utils/data"
|
import { noticeFlowType as noticeFlowTypeList } from "../../utils/data"
|
||||||
const { OK } = request
|
const { OK } = request
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ Page({
|
|||||||
data: {
|
data: {
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 20,
|
size: 20,
|
||||||
noticeFlowType,
|
noticeFlowTypeList,
|
||||||
actionItems: [{
|
actionItems: [{
|
||||||
name: '详情',
|
name: '详情',
|
||||||
value: 'detail'
|
value: 'detail'
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
{{ item.time }}
|
{{ item.time }}
|
||||||
</view>
|
</view>
|
||||||
<view class="th" style="flex: 0 0 150rpx;">
|
<view class="th" style="flex: 0 0 150rpx;">
|
||||||
{{ noticeFlowType[item.types - 1] }}
|
{{ noticeFlowTypeList[item.types - 1] }}
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="th" style="flex: 0 0 150rpx;">
|
<view class="th" style="flex: 0 0 150rpx;">
|
||||||
|
|||||||
@@ -11,7 +11,12 @@ Page({
|
|||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
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 ? "未确认" : "已确认" } },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
"navigator": "/components/navigator/index",
|
"navigator": "/components/navigator/index",
|
||||||
"van-popup": "@vant/weapp/popup/index",
|
"van-popup": "@vant/weapp/popup/index",
|
||||||
"van-field": "@vant/weapp/field/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"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
@@ -36,6 +36,39 @@
|
|||||||
<view wx:else> - </view>
|
<view wx:else> - </view>
|
||||||
</view>
|
</view>
|
||||||
</van-field>
|
</van-field>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.created_at || '-' }}"
|
||||||
|
label="发起时间"
|
||||||
|
readonly
|
||||||
|
title-width="132rpx"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.created_name || '-' }}"
|
||||||
|
label="发起人"
|
||||||
|
readonly
|
||||||
|
title-width="132rpx"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.target.meter_data.meter_sn || '-' }}"
|
||||||
|
label="电表编号"
|
||||||
|
readonly
|
||||||
|
title-width="132rpx"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.reason || '-' }}"
|
||||||
|
label="批注"
|
||||||
|
readonly
|
||||||
|
title-width="132rpx"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.current_user_audit_status === 0 ? '未确认' : '已确认' }}"
|
||||||
|
label="工单状态"
|
||||||
|
readonly
|
||||||
|
title-width="132rpx"
|
||||||
|
/>
|
||||||
|
<view style="margin: 20rpx;">
|
||||||
|
<custom-table header="{{header}}" list="{{detail.notifier}}" />
|
||||||
|
</view>
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<view class="operate">
|
<view class="operate">
|
||||||
<view class="submit" wx:if="{{detail.current_user_audit_status === 0}}"> <van-button type="info" block bind:click="onSubmit"> 确认 </van-button> </view>
|
<view class="submit" wx:if="{{detail.current_user_audit_status === 0}}"> <van-button type="info" block bind:click="onSubmit"> 确认 </van-button> </view>
|
||||||
|
|||||||
@@ -79,3 +79,8 @@ export const installMeter = async function(data) {
|
|||||||
export const uninstallMeter = async function(data) {
|
export const uninstallMeter = async function(data) {
|
||||||
return await POST(`/flow/doMeterRemoveApproval`, data);
|
return await POST(`/flow/doMeterRemoveApproval`, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取商户下的电表,后台
|
||||||
|
export const getCollectorList = async function(keyword) {
|
||||||
|
return await GET(`/collector/list?collectorAddress=${replaceSpecialIcon(keyword)}`);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user