| | |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/equ-status/list", |
| | | "type": "page" |
| | | }, |
| | | { |
| | | "path": "pages/fixture/fixture-list", |
| | | "type": "page", |
| | | "layout": "default", |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view class="bg-base"> |
| | | |
| | | <z-paging ref="paging" v-model="dataList" @query="queryList" class="bg-base"> |
| | | <template #top> |
| | | <wd-search v-model="searchValue" placeholder="设å¤åç§°/èµäº§ç¼å·" @search="reloadData" /> |
| | | <wd-tabs v-model="activeTab" @change="handleTabChange"> |
| | | <wd-tab title="å¾
确认"></wd-tab> |
| | | <wd-tab title="å·²åæ"></wd-tab> |
| | | <wd-tab title="已驳å"></wd-tab> |
| | | </wd-tabs> |
| | | </template> |
| | | <view v-for="item in dataList" :key="item.equStatuId" class="mb-2" > |
| | | <wd-card type="rectangle"> |
| | | <template #title> |
| | | <view class="flex justify-between items-center menu-title-box"> |
| | | <view class="flex items-center"> |
| | | <view class="menu-indicator"></view> |
| | | <text class="ml-1 text-sm">{{ item.equName || '-' }}</text> |
| | | <text class="ml-2 text-color-gray text-mini">{{ item.assetNo || '-' }}</text> |
| | | </view> |
| | | <wd-tag v-if="item.orderStatus === '0'" type="warning">å¾
确认</wd-tag> |
| | | <wd-tag v-else-if="item.orderStatus === '1'" type="success">å·²åæ</wd-tag> |
| | | <wd-tag v-else type="error">已驳å</wd-tag> |
| | | </view> |
| | | </template> |
| | | <view class="flex h-[200rpx] items-center"> |
| | | <image class="slot-img text-center" src="/static/images/camera.png" /> |
| | | <view class="flex-1"> |
| | | <view class="text-color-base mt-1">åæ´åï¼{{ statusText(item.beforeChange) }} â åæ´åï¼{{ statusText(item.afterChange) }}</view> |
| | | <view class="text-color-gray text-sm mt-1">åæ´åå ï¼{{ item.changeDesc }}</view> |
| | | <view class="text-color-gray text-sm mt-1">åæ´æ¶é´ï¼{{ item.changeDate || '-' }}</view> |
| | | <view class="text-color-gray text-sm mt-1">åæ´äººï¼{{ item.changeUserName || '-' }}</view> |
| | | <view v-if="item.orderStatus === '2' && item.remark" class="text-color-error text-sm mt-1">驳åçç±ï¼{{ item.remark }}</view> |
| | | </view> |
| | | <view v-if="item.orderStatus === '0' && isEquAdmin()" class="flex flex-col gap-2 ml-2"> |
| | | <wd-button size="small" type="success" @click="handleAgree(item)">åæ</wd-button> |
| | | <wd-button size="small" type="error" @click="openReject(item)">驳å</wd-button> |
| | | </view> |
| | | </view> |
| | | </wd-card> |
| | | </view> |
| | | </z-paging> |
| | | <wd-popup v-model="showReject" position="center" round :close-on-click-modal="false"> |
| | | <view class="popup-container"> |
| | | <view class="popup-title">å¡«å驳åçç±</view> |
| | | <wd-textarea v-model="rejectReason" placeholder="请è¾å
¥é©³åçç±" :maxlength="100" show-word-limit required /> |
| | | <view class="popup-actions"> |
| | | <wd-button block @click="showReject = false">åæ¶</wd-button> |
| | | <wd-button type="error" block class="ml-2" @click="handleRejectConfirm">ç¡®å®</wd-button> |
| | | </view> |
| | | </view> |
| | | </wd-popup> |
| | | </view> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import { ref } from 'vue' |
| | | import { getEquStatuList, updateEquStatu } from '@/service/equ_status' |
| | | import { useToast } from 'wot-design-uni' |
| | | import { isEquAdmin } from "@/utils/RoleUtils"; |
| | | const toast = useToast() |
| | | const searchValue = ref('') |
| | | const activeTab = ref(0) |
| | | const dataList = ref<any[]>([]) |
| | | const paging = ref() |
| | | const showReject = ref(false) |
| | | const rejectReason = ref('') |
| | | const rejectItem = ref<any>(null) |
| | | |
| | | const statusMap = [ |
| | | { label: 'è¯ç¨', value: '0' }, |
| | | { label: '使ç¨', value: '1' }, |
| | | { label: 'åç¨', value: '2' }, |
| | | { label: 'æ¥åº', value: '3' }, |
| | | { label: 'é²ç½®', value: '4' }, |
| | | { label: 'æ°å¢', value: '5' }, |
| | | ] |
| | | function statusText(val: string) { |
| | | return statusMap.find((s) => s.value === val)?.label || '-' |
| | | } |
| | | function handleTabChange({ index }) { |
| | | activeTab.value = index |
| | | reloadData() |
| | | } |
| | | function reloadData() { |
| | | paging.value.reload() |
| | | } |
| | | function queryList(pageNum?: number, pageSize?: number) { |
| | | const params: any = { |
| | | pageNum, |
| | | pageSize, |
| | | params: { |
| | | searchValue: searchValue.value, |
| | | }, |
| | | orderStatus: String(activeTab.value), |
| | | } |
| | | getEquStatuList(params).then((res: any) => { |
| | | paging.value.completeByTotal(res.rows, res.total) |
| | | }).catch(() => { |
| | | paging.value.complete(false) |
| | | }) |
| | | } |
| | | function handleAgree(item: any) { |
| | | updateEquStatu({ |
| | | equStatuId: item.equStatuId, |
| | | orderStatus: '1', |
| | | remark: '', |
| | | }).then(() => { |
| | | toast.success('æä½æå') |
| | | reloadData() |
| | | }) |
| | | } |
| | | function openReject(item: any) { |
| | | rejectItem.value = item |
| | | rejectReason.value = '' |
| | | showReject.value = true |
| | | } |
| | | function handleRejectConfirm() { |
| | | if (!rejectReason.value.trim()) { |
| | | toast.info('请填å驳åçç±') |
| | | return |
| | | } |
| | | updateEquStatu({ |
| | | equStatuId: rejectItem.value.equStatuId, |
| | | orderStatus: '2', |
| | | remark: rejectReason.value, |
| | | }).then(() => { |
| | | toast.success('已驳å') |
| | | showReject.value = false |
| | | reloadData() |
| | | }) |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .menu-title-box { |
| | | } |
| | | .slot-img { |
| | | width: 72rpx; |
| | | height: 72rpx; |
| | | margin-right: 24rpx; |
| | | } |
| | | .text-mini { |
| | | font-size: 24rpx; |
| | | } |
| | | .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; |
| | | } |
| | | .popup-container { |
| | | width: 600rpx; |
| | | background: #fff; |
| | | border-radius: 16rpx; |
| | | padding: 32rpx 24rpx 24rpx 24rpx; |
| | | } |
| | | .popup-title { |
| | | font-size: 32rpx; |
| | | font-weight: bold; |
| | | text-align: center; |
| | | margin-bottom: 24rpx; |
| | | } |
| | | .popup-actions { |
| | | display: flex; |
| | | margin-top: 24rpx; |
| | | gap: 16rpx; |
| | | } |
| | | </style> |
| | |
| | | <template #title> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <view class="ml-1 text-sm">设å¤ç®¡ç</view> |
| | | <view class="ml-1 text-sm">ç¹æ£ä¿å
»</view> |
| | | </view> |
| | | </template> |
| | | <wd-grid :column="4"> |
| | |
| | | <template #title> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <view class="ml-1 text-sm">å°è´¦ç¸å
³</view> |
| | | <view class="ml-1 text-sm">设å¤å°å¸</view> |
| | | </view> |
| | | </template> |
| | | <wd-grid :column="4"> |
| | |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: 'å·¥å
·å表', |
| | | icon: '/static/ico/ico16.png', |
| | | path: 'pages/fixture/fixture-list', |
| | | name: 'ç¶æåæ´è®°å½', |
| | | icon: '/static/ico/ico15.png', |
| | | path: 'pages/equ-status/list', |
| | | }, |
| | | // { |
| | | // id: 2, |
| | | // name: 'å·¥å
·å表', |
| | | // icon: '/static/ico/ico16.png', |
| | | // path: 'pages/fixture/fixture-list', |
| | | // }, |
| | | ]) |
| | | |
| | | const inspectMenu = reactive([ |
| | |
| | | <view class="text-color-gray text-sm mt-2 flex"> |
| | | <text>ç¶æï¼</text> |
| | | <template v-if="item.status === '1'"> |
| | | <wd-icon class="icon-color-success" name="check-outline" size="34rpx"></wd-icon> |
| | | <text class="ml-1">已宿</text> |
| | | <wd-icon class="icon-color-warning" name="check-outline" size="34rpx"></wd-icon> |
| | | <text class="ml-1">å¾
确认</text> |
| | | </template> |
| | | <template v-else-if="item.status === '2'"> |
| | | <wd-icon class="icon-color-warning" name="check-outline" size="34rpx"></wd-icon> |
| | | <text class="ml-1">已确认</text> |
| | | <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> |
| | |
| | | <view class="text-color-gray text-sm mt-2 flex"> |
| | | <text>ç¶æï¼</text> |
| | | <template v-if="item.status === '1'"> |
| | | <wd-icon class="icon-color-success" name="check-outline" size="34rpx"></wd-icon> |
| | | <text class="ml-1">已宿</text> |
| | | <wd-icon class="icon-color-warning" name="check-outline" size="34rpx"></wd-icon> |
| | | <text class="ml-1">å¾
确认</text> |
| | | </template> |
| | | <template v-else-if="item.status === '2'"> |
| | | <wd-icon class="icon-color-warning" name="check-outline" size="34rpx"></wd-icon> |
| | | <text class="ml-1">已确认</text> |
| | | <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> |
| | |
| | | </view> |
| | | <!-- 维修说æåºå --> |
| | | <view class="mt-2 flex justify-end"> |
| | | <wd-button type="success" style="margin: 20px" @click.stop="addSparePart()"> |
| | | <wd-button type="info" style="margin: 20px" @click.stop="addSparePart()"> |
| | | æ·»å å¤ä»¶ |
| | | </wd-button> |
| | | </view> |
| | | <view class="h-[2px] w-full bg-base"></view> |
| | | </wd-cell-group> |
| | | </wd-form> |
| | | <!-- <wd-button style="margin: 20px" block @click="handleClickRight">æäº¤</wd-button>--> |
| | | <view class="h-[20px] w-full bg-base"></view> |
| | | <view class="h-[5px] w-full bg-base"></view> |
| | | <view class=" flex justify-around py-4"> |
| | | <wd-button block @click="saveOrder">ä¿å</wd-button> |
| | | <wd-button type="success" block @click="submitOrder">æäº¤</wd-button> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- å¤ä»¶éæ©å¼¹åºå± --> |
| | |
| | | function handleClickRight(data: any) { |
| | | message |
| | | .confirm({ |
| | | msg: 'ç¡®å®æäº¤ï¼', |
| | | msg: 'ç¡®å®' + (data.status === '3' ? 'æäº¤' : 'ä¿å') + 'ï¼', |
| | | title: 'æç¤º', |
| | | beforeConfirm: ({ resolve }) => { |
| | | hanldeUpdateRepairRes(data, resolve) |
| | |
| | | }) |
| | | } |
| | | |
| | | function submitOrder() { |
| | | const data = Object.assign({}, repairRes) |
| | | // æäº¤ä¿®æ¹ç¶æä¸ºå®æ |
| | | data.status = '3' |
| | | // è®¾ç½®ç»´ä¿®å®ææ¶é´ |
| | | data.endTime = formatDate(new Date()) |
| | | handleClickRight(data) |
| | | } |
| | | |
| | | function saveOrder() { |
| | | const data = Object.assign({}, repairRes) |
| | | // ä»
ä¿åä¸ä¿®æ¹ç¶æä¸ºå®æ |
| | | data.status = '2' |
| | | // ä»
ä¿åä¸è®¾ç½®å®ææ¶é´ |
| | | data.endTime = '' |
| | | handleClickRight(data) |
| | | } |
| | | |
| | | onNavigationBarButtonTap((e) => { |
| | | if (e.index === 0) { |
| | | // 管çåè§è² |
| | |
| | | <wd-tag v-else-if="model.status === '2'" class="ml-2" type="danger">åç¨</wd-tag> |
| | | <wd-tag v-else-if="model.status === '3'" class="ml-2" bg-color="pink">æ¥åº</wd-tag> |
| | | <wd-tag v-else-if="model.status === '4'" class="ml-2" type="warning">é²ç½®</wd-tag> |
| | | <wd-tag v-else-if="model.status === '5'" class="ml-2">æ°å¢</wd-tag> |
| | | <wd-tag v-else class="ml-2">æ°å¢</wd-tag> |
| | | </view> |
| | | |
| | | <view @click="handleInfo"> |
| | | <text class="icon-color-base">详æ
</text> |
| | | <text class="icon-color-base">ç¶æåæ´</text> |
| | | <wd-icon name="arrow-right" custom-class="icon-color-base"></wd-icon> |
| | | </view> |
| | | </view> |
| | |
| | | @select="select" |
| | | cancel-text="åæ¶" |
| | | /> |
| | | |
| | | <wd-popup v-model="showStatusDialog" position="center" round :close-on-click-modal="false"> |
| | | <view class="popup-container"> |
| | | <view class="popup-title">设å¤ç¶æåæ´</view> |
| | | <view class="flex flex-wrap justify-between mb-4"> |
| | | <view |
| | | v-for="item in statusOptions" |
| | | :key="item.value" |
| | | :class="['status-option', selectedStatus === item.value ? 'active' : '']" |
| | | @click="selectStatus(item.value)" |
| | | > |
| | | {{ item.label }} |
| | | </view> |
| | | </view> |
| | | <wd-textarea |
| | | v-model="changeReason" |
| | | placeholder="请è¾å
¥åæ´åå " |
| | | :maxlength="100" |
| | | show-word-limit |
| | | required |
| | | /> |
| | | <view class="popup-actions"> |
| | | <wd-button block @click="handleStatusChangeCancel">åæ¶</wd-button> |
| | | <wd-button type="primary" block class="ml-2" @click="handleStatusChangeConfirm">ç¡®å®</wd-button> |
| | | </view> |
| | | </view> |
| | | </wd-popup> |
| | | </view> |
| | | <view v-else> |
| | | <wd-status-tip image="search" tip="å½åæç´¢æ ç»æ" /> |
| | |
| | | import ReqCard from '@/components/repair/req-card.vue' |
| | | import ResCard from '@/components/repair/res-card.vue' |
| | | import { useUserStore } from '@/store' |
| | | import { addEquStatu } from '@/service/equ_status' |
| | | import type { EimsEquStatuBo } from '@/service/equ_status.d' |
| | | const tab = ref<number>(0) |
| | | const message = useMessage() |
| | | const toast = useToast() |
| | |
| | | name: 'å»ç»´ä¿®', |
| | | }, |
| | | ]) |
| | | const showStatusDialog = ref(false) |
| | | const selectedStatus = ref<string>('') |
| | | const changeReason = ref<string>('') |
| | | const statusOptions = [ |
| | | { label: 'è¯ç¨', value: '0' }, |
| | | { label: '使ç¨', value: '1' }, |
| | | { label: 'åç¨', value: '2' }, |
| | | { label: 'æ¥åº', value: '3' }, |
| | | { label: 'é²ç½®', value: '4' }, |
| | | { label: 'æ°å¢', value: '5' }, |
| | | ] |
| | | |
| | | function initData(assetNo: any) { |
| | | getEquByAssetNo(assetNo) |
| | |
| | | } |
| | | |
| | | function handleInfo() { |
| | | uni.showToast({ |
| | | title: 'åè½å¼åä¸', |
| | | icon: 'none', |
| | | }) |
| | | if (!model?.equId) { |
| | | uni.showToast({ title: 'æªæ¥è¯¢å°è®¾å¤ï¼è¯·è系管çåï¼', icon: 'none' }) |
| | | return |
| | | } |
| | | console.log("model::",model) |
| | | selectedStatus.value = model.status || '5' |
| | | changeReason.value = '' |
| | | showStatusDialog.value = true |
| | | } |
| | | |
| | | function handleInsp() { |
| | |
| | | break |
| | | } |
| | | } |
| | | ;`/pages/repair/req-list`, |
| | | // å¤ç维修请æ±ç¹å»äºä»¶ |
| | | function handleReqClick(item) { |
| | | uni.navigateTo({ |
| | | url: `/pages/repair/req-detail?id=${item.id}`, |
| | | }) |
| | | } |
| | | |
| | | // // å¤çç»´ä¿®åç¹å»äºä»¶ |
| | | // function handleResClick(item) { |
| | | // uni.navigateTo({ |
| | | // url: `/pages/repair/res-detail?id=${item.id}`, |
| | | // }) |
| | | // } |
| | | // å¤ç维修请æ±ç¹å»äºä»¶ |
| | | function handleReqClick(item) { |
| | | uni.navigateTo({ |
| | | url: `/pages/repair/req-detail?id=${item.id}`, |
| | | }) |
| | | } |
| | | |
| | | defineExpose({ handleReqClick }) |
| | | |
| | | function selectStatus(val: string) { |
| | | selectedStatus.value = val |
| | | } |
| | | |
| | | function handleStatusChangeCancel() { |
| | | showStatusDialog.value = false |
| | | } |
| | | |
| | | async function handleStatusChangeConfirm() { |
| | | if (!selectedStatus.value) { |
| | | uni.showToast({ title: 'è¯·éæ©è®¾å¤ç¶æ', icon: 'none' }) |
| | | return |
| | | } |
| | | if (!changeReason.value.trim()) { |
| | | uni.showToast({ title: '请填ååæ´åå ', icon: 'none' }) |
| | | return |
| | | } |
| | | const params: EimsEquStatuBo = { |
| | | equId: model.equId, |
| | | beforeChange: model.status, |
| | | afterChange: selectedStatus.value, |
| | | changeDesc: changeReason.value, |
| | | orderStatus: '0', |
| | | } |
| | | try { |
| | | await addEquStatu(params) |
| | | uni.showToast({ title: 'æäº¤æåï¼å¾
管çå确认', icon: 'success' }) |
| | | showStatusDialog.value = false |
| | | // å¯éï¼å·æ°è®¾å¤ä¿¡æ¯ |
| | | initData(model.assetNo) |
| | | } catch (e) { |
| | | uni.showToast({ title: 'æäº¤å¤±è´¥', icon: 'none' }) |
| | | } |
| | | } |
| | | |
| | | onLoad((options) => { |
| | | uni.$on('list-refresh', loadRepairData) |
| | |
| | | :deep(.wd-card__title-content) { |
| | | padding: 16rpx 0 !important; |
| | | } |
| | | .status-option { |
| | | display: inline-block; |
| | | padding: 10rpx 24rpx; |
| | | margin: 8rpx 8rpx 8rpx 0; |
| | | border-radius: 8rpx; |
| | | border: 1px solid #eee; |
| | | background: #f7f7f7; |
| | | color: #666; |
| | | cursor: pointer; |
| | | } |
| | | .status-option.active { |
| | | background: $uni-color-primary; |
| | | color: #fff; |
| | | border-color: $uni-color-primary; |
| | | } |
| | | .popup-container { |
| | | width: 600rpx; |
| | | background: #fff; |
| | | border-radius: 16rpx; |
| | | padding: 32rpx 24rpx 24rpx 24rpx; |
| | | } |
| | | .popup-title { |
| | | font-size: 32rpx; |
| | | font-weight: bold; |
| | | text-align: center; |
| | | margin-bottom: 24rpx; |
| | | } |
| | | .popup-actions { |
| | | display: flex; |
| | | margin-top: 24rpx; |
| | | gap: 16rpx; |
| | | justify-content: space-around; |
| | | } |
| | | </style> |
| | |
| | | export const getEquByAssetNo = (assetNo: string) => { |
| | | return http.get<EquVO>(`/eims/equ/info/${assetNo}`) |
| | | } |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface EimsEquStatuVO { |
| | | /** |
| | | * 设å¤ç¶æè®°å½id |
| | | */ |
| | | equStatuId?: number | string; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | equId?: number | string; |
| | | |
| | | /** |
| | | * åæ´åç¶æ |
| | | */ |
| | | beforeChange?: string; |
| | | |
| | | /** |
| | | * åæ´åç¶æ |
| | | */ |
| | | afterChange?: string; |
| | | |
| | | /** |
| | | * åæ´æ¥æ |
| | | */ |
| | | changeDate?: string; |
| | | |
| | | /** |
| | | * åæ´äºº |
| | | */ |
| | | changeUser?: number | string; |
| | | |
| | | /** |
| | | * åæ´äººé¨é¨ |
| | | */ |
| | | userDept?: number | string; |
| | | |
| | | /** |
| | | * åæ´æè¿° |
| | | */ |
| | | changeDesc?: string; |
| | | |
| | | /** |
| | | * æè¿° |
| | | */ |
| | | remark?: string; |
| | | |
| | | /** |
| | | * 确认人 |
| | | */ |
| | | confirmor?: number | string; |
| | | |
| | | /** |
| | | * åæ´åç¶æï¼0-ç³è¯·ï¼1-åæï¼2-驳åï¼ |
| | | */ |
| | | orderStatus?: string; |
| | | } |
| | | |
| | | export interface EimsEquStatuBo { |
| | | /** |
| | | * 设å¤ç¶æè®°å½id |
| | | */ |
| | | equStatuId?: number | string; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | equId?: number | string; |
| | | |
| | | /** |
| | | * åæ´åç¶æ |
| | | */ |
| | | beforeChange?: string; |
| | | |
| | | /** |
| | | * åæ´åç¶æ |
| | | */ |
| | | afterChange?: string; |
| | | |
| | | /** |
| | | * åæ´æ¥æ |
| | | */ |
| | | changeDate?: string; |
| | | |
| | | /** |
| | | * åæ´æè¿° |
| | | */ |
| | | changeDesc?: string; |
| | | |
| | | /** |
| | | * æè¿° |
| | | */ |
| | | remark?: string; |
| | | |
| | | /** |
| | | * åæ´åç¶æï¼0-ç³è¯·ï¼1-åæï¼2-驳åï¼ |
| | | */ |
| | | orderStatus?: string; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { http } from '@/utils/http' |
| | | import type { EimsEquStatuVO, EimsEquStatuBo } from './equ_status.d' |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤ç¶æè®°å½å表 |
| | | */ |
| | | export const getEquStatuList = (params: EimsEquStatuBo & { pageNum?: number; pageSize?: number }) => { |
| | | return http.get<{ rows: EimsEquStatuVO[], total: number }>('/eims/equStatu/list', params) |
| | | } |
| | | |
| | | /** |
| | | * è·å设å¤ç¶æè®°å½è¯¦ç»ä¿¡æ¯ |
| | | * @param equStatuId ä¸»é® |
| | | */ |
| | | export const getEquStatuInfo = (equStatuId: number | string) => { |
| | | return http.get<EimsEquStatuVO>(`/eims/equStatu/${equStatuId}`) |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤ç¶æè®°å½ |
| | | */ |
| | | export const addEquStatu = (data: EimsEquStatuBo) => { |
| | | return http.post('/eims/equStatu', data) |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¾å¤ç¶æè®°å½ |
| | | */ |
| | | export const updateEquStatu = (data: EimsEquStatuBo) => { |
| | | return http.put('/eims/equStatu', data) |
| | | } |
| | | |
| | | /** |
| | | * å é¤è®¾å¤ç¶æè®°å½ |
| | | * @param equStatuIds 主é®ä¸² |
| | | */ |
| | | export const deleteEquStatu = (equStatuIds: (number | string)[]) => { |
| | | return http.delete(`/eims/equStatu/${equStatuIds.join(',')}`) |
| | | } |
| | | |
| | | /** |
| | | * 导åºè®¾å¤ç¶æè®°å½å表 |
| | | */ |
| | | export const exportEquStatu = (params: EimsEquStatuBo) => { |
| | | return http.post('/eims/equStatu/export', params, { |
| | | responseType: 'blob' |
| | | }) |
| | | } |
| | |
| | | url: "/pages/home/index" | |
| | | "/pages/equ/equ-list" | |
| | | "/pages/equ/index" | |
| | | "/pages/equ-status/list" | |
| | | "/pages/fixture/fixture-list" | |
| | | "/pages/inspect/insp-add" | |
| | | "/pages/inspect/insp-record" | |
| | |
| | | "/pages/maint/maint-st" | |
| | | "/pages/maint/order-detail" | |
| | | "/pages/my/index" | |
| | | "/pages/my/password" | |
| | | "/pages/repair/repair-add" | |
| | | "/pages/repair/repair-fb" | |
| | | "/pages/repair/req-detail" | |
| | |
| | | * @author Lion Li |
| | | */ |
| | | |
| | | @SpringBootApplication(scanBasePackages={"org.dromara", "cn.shlanbao"}) |
| | | @SpringBootApplication(scanBasePackages={"org.dromara"}) |
| | | public class DromaraApplication { |
| | | |
| | | public static void main(String[] args) { |
| | |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 确认人 |
| | | */ |
| | | private Long confirmor; |
| | | |
| | | /** |
| | | * åæ´åç¶æï¼0-ç³è¯·ï¼1-åæï¼2-驳åï¼ |
| | | */ |
| | | private String orderStatus; |
| | | |
| | | |
| | | } |
| | |
| | | /** |
| | | * åæ´æè¿° |
| | | */ |
| | | @NotBlank(message = "åæ´æè¿°ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String changeDesc; |
| | | |
| | | /** |
| | |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 确认人 |
| | | */ |
| | | private Long confirmor; |
| | | |
| | | /** |
| | | * åæ´åç¶æï¼0-ç³è¯·ï¼1-åæï¼2-驳åï¼ |
| | | */ |
| | | private String orderStatus; |
| | | } |
| | |
| | | /** |
| | | * 设å¤åç§° |
| | | */ |
| | | @Translation(type = TransConstant.EQU_ID_TO_NAME, mapper = "equId") |
| | | private String equName; |
| | | |
| | | |
| | | private String assetNo; |
| | | |
| | | /** |
| | | * åæ´åç¶æ |
| | |
| | | private String remark; |
| | | |
| | | |
| | | /** |
| | | * 确认人 |
| | | */ |
| | | private Long confirmor; |
| | | |
| | | |
| | | @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "confirmor") |
| | | private String confirmorName; |
| | | |
| | | /** |
| | | * åæ´åç¶æï¼0-ç³è¯·ï¼1-åæï¼2-驳åï¼ |
| | | */ |
| | | private String orderStatus; |
| | | |
| | | |
| | | } |
| | |
| | | import com.aizuda.snailjob.client.job.core.dto.JobArgs; |
| | | import com.aizuda.snailjob.client.model.ExecuteResult; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | |
| | | @SneakyThrows |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ExecuteResult jobExecute(JobArgs jobArgs) { |
| | | // è·åä»å¤©æ¥æ |
| | | |
| | | Date today = new Date(); |
| | | LambdaQueryWrapper<EimsInspectPlan> planBoQueryWrapper = Wrappers.lambdaQuery(); |
| | | QueryWrapper<EimsInspectPlan> planBoQueryWrapper = Wrappers.query(); |
| | | // æ¥è¯¢å¯ç¨çç¹æ£è®¡å |
| | | planBoQueryWrapper.eq(EimsInspectPlan::getStatus, DictConstants.SYS_NORMAL_DISABLE_DETAIL.NORMAL); |
| | | planBoQueryWrapper.eq("ip.status", DictConstants.SYS_NORMAL_DISABLE_DETAIL.NORMAL) |
| | | .eq("equ.status", DictConstants.EIMS_EQU_STATUS_DETAIL.SHIYONG); |
| | | // å¢å è¿æ»¤æ¡ä»¶ 䏿¬¡çææ¥æå°äºå½åæ¥æ |
| | | planBoQueryWrapper.and(wrapper -> wrapper.eq("ip.insp_next_time", DateUtils.getDate()).or().isNull("ip.insp_next_time")); |
| | | // // è¿æ»¤æ²¡æä¸æ¬¡è¿è¡æ¶é´ |
| | | // planBoQueryWrapper.isNotNull(EimsInspectPlan::getInspNextTime); |
| | | // // è¿æ»¤æ²¡æç¹æ£å¨æçæ°æ® |
| | | // planBoQueryWrapper.isNotNull(EimsInspectPlan::getInspCycle); |
| | | // planBoQueryWrapper.isNotNull(EimsInspectPlan::getInspCycleUnit); |
| | | |
| | | List<EimsInspectPlanVo> planVoList = planMapper.selectVoList(planBoQueryWrapper); |
| | | List<EimsInspectPlanVo> planVoList = planMapper.selectVoListJoinEqu(planBoQueryWrapper); |
| | | for (int i = 0; i < planVoList.size(); i++) { |
| | | EimsInspectPlanVo planVo = planVoList.get(i); |
| | | // // ç¹æ£è®¡åaddçæ¶åä¼èªå¨çæä¸æ¬¡è¿è¡æ¶é´ |
| | |
| | | import com.aizuda.snailjob.client.job.core.dto.JobArgs; |
| | | import com.aizuda.snailjob.client.model.ExecuteResult; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | |
| | | // è·åä»å¤©æ¥æ |
| | | |
| | | Date today = new Date(); |
| | | LambdaQueryWrapper<EimsMaintPlan> planBoQueryWrapper = Wrappers.lambdaQuery(); |
| | | QueryWrapper<EimsMaintPlan> planBoQueryWrapper = Wrappers.query(); |
| | | // æ¥è¯¢å¯ç¨çä¿å
»è®¡å |
| | | planBoQueryWrapper.eq(EimsMaintPlan::getStatus, DictConstants.SYS_NORMAL_DISABLE_DETAIL.NORMAL); |
| | | // è¿æ»¤æ²¡æä¸æ¬¡è¿è¡æ¶é´ |
| | | planBoQueryWrapper.isNotNull(EimsMaintPlan::getMaintNextTime); |
| | | // è¿æ»¤æ²¡æä¿å
»å¨æçæ°æ® |
| | | planBoQueryWrapper.isNotNull(EimsMaintPlan::getMaintCycle); |
| | | planBoQueryWrapper.isNotNull(EimsMaintPlan::getMaintCycleUnit); |
| | | planBoQueryWrapper.isNotNull(EimsMaintPlan::getMaintRule); |
| | | |
| | | List<EimsMaintPlanVo> planVoList = planMapper.selectVoList(planBoQueryWrapper); |
| | | planBoQueryWrapper.eq("mp.status", DictConstants.SYS_NORMAL_DISABLE_DETAIL.NORMAL); |
| | | planBoQueryWrapper .eq("equ.status", DictConstants.EIMS_EQU_STATUS_DETAIL.SHIYONG); |
| | | // è¿æ»¤ä¸æ¬¡è¿è¡æ¶é´çäºå½å¤©æ¶é´ç |
| | | planBoQueryWrapper.eq("mp.maint_next_time", DateUtils.getDate()); |
| | | // è¿æ»¤æ²¡æä¿å
»å¨æçæ°æ® |
| | | planBoQueryWrapper.isNotNull("mp.maint_cycle"); |
| | | planBoQueryWrapper.isNotNull("mp.maint_cycle_unit"); |
| | | planBoQueryWrapper.isNotNull("mp.maint_rule"); |
| | | |
| | | List<EimsMaintPlanVo> planVoList = planMapper.selectVoListJoinEqu(planBoQueryWrapper); |
| | | for (int i = 0; i < planVoList.size(); i++) { |
| | | EimsMaintPlanVo planVo = planVoList.get(i); |
| | | // ä¿å
»è®¡åaddçæ¶åä¼èªå¨çæä¸æ¬¡è¿è¡æ¶é´ |
| | |
| | | |
| | | // 计ç®çæå·¥åæ¶é´ |
| | | Long maintCycle = planVo.getMaintCycle(); |
| | | String maintRule = planVo.getMaintRule(); |
| | | Date firstTime = planVo.getMaintFirstTime(); |
| | | Date lastTime = planVo.getMaintLastTime(); |
| | | Date newNext = null; |
| | | String maintCycleUnit = planVo.getMaintCycleUnit(); |
| | | switch (maintCycleUnit) { |
| | |
| | | package org.dromara.eims.mapper; |
| | | |
| | | import org.dromara.eims.domain.EimsEquStatu; |
| | | import org.dromara.eims.domain.bo.EimsEquStatuBo; |
| | | import org.dromara.eims.domain.vo.EimsEquStatuVo; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 设å¤ç¶æè®°å½Mapperæ¥å£ |
| | |
| | | */ |
| | | public interface EimsEquStatuMapper extends BaseMapperPlus<EimsEquStatu, EimsEquStatuVo> { |
| | | |
| | | List<EimsEquStatuVo> selectEquStatuPage(@Param("bo") EimsEquStatuBo bo, @Param("pageQuery") PageQuery pageQuery); |
| | | |
| | | } |
| | |
| | | package org.dromara.eims.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | import org.dromara.eims.domain.EimsInspectPlan; |
| | | import org.dromara.eims.domain.vo.EimsInspectPlanVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¹æ£è®¡åMapperæ¥å£ |
| | |
| | | */ |
| | | public interface EimsInspectPlanMapper extends BaseMapperPlus<EimsInspectPlan, EimsInspectPlanVo> { |
| | | Page<EimsInspectPlanVo> selectInspPlanList(@Param("page") Page<EimsInspectPlanVo> page, @Param(Constants.WRAPPER) Wrapper<EimsInspectPlan> queryWrapper); |
| | | |
| | | List<EimsInspectPlanVo> selectVoListJoinEqu(@Param(Constants.WRAPPER) Wrapper<EimsInspectPlan> queryWrapper); |
| | | } |
| | |
| | | package org.dromara.eims.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.dromara.eims.domain.EimsInspectPlan; |
| | | import org.dromara.eims.domain.EimsMaintPlan; |
| | | import org.dromara.eims.domain.EimsRepairReq; |
| | | import org.dromara.eims.domain.vo.EimsMaintPlanVo; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | import org.dromara.eims.domain.vo.EimsRepairReqVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ä¿å
»è®¡åMapperæ¥å£ |
| | |
| | | public interface EimsMaintPlanMapper extends BaseMapperPlus<EimsMaintPlan, EimsMaintPlanVo> { |
| | | Page<EimsMaintPlanVo> selectMaintPlanList(@Param("page") Page<EimsMaintPlanVo> page, @Param(Constants.WRAPPER) Wrapper<EimsMaintPlan> queryWrapper); |
| | | |
| | | List<EimsMaintPlanVo> selectVoListJoinEqu(@Param(Constants.WRAPPER) Wrapper<EimsMaintPlan> queryWrapper); |
| | | } |
| | |
| | | package org.dromara.eims.service.impl; |
| | | |
| | | 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 org.dromara.common.mybatis.core.page.TableDataInfo; |
| | |
| | | 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.EimsEqu; |
| | | import org.springframework.stereotype.Service; |
| | | import org.dromara.eims.domain.bo.EimsEquStatuBo; |
| | |
| | | import org.dromara.eims.domain.EimsEquStatu; |
| | | import org.dromara.eims.mapper.EimsEquStatuMapper; |
| | | import org.dromara.eims.service.IEimsEquStatuService; |
| | | import org.dromara.eims.service.IEimsEquService; |
| | | import org.dromara.eims.domain.bo.EimsEquBo; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | public class EimsEquStatuServiceImpl implements IEimsEquStatuService { |
| | | |
| | | private final EimsEquStatuMapper baseMapper; |
| | | private final IEimsEquService equService; |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤ç¶æè®°å½ |
| | |
| | | */ |
| | | @Override |
| | | public TableDataInfo<EimsEquStatuVo> queryPageList(EimsEquStatuBo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<EimsEquStatu> lqw = buildQueryWrapper(bo); |
| | | Page<EimsEquStatuVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(result); |
| | | // 使ç¨èªå®ä¹SQLå®ç°è®¾å¤ç¶æä¸è®¾å¤è¡¨ç模ç³å
³èå页æ¥è¯¢ |
| | | Page<EimsEquStatuVo> page = pageQuery.build(); |
| | | List<EimsEquStatuVo> list = baseMapper.selectEquStatuPage(bo, pageQuery); |
| | | page.setRecords(list); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public Boolean insertByBo(EimsEquStatuBo bo) { |
| | | // è·åç»å½ç¨æ· |
| | | LoginUser loginUser = LoginHelper.getLoginUser(); |
| | | EimsEquStatu add = MapstructUtils.convert(bo, EimsEquStatu.class); |
| | | add.setChangeUser(loginUser.getUserId()); |
| | | add.setChangeDate(DateUtils.getNowDate()); |
| | | validEntityBeforeSave(add); |
| | | boolean flag = baseMapper.insert(add) > 0; |
| | | if (flag) { |
| | |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean updateByBo(EimsEquStatuBo bo) { |
| | | EimsEquStatu update = MapstructUtils.convert(bo, EimsEquStatu.class); |
| | | validEntityBeforeSave(update); |
| | | return baseMapper.updateById(update) > 0; |
| | | boolean result = baseMapper.updateById(update) > 0; |
| | | // åææ¶åæ¥è®¾å¤ç¶æ |
| | | if ("1".equals(String.valueOf(bo.getOrderStatus()))) { |
| | | EimsEquStatuVo vo = baseMapper.selectVoById(bo.getEquStatuId()); |
| | | EimsEquBo equBo = new EimsEquBo(); |
| | | equBo.setEquId(vo.getEquId()); |
| | | equBo.setStatus(vo.getAfterChange()); |
| | | equService.updateByBo(equBo); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public TableDataInfo<EimsInspectStVo> queryPageList(EimsInspectStBo bo, PageQuery pageQuery) { |
| | | bo.setType(bo.getViewMode()); |
| | | // æè§å¾ |
| | | // if(bo.getViewMode().equals("Month")){ |
| | | QueryWrapper<EimsInspectSt> qw = buildWrapper(bo); |
| | | Page<EimsInspectStVo> result = baseMapper.selectInspStList(pageQuery.build(), qw); |
| | | // å¡«å
æ°æ® |
| | | 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); |
| | | // } |
| | | |
| | | // return null; |
| | | } |
| | | |
| | | /** |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.dromara.eims.mapper.EimsEquStatuMapper"> |
| | | |
| | | <resultMap type="org.dromara.eims.domain.vo.EimsEquStatuVo" id="EquStatuVoResult"> |
| | | </resultMap> |
| | | |
| | | <select id="selectEquStatuPage" resultMap="EquStatuVoResult"> |
| | | SELECT s.*, e.equ_name AS equName, e.asset_no AS assetNo |
| | | FROM eims_equ_statu s |
| | | LEFT JOIN eims_equ e ON s.equ_id = e.equ_id |
| | | <where> |
| | | <if test="bo.equId != null"> |
| | | AND s.equ_id = #{bo.equId} |
| | | </if> |
| | | <if test="bo.beforeChange != null and bo.beforeChange != ''"> |
| | | AND s.before_change = #{bo.beforeChange} |
| | | </if> |
| | | <if test="bo.afterChange != null and bo.afterChange != ''"> |
| | | AND s.after_change = #{bo.afterChange} |
| | | </if> |
| | | <if test="bo.changeUser != null"> |
| | | AND s.change_user = #{bo.changeUser} |
| | | </if> |
| | | <if test="bo.orderStatus != null and bo.orderStatus != ''"> |
| | | AND s.order_status = #{bo.orderStatus} |
| | | </if> |
| | | <if test="bo.params != null and bo.params.beginTime != null and bo.params.endTime != null"> |
| | | AND s.change_date BETWEEN #{bo.params.beginTime} AND #{bo.params.endTime} |
| | | </if> |
| | | <if test="bo.params != null and bo.params.searchValue != null and bo.params.searchValue != ''"> |
| | | AND ( |
| | | e.equ_name LIKE CONCAT('%', #{bo.params.searchValue}, '%') |
| | | OR e.asset_no LIKE CONCAT('%', #{bo.params.searchValue}, '%') |
| | | ) |
| | | </if> |
| | | </where> |
| | | ORDER BY s.change_date DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | LEFT JOIN sys_dict_data dd on dd.dict_type = 'maint_cycle_unit' and dd.dict_value = ip.insp_cycle_unit |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |
| | | <select id="selectVoListJoinEqu" resultType="org.dromara.eims.domain.vo.EimsInspectPlanVo"> |
| | | SELECT ip.* |
| | | FROM eims_inspect_plan ip |
| | | LEFT JOIN eims_equ equ ON ip.equ_id = equ.equ_id |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |
| | | </mapper> |
| | |
| | | LEFT JOIN sys_dict_data dd on dd.dict_type = 'maint_cycle_unit' and dd.dict_value = mp.maint_cycle_unit |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |
| | | <select id="selectVoListJoinEqu" resultType="org.dromara.eims.domain.vo.EimsMaintPlanVo"> |
| | | SELECT mp.* |
| | | FROM eims_maint_plan mp |
| | | LEFT JOIN eims_equ equ ON mp.equ_id = equ.equ_id |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |
| | | </mapper> |