| | |
| | | safeAreaInsetTop |
| | | > |
| | | <template #right> |
| | | <text v-if="isOperatorOrRepair()" class="text-white">提交</text> |
| | | <text v-if="maintSt.status === '0'" class="text-white">提交</text> |
| | | </template> |
| | | </wd-navbar> |
| | | <wd-cell> |
| | |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <view class="flex h-[140rpx]" items-center> |
| | | <view class="flex" items-center> |
| | | <image class="slot-img text-center" src="/static/images/camera.png" /> |
| | | <view class="flex-1"> |
| | | <view class="text-color-gray text-sm mt-1 flex"> |
| | |
| | | <text class="mr-3">待保养: {{ maintSt.dbyCount }}</text> |
| | | | |
| | | <text class="mx-3">保养中: {{ maintSt.byCount }}</text> |
| | | | |
| | | <text class="ml-3">待验证: {{ maintSt.dyzCount }}</text> |
| | | <!-- |--> |
| | | <!-- <text class="ml-3">待验证: {{ maintSt.dyzCount }}</text>--> |
| | | </view> |
| | | <view class="text-color-gray text-sm mt-2 flex"> |
| | | <text>状态:</text> |
| | | <template v-if="maintSt.status === '1'"> |
| | | <wd-icon class="icon-color-success" name="check-outline" size="34rpx"></wd-icon> |
| | | <text class="ml-1">已完成</text> |
| | | </template> |
| | | <template v-else-if="maintSt.status === '2'"> |
| | | <wd-icon class="icon-color-warning" name="check-outline" size="34rpx"></wd-icon> |
| | | <text class="ml-1">已确认</text> |
| | | </template> |
| | | <template v-else> |
| | | <wd-icon class="icon-color-base" name="detection" size="40rpx"></wd-icon> |
| | |
| | | placeholder="请输入特记事项" |
| | | clearable |
| | | /> |
| | | <!-- 新增确认完成按钮 --> |
| | | <view class="flex justify-around mt-4"> |
| | | <wd-button type="primary" block size="large" v-if="maintSt.status === '0'" @click="handleClickRight">提交</wd-button> |
| | | <wd-button type="success" block size="large" v-if="isLeader() && maintSt.status === '1'" @click="handleComplete">确认完成</wd-button> |
| | | </view> |
| | | </view> |
| | | <!-- 新增提交按钮 --> |
| | | <view class="flex justify-center mt-4"> |
| | | <wd-button type="primary" block size="large" @click="handleClickRight">提交</wd-button> |
| | | </view> |
| | | <!-- <view class="flex justify-center mt-4">--> |
| | | <!-- <wd-button type="primary" block size="large" @click="handleClickRight">提交</wd-button>--> |
| | | <!-- </view>--> |
| | | </z-paging> |
| | | |
| | | <!-- 备件选择弹出层 --> |
| | |
| | | } |
| | | |
| | | function loadSpareParts(value?: string) { |
| | | getSpareList({ name: value }).then((res: any) => { |
| | | getSpareList({ name: value, pageNum: 1, pageSize: 10 }).then((res: any) => { |
| | | sparePartsList.value = res.rows |
| | | |
| | | }) |
| | |
| | | .then((res: any) => { |
| | | resolve(true) |
| | | if (res?.code === 200) { |
| | | reloadData() |
| | | uni.$emit('maint-st-refresh') |
| | | goBack() |
| | | toastSucces() |
| | | } |
| | | }) |
| | |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 确认完成按钮点击事件 |
| | | */ |
| | | function handleComplete() { |
| | | if (!isLeader()) { |
| | | toast.info('无权限操作'); |
| | | return; |
| | | } |
| | | const now = new Date(); |
| | | const data: any = Object.assign( |
| | | {}, |
| | | { |
| | | id: maintSt.id, |
| | | status: '2', |
| | | verifyUser: userStore?.userInfo?.userId , |
| | | verifyTime: `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}:${String(now.getSeconds()).padStart(2, '0')}` |
| | | }, |
| | | ) |
| | | updateMaintSt(data) |
| | | .then((res: any) => { |
| | | if (res?.code === 200) { |
| | | uni.$emit('maint-st-refresh') |
| | | goBack() |
| | | toastSucces() |
| | | } |
| | | }) |
| | | .catch((res) => { |
| | | console.error(res) |
| | | }) |
| | | |
| | | } |
| | | |
| | | // 新增方法:获取状态文本 |
| | | function getStatusText(maintFun: string): string { |
| | | switch (maintFun) { |