From 496eaf6c859b868cac4aaaa8948b446d759b9d94 Mon Sep 17 00:00:00 2001 From: zhuguifei <zhuguifei@zhuguifeideiMac.local> Date: 星期三, 14 五月 2025 16:07:20 +0800 Subject: [PATCH] 更新生成点检记录定时器 --- eims-ui-mobile/src/pages/inspect/insp-record.vue | 108 +++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 78 insertions(+), 30 deletions(-) diff --git a/eims-ui-mobile/src/pages/inspect/insp-record.vue b/eims-ui-mobile/src/pages/inspect/insp-record.vue index 620f323..fb20b64 100644 --- a/eims-ui-mobile/src/pages/inspect/insp-record.vue +++ b/eims-ui-mobile/src/pages/inspect/insp-record.vue @@ -1,26 +1,31 @@ <route lang="json5"> { + layout: 'default', needLogin: true, style: { navigationBarTitleText: '鐐规璁板綍', - navigationStyle: 'custom', - navigationBarBackgroundColor: '#4D80F0', + 'app-plus': { + titleNView: { + buttons: [ + { + text: '鎻愪氦', + fontSize: '14px', + color: '#FFFFFF', + }, + { + text: '', + fontSize: '24px', + color: '#FFFFFF', + }, + ], + }, + }, }, } </route> <template> - <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time> + <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 - ></wd-navbar> - <wd-card type="rectangle"> <template #title> <view class="flex justify-between"> @@ -35,7 +40,7 @@ </view> </view> </template> - <view class="flex h-[100rpx]" items-center> + <view class="flex h-[140rpx]" items-center> <image class="slot-img text-center" src="/static/images/camera.png" /> <view class="flex-1"> <view class="text-color-gray text-xs mt-1 flex"> @@ -61,6 +66,7 @@ <text class="ml-1">杩涜涓�</text> </template> </view> + <view class="text-color-gray text-xs mt-2 flex">鍒涘缓鏃堕棿: {{ inspSt.createTime }}</view> </view> </view> </wd-card> @@ -77,11 +83,11 @@ </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"> @@ -110,7 +116,13 @@ </view> </wd-collapse-item> </wd-collapse> - <view class="w-full h-[1rpx] bg-base"></view> + <view class="w-full h-[24rpx]"></view> + <wd-cell> + <template #title> + <text class="text-color-gray">鍏朵粬</text> + </template> + </wd-cell> + <view class="w-full h-[1px] bg-base"></view> <wd-textarea label="鐗硅浜嬮」" label-width="200rpx" @@ -129,7 +141,12 @@ <script setup lang="ts"> import { ref } from 'vue' import { useUserStore, useAccessStore, useSystemConfigStore } from '@/store' -import { getInspStRecordList, updateInspectSt, updateInspRecordBatch } from '@/service/inspect' +import { + getInspStRecordList, + getInspSt, + updateInspectSt, + updateInspRecordBatch, +} from '@/service/inspect' import { useToast, useMessage } from 'wot-design-uni' import type { CollapseInstance } from 'wot-design-uni/components/wd-collapse/types' const message = useMessage() @@ -137,6 +154,7 @@ const collapseRef = ref<CollapseInstance>() const isAllExpanded = ref(false) +const viewMode = ref<string>('Day') // 瀹氫箟鎺ュ彛 interface QueryParams { @@ -152,6 +170,7 @@ equName: string assetNo: string planTimeStr?: string + createTime?: string status: string inspUser: number | string specialNote: string @@ -170,6 +189,7 @@ equName: '', assetNo: '', planTimeStr: '', + createTime: '', status: '', inspUser: '', specialNote: '', @@ -190,7 +210,7 @@ getInspStRecordList(params) .then((res: any) => { // 璇峰嬁鍦ㄧ綉缁滆姹傚洖璋冧腑缁檇ataList璧嬪�硷紒锛佸彧闇�瑕佽皟鐢╟omplete灏卞彲浠ヤ簡 - paging.value.complete(res.rows) + paging.value.completeByTotal(res.rows, res.total) }) .catch((res) => { // 濡傛灉璇锋眰澶辫触鍐檖aging.value.complete(false)锛屼細鑷姩灞曠ず閿欒椤甸潰 @@ -207,9 +227,11 @@ const goBack = () => { uni.navigateBack() } -function handleClickRight() { - handleConfirm() -} +onNavigationBarButtonTap((e) => { + if (e.index === 0) { + handleConfirm() + } +}) const toggleCollapse = () => { isAllExpanded.value = !isAllExpanded.value @@ -243,6 +265,7 @@ updateInspRecordBatch(params) .then((res: any) => { updateInspSt(resolve) + toast.success('鎿嶄綔鎴愬姛') }) .catch((res) => { console.error(res) @@ -278,15 +301,40 @@ { deep: true }, ) onLoad((options) => { - inspSt.id = options.id - inspSt.inspCode = options.inspCode - inspSt.equName = options.equName - inspSt.assetNo = options.assetNo - inspSt.planTimeStr = options.planTimeStr - inspSt.specialNote = options?.specialNote - inspSt.inspUser = userStore?.userInfo?.userId + // inspSt.id = options.id + // inspSt.inspCode = options.inspCode + // inspSt.equName = options.equName + // inspSt.assetNo = options.assetNo + // inspSt.planTimeStr = options.planTimeStr + // inspSt.createTime = options.createTime + // inspSt.specialNote = options?.specialNote + // inspSt.inspUser = userStore?.userInfo?.userId + viewMode.value = options.viewMode + initData(options.id) }) +function initData(id: any) { + getInspSt(id) + .then((res: any) => { + if (res?.id) { + const inspCode = `${res?.equId}_${res?.planTime}_${viewMode.value}` + inspSt.inspCode = inspCode + Object.assign(inspSt, res) + reloadData() + } else { + uni.showToast({ + title: '鏁版嵁鏌ヨ澶辫触锛岃鑱旂郴绠$悊鍛�', + icon: 'none', + }) + } + }) + .catch((res) => { + console.error(res) + }) +} +function reloadData() { + paging.value.reload() +} const dataCount = computed(() => dataList.value.length) const checkCount = computed(() => dataList.value.filter((item) => item.status === '1').length) const normalNum = computed(() => dataList.value.filter((item) => item.inspResult === '1').length) -- Gitblit v1.9.3