联调拆表

This commit is contained in:
2025-11-10 16:09:38 +08:00
parent 639f92540f
commit 07add88856
6 changed files with 43 additions and 12 deletions

View File

@@ -1,8 +1,9 @@
// pages/workBenchNew/components/uninstallMeter/index.js
import { uninstallMeter } from "../../../../service/meter";
import { uninstallMeter, } from "../../../../service/meter";
import dayjs from "../../../../utils/dayjs"
import request from "../../../../utils/request"
import { alertInfo, alertSuccess, } from "../../../../utils/index"
import { alertInfo, alertSuccess, loadingFunc} from "../../../../utils/index"
import { uploadUninstallMeter } from "../../../../service/public"
const { OK } = request;
@@ -113,12 +114,12 @@ Page({
})
},
async onSubmit() {
const { meter, } = this.data;
const { meter, reason, url, meterInfo } = this.data;
if (!meter) {
alertInfo("请选择表号")
return;
}
const { code, message } = await uninstallMeter(meter)
const { code, message } = await uninstallMeter({sn: meterInfo.meterSn, images: url, reason})
if (code !== OK) {
alertInfo(message)
return
@@ -148,7 +149,7 @@ Page({
}
var tempFilePaths = path;
loadingFunc(async () => {
const { code, message, url } = await uploadInstallMeter(tempFilePaths)
const { code, message, url } = await uploadUninstallMeter(tempFilePaths)
if (code !== OK) {
alertError(message)
return
@@ -165,6 +166,16 @@ Page({
url: ""
})
},
showImage() {
this.setData({
imageShow: true
})
},
onClose() {
this.setData({
imageShow: false
})
},
goback() {
wx.navigateBack()
},

View File

@@ -5,7 +5,8 @@
"search-select": "/components/searchSelect/index",
"van-field": "@vant/weapp/field/index",
"van-button": "@vant/weapp/button/index",
"searchSelectWrapper": "/components/searchSelectWrapper/index"
"searchSelectWrapper": "/components/searchSelectWrapper/index",
"van-image": "@vant/weapp/image/index"
},
"navigationStyle": "custom"
}

View File

@@ -46,7 +46,7 @@
<van-button type="danger" size="small" bind:click="clearImage" custom-style="margin-right: 20rpx;"> 清除 </van-button>
</view>
</view>
<van-image wx:if="{{!!url}}" width="100" height="100" src="{{url}}" custom-style="margin-left: 20rpx;" />
<van-image wx:if="{{!!url}}" width="100" height="100" src="{{url}}" custom-style="margin-left: 20rpx;" bind:tap="showImage" />
</view>
</searchSelectWrapper>

View File

@@ -148,11 +148,10 @@ onMenuSelect(e) {
await that.init()
})
})
console.log("e", e)
},
async init() {
const { page, size, park, tenement, meter, type, time, status } = this.data;
const { code, message, data, total } = await getWorkOrderList({ page, size, park, tenement, meter, type, time, status })
const { page, size, park, tenement, meter, noticeFlowType, noticeFlowStatus, time } = this.data;
const { code, message, data, total } = await getWorkOrderList({ page, size, park, tenement, meter, type: noticeFlowType, time, status: noticeFlowStatus })
if (code !== OK) {
alertInfo(message)
return;

View File

@@ -70,6 +70,6 @@ export const installMeter = async function(data) {
}
// 拆表
export const uninstallMeter = async function(sn) {
return await DELETE(`/flow/doMeterRemoveApproval?sn=${sn}`);
export const uninstallMeter = async function({sn, reason, images}) {
return await DELETE(`/flow/doMeterRemoveApproval`, { sn, reason, images });
}

View File

@@ -63,6 +63,26 @@ export const uploadInstallMeter = (filePath) => {
})
}
export const uploadUninstallMeter = (filePath) => {
const { api } = getConfigByEnv();
return new Promise((resolve, reject) => {
wx.uploadFile({
filePath: filePath,
name: 'data',
url: `${api}/image/meter/delete`,
header: {
authorization: 'Bearer ' + wx.getStorageSync("token")
},
success: (res) => {
resolve(res?.data ? JSON.parse(res?.data) : res?.data);
},
fail: (err) => {
reject(err);
}
})
})
}
export const uploadPublicFile = (filePath) => {
const { api } = getConfigByEnv();
return new Promise((resolve, reject) => {