Merge remote-tracking branch 'origin/main'
| | |
| | | "Component": true, |
| | | "ComponentPublicInstance": true, |
| | | "ComputedRef": true, |
| | | "DirectiveBinding": true, |
| | | "EffectScope": true, |
| | | "ExtractDefaultPropTypes": true, |
| | | "ExtractPropTypes": true, |
| | | "ExtractPublicPropTypes": true, |
| | | "InjectionKey": true, |
| | | "MaybeRef": true, |
| | | "MaybeRefOrGetter": true, |
| | | "PropType": true, |
| | | "Ref": true, |
| | | "VNode": true, |
| | |
| | | "onUnload": true, |
| | | "onUnmounted": true, |
| | | "onUpdated": true, |
| | | "onWatcherCleanup": true, |
| | | "provide": true, |
| | | "reactive": true, |
| | | "readonly": true, |
| | |
| | | "useAttrs": true, |
| | | "useCssModule": true, |
| | | "useCssVars": true, |
| | | "useId": true, |
| | | "useModel": true, |
| | | "useRequest": true, |
| | | "useSlots": true, |
| | | "useTemplateRef": true, |
| | | "useUpload": true, |
| | | "useUpload2": true, |
| | | "watch": true, |
| | | "watchEffect": true, |
| | | "watchPostEffect": true, |
| | | "watchSyncEffect": true, |
| | | "DirectiveBinding": true, |
| | | "MaybeRef": true, |
| | | "MaybeRefOrGetter": true, |
| | | "onWatcherCleanup": true, |
| | | "useId": true, |
| | | "useModel": true, |
| | | "useTemplateRef": true |
| | | "watchSyncEffect": true |
| | | } |
| | | } |
| | |
| | | # h5é¨ç½²ç½ç«çbaseï¼é
ç½®å° manifest.config.ts éç h5.router.base |
| | | VITE_APP_PUBLIC_BASE=/ |
| | | |
| | | VITE_SERVER_BASEURL = 'https://ukw0y1.laf.run' |
| | | VITE_UPLOAD_BASEURL = 'https://ukw0y1.laf.run/upload' |
| | | VITE_SERVER_BASEURL = 'http://192.168.12.33:8080' |
| | | VITE_UPLOAD_BASEURL = 'http://192.168.12.33:8080/resource/oss/upload' |
| | | |
| | | # æäºåå¦å¯è½éè¦å¨å¾®ä¿¡å°ç¨åºé颿 ¹æ® developãtrialãrelease åå«è®¾ç½®ä¸ä¼ å°åï¼åè代ç å¦ä¸ã |
| | | # ä¸é¢çåéå¦ææ²¡æè®¾ç½®ï¼ä¼é»è®¤ä½¿ç¨ VITE_SERVER_BASEURL or VITE_UPLOAD_BASEURL |
| | |
| | | # h5æ¯å¦éè¦é
置代ç |
| | | VITE_APP_PROXY=false |
| | | VITE_APP_PROXY_PREFIX = '/api' |
| | | |
| | | |
| | | # åç«¯åæ°é
ç½® |
| | | VITE_APP_CLIENT_ID = '428a8310cd442757ae699df5d894f051' |
| | |
| | | globalStyle: { |
| | | navigationStyle: 'default', |
| | | navigationBarTitleText: 'å
°å®è®¾å¤ç®¡ç', |
| | | navigationBarBackgroundColor: '#f8f8f8', |
| | | navigationBarTextStyle: 'black', |
| | | navigationBarBackgroundColor: '#4D80F0', |
| | | navigationBarTextStyle: 'white', |
| | | backgroundColor: '#FFFFFF', |
| | | }, |
| | | easycom: { |
| | |
| | | tabBar: { |
| | | custom: true, |
| | | color: '#999999', |
| | | selectedColor: '#007aff', |
| | | selectedColor: '#4D80F0', |
| | | borderStyle: 'black', |
| | | height: '50px', |
| | | fontSize: '10px', |
| | |
| | | safeAreaInsetBottom |
| | | placeholder |
| | | @change="selectTabBar" |
| | | active-color="#007aff" |
| | | active-color="#4D80F0" |
| | | inactive-color="#7d7e80" |
| | | > |
| | | <block v-for="(item, idx) in tabbarList" :key="item.path"> |
| | |
| | | readonly VITE_UPLOAD_BASEURL: string |
| | | /** æ¯å¦æ¸
é¤console */ |
| | | readonly VITE_DELETE_CONSOLE: string |
| | | readonly VITE_APP_CLIENT_ID: string |
| | | // æ´å¤ç¯å¢åé... |
| | | } |
| | | |
| | |
| | | /* eslint-disable no-param-reassign */ |
| | | import qs from 'qs' |
| | | import { useUserStore } from '@/store' |
| | | import { useAccessStore } from '@/store' |
| | | import { platform } from '@/utils/platform' |
| | | import { getEnvBaseUrl } from '@/utils' |
| | | const clientId = import.meta.env.VITE_APP_CLIENT_ID |
| | | |
| | | export type CustomRequestOptions = UniApp.RequestOptions & { |
| | | query?: Record<string, any> |
| | |
| | | ...options.header, |
| | | } |
| | | // 3. æ·»å token 请æ±å¤´æ è¯ |
| | | const userStore = useUserStore() |
| | | const { token } = userStore.userInfo as unknown as IUserInfo |
| | | const accessStore = useAccessStore() |
| | | const token = accessStore.accessInfo.access_token |
| | | if (token) { |
| | | options.header.Authorization = `Bearer ${token}` |
| | | options.header.clientid = clientId |
| | | } |
| | | }, |
| | | } |
| | |
| | | * å¯ä»¥è®¾ç½®è·¯ç±ç½ååï¼æè
é»ååï¼çä¸å¡éè¦éåªä¸ä¸ª |
| | | * æè¿éåºä¸ºå¤§é¨åé½å¯ä»¥é便è¿å
¥ï¼æä»¥ä½¿ç¨é»åå |
| | | */ |
| | | import { useUserStore } from '@/store' |
| | | import { useUserStore, useAccessStore } from '@/store' |
| | | import { needLoginPages as _needLoginPages, getNeedLoginPages } from '@/utils' |
| | | |
| | | // TODO Check |
| | | const loginRoute = '/pages/login/index' |
| | | |
| | | const isLogined = () => { |
| | | const userStore = useUserStore() |
| | | return userStore.isLogined |
| | | const accessStore = useAccessStore() |
| | | return accessStore.isLogined |
| | | } |
| | | |
| | | const isDev = import.meta.env.DEV |
| | |
| | | "globalStyle": { |
| | | "navigationStyle": "default", |
| | | "navigationBarTitleText": "å
°å®è®¾å¤ç®¡ç", |
| | | "navigationBarBackgroundColor": "#f8f8f8", |
| | | "navigationBarTextStyle": "black", |
| | | "navigationBarBackgroundColor": "#4D80F0", |
| | | "navigationBarTextStyle": "white", |
| | | "backgroundColor": "#FFFFFF" |
| | | }, |
| | | "easycom": { |
| | |
| | | "tabBar": { |
| | | "custom": true, |
| | | "color": "#999999", |
| | | "selectedColor": "#007aff", |
| | | "selectedColor": "#4D80F0", |
| | | "borderStyle": "black", |
| | | "height": "50px", |
| | | "fontSize": "10px", |
| | |
| | | "type": "home", |
| | | "layout": "tabbar", |
| | | "style": { |
| | | "navigationStyle": "custom", |
| | | "navigationBarTitleText": "é¦é¡µ" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/equ/equ-list", |
| | | "type": "page", |
| | | "layout": "default", |
| | | "needLogin": true, |
| | | "style": { |
| | | "navigationBarTitleText": "设å¤å表" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/equ/index", |
| | | "type": "page", |
| | | "layout": "tabbar", |
| | | "needLogin": true, |
| | | "style": { |
| | | "navigationBarTitleText": "å
³äº" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/inspect/insp-add", |
| | | "type": "page", |
| | | "layout": "default", |
| | | "style": { |
| | | "navigationBarTitleText": "设å¤ç¹æ£" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/inspect/insp-record", |
| | | "type": "page", |
| | | "needLogin": true, |
| | | "style": { |
| | | "navigationBarTitleText": "ç¹æ£è®°å½", |
| | | "navigationStyle": "custom", |
| | | "navigationBarBackgroundColor": "#4D80F0" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/inspect/insp-st", |
| | | "type": "page", |
| | | "layout": "default", |
| | | "needLogin": true, |
| | | "style": { |
| | | "navigationBarTitleText": "ç¹æ£æ±æ»" |
| | | } |
| | | }, |
| | | { |
| | |
| | | "type": "page", |
| | | "layout": "default", |
| | | "style": { |
| | | "navigationStyle": "custom", |
| | | "navigationBarTitleText": "ç»å½" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/maint/maint-order", |
| | | "type": "page", |
| | | "needLogin": true, |
| | | "style": { |
| | | "navigationBarTitleText": "ä¿å
Ȍᴌ", |
| | | "navigationStyle": "custom", |
| | | "navigationBarBackgroundColor": "#4D80F0" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/maint/maint-st", |
| | | "type": "page", |
| | | "layout": "default", |
| | | "needLogin": true, |
| | | "style": { |
| | | "navigationBarTitleText": "ä¿å
»æ±æ»" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/maint/order-detail", |
| | | "type": "page", |
| | | "needLogin": true, |
| | | "style": { |
| | | "navigationBarTitleText": "å·¥åæç»", |
| | | "navigationStyle": "custom", |
| | | "navigationBarBackgroundColor": "#4D80F0" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/my/index", |
| | | "type": "page", |
| | | "layout": "tabbar", |
| | | "needLogin": true, |
| | | "style": { |
| | | "navigationBarTitleText": "æç" |
| | | } |
| | |
| | | "path": "pages/spare/index", |
| | | "type": "page", |
| | | "layout": "tabbar", |
| | | "needLogin": true, |
| | | "style": { |
| | | "navigationBarTitleText": "spare" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <route lang="json5" type="page"> |
| | | { |
| | | layout: 'default', |
| | | needLogin: true, |
| | | style: { |
| | | navigationBarTitleText: '设å¤å表', |
| | | }, |
| | | } |
| | | </route> |
| | | <template> |
| | | <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time> |
| | | <template #top> |
| | | <wd-drop-menu> |
| | | <wd-drop-menu-item v-model="equTypeId" :options="typeList" @change="handleEquType" /> |
| | | <wd-drop-menu-item v-model="status" :options="statusList" @change="handleEquStatu" /> |
| | | </wd-drop-menu> |
| | | </template> |
| | | |
| | | <view class="bg-base"> |
| | | <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id"> |
| | | <template #title> |
| | | <view class="flex justify-between items-baseline"> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <text class="ml-1 text-xs">{{ item.assetNo }}</text> |
| | | </view> |
| | | |
| | | <view> |
| | | <text class="icon-color-base">详æ
</text> |
| | | <wd-icon name="arrow-right" custom-class="icon-color-base"></wd-icon> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <view class="flex h-[80rpx]" @click.stop="itemClick(item)"> |
| | | <image class="slot-img text-center" src="/static/images/camera.png" /> |
| | | <view> |
| | | <view class="text-color-base"> |
| | | {{ item.equName }} |
| | | <text class="text-color-gray ml-2 text-mini">{{ item.modelNo }}</text> |
| | | </view> |
| | | <view class="text-color-gray text-xs mt-1"> |
| | | {{ item.location }} | {{ item.madeIn }} |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </wd-card> |
| | | </view> |
| | | </z-paging> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { onMounted, getCurrentInstance, ref } from 'vue' |
| | | |
| | | import { getEquList } from '@/service/equ' |
| | | |
| | | // 设å¤ç±»å |
| | | const equTypeId = ref<number>(0) |
| | | // 设å¤ç¶æ |
| | | const status = ref<number>(0) |
| | | |
| | | const isSelectEqu = ref(false) |
| | | |
| | | const typeList = ref<Record<string, any>[]>([{ label: 'ææè®¾å¤', value: 0 }]) |
| | | const statusList = ref<Record<string, any>[]>([{ label: 'ææç¶æ', value: 0 }]) |
| | | function handleEquType({ value }) { |
| | | console.log(value) |
| | | } |
| | | function handleEquStatu({ value }) { |
| | | console.log(value) |
| | | } |
| | | |
| | | const paging = ref(null) |
| | | const dataList = ref([]) |
| | | |
| | | const queryList = (pageNum?: number, pageSize?: number) => { |
| | | // è¿éçpageNoåpageSizeä¼èªå¨è®¡ç®å¥½ï¼ç´æ¥ä¼ ç»æå¡å¨å³å¯ |
| | | // è¿éç请æ±åªæ¯æ¼ç¤ºï¼è¯·æ¿æ¢æèªå·±ç项ç®çç½ç»è¯·æ±ï¼å¹¶å¨ç½ç»è¯·æ±åè°ä¸éè¿paging.value.complete(请æ±åæ¥çæ°ç»)å°è¯·æ±ç»æä¼ ç»z-paging |
| | | getEquList({ pageNum, pageSize }) |
| | | .then((res: any) => { |
| | | // 请å¿å¨ç½ç»è¯·æ±åè°ä¸ç»dataListèµå¼ï¼ï¼åªéè¦è°ç¨completeå°±å¯ä»¥äº |
| | | console.log(res) |
| | | paging.value.complete(res.rows) |
| | | }) |
| | | .catch((res) => { |
| | | // å¦æè¯·æ±å¤±è´¥åpaging.value.complete(false)ï¼ä¼èªå¨å±ç¤ºéè¯¯é¡µé¢ |
| | | // 注æï¼æ¯æ¬¡é½éè¦å¨catchä¸åè¿å¥è¯å¾éº»ç¦ï¼z-pagingæä¾äºæ¹æ¡å¯ä»¥å
¨å±ç»ä¸å¤ç |
| | | // å¨åºå±çç½ç»è¯·æ±æåºå¼å¸¸æ¶ï¼åuni.$emit('z-paging-error-emit');å³å¯ |
| | | paging.value.complete(false) |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * è®¾å¤æ¡ç®ç¹å»äºä»¶ |
| | | * @param item |
| | | */ |
| | | function itemClick(item: any) { |
| | | if (isSelectEqu.value) { |
| | | emitSelectEqu(item) |
| | | uni.navigateBack() |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éæ©è®¾å¤åè° |
| | | * @param equ |
| | | */ |
| | | function emitSelectEqu(equ: any) { |
| | | eventChannel.value.emit('selectEqu', { |
| | | data: equ, |
| | | }) |
| | | } |
| | | |
| | | |
| | | const eventChannel = ref<any>() |
| | | onMounted(() => { |
| | | const instance: any = getCurrentInstance().proxy |
| | | const event = instance.getOpenerEventChannel() |
| | | eventChannel.value = event |
| | | event.on('handleSelectEqu', function (data) { |
| | | isSelectEqu.value = true |
| | | console.log('handleSelectEqu', data) |
| | | }) |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .menu-title-box { |
| | | height: 30rpx; |
| | | line-height: 30rpx; |
| | | } |
| | | |
| | | .slot-img { |
| | | width: 72rpx; |
| | | height: 72rpx; |
| | | margin-right: 24rpx; |
| | | } |
| | | .text-mini { |
| | | font-size: 22rpx; |
| | | } |
| | | |
| | | .menu-indicator { |
| | | width: 6rpx; |
| | | height: 22rpx; |
| | | border-radius: 10rpx; |
| | | background-color: $uni-color-primary; |
| | | } |
| | | :deep(.wd-card__footer) { |
| | | padding: 10rpx !important; |
| | | } |
| | | </style> |
| | |
| | | <route lang="json5"> |
| | | { |
| | | layout: 'tabbar', |
| | | needLogin: true, |
| | | style: { |
| | | navigationBarTitleText: 'å
³äº', |
| | | }, |
| | |
| | | { |
| | | layout: 'tabbar', |
| | | style: { |
| | | navigationStyle: 'custom', |
| | | navigationBarTitleText: 'é¦é¡µ', |
| | | }, |
| | | } |
| | | </route> |
| | | <template> |
| | | <view |
| | | class="bg-white overflow-hidden pt-2 px-4" |
| | | :style="{ marginTop: safeAreaInsets?.top + 'px' }" |
| | | class="bg-base overflow-hidden" |
| | | :style="{ |
| | | marginTop: safeAreaInsets?.top + 'px', |
| | | }" |
| | | > |
| | | <view class="mt-12"> |
| | | <image src="/static/logo.svg" alt="" class="w-28 h-28 block mx-auto" /> |
| | | </view> |
| | | <view class="text-center text-4xl main-title-color mt-4">unibest</view> |
| | | <view class="text-center text-2xl mt-2 mb-8">æå¥½ç¨ç uniapp å¼å模æ¿</view> |
| | | <view class="bg-white h-[80rpx] px-2 flex items-center justify-between"> |
| | | <view class="flex items-center" @click="handleUserInfo"> |
| | | <wd-icon name="user" size="40rpx" class="icon-color-base"></wd-icon> |
| | | <text class="ml-1 text-color-base">å¼ ä¸</text> |
| | | </view> |
| | | |
| | | <view class="text-justify max-w-100 m-auto text-4 indent mb-2">{{ description }}</view> |
| | | <view class="text-center mt-8"> |
| | | å½å平尿¯ï¼ |
| | | <text class="text-green-500">{{ PLATFORM.platform }}</text> |
| | | <view class="flex items-center"> |
| | | <wd-icon name="notification" size="40rpx" class="icon-color-base mr-3"></wd-icon> |
| | | <wd-icon name="tips" size="40rpx" class="icon-color-base mr-3"></wd-icon> |
| | | <wd-icon name="app" size="40rpx" class="icon-color-base"></wd-icon> |
| | | </view> |
| | | </view> |
| | | <view class="text-center mt-4"> |
| | | 模æ¿åæ¯æ¯ï¼ |
| | | <text class="text-green-500">tabbar</text> |
| | | |
| | | <view class="bg-white py-2 px-2"> |
| | | <wd-img class="w-full h-[260rpx]" src="/static/images/pic4.jpeg" /> |
| | | </view> |
| | | <view class="bg-noti flex flex-row"> |
| | | <wd-notice-bar |
| | | text="è¿æ¯ä¸æ¡æ¶æ¯æç¤ºä¿¡æ¯ï¼è¿æ¯ä¸æ¡æ¶æ¯æç¤ºä¿¡æ¯ï¼è¿æ¯ä¸æ¡æ¶æ¯æç¤ºä¿¡æ¯" |
| | | prefix="clock" |
| | | type="info" |
| | | :scrollable="false" |
| | | custom-class="flex-1 overflow-hidden" |
| | | /> |
| | | <wd-button type="text" class="w-[120rpx]">æ¥ç</wd-button> |
| | | </view> |
| | | |
| | | <view class="bg-white"> |
| | | <wd-card type="rectangle"> |
| | | <template #title> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <view class="ml-1 text-xs">æ°æ®æ»è§</view> |
| | | </view> |
| | | </template> |
| | | <view class="flex flex-row justify-around"> |
| | | <view class="flex flex-col justify-center"> |
| | | <text class="text-lg text-center">0</text> |
| | | <text class="text-color-gray">è®¾å¤æ»æ°</text> |
| | | </view> |
| | | <view class="flex flex-col justify-center"> |
| | | <text class="text-lg text-center">0</text> |
| | | <text class="text-color-gray">æ
éè®¾å¤æ°</text> |
| | | </view> |
| | | <view class="flex flex-col justify-center"> |
| | | <text class="text-lg text-center">0</text> |
| | | <text class="text-color-gray">æªä¿®å¤æ
é</text> |
| | | </view> |
| | | </view> |
| | | </wd-card> |
| | | </view> |
| | | |
| | | <view class="bg-white mt-2"> |
| | | <wd-card type="rectangle"> |
| | | <template #title> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <view class="ml-1 text-xs">设å¤ç®¡ç</view> |
| | | </view> |
| | | </template> |
| | | <wd-grid :column="4"> |
| | | <wd-grid-item |
| | | use-slot |
| | | class="flex justify-center items-center" |
| | | v-for="(item, index) in equMenu" |
| | | @click.stop="goItemPage(item.path)" |
| | | > |
| | | <image class="slot-img text-center" :src="item.icon" /> |
| | | <text>{{ item.name }}</text> |
| | | </wd-grid-item> |
| | | </wd-grid> |
| | | </wd-card> |
| | | </view> |
| | | |
| | | <view class="bg-white mt-2"> |
| | | <wd-card type="rectangle"> |
| | | <template #title> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <view class="ml-1 text-xs">设å¤ç¹æ£</view> |
| | | </view> |
| | | </template> |
| | | <wd-grid :column="4"> |
| | | <wd-grid-item |
| | | use-slot |
| | | class="flex justify-center items-center" |
| | | v-for="(item, index) in inspectMenu" |
| | | :key="item.id" |
| | | @click.stop="goItemPage(item.path)" |
| | | > |
| | | <image class="slot-img text-center" :src="item.icon" /> |
| | | <text>{{ item.name }}</text> |
| | | </wd-grid-item> |
| | | </wd-grid> |
| | | </wd-card> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | import { TestEnum } from '@/typings' |
| | | import PLATFORM from '@/utils/platform' |
| | | import { getAllMenusApi } from '@/service/menu' |
| | | |
| | | defineOptions({ |
| | | name: 'Home', |
| | |
| | | |
| | | // è·åå±å¹è¾¹çå°å®å
¨åºåè·ç¦» |
| | | const { safeAreaInsets } = uni.getSystemInfoSync() |
| | | const author = ref('è²é¸½') |
| | | const description = ref( |
| | | 'unibest æ¯ä¸ä¸ªéæäºå¤ç§å·¥å
·åææ¯ç uniapp å¼å模æ¿ï¼ç± uniapp + Vue3 + Ts + Vite4 + UnoCss + UniUI + VSCode æå»ºï¼æ¨¡æ¿å
·æä»£ç æç¤ºãèªå¨æ ¼å¼åãç»ä¸é
ç½®ã代ç çæ®µçåè½ï¼å¹¶å
ç½®äºè®¸å¤å¸¸ç¨çåºæ¬ç»ä»¶ååºæ¬åè½ï¼è®©ä½ ç¼å uniapp æ¥æ best ä½éªã', |
| | | ) |
| | | // æµè¯ uni API èªå¨å¼å
¥ |
| | | |
| | | const getAllMenus = async () => { |
| | | const menuList = await getAllMenusApi() |
| | | console.error(menuList) |
| | | } |
| | | |
| | | const goItemPage = (path: string) => { |
| | | const url = `/${path}` |
| | | uni.navigateTo({ |
| | | url, |
| | | }) |
| | | } |
| | | |
| | | onLoad(() => { |
| | | console.log(author) |
| | | console.log(TestEnum.A) |
| | | // getAllMenus() |
| | | }) |
| | | |
| | | const equMenu = reactive([ |
| | | { |
| | | id: 1, |
| | | name: '设å¤ç®¡ç', |
| | | icon: '/static/menu/menu1.png', |
| | | path: 'pages/equ/equ-list', |
| | | } |
| | | ]) |
| | | |
| | | const inspectMenu = reactive([ |
| | | /* { |
| | | id: 0, |
| | | name: '设å¤ç¹æ£', |
| | | icon: '/static/menu/menu0.png', |
| | | path: 'pages/inspect/insp-add', |
| | | }, */ |
| | | { |
| | | id: 1, |
| | | name: 'ç¹æ£æ±æ»', |
| | | icon: '/static/menu/menu2.png', |
| | | path: 'pages/inspect/insp-st', |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: 'ä¿å
»æ±æ»', |
| | | icon: '/static/menu/menu1.png', |
| | | path: 'pages/maint/maint-st', |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: 'ç¹æ£è®°å½', |
| | | icon: '/static/menu/menu3.png', |
| | | path: 'pages/inspect/insp-record', |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: 'ç¹æ£è®¡å', |
| | | icon: '/static/menu/menu4.png', |
| | | path: 'pages/inspect/insp-add', |
| | | }, |
| | | ]) |
| | | |
| | | function handleUserInfo() { |
| | | getAllMenus() |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .main-title-color { |
| | | color: $uni-color-primary; |
| | | } |
| | | |
| | | .bg-noti { |
| | | background: #f4f9ff; |
| | | } |
| | | |
| | | :deep(.wd-card) { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | :deep(.wd-card__footer) { |
| | | padding: 0 !important; |
| | | } |
| | | |
| | | :deep(.wd-card__footer)::after { |
| | | height: 0 !important; |
| | | } |
| | | |
| | | .menu-title-box { |
| | | height: 30rpx; |
| | | } |
| | | |
| | | .menu-indicator { |
| | | width: 6rpx; |
| | | height: 24rpx; |
| | | border-radius: 10rpx; |
| | | background-color: $uni-color-primary; |
| | | } |
| | | |
| | | .slot-img { |
| | | width: 72rpx; |
| | | height: 72rpx; |
| | | margin-left: 4rpx; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <route lang="json5" type="page"> |
| | | { |
| | | layout: 'default', |
| | | style: { |
| | | navigationBarTitleText: '设å¤ç¹æ£', |
| | | }, |
| | | } |
| | | </route> |
| | | |
| | | <template> |
| | | <view class="bg-base"> |
| | | <wd-form ref="form" :model="model" :rules="rules"> |
| | | <wd-cell-group custom-class="group" title="设å¤ä¿¡æ¯" border> |
| | | <wd-input |
| | | @click.stop="handleSelectEqu" |
| | | label="设å¤åç§°" |
| | | label-width="200rpx" |
| | | prop="equId" |
| | | readonly |
| | | required |
| | | suffix-icon="arrow-right" |
| | | clearable |
| | | v-model="model.equId" |
| | | placeholder="è¯·éæ©è®¾å¤" |
| | | @clicksuffixicon="handleSelectEqu" |
| | | /> |
| | | <!-- <wd-picker |
| | | label="设å¤åç§°" |
| | | placeholder="请é设å¤" |
| | | label-width="200rpx" |
| | | prop="equId" |
| | | v-model="model.equId" |
| | | :columns="equList" |
| | | />--> |
| | | </wd-cell-group> |
| | | |
| | | <wd-cell-group custom-class="mt-2" title="ç¹æ£ä¿¡æ¯" border> |
| | | <wd-picker |
| | | label="ç¹æ£é¡¹" |
| | | placeholder="请éç¹æ£é¡¹" |
| | | label-width="200rpx" |
| | | prop="equId" |
| | | v-model="model.inspName" |
| | | :columns="equList" |
| | | /> |
| | | |
| | | <wd-input |
| | | label="ç¹æ£ç¼å·" |
| | | placeholder="请çæç¹æ£ç¼å·" |
| | | label-width="200rpx" |
| | | v-model="model.inspCode" |
| | | prop="inspCode" |
| | | > |
| | | <template #suffix> |
| | | <wd-button size="small" @click.stop="handleInspCode">çæ</wd-button> |
| | | </template> |
| | | </wd-input> |
| | | |
| | | <wd-textarea |
| | | label="ç¹æ£æè¿°" |
| | | label-width="200rpx" |
| | | type="textarea" |
| | | v-model="model.inspDesc" |
| | | auto-height |
| | | :maxlength="200" |
| | | show-word-limit |
| | | placeholder="请è¾å
¥ç¹æ£æè¿°" |
| | | clearable |
| | | prop="inspDesc" |
| | | /> |
| | | <wd-cell title="ç¹æ£å¾ç" title-width="200rpx" prop="fileList"> |
| | | <wd-upload |
| | | :auto-upload="false" |
| | | :file-list="model.fileList" |
| | | :action="VITE_UPLOAD_BASEURL" |
| | | @change="handleFileChange" |
| | | ></wd-upload> |
| | | </wd-cell> |
| | | |
| | | <wd-calendar |
| | | label="è®¡åæ¥æ" |
| | | label-width="200rpx" |
| | | placeholder="è¯·éæ©æ¥æ" |
| | | prop="planTime" |
| | | v-model="model.planTime" |
| | | /> |
| | | <wd-datetime-picker |
| | | label="ç¹æ£æ¶é´" |
| | | label-width="200rpx" |
| | | placeholder="è¯·éæ©æ¶é´" |
| | | prop="inspTime" |
| | | v-model="model.inspTime" |
| | | /> |
| | | </wd-cell-group> |
| | | |
| | | <view class="footer"> |
| | | <wd-button type="primary" size="large" @click="handleSubmit" block>æäº¤</wd-button> |
| | | </view> |
| | | </wd-form> |
| | | </view> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import { reactive, ref } from 'vue' |
| | | import { FormRules } from 'wot-design-uni/components/wd-form/types' |
| | | import { getEnvBaseUploadUrl } from '@/utils' |
| | | |
| | | const VITE_UPLOAD_BASEURL = `${getEnvBaseUploadUrl()}` |
| | | |
| | | const form = ref() |
| | | const model = reactive<{ |
| | | equId: string |
| | | inspName: string |
| | | inspCode: string |
| | | inspDesc: string |
| | | planTime: null | number |
| | | inspTime: number | string |
| | | fileList: [] |
| | | }>({ |
| | | equId: '', |
| | | inspName: '', |
| | | inspCode: '', |
| | | inspDesc: '', |
| | | planTime: null, |
| | | inspTime: '', |
| | | fileList: [], |
| | | }) |
| | | const rules: FormRules = { |
| | | equId: [ |
| | | { |
| | | required: true, |
| | | message: 'è¯·éæ©è®¾å¤', |
| | | }, |
| | | ], |
| | | inspName: [ |
| | | { |
| | | required: true, |
| | | message: 'è¯·éæ©ç¹æ£é¡¹', |
| | | }, |
| | | ], |
| | | inspCode: [ |
| | | { |
| | | required: true, |
| | | message: '请è¾å
¥ç¹æ£ç¼ç ', |
| | | }, |
| | | ], |
| | | inspDesc: [ |
| | | { |
| | | required: true, |
| | | message: '请è¾å
¥ç¹æ£æè¿°', |
| | | }, |
| | | ], |
| | | fileList: [ |
| | | { |
| | | required: false, |
| | | message: '', |
| | | }, |
| | | ], |
| | | } |
| | | |
| | | const equList = ref<any[]>([ |
| | | { |
| | | value: '1', |
| | | label: '1#å¹²ç¥æº', |
| | | }, |
| | | { |
| | | value: '2', |
| | | label: '1#å¹²ç¥æº', |
| | | }, |
| | | ]) |
| | | |
| | | /** |
| | | * éæ©è®¾å¤ |
| | | */ |
| | | function handleSelectEqu() { |
| | | uni.navigateTo({ |
| | | url: '/pages/equ/equ-list', |
| | | events: { |
| | | // 为æå®äºä»¶æ·»å ä¸ä¸ªçå¬å¨ï¼è·å被æå¼é¡µé¢ä¼ éå°å½å页é¢çæ°æ® |
| | | selectEqu: function (data) { |
| | | console.log(data) |
| | | }, |
| | | }, |
| | | success: function (res) { |
| | | // éè¿eventChannelå被æå¼é¡µé¢ä¼ éæ°æ® |
| | | res.eventChannel.emit('handleSelectEqu', { data: 'ç¹æ£é¡µé¢éæ©è®¾å¤' }) |
| | | }, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * çæç¹æ£ç¼å· |
| | | */ |
| | | function handleInspCode() { |
| | | console.error('çæç¹æ£ç¼ç ') |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ ç¹æ£å¾ç |
| | | * @param fileList |
| | | */ |
| | | function handleFileChange({ fileList }) { |
| | | model.fileList = fileList |
| | | } |
| | | |
| | | function handleSubmit() { |
| | | form.value |
| | | .validate() |
| | | .then(({ valid, errors }) => { |
| | | console.log(valid) |
| | | console.log(errors) |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error, 'error') |
| | | }) |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .footer { |
| | | background: white; |
| | | padding: 60rpx 42rpx; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <route lang="json5"> |
| | | { |
| | | needLogin: true, |
| | | style: { |
| | | navigationBarTitleText: 'ç¹æ£è®°å½', |
| | | navigationStyle: 'custom', |
| | | navigationBarBackgroundColor: '#4D80F0', |
| | | }, |
| | | } |
| | | </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 |
| | | ></wd-navbar> |
| | | |
| | | <wd-card type="rectangle"> |
| | | <template #title> |
| | | <view class="flex justify-between"> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <view class="ml-1 text-sm align-center">{{ inspSt.equName }}</view> |
| | | <view class="text-color-gray ml-2 text-mini">{{ inspSt.assetNo }}</view> |
| | | </view> |
| | | |
| | | <view class="flex items-center"> |
| | | <text class="text-color-gray text-mini">{{ inspSt.planTimeStr }}</text> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <view class="flex h-[100rpx]" 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">ç¹æ£æ»æ°: {{ dataCount }}</text> |
| | | | |
| | | <text class="mx-3">å·²ç¹æ£: {{ checkCount }}</text> |
| | | | |
| | | <text class="ml-3">æªç¹æ£: {{ dataCount - checkCount }}</text> |
| | | </view> |
| | | <view class="text-color-gray text-xs mt-2 flex"> |
| | | <text class="mr-3">æ£å¸¸: {{ normalNum }}</text> |
| | | | |
| | | <text class="mx-3">å¼å¸¸: {{ abNormalNum }}</text> |
| | | </view> |
| | | <view class="text-color-gray text-xs mt-2 flex"> |
| | | <text>ç¶æï¼</text> |
| | | <template v-if="dataCount > 0 && dataCount === checkCount"> |
| | | <wd-icon class="icon-color-success" name="check-outline" size="34rpx"></wd-icon> |
| | | <text class="ml-1">已宿</text> |
| | | </template> |
| | | <template v-else> |
| | | <wd-icon class="icon-color-base" name="detection" size="40rpx"></wd-icon> |
| | | <text class="ml-1">è¿è¡ä¸</text> |
| | | </template> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </wd-card> |
| | | </template> |
| | | |
| | | <view class="bg-base"> |
| | | <view class="w-full h-[24rpx]"></view> |
| | | <wd-cell> |
| | | <template #title> |
| | | <text class="text-color-gray">ç¹æ£é¡¹</text> |
| | | </template> |
| | | <wd-button size="small" type="text" @click.stop="toggleCollapse"> |
| | | {{ isAllExpanded ? 'å
¨é¨æå ' : 'å
¨é¨å±å¼' }} |
| | | </wd-button> |
| | | </wd-cell> |
| | | <wd-collapse v-model="collSelects" title="ç¹æ£é¡¹" ref="collapseRef"> |
| | | <wd-collapse-item :name="item.id" v-for="(item, index) in dataList"> |
| | | <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> |
| | | |
| | | <view class="flex items-center"> |
| | | <wd-radio-group |
| | | v-model="item.inspResult" |
| | | inline |
| | | shape="dot" |
| | | @change="inspResultClick(item)" |
| | | > |
| | | <wd-radio value="1">æ£å¸¸</wd-radio> |
| | | <wd-radio value="2">å¼å¸¸</wd-radio> |
| | | </wd-radio-group> |
| | | <wd-icon |
| | | v-if="expanded" |
| | | name="arrow-up" |
| | | size="30rpx" |
| | | class="icon-color-gray" |
| | | ></wd-icon> |
| | | <wd-icon v-else name="arrow-down" size="30rpx" class="icon-color-gray"></wd-icon> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <view class="text-color-gray text-xs flex justify-between"> |
| | | <text class="mr-3">ç¹æ£äºº: {{ item.inspUserName }}</text> |
| | | <text class="mx-3">ç¹æ£æ¶é´: {{ item.inspTime }}</text> |
| | | </view> |
| | | </wd-collapse-item> |
| | | </wd-collapse> |
| | | <view class="w-full h-[1rpx] bg-base"></view> |
| | | <wd-textarea |
| | | label="ç¹è®°äºé¡¹" |
| | | label-width="200rpx" |
| | | type="textarea" |
| | | v-model="inspSt.specialNote" |
| | | auto-height |
| | | :maxlength="200" |
| | | show-word-limit |
| | | placeholder="请è¾å
¥ç¹è®°äºé¡¹" |
| | | clearable |
| | | /> |
| | | </view> |
| | | </z-paging> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref } from 'vue' |
| | | import { useUserStore, useAccessStore, useSystemConfigStore } from '@/store' |
| | | import { getInspStRecordList, 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() |
| | | const toast = useToast() |
| | | |
| | | const collapseRef = ref<CollapseInstance>() |
| | | const isAllExpanded = ref(false) |
| | | |
| | | // å®ä¹æ¥å£ |
| | | interface QueryParams { |
| | | pageNum: number |
| | | pageSize: number |
| | | inspCode: string |
| | | status?: string |
| | | } |
| | | |
| | | interface InspSt { |
| | | id: string |
| | | inspCode: string |
| | | equName: string |
| | | assetNo: string |
| | | planTimeStr?: string |
| | | status: string |
| | | inspUser: number | string |
| | | specialNote: string |
| | | } |
| | | |
| | | const dataChange = ref(false) |
| | | |
| | | const userStore = useUserStore() |
| | | |
| | | const collSelects = ref<string[]>([]) |
| | | |
| | | // ç¹æ£æ±æ»æ°æ®(ä¸ä¸ªé¡µé¢ä¼ å¼) |
| | | const inspSt = reactive<InspSt>({ |
| | | id: '', |
| | | inspCode: '', |
| | | equName: '', |
| | | assetNo: '', |
| | | planTimeStr: '', |
| | | status: '', |
| | | inspUser: '', |
| | | specialNote: '', |
| | | }) |
| | | |
| | | const paging = ref(null) |
| | | const dataList = ref([]) |
| | | |
| | | const queryList = (pageNum?: number, pageSize?: number) => { |
| | | // è¿éçpageNoåpageSizeä¼èªå¨è®¡ç®å¥½ï¼ç´æ¥ä¼ ç»æå¡å¨å³å¯ |
| | | // è¿éç请æ±åªæ¯æ¼ç¤ºï¼è¯·æ¿æ¢æèªå·±ç项ç®çç½ç»è¯·æ±ï¼å¹¶å¨ç½ç»è¯·æ±åè°ä¸éè¿paging.value.complete(请æ±åæ¥çæ°ç»)å°è¯·æ±ç»æä¼ ç»z-paging |
| | | const params: QueryParams = { |
| | | pageNum, |
| | | pageSize, |
| | | inspCode: inspSt.inspCode, |
| | | } |
| | | |
| | | getInspStRecordList(params) |
| | | .then((res: any) => { |
| | | // 请å¿å¨ç½ç»è¯·æ±åè°ä¸ç»dataListèµå¼ï¼ï¼åªéè¦è°ç¨completeå°±å¯ä»¥äº |
| | | paging.value.complete(res.rows) |
| | | }) |
| | | .catch((res) => { |
| | | // å¦æè¯·æ±å¤±è´¥åpaging.value.complete(false)ï¼ä¼èªå¨å±ç¤ºéè¯¯é¡µé¢ |
| | | // 注æï¼æ¯æ¬¡é½éè¦å¨catchä¸åè¿å¥è¯å¾éº»ç¦ï¼z-pagingæä¾äºæ¹æ¡å¯ä»¥å
¨å±ç»ä¸å¤ç |
| | | // å¨åºå±çç½ç»è¯·æ±æåºå¼å¸¸æ¶ï¼åuni.$emit('z-paging-error-emit');å³å¯ |
| | | paging.value.complete(false) |
| | | }) |
| | | } |
| | | |
| | | function inspResultClick(item: any) { |
| | | // userStore?.userInfo?.userId |
| | | } |
| | | |
| | | const goBack = () => { |
| | | uni.navigateBack() |
| | | } |
| | | function handleClickRight() { |
| | | handleConfirm() |
| | | } |
| | | |
| | | const toggleCollapse = () => { |
| | | isAllExpanded.value = !isAllExpanded.value |
| | | collapseRef.value.toggleAll(isAllExpanded.value) |
| | | } |
| | | |
| | | function handleConfirm() { |
| | | if (!dataChange.value) { |
| | | message.alert('请æä½åæäº¤!') |
| | | return false |
| | | } |
| | | message |
| | | .confirm({ |
| | | msg: 'ç¡®å®æäº¤ï¼', |
| | | title: 'æç¤º', |
| | | beforeConfirm: ({ resolve }) => { |
| | | updateData(resolve) |
| | | }, |
| | | }) |
| | | .then(() => {}) |
| | | .catch((error) => { |
| | | console.log(error) |
| | | }) |
| | | } |
| | | |
| | | function updateData(resolve: any) { |
| | | const params = { |
| | | inspRecordList: dataList.value, |
| | | } |
| | | // æ´æ°ç¹æ£è®°å½ |
| | | updateInspRecordBatch(params) |
| | | .then((res: any) => { |
| | | updateInspSt(resolve) |
| | | }) |
| | | .catch((res) => { |
| | | console.error(res) |
| | | }) |
| | | } |
| | | function updateInspSt(resolve: any) { |
| | | // æ´æ°ç¹æ£æ±æ» |
| | | inspSt.status = '1' |
| | | updateInspectSt(inspSt) |
| | | .then((res: any) => { |
| | | paging.value.reload() |
| | | uni.$emit('insp-st-refresh') |
| | | resolve(true) |
| | | }) |
| | | .catch((res) => { |
| | | console.error(res) |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * ç¹æ£è®°å½æ¡ç®ç¹å»äºä»¶ |
| | | * @param item |
| | | */ |
| | | function itemClick(item: any) {} |
| | | |
| | | watch( |
| | | () => [...dataList.value], // ä½¿ç¨æ©å±è¿ç®ç¬¦åå»ºæ°æ°ç»ä»¥è§¦åçå¬ |
| | | (newVal, oldVal) => { |
| | | if (oldVal.length > 0) { |
| | | dataChange.value = true |
| | | } |
| | | }, |
| | | { 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 |
| | | }) |
| | | |
| | | 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) |
| | | const abNormalNum = computed(() => dataList.value.filter((item) => item.inspResult === '2').length) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .menu-title-box { |
| | | height: 30rpx; |
| | | line-height: 30rpx; |
| | | } |
| | | |
| | | .slot-img { |
| | | width: 72rpx; |
| | | height: 72rpx; |
| | | margin-right: 24rpx; |
| | | } |
| | | .text-mini { |
| | | font-size: 22rpx; |
| | | } |
| | | |
| | | .menu-indicator { |
| | | width: 6rpx; |
| | | height: 22rpx; |
| | | border-radius: 10rpx; |
| | | background-color: $uni-color-primary; |
| | | } |
| | | :deep(.wd-card__footer) { |
| | | padding: 10rpx !important; |
| | | } |
| | | |
| | | .col-title-box { |
| | | } |
| | | .bg-primary { |
| | | background: $uni-color-primary; |
| | | } |
| | | :deep(.wd-navbar__text) { |
| | | font-size: 26rpx; |
| | | color: white; |
| | | } |
| | | :deep(.wd-icon-arrow-left:before), |
| | | :deep(.wd-navbar__title) { |
| | | color: white; |
| | | font-weight: 0; |
| | | font-size: 32rpx; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <route lang="json5" type="page"> |
| | | { |
| | | layout: 'default', |
| | | needLogin: true, |
| | | style: { |
| | | navigationBarTitleText: 'ç¹æ£æ±æ»', |
| | | }, |
| | | } |
| | | </route> |
| | | |
| | | <template> |
| | | <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time> |
| | | <template #top> |
| | | <wd-drop-menu> |
| | | <wd-drop-menu-item v-model="viewMode" :options="viewModeList" @change="handleViewMode" /> |
| | | <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"> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <view class="ml-1 text-sm align-center">{{ item.equName }}</view> |
| | | <view class="text-color-gray ml-2 text-mini">{{ item.assetNo }}</view> |
| | | </view> |
| | | |
| | | <view class="flex items-center"> |
| | | <text class="text-color-gray text-mini"> |
| | | {{ |
| | | viewMode === 'Day' ? item.planTimeStr : item?.planTimeStr?.substring(0, 7) || '' |
| | | }} |
| | | </text> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <view class="flex h-[100rpx]" 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> |
| | | | |
| | | <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"> |
| | | <text class="mr-3">æ£å¸¸: {{ item.normalNum }}</text> |
| | | | |
| | | <text class="mx-3">å¼å¸¸: {{ item.abNormalNum }}</text> |
| | | </view> |
| | | <view class="text-color-gray text-xs 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> |
| | | <text class="ml-1">已宿</text> |
| | | </template> |
| | | <template v-else> |
| | | <wd-icon class="icon-color-base" name="detection" size="40rpx"></wd-icon> |
| | | <text class="ml-1">è¿è¡ä¸</text> |
| | | </template> |
| | | </view> |
| | | </view> |
| | | <wd-button size="small" icon="edit-outline" @click.stop="itemClick(item)">æç»</wd-button> |
| | | </view> |
| | | </wd-card> |
| | | </view> |
| | | </z-paging> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref } from 'vue' |
| | | import { getInspStList } from '@/service/inspect' |
| | | import { onShow } from '@dcloudio/uni-app' |
| | | |
| | | const viewMode = ref<string>('Day') |
| | | const equName = ref<string>('ææè®¾å¤') |
| | | |
| | | const viewModeList = ref<Record<string, any>[]>([ |
| | | { label: 'æ¥è§å¾', value: 'Day' }, |
| | | { label: 'æè§å¾', value: 'Month' }, |
| | | ]) |
| | | const equList = ref<Record<string, any>[]>([{ label: 'ææè®¾å¤', value: 'ææè®¾å¤' }]) |
| | | function handleViewMode({ value }) { |
| | | reloadData() |
| | | } |
| | | function handleEquName({ value }) { |
| | | console.log(value) |
| | | } |
| | | |
| | | const paging = ref(null) |
| | | const dataList = ref([]) |
| | | |
| | | const queryList = (pageNum?: number, pageSize?: number) => { |
| | | // è¿éçpageNoåpageSizeä¼èªå¨è®¡ç®å¥½ï¼ç´æ¥ä¼ ç»æå¡å¨å³å¯ |
| | | // è¿éç请æ±åªæ¯æ¼ç¤ºï¼è¯·æ¿æ¢æèªå·±ç项ç®çç½ç»è¯·æ±ï¼å¹¶å¨ç½ç»è¯·æ±åè°ä¸éè¿paging.value.complete(请æ±åæ¥çæ°ç»)å°è¯·æ±ç»æä¼ ç»z-paging |
| | | getInspStList({ pageNum, pageSize, viewMode: viewMode.value }) |
| | | .then((res: any) => { |
| | | // 请å¿å¨ç½ç»è¯·æ±åè°ä¸ç»dataListèµå¼ï¼ï¼åªéè¦è°ç¨completeå°±å¯ä»¥äº |
| | | paging.value.complete(res.rows) |
| | | }) |
| | | .catch((res) => { |
| | | // å¦æè¯·æ±å¤±è´¥åpaging.value.complete(false)ï¼ä¼èªå¨å±ç¤ºéè¯¯é¡µé¢ |
| | | // 注æï¼æ¯æ¬¡é½éè¦å¨catchä¸åè¿å¥è¯å¾éº»ç¦ï¼z-pagingæä¾äºæ¹æ¡å¯ä»¥å
¨å±ç»ä¸å¤ç |
| | | // å¨åºå±çç½ç»è¯·æ±æåºå¼å¸¸æ¶ï¼åuni.$emit('z-paging-error-emit');å³å¯ |
| | | paging.value.complete(false) |
| | | }) |
| | | } |
| | | |
| | | function itemClick(item) { |
| | | const inspCode = `${item.equId}_${item.planTime}_${viewMode.value}` |
| | | uni.navigateTo({ |
| | | url: `/pages/inspect/insp-record?id=${item.id}&inspCode=${inspCode}&specialNote=${item.specialNote ?? ''}&equName=${item.equName ?? ''}&assetNo=${item.assetNo ?? ''}&planTimeStr=${item.planTimeStr ?? ''}`, |
| | | }) |
| | | } |
| | | |
| | | function reloadData() { |
| | | paging.value.reload() |
| | | } |
| | | onLoad(() => { |
| | | uni.$on('insp-st-refresh', reloadData) |
| | | }) |
| | | onUnload(() => { |
| | | uni.$off('insp-st-refres', reloadData) |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .menu-title-box { |
| | | } |
| | | |
| | | .slot-img { |
| | | width: 72rpx; |
| | | height: 72rpx; |
| | | margin-right: 24rpx; |
| | | } |
| | | .statu-img { |
| | | width: 60rpx; |
| | | height: 40rpx; |
| | | } |
| | | .text-mini { |
| | | font-size: 22rpx; |
| | | } |
| | | |
| | | .menu-indicator { |
| | | width: 6rpx; |
| | | height: 26rpx; |
| | | border-radius: 10rpx; |
| | | background-color: $uni-color-primary; |
| | | } |
| | | :deep(.wd-card__footer) { |
| | | padding: 10rpx !important; |
| | | } |
| | | :deep(.wd-card__title-content) { |
| | | padding: 24rpx 0 !important; |
| | | } |
| | | </style> |
| | |
| | | { |
| | | layout: 'default', |
| | | style: { |
| | | navigationStyle: 'custom', |
| | | navigationBarTitleText: 'ç»å½', |
| | | }, |
| | | } |
| | | </route> |
| | | <script setup lang="ts"> |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <wd-img class="w-full h-[260rpx]" src="/static/images/pic2.jpg" /> |
| | | <wd-form ref="form" :model="model" class="mt-2"> |
| | | <wd-cell-group border> |
| | | <wd-input |
| | | label="ç¨æ·å" |
| | | label-width="200rpx" |
| | | prop="username" |
| | | clearable |
| | | v-model="model.username" |
| | | placeholder="请è¾å
¥ç¨æ·å" |
| | | :rules="[{ required: true, message: '请填åç¨æ·å' }]" |
| | | /> |
| | | <wd-input |
| | | label="å¯ç " |
| | | label-width="200rpx" |
| | | prop="password" |
| | | show-password |
| | | clearable |
| | | v-model="model.password" |
| | | placeholder="请è¾å
¥å¯ç " |
| | | :rules="[{ required: true, message: '请填åå¯ç ' }]" |
| | | /> |
| | | </wd-cell-group> |
| | | <view class="footer"> |
| | | <view> |
| | | <wd-checkbox v-model="rember" @change="handleChange"> |
| | | <text class="rember-text">è®°ä½å¯ç </text> |
| | | </wd-checkbox> |
| | | </view> |
| | | <wd-button class="mt-6" type="primary" size="large" @click="handleSubmit" block> |
| | | æäº¤ |
| | | </wd-button> |
| | | |
| | | <view class="copyright-info"> |
| | | <text> |
| | | 䏿µ·å
°å®ä¼ æç§æè¡ä»½æéå
¬å¸ |
| | | </text> |
| | | |
| | | </view> |
| | | </view> |
| | | </wd-form> |
| | | </template> |
| | | |
| | | <style scoped lang="scss"> |
| | | <script setup lang="ts"> |
| | | import { currRoute } from '@/utils' |
| | | import { useUserStore, useAccessStore, useSystemConfigStore } from '@/store' |
| | | import { useToast } from 'wot-design-uni' |
| | | import { login, getUserInfo } from '@/service/login' |
| | | import type { UserInfo } from '@/service/login.d' |
| | | import { TestEnum } from '@/typings' |
| | | const userStore = useUserStore() |
| | | const accessStore = useAccessStore() |
| | | const configStore = useSystemConfigStore() |
| | | const { success: showSuccess } = useToast() |
| | | |
| | | const model = reactive<{ |
| | | username: string |
| | | password: string |
| | | }>({ |
| | | username: '', |
| | | password: '', |
| | | }) |
| | | const rember = ref<boolean>(false) |
| | | |
| | | function handleChange({ value }) { |
| | | console.log(value) |
| | | } |
| | | |
| | | const form = ref() |
| | | function handleSubmit() { |
| | | form.value |
| | | .validate() |
| | | .then(({ valid, errors }) => { |
| | | if (valid) { |
| | | toLogin() |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error, 'error') |
| | | }) |
| | | } |
| | | |
| | | onLoad(() => { |
| | | const { remberPassword, username, password } = configStore.systemConfigInfo |
| | | if (remberPassword) { |
| | | rember.value = true |
| | | model.username = username |
| | | model.password = password |
| | | } |
| | | }) |
| | | |
| | | const toLogin = async () => { |
| | | // è®°ä½å¯ç |
| | | if (rember.value) { |
| | | configStore.setConfigInfo({ ...model, ...{ remberPassword: true } }) |
| | | } |
| | | |
| | | const res = await login(model) |
| | | accessStore.setAccessInfo(res as any) |
| | | const backUserInfo: any = await getUserInfo() |
| | | /** |
| | | * ç»å½è¶
æ¶çæ
åµ |
| | | */ |
| | | if (!backUserInfo) { |
| | | throw new Error('è·åç¨æ·ä¿¡æ¯å¤±è´¥.') |
| | | } |
| | | const { permissions = [], roles = [], user } = backUserInfo |
| | | /** |
| | | * ä»åå°user -> vben userè½¬æ¢ |
| | | */ |
| | | const userInfo: UserInfo = { |
| | | avatar: user.avatar ?? '', |
| | | permissions, |
| | | realName: user.nickName, |
| | | roles, |
| | | userId: user.userId, |
| | | deptId: user.deptId, |
| | | username: user.userName, |
| | | } |
| | | userStore.setUserInfo(userInfo) |
| | | const { query } = currRoute() |
| | | uni.switchTab({ url: query.redirect }) |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .footer { |
| | | padding: 24rpx; |
| | | } |
| | | .rember-text { |
| | | font-size: 24rpx; |
| | | color: $uni-text-color-grey; |
| | | } |
| | | |
| | | .copyright-info { |
| | | position: absolute; |
| | | bottom: 20rpx; |
| | | width: 100%; |
| | | display: flex; |
| | | justify-content: center; |
| | | color: $uni-text-color-disable; |
| | | font-size: 24rpx; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <route lang="json5" type="page"> |
| | | { |
| | | needLogin: true, |
| | | style: { |
| | | navigationBarTitleText: 'ä¿å
Ȍᴌ', |
| | | navigationStyle: 'custom', |
| | | navigationBarBackgroundColor: '#4D80F0', |
| | | }, |
| | | } |
| | | </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 |
| | | ></wd-navbar> |
| | | <wd-cell> |
| | | <template #title> |
| | | <text class="text-color-gray">设å¤</text> |
| | | </template> |
| | | </wd-cell> |
| | | <view class="h-[2px] w-full bg-base"></view> |
| | | <wd-card type="rectangle"> |
| | | <template #title> |
| | | <view class="flex justify-between"> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <view class="ml-1 text-sm align-center">{{ maintSt.equName }}</view> |
| | | <view class="text-color-gray ml-2 text-mini">{{ maintSt.assetNo }}</view> |
| | | </view> |
| | | |
| | | <view class="flex items-center"> |
| | | <text class="text-color-gray text-mini">{{ maintSt.planTime }}</text> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <view class="flex h-[100rpx]" 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">工忻æ°: {{ maintSt.orderCount }}</text> |
| | | | |
| | | <text class="mx-3">已宿: {{ maintSt.wcCount }}</text> |
| | | </view> |
| | | <view class="text-color-gray text-xs mt-2 flex"> |
| | | <text class="mr-3">å¾
ä¿å
»: {{ maintSt.dbyCount }}</text> |
| | | | |
| | | <text class="mx-3">ä¿å
»ä¸: {{ maintSt.byCount }}</text> |
| | | | |
| | | <text class="ml-3">å¾
éªè¯: {{ maintSt.dyzCount }}</text> |
| | | </view> |
| | | <view class="text-color-gray text-xs mt-2 flex"> |
| | | <text>ç¶æï¼</text> |
| | | <template v-if="maintSt.orderCount === maintSt.wcCount"> |
| | | <wd-icon class="icon-color-success" name="check-outline" size="34rpx"></wd-icon> |
| | | <text class="ml-1">已宿</text> |
| | | </template> |
| | | <template v-else> |
| | | <wd-icon class="icon-color-base" name="detection" size="40rpx"></wd-icon> |
| | | <text class="ml-1">è¿è¡ä¸</text> |
| | | </template> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </wd-card> |
| | | </template> |
| | | |
| | | <view class="bg-base"> |
| | | <view class="w-full h-[24rpx]"></view> |
| | | <wd-cell class="mb-[2px]"> |
| | | <template #title> |
| | | <text class="text-color-gray">ä¿å
»é¡¹</text> |
| | | </template> |
| | | </wd-cell> |
| | | |
| | | <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id"> |
| | | <template #title> |
| | | <view class="flex justify-between"> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <view class="ml-1 text-sm align-center w-[50%]"> |
| | | <wd-text :text="item.maintName" :lines="1"></wd-text> |
| | | </view> |
| | | <view class="text-color-gray ml-2 text-mini">{{ item.maintCode }}</view> |
| | | </view> |
| | | |
| | | <view class="flex items-center w-[20%] justify-end"> |
| | | <text class="text-color-gray text-mini"> |
| | | {{ item?.planTime }} |
| | | </text> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <view class="flex h-[140rpx]" items-center> |
| | | <image class="slot-img text-center" src="/static/ico/ico-platform.png" /> |
| | | <view class="flex-1 text-color-gray text-xs flex-row"> |
| | | <view class="mr-3 mt-2">计åä¿å
»æ¥æ: {{ item.planTime }}</view> |
| | | <view class="mr-3 mt-2">ä¿å
»å¼å§æ¶é´: {{ item.startTime }}</view> |
| | | <view class="mr-3 mt-2">ä¿å
»ç»ææ¶é´: {{ item.endTime }}</view> |
| | | <view class="text-color-gray text-xs mt-2 flex"> |
| | | <text>ç¶æï¼</text> |
| | | <template v-if="item.status === '0'"> |
| | | <wd-icon class="icon-color-warning" name="books" size="34rpx"></wd-icon> |
| | | <text class="ml-1">å¾
ä¿å
»</text> |
| | | </template> |
| | | <template v-else-if="item.status === '1'"> |
| | | <wd-icon class="icon-color-base" name="books" size="34rpx"></wd-icon> |
| | | <text class="ml-1">ä¿å
»ä¸</text> |
| | | </template> |
| | | <template v-else-if="item.status === '2'"> |
| | | <wd-icon class="icon-color-purple" name="books" size="34rpx"></wd-icon> |
| | | <text class="ml-1">å¾
éªè¯</text> |
| | | </template> |
| | | <template v-else-if="item.status === '3'"> |
| | | <wd-icon class="icon-color-success" name="check-outline" size="34rpx"></wd-icon> |
| | | <text class="ml-1">已宿</text> |
| | | </template> |
| | | <text class="mx-3">|</text> |
| | | <wd-icon class="icon-color-base" name="camera" size="30rpx"></wd-icon> |
| | | <text class="ml-1">{{ item.maintUserName }}</text> |
| | | </view> |
| | | </view> |
| | | <!--æä½å·¥æç»´ä¿®å·¥è§è²--> |
| | | <template v-if="isOperatorOrRepair()"> |
| | | <wd-button |
| | | v-if="item.status === '0'" |
| | | size="small" |
| | | icon="edit-outline" |
| | | @click.stop="handleStartMaint(item)" |
| | | > |
| | | å¼å§ä¿å
» |
| | | </wd-button> |
| | | <wd-button |
| | | v-if="item.status === '1'" |
| | | size="small" |
| | | icon="edit-outline" |
| | | @click.stop="itemClick(item)" |
| | | > |
| | | ä¿å
»ä¸ |
| | | </wd-button> |
| | | |
| | | <wd-button |
| | | v-if="item.status === '2'" |
| | | size="small" |
| | | icon="edit-outline" |
| | | @click.stop="itemClick(item)" |
| | | > |
| | | å¾
éªè¯ |
| | | </wd-button> |
| | | |
| | | <wd-button |
| | | v-if="item.status === '3'" |
| | | size="small" |
| | | icon="check-outline" |
| | | @click.stop="itemClick(item)" |
| | | > |
| | | 已宿 |
| | | </wd-button> |
| | | </template> |
| | | |
| | | <!--管çåè§è²--> |
| | | <template v-else-if="isLeader()"> |
| | | <wd-button |
| | | v-if="item.status === '0'" |
| | | size="small" |
| | | icon="warn-bold" |
| | | disabled |
| | | > |
| | | å¾
ä¿å
» |
| | | </wd-button> |
| | | <wd-button |
| | | v-if="item.status === '1'" |
| | | size="small" |
| | | icon="warn-bold" |
| | | disabled |
| | | > |
| | | ä¿å
»ä¸ |
| | | </wd-button> |
| | | |
| | | <wd-button |
| | | v-if="item.status === '2'" |
| | | size="small" |
| | | icon="edit-outline" |
| | | @click.stop="itemClick(item)" |
| | | > |
| | | å¾
éªè¯ |
| | | </wd-button> |
| | | |
| | | <wd-button |
| | | v-if="item.status === '3'" |
| | | size="small" |
| | | icon="check-outline" |
| | | @click.stop="itemClick(item)" |
| | | > |
| | | 已宿 |
| | | </wd-button> |
| | | </template> |
| | | </view> |
| | | </wd-card> |
| | | <wd-cell> |
| | | <template #title> |
| | | <text class="text-color-gray">å
¶ä»ä¿¡æ¯</text> |
| | | </template> |
| | | </wd-cell> |
| | | <view class="h-[2px] w-full bg-base"></view> |
| | | <wd-textarea |
| | | label="ç¹è®°äºé¡¹" |
| | | label-width="200rpx" |
| | | type="textarea" |
| | | v-model="maintSt.specialNote" |
| | | auto-height |
| | | :maxlength="200" |
| | | show-word-limit |
| | | placeholder="请è¾å
¥ç¹è®°äºé¡¹" |
| | | clearable |
| | | /> |
| | | </view> |
| | | </z-paging> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import type { MaintStVO } from '@/service/maint.d' |
| | | import { getMaintSt, getMaintStOrderList, updateMaintOrder } from '@/service/maint' |
| | | import { ref, reactive } from 'vue' |
| | | import { useToast, useMessage } from 'wot-design-uni' |
| | | import { isLeader, isOperatorOrRepair } from '@/utils/RoleUtils' |
| | | const message = useMessage() |
| | | |
| | | const paging = ref(null) |
| | | const dataList = ref([]) |
| | | |
| | | interface QueryParams { |
| | | pageNum: number |
| | | pageSize: number |
| | | maintCode: string |
| | | status?: string |
| | | } |
| | | |
| | | const maintSt = reactive<MaintStVO>({ |
| | | id: '', |
| | | equName: '', |
| | | assetNo: '', |
| | | planTime: '', |
| | | orderCount: null, |
| | | wcCount: null, |
| | | dbyCount: null, |
| | | byCount: null, |
| | | dyzCount: null, |
| | | specialNote: '', |
| | | }) |
| | | const queryList = (pageNum?: number, pageSize?: number) => { |
| | | const params: QueryParams = { |
| | | pageNum, |
| | | pageSize, |
| | | maintCode: maintCode.value, |
| | | } |
| | | |
| | | getMaintStOrderList(params) |
| | | .then((res: any) => { |
| | | // 请å¿å¨ç½ç»è¯·æ±åè°ä¸ç»dataListèµå¼ï¼ï¼åªéè¦è°ç¨completeå°±å¯ä»¥äº |
| | | paging.value.complete(res.rows) |
| | | }) |
| | | .catch((res) => { |
| | | // å¦æè¯·æ±å¤±è´¥åpaging.value.complete(false)ï¼ä¼èªå¨å±ç¤ºéè¯¯é¡µé¢ |
| | | // 注æï¼æ¯æ¬¡é½éè¦å¨catchä¸åè¿å¥è¯å¾éº»ç¦ï¼z-pagingæä¾äºæ¹æ¡å¯ä»¥å
¨å±ç»ä¸å¤ç |
| | | // å¨åºå±çç½ç»è¯·æ±æåºå¼å¸¸æ¶ï¼åuni.$emit('z-paging-error-emit');å³å¯ |
| | | paging.value.complete(false) |
| | | }) |
| | | } |
| | | |
| | | function itemClick(item) { |
| | | goToOrderDetail(item) |
| | | } |
| | | |
| | | function goToOrderDetail(item) { |
| | | uni.navigateTo({ |
| | | url: `/pages/maint/order-detail?id=${item.id}`, |
| | | }) |
| | | } |
| | | |
| | | function handleStartMaint(item) { |
| | | message |
| | | .confirm({ |
| | | msg: 'ç¡®å®å¼å§ä¿å
»ï¼', |
| | | title: 'æç¤º', |
| | | beforeConfirm: ({ resolve }) => { |
| | | // 确认å¼å§ä¿®æ¹ç¶æä¸º1-ä¿å
»ä¸ |
| | | const data = Object.assign({}, item) |
| | | data.status = '1' |
| | | updateOrder(data, resolve) |
| | | }, |
| | | }) |
| | | .then(() => {}) |
| | | .catch((error) => { |
| | | console.log(error) |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°ä¿å
Ȍᴌ |
| | | * @param item |
| | | * @param resolve |
| | | */ |
| | | function updateOrder(data: any, resolve: any) { |
| | | updateMaintOrder(data) |
| | | .then((res: any) => { |
| | | resolve(true) |
| | | if (res?.code === 200) { |
| | | reloadData() |
| | | } |
| | | }) |
| | | .catch((res) => { |
| | | console.error(res) |
| | | }) |
| | | } |
| | | function reloadData() { |
| | | paging.value.reload() |
| | | } |
| | | const goBack = () => { |
| | | uni.navigateBack() |
| | | } |
| | | |
| | | function handleClickRight() {} |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»æç»éè¦çcode |
| | | */ |
| | | const maintCode = computed(() => `${maintSt.equId}_${maintSt.planTime}`) |
| | | |
| | | onLoad((options) => { |
| | | const itemString = decodeURIComponent(options.maintSt) |
| | | const item = JSON.parse(itemString) |
| | | Object.assign(maintSt, item) |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .menu-title-box { |
| | | height: 30rpx; |
| | | line-height: 30rpx; |
| | | } |
| | | |
| | | .slot-img { |
| | | width: 72rpx; |
| | | height: 72rpx; |
| | | margin-right: 24rpx; |
| | | } |
| | | |
| | | .text-mini { |
| | | font-size: 22rpx; |
| | | } |
| | | |
| | | .menu-indicator { |
| | | width: 6rpx; |
| | | height: 22rpx; |
| | | border-radius: 10rpx; |
| | | background-color: $uni-color-primary; |
| | | } |
| | | |
| | | :deep(.wd-card__footer) { |
| | | padding: 10rpx !important; |
| | | } |
| | | |
| | | .col-title-box { |
| | | } |
| | | |
| | | .bg-primary { |
| | | background: $uni-color-primary; |
| | | } |
| | | |
| | | :deep(.wd-navbar__text) { |
| | | font-size: 26rpx; |
| | | color: white; |
| | | } |
| | | |
| | | :deep(.wd-icon-arrow-left:before), |
| | | :deep(.wd-navbar__title) { |
| | | color: white; |
| | | font-weight: 0; |
| | | font-size: 32rpx; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <route lang="json5" type="page"> |
| | | { |
| | | layout: 'default', |
| | | needLogin: true, |
| | | style: { |
| | | navigationBarTitleText: 'ä¿å
»æ±æ»', |
| | | }, |
| | | } |
| | | </route> |
| | | |
| | | <template> |
| | | <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time> |
| | | <template #top> |
| | | <wd-drop-menu> |
| | | <wd-drop-menu-item v-model="equName" :options="equList" @change="handleEquName" /> |
| | | <wd-drop-menu-item v-model="status" :options="statusList" @change="handleStatus" /> |
| | | </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"> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <view class="ml-1 text-sm align-center w-[50%]"> |
| | | <wd-text :text="item.equName" :lines="1"></wd-text> |
| | | </view> |
| | | <view class="text-color-gray ml-2 text-mini">{{ item.assetNo }}</view> |
| | | </view> |
| | | |
| | | <view class="flex items-center w-[20%] justify-end"> |
| | | <text class="text-color-gray text-mini"> |
| | | {{ item?.planTime }} |
| | | </text> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <view class="flex h-[100rpx]" 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.orderCount }}</text> |
| | | | |
| | | <text class="mx-3">已宿: {{ item.wcCount }}</text> |
| | | </view> |
| | | <view class="text-color-gray text-xs mt-2 flex"> |
| | | <text class="mr-3">å¾
ä¿å
»: {{ item.dbyCount }}</text> |
| | | | |
| | | <text class="mx-3">ä¿å
»ä¸: {{ item.byCount }}</text> |
| | | | |
| | | <text class="ml-3">å¾
éªè¯: {{ item.dyzCount }}</text> |
| | | </view> |
| | | <view class="text-color-gray text-xs mt-2 flex"> |
| | | <text>ç¶æï¼</text> |
| | | <template v-if="item.orderCount === item.wcCount"> |
| | | <wd-icon class="icon-color-success" name="check-outline" size="34rpx"></wd-icon> |
| | | <text class="ml-1">已宿</text> |
| | | </template> |
| | | <template v-else> |
| | | <wd-icon class="icon-color-base" name="detection" size="40rpx"></wd-icon> |
| | | <text class="ml-1">è¿è¡ä¸</text> |
| | | </template> |
| | | </view> |
| | | </view> |
| | | <wd-button size="small" icon="edit-outline" @click.stop="itemClick(item)">æç»</wd-button> |
| | | </view> |
| | | </wd-card> |
| | | </view> |
| | | </z-paging> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref } from 'vue' |
| | | import { getMaintStList } from '@/service/maint' |
| | | |
| | | interface QueryParams { |
| | | pageNum: number |
| | | pageSize: number |
| | | equName?: string |
| | | status?: string |
| | | } |
| | | |
| | | const status = ref<string>('-1') |
| | | const equName = ref<string>('-1') |
| | | |
| | | const statusList = ref<Record<string, any>[]>([ |
| | | { label: 'ææç¶æ', value: '-1' }, |
| | | { label: 'å¾
ä¿å
»', value: '0' }, |
| | | { label: 'ä¿å
»ä¸', value: '1' }, |
| | | { label: 'å¾
éªè¯', value: '2' }, |
| | | { label: '已宿', value: '3' }, |
| | | ]) |
| | | const equList = ref<Record<string, any>[]>([{ label: 'ææè®¾å¤', value: '-1' }]) |
| | | function handleStatus({ value }) {} |
| | | function handleEquName({ value }) { |
| | | console.log(value) |
| | | } |
| | | |
| | | const paging = ref(null) |
| | | const dataList = ref([]) |
| | | |
| | | const queryList = (pageNum?: number, pageSize?: number) => { |
| | | // è¿éçpageNoåpageSizeä¼èªå¨è®¡ç®å¥½ï¼ç´æ¥ä¼ ç»æå¡å¨å³å¯ |
| | | // è¿éç请æ±åªæ¯æ¼ç¤ºï¼è¯·æ¿æ¢æèªå·±ç项ç®çç½ç»è¯·æ±ï¼å¹¶å¨ç½ç»è¯·æ±åè°ä¸éè¿paging.value.complete(请æ±åæ¥çæ°ç»)å°è¯·æ±ç»æä¼ ç»z-paging |
| | | const params: QueryParams = { |
| | | pageNum, |
| | | pageSize, |
| | | equName: equName.value, |
| | | status: status.value, |
| | | } |
| | | if (equName.value === '-1') { |
| | | delete params.equName |
| | | } |
| | | if (status.value === '-1') { |
| | | delete params.status |
| | | } |
| | | |
| | | getMaintStList(params) |
| | | .then((res: any) => { |
| | | // 请å¿å¨ç½ç»è¯·æ±åè°ä¸ç»dataListèµå¼ï¼ï¼åªéè¦è°ç¨completeå°±å¯ä»¥äº |
| | | paging.value.complete(res.rows) |
| | | }) |
| | | .catch((res) => { |
| | | // å¦æè¯·æ±å¤±è´¥åpaging.value.complete(false)ï¼ä¼èªå¨å±ç¤ºéè¯¯é¡µé¢ |
| | | // 注æï¼æ¯æ¬¡é½éè¦å¨catchä¸åè¿å¥è¯å¾éº»ç¦ï¼z-pagingæä¾äºæ¹æ¡å¯ä»¥å
¨å±ç»ä¸å¤ç |
| | | // å¨åºå±çç½ç»è¯·æ±æåºå¼å¸¸æ¶ï¼åuni.$emit('z-paging-error-emit');å³å¯ |
| | | paging.value.complete(false) |
| | | }) |
| | | } |
| | | |
| | | function itemClick(item) { |
| | | const itemString = encodeURIComponent(JSON.stringify(item)) |
| | | uni.navigateTo({ |
| | | url: `/pages/maint/maint-order?maintSt=${itemString}`, |
| | | }) |
| | | } |
| | | |
| | | function reloadData() { |
| | | paging.value.reload() |
| | | } |
| | | onLoad(() => { |
| | | queryList() |
| | | uni.$on('maint-st-refresh', reloadData) |
| | | }) |
| | | onUnload(() => { |
| | | uni.$off('maint-st-refres', reloadData) |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .menu-title-box { |
| | | } |
| | | |
| | | .slot-img { |
| | | width: 72rpx; |
| | | height: 72rpx; |
| | | margin-right: 24rpx; |
| | | } |
| | | .statu-img { |
| | | width: 60rpx; |
| | | height: 40rpx; |
| | | } |
| | | .text-mini { |
| | | font-size: 22rpx; |
| | | } |
| | | |
| | | .menu-indicator { |
| | | width: 6rpx; |
| | | height: 26rpx; |
| | | border-radius: 10rpx; |
| | | background-color: $uni-color-primary; |
| | | } |
| | | :deep(.wd-card__footer) { |
| | | padding: 10rpx !important; |
| | | } |
| | | :deep(.wd-card__title-content) { |
| | | padding: 24rpx 0 !important; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <route lang="json5" type="page"> |
| | | { |
| | | needLogin: true, |
| | | style: { |
| | | navigationBarTitleText: 'å·¥åæç»', |
| | | navigationStyle: 'custom', |
| | | navigationBarBackgroundColor: '#4D80F0', |
| | | }, |
| | | } |
| | | </route> |
| | | <template> |
| | | <view class="bg-base h-[100vh]"> |
| | | <wd-navbar |
| | | title="å·¥åæç»" |
| | | left-arrow |
| | | @click-left="goBack" |
| | | right-text="æäº¤" |
| | | @click-right="handleClickRight" |
| | | custom-style="background: #4D80F0;" |
| | | safeAreaInsetTop |
| | | ></wd-navbar> |
| | | |
| | | <wd-form ref="form" :model="order" :rules="rules"> |
| | | <wd-cell-group custom-class="group" title="设å¤ä¿¡æ¯" border> |
| | | <wd-cell title="设å¤åç§°" title-width="200rpx" is-link> |
| | | <text>{{ order?.equName }}</text> |
| | | </wd-cell> |
| | | <wd-cell title="èµäº§ç¼å·" title-width="200rpx" is-link> |
| | | <text>{{ order?.assetNo }}</text> |
| | | </wd-cell> |
| | | </wd-cell-group> |
| | | |
| | | <wd-cell-group custom-class="mt-2" title="ä¿å
»ä¿¡æ¯" border> |
| | | <wd-cell title="ä¿å
»åå·" title-width="200rpx" is-link> |
| | | <text>{{ order?.maintCode }}</text> |
| | | </wd-cell> |
| | | <wd-cell title="ä¿å
»é¡¹" title-width="200rpx" is-link> |
| | | <text>{{ order?.maintName }}</text> |
| | | </wd-cell> |
| | | <wd-cell title="计åä¿å
»æ¥æ" title-width="200rpx" is-link> |
| | | <text>{{ order?.planTime }}</text> |
| | | </wd-cell> |
| | | <wd-datetime-picker |
| | | label="ä¿å
»å¼å§æ¶é´" |
| | | label-width="200rpx" |
| | | placeholder="è¯·éæ©æ¶é´" |
| | | prop="startTime" |
| | | v-model="startTime" |
| | | @open="openStartTime" |
| | | @confirm="handleStartTime" |
| | | /> |
| | | <wd-datetime-picker |
| | | label="ä¿å
»ç»ææ¶é´" |
| | | label-width="200rpx" |
| | | placeholder="è¯·éæ©æ¶é´" |
| | | prop="endTime" |
| | | v-model="endTime" |
| | | @open="openEndTime" |
| | | @confirm="handleEndTime" |
| | | /> |
| | | |
| | | <wd-textarea |
| | | label="å·¥ä½æè¿°" |
| | | label-width="200rpx" |
| | | type="textarea" |
| | | v-model="order.maintDesc" |
| | | auto-height |
| | | :maxlength="200" |
| | | show-word-limit |
| | | placeholder="请è¾å
¥å·¥ä½æè¿°" |
| | | clearable |
| | | /> |
| | | <wd-cell title="ä¿å
»å¾ç" title-width="200rpx" prop="fileList"> |
| | | <wd-upload |
| | | :auto-upload="false" |
| | | :file-list="fileList" |
| | | @change="handleFileChange" |
| | | ></wd-upload> |
| | | </wd-cell> |
| | | <wd-textarea |
| | | label="夿³¨" |
| | | label-width="200rpx" |
| | | type="textarea" |
| | | v-model="order.remark" |
| | | auto-height |
| | | :maxlength="200" |
| | | show-word-limit |
| | | placeholder="请è¾å
¥å¤æ³¨" |
| | | clearable |
| | | /> |
| | | </wd-cell-group> |
| | | </wd-form> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { getMaintOrder, updateMaintOrder } from '@/service/maint' |
| | | import { formatDate } from '@/utils/DateUtils' |
| | | import { reactive } from 'vue' |
| | | import { FormRules } from 'wot-design-uni/components/wd-form/types' |
| | | import { useToast, useMessage } from 'wot-design-uni' |
| | | const message = useMessage() |
| | | |
| | | const fileList = ref<[]>() |
| | | const startTime = ref<number>(0) |
| | | const endTime = ref<number>(0) |
| | | |
| | | interface MaintOrder { |
| | | id: string |
| | | equName: string |
| | | maintCode: string |
| | | maintName: string |
| | | planTime: string |
| | | startTime: string |
| | | endTime?: string |
| | | maintDesc: string |
| | | remark: string |
| | | } |
| | | |
| | | const order = reactive<MaintOrder>({ |
| | | id: '', |
| | | equName: '', |
| | | maintCode: '', |
| | | maintName: '', |
| | | planTime: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | maintDesc: '', |
| | | remark: '', |
| | | }) |
| | | |
| | | const rules: FormRules = { |
| | | startTime: [ |
| | | { |
| | | required: true, |
| | | message: 'è¯·éæ©ä¿å
»å¼å§æ¶é´', |
| | | }, |
| | | ], |
| | | endTime: [ |
| | | { |
| | | required: true, |
| | | message: 'è¯·éæ©ä¿å
»ç»ææ¶é´', |
| | | }, |
| | | ], |
| | | maintDesc: [ |
| | | { |
| | | required: true, |
| | | message: '请è¾å
¥å·¥ä½æè¿°', |
| | | }, |
| | | ], |
| | | } |
| | | function openStartTime() { |
| | | if (startTime.value === 0) { |
| | | startTime.value = Date.now() |
| | | } |
| | | } |
| | | function openEndTime() { |
| | | if (endTime.value === 0) { |
| | | endTime.value = Date.now() |
| | | } |
| | | } |
| | | |
| | | function handleStartTime(value) { |
| | | order.startTime = formatDate(new Date(value.value)) |
| | | } |
| | | function handleEndTime(value) { |
| | | order.endTime = formatDate(new Date(value.value)) |
| | | } |
| | | |
| | | function handleFileChange({ fileList }) {} |
| | | |
| | | function initMaintOrder(id: any) { |
| | | getMaintOrder(id) |
| | | .then((res: any) => { |
| | | Object.assign(order, res) |
| | | startTime.value = new Date(order.startTime).getTime() |
| | | endTime.value = new Date(order.endTime).getTime() |
| | | }) |
| | | .catch((res) => {}) |
| | | } |
| | | |
| | | function updateOrder(resolve: any) { |
| | | updateMaintOrder(order) |
| | | .then((res: any) => { |
| | | resolve(true) |
| | | }) |
| | | .catch((res) => { |
| | | console.error(res) |
| | | }) |
| | | } |
| | | |
| | | const goBack = () => { |
| | | uni.navigateBack() |
| | | } |
| | | |
| | | function handleClickRight() { |
| | | message |
| | | .confirm({ |
| | | msg: 'ç¡®å®æäº¤ï¼', |
| | | title: 'æç¤º', |
| | | beforeConfirm: ({ resolve }) => { |
| | | updateOrder(resolve) |
| | | }, |
| | | }) |
| | | .then(() => {}) |
| | | .catch((error) => { |
| | | console.log(error) |
| | | }) |
| | | } |
| | | |
| | | onLoad((options) => { |
| | | initMaintOrder(options.id) |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | :deep(.wd-navbar__text) { |
| | | font-size: 26rpx; |
| | | color: white; |
| | | } |
| | | |
| | | :deep(.wd-icon-arrow-left:before), |
| | | :deep(.wd-navbar__title) { |
| | | color: white; |
| | | font-weight: bold !important; |
| | | font-size: 32rpx; |
| | | } |
| | | </style> |
| | |
| | | <route lang="json5" type="page"> |
| | | { |
| | | layout: 'tabbar', |
| | | needLogin: true, |
| | | style: { |
| | | navigationBarTitleText: 'æç', |
| | | }, |
| | |
| | | <route lang="json5" type="page"> |
| | | { |
| | | layout: 'tabbar', |
| | | needLogin: true, |
| | | style: { |
| | | navigationBarTitleText: 'spare', |
| | | }, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface EquVO { |
| | | /** |
| | | * |
| | | */ |
| | | equId: number | string; |
| | | |
| | | /** |
| | | * èµäº§ç¼å· |
| | | */ |
| | | assetNo: string; |
| | | /** |
| | | * 设å¤ç¼ç |
| | | */ |
| | | equCode: string; |
| | | |
| | | /** |
| | | * 设å¤åç§° |
| | | |
| | | */ |
| | | equName: string; |
| | | /** |
| | | * 设å¤ç±»å |
| | | |
| | | */ |
| | | equTypeName: string; |
| | | |
| | | /** |
| | | * åå· |
| | | */ |
| | | modelNo: string; |
| | | |
| | | /** |
| | | * å¶é å |
| | | */ |
| | | madeIn: string; |
| | | |
| | | /** |
| | | * é¢åº¦åç |
| | | */ |
| | | ratedPower: number; |
| | | |
| | | /** |
| | | * éçä¿¡æ¯ |
| | | */ |
| | | plateInfo: string; |
| | | |
| | | /** |
| | | * éè´æ¥æ |
| | | */ |
| | | purchaseDate: string; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | status: string; |
| | | |
| | | /** |
| | | * æå¨åºæ |
| | | */ |
| | | location: string; |
| | | |
| | | /** |
| | | * 使ç¨é¨é¨ï¼å
³èidï¼ |
| | | */ |
| | | deptUsed: number; |
| | | /** |
| | | * 使ç¨é¨é¨åç§° |
| | | */ |
| | | deptName: number; |
| | | |
| | | /** |
| | | * 责任人(å
³èid) |
| | | */ |
| | | respPerson: number; |
| | | /** |
| | | * 责任人 |
| | | */ |
| | | respPersonName: string; |
| | | |
| | | /** |
| | | * èç³»çµè¯ |
| | | */ |
| | | contactPhone: string; |
| | | |
| | | /** |
| | | * æ£å¼ä½¿ç¨æ¥æ |
| | | */ |
| | | deployDate: string; |
| | | |
| | | /** |
| | | * å¼å§è¯ç¨æ¥æ |
| | | */ |
| | | trialDate: string; |
| | | |
| | | /** |
| | | * 计åéªæ¶æ¥æ |
| | | */ |
| | | planAcceptDate: string; |
| | | |
| | | /** |
| | | * å®é
éªæ¶æ¥æ |
| | | */ |
| | | actualAcceptDate: string; |
| | | |
| | | /** |
| | | * 导å
¥ç¶æï¼åå
¸ï¼ |
| | | */ |
| | | importStatus: number; |
| | | |
| | | /** |
| | | * çç¹æ å¿ |
| | | */ |
| | | inventoryFlag: number; |
| | | |
| | | /** |
| | | * 䏿¬¡çç¹æ¥æ |
| | | */ |
| | | inventoryDate: string; |
| | | |
| | | /** |
| | | * 使ç¨å¹´é |
| | | */ |
| | | serviceLife: number; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { http } from '@/utils/http' |
| | | import type { EquVO } from './equ.d' |
| | | |
| | | /** |
| | | * 设å¤å表 |
| | | */ |
| | | export const getEquList = (params: any) => { |
| | | return http.get<EquVO[]>('/eims/equ/list', params) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * ç¹æ£æ±æ» |
| | | */ |
| | | export interface InspectStVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: number | string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | title: string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | equId: number | string; |
| | | status: string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | planTime: string; |
| | | |
| | | /** |
| | | * ä¿å
»äºº |
| | | */ |
| | | maintUser: number; |
| | | |
| | | /** |
| | | * éªè¯äºº |
| | | */ |
| | | verifyUser: number; |
| | | verifyTime: string; |
| | | |
| | | /** |
| | | * ç¹è®°äºé¡¹ |
| | | */ |
| | | specialNote: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç¹æ£è®°å½ |
| | | */ |
| | | export interface InspectRecordVO { |
| | | /** |
| | | * id |
| | | */ |
| | | id: string | number; |
| | | |
| | | /** |
| | | * 设å¤di |
| | | */ |
| | | equId: string | number; |
| | | /** |
| | | * 设å¤åç§° |
| | | |
| | | */ |
| | | equName: string; |
| | | /** |
| | | * èµäº§ç¼å· |
| | | |
| | | */ |
| | | assteNo: string; |
| | | |
| | | /** |
| | | * ç¹æ£åç§° |
| | | */ |
| | | inspName: string; |
| | | |
| | | /** |
| | | * ç¹æ£æè¿° |
| | | */ |
| | | inspDesc: string; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | status: string; |
| | | |
| | | /** |
| | | * ç¹æ£ç¼ç |
| | | */ |
| | | inspCode: string; |
| | | |
| | | /** |
| | | * å¼è®°å½æ¹å¼ï¼åå
¸ï¼ |
| | | */ |
| | | recordMode: string; |
| | | |
| | | /** |
| | | * åèå¼ |
| | | */ |
| | | referenceValue: string; |
| | | |
| | | /** |
| | | * ä¸é |
| | | */ |
| | | upperLimit: string; |
| | | |
| | | /** |
| | | * ä¸é |
| | | */ |
| | | lowLimit: string; |
| | | |
| | | /** |
| | | * æ£æ¥å¼ |
| | | */ |
| | | checkValue: string; |
| | | |
| | | /** |
| | | * ç¹æ£ç»æï¼åå
¸ï¼ |
| | | */ |
| | | inspResult: string; |
| | | |
| | | /** |
| | | * ç¹æ£æ¶é´ |
| | | */ |
| | | inspTime: string; |
| | | |
| | | /** |
| | | * 计åç¹æ£æ¥æ |
| | | */ |
| | | planTime: string; |
| | | |
| | | /** |
| | | * éªè¯äºº |
| | | */ |
| | | verifyUser: number; |
| | | |
| | | /** |
| | | * 计åid |
| | | */ |
| | | planId: string | number; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | |
| | | } |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { http } from '@/utils/http' |
| | | import type { InspectStVO, InspectRecordVO } from './inspect.d' |
| | | |
| | | /** |
| | | * ç¹æ£æ±æ»å表 |
| | | */ |
| | | export const getInspStList = (params: any) => { |
| | | return http.get<InspectStVO[]>('/eims/inspectSt/list', params) |
| | | } |
| | | |
| | | /** |
| | | * ç¹æ£æ±æ»å表ä¸ç¹æ£è®°å½å表 |
| | | */ |
| | | export const getInspStRecordList = (params: any) => { |
| | | return http.get<InspectRecordVO[]>('/eims/inspRecord/stList', params) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°ç¹æ£è®°å½ |
| | | * @param data |
| | | */ |
| | | export const updateInspRecord = (data: any) => { |
| | | return http.put<void>('/eims/inspRecord', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ´æ°ç¹æ£è®°å½ |
| | | * @param data |
| | | */ |
| | | export const updateInspRecordBatch = (data: any) => { |
| | | return http.put<void>('/eims/inspRecord/editBatch', data) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°ç¹æ£æ±æ» |
| | | * @param data |
| | | */ |
| | | export const updateInspectSt = (data: any) => { |
| | | return http.put<void>('/eims/inspectSt', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface LoginParams { |
| | | username: string; |
| | | password: string; |
| | | clientId?: string; |
| | | tenantId?: string; |
| | | grantType?: string; |
| | | } |
| | | |
| | | |
| | | export interface User { |
| | | avatar: string; |
| | | createTime: string; |
| | | deptId: number; |
| | | deptName: string; |
| | | email: string; |
| | | loginDate: string; |
| | | loginIp: string; |
| | | nickName: string; |
| | | phonenumber: string; |
| | | remark: string; |
| | | roles: Role[]; |
| | | sex: string; |
| | | status: string; |
| | | tenantId: string; |
| | | userId: number; |
| | | userName: string; |
| | | userType: string; |
| | | } |
| | | |
| | | |
| | | export interface UserInfoResp { |
| | | permissions: string[]; |
| | | roles: string[]; |
| | | user: User; |
| | | } |
| | | |
| | | |
| | | |
| | | interface BasicUserInfo { |
| | | /** |
| | | * 头å |
| | | */ |
| | | avatar: string; |
| | | /** |
| | | * é¨é¨id |
| | | */ |
| | | deptId: number; |
| | | /** |
| | | * ç¨æ·æé |
| | | */ |
| | | permissions: string[]; |
| | | /** |
| | | * ç¨æ·æµç§° |
| | | */ |
| | | realName: string; |
| | | /** |
| | | * ç¨æ·è§è² |
| | | */ |
| | | roles: string[]; |
| | | /** |
| | | * ç¨æ·id |
| | | */ |
| | | userId: number | string; |
| | | |
| | | /** |
| | | * ç¨æ·å |
| | | */ |
| | | username: string; |
| | | } |
| | | |
| | | |
| | | /** ç¨æ·ä¿¡æ¯ */ |
| | | interface UserInfo extends BasicUserInfo { |
| | | /** |
| | | * æå±ä½¿ç¨ |
| | | */ |
| | | [key: string]: any; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { http } from '@/utils/http' |
| | | import type { LoginParams, UserInfoResp } from './login.d' |
| | | const clientId = import.meta.env.VITE_APP_CLIENT_ID |
| | | |
| | | const DEFAULT_TENANT_ID = '000000' |
| | | const GRANT_TYPE = 'password' |
| | | |
| | | /** get è¯·æ± */ |
| | | export const login = (params: LoginParams) => { |
| | | const { username, password } = params |
| | | // æé æ°ç请æ±åæ°ï¼é¿å
ç´æ¥ä¿®æ¹åå§å¯¹è±¡ |
| | | const requestData = { |
| | | username, |
| | | password, |
| | | clientId, |
| | | tenantId: DEFAULT_TENANT_ID, |
| | | grantType: GRANT_TYPE, |
| | | } |
| | | return http.post<any>('/auth/login', requestData) |
| | | } |
| | | |
| | | export const getUserInfo = () => { |
| | | return http.get<null | UserInfoResp>('/system/user/getInfo') |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface MaintStVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: number | string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | title?: string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | equId?: number | string; |
| | | equName?: string; |
| | | assetNo?: string; |
| | | status?: string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | planTime?: string; |
| | | |
| | | /** |
| | | * ä¿å
»äºº |
| | | */ |
| | | maintUser?: number; |
| | | orderCount?: number, |
| | | wcCount?: number, |
| | | dbyCount?: number, |
| | | byCount?: number, |
| | | dyzCount?: number, |
| | | |
| | | /** |
| | | * éªè¯äºº |
| | | */ |
| | | verifyUser?: number; |
| | | verifyTime?: string; |
| | | |
| | | /** |
| | | * ç¹è®°äºé¡¹ |
| | | */ |
| | | specialNote?: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark?: string; |
| | | } |
| | | |
| | | |
| | | export interface MaintOrderVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: number | string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | equId?: number | string; |
| | | equName?: string; |
| | | assetNo?: string; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»ç±»åï¼åå
¸ï¼ |
| | | */ |
| | | maintType?: string; |
| | | |
| | | /** |
| | | * å·¥ä½æè¿° |
| | | */ |
| | | maintDesc?: string; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»å¨æ |
| | | */ |
| | | maintCycle?: number; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»å¨æåä½ï¼åå
¸ï¼ |
| | | */ |
| | | maintCycleUnit?: string; |
| | | |
| | | /** |
| | | * 计å表åä½- ä¿å
»è§åï¼åå
¸ï¼ä¿å
»æ¶é´è®¡ç®ï¼1-æå¨æ 2-æä¸æ¬¡ä¿å
»æ¶é´ |
| | | */ |
| | | maintRule?: string; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»äºº |
| | | */ |
| | | maintUser?: number; |
| | | maintUserName?: string; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»é¨é¨ |
| | | */ |
| | | maintDept?: number; |
| | | |
| | | /** |
| | | * ä¿å
»åå· |
| | | */ |
| | | maintCode?: string; |
| | | maintName?: string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | status?: string; |
| | | |
| | | verifyUser?: number; |
| | | /** |
| | | * éªè¯äºº |
| | | */ |
| | | verifyUserName?: string; |
| | | |
| | | /** |
| | | * ä¿å
»è®¡åæ¶é´ |
| | | */ |
| | | planTime?: number | string; |
| | | |
| | | /** |
| | | * ä¿å
»å¼å§æ¶é´ |
| | | */ |
| | | startTime: any; |
| | | |
| | | /** |
| | | * ä¿å
»ç»ææ¶é´ |
| | | */ |
| | | endTime: any; |
| | | |
| | | /** |
| | | * 计åid |
| | | */ |
| | | planId?: number | string; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | createTime?: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark?: string; |
| | | |
| | | } |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { http } from '@/utils/http' |
| | | import type { MaintStVO, MaintOrderVO } from './maint.d' |
| | | type ID = number | string |
| | | |
| | | /** |
| | | * æ ¹æ®idæ¥è¯¢æ±æ» |
| | | * @param id |
| | | */ |
| | | export const getMaintSt = (id: ID) => { |
| | | return http.get<MaintStVO>(`/eims/maintSt/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * ä¿å
»æ±æ»å表 |
| | | */ |
| | | export const getMaintStList = (params: any) => { |
| | | return http.get<MaintStVO[]>('/eims/maintSt/list', params) |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®idæ¥è¯¢å·¥å |
| | | * @param id |
| | | */ |
| | | export const getMaintOrder = (id: ID) => { |
| | | return http.get<MaintOrderVO>(`/eims/maintOrder/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * ä¿å
»æ±æ»å表ä¸ä¿å
»å·¥åå表 |
| | | */ |
| | | export const getMaintStOrderList = (params: any) => { |
| | | return http.get<MaintOrderVO[]>('/eims/maintOrder/detailList', params) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°ä¿å
Ȍᴌ |
| | | * @param data |
| | | */ |
| | | export const updateMaintOrder = (data: any) => { |
| | | return http.put<void>('/eims/maintOrder', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * @description: èåmeta |
| | | * @param title èåå |
| | | * @param icon èå徿 |
| | | * @param noCache æ¯å¦ä¸ç¼å |
| | | * @param link å¤é¾é¾æ¥ |
| | | */ |
| | | export interface MenuMeta { |
| | | icon: string; |
| | | link?: string; |
| | | noCache: boolean; |
| | | title: string; |
| | | } |
| | | |
| | | /** |
| | | * @description: èå |
| | | * @param name èåå |
| | | * @param path èåè·¯å¾ |
| | | * @param hidden æ¯å¦éè |
| | | * @param component ç»ä»¶åç§° Laout |
| | | * @param alwaysShow æ»æ¯æ¾ç¤º |
| | | * @param query è·¯ç±åæ°(jsonå½¢å¼) |
| | | * @param meta è·¯ç±ä¿¡æ¯ |
| | | * @param children åè·¯ç±ä¿¡æ¯ |
| | | */ |
| | | export interface Menu { |
| | | alwaysShow?: boolean; |
| | | children: Menu[]; |
| | | component: string; |
| | | hidden: boolean; |
| | | meta: MenuMeta; |
| | | name: string; |
| | | path: string; |
| | | query?: string; |
| | | redirect?: string; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { http } from '@/utils/http' |
| | | import type { Menu } from './menu.d' |
| | | |
| | | export const getAllMenusApi = () => { |
| | | return http.get<Menu>('/system/menu/getRouters') |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { defineStore } from 'pinia' |
| | | import { ref } from 'vue' |
| | | |
| | | type AccessToken = null | string |
| | | const initState = { |
| | | access_codes: [], |
| | | access_menus: [], |
| | | access_routes: [], |
| | | access_token: null, |
| | | is_access_checked: false, |
| | | login_expired: false, |
| | | refresh_token: null, |
| | | } |
| | | |
| | | interface AccessInfo { |
| | | /** |
| | | * æéç |
| | | */ |
| | | access_codes: string[] |
| | | /** |
| | | * å¯è®¿é®çèåå表 |
| | | */ |
| | | access_menus: string[] |
| | | /** |
| | | * å¯è®¿é®çè·¯ç±å表 |
| | | */ |
| | | access_routes: string[] |
| | | /** |
| | | * ç»å½ accessToken |
| | | */ |
| | | access_token: AccessToken |
| | | /** |
| | | * æ¯å¦å·²ç»æ£æ¥è¿æé |
| | | */ |
| | | is_access_checked: boolean |
| | | /** |
| | | * ç»å½æ¯å¦è¿æ |
| | | */ |
| | | login_expired: boolean |
| | | /** |
| | | * ç»å½ accessToken |
| | | */ |
| | | refresh_token: AccessToken |
| | | } |
| | | |
| | | export const useAccessStore = defineStore( |
| | | 'accessInfo', |
| | | () => { |
| | | const accessInfo = ref<AccessInfo>({ ...initState }) |
| | | |
| | | const setAccessInfo = (val: AccessInfo) => { |
| | | accessInfo.value = val |
| | | } |
| | | const setAccessToken = (val: AccessToken) => { |
| | | accessInfo.value.access_token = val |
| | | } |
| | | |
| | | const clearAccessInfo = () => { |
| | | accessInfo.value = { ...initState } |
| | | } |
| | | // ä¸è¬æ²¡æresetéæ±ï¼ä¸éè¦çå¯ä»¥å é¤ |
| | | const reset = () => { |
| | | accessInfo.value = { ...initState } |
| | | } |
| | | const isLogined = computed(() => !!accessInfo.value.access_token) |
| | | |
| | | return { |
| | | accessInfo, |
| | | setAccessInfo, |
| | | setAccessToken, |
| | | clearAccessInfo, |
| | | isLogined, |
| | | reset, |
| | | } |
| | | }, |
| | | { |
| | | persist: true, |
| | | }, |
| | | ) |
| | |
| | | |
| | | // 模åç»ä¸å¯¼åº |
| | | export * from './user' |
| | | export * from './access' |
| | | export * from './system-config' |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { defineStore } from 'pinia' |
| | | import { ref } from 'vue' |
| | | |
| | | const initState = { |
| | | remberPassword: false, |
| | | username: '', |
| | | password: '', |
| | | } |
| | | |
| | | export const useSystemConfigStore = defineStore( |
| | | 'systemConfig', |
| | | () => { |
| | | const systemConfigInfo = ref<any>({ ...initState }) |
| | | |
| | | const setConfigInfo = (val: any) => { |
| | | systemConfigInfo.value = val |
| | | } |
| | | |
| | | const clearConfigInfo = () => { |
| | | systemConfigInfo.value = { ...initState } |
| | | } |
| | | // ä¸è¬æ²¡æresetéæ±ï¼ä¸éè¦çå¯ä»¥å é¤ |
| | | const reset = () => { |
| | | systemConfigInfo.value = { ...initState } |
| | | } |
| | | |
| | | return { |
| | | systemConfigInfo, |
| | | setConfigInfo, |
| | | clearConfigInfo, |
| | | reset, |
| | | } |
| | | }, |
| | | { |
| | | persist: true, |
| | | }, |
| | | ) |
| | |
| | | import { defineStore } from 'pinia' |
| | | import { ref } from 'vue' |
| | | import type { UserInfoResp, UserInfo } from '@/service/login.d' |
| | | |
| | | const initState = { nickname: '', avatar: '' } |
| | | const initState = null |
| | | |
| | | export const useUserStore = defineStore( |
| | | 'user', |
| | | 'userInfo', |
| | | () => { |
| | | const userInfo = ref<IUserInfo>({ ...initState }) |
| | | const userInfo = ref<UserInfo>({ ...initState }) |
| | | |
| | | const setUserInfo = (val: IUserInfo) => { |
| | | const setUserInfo = (val: UserInfo) => { |
| | | userInfo.value = val |
| | | } |
| | | |
| | |
| | | const reset = () => { |
| | | userInfo.value = { ...initState } |
| | | } |
| | | const isLogined = computed(() => !!userInfo.value.token) |
| | | |
| | | return { |
| | | userInfo, |
| | | setUserInfo, |
| | | clearUserInfo, |
| | | isLogined, |
| | | reset, |
| | | } |
| | | }, |
| | |
| | | // ä¿®æ¹æé®èæ¯è² |
| | | // --wot-button-primary-bg-color: green; |
| | | } |
| | | |
| | | // baseæåé¢è² |
| | | .text-color-base { |
| | | color: $uni-text-color; |
| | | } |
| | | .text-color-gray { |
| | | color: $uni-text-color-grey; |
| | | } |
| | | |
| | | // 徿 é¢è² |
| | | .icon-color-base { |
| | | color: $uni-color-primary; |
| | | } |
| | | .icon-color-gray { |
| | | color: $uni-text-color-grey; |
| | | } |
| | | .icon-color-success { |
| | | color: $uni-color-success; |
| | | } |
| | | |
| | | .icon-color-warning { |
| | | color: $uni-color-warning; |
| | | } |
| | | .icon-color-purple { |
| | | color: #824eed; |
| | | } |
| | | |
| | | .bg-base { |
| | | background: $uni-bg-color-grey; |
| | | } |
| | | |
| | | .bg-primary { |
| | | background: $uni-color-primary; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | const useCssVars: typeof import('vue')['useCssVars'] |
| | | const useId: typeof import('vue')['useId'] |
| | | const useModel: typeof import('vue')['useModel'] |
| | | const useNavbarWeixin: (typeof import('../hooks/useNavbarWeixin'))['default'] |
| | | const useRequest: typeof import('../hooks/useRequest')['default'] |
| | | const useSlots: typeof import('vue')['useSlots'] |
| | | const useTemplateRef: typeof import('vue')['useTemplateRef'] |
| | | const useUpload: typeof import('../hooks/useUpload')['default'] |
| | | const useUpload2: typeof import('../hooks/useUpload2')['default'] |
| | | const watch: typeof import('vue')['watch'] |
| | | const watchEffect: typeof import('vue')['watchEffect'] |
| | | const watchPostEffect: typeof import('vue')['watchPostEffect'] |
| | |
| | | |
| | | interface NavigateToOptions { |
| | | url: "/pages/home/index" | |
| | | "/pages/equ/equ-list" | |
| | | "/pages/equ/index" | |
| | | "/pages/inspect/insp-add" | |
| | | "/pages/inspect/insp-record" | |
| | | "/pages/inspect/insp-st" | |
| | | "/pages/login/index" | |
| | | "/pages/maint/maint-order" | |
| | | "/pages/maint/maint-st" | |
| | | "/pages/maint/order-detail" | |
| | | "/pages/my/index" | |
| | | "/pages/spare/index"; |
| | | } |
| | |
| | | /* é¢è²åé */ |
| | | |
| | | /* è¡ä¸ºç¸å
³é¢è² */ |
| | | $uni-color-primary: #007aff; |
| | | $uni-color-primary: #4D80F0; |
| | | $uni-color-success: #4cd964; |
| | | $uni-color-warning: #f0ad4e; |
| | | $uni-color-error: #dd524d; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import dayjs from 'dayjs' |
| | | |
| | | export function formatDate(inputDate: Date) { |
| | | return dayjs(inputDate).format('YYYY-MM-DD HH:mm:ss') |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { useUserStore } from '@/store' |
| | | // import { ROLE_OPERATOR, ROLE_REPAIR, ROLE_LEADER, ROLE_LINE, ROLE_SUPER_ADMIN } from '@/utils/constants' |
| | | |
| | | /** |
| | | * è¶
级管çå |
| | | */ |
| | | export const ROLE_SUPER_ADMIN = 'superadmin' |
| | | /** |
| | | * é¢å¯¼ |
| | | */ |
| | | export const ROLE_LEADER = 'leader' |
| | | /** |
| | | * æä½å |
| | | */ |
| | | export const ROLE_OPERATOR = 'operator' |
| | | /** |
| | | * çº¿é¿ |
| | | */ |
| | | export const ROLE_LINE = 'line' |
| | | /** |
| | | * ç»´ä¿®å |
| | | */ |
| | | export const ROLE_REPAIR = 'repair' |
| | | |
| | | /** |
| | | * ç»å½è§è²æ¯æä½å·¥æç»´ä¿®å·¥ |
| | | */ |
| | | export const isOperatorOrRepair = () => { |
| | | const roles = useUserStore()?.userInfo?.roles || [] |
| | | return roles.includes(ROLE_OPERATOR) || roles.includes(ROLE_REPAIR) |
| | | } |
| | | |
| | | /** |
| | | * ç»å½è§è²æ¯æä½å·¥æç»´ä¿®å·¥ |
| | | */ |
| | | export const isLeader = () => { |
| | | const roles = useUserStore()?.userInfo?.roles || [] |
| | | return ( |
| | | roles.includes(ROLE_LINE) || roles.includes(ROLE_SUPER_ADMIN) || roles.includes(ROLE_LEADER) |
| | | ) |
| | | } |
| | |
| | | import { CustomRequestOptions } from '@/interceptors/request' |
| | | import { useUserStore, useAccessStore } from '@/store' |
| | | |
| | | export const http = <T>(options: CustomRequestOptions) => { |
| | | uni.showLoading({ |
| | | title: 'å è½½ä¸', |
| | | }) |
| | | // 1. è¿å Promise 对象 |
| | | return new Promise<IResData<T>>((resolve, reject) => { |
| | | uni.request({ |
| | |
| | | // #endif |
| | | // ååºæå |
| | | success(res) { |
| | | uni.hideLoading() |
| | | // ç¶æç 2xxï¼åè axios ç设计 |
| | | if (res.statusCode >= 200 && res.statusCode < 300) { |
| | | // 2.1 æåæ ¸å¿æ°æ® res.data |
| | | resolve(res.data as IResData<T>) |
| | | if ((res.data as IResData<T>).code === 200) { |
| | | resolve(((res.data as IResData<T>).data || res.data) as IResData<T>) |
| | | } else if ((res.data as IResData<T>).code === 401) { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: 'ç»å½è¶
æ¶ï¼è¯·éæ°ç»å½ï¼', |
| | | }) |
| | | // 401é误 -> æ¸
çç¨æ·ä¿¡æ¯ï¼è·³è½¬å°ç»å½é¡µ |
| | | useAccessStore().clearAccessInfo() |
| | | useUserStore().clearUserInfo() |
| | | const loginRoute = '/pages/login/index' |
| | | // éæ°ç»å½åè¿åé¡µé¢ |
| | | const url = '/pages/home/index' |
| | | const redirectRoute = `${loginRoute}?redirect=${encodeURIComponent(url)}` |
| | | uni.navigateTo({ url: redirectRoute }) |
| | | reject(res) |
| | | } else { |
| | | // å
¶ä»é误 -> æ ¹æ®å端é误信æ¯è½»æç¤º |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: (res.data as IResData<T>).msg || '请æ±é误', |
| | | }) |
| | | reject(res) |
| | | } |
| | | } else if (res.statusCode === 401) { |
| | | // 401é误 -> æ¸
çç¨æ·ä¿¡æ¯ï¼è·³è½¬å°ç»å½é¡µ |
| | | // userStore.clearUserInfo() |
| | | // uni.navigateTo({ url: '/pages/login/login' }) |
| | | useAccessStore().clearAccessInfo() |
| | | useUserStore().clearUserInfo() |
| | | uni.navigateTo({ url: '/pages/login/index' }) |
| | | reject(res) |
| | | } else { |
| | | // å
¶ä»é误 -> æ ¹æ®å端é误信æ¯è½»æç¤º |
| | |
| | | title: 'ç½ç»éè¯¯ï¼æ¢ä¸ªç½ç»è¯è¯', |
| | | }) |
| | | reject(err) |
| | | uni.hideLoading() |
| | | }, |
| | | }) |
| | | }) |
| | |
| | | }) |
| | | } |
| | | |
| | | export const httpPut = <T>( |
| | | url: string, |
| | | data?: Record<string, any>, |
| | | query?: Record<string, any>, |
| | | ) => { |
| | | return http<T>({ |
| | | url, |
| | | query, |
| | | data, |
| | | method: 'PUT', |
| | | }) |
| | | } |
| | | |
| | | http.get = httpGet |
| | | http.post = httpPost |
| | | http.put = httpPut |
| | |
| | | VITE_SHOW_SOURCEMAP, |
| | | VITE_APP_PROXY, |
| | | VITE_APP_PROXY_PREFIX, |
| | | VITE_APP_CLIENT_ID, |
| | | } = env |
| | | console.log('ç¯å¢åé env -> ', env) |
| | | |
| | |
| | | { |
| | | title: 'ä¿å
»æ¶é´', |
| | | field: 'planTimeStr', |
| | | minWidth: 200 |
| | | minWidth: 200, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | // 夿æ¯å¦éè¦æ¾ç¤ºæ¶é´ |
| | | if (!row.type) return ''; |
| | | |
| | | // è·ååå§æ¶é´å符串 |
| | | const fullDate = row.planTimeStr; |
| | | |
| | | // æ ¹æ®æ¡ä»¶å³å®æ¾ç¤ºæ ¼å¼ |
| | | // ç¤ºä¾æ¡ä»¶ï¼å¦æ status æ¯æä¸ªç¹å®å¼ï¼ä¾å¦ 'monthly'ï¼ï¼åæ¾ç¤º YYYY-MM |
| | | if (row.type === 'Month') { |
| | | return fullDate.slice(0, 7); // æªåå 7 个å符ï¼å¾å° YYYY-MM |
| | | } |
| | | // é»è®¤æ¾ç¤ºå®æ´æ¥æ YYYY-MM-DD |
| | | return fullDate; |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: 'ç¶æ', |
| | |
| | | const monBtn = ref<any>('primary'); |
| | | |
| | | function queryData(type: ViewMode) { |
| | | // TODO æ¥è§å¾åæè§å¾å端已ç»ä¸æ¹æ³ å端å¯å 餿¥è§å¾å¤ä½é
ç½® |
| | | if (type === ViewMode.Day) { |
| | | dayBtn.value = 'primary'; |
| | | monBtn.value = 'default'; |
| | | curViewMode.value = ViewMode.Day; |
| | | tableApi.setGridOptions(gridOptions2); |
| | | // tableApi.setGridOptions(gridOptions2); |
| | | } else if (type === ViewMode.Month) { |
| | | dayBtn.value = 'default'; |
| | | monBtn.value = 'primary'; |
| | | curViewMode.value = ViewMode.Month; |
| | | tableApi.setGridOptions(gridOptions); |
| | | // tableApi.setGridOptions(gridOptions); |
| | | } |
| | | tableApi.query(); |
| | | } |
| | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="flex h-full gap-[8px] flex-col"> |
| | | <BasicTable class="h-2/3" table-title="ç¹æ£è®°å½å表"> |
| | | <BasicTable class="h-2/3" table-title="ç¹æ£æ±æ»å表"> |
| | | <template #toolbar-tools> |
| | | <Space> |
| | | <Button :type="dayBtn" @click.stop="queryData(ViewMode.Day)">æ¥è§å¾</Button> |
| | |
| | | <ghost-button v-access:code="['eims:inspectSt:edit']" @click.stop="handleEdit(row)"> |
| | | {{ $t('pages.common.edit') }} |
| | | </ghost-button> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" |
| | | @confirm="handleDelete(row)"> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" @confirm="handleDelete(row)"> |
| | | <ghost-button danger v-access:code="['eims:inspectSt:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | |
| | | </Space> |
| | | </template> |
| | | </BasicTable> |
| | | <BasisSubTable :columns="recordCol" :list-api="listInspStRecord" :req-value="recordId" class="h-1/3" |
| | | req-key="inspCode" title="ç¹æ£è®°å½" /> |
| | | <BasisSubTable :columns="recordCol" :list-api="listInspStRecord" :req-value="recordId" class="h-1/3" req-key="inspCode" title="ç¹æ£è®°å½" /> |
| | | </div> |
| | | <InspStDrawer @reload="tableApi.query()" /> |
| | | </Page> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | import org.dromara.common.core.utils.DateUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.eims.domain.bo.EimsMaintOrderBo; |
| | | import org.dromara.eims.domain.bo.InspectRecordBo; |
| | | import org.dromara.eims.domain.vo.EimsMaintOrderVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | Map<String, Object> params = bo.getParams(); |
| | | params.put("beginPlanTime",startOfMonth); |
| | | params.put("endPlanTime",endOfMonth); |
| | | params.put("type","Month"); |
| | | } |
| | | return eimsInspectRecordService.queryPageListCustom(bo, pageQuery); |
| | | } |
| | |
| | | return toAjax(eimsInspectRecordService.updateByBo(bo)); |
| | | } |
| | | |
| | | @SaCheckPermission("eims:inspectRecord:edit") |
| | | @Log(title = "ç¹æ£è®°å½-æ¹éä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping("editBatch") |
| | | public R<Void> editBatch(@Validated(EditGroup.class) @RequestBody InspectRecordBo bo) { |
| | | return toAjax(eimsInspectRecordService.updateBatchByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç¹æ£è®°å½ |
| | | * |
| | |
| | | */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | | /** |
| | | * æ±æ»ç±»å Day-æ¥æ±æ» Month-ææ±æ» |
| | | */ |
| | | private String type; |
| | | |
| | | /** |
| | | * æ é¢ |
| | |
| | | */ |
| | | @NotNull(message = "ä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long id; |
| | | /** |
| | | * æ±æ»ç±»å Day-æ¥æ±æ» Month-ææ±æ» |
| | | */ |
| | | private String type; |
| | | |
| | | /** |
| | | * æ é¢ |
| | | */ |
| | | @NotBlank(message = "æ é¢ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String title; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | @NotNull(message = "设å¤idä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long equId; |
| | | private String equName; |
| | | private String assetNo; |
| | |
| | | /** |
| | | * è®¡åæ¶é´ |
| | | */ |
| | | @NotNull(message = "è®¡åæ¶é´ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Date planTime; |
| | | |
| | | /** |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class InspectRecordBo { |
| | | /** |
| | | * ç§»å¨ç«¯æ¹éæ´æ° |
| | | */ |
| | | private List<EimsInspectRecordBo> inspRecordList; |
| | | } |
| | |
| | | */ |
| | | @ExcelProperty(value = "æ é¢") |
| | | private String title; |
| | | |
| | | /** |
| | | * æ±æ»ç±»å Day-æ¥æ±æ» Month-ææ±æ» |
| | | */ |
| | | private String type; |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | |
| | | */ |
| | | public interface EimsInspectRecordMapper extends BaseMapperPlus<EimsInspectRecord, EimsInspectRecordVo> { |
| | | Page<EimsInspectRecordVo> selectInspRecordList(@Param("page") Page<EimsInspectRecordVo> page, @Param(Constants.WRAPPER) Wrapper<EimsInspectRecord> queryWrapper); |
| | | // TODO æ¥è§å¾åæè§å¾ç»ä¸æ¥å£ï¼å¾
å é¤ |
| | | Page<EimsInspectStVo> selectInspRecordDayList(@Param("page") Page<EimsInspectStVo> page, @Param(Constants.WRAPPER) Wrapper<EimsInspectSt> queryWrapper); |
| | | |
| | | } |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | import org.dromara.eims.domain.bo.EimsInspectStBo; |
| | | import org.dromara.eims.domain.bo.InspectRecordBo; |
| | | import org.dromara.eims.domain.vo.EimsInspectRecordVo; |
| | | import org.dromara.eims.domain.bo.EimsInspectRecordBo; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | Boolean updateByBo(EimsInspectRecordBo bo); |
| | | Boolean updateBatchByBo(InspectRecordBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤ç¹æ£è®°å½ä¿¡æ¯ |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import lombok.SneakyThrows; |
| | | import org.dromara.common.core.constant.DictConstants; |
| | | import org.dromara.common.core.domain.model.LoginUser; |
| | | import org.dromara.common.core.utils.DateUtils; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.dromara.common.satoken.utils.LoginHelper; |
| | | import org.dromara.eims.domain.EimsInspectPlan; |
| | | import org.dromara.eims.domain.EimsInspectSt; |
| | | import org.dromara.eims.domain.EimsMaintPlan; |
| | | import org.dromara.eims.domain.bo.EimsInspectStBo; |
| | | import org.dromara.eims.domain.bo.InspectRecordBo; |
| | | import org.dromara.eims.domain.vo.EimsInspectStVo; |
| | | import org.dromara.eims.domain.vo.EimsMaintOrderVo; |
| | | import org.dromara.eims.mapper.EimsInspectPlanMapper; |
| | |
| | | return baseMapper.updateById(update) > 0; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean updateBatchByBo(InspectRecordBo bo) { |
| | | LoginUser loginUser = LoginHelper.getLoginUser(); |
| | | List<EimsInspectRecord> inspRecordList = MapstructUtils.convert(bo.getInspRecordList(), EimsInspectRecord.class); |
| | | inspRecordList.forEach(item->{ |
| | | // æ´æ°ä¸ºå·²ç¹æ£ |
| | | item.setStatus(DictConstants.EIMS_INSPECT_STATUS_DETAIL.Y); |
| | | item.setInspTime(new Date()); |
| | | item.setInspUser(loginUser.getUserId()); |
| | | }); |
| | | return baseMapper.updateBatchById(inspRecordList); |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | */ |
| | |
| | | import org.dromara.eims.service.IEimsInspectStService; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.ZoneId; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.*; |
| | |
| | | */ |
| | | @Override |
| | | public TableDataInfo<EimsInspectStVo> queryPageList(EimsInspectStBo bo, PageQuery pageQuery) { |
| | | bo.setType(bo.getViewMode()); |
| | | // æè§å¾ |
| | | if(bo.getViewMode().equals("Month")){ |
| | | // if(bo.getViewMode().equals("Month")){ |
| | | QueryWrapper<EimsInspectSt> qw = buildWrapper(bo); |
| | | Page<EimsInspectStVo> result = baseMapper.selectInspStList(pageQuery.build(), qw); |
| | | // å¡«å
æ°æ® |
| | | fillStData(result); |
| | | fillStData(result,bo.getViewMode()); |
| | | return TableDataInfo.build(result); |
| | | // æ¥è§å¾ |
| | | }else if(bo.getViewMode().equals("Day")){ |
| | | Page<EimsInspectStVo> result = recordMapper.selectInspRecordDayList(pageQuery.build(), buildGroupWrapper(bo)); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | // }else if(bo.getViewMode().equals("Day")){ |
| | | // Page<EimsInspectStVo> result = recordMapper.selectInspRecordDayList(pageQuery.build(), buildGroupWrapper(bo)); |
| | | // return TableDataInfo.build(result); |
| | | // } |
| | | |
| | | return null; |
| | | // return null; |
| | | } |
| | | |
| | | private void fillStData(Page<EimsInspectStVo> result) { |
| | | /** |
| | | * |
| | | * @param result |
| | | * @param type Day-æ¥è§å¾ Month-æè§å¾ |
| | | */ |
| | | private void fillStData(Page<EimsInspectStVo> result,String type) { |
| | | List<EimsInspectStVo> records = result.getRecords(); |
| | | for (int i = 0; i < records.size(); i++) { |
| | | EimsInspectStVo stVo = records.get(i); |
| | |
| | | LambdaQueryWrapper<EimsInspectRecord> recordLqw = Wrappers.lambdaQuery(); |
| | | recordLqw.eq(EimsInspectRecord::getEquId, stVo.getEquId()); |
| | | LocalDate planTime = stVo.getPlanTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
| | | // æè§å¾æ¥è¯¢èå´ |
| | | LocalDate startOfMonth = planTime.with(TemporalAdjusters.firstDayOfMonth()); |
| | | LocalDate endOfMonth = planTime.with(TemporalAdjusters.lastDayOfMonth()); |
| | | recordLqw.between(EimsInspectRecord::getPlanTime, startOfMonth, endOfMonth); |
| | | |
| | | // æ¥è§å¾æ¥è¯¢èå´ |
| | | if(type.equals("Day")){ |
| | | recordLqw.between(EimsInspectRecord::getPlanTime, planTime, planTime); |
| | | }else { |
| | | // æè§å¾æ¥è¯¢èå´ |
| | | recordLqw.between(EimsInspectRecord::getPlanTime, startOfMonth, endOfMonth); |
| | | } |
| | | |
| | | |
| | | // æ§è¡æ¥è¯¢ |
| | | List<EimsInspectRecordVo> recordList = recordMapper.selectVoList(recordLqw); |
| | | // TODO æ ¹æ®åå
¸eims_inspect_status |
| | |
| | | // TODO æ ¹æ®åå
¸eims_inspect_result |
| | | Map<String, Long> rMap = recordList.stream() |
| | | .filter(order ->order.getInspResult()!=null && List.of("1", "2").contains(order.getInspResult())) |
| | | .collect(Collectors.groupingBy(EimsInspectRecordVo::getStatus, Collectors.counting())); |
| | | .collect(Collectors.groupingBy(EimsInspectRecordVo::getInspResult, Collectors.counting())); |
| | | |
| | | stVo.setRecordCount(recordList.size()); |
| | | stVo.setUnCheckCount(cMap.getOrDefault("0", 0L).intValue()); |
| | |
| | | qw.like(StringUtils.isNotBlank(bo.getTitle()), "st.title", bo.getTitle()); |
| | | qw.like(StringUtils.isNotBlank(bo.getEquName()), "equ.equ_name", bo.getEquName()); |
| | | qw.like(StringUtils.isNotBlank(bo.getAssetNo()), "equ.asset_no", bo.getAssetNo()); |
| | | qw.eq( "st.type", bo.getType()); |
| | | qw.between(params.get("beginPlanTime") != null && params.get("endPlanTime") != null, |
| | | "st.plan_time", params.get("beginPlanTime"), params.get("endPlanTime")); |
| | | qw.eq(bo.getInspUser() != null, "st.maint_user", bo.getInspUser()); |
| | |
| | | import org.dromara.common.satoken.utils.LoginHelper; |
| | | import org.dromara.eims.domain.EimsMaintPlan; |
| | | import org.dromara.eims.domain.bo.EimsMaintPlanBo; |
| | | import org.dromara.eims.domain.vo.EimsEquVo; |
| | | import org.dromara.eims.domain.vo.MaintOrdeGroupVo; |
| | | import org.dromara.eims.mapper.EimsEquMapper; |
| | | import org.dromara.eims.mapper.EimsMaintPlanMapper; |
| | | import org.dromara.system.domain.SysDept; |
| | | import org.dromara.system.domain.vo.SysDeptVo; |
| | |
| | | private final EimsMaintOrderMapper baseMapper; |
| | | private final EimsMaintPlanMapper planMapper; |
| | | private final SysDeptMapper sysDeptMapper; |
| | | private final EimsEquMapper equMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
Ȍᴌ |
| | |
| | | */ |
| | | @Override |
| | | public EimsMaintOrderVo queryById(Long id){ |
| | | return baseMapper.selectVoById(id); |
| | | EimsMaintOrderVo orderVo = baseMapper.selectVoById(id); |
| | | EimsEquVo equVo = equMapper.selectVoById(orderVo.getEquId()); |
| | | if(equVo!=null){ |
| | | orderVo.setEquName(equVo.getEquName()); |
| | | orderVo.setAssetNo(equVo.getAssetNo()); |
| | | } |
| | | return orderVo; |
| | | } |
| | | |
| | | /** |
| | |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |
| | | |
| | | |
| | | <!--TODO æ¥è§å¾åæè§å¾ç»ä¸æ¥å£ï¼å¾
å é¤--> |
| | | <select id="selectInspRecordDayList" resultMap="EimsInspectStVoResult"> |
| | | SELECT |
| | | MAX(ir.id) id, |
| | |
| | | <resultMap type="org.dromara.eims.domain.vo.EimsInspectStVo" id="MaintInspStVoResult"> |
| | | </resultMap> |
| | | <select id="selectInspStList" resultMap="MaintInspStVoResult"> |
| | | SELECT st.*,equ.equ_name equName,equ.asset_no assetNo, DATE_FORMAT(st.plan_time, '%Y-%m') as planTimeStr FROM eims_inspect_st st |
| | | SELECT st.*,equ.equ_name equName,equ.asset_no assetNo, DATE_FORMAT(st.plan_time, '%Y-%m-%d') as planTimeStr FROM eims_inspect_st st |
| | | LEFT JOIN eims_equ equ on st.equ_id = equ.equ_id |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |