管理员可以修改项目所属人

This commit is contained in:
sdaduanbilei 2025-12-03 15:22:08 +08:00
parent 7dbeeeb0c9
commit 42dc47724f
2 changed files with 48 additions and 16 deletions

View File

@ -40,6 +40,35 @@ Page({
}
})
},
make(e){
const item = e.currentTarget.dataset.item
const status = parseInt(e.currentTarget.dataset.status)
const data = {id:item.id,plantId:item.plantId, name:item.name,remark:item.name,status: status}
if (status != 3){
this.changeStatus(data)
} else {
wx.showModal({
content: '确认跳过该任务?',
complete: (res) => {
if (res.confirm) {
this.changeStatus(data)
}
}
})
}
},
changeStatus(data){
api('/plant/makeCare','POST',data,'json').then(res => {
if (res.code === 200){
wx.showToast({
icon:'success',
title: res.msg,
})
this.fetchList()
}
})
},
goAdd(){
wx.navigateTo({
url: '../add/index',

View File

@ -28,30 +28,33 @@
<!-- list 数据 -->
<scroll-view scroll-y="{{true}}" wx:else>
<view class="padding">
<view wx:for="{{list}}" >
<view wx:for="{{list}}">
<view class="mb-16 bo">{{item.name}}</view>
<view wx:for="{{item.careList}}">
<view class="row padding mb-32" data-id="{{item.plant.id}}" bind:tap="goInfo">
<view class="flex flex-center flex-justify-start">
<image class="pic" mode="aspectFill" wx:if="{{item.plant.imgList[0].url}}" src="{{item.plant.imgList[0].url}}"></image>
<image class="pic" mode="aspectFill" wx:else src="https://res.catter.cn/pub/2025/09/30/20250930143920286.png"></image>
<view style="margin-left:16rpx;" class="full-width">
<view class="flex flex-center flex-justify-between full-width">
<view class="font-16 bold">{{item.plant.name}}</view>
<t-tag wx:if="{{item.todayCare.status === 1}}" shape="round" theme="primary">立即完成</t-tag>
<t-tag wx:if="{{item.todayCare.status === 2}}" shape="round">已完成</t-tag>
<t-tag wx:if="{{item.todayCare.status === 3}}" shape="round" theme="primary">跳过</t-tag>
<t-tag wx:if="{{item.todayCare.status === 4}}" shape="round" theme="danger">已逾期{{item.todayCare.expireDays}}天</t-tag>
</view>
<view class="flex flex-center flex-justify-start mt-16 ">
<view>
<view class="font-12 grey">上次养护:{{item.plant.lastPeriod}}</view>
<view class="flex flex-center flex-justify-start">
<image class="pic" mode="aspectFill" wx:if="{{item.plant.imgList[0].url}}" src="{{item.plant.imgList[0].url}}"></image>
<image class="pic" mode="aspectFill" wx:else src="https://res.catter.cn/pub/2025/09/30/20250930143920286.png"></image>
<view style="margin-left:16rpx;" class="full-width">
<view class="flex flex-center flex-justify-between full-width">
<view class="font-16 bold">{{item.plant.name}}</view>
<view class="flex flex-center flex-justify-end">
<t-icon wx:if="{{item.todayCare.status == 1 || item.todayCare.status == 4}}" name="alarm-off" style="padding:0 32rpx ; " data-status="3" data-item="{{item.todayCare}}" catch:tap="make"></t-icon>
<t-tag wx:if="{{item.todayCare.status === 1}}" shape="round" data-status="2" data-item="{{item.todayCare}}" catch:tap="make" theme="primary">立即完成</t-tag>
<t-tag wx:if="{{item.todayCare.status === 2}}" shape="round" >已完成</t-tag>
<t-tag wx:if="{{item.todayCare.status === 3}}" shape="round" theme="danger" variant="outline" >已跳过</t-tag>
<t-tag wx:if="{{item.todayCare.status === 4}}" shape="round" data-status="2" data-item="{{item.todayCare}}" catch:tap="make" theme="danger">已逾期{{item.todayCare.expireDays}}天</t-tag>
</view>
</view>
<view class="flex flex-center flex-justify-start mt-16 ">
<view>
<view class="font-12 grey">上次养护:{{item.plant.lastPeriod}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>