| | |
| | | { |
| | | layout: 'default', |
| | | needLogin: true, |
| | | style: { |
| | | navigationBarTitleText: '点检记录', |
| | | 'app-plus': { |
| | | titleNView: { |
| | | buttons: [ |
| | | { |
| | | text: '提交', |
| | | fontSize: '14px', |
| | | color: '#FFFFFF', |
| | | }, |
| | | { |
| | | text: '', |
| | | fontSize: '24px', |
| | | color: '#FFFFFF', |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | }, |
| | | style: { navigationBarTitleText: '点检记录', navigationStyle: 'custom' }, |
| | | } |
| | | </route> |
| | | <template> |
| | | <z-paging ref="paging" v-model="dataList" :auto="false" @query="queryList" show-refresher-update-time> |
| | | <template #top> |
| | | <wd-navbar |
| | | title="点检记录" |
| | | left-arrow |
| | | @click-left="goBack" |
| | | right-text="提交" |
| | | @click-right="handleClickRight" |
| | | custom-style="background: #4D80F0;" |
| | | safeAreaInsetTop |
| | | > |
| | | <template #right> |
| | | <text v-if="isOperatorOrRepair()" class="text-white">提交</text> |
| | | </template> |
| | | </wd-navbar> |
| | | <wd-card type="rectangle"> |
| | | <template #title> |
| | | <view class="flex justify-between"> |
| | |
| | | </wd-button> |
| | | </wd-cell> |
| | | <wd-collapse v-model="collSelects" title="点检项" ref="collapseRef"> |
| | | <wd-collapse-item :name="item.id" v-for="(item, index) in dataList"> |
| | | <wd-collapse-item :name="item.id" v-for="(item, index) in dataList" disabled> |
| | | <template #title="{ expanded, disabled, isFirst }"> |
| | | <view class="flex justify-between"> |
| | | <view class="flex justify-center items-center"> |
| | | <text class="text-sm">{{ item.inspName }}</text> |
| | | <view class="flex justify-center items-center" style="max-width: 60%;"> |
| | | <text class="text-sm" >{{ item.inspName }}</text> |
| | | </view> |
| | | |
| | | <view class="flex items-center"> |
| | |
| | | </template> |
| | | </wd-cell> |
| | | <view class="w-full h-[1px] bg-base"></view> |
| | | <wd-input |
| | | label="运行时间" |
| | | label-width="200rpx" |
| | | clearable |
| | | v-model="inspSt.runTimes" |
| | | placeholder="请输入运行时间(h)" |
| | | inputmode="numeric" |
| | | /> |
| | | <wd-input |
| | | label="故障时间" |
| | | label-width="200rpx" |
| | | clearable |
| | | v-model="inspSt.faultTimes" |
| | | placeholder="请输入故障时间(h)" |
| | | inputmode="numeric" |
| | | /> |
| | | <wd-textarea |
| | | label="特记事项" |
| | | label-width="200rpx" |
| | |
| | | <script setup lang="ts"> |
| | | import { ref } from 'vue' |
| | | import { useUserStore, useAccessStore, useSystemConfigStore } from '@/store' |
| | | import { isLeader, isOperatorOrRepair } from '@/utils/RoleUtils' |
| | | import { |
| | | getInspStRecordList, |
| | | getInspSt, |
| | |
| | | status: string |
| | | inspUser: number | string |
| | | specialNote: string |
| | | runTimes: number |
| | | faultTimes: number |
| | | } |
| | | |
| | | const dataChange = ref(false) |
| | |
| | | status: '', |
| | | inspUser: '', |
| | | specialNote: '', |
| | | runTimes: 0, |
| | | faultTimes: 0, |
| | | }) |
| | | |
| | | const paging = ref(null) |
| | |
| | | const goBack = () => { |
| | | uni.navigateBack() |
| | | } |
| | | onNavigationBarButtonTap((e) => { |
| | | if (e.index === 0) { |
| | | |
| | | function handleClickRight() { |
| | | if(isOperatorOrRepair()){ |
| | | handleConfirm() |
| | | } |
| | | }) |
| | | |
| | | } |
| | | |
| | | const toggleCollapse = () => { |
| | | isAllExpanded.value = !isAllExpanded.value |
| | |
| | | updateInspRecordBatch(params) |
| | | .then((res: any) => { |
| | | updateInspSt(resolve) |
| | | toast.success('操作成功') |
| | | }) |
| | | .catch((res) => { |
| | | console.error(res) |
| | | toast.error('操作失败') |
| | | }) |
| | | } |
| | | function updateInspSt(resolve: any) { |
| | |
| | | inspSt.status = '1' |
| | | updateInspectSt(inspSt) |
| | | .then((res: any) => { |
| | | toast.success('操作成功') |
| | | paging.value.reload() |
| | | uni.$emit('insp-st-refresh') |
| | | resolve(true) |
| | | }) |
| | | .catch((res) => { |
| | | console.error(res) |
| | | toast.error('操作失败') |
| | | }) |
| | | } |
| | | |