From bab490d2da009c1a23b352b3b964e0c2dd06a0b3 Mon Sep 17 00:00:00 2001 From: baoshiwei <baoshiwei@shlanbao.cn> Date: 星期四, 12 六月 2025 17:32:42 +0800 Subject: [PATCH] 移动端功能优化 --- eims-ui-mobile/src/pages/inspect/insp-record.vue | 34 +++++++++++++++++----------------- 1 files changed, 17 insertions(+), 17 deletions(-) diff --git a/eims-ui-mobile/src/pages/inspect/insp-record.vue b/eims-ui-mobile/src/pages/inspect/insp-record.vue index c039bad..d38c7ea 100644 --- a/eims-ui-mobile/src/pages/inspect/insp-record.vue +++ b/eims-ui-mobile/src/pages/inspect/insp-record.vue @@ -124,7 +124,7 @@ </view> </template> - <view v-if="item.showDesc" class="mt-2"> + <view v-if="item.inspResult === '2'" class="mt-2"> <wd-input v-model="item.inspDesc" placeholder="璇疯緭鍏ュ紓甯告弿杩�" @@ -177,8 +177,8 @@ /> <!-- 鏂板鎻愪氦鎸夐挳 --> <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> + <wd-button type="primary" block size="large" v-if="inspSt.status === '0' || inspSt.status === '1'" @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> @@ -186,7 +186,7 @@ <script setup lang="ts"> import { useUserStore, useAccessStore, useSystemConfigStore } from '@/store' -import { isLeader, isOperatorOrRepair } from '@/utils/RoleUtils' +import { isLeader, isLineOrRepair } from '@/utils/RoleUtils' import { getInspStRecordList, getInspSt, @@ -244,8 +244,8 @@ status: '', inspUser: '', specialNote: '', - runTimes: 0, - faultTimes: 0, + runTimes: undefined, + faultTimes: undefined, }) const paging = ref(null) @@ -280,13 +280,6 @@ // 淇敼鏃堕棿鏍煎紡涓� YYYY-MM-DD HH:mm:ss const now = new Date() item.inspTime = `${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')}` - - if (item.inspResult === '2') { - item.showDesc = true - } else { - item.showDesc = false - item.inspDesc = '' - } } const goBack = () => { @@ -294,8 +287,11 @@ } function handleClickRight() { - if (isOperatorOrRepair()) { + + if (inspSt.status === '0') { handleConfirm() + } else if (inspSt.status === '1') { + handleComplete() } } @@ -368,6 +364,7 @@ } else { inspSt.status = '0' } + updateInspectSt(inspSt) .then((res: any) => { toast.success('鎿嶄綔鎴愬姛') @@ -385,15 +382,18 @@ * 纭瀹屾垚鎸夐挳鐐瑰嚮浜嬩欢 */ function handleComplete() { - if (!isLeader()) { - toast.info('鏃犳潈闄愭搷浣�'); - return; + console.log('handleComplete', inspSt) + if (!inspSt.runTimes || !inspSt.faultTimes) { + message.alert('璇峰~鍐欒繍琛屾鏁板拰鏁呴殰娆℃暟!') + return false } const now = new Date(); const data: any = Object.assign( {}, { id: inspSt.id, + runTimes: inspSt.runTimes, + faultTimes: inspSt.faultTimes, 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')}` -- Gitblit v1.9.3