| | |
| | | safeAreaInsetTop |
| | | > |
| | | <template #right> |
| | | <text v-if="isOperatorOrRepair()" class="text-white">提交</text> |
| | | <text v-if="inspSt.status === '0'" class="text-white">提交</text> |
| | | </template> |
| | | </wd-navbar> |
| | | <wd-card type="rectangle"> |
| | |
| | | </view> |
| | | <view class="text-color-gray text-sm mt-2 flex"> |
| | | <text>状态:</text> |
| | | <template v-if="dataCount > 0 && dataCount === checkCount"> |
| | | <template v-if="inspSt.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="inspSt.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> |
| | |
| | | size="large" |
| | | /> |
| | | <!-- 新增提交按钮 --> |
| | | <view class="flex justify-center mt-4"> |
| | | <wd-button type="primary" block size="large" @click="handleClickRight">提交</wd-button> |
| | | <view class="flex justify-around mt-4"> |
| | | <wd-button type="primary" block size="large" v-if="inspSt.status === '0'" @click="handleClickRight">提交</wd-button> |
| | | <wd-button type="success" block size="large" v-if="isLeader() && inspSt.status === '1'" @click="handleComplete">确认完成</wd-button> |
| | | </view> |
| | | </view> |
| | | </z-paging> |
| | |
| | | specialNote: string |
| | | runTimes: number |
| | | faultTimes: number |
| | | verifyUser?: number | string |
| | | verifyTime?: string |
| | | } |
| | | |
| | | const dataChange = ref(false) |
| | |
| | | } |
| | | function updateInspSt(resolve: any) { |
| | | // 更新点检汇总 |
| | | inspSt.status = '1' |
| | | if (dataCount.value === selectedItems.value.length) { |
| | | inspSt.status = '1' |
| | | } else { |
| | | inspSt.status = '0' |
| | | } |
| | | updateInspectSt(inspSt) |
| | | .then((res: any) => { |
| | | toast.success('操作成功') |
| | |
| | | } |
| | | |
| | | /** |
| | | * 确认完成按钮点击事件 |
| | | */ |
| | | function handleComplete() { |
| | | if (!isLeader()) { |
| | | toast.info('无权限操作'); |
| | | return; |
| | | } |
| | | const now = new Date(); |
| | | const data: any = Object.assign( |
| | | {}, |
| | | { |
| | | id: inspSt.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')}` |
| | | }, |
| | | ) |
| | | updateInspectSt(data) |
| | | .then((res: any) => { |
| | | if (res?.code === 200) { |
| | | uni.$emit('insp-st-refresh') |
| | | goBack() |
| | | toast.success('操作成功') |
| | | } |
| | | }) |
| | | .catch((res) => { |
| | | console.error(res) |
| | | toast.error('操作失败') |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 点检记录条目点击事件 |
| | | * @param item |
| | | */ |