工单详情
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
// pages/workBenchTodoList/index.js
|
// pages/workBenchTodoList/index.js
|
||||||
import request from "../../utils/request"
|
import request from "../../utils/request"
|
||||||
import { getWorkOrderList } from "../../service/workBench"
|
import { getWorkOrderList, doNoticeFlow } from "../../service/workBench"
|
||||||
import { alertInfo, loadingFunc } from "../../utils/index";
|
import { alertInfo, alertSuccess, loadingFunc } from "../../utils/index";
|
||||||
import { noticeFlowType } from "../../utils/data"
|
import { noticeFlowType } from "../../utils/data"
|
||||||
const { OK } = request
|
const { OK } = request
|
||||||
Page({
|
Page({
|
||||||
@@ -40,9 +40,19 @@ onMenuSelect(e) {
|
|||||||
this.jumpToDetail(id);
|
this.jumpToDetail(id);
|
||||||
break;
|
break;
|
||||||
case "ok":
|
case "ok":
|
||||||
|
this.handleDoNotice(id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async handleDoNotice(id) {
|
||||||
|
const { code, message } = await doNoticeFlow(id)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
alertSuccess("确认成功")
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
jumpToDetail(id) {
|
jumpToDetail(id) {
|
||||||
|
|
||||||
// wx.navigateTo({
|
// wx.navigateTo({
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"navigator": "/components/navigator/index",
|
"navigator": "/components/navigator/index",
|
||||||
|
"van-field": "@vant/weapp/field/index",
|
||||||
"van-popup": "@vant/weapp/popup/index",
|
"van-popup": "@vant/weapp/popup/index",
|
||||||
"van-row": "@vant/weapp/row/index",
|
"van-row": "@vant/weapp/row/index",
|
||||||
"van-col": "@vant/weapp/col/index",
|
"van-col": "@vant/weapp/col/index",
|
||||||
"search-select": "/components/searchSelect/index",
|
"search-select": "/components/searchSelect/index",
|
||||||
"van-field": "@vant/weapp/field/index",
|
|
||||||
"van-button": "@vant/weapp/button/index",
|
"van-button": "@vant/weapp/button/index",
|
||||||
"searchSelectWrapper": "/components/searchSelectWrapper/index",
|
"searchSelectWrapper": "/components/searchSelectWrapper/index",
|
||||||
"van-empty": "@vant/weapp/empty/index",
|
"van-empty": "@vant/weapp/empty/index",
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
import { loadingFunc, alertSuccess, alertInfo } from "../../utils/index";
|
||||||
|
import request from "../../utils/request"
|
||||||
|
import { getNoticeFlowDetail, doNoticeFlow } from "../../service/workBench"
|
||||||
|
|
||||||
|
const { OK } = request;
|
||||||
|
|
||||||
// pages/workOrderDetail/index.js
|
// pages/workOrderDetail/index.js
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
@@ -5,16 +11,56 @@ Page({
|
|||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
|
detail: {}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
const { id } = options;
|
||||||
|
const that = this;
|
||||||
|
loadingFunc(async () => {
|
||||||
|
that.getDetail(id)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
showImage() {
|
||||||
|
this.setData({
|
||||||
|
imageShow: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onClose() {
|
||||||
|
this.setData({
|
||||||
|
imageShow: false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goback() {
|
||||||
|
wx.navigateBack();
|
||||||
|
},
|
||||||
|
async onSubmit() {
|
||||||
|
const {detail} = this.data;
|
||||||
|
const {id} = detail;
|
||||||
|
const { code, message } = await doNoticeFlow(id)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
alertSuccess("确认成功")
|
||||||
|
const that = this;
|
||||||
|
loadingFunc(async () => {
|
||||||
|
that.getDetail(id)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async getDetail(id) {
|
||||||
|
const { code, data ,message } = await getNoticeFlowDetail(id)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
detail: data
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
{
|
{
|
||||||
"usingComponents": {}
|
"usingComponents": {
|
||||||
|
"navigator": "/components/navigator/index",
|
||||||
|
"van-popup": "@vant/weapp/popup/index",
|
||||||
|
"van-field": "@vant/weapp/field/index"
|
||||||
|
},
|
||||||
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
@@ -1,2 +1,58 @@
|
|||||||
<!--pages/workOrderDetail/index.wxml-->
|
<!--pages/workOrderDetail/index.wxml-->
|
||||||
<text>pages/workOrderDetail/index.wxml</text>
|
<navigator title="工单详情" canBack="{{true}}" />
|
||||||
|
<view>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.target.meter_data.park_name || '-' }}"
|
||||||
|
label="园区"
|
||||||
|
readonly
|
||||||
|
title-width="132rpx"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.target.full_name || '-' }}"
|
||||||
|
label="商户全称"
|
||||||
|
readonly
|
||||||
|
title-width="132rpx"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.target.meter_data.meter_sn || '-' }}"
|
||||||
|
label="电表编号"
|
||||||
|
readonly
|
||||||
|
title-width="132rpx"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.target.meter_data.address || '-' }}"
|
||||||
|
label="电表地址"
|
||||||
|
readonly
|
||||||
|
title-width="132rpx"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
label="图片"
|
||||||
|
title-width="132rpx"
|
||||||
|
>
|
||||||
|
<view slot="input" >
|
||||||
|
<view style="display: flex; align-items: center;" wx:if="{{detail.images}}">
|
||||||
|
<van-image width="100" height="100" src="{{detail.images}}" bind:tap="showImage" />
|
||||||
|
</view>
|
||||||
|
<view wx:else> - </view>
|
||||||
|
</view>
|
||||||
|
</van-field>
|
||||||
|
<view class="operate">
|
||||||
|
<view class="submit"> <van-button type="info" block bind:click="onSubmit"> 提交 </van-button> </view>
|
||||||
|
<view class="cancel"> <van-button block bind:tap="goback"> 返回 </van-button> </view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<van-popup
|
||||||
|
show="{{ imageShow }}"
|
||||||
|
bind:close="onClose"
|
||||||
|
z-index="99999"
|
||||||
|
>
|
||||||
|
<van-image
|
||||||
|
width="100vw"
|
||||||
|
height="99.1vh"
|
||||||
|
fit="contain"
|
||||||
|
src="{{detail.images}}"
|
||||||
|
bind:click="onClose"
|
||||||
|
/>
|
||||||
|
</van-popup>
|
||||||
@@ -1 +1,16 @@
|
|||||||
/* pages/workOrderDetail/index.wxss */
|
/* pages/workOrderDetail/index.wxss */
|
||||||
|
|
||||||
|
|
||||||
|
.operate {
|
||||||
|
display: flex;
|
||||||
|
padding-top: 24rpx;
|
||||||
|
padding-bottom: 36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit, .cancel {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit {
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
@@ -23,6 +23,13 @@
|
|||||||
"condition": {
|
"condition": {
|
||||||
"miniprogram": {
|
"miniprogram": {
|
||||||
"list": [
|
"list": [
|
||||||
|
{
|
||||||
|
"name": "pages/workOrderDetail/index",
|
||||||
|
"pathName": "pages/workOrderDetail/index",
|
||||||
|
"query": "id=NM00123091982548993",
|
||||||
|
"launchMode": "default",
|
||||||
|
"scene": null
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "pages/workBenchTodoList/index",
|
"name": "pages/workBenchTodoList/index",
|
||||||
"pathName": "pages/workBenchTodoList/index",
|
"pathName": "pages/workBenchTodoList/index",
|
||||||
|
|||||||
@@ -56,4 +56,14 @@ export const getWorkOrderList = async function({
|
|||||||
page, size, park = "", meter = "", tenement = "", status = "", type = "", time = ""
|
page, size, park = "", meter = "", tenement = "", status = "", type = "", time = ""
|
||||||
}) {
|
}) {
|
||||||
return await GET(`/noticeFlow/getDisposeList?page=${page}&size=${size}&park=${park}&meter=${meter}&tenement=${tenement}&status=${status}&type=${type}&time=${time}`,);
|
return await GET(`/noticeFlow/getDisposeList?page=${page}&size=${size}&park=${park}&meter=${meter}&tenement=${tenement}&status=${status}&type=${type}&time=${time}`,);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 确认当前流程
|
||||||
|
export const doNoticeFlow = async function(id) {
|
||||||
|
return await PUT(`/noticeFlow/${id}/meter/dispose`,);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确认当前流程
|
||||||
|
export const getNoticeFlowDetail = async function(id) {
|
||||||
|
return await GET(`/noticeFlow/${id}/detail`,);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user