From 14681dfe7052cb76eefcc0c17d0a0d708e1ac9dd Mon Sep 17 00:00:00 2001 From: zhuguifei <zhuguifei@zhuguifeideiMac.local> Date: 星期二, 13 五月 2025 16:31:14 +0800 Subject: [PATCH] 完成移动端基本功能 --- eims-ui-mobile/src/pages/inspect/insp-record.vue | 64 ++++++++++++++++++++++++------- 1 files changed, 49 insertions(+), 15 deletions(-) diff --git a/eims-ui-mobile/src/pages/inspect/insp-record.vue b/eims-ui-mobile/src/pages/inspect/insp-record.vue index 7b64703..e17e7bf 100644 --- a/eims-ui-mobile/src/pages/inspect/insp-record.vue +++ b/eims-ui-mobile/src/pages/inspect/insp-record.vue @@ -24,7 +24,7 @@ } </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-card type="rectangle"> <template #title> @@ -66,9 +66,7 @@ <text class="ml-1">杩涜涓�</text> </template> </view> - <view class="text-color-gray text-xs mt-2 flex"> - 鍒涘缓鏃堕棿: {{inspSt.createTime}} - </view> + <view class="text-color-gray text-xs mt-2 flex">鍒涘缓鏃堕棿: {{ inspSt.createTime }}</view> </view> </view> </wd-card> @@ -118,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" @@ -137,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() @@ -145,6 +154,7 @@ const collapseRef = ref<CollapseInstance>() const isAllExpanded = ref(false) +const viewMode = ref<string>('Day') // 瀹氫箟鎺ュ彛 interface QueryParams { @@ -255,7 +265,7 @@ updateInspRecordBatch(params) .then((res: any) => { updateInspSt(resolve) - toast.success("鎿嶄綔鎴愬姛") + toast.success('鎿嶄綔鎴愬姛') }) .catch((res) => { console.error(res) @@ -291,16 +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.createTime = options.createTime - 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