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/repair/res-list.vue | 138 +++++++++++++++++++++++++++++++--------------- 1 files changed, 93 insertions(+), 45 deletions(-) diff --git a/eims-ui-mobile/src/pages/repair/res-list.vue b/eims-ui-mobile/src/pages/repair/res-list.vue index 096aedd..914a751 100644 --- a/eims-ui-mobile/src/pages/repair/res-list.vue +++ b/eims-ui-mobile/src/pages/repair/res-list.vue @@ -2,30 +2,25 @@ { 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" @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-drop-menu> <wd-drop-menu-item v-model="resTypeId" @@ -33,6 +28,11 @@ value-key="dictValue" :options="resTypeList" @change="handleResType" + /> + <wd-drop-menu-item + v-model="filterDate" + :options="filterDateList" + @change="handleFilterDate" /> <wd-drop-menu-item v-model="status" @@ -50,7 +50,7 @@ <view class="flex justify-between items-center"> <view class="flex items-center menu-title-box"> <view class="menu-indicator"></view> - <text class="ml-1 text-xs">{{ item.resCode }}</text> + <text class="ml-1 text-sm">{{ item.resCode }}</text> <text class="text-color-gray ml-2 text-mini">鎺ュ崟:{{ item.createTime }}</text> </view> @@ -140,9 +140,8 @@ size="small" icon="edit-outline" @click.stop="goToFeedBack(item)" - v-if="item.fbId === null" > - 鍐欒瘎浠� + 鏌ョ湅璇勪环 </wd-button> </view> </template> @@ -176,9 +175,8 @@ size="small" icon="edit-outline" @click.stop="goToFeedBack(item)" - v-if="item.fbId === null" > - 鍐欒瘎浠� + {{ item.fbId == null ? '鍐欒瘎浠�' : '鏌ョ湅璇勪环' }} </wd-button> </view> </template> @@ -197,23 +195,50 @@ import { isLeader, isOperatorOrRepair } from '@/utils/RoleUtils' import { useUserStore } from '@/store' import { formatDate } from '@/utils/DateUtils' +import dayjs from "dayjs"; const userStore = useUserStore() const message = useMessage() const toast = useToast() + +/** + * 鍏朵粬椤甸潰浼犺繃鏉ョ殑鏁版嵁 + * assetNo: 璧勪骇缂栧彿 + * from: 鏄惁鏄壂鐮佽繘鏉ョ殑锛屽鏋滄槸鎵爜杩涙潵锛屽彧鑳芥煡璇㈠浐瀹氳澶囩殑鏁版嵁 + */ +interface PageParams { + assetNo?: string + from?: string +} + +// 椤甸潰鍙傛暟锛屼笂涓〉闈紶閫掕繃鏉ョ殑鍙傛暟 +const option = reactive<PageParams>({ + assetNo: '', + from: '', +}) + // 缁翠慨鍗曠被鍨� -const resTypeId = ref<number>(0) +const resTypeId = ref<number>(-1) // 缁翠慨鍗曞鐞嗙姸鎬� -const status = ref<number>(0) +const status = ref<number>(-1) const isSelectRes = ref(false) +const filterDate = ref<string>('2') -const resTypeList = ref<any>([{ dictLabel: '鎵�鏈夌被鍨�', dictValue: 0 }]) -const statusList = ref<any>([{ dictLabel: '鎵�鏈夌姸鎬�', dictValue: 0 }]) +const filterDateList = ref<Record<string, any>[]>([ + { label: '鎵�鏈夋暟鎹�', value: '0' }, + { label: '褰撳ぉ鏁版嵁', value: '1' }, + { label: '褰撴湀鏁版嵁', value: '2' }, +]) +const resTypeList = ref<any>([{ dictLabel: '鎵�鏈夌被鍨�', dictValue: -1 }]) +const statusList = ref<any>([{ dictLabel: '鎵�鏈夌姸鎬�', dictValue: -1 }]) function handleResType({ value }) { reloadData() } function handleResStatu({ value }) { + reloadData() +} +function handleFilterDate({ value }) { reloadData() } @@ -221,19 +246,40 @@ const dataList = ref([]) const queryList = (pageNum?: number, pageSize?: number) => { - const parmams = { + const queryParams: any = { pageNum, pageSize, reqType: resTypeId.value, status: status.value, } - if (resTypeId.value === 0) { - delete parmams.reqType + if (resTypeId.value === -1) { + delete queryParams.reqType } - if (status.value === 0) { - delete parmams.status + if (status.value === -1) { + delete queryParams.status } - getRepairResList(parmams) + + if (filterDate.value === '1') { + // 鑾峰彇褰撳墠鏃ユ湡 + const now = dayjs() + queryParams.params = { + beginReqTime: now.startOf('day').format('YYYY-MM-DD 00:00:00'), + endReqTime: now.endOf('day').format('YYYY-MM-DD 23:59:59'), + } + } else if (filterDate.value === '2') { + const now = dayjs() + queryParams.params = { + beginReqTime: now.startOf('month').format('YYYY-MM-DD 00:00:00'), + endReqTime: now.endOf('month').format('YYYY-MM-DD 23:59:59'), + } + } else { + delete queryParams.params + } + // 濡傛灉鏄粠鎵爜椤甸潰杩囨潵锛屽彧鑳芥煡璇㈠浐瀹氳澶囩殑鏁版嵁 + if (option?.from === 'scan') { + queryParams.assetNo = option.assetNo + } + getRepairResList(queryParams) .then((res: any) => { paging.value.completeByTotal(res.rows, res.total) }) @@ -308,19 +354,20 @@ function goToFeedBack(item) { uni.navigateTo({ - url: `/pages/repair/feedback?id=${item.id}`, + url: `/pages/repair/repair-fb?id=${item.id}`, }) } - -onNavigationBarButtonTap((e) => { - if (e.index === 0) { - if (isLeader()) { - toast.info('璇风櫥褰曠淮淇伐璐﹀彿鎺ュ崟') - } else if (isOperatorOrRepair()) { - handleSelectReq() - } +const goBack = () => { + uni.navigateBack() +} +function handleClickRight() { + if (isLeader()) { + toast.info('璇风櫥褰曠淮淇伐璐﹀彿鎺ュ崟') + } else if (isOperatorOrRepair()) { + handleSelectReq() } -}) +} + /** * 閫夋嫨鎶ヤ慨鍗� @@ -373,7 +420,8 @@ const sList: any = await getDictInfo(DICT_REPAIR_RES_STATUS) statusList.value.push(...sList) } -onLoad(() => { +onLoad((options) => { + Object.assign(option, options) initData() uni.$on('res-list-refresh', reloadData) }) -- Gitblit v1.9.3