fix 任务工单
This commit is contained in:
parent
3fa72b2b3d
commit
7acb486861
@ -44,9 +44,10 @@ Page({
|
||||
}
|
||||
|
||||
tmp.carePlans.map(e => {
|
||||
console.log(e.id);
|
||||
const item = tmp.todayCares.find(sub => sub.careId === e.id)
|
||||
console.log(item);
|
||||
e.status = item ? item.status:2
|
||||
e.todayCareId = item.id
|
||||
return e
|
||||
|
||||
})
|
||||
@ -85,13 +86,15 @@ Page({
|
||||
|
||||
make(e){
|
||||
const item = e.currentTarget.dataset.item
|
||||
console.log(item);
|
||||
if (item.status === 2){
|
||||
wx.showModal({
|
||||
content: '已完成',
|
||||
})
|
||||
return
|
||||
}
|
||||
const data = {id:item.id,plantId:item.plantId, name:item.name,remark:'测试',status:2}
|
||||
const data = {id:item.todayCareId,plantId:item.plantId, name:item.name,remark:item.name,status: 2}
|
||||
console.log(data);
|
||||
api('/plant/makeCare','POST',data,'json').then(res => {
|
||||
if (res.code === 200){
|
||||
wx.showToast({
|
||||
|
||||
@ -62,6 +62,9 @@
|
||||
</view>
|
||||
<view class="mt-16">{{item.name}}</view>
|
||||
<view class="mt-16 font-12 grey">每{{item.period}}天一次</view>
|
||||
<view wx:if="{{item.status === 1}}">
|
||||
<view class="mt-16 font-12 primary">立即完成</view>
|
||||
</view>
|
||||
<view wx:if="{{item.status === 2}}">
|
||||
<view class="mt-16 font-12 primary">已完成</view>
|
||||
</view>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user