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

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

View File

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

View File

@@ -2,7 +2,7 @@
import { uninstallMeter, } from "../../../../service/meter";
import dayjs from "../../../../utils/dayjs"
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"
const { OK } = request;
@@ -152,6 +152,7 @@ Page({
alertInfo("请选择表号")
return;
}
if (!meterInfo?.tenement) {
const { code, message } = await uninstallMeter({sn: meter, images: url, reason, tenement: meterInfo.tenement, critical, peak, flat, valley, overall, deepOverall})
if (code !== OK) {
alertInfo(message)
@@ -163,6 +164,32 @@ Page({
url: '/pages/workBenchTodoList/index',
})
}, 300)
return;
}
wx.showModal({
title: '提示',
content: '拆出后电表和商户关系,电表和卡的关系会自动解绑,是否拆出',
complete: async (res) => {
if (res.cancel) {
}
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() {
const that = this;

View File

@@ -108,6 +108,12 @@ handleDoNoticeBtn(e) {
url: '/pages/workOrderDetail/index?id=' + id,
})
},
listJumpToDetail(e) {
const { id } = e.currentTarget.dataset;
wx.navigateTo({
url: '/pages/workOrderDetail/index?id=' + id,
})
},
onConfirm(e) {
const { type, data = {}, way } = e.detail;
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>
<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="th" style="flex: 0 0 130rpx;">
{{ item.time }}
@@ -62,14 +62,14 @@
<view class="th" style="flex: 0 0 150rpx;">
<view
class="primaryTextBtn"
wx:if="{{item.flow_status === 0}}"
wx:if="{{item.current_user_audit_status === 0}}"
data-id="{{item.id}}"
bind:tap="handleDoNoticeBtn"
catch:tap="handleDoNoticeBtn"
> 确认 </view>
<view wx:else> 已确认 </view>
</view>
<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
show="{{ currentActionSheet === item.id }}"
actions="{{ actionItems }}"
@@ -83,8 +83,7 @@
</view>
</view>
</block>
</van-radio-group>
</view>
</view>
</view>
</view>

View File

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

View File

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