From df64c34d92cbe8501bbbfe837bc491a47452c0b6 Mon Sep 17 00:00:00 2001 From: baoshiwei <baoshiwei@shlanbao.cn> Date: 星期一, 09 六月 2025 10:58:19 +0800 Subject: [PATCH] feat(eims): 新增保养工单批量修改功能并优化相关领域对象 --- eims-ui-mobile/src/pages/inspect/insp-st.vue | 55 +++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 37 insertions(+), 18 deletions(-) diff --git a/eims-ui-mobile/src/pages/inspect/insp-st.vue b/eims-ui-mobile/src/pages/inspect/insp-st.vue index f53f836..0eb3a03 100644 --- a/eims-ui-mobile/src/pages/inspect/insp-st.vue +++ b/eims-ui-mobile/src/pages/inspect/insp-st.vue @@ -13,12 +13,15 @@ <template #top> <wd-drop-menu> <wd-drop-menu-item v-model="viewMode" :options="viewModeList" @change="handleViewMode" /> + <wd-drop-menu-item + v-model="filterDate" + :options="filterDateList" + @change="handleFilterDate" + /> <wd-drop-menu-item v-model="equName" :options="equList" @change="handleEquName" /> </wd-drop-menu> - <wd-divider></wd-divider> </template> <view class="bg-base"> - <view class="w-full h-[24rpx]"></view> <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id"> <template #title> <view class="flex justify-between"> @@ -40,19 +43,19 @@ <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"> - <text class="mr-3">鐐规鎬绘暟: {{ item.recordCount }}</text> + <view class="text-color-gray text-sm mt-1 flex"> + <text class="mr-3">鎬绘暟: {{ item.recordCount }}</text> | <text class="mx-3">宸茬偣妫�: {{ item.checkCount }}</text> | <text class="ml-3">鏈偣妫�: {{ item.unCheckCount }}</text> </view> - <view class="text-color-gray text-xs mt-2 flex"> + <view class="text-color-gray text-sm mt-2 flex"> <text class="mr-3">姝e父: {{ item.normalNum }}</text> | <text class="mx-3">寮傚父: {{ item.abNormalNum }}</text> </view> - <view class="text-color-gray text-xs mt-2 flex"> + <view class="text-color-gray text-sm mt-2 flex"> <text>鐘舵�侊細</text> <template v-if="item.recordCount === item.checkCount"> <wd-icon class="icon-color-success" name="check-outline" size="34rpx"></wd-icon> @@ -63,9 +66,7 @@ <text class="ml-1">杩涜涓�</text> </template> </view> - <view class="text-color-gray text-xs mt-2 flex"> - 鍒涘缓鏃堕棿: {{item.createTime}} - </view> + <view class="text-color-gray text-sm mt-2 flex">鍒涘缓鏃堕棿: {{ item.createTime }}</view> </view> <wd-button size="small" icon="edit-outline" @click.stop="itemClick(item)">鏄庣粏</wd-button> </view> @@ -77,15 +78,21 @@ <script setup lang="ts"> import { ref } from 'vue' import { getInspStList } from '@/service/inspect' -import { onShow } from '@dcloudio/uni-app' +import dayjs from 'dayjs' const viewMode = ref<string>('Day') const equName = ref<string>('鎵�鏈夎澶�') +const filterDate = ref<string>('1') const viewModeList = ref<Record<string, any>[]>([ { label: '鏃ヨ鍥�', value: 'Day' }, { label: '鏈堣鍥�', value: 'Month' }, ]) +const filterDateList = ref<Record<string, any>[]>([ + { label: '鎵�鏈夋暟鎹�', value: '0' }, + { label: '褰撳ぉ(鏈�)鏁版嵁', value: '1' }, +]) + const equList = ref<Record<string, any>[]>([{ label: '鎵�鏈夎澶�', value: '鎵�鏈夎澶�' }]) function handleViewMode({ value }) { reloadData() @@ -93,17 +100,28 @@ function handleEquName({ value }) { console.log(value) } +function handleFilterDate({ value }) { + reloadData() +} const paging = ref(null) const dataList = ref([]) const queryList = (pageNum?: number, pageSize?: number) => { - // 杩欓噷鐨刾ageNo鍜宲ageSize浼氳嚜鍔ㄨ绠楀ソ锛岀洿鎺ヤ紶缁欐湇鍔″櫒鍗冲彲 - // 杩欓噷鐨勮姹傚彧鏄紨绀猴紝璇锋浛鎹㈡垚鑷繁鐨勯」鐩殑缃戠粶璇锋眰锛屽苟鍦ㄧ綉缁滆姹傚洖璋冧腑閫氳繃paging.value.complete(璇锋眰鍥炴潵鐨勬暟缁�)灏嗚姹傜粨鏋滀紶缁檢-paging - getInspStList({ pageNum, pageSize, viewMode: viewMode.value }) + const params: any = { + pageNum, + pageSize, + viewMode: viewMode.value, + } + if (filterDate.value === '1') { + params.planTime = dayjs().format('YYYY-MM-DD') + } else { + delete params.planTime + } + getInspStList(params) .then((res: any) => { // 璇峰嬁鍦ㄧ綉缁滆姹傚洖璋冧腑缁檇ataList璧嬪�硷紒锛佸彧闇�瑕佽皟鐢╟omplete灏卞彲浠ヤ簡 - paging.value.complete(res.rows) + paging.value.completeByTotal(res.rows, res.total) }) .catch((res) => { // 濡傛灉璇锋眰澶辫触鍐檖aging.value.complete(false)锛屼細鑷姩灞曠ず閿欒椤甸潰 @@ -114,9 +132,10 @@ } function itemClick(item) { - const inspCode = `${item.equId}_${item.planTime}_${viewMode.value}` + // const inspCode = `${item.equId}_${item.planTime}_${viewMode.value}` uni.navigateTo({ - url: `/pages/inspect/insp-record?id=${item.id}&createTime=${item.createTime}&inspCode=${inspCode}&specialNote=${item.specialNote ?? ''}&equName=${item.equName ?? ''}&assetNo=${item.assetNo ?? ''}&planTimeStr=${item.planTimeStr ?? ''}`, + // url: `/pages/inspect/insp-record?id=${item.id}&createTime=${item.createTime}&inspCode=${inspCode}&specialNote=${item.specialNote ?? ''}&equName=${item.equName ?? ''}&assetNo=${item.assetNo ?? ''}&planTimeStr=${item.planTimeStr ?? ''}`, + url: `/pages/inspect/insp-record?id=${item.id}&viewMode=${viewMode.value}`, }) } @@ -127,7 +146,7 @@ uni.$on('insp-st-refresh', reloadData) }) onUnload(() => { - uni.$off('insp-st-refres', reloadData) + uni.$off('insp-st-refresh', reloadData) }) </script> @@ -145,7 +164,7 @@ height: 40rpx; } .text-mini { - font-size: 22rpx; + font-size: 24rpx; } .menu-indicator { -- Gitblit v1.9.3