修改状态
This commit is contained in:
@@ -58,6 +58,12 @@ Page({
|
|||||||
const { token, ...user } = data
|
const { token, ...user } = data
|
||||||
wx.setStorageSync('user', user)
|
wx.setStorageSync('user', user)
|
||||||
wx.setStorageSync('token', data?.token)
|
wx.setStorageSync('token', data?.token)
|
||||||
|
// if (user.workStatus) {
|
||||||
|
// wx.redirectTo({
|
||||||
|
// url: '/pages/workBenchNew/index',
|
||||||
|
// })
|
||||||
|
// return
|
||||||
|
// }
|
||||||
wx.switchTab({
|
wx.switchTab({
|
||||||
url: '/pages/home/index',
|
url: '/pages/home/index',
|
||||||
})
|
})
|
||||||
|
@@ -20,12 +20,13 @@ Page({
|
|||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
console.log("options", options)
|
console.log("options", options)
|
||||||
const { meter, park, routeId } = options;
|
const { meter, park, routeId, disabled } = options;
|
||||||
const that = this;
|
const that = this;
|
||||||
this.setData({
|
this.setData({
|
||||||
meter,
|
meter,
|
||||||
park,
|
park,
|
||||||
routeId,
|
routeId,
|
||||||
|
disabled
|
||||||
}, () => {
|
}, () => {
|
||||||
that.refresh();
|
that.refresh();
|
||||||
})
|
})
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
<view class="text">
|
<view class="text">
|
||||||
抄表记录历史
|
抄表记录历史
|
||||||
</view>
|
</view>
|
||||||
<van-button type="info" size="small" icon="plus" bind:tap="handleCreate"> 新增记录 </van-button>
|
<van-button disabled="{{disabled === 'true'}}" type="info" size="small" icon="plus" bind:tap="handleCreate"> 新增记录 </van-button>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view wx:if="{{list.length}}">
|
<view wx:if="{{list.length}}">
|
||||||
@@ -28,8 +28,8 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="th" style="width: 25%; text-align: center; justify-content: center; display: flex; align-items: center;">
|
<view class="th" style="width: 25%; text-align: center; justify-content: center; display: flex; align-items: center;">
|
||||||
<van-icon wx:if="{{item.isDelete}}" name="edit" size="40rpx" bind:tap="handleUpdate" data-data="{{item}}" color="#15755e" />
|
<van-icon wx:if="{{item.isDelete && disabled !== 'true'}}" name="edit" size="40rpx" bind:tap="handleUpdate" data-data="{{item}}" color="#15755e" />
|
||||||
<van-icon wx:if="{{item.isDelete}}" name="delete" size="40rpx" bind:tap="handleDelete" data-data="{{item}}" color="#15755e" custom-style="margin-left: 20rpx" />
|
<van-icon wx:if="{{item.isDelete && disabled !== 'true'}}" name="delete" size="40rpx" bind:tap="handleDelete" data-data="{{item}}" color="#15755e" custom-style="margin-left: 20rpx" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@@ -53,9 +53,9 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
jumpToReading(e) {
|
jumpToReading(e) {
|
||||||
const { id } = e.currentTarget.dataset;
|
const { id, type } = e.currentTarget.dataset;
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: `/pages/writeReading/index?id=${id}`,
|
url: `/pages/writeReading/index?id=${id}&type=${type}`,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async changeStartStatus(e) {
|
async changeStartStatus(e) {
|
||||||
@@ -73,6 +73,16 @@ Page({
|
|||||||
}, 500)
|
}, 500)
|
||||||
},
|
},
|
||||||
async changeEndStatus(e) {
|
async changeEndStatus(e) {
|
||||||
|
const that = this;
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确认要结束吗?',
|
||||||
|
complete: async (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
const { id, routeid: routeId } = e.currentTarget.dataset;
|
const { id, routeid: routeId } = e.currentTarget.dataset;
|
||||||
const { code, message } = await changeMeterRouteStatus({ id, status: 0, routeId })
|
const { code, message } = await changeMeterRouteStatus({ id, status: 0, routeId })
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
@@ -80,7 +90,11 @@ Page({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
alertSuccess("操作成功")
|
alertSuccess("操作成功")
|
||||||
this.init()
|
that.init()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
|
@@ -32,6 +32,9 @@
|
|||||||
wx:key="id"
|
wx:key="id"
|
||||||
title="{{item.readingRouteName}}"
|
title="{{item.readingRouteName}}"
|
||||||
label="包含{{item.meterRoute}}个抄表点"
|
label="包含{{item.meterRoute}}个抄表点"
|
||||||
|
data-id="{{item.id}}"
|
||||||
|
data-type="look"
|
||||||
|
bind:click="jumpToReading"
|
||||||
>
|
>
|
||||||
<view slot="right-icon">
|
<view slot="right-icon">
|
||||||
<van-button
|
<van-button
|
||||||
@@ -42,6 +45,7 @@
|
|||||||
data-routeId="{{item.readingRouteId}}"
|
data-routeId="{{item.readingRouteId}}"
|
||||||
custom-style="margin-right: 20rpx;"
|
custom-style="margin-right: 20rpx;"
|
||||||
data-id="{{item.id}}"
|
data-id="{{item.id}}"
|
||||||
|
|
||||||
wx:if="{{item.status === 0}}"
|
wx:if="{{item.status === 0}}"
|
||||||
> 开始抄表 </van-button>
|
> 开始抄表 </van-button>
|
||||||
<van-button
|
<van-button
|
||||||
@@ -49,6 +53,7 @@
|
|||||||
size="small"
|
size="small"
|
||||||
bind:tap="jumpToReading"
|
bind:tap="jumpToReading"
|
||||||
data-id="{{item.id}}"
|
data-id="{{item.id}}"
|
||||||
|
data-type="edit"
|
||||||
custom-style="margin-right: 20rpx;"
|
custom-style="margin-right: 20rpx;"
|
||||||
wx:if="{{item.status === 1}}"
|
wx:if="{{item.status === 1}}"
|
||||||
> 去抄表 </van-button>
|
> 去抄表 </van-button>
|
||||||
|
@@ -18,6 +18,10 @@ Page({
|
|||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.init()
|
this.init()
|
||||||
|
const user = wx.getStorageSync('user')
|
||||||
|
this.setData({
|
||||||
|
workStatus: !!user.workStatus
|
||||||
|
})
|
||||||
},
|
},
|
||||||
async init() {
|
async init() {
|
||||||
const { code, message, data } = await getWorkBenchHome()
|
const { code, message, data } = await getWorkBenchHome()
|
||||||
|
@@ -7,6 +7,7 @@ Component({
|
|||||||
properties: {
|
properties: {
|
||||||
meterInfo: Object,
|
meterInfo: Object,
|
||||||
routeId: String,
|
routeId: String,
|
||||||
|
disabled: Boolean,
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,10 +22,10 @@ Component({
|
|||||||
*/
|
*/
|
||||||
methods: {
|
methods: {
|
||||||
jumpToHistory() {
|
jumpToHistory() {
|
||||||
const { meterInfo, routeId } = this.data;
|
const { meterInfo, routeId, disabled } = this.data;
|
||||||
console.log("meterInfo", meterInfo)
|
console.log("meterInfo", meterInfo)
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: `/pages/readingHistory/index?meter=${meterInfo?.id}&park=${meterInfo?.parkId}&routeId=${routeId}`,
|
url: `/pages/readingHistory/index?meter=${meterInfo?.id}&park=${meterInfo?.parkId}&routeId=${routeId}&disabled=${disabled}`,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,8 @@ Component({
|
|||||||
meterInfo: Object,
|
meterInfo: Object,
|
||||||
showLeft: Boolean,
|
showLeft: Boolean,
|
||||||
showRight: Boolean,
|
showRight: Boolean,
|
||||||
routeId: String
|
routeId: String,
|
||||||
|
disabled: Boolean,
|
||||||
},
|
},
|
||||||
observers: {
|
observers: {
|
||||||
"routeId": function(newValue) {
|
"routeId": function(newValue) {
|
||||||
|
@@ -52,14 +52,15 @@
|
|||||||
<view style="flex: 1;">
|
<view style="flex: 1;">
|
||||||
<van-field
|
<van-field
|
||||||
value="{{currentNumber}}"
|
value="{{currentNumber}}"
|
||||||
placeholder="请输入本次读数"
|
placeholder="{{ disabled ? '已抄表' : '请输入本次读数'}}"
|
||||||
bind:change="onChange"
|
bind:change="onChange"
|
||||||
border="{{false}}"
|
border="{{false}}"
|
||||||
custom-style="border: 1rpx solid #ccc; padding: 2px 14rpx; font-size: 32rpx; border-radius: 10rpx;flex: 1;"
|
custom-style="border: 1rpx solid #ccc; padding: 2px 14rpx; font-size: 32rpx; border-radius: 10rpx;flex: 1;"
|
||||||
|
disabled="{{disabled}}"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<photo bind:finish="onPhotoFinish" />
|
<photo bind:finish="onPhotoFinish" wx:if="{{!disabled}}" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="photo">
|
<!-- <view class="photo">
|
||||||
@@ -79,10 +80,10 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="operate">
|
<view class="operate">
|
||||||
<view style="flex: 1;">
|
<view style="flex: 1;">
|
||||||
<van-button type="info" block bind:click="handleCreateReading"> 确定录入 </van-button>
|
<van-button disabled="{{disabled}}" type="info" block bind:click="handleCreateReading"> 确定录入 </van-button>
|
||||||
</view>
|
</view>
|
||||||
<view style="flex: 1; margin-left: 20rpx;">
|
<view style="flex: 1; margin-left: 20rpx;">
|
||||||
<van-button block bind:click="handleClear"> 清除记录 </van-button>
|
<van-button disabled="{{disabled}}" block bind:click="handleClear"> 清除记录 </van-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@@ -18,7 +18,8 @@ Page({
|
|||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const { id } = options;
|
const { id, type } = options;
|
||||||
|
this.setData({ id, type })
|
||||||
this.getMeterList(id)
|
this.getMeterList(id)
|
||||||
},
|
},
|
||||||
async getMeterList(id) {
|
async getMeterList(id) {
|
||||||
|
@@ -8,7 +8,11 @@
|
|||||||
meterInfo="{{meterInfo}}"
|
meterInfo="{{meterInfo}}"
|
||||||
finishNumber="{{finishNumber}}"
|
finishNumber="{{finishNumber}}"
|
||||||
/>
|
/>
|
||||||
<meter-info meterInfo="{{meterInfo}}" routeId="{{routeId}}" />
|
<meter-info
|
||||||
|
meterInfo="{{meterInfo}}"
|
||||||
|
routeId="{{routeId}}"
|
||||||
|
disabled="{{meterInfo.status === 1}}"
|
||||||
|
/>
|
||||||
<reading-info
|
<reading-info
|
||||||
meterInfo="{{meterInfo}}"
|
meterInfo="{{meterInfo}}"
|
||||||
showLeft="{{active !== 0}}"
|
showLeft="{{active !== 0}}"
|
||||||
@@ -18,4 +22,5 @@
|
|||||||
routeId="{{routeId}}"
|
routeId="{{routeId}}"
|
||||||
bind:finishNumber="onSetFinishNumber"
|
bind:finishNumber="onSetFinishNumber"
|
||||||
bind:onSubmit="onSubmit"
|
bind:onSubmit="onSubmit"
|
||||||
|
disabled="{{meterInfo.status === 1}}"
|
||||||
/>
|
/>
|
@@ -23,6 +23,13 @@
|
|||||||
"condition": {
|
"condition": {
|
||||||
"miniprogram": {
|
"miniprogram": {
|
||||||
"list": [
|
"list": [
|
||||||
|
{
|
||||||
|
"name": "pages/workBenchNew/components/workBenchReading/index",
|
||||||
|
"pathName": "pages/workBenchNew/components/workBenchReading/index",
|
||||||
|
"query": "",
|
||||||
|
"launchMode": "default",
|
||||||
|
"scene": null
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "pages/workBenchNew/index",
|
"name": "pages/workBenchNew/index",
|
||||||
"pathName": "pages/workBenchNew/index",
|
"pathName": "pages/workBenchNew/index",
|
||||||
|
Reference in New Issue
Block a user