工单支持点击列表进入详情,新装电表的适合根据电表类型显示商户和尖峰平谷,拆表的时候是商户表的时候二次提示

This commit is contained in:
2025-11-21 16:25:43 +08:00
parent 0ef96344ce
commit 990a3a17aa
7 changed files with 89 additions and 23 deletions

View File

@@ -224,6 +224,7 @@ Page({
peak: null, peak: null,
flat: null, flat: null,
valley: null, valley: null,
deepValley: null,
area: null, area: null,
collector: null, collector: null,
collectorName: null, collectorName: null,
@@ -233,7 +234,7 @@ Page({
onConfirm(e) { onConfirm(e) {
console.log("e", e) console.log("e", e)
const { type, data = {}, way } = e.detail; const { type, data = {}, way } = e.detail;
const {collection, park, tenement} = this.data; const {collection, park, meterType, tenement, tenementName, overall, sharp, flat, peak, valley, deepValley} = this.data;
switch(type) { switch(type) {
case "park": case "park":
this.setData({ this.setData({
@@ -276,9 +277,23 @@ Page({
}) })
break; break;
case "meterType": case "meterType":
let newMeterData = {};
if (way !== 0) {
newMeterData = {
tenement: null,
tenementName: null,
overall: null,
sharp: null,
peak: null,
flat: null,
valley: null,
deepValley: null,
}
}
this.setData({ this.setData({
meterType: way, meterType: way,
meterTypeName: data, meterTypeName: data,
...newMeterData,
}); });
break; break;
case "collector": case "collector":
@@ -402,6 +417,11 @@ Page({
valley: e.detail valley: e.detail
}) })
}, },
changeDeepValley(e) {
this.setData({
deepValley: e.detail
})
},
changeRatio(e) { changeRatio(e) {
this.setData({ this.setData({
ratio: e.detail, ratio: e.detail,
@@ -431,7 +451,7 @@ Page({
const { const {
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, deepValley, overall, url, sn,
collectionARatio, collectionBRatio, collectionCRatio, collector, 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) {
@@ -463,6 +483,8 @@ 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,
deepValley: deepValley == "" ? null : deepValley,
url, sn, collector url, sn, collector
}) })
if (code !== OK) { if (code !== OK) {

View File

@@ -127,36 +127,49 @@
placeholder="请选择商户" placeholder="请选择商户"
text="{{ tenementName }}" text="{{ tenementName }}"
bind:search="onTenementFocus" bind:search="onTenementFocus"
wx:if="{{meterType === 0}}"
/> />
<searchSelectWrapper <searchSelectWrapper
label="总" label="总"
placeholder="请输入总" placeholder="请输入总"
type="input" type="input"
bind:changeText="changeOverall" bind:changeText="changeOverall"
wx:if="{{meterType === 0}}"
/> />
<searchSelectWrapper <searchSelectWrapper
label="尖" label="尖"
placeholder="请输入尖" placeholder="请输入尖"
type="input" type="input"
bind:changeText="changeSharp" bind:changeText="changeSharp"
wx:if="{{meterType === 0}}"
/> />
<searchSelectWrapper <searchSelectWrapper
label="峰" label="峰"
placeholder="请输入峰" placeholder="请输入峰"
type="input" type="input"
bind:changeText="changePeak" bind:changeText="changePeak"
wx:if="{{meterType === 0}}"
/> />
<searchSelectWrapper <searchSelectWrapper
label="平" label="平"
placeholder="请输入平" placeholder="请输入平"
type="input" type="input"
bind:changeText="changeFlat" bind:changeText="changeFlat"
wx:if="{{meterType === 0}}"
/> />
<searchSelectWrapper <searchSelectWrapper
label="谷" label="谷"
placeholder="请输入谷" placeholder="请输入谷"
type="input" type="input"
bind:changeText="changeValley" bind:changeText="changeValley"
wx:if="{{meterType === 0}}"
/>
<searchSelectWrapper
label="深谷"
placeholder="请输入深谷"
type="input"
bind:changeText="changeDeepValley"
wx:if="{{meterType === 0}}"
/> />
<searchSelectWrapper <searchSelectWrapper
label="图片" label="图片"

View File

@@ -2,7 +2,7 @@
import { uninstallMeter, } from "../../../../service/meter"; import { uninstallMeter, } from "../../../../service/meter";
import dayjs from "../../../../utils/dayjs" import dayjs from "../../../../utils/dayjs"
import request from "../../../../utils/request" import request from "../../../../utils/request"
import { alertInfo, alertSuccess, loadingFunc} from "../../../../utils/index" import { alertInfo, alertSuccess, loadingFunc, wxModal} from "../../../../utils/index"
import { uploadUninstallMeter } from "../../../../service/public" import { uploadUninstallMeter } from "../../../../service/public"
const { OK } = request; const { OK } = request;
@@ -152,17 +152,44 @@ Page({
alertInfo("请选择表号") alertInfo("请选择表号")
return; return;
} }
const { code, message } = await uninstallMeter({sn: meter, images: url, reason, tenement: meterInfo.tenement, critical, peak, flat, valley, overall, deepOverall}) if (!meterInfo?.tenement) {
if (code !== OK) { const { code, message } = await uninstallMeter({sn: meter, images: url, reason, tenement: meterInfo.tenement, critical, peak, flat, valley, overall, deepOverall})
alertInfo(message) if (code !== OK) {
return alertInfo(message)
return
}
alertSuccess("拆除成功")
setTimeout(() => {
wx.navigateTo({
url: '/pages/workBenchTodoList/index',
})
}, 300)
return;
} }
alertSuccess("拆除成功") wx.showModal({
setTimeout(() => { title: '提示',
wx.navigateTo({ content: '拆出后电表和商户关系,电表和卡的关系会自动解绑,是否拆出',
url: '/pages/workBenchTodoList/index', complete: async (res) => {
}) if (res.cancel) {
}, 300)
}
if (res.confirm) {
const { code, message } = await uninstallMeter({sn: meter, images: url, reason, tenement: meterInfo.tenement, critical, peak, flat, valley, overall, deepOverall})
if (code !== OK) {
alertInfo(message)
return
}
alertSuccess("拆除成功")
setTimeout(() => {
wx.navigateTo({
url: '/pages/workBenchTodoList/index',
})
}, 300)
return;
}
}
})
}, },
uploadImage() { uploadImage() {
const that = this; const that = this;

View File

@@ -108,6 +108,12 @@ handleDoNoticeBtn(e) {
url: '/pages/workOrderDetail/index?id=' + id, url: '/pages/workOrderDetail/index?id=' + id,
}) })
}, },
listJumpToDetail(e) {
const { id } = e.currentTarget.dataset;
wx.navigateTo({
url: '/pages/workOrderDetail/index?id=' + id,
})
},
onConfirm(e) { onConfirm(e) {
const { type, data = {}, way } = e.detail; const { type, data = {}, way } = e.detail;
const that = this; const that = this;

View File

@@ -46,8 +46,8 @@
<view class="th"style="flex: 0 0 120rpx; justify-content: flex-end; display: flex; align-items: center;"> 操作 </view> <view class="th"style="flex: 0 0 120rpx; justify-content: flex-end; display: flex; align-items: center;"> 操作 </view>
</view> </view>
<view class="tbody"> <view class="tbody">
<van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
<block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item"> <view wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item" catch:tap="listJumpToDetail" data-id="{{item.id}}">
<view class="tr" style="display: flex; align-items: center; "> <view class="tr" style="display: flex; align-items: center; ">
<view class="th" style="flex: 0 0 130rpx;"> <view class="th" style="flex: 0 0 130rpx;">
{{ item.time }} {{ item.time }}
@@ -62,14 +62,14 @@
<view class="th" style="flex: 0 0 150rpx;"> <view class="th" style="flex: 0 0 150rpx;">
<view <view
class="primaryTextBtn" class="primaryTextBtn"
wx:if="{{item.flow_status === 0}}" wx:if="{{item.current_user_audit_status === 0}}"
data-id="{{item.id}}" data-id="{{item.id}}"
bind:tap="handleDoNoticeBtn" catch:tap="handleDoNoticeBtn"
> 确认 </view> > 确认 </view>
<view wx:else> 已确认 </view> <view wx:else> 已确认 </view>
</view> </view>
<view class="th" style="flex: 0 0 120rpx; justify-content: flex-end; display: flex; align-items: center;"> <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}}" data-status="{{item.current_user_audit_status}}" class="more-icon" /> <van-icon name="ellipsis" size="24px" catch:tap="showActionMenu" data-id="{{item.id}}" data-data="{{index}}" data-status="{{item.current_user_audit_status}}" class="more-icon" />
<van-action-sheet <van-action-sheet
show="{{ currentActionSheet === item.id }}" show="{{ currentActionSheet === item.id }}"
actions="{{ actionItems }}" actions="{{ actionItems }}"
@@ -83,8 +83,7 @@
</view> </view>
</view> </view>
</block> </view>
</van-radio-group>
</view> </view>
</view> </view>
</view> </view>

View File

@@ -6,7 +6,6 @@ const { OK } = request;
// pages/workOrderDetail/index.js // pages/workOrderDetail/index.js
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */

View File

@@ -48,12 +48,12 @@
readonly readonly
title-width="132rpx" title-width="132rpx"
/> />
<van-field <!-- <van-field
value="{{ detail.target.meter_data.meter_sn || '-' }}" value="{{ detail.target.meter_data.meter_sn || '-' }}"
label="电表编号" label="电表编号"
readonly readonly
title-width="132rpx" title-width="132rpx"
/> /> -->
<van-field <van-field
value="{{ detail.reason || '-' }}" value="{{ detail.reason || '-' }}"
label="批注" label="批注"