¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <wd-card type="rectangle" :key="item.id"> |
| | | <template #title> |
| | | <view class="flex justify-between items-center"> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <text class="ml-1 text-sm">{{ item.code }}</text> |
| | | </view> |
| | | |
| | | <view> |
| | | <wd-button size="small" v-if="item.status === '0'" type="info">å¾
æ¥å</wd-button> |
| | | <wd-button size="small" v-else-if="item.status === '1'" type="warning">å·²æ¥å</wd-button> |
| | | <wd-button size="small" v-else-if="item.status === '2'" type="primary">ç»´ä¿®ä¸</wd-button> |
| | | <wd-button size="small" v-else-if="item.status === '3'" type="success">已宿</wd-button> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <wd-swipe-action> |
| | | <view class="flex items-center" @click.stop="itemClick(item)"> |
| | | <image |
| | | v-if="item.reqType === '1'" |
| | | class="slot-img text-center" |
| | | src="/static/ico/ico-huiyi.png" |
| | | /> |
| | | <image |
| | | v-else-if="item.reqType === '2'" |
| | | class="slot-img text-center" |
| | | src="/static/ico/ico-setting.png" |
| | | /> |
| | | <image |
| | | v-else-if="item.reqType === '3'" |
| | | class="slot-img text-center" |
| | | src="/static/ico/ico-faxian.png" |
| | | /> |
| | | <view class="flex-1 mt-1"> |
| | | <view class="text-color-base"> |
| | | <template v-if="item.reqType === '1'"> |
| | | <text>设å¤ç±»å</text> |
| | | <text class="mx-2">|</text> |
| | | <text>{{ item.equName }}</text> |
| | | </template> |
| | | |
| | | <template v-if="item.reqType === '2'"> |
| | | <text>å·¥å
፱Ȍ</text> |
| | | <text class="mx-2">|</text> |
| | | <text>{{ item.fixtureName }}</text> |
| | | </template> |
| | | |
| | | <template v-if="item.reqType === '3'"> |
| | | <text>å
¶ä»ç±»å</text> |
| | | </template> |
| | | <view class="text-color-gray mt-1 text-mini"> |
| | | <text>åçæ¶é´: {{ item.occTime }}</text> |
| | | </view> |
| | | |
| | | <view class="text-color-gray mt-1 text-mini"> |
| | | <text>æ¥ä¿®äºº: {{ item.reqUserName }}</text> |
| | | </view> |
| | | <view class="text-color-gray mt-1 text-mini"> |
| | | <text>æè¿°: {{ item.reqDesc }}</text> |
| | | </view> |
| | | <view class="text-color-gray mt-1 text-mini"> |
| | | <text>ç´§æ¥ç¨åº¦: </text> |
| | | <wd-tag type="danger" v-if="item.urgencyLevel === '1'">ç´§æ¥</wd-tag> |
| | | <wd-tag type="warning" v-else-if="item.urgencyLevel === '2'">ä¸è¬</wd-tag> |
| | | <wd-tag type="success" v-else-if="item.urgencyLevel === '3'">æ®é</wd-tag> |
| | | </view> |
| | | </view> |
| | | <view class="text-color-gray text-sm mt-1"> |
| | | {{ item.location }} {{ item.madeIn }} |
| | | </view> |
| | | |
| | | </view> |
| | | <view v-if="isRepair() || isEquAdmin()"> |
| | | <wd-button size="small" icon="edit-outline" @click.stop="handleSelectReq(item)"> |
| | | æ¥å |
| | | </wd-button> |
| | | </view> |
| | | </view> |
| | | <template #right> |
| | | <view class="h-full px-3 flex items-center"> |
| | | <wd-button size="small" type="error" @click.stop="handleDelete(item)">å é¤</wd-button> |
| | | </view> |
| | | </template> |
| | | </wd-swipe-action> |
| | | </wd-card> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { useToast, useMessage } from 'wot-design-uni' |
| | | import type { RepairReqVO } from '@/service/repair.d' |
| | | import {addRepairRes} from "@/service/repair"; |
| | | import { isEquAdmin, isRepair } from "@/utils/RoleUtils"; |
| | | import { useUserStore } from "@/store"; |
| | | |
| | | const userStore = useUserStore() |
| | | const message = useMessage() |
| | | const toast = useToast() |
| | | defineProps({ |
| | | item: { |
| | | type: Object as () => RepairReqVO, |
| | | required: true |
| | | } |
| | | }) |
| | | |
| | | const emit = defineEmits(['click']) |
| | | |
| | | function itemClick(item) { |
| | | emit('click', item) |
| | | // è·³è½¬å°æ¥ä¿®å详æ
é¡µé¢ |
| | | uni.navigateTo({ |
| | | url: '/pages/repair/req-detail?id=' + item.id |
| | | }) |
| | | } |
| | | |
| | | |
| | | function handleSelectReq(item: any) { |
| | | // å¼¹åºç¡®è®¤æ¯å¦æ¥åå¼¹çª |
| | | message.confirm({ |
| | | msg: 'ç¡®å®æ¥åï¼', |
| | | title: 'æç¤º', |
| | | beforeConfirm: ({ resolve }) => { |
| | | resolve(true) |
| | | addNewRepairRes(item) |
| | | }, |
| | | }) |
| | | } |
| | | function addNewRepairRes(data: any) { |
| | | console.error(data) |
| | | // éæ©æ¥ä¿®ååï¼ä¿®æ¹æ¥ä¿®åç¶æåæ°å¢ç»´ä¿®å·¥å |
| | | const resCode = `WXD${data.code.slice(3)}` |
| | | const deptId = userStore?.userInfo?.deptId |
| | | const userId = userStore?.userInfo?.userId |
| | | const resData = { |
| | | reqId: data.id, |
| | | reqCode: data.code, |
| | | reqUser: data.reqUser, |
| | | reqDept: data.reqDept, |
| | | resCode, |
| | | status: '1', |
| | | resUser: userId, |
| | | resDept: deptId, |
| | | } |
| | | addRepairRes(resData) |
| | | .then((res: any) => { |
| | | if (res.code === 200) { |
| | | toast.success(res?.msg || 'æä½æå') |
| | | uni.$emit('list-refresh') |
| | | } else { |
| | | toast.error(res?.msg || 'çæç»´ä¿®å·¥å失败ï¼è¯·éè¯') |
| | | } |
| | | }) |
| | | .catch((res) => { |
| | | toast.error(res?.msg || 'çæç»´ä¿®å·¥å失败ï¼è¯·éè¯') |
| | | }) |
| | | } |
| | | </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__title-content) { |
| | | padding: 16rpx !important; |
| | | } |
| | | :deep(.wd-card__content) { |
| | | padding: 16rpx !important; |
| | | } |
| | | :deep(.wd-card__footer) { |
| | | padding: 10rpx !important; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <wd-card type="rectangle" :key="item.id"> |
| | | <template #title> |
| | | <view class="flex justify-between items-center"> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <text class="ml-1 text-sm">{{ item.resCode }}</text> |
| | | <text class="text-color-gray ml-2 text-mini">æ¥å:{{ item.createTime }}</text> |
| | | </view> |
| | | |
| | | <view> |
| | | <wd-tag size="small" v-if="item.status === '1'" type="warning">å·²æ¥å</wd-tag> |
| | | <wd-tag size="small" v-else-if="item.status === '2'" type="primary">ç»´ä¿®ä¸</wd-tag> |
| | | <wd-tag size="small" v-else-if="item.status === '3'" type="success">已宿</wd-tag> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <view class="flex h-[240rpx] items-center"> |
| | | <image |
| | | v-if="item.reqType === '1'" |
| | | class="slot-img text-center" |
| | | src="/static/ico/ico-huiyi.png" |
| | | /> |
| | | <image |
| | | v-else-if="item.reqType === '2'" |
| | | class="slot-img text-center" |
| | | src="/static/ico/ico-setting.png" |
| | | /> |
| | | <image |
| | | v-else-if="item.reqType === '3'" |
| | | class="slot-img text-center" |
| | | src="/static/ico/ico-faxian.png" |
| | | /> |
| | | <view class="flex-1 mt-1"> |
| | | <view class="text-color-base"> |
| | | <template v-if="item.reqType === '1'"> |
| | | <text>设å¤ç±»å</text> |
| | | <text class="mx-2">|</text> |
| | | <text>{{ item.equName }}</text> |
| | | </template> |
| | | |
| | | <template v-if="item.reqType === '2'"> |
| | | <text>å·¥å
፱Ȍ</text> |
| | | <text class="mx-2">|</text> |
| | | <text>{{ item.fixtureName }}</text> |
| | | </template> |
| | | |
| | | <template v-if="item.reqType === '3'"> |
| | | <text>å
¶ä»ç±»å</text> |
| | | </template> |
| | | <view class="text-color-gray mt-1 text-mini"> |
| | | <text>æ¥ä¿®äºº: {{ item.reqUserName }}</text> |
| | | </view> |
| | | <view class="text-color-gray mt-1 text-mini"> |
| | | <text>æ¥ä¿®æ¶é´: {{ item.reqTime }}</text> |
| | | </view> |
| | | |
| | | <view class="text-color-gray mt-1 text-mini"> |
| | | <text>ç»´ä¿®å¼å§: {{ item.startTime }}</text> |
| | | </view> |
| | | <view class="text-color-gray mt-1 text-mini"> |
| | | <text>ç»´ä¿®ç»æ: {{ item.endTime }}</text> |
| | | </view> |
| | | <view class="text-color-gray mt-1 text-mini"> |
| | | <text>维修人: {{ item.resUserName }}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view> |
| | | <template v-if="item.status === '3'"> |
| | | <view class="h-full flex flex-col"> |
| | | <wd-button size="small" icon="warn-bold" @click.stop="itemClick(item)"> |
| | | 详æ
|
| | | </wd-button> |
| | | <wd-button |
| | | class="mt-4" |
| | | size="small" |
| | | icon="edit-outline" |
| | | @click.stop="goToFeedBack(item)" |
| | | type="warning" |
| | | > |
| | | {{ item.fbId == null ? 'åè¯ä»·' : 'æ¥çè¯ä»·' }} |
| | | </wd-button> |
| | | </view> |
| | | </template> |
| | | <!--æä½å·¥æç»´ä¿®å·¥è§è²--> |
| | | <template v-if="isRepair() || isEquAdmin()"> |
| | | <wd-button |
| | | v-if="item.status === '1'" |
| | | size="small" |
| | | icon="edit-outline" |
| | | @click.stop="handleStartRepair(item)" |
| | | > |
| | | å¼å§ç»´ä¿® |
| | | </wd-button> |
| | | <wd-button |
| | | v-else-if="item.status === '2'" |
| | | size="small" |
| | | icon="edit-outline" |
| | | @click.stop="itemClick(item)" |
| | | type="success" |
| | | > |
| | | å®æç»´ä¿® |
| | | </wd-button> |
| | | |
| | | </template> |
| | | |
| | | </view> |
| | | </view> |
| | | </wd-card> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import type { RepairResVO } from '@/service/repair.d' |
| | | import { isEquAdmin, isLeader, isLineOrRepair, isRepair } from "@/utils/RoleUtils"; |
| | | import { formatDate } from "@/utils/DateUtils"; |
| | | import { updateRepairRes } from "@/service/repair"; |
| | | import { useToast, useMessage } from 'wot-design-uni' |
| | | import { useUserStore } from "@/store"; |
| | | |
| | | const userStore = useUserStore() |
| | | const message = useMessage() |
| | | const toast = useToast() |
| | | defineProps({ |
| | | item: { |
| | | type: Object as () => RepairResVO, |
| | | required: true |
| | | } |
| | | }) |
| | | |
| | | const emit = defineEmits(['click']) |
| | | |
| | | function handleClick(item) { |
| | | emit('click', item) |
| | | } |
| | | |
| | | /** |
| | | * å¼å§ç»´ä¿® |
| | | * @param item |
| | | */ |
| | | function handleStartRepair(item: any) { |
| | | // 确认å¼å§ä¿®æ¹ç¶æä¸º2-ç»´ä¿®ä¸ |
| | | const data = Object.assign({}, item) |
| | | // 确认å¼å§ä¿®æ¹ç¶æä¸º2-ç»´ä¿®ä¸ |
| | | data.status = '2' |
| | | // 设置å¼å§ç»´ä¿®æ¶é´ |
| | | data.startTime = formatDate(new Date()) |
| | | message |
| | | .confirm({ |
| | | msg: 'ç¡®å®å¼å§ç»´ä¿®ï¼', |
| | | title: 'æç¤º', |
| | | beforeConfirm: ({ resolve }) => { |
| | | updateRepair(data, resolve) |
| | | }, |
| | | }) |
| | | .then(() => {}) |
| | | .catch((error) => { |
| | | console.log(error) |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°ç»´ä¿®å·¥å |
| | | * @param data |
| | | * @param resolve |
| | | */ |
| | | function updateRepair(data: any, resolve: any) { |
| | | updateRepairRes(data) |
| | | .then((res: any) => { |
| | | resolve(true) |
| | | if (res?.code === 200) { |
| | | uni.$emit('list-refresh') |
| | | // ç»´ä¿®ä¸ç¶ææéè¦è·³è½¬ |
| | | if (data?.status === '3') { |
| | | goToDetail(data) |
| | | } |
| | | } |
| | | }) |
| | | .catch((res) => { |
| | | console.error(res) |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ¡ç®ç¹å»äºä»¶ |
| | | * @param item |
| | | */ |
| | | function itemClick(item: any) { |
| | | goToDetail(item) |
| | | } |
| | | |
| | | function goToDetail(item) { |
| | | uni.navigateTo({ |
| | | url: `/pages/repair/res-detail?id=${item.id}`, |
| | | }) |
| | | } |
| | | |
| | | function goToFeedBack(item) { |
| | | uni.navigateTo({ |
| | | url: `/pages/repair/repair-fb?id=${item.id}`, |
| | | }) |
| | | } |
| | | |
| | | </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__title-content) { |
| | | padding: 16rpx !important; |
| | | } |
| | | :deep(.wd-card__content) { |
| | | padding: 16rpx !important; |
| | | } |
| | | :deep(.wd-card__footer) { |
| | | padding: 10rpx !important; |
| | | } |
| | | </style> |
| | |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/repair/req-detail", |
| | | "type": "page", |
| | | "layout": "default", |
| | | "needLogin": true, |
| | | "style": { |
| | | "navigationBarTitleText": "æ¥ä¿®è¯¦æ
", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/repair/req-list", |
| | | "type": "page", |
| | | "layout": "default", |
| | |
| | | </view> |
| | | </template> |
| | | |
| | | <view v-if="item.showDesc" class="mt-2"> |
| | | <view v-if="item.inspResult === '2'" class="mt-2"> |
| | | <wd-input |
| | | v-model="item.inspDesc" |
| | | placeholder="请è¾å
¥å¼å¸¸æè¿°" |
| | |
| | | /> |
| | | <!-- æ°å¢æäº¤æé® --> |
| | | <view class="flex justify-around mt-4"> |
| | | <wd-button type="primary" block size="large" v-if="inspSt.status === '0'" @click="handleClickRight">æäº¤</wd-button> |
| | | <wd-button type="success" block size="large" v-if="isLeader() && inspSt.status === '1'" @click="handleComplete">ç¡®è®¤å®æ</wd-button> |
| | | <wd-button type="primary" block size="large" v-if="inspSt.status === '0' || inspSt.status === '1'" @click="handleClickRight">æäº¤</wd-button> |
| | | <!-- <wd-button type="success" block size="large" v-if="isLeader() && inspSt.status === '1'" @click="handleComplete">ç¡®è®¤å®æ</wd-button>--> |
| | | </view> |
| | | </view> |
| | | </z-paging> |
| | |
| | | |
| | | <script setup lang="ts"> |
| | | import { useUserStore, useAccessStore, useSystemConfigStore } from '@/store' |
| | | import { isLeader, isOperatorOrRepair } from '@/utils/RoleUtils' |
| | | import { isLeader, isLineOrRepair } from '@/utils/RoleUtils' |
| | | import { |
| | | getInspStRecordList, |
| | | getInspSt, |
| | |
| | | status: '', |
| | | inspUser: '', |
| | | specialNote: '', |
| | | runTimes: 0, |
| | | faultTimes: 0, |
| | | runTimes: undefined, |
| | | faultTimes: undefined, |
| | | }) |
| | | |
| | | const paging = ref(null) |
| | |
| | | // ä¿®æ¹æ¶é´æ ¼å¼ä¸º YYYY-MM-DD HH:mm:ss |
| | | const now = new Date() |
| | | item.inspTime = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}:${String(now.getSeconds()).padStart(2, '0')}` |
| | | |
| | | if (item.inspResult === '2') { |
| | | item.showDesc = true |
| | | } else { |
| | | item.showDesc = false |
| | | item.inspDesc = '' |
| | | } |
| | | } |
| | | |
| | | const goBack = () => { |
| | |
| | | } |
| | | |
| | | function handleClickRight() { |
| | | if (isOperatorOrRepair()) { |
| | | |
| | | if (inspSt.status === '0') { |
| | | handleConfirm() |
| | | } else if (inspSt.status === '1') { |
| | | handleComplete() |
| | | } |
| | | } |
| | | |
| | |
| | | } else { |
| | | inspSt.status = '0' |
| | | } |
| | | |
| | | updateInspectSt(inspSt) |
| | | .then((res: any) => { |
| | | toast.success('æä½æå') |
| | |
| | | * ç¡®è®¤å®ææé®ç¹å»äºä»¶ |
| | | */ |
| | | function handleComplete() { |
| | | if (!isLeader()) { |
| | | toast.info('æ æéæä½'); |
| | | return; |
| | | console.log('handleComplete', inspSt) |
| | | if (!inspSt.runTimes || !inspSt.faultTimes) { |
| | | message.alert('请填åè¿è¡æ¬¡æ°åæ
鿬¡æ°!') |
| | | return false |
| | | } |
| | | const now = new Date(); |
| | | const data: any = Object.assign( |
| | | {}, |
| | | { |
| | | id: inspSt.id, |
| | | runTimes: inspSt.runTimes, |
| | | faultTimes: inspSt.faultTimes, |
| | | status: '2', |
| | | verifyUser: userStore?.userInfo?.userId, |
| | | verifyTime: `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}:${String(now.getSeconds()).padStart(2, '0')}` |
| | |
| | | <script setup lang="ts"> |
| | | import { getInspStList } from '@/service/inspect' |
| | | import dayjs from 'dayjs' |
| | | |
| | | import { useUserStore, useAccessStore, useSystemConfigStore } from '@/store' |
| | | import { isLeader, isLineOrRepair, isOperator } from "@/utils/RoleUtils"; |
| | | // æ ç¾é¡µç¸å
³ |
| | | const activeTab = ref(0) // é»è®¤éä¸ç¬¬ä¸ä¸ªæ ç¾é¡µï¼å¾
ç¹æ£ï¼ |
| | | |
| | |
| | | ]) |
| | | |
| | | const equList = ref<Record<string, any>[]>([{ label: 'ææè®¾å¤', value: 'ææè®¾å¤' }]) |
| | | |
| | | const userStore = useUserStore() |
| | | // æ ç¾é¡µåæ¢å¤ç彿° |
| | | function handleTabChange({ index }) { |
| | | // æ ¹æ®æ ç¾é¡µç´¢å¼è®¾ç½®å¯¹åºçç¶æå¼ |
| | |
| | | } else { |
| | | delete params.planTime |
| | | } |
| | | |
| | | console.log('queryList::', isLineOrRepair(), isOperator(), userStore.userInfo) |
| | | if (isLineOrRepair() || isOperator()) { |
| | | params.updateBy = userStore.userInfo.userId |
| | | } else if (isLeader()) { |
| | | delete params.updateBy |
| | | } |
| | | console.log('params::', params) |
| | | getInspStList(params) |
| | | .then((res: any) => { |
| | | // 请å¿å¨ç½ç»è¯·æ±åè°ä¸ç»dataListèµå¼ï¼ï¼åªéè¦è°ç¨completeå°±å¯ä»¥äº |
| | |
| | | > |
| | | <wd-input |
| | | v-model="part.name" |
| | | label="åç§°" |
| | | label="åç§°ï¼" |
| | | label-width="100rpx" |
| | | placeholder="å¤ä»¶åç§°" |
| | | |
| | |
| | | /> |
| | | <wd-input |
| | | v-model="part.quantity" |
| | | label="æ°é" label-width="100rpx" |
| | | label="æ°éï¼" |
| | | label-width="100rpx" |
| | | placeholder="æ°é" type="number" :maxlength="5" /> |
| | | </view> |
| | | </view> |
| | |
| | | import { getMaintSt, getMaintStOrderList, updateMaintOrder, updateMaintSt, updateMaintOrderBatch } from '@/service/maint' |
| | | import { ref, reactive } from 'vue' |
| | | import { useToast, useMessage } from 'wot-design-uni' |
| | | import { isLeader, isOperatorOrRepair } from '@/utils/RoleUtils' |
| | | import { isLeader, isLineOrRepair } from '@/utils/RoleUtils' |
| | | import { formatDate } from '@/utils/DateUtils' |
| | | import { useUserStore } from "@/store"; |
| | | import { getSpareList } from '@/service/spare' |
| | |
| | | } |
| | | |
| | | function handleClickRight() { |
| | | if(isOperatorOrRepair()){ |
| | | |
| | | handleUpdateMaintSt() |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | safeAreaInsetTop |
| | | > |
| | | <template #right> |
| | | <text v-if="isOperatorOrRepair()" class="text-white">æäº¤</text> |
| | | <text v-if="isLineOrRepair()" class="text-white">æäº¤</text> |
| | | <text v-else-if="isLeader()" class="text-white">éªè¯</text> |
| | | </template> |
| | | </wd-navbar> |
| | |
| | | <wd-cell |
| | | title="ä¿å
»å®æ(æä½å·¥)" |
| | | title-width="200px" |
| | | v-if="order.status === '1' && isOperatorOrRepair()" |
| | | v-if="order.status === '1' && isLineOrRepair()" |
| | | > |
| | | <view style="text-align: right"> |
| | | <wd-switch v-model="isFinish" /> |
| | |
| | | import { reactive, onMounted } from 'vue' |
| | | import { FormRules } from 'wot-design-uni/components/wd-form/types' |
| | | import { useToast, useMessage } from 'wot-design-uni' |
| | | import { isLeader, isOperatorOrRepair } from '@/utils/RoleUtils' |
| | | import { isLeader, isLineOrRepair } from '@/utils/RoleUtils' |
| | | const toast = useToast() |
| | | const message = useMessage() |
| | | |
| | |
| | | toast.warning('å½åå·¥åå®æç¶æï¼ä¸å¯æä½') |
| | | break |
| | | } |
| | | } else if (isOperatorOrRepair()) { |
| | | } else if (isLineOrRepair()) { |
| | | switch (order.status) { |
| | | case '0': |
| | | break |
| | |
| | | /> |
| | | <wd-cell title="æ¥ä¿®å¾ç" title-width="200rpx" prop="fileList"> |
| | | <wd-upload |
| | | :file-list="model.fileList" |
| | | v-model:file-list="model.fileList" |
| | | :action="VITE_UPLOAD_BASEURL" |
| | | @change="handleFileChange" |
| | | @success="handleUploadSuccess" |
| | | ></wd-upload> |
| | | </wd-cell> |
| | | |
| | |
| | | @open="openOccTime" |
| | | @confirm="handleOccTimeConfirm" |
| | | /> |
| | | <!-- <wd-picker |
| | | :columns="urgencyList" |
| | | label-key="dictLabel" |
| | | value-key="dictValue" |
| | | label="ç´§æ¥ç¨åº¦" |
| | | v-model="model.urgencyLevel" |
| | | @confirm="handleConfirmUrgencyLevel" |
| | | /> --> |
| | | <wd-cell title="ç´§æ¥ç¨åº¦" title-width="200rpx" prop="urgencyLevel"> |
| | | <wd-radio-group v-model="model.urgencyLevel" inline shape="dot"> @change="handleConfirmUrgencyLevel"> |
| | | <wd-radio v-for="item in urgencyList" :value="item.dictValue">{{item.dictLabel}}</wd-radio> |
| | | </wd-radio-group> |
| | | </wd-cell> |
| | | |
| | | </wd-cell-group> |
| | | |
| | | <wd-cell-group custom-class="mt-2" title="å
¶ä»ä¿¡æ¯" border> |
| | | |
| | | <wd-button style="margin: 20px" block @click="handleSubmit">æäº¤</wd-button> |
| | | |
| | | <!-- <wd-cell-group custom-class="mt-2" title="å
¶ä»ä¿¡æ¯" border> |
| | | <wd-picker |
| | | :columns="faultList" |
| | | label-key="dictLabel" |
| | |
| | | v-model="model.urgencyLevel" |
| | | @confirm="handleConfirmUrgencyLevel" |
| | | /> |
| | | </wd-cell-group> |
| | | </wd-cell-group> --> |
| | | </wd-form> |
| | | </view> |
| | | </template> |
| | |
| | | model.reqTime = formatDate(new Date()) |
| | | model.reqDept = userStore?.userInfo?.deptId |
| | | model.reqUser = userStore?.userInfo?.userId |
| | | model.faultPicture = model.fileList.join(',') |
| | | console.log('model', model) |
| | | const map = model.fileList?.map((file) => file.url) |
| | | console.log('map', map) |
| | | model.faultPicture = map.join(',') |
| | | addRepairReq(model) |
| | | .then((res: any) => { |
| | | if (res?.code === 200) { |
| | |
| | | } |
| | | }) |
| | | .catch((res) => { |
| | | console.error('æ·»å æ¥ä¿®å¤±è´¥:', res) |
| | | toast.error(res?.data?.msg || '请æ±å¤±è´¥') |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ ç¹æ£å¾ç |
| | | * @param fileList |
| | | */ |
| | | function handleFileChange({ fileList }) { |
| | | console.log('fileList:', fileList) |
| | | model.fileList = fileList |
| | | |
| | | function handleUploadSuccess({ file, fileList }) { |
| | | console.log('handleUploadSuccess', file) |
| | | // 夿 file.responseæ¯ä¸æ¯ 对象ï¼ä¸æ¯å¯¹è±¡å°jsonå符串转æ¢ä¸ºå¯¹è±¡ |
| | | if (typeof file.response === 'string') { |
| | | file.response = JSON.parse(file.response) |
| | | console.log('file.response', file.response) |
| | | file.ossId = file.response.data.ossId |
| | | file.url = file.response.data.url |
| | | } |
| | | } |
| | | |
| | | function checkData() { |
| | |
| | | */ |
| | | function openOccTime() { |
| | | occTime.value = Date.now() |
| | | console.log('openOccTime', occTime) |
| | | model.occTime = formatDate(new Date(occTime.value)) |
| | | } |
| | | /** |
| | | * ç¡®è®¤éæ©åçæ¶é´ |
| | | */ |
| | | function handleOccTimeConfirm({ value }) { |
| | | console.log('handleOccTimeConfirm', value) |
| | | model.occTime = formatDate(new Date(value)) |
| | | } |
| | | |
| | |
| | | </view> |
| | | </template> |
| | | <wd-cell title="维修满æåº¦"> |
| | | <wd-rate v-model="repairFb.repairSatisfaction" change="handleChange"></wd-rate> |
| | | <wd-radio-group v-model="repairFb.repairSatisfaction" inline shape="dot"> |
| | | <wd-radio :value="0">䏿»¡æ</wd-radio> |
| | | <wd-radio :value="1">满æ</wd-radio> |
| | | </wd-radio-group> |
| | | </wd-cell> |
| | | <wd-cell title="ç»´ä¿®åæ¶æ§"> |
| | | <wd-rate v-model="repairFb.repairTimeliness" change="handleChange"></wd-rate> |
| | | </wd-cell> |
| | | <wd-cell title="ç»´ä¿®åæåº¦"> |
| | | <wd-rate v-model="repairFb.serviceAttitude" change="handleChange"></wd-rate> |
| | | </wd-cell> |
| | | <wd-cell title="ç»´ä¿®ç°åº6S"> |
| | | <wd-rate v-model="repairFb.repairSs" change="handleChange"></wd-rate> |
| | | </wd-cell> |
| | | |
| | | <wd-textarea |
| | | label="ç»æåé¦" |
| | | label-width="200rpx" |
| | | type="textarea" |
| | | v-model="repairFb.fbResult" |
| | | auto-height |
| | | :maxlength="200" |
| | | show-word-limit |
| | | placeholder="请è¾å
¥ç»æåé¦" |
| | | clearable |
| | | /> |
| | | <wd-textarea |
| | | v-if="repairFb.repairSatisfaction === 0" |
| | | label="æè§æå»ºè®®" |
| | | label-width="200rpx" |
| | | type="textarea" |
| | |
| | | show-word-limit |
| | | placeholder="请è¾å
¥æè§æå»ºè®®" |
| | | clearable |
| | | required |
| | | |
| | | /> |
| | | </wd-cell-group> |
| | | |
| | | <wd-button style="margin: 20px" block @click="handleRepairFb">æäº¤</wd-button> |
| | | </view> |
| | | </template> |
| | | <script setup lang="ts"> |
| | |
| | | updateRepairFb, |
| | | } from '@/service/repair' |
| | | import { reactive } from 'vue' |
| | | import { isLeader, isOperatorOrRepair } from '@/utils/RoleUtils' |
| | | import { isLeader, isLineOrRepair } from '@/utils/RoleUtils' |
| | | import { RepairResVO, RepairFbVO, RepairRecordVO } from '@/service/repair.d' |
| | | import { useUserStore } from "@/store"; |
| | | |
| | | const userStore = useUserStore() |
| | | const isUpdate = ref(false) |
| | | const repairRes = reactive<RepairResVO>({ |
| | | id: '', |
| | |
| | | resCode: '', |
| | | fbResult: '', |
| | | suggestions: '', |
| | | repairSatisfaction: 0, |
| | | repairSatisfaction: 1, |
| | | repairTimeliness: 0, |
| | | serviceAttitude: 0, |
| | | repairSs: 0, |
| | |
| | | } |
| | | |
| | | function handleRepairFb() { |
| | | if(isOperatorOrRepair()){ |
| | | if(repairRes.reqUser !== userStore.userInfo.userId){ |
| | | uni.showToast({ |
| | | title: 'æ æé,请ç»å½ç®¡çåè´¦å·æä½', |
| | | title: 'åªæè¯·æ±äººææè¯ä»·æé', |
| | | icon: 'none', |
| | | }) |
| | | return false |
| | | } |
| | | if (repairFb.repairSatisfaction === 0 && !repairFb.suggestions) { |
| | | uni.showToast({ |
| | | title: '请填åæè§æå»ºè®®', |
| | | icon: 'none', |
| | | }) |
| | | return false |
| | |
| | | title: 'ä¿®æ¹æå', |
| | | icon: 'none', |
| | | }) |
| | | uni.navigateBack() |
| | | uni.$emit('res-list-refresh') |
| | | } |
| | | }) |
| | | .catch((res) => {}) |
| | |
| | | title: 'è¯ä»·æå', |
| | | icon: 'none', |
| | | }) |
| | | uni.navigateBack() |
| | | uni.$emit('res-list-refresh') |
| | | } |
| | | }) |
| | | .catch((res) => {}) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <route lang="json5" type="page"> |
| | | { |
| | | layout: 'default', |
| | | needLogin: true, |
| | | style: { |
| | | navigationBarTitleText: 'æ¥ä¿®è¯¦æ
', |
| | | navigationStyle: 'custom' |
| | | }, |
| | | } |
| | | </route> |
| | | <template> |
| | | <view class="bg-base container" safeAreaInsetTopBottom> |
| | | <wd-navbar |
| | | title="æ¥ä¿®è¯¦æ
" |
| | | left-arrow |
| | | @click-left="goBack" |
| | | custom-style="background: #4D80F0;" |
| | | safeAreaInsetTop |
| | | ></wd-navbar> |
| | | |
| | | <view class="content"> |
| | | <!-- ç¶æå±ç¤º --> |
| | | <view class="status-card"> |
| | | <view class="status-header"> |
| | | <text class="status-code">{{ repairReq.code }}</text> |
| | | <view class="status-tag"> |
| | | <wd-button size="small" v-if="repairReq.status === '0'" type="info">å¾
æ¥å</wd-button> |
| | | <wd-button size="small" v-else-if="repairReq.status === '1'" type="warning">å·²æ¥å</wd-button> |
| | | <wd-button size="small" v-else-if="repairReq.status === '2'" type="primary">ç»´ä¿®ä¸</wd-button> |
| | | <wd-button size="small" v-else-if="repairReq.status === '3'" type="success">已宿</wd-button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 设å¤ä¿¡æ¯ --> |
| | | <wd-cell-group |
| | | v-if="repairReq.reqType === '1'" |
| | | custom-class="mt-2" |
| | | title="设å¤ä¿¡æ¯" |
| | | use-slot |
| | | border |
| | | > |
| | | <wd-cell title="设å¤åç§°" title-width="200rpx"> |
| | | <text>{{ repairReq.equName }}</text> |
| | | </wd-cell> |
| | | <wd-cell title="èµäº§ç¼å·" title-width="200rpx"> |
| | | <text>{{ repairReq.assetNo }}</text> |
| | | </wd-cell> |
| | | </wd-cell-group> |
| | | |
| | | <!-- å·¥å
·ä¿¡æ¯ --> |
| | | <wd-cell-group |
| | | v-if="repairReq.reqType === '2'" |
| | | custom-class="mt-2" |
| | | title="å·¥å
·ä¿¡æ¯" |
| | | use-slot |
| | | border |
| | | > |
| | | <wd-cell title="å·¥å
·åç§°" title-width="200rpx"> |
| | | <text>{{ repairReq.fixtureName }}</text> |
| | | </wd-cell> |
| | | </wd-cell-group> |
| | | |
| | | <!-- æ¥ä¿®ä¿¡æ¯ --> |
| | | <wd-cell-group custom-class="mt-2" title="æ¥ä¿®ä¿¡æ¯" use-slot border> |
| | | <wd-cell title="æ¥ä¿®ç±»å" title-width="200rpx"> |
| | | <text v-if="repairReq.reqType === '1'">设å¤ç±»å</text> |
| | | <text v-else-if="repairReq.reqType === '2'">å·¥å
፱Ȍ</text> |
| | | <text v-else-if="repairReq.reqType === '3'">å
¶ä»ç±»å</text> |
| | | </wd-cell> |
| | | <wd-cell title="åçæ¶é´" title-width="200rpx"> |
| | | <text>{{ repairReq.occTime }}</text> |
| | | </wd-cell> |
| | | <wd-cell title="æ¥ä¿®æ¶é´" title-width="200rpx"> |
| | | <text>{{ repairReq.reqTime }}</text> |
| | | </wd-cell> |
| | | <wd-cell title="æ¥ä¿®äºº" title-width="200rpx"> |
| | | <text>{{ repairReq.reqUserName }}</text> |
| | | </wd-cell> |
| | | <wd-cell title="ç´§æ¥ç¨åº¦" title-width="200rpx"> |
| | | <wd-tag type="danger" v-if="repairReq.urgencyLevel === '1'">ç´§æ¥</wd-tag> |
| | | <wd-tag type="warning" v-else-if="repairReq.urgencyLevel === '2'">ä¸è¬</wd-tag> |
| | | <wd-tag type="success" v-else-if="repairReq.urgencyLevel === '3'">æ®é</wd-tag> |
| | | </wd-cell> |
| | | </wd-cell-group> |
| | | |
| | | <!-- æ
éæè¿° --> |
| | | <wd-cell-group custom-class="mt-2" title="æ
éæè¿°" use-slot border> |
| | | <view class="description-box"> |
| | | <text>{{ repairReq.reqDesc }}</text> |
| | | </view> |
| | | </wd-cell-group> |
| | | |
| | | <!-- æ
éå¾ç --> |
| | | <wd-cell-group v-if="repairReq.faultPicture" custom-class="mt-2" title="æ
éå¾ç" use-slot border> |
| | | <view class="image-box"> |
| | | <image |
| | | class="fault-image" |
| | | :src="repairReq.faultPicture" |
| | | mode="aspectFit" |
| | | @click="previewImage" |
| | | /> |
| | | </view> |
| | | </wd-cell-group> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { reactive, onMounted } from 'vue' |
| | | import { useToast } from 'wot-design-uni' |
| | | import { getRepairReqList } from '@/service/repair' |
| | | import type { RepairReqVO } from '@/service/repair.d' |
| | | |
| | | const toast = useToast() |
| | | |
| | | // æ¥ä¿®è¯·æ±æ°æ® |
| | | const repairReq = reactive<RepairReqVO>({ |
| | | id: '', |
| | | code: '', |
| | | status: '', |
| | | occTime: '', |
| | | reqTime: '', |
| | | reqDept: 0, |
| | | reqUser: 0, |
| | | reqDesc: '', |
| | | urgencyLevel: '', |
| | | faultPicture: '', |
| | | reqType: '', |
| | | equId: '', |
| | | repairId: '', |
| | | repairDept: 0, |
| | | repairUser: 0, |
| | | faultType: '', |
| | | remark: '', |
| | | reqUserName: '', |
| | | equName: '', |
| | | assetNo: '', |
| | | fixtureName: '' |
| | | }) |
| | | |
| | | // è·åæ¥ä¿®è¯·æ±è¯¦æ
|
| | | function getRepairReqDetail(id: string | number) { |
| | | getRepairReqList({ id }) |
| | | .then((res: any) => { |
| | | if (res && res.rows && res.rows.length > 0) { |
| | | Object.assign(repairReq, res.rows[0]) |
| | | } else { |
| | | toast.error('è·åæ¥ä¿®è¯¦æ
失败') |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.error('è·åæ¥ä¿®è¯¦æ
失败', err) |
| | | toast.error('è·åæ¥ä¿®è¯¦æ
失败') |
| | | }) |
| | | } |
| | | |
| | | // é¢è§å¾ç |
| | | function previewImage() { |
| | | if (repairReq.faultPicture) { |
| | | uni.previewImage({ |
| | | urls: [repairReq.faultPicture], |
| | | current: repairReq.faultPicture |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // è¿åä¸ä¸é¡µ |
| | | function goBack() { |
| | | uni.navigateBack() |
| | | } |
| | | |
| | | // 页é¢å è½½æ¶è·åæ¥ä¿®è¯¦æ
|
| | | onLoad((options) => { |
| | | if (options && options.id) { |
| | | getRepairReqDetail(options.id) |
| | | } else { |
| | | toast.error('åæ°é误') |
| | | setTimeout(() => { |
| | | goBack() |
| | | }, 1500) |
| | | } |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .container { |
| | | min-height: 100vh; |
| | | background-color: #f5f5f5; |
| | | } |
| | | |
| | | .content { |
| | | padding: 20rpx; |
| | | } |
| | | |
| | | .status-card { |
| | | background-color: #ffffff; |
| | | border-radius: 12rpx; |
| | | padding: 24rpx; |
| | | margin-bottom: 20rpx; |
| | | box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); |
| | | } |
| | | |
| | | .status-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | .status-code { |
| | | font-size: 32rpx; |
| | | font-weight: bold; |
| | | color: #333333; |
| | | } |
| | | |
| | | .description-box { |
| | | padding: 24rpx; |
| | | background-color: #f9f9f9; |
| | | border-radius: 8rpx; |
| | | margin: 16rpx; |
| | | color: #666666; |
| | | line-height: 1.6; |
| | | } |
| | | |
| | | .image-box { |
| | | padding: 24rpx; |
| | | display: flex; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .fault-image { |
| | | width: 80%; |
| | | height: 400rpx; |
| | | border-radius: 8rpx; |
| | | box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | :deep(.wd-cell-group__title) { |
| | | font-size: 28rpx; |
| | | font-weight: bold; |
| | | color: #4D80F0; |
| | | } |
| | | |
| | | :deep(.wd-cell__title) { |
| | | color: #666666; |
| | | } |
| | | |
| | | :deep(.wd-cell__value) { |
| | | color: #333333; |
| | | font-weight: 500; |
| | | } |
| | | </style> |
| | |
| | | custom-style="background: #4D80F0;" |
| | | safeAreaInsetTop |
| | | ></wd-navbar> |
| | | <wd-drop-menu v-if="!isSelectReq"> |
| | | <wd-drop-menu-item |
| | | v-model="reqTypeId" |
| | | label-key="dictLabel" |
| | | value-key="dictValue" |
| | | :options="reqTypeList" |
| | | @change="handleReqType" |
| | | /> |
| | | <wd-drop-menu-item |
| | | v-model="filterDate" |
| | | :options="filterDateList" |
| | | @change="handleFilterDate" |
| | | /> |
| | | <wd-drop-menu-item |
| | | v-model="status" |
| | | label-key="dictLabel" |
| | | value-key="dictValue" |
| | | :options="statusList" |
| | | @change="handleReqStatu" |
| | | /> |
| | | </wd-drop-menu> |
| | | <!-- <wd-drop-menu v-if="!isSelectReq">--> |
| | | <!-- <wd-drop-menu-item--> |
| | | <!-- v-model="reqTypeId"--> |
| | | <!-- label-key="dictLabel"--> |
| | | <!-- value-key="dictValue"--> |
| | | <!-- :options="reqTypeList"--> |
| | | <!-- @change="handleReqType"--> |
| | | <!-- />--> |
| | | <!-- <wd-drop-menu-item--> |
| | | <!-- v-model="filterDate"--> |
| | | <!-- :options="filterDateList"--> |
| | | <!-- @change="handleFilterDate"--> |
| | | <!-- />--> |
| | | <!-- <wd-drop-menu-item--> |
| | | <!-- v-model="status"--> |
| | | <!-- label-key="dictLabel"--> |
| | | <!-- value-key="dictValue"--> |
| | | <!-- :options="statusList"--> |
| | | <!-- @change="handleReqStatu"--> |
| | | <!-- />--> |
| | | <!-- </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-center"> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <text class="ml-1 text-sm">{{ item.code }}</text> |
| | | </view> |
| | | <ReqCard |
| | | v-for="item in dataList" |
| | | :key="item.id" |
| | | :item="item" |
| | | @itemClick="itemClick" |
| | | ></ReqCard> |
| | | <!-- <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id">--> |
| | | <!-- <template #title>--> |
| | | <!-- <view class="flex justify-between items-center">--> |
| | | <!-- <view class="flex items-center menu-title-box">--> |
| | | <!-- <view class="menu-indicator"></view>--> |
| | | <!-- <text class="ml-1 text-sm">{{ item.code }}</text>--> |
| | | <!-- </view>--> |
| | | |
| | | <view> |
| | | <wd-button size="small" v-if="item.status === '0'" type="info">å¾
æ¥å</wd-button> |
| | | <wd-button size="small" v-else-if="item.status === '1'" type="warning"> |
| | | å·²æ¥å |
| | | </wd-button> |
| | | <wd-button size="small" v-else-if="item.status === '2'" type="primary"> |
| | | ç»´ä¿®ä¸ |
| | | </wd-button> |
| | | <wd-button size="small" v-else-if="item.status === '3'" type="success"> |
| | | 已宿 |
| | | </wd-button> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <wd-swipe-action> |
| | | <view class="flex h-[160rpx] items-center" @click.stop="itemClick(item)"> |
| | | <image |
| | | v-if="item.reqType === '1'" |
| | | class="slot-img text-center" |
| | | src="/static/ico/ico-huiyi.png" |
| | | /> |
| | | <image |
| | | v-else-if="item.reqType === '2'" |
| | | class="slot-img text-center" |
| | | src="/static/ico/ico-setting.png" |
| | | /> |
| | | <image |
| | | v-else-if="item.reqType === '3'" |
| | | class="slot-img text-center" |
| | | src="/static/ico/ico-faxian.png" |
| | | /> |
| | | <view class="flex-1 mt-1"> |
| | | <view class="text-color-base"> |
| | | <template v-if="item.reqType === '1'"> |
| | | <text>设å¤ç±»å</text> |
| | | <text class="mx-2">|</text> |
| | | <text>{{ item.equName }}</text> |
| | | </template> |
| | | <!-- <view>--> |
| | | <!-- <wd-button size="small" v-if="item.status === '0'" type="info">å¾
æ¥å</wd-button>--> |
| | | <!-- <wd-button size="small" v-else-if="item.status === '1'" type="warning">--> |
| | | <!-- å·²æ¥å--> |
| | | <!-- </wd-button>--> |
| | | <!-- <wd-button size="small" v-else-if="item.status === '2'" type="primary">--> |
| | | <!-- ç»´ä¿®ä¸--> |
| | | <!-- </wd-button>--> |
| | | <!-- <wd-button size="small" v-else-if="item.status === '3'" type="success">--> |
| | | <!-- 已宿--> |
| | | <!-- </wd-button>--> |
| | | <!-- </view>--> |
| | | <!-- </view>--> |
| | | <!-- </template>--> |
| | | <!-- <wd-swipe-action>--> |
| | | <!-- <view class="flex h-[160rpx] items-center" @click.stop="itemClick(item)">--> |
| | | <!-- <image--> |
| | | <!-- v-if="item.reqType === '1'"--> |
| | | <!-- class="slot-img text-center"--> |
| | | <!-- src="/static/ico/ico-huiyi.png"--> |
| | | <!-- />--> |
| | | <!-- <image--> |
| | | <!-- v-else-if="item.reqType === '2'"--> |
| | | <!-- class="slot-img text-center"--> |
| | | <!-- src="/static/ico/ico-setting.png"--> |
| | | <!-- />--> |
| | | <!-- <image--> |
| | | <!-- v-else-if="item.reqType === '3'"--> |
| | | <!-- class="slot-img text-center"--> |
| | | <!-- src="/static/ico/ico-faxian.png"--> |
| | | <!-- />--> |
| | | <!-- <view class="flex-1 mt-1">--> |
| | | <!-- <view class="text-color-base">--> |
| | | <!-- <template v-if="item.reqType === '1'">--> |
| | | <!-- <text>设å¤ç±»å</text>--> |
| | | <!-- <text class="mx-2">|</text>--> |
| | | <!-- <text>{{ item.equName }}</text>--> |
| | | <!-- </template>--> |
| | | |
| | | <template v-if="item.reqType === '2'"> |
| | | <text>å·¥å
፱Ȍ</text> |
| | | <text class="mx-2">|</text> |
| | | <text>{{ item.fixtureName }}</text> |
| | | </template> |
| | | <!-- <template v-if="item.reqType === '2'">--> |
| | | <!-- <text>å·¥å
፱Ȍ</text>--> |
| | | <!-- <text class="mx-2">|</text>--> |
| | | <!-- <text>{{ item.fixtureName }}</text>--> |
| | | <!-- </template>--> |
| | | |
| | | <template v-if="item.reqType === '3'"> |
| | | <text>å
¶ä»ç±»å</text> |
| | | </template> |
| | | <view class="text-color-gray mt-1 text-mini"> |
| | | <text>åçæ¶é´: {{ item.occTime }}</text> |
| | | </view> |
| | | <!-- <template v-if="item.reqType === '3'">--> |
| | | <!-- <text>å
¶ä»ç±»å</text>--> |
| | | <!-- </template>--> |
| | | <!-- <view class="text-color-gray mt-1 text-mini">--> |
| | | <!-- <text>åçæ¶é´: {{ item.occTime }}</text>--> |
| | | <!-- </view>--> |
| | | |
| | | <view class="text-color-gray mt-1 text-mini"> |
| | | <text>æ¥ä¿®æ¶é´: {{ item.reqTime }}</text> |
| | | </view> |
| | | <view class="text-color-gray mt-1 text-mini"> |
| | | <text>æ¥ä¿®äºº: {{ item.reqUserName }}</text> |
| | | </view> |
| | | </view> |
| | | <view class="text-color-gray text-sm mt-1"> |
| | | {{ item.location }} {{ item.madeIn }} |
| | | </view> |
| | | </view> |
| | | <view v-if="isSelectReq"> |
| | | <wd-button size="small" icon="edit-outline" @click.stop="handleSelectReq(item)"> |
| | | æ¥å |
| | | </wd-button> |
| | | </view> |
| | | </view> |
| | | <template #right> |
| | | <view class="h-full px-3 flex items-center"> |
| | | <wd-button size="small" type="error" @click.stop="handleDelete(item)">å é¤</wd-button> |
| | | </view> |
| | | </template> |
| | | </wd-swipe-action> |
| | | </wd-card> |
| | | <!-- <view class="text-color-gray mt-1 text-mini">--> |
| | | <!-- <text>æ¥ä¿®æ¶é´: {{ item.reqTime }}</text>--> |
| | | <!-- </view>--> |
| | | <!-- <view class="text-color-gray mt-1 text-mini">--> |
| | | <!-- <text>æ¥ä¿®äºº: {{ item.reqUserName }}</text>--> |
| | | <!-- </view>--> |
| | | <!-- </view>--> |
| | | <!-- <view class="text-color-gray text-sm mt-1">--> |
| | | <!-- {{ item.location }} {{ item.madeIn }}--> |
| | | <!-- </view>--> |
| | | <!-- </view>--> |
| | | <!-- <view v-if="isSelectReq">--> |
| | | <!-- <wd-button size="small" icon="edit-outline" @click.stop="handleSelectReq(item)">--> |
| | | <!-- æ¥å--> |
| | | <!-- </wd-button>--> |
| | | <!-- </view>--> |
| | | <!-- </view>--> |
| | | <!-- <template #right>--> |
| | | <!-- <view class="h-full px-3 flex items-center">--> |
| | | <!-- <wd-button size="small" type="error" @click.stop="handleDelete(item)">å é¤</wd-button>--> |
| | | <!-- </view>--> |
| | | <!-- </template>--> |
| | | <!-- </wd-swipe-action>--> |
| | | <!-- </wd-card>--> |
| | | </view> |
| | | </z-paging> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { onMounted, getCurrentInstance, ref } from 'vue' |
| | | import { useToast, useMessage } from 'wot-design-uni' |
| | | import { getRepairReqList, delRepairReq } from '@/service/repair' |
| | | import { DICT_REPAIR_REQ_STATUS, DICT_REPAIR_REQ_TYPE, getDictInfo } from '@/service/dict' |
| | | import dayjs from "dayjs"; |
| | | import { isEquAdmin, isRepair } from "@/utils/RoleUtils"; |
| | | import { useUserStore } from "@/store"; |
| | | import ReqCard from "@/components/repair/req-card.vue"; |
| | | |
| | | const userStore = useUserStore() |
| | | const message = useMessage() |
| | | const toast = useToast() |
| | | // æ¥ä¿®åç±»å |
| | |
| | | const queryParams: any = { |
| | | pageNum, |
| | | pageSize, |
| | | reqType: reqTypeId.value, |
| | | status: status.value, |
| | | params: {}, |
| | | } |
| | | if (reqTypeId.value === -1) { |
| | | delete queryParams.reqType |
| | | } |
| | | if (status.value === -1) { |
| | | delete queryParams.status |
| | | } |
| | | // if (reqTypeId.value === -1) { |
| | | // delete queryParams.reqType |
| | | // } |
| | | // if (status.value === -1) { |
| | | // delete queryParams.status |
| | | // } |
| | | // |
| | | // if (filterDate.value === '1') { |
| | | // // è·åå½åæ¥æ |
| | | // const now = dayjs() |
| | | // queryParams.params = { |
| | | // beginReqTime: now.startOf('day').format('YYYY-MM-DD 00:00:00'), |
| | | // endReqTime: now.endOf('day').format('YYYY-MM-DD 23:59:59'), |
| | | // } |
| | | // } else if (filterDate.value === '2') { |
| | | // const now = dayjs() |
| | | // queryParams.params = { |
| | | // beginReqTime: now.startOf('month').format('YYYY-MM-DD 00:00:00'), |
| | | // endReqTime: now.endOf('month').format('YYYY-MM-DD 23:59:59'), |
| | | // } |
| | | // } else { |
| | | // delete queryParams.params |
| | | // } |
| | | |
| | | if (filterDate.value === '1') { |
| | | // è·åå½åæ¥æ |
| | | const now = dayjs() |
| | | queryParams.params = { |
| | | beginReqTime: now.startOf('day').format('YYYY-MM-DD 00:00:00'), |
| | | endReqTime: now.endOf('day').format('YYYY-MM-DD 23:59:59'), |
| | | } |
| | | } else if (filterDate.value === '2') { |
| | | const now = dayjs() |
| | | queryParams.params = { |
| | | beginReqTime: now.startOf('month').format('YYYY-MM-DD 00:00:00'), |
| | | endReqTime: now.endOf('month').format('YYYY-MM-DD 23:59:59'), |
| | | } |
| | | } else { |
| | | delete queryParams.params |
| | | // æ¥è¯¢æªå®æçæ¥ä¿®å |
| | | queryParams.params.status = '0,1,2' |
| | | queryParams.reqUser = userStore?.userInfo?.userId |
| | | if (isRepair() || isEquAdmin()) { |
| | | queryParams.params.status = '0' |
| | | queryParams.reqUser = undefined |
| | | } |
| | | |
| | | getRepairReqList(queryParams) |
| | |
| | | |
| | | onLoad(() => { |
| | | initData() |
| | | uni.$on('req-list-refresh', reloadData) |
| | | uni.$on('list-refresh', reloadData) |
| | | }) |
| | | onUnload(() => { |
| | | uni.$off('req-list-refresh', reloadData) |
| | | uni.$off('list-refresh', reloadData) |
| | | }) |
| | | </script> |
| | | |
| | |
| | | <wd-cell title="æ
éç±»å" title-width="200rpx" is-link> |
| | | <text>{{ reqType?.dictLabel }}</text> |
| | | </wd-cell> |
| | | <wd-cell title="æ¥ä¿®æè¿°" :label="repairRes?.reqDesc" is-link /> |
| | | |
| | | <wd-textarea |
| | | label="æ¥ä¿®æè¿°" |
| | | label-width="200rpx" |
| | | type="textarea" |
| | | v-model="repairRes.reqDesc" |
| | | auto-height |
| | | readonly |
| | | /> |
| | | </wd-cell-group> |
| | | |
| | | <wd-cell-group |
| | |
| | | </wd-cell-group> |
| | | |
| | | <wd-cell-group custom-class="mt-2" title="维修信æ¯" use-slot border> |
| | | <wd-cell title="æ
éç±»å«" title-width="200rpx" prop="faultType"> |
| | | <wd-radio-group v-model="repairRes.faultType" inline shape="dot"> > |
| | | <wd-radio v-for="item in faultList" :value="item.dictValue">{{item.dictLabel}}</wd-radio> |
| | | </wd-radio-group> |
| | | </wd-cell> |
| | | <wd-textarea |
| | | label="åå åæ" |
| | | label-width="200rpx" |
| | |
| | | clearable |
| | | /> |
| | | </wd-cell-group> |
| | | <wd-cell-group custom-class="mt-2" title="å¤ä»¶ä¿¡æ¯" use-slot border> |
| | | <!-- å¤ä»¶ä¿¡æ¯å½å
¥åºå --> |
| | | <view v-if="repairRes.spareParts && repairRes.spareParts.length > 0" class="mt-2"> |
| | | <view |
| | | v-for="(part, partIndex) in repairRes.spareParts" |
| | | :key="partIndex" |
| | | class="flex justify-between mt-1" |
| | | > |
| | | <wd-input |
| | | v-model="part.name" |
| | | label="åç§°ï¼" |
| | | label-width="100rpx" |
| | | placeholder="å¤ä»¶åç§°" |
| | | |
| | | |
| | | /> |
| | | <wd-input |
| | | v-model="part.quantity" |
| | | label="æ°éï¼" |
| | | label-width="100rpx" |
| | | placeholder="æ°é" type="number" :maxlength="5" /> |
| | | </view> |
| | | </view> |
| | | <!-- 维修说æåºå --> |
| | | <view class="mt-2 flex justify-end"> |
| | | <wd-button type="success" 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> |
| | | |
| | | <!-- å¤ä»¶éæ©å¼¹åºå± --> |
| | | <wd-popup v-model="showSparePopup" position="bottom" height="33.33vh"> |
| | | <view class="flex justify-between p-2 bg-white"> |
| | | <wd-button type="text" @click="closeSparePopup">åæ¶</wd-button> |
| | | <wd-button type="text" @click="addOtherSparePart">å
¶ä»</wd-button> |
| | | |
| | | </view> |
| | | <wd-input |
| | | v-model="searchKeyword" |
| | | placeholder="请è¾å
¥å¤ä»¶åç§°æåå·" |
| | | clearable |
| | | @input="filterSpareParts" |
| | | /> |
| | | <view class="p-2"> |
| | | <view |
| | | v-for="(part, index) in sparePartsList" |
| | | :key="index" |
| | | class="flex justify-between items-center p-2 border-b" |
| | | @click="selectFilteredSparePart(part)" |
| | | > |
| | | <text>{{ part.name }} ({{ part.code }})</text> |
| | | <text>å©ä½: {{ part.actualStock }}</text> |
| | | </view> |
| | | </view> |
| | | </wd-popup> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { getRepairRes, updateRepairRes } from '@/service/repair' |
| | | import { RepairResVO } from '@/service/repair.d' |
| | | import { reactive, onMounted, ref } from 'vue' |
| | | import { FormRules } from 'wot-design-uni/components/wd-form/types' |
| | | import { useToast, useMessage } from 'wot-design-uni' |
| | | import { isLeader, isOperatorOrRepair } from '@/utils/RoleUtils' |
| | | import { DICT_REPAIR_REQ_TYPE, getDictInfo } from '@/service/dict' |
| | | import { isEquAdmin, isLeader, isLineOrRepair, isRepair } from "@/utils/RoleUtils"; |
| | | import { DICT_REPAIR_FAULT_TYPE, DICT_REPAIR_REQ_TYPE, getDictInfo } from "@/service/dict"; |
| | | import { formatDate } from '@/utils/DateUtils' |
| | | const toast = useToast() |
| | | const message = useMessage() |
| | | |
| | | const showSparePopup = ref(false) |
| | | import { getSpareList } from '@/service/spare' |
| | | import { ref } from "vue"; |
| | | const fileList = ref<[]>() |
| | | |
| | | const selectedPartIndex = ref(-1) |
| | | const sparePartsList = ref([]) |
| | | const searchKeyword = ref('') |
| | | // æ¥ä¿®åç±»å |
| | | const reqTypeList = ref<any>([]) |
| | | |
| | | // æ
éç±»å« |
| | | const faultList = ref<any>([]) |
| | | const repairRes = reactive<RepairResVO>({ |
| | | id: '', |
| | | resCode: '', |
| | |
| | | ], |
| | | } |
| | | |
| | | function filterSpareParts() { |
| | | if (!searchKeyword.value) { |
| | | loadSpareParts() |
| | | } else { |
| | | loadSpareParts(searchKeyword.value) |
| | | } |
| | | } |
| | | // å¤ä»¶éæ©ç¸å
³é»è¾ |
| | | function addSparePart() { |
| | | // if (!item.spareParts) { |
| | | // item.spareParts = [] |
| | | // } |
| | | repairRes.spareParts.value = [] |
| | | |
| | | selectSparePart() |
| | | } |
| | | |
| | | function selectSparePart(item: any) { |
| | | showSparePopup.value = true |
| | | |
| | | loadSpareParts() |
| | | } |
| | | |
| | | function loadSpareParts(value?: string) { |
| | | getSpareList({ name: value, pageNum: 1, pageSize: 10 }).then((res: any) => { |
| | | sparePartsList.value = res.rows |
| | | |
| | | }) |
| | | } |
| | | |
| | | function selectFilteredSparePart(part: any) { |
| | | repairRes.spareParts.value.push({ |
| | | id: part.id, |
| | | name: part.name, |
| | | quantity: '', |
| | | }) |
| | | closeSparePopup() |
| | | } |
| | | function addOtherSparePart() { |
| | | repairRes.spareParts.value.push({ |
| | | id: '', |
| | | name: '', |
| | | quantity: '', |
| | | }) |
| | | closeSparePopup(); |
| | | } |
| | | |
| | | function closeSparePopup() { |
| | | showSparePopup.value = false |
| | | selectedPartIndex.value = -1 |
| | | searchKeyword.value = '' |
| | | } |
| | | |
| | | function handleFileChange({ fileList }) {} |
| | | |
| | | function initRepairRes(id: any) { |
| | |
| | | initRepairRes(options.id) |
| | | const reqList = await getDictInfo(DICT_REPAIR_REQ_TYPE) |
| | | reqTypeList.value = reqList |
| | | const fList = await getDictInfo(DICT_REPAIR_FAULT_TYPE) |
| | | faultList.value = fList |
| | | } |
| | | |
| | | function hanldeUpdateRepairRes(data: any, resolve: any) { |
| | |
| | | resolve(true) |
| | | toastSucces() |
| | | uni.$emit('res-list-refresh') |
| | | uni.navigateBack() |
| | | }) |
| | | .catch((res) => { |
| | | console.error(res) |
| | |
| | | onNavigationBarButtonTap((e) => { |
| | | if (e.index === 0) { |
| | | // 管çåè§è² |
| | | if (isLeader()) { |
| | | toast.warning('å½åç»å½è§è²ä¸å¯æä½') |
| | | } else if (isOperatorOrRepair()) { |
| | | if (isRepair() || isEquAdmin()) { |
| | | switch (repairRes.status) { |
| | | // å·²æ¥å |
| | | case '1': |
| | |
| | | } |
| | | } |
| | | } else if (e.index === 1) { |
| | | if (isLeader()) { |
| | | toast.warning('å½åç»å½è§è²ä¸å¯æä½') |
| | | } else if (isOperatorOrRepair()) { |
| | | if (isRepair() || isEquAdmin()) { |
| | | switch (repairRes.status) { |
| | | // å·²æ¥å |
| | | case '1': |
| | |
| | | title="设å¤ç»´ä¿®" |
| | | left-arrow |
| | | @click-left="goBack" |
| | | right-text="æäº¤" |
| | | @click-right="handleClickRight" |
| | | custom-style="background: #4D80F0;" |
| | | safeAreaInsetTop |
| | | > |
| | | <template #right> |
| | | <text v-if="isOperatorOrRepair()" class="text-white">æ¥å</text> |
| | | </template> |
| | | <!-- <template #right>--> |
| | | <!-- <text v-if="isLineOrRepair()" class="text-white">æ¥å</text>--> |
| | | <!-- </template>--> |
| | | </wd-navbar> |
| | | <wd-drop-menu> |
| | | <wd-drop-menu-item |
| | | v-model="resTypeId" |
| | | label-key="dictLabel" |
| | | value-key="dictValue" |
| | | :options="resTypeList" |
| | | @change="handleResType" |
| | | /> |
| | | <wd-drop-menu-item |
| | | v-model="filterDate" |
| | | :options="filterDateList" |
| | | @change="handleFilterDate" |
| | | /> |
| | | <wd-drop-menu-item |
| | | v-model="status" |
| | | label-key="dictLabel" |
| | | value-key="dictValue" |
| | | :options="statusList" |
| | | @change="handleResStatu" |
| | | /> |
| | | </wd-drop-menu> |
| | | <!-- <wd-drop-menu>--> |
| | | <!-- <wd-drop-menu-item--> |
| | | <!-- v-model="resTypeId"--> |
| | | <!-- label-key="dictLabel"--> |
| | | <!-- value-key="dictValue"--> |
| | | <!-- :options="resTypeList"--> |
| | | <!-- @change="handleResType"--> |
| | | <!-- />--> |
| | | <!-- <wd-drop-menu-item--> |
| | | <!-- v-model="filterDate"--> |
| | | <!-- :options="filterDateList"--> |
| | | <!-- @change="handleFilterDate"--> |
| | | <!-- />--> |
| | | <!-- <wd-drop-menu-item--> |
| | | <!-- v-model="status"--> |
| | | <!-- label-key="dictLabel"--> |
| | | <!-- value-key="dictValue"--> |
| | | <!-- :options="statusList"--> |
| | | <!-- @change="handleResStatu"--> |
| | | <!-- />--> |
| | | <!-- </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-center"> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <text class="ml-1 text-sm">{{ item.resCode }}</text> |
| | | <text class="text-color-gray ml-2 text-mini">æ¥å:{{ item.createTime }}</text> |
| | | </view> |
| | | |
| | | <view> |
| | | <wd-tag size="small" v-if="item.status === '1'" type="warning">å·²æ¥å</wd-tag> |
| | | <wd-tag size="small" v-else-if="item.status === '2'" type="primary">ç»´ä¿®ä¸</wd-tag> |
| | | <wd-tag size="small" v-else-if="item.status === '3'" type="success">已宿</wd-tag> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <view class="flex h-[240rpx] items-center"> |
| | | <image |
| | | v-if="item.reqType === '1'" |
| | | class="slot-img text-center" |
| | | src="/static/ico/ico-huiyi.png" |
| | | /> |
| | | <image |
| | | v-else-if="item.reqType === '2'" |
| | | class="slot-img text-center" |
| | | src="/static/ico/ico-setting.png" |
| | | /> |
| | | <image |
| | | v-else-if="item.reqType === '3'" |
| | | class="slot-img text-center" |
| | | src="/static/ico/ico-faxian.png" |
| | | /> |
| | | <view class="flex-1 mt-1"> |
| | | <view class="text-color-base"> |
| | | <template v-if="item.reqType === '1'"> |
| | | <text>设å¤ç±»å</text> |
| | | <text class="mx-2">|</text> |
| | | <text>{{ item.equName }}</text> |
| | | </template> |
| | | |
| | | <template v-if="item.reqType === '2'"> |
| | | <text>å·¥å
፱Ȍ</text> |
| | | <text class="mx-2">|</text> |
| | | <text>{{ item.fixtureName }}</text> |
| | | </template> |
| | | |
| | | <template v-if="item.reqType === '3'"> |
| | | <text>å
¶ä»ç±»å</text> |
| | | </template> |
| | | <view class="text-color-gray mt-1 text-mini"> |
| | | <text>æ¥ä¿®äºº: {{ item.reqUserName }}</text> |
| | | </view> |
| | | <view class="text-color-gray mt-1 text-mini"> |
| | | <text>æ¥ä¿®æ¶é´: {{ item.reqTime }}</text> |
| | | </view> |
| | | |
| | | <view class="text-color-gray mt-1 text-mini"> |
| | | <text>ç»´ä¿®å¼å§: {{ item.startTime }}</text> |
| | | </view> |
| | | <view class="text-color-gray mt-1 text-mini"> |
| | | <text>ç»´ä¿®ç»æ: {{ item.endTime }}</text> |
| | | </view> |
| | | <view class="text-color-gray mt-1 text-mini"> |
| | | <text>维修人: {{ item.resUserName }}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view> |
| | | <!--æä½å·¥æç»´ä¿®å·¥è§è²--> |
| | | <template v-if="isOperatorOrRepair()"> |
| | | <wd-button |
| | | v-if="item.status === '1'" |
| | | size="small" |
| | | icon="edit-outline" |
| | | @click.stop="handleStartRepair(item)" |
| | | > |
| | | å¼å§ç»´ä¿® |
| | | </wd-button> |
| | | <wd-button |
| | | v-else-if="item.status === '2'" |
| | | size="small" |
| | | icon="edit-outline" |
| | | @click.stop="itemClick(item)" |
| | | > |
| | | ç»´ä¿®ä¸ |
| | | </wd-button> |
| | | <view class="h-full flex flex-col" v-else-if="item.status === '3'"> |
| | | <wd-button size="small" icon="warn-bold" @click.stop="itemClick(item)"> |
| | | 详æ
|
| | | </wd-button> |
| | | <wd-button |
| | | class="mt-4" |
| | | size="small" |
| | | icon="edit-outline" |
| | | @click.stop="goToFeedBack(item)" |
| | | > |
| | | æ¥çè¯ä»· |
| | | </wd-button> |
| | | </view> |
| | | </template> |
| | | |
| | | <!--管çåè§è²--> |
| | | <template v-else-if="isLeader()"> |
| | | <wd-button |
| | | v-if="item.status === '1'" |
| | | size="small" |
| | | icon="warn-bold" |
| | | disabled |
| | | @click.stop="itemClick(item)" |
| | | > |
| | | å¾
ç»´ä¿® |
| | | </wd-button> |
| | | <wd-button |
| | | v-else-if="item.status === '2'" |
| | | size="small" |
| | | icon="warn-bold" |
| | | disabled |
| | | @click.stop="itemClick(item)" |
| | | > |
| | | ç»´ä¿®ä¸ |
| | | </wd-button> |
| | | <view class="h-full flex flex-col" v-else-if="item.status === '3'"> |
| | | <wd-button size="small" icon="warn-bold" @click.stop="itemClick(item)"> |
| | | 详æ
|
| | | </wd-button> |
| | | <wd-button |
| | | class="mt-4" |
| | | size="small" |
| | | icon="edit-outline" |
| | | @click.stop="goToFeedBack(item)" |
| | | > |
| | | {{ item.fbId == null ? 'åè¯ä»·' : 'æ¥çè¯ä»·' }} |
| | | </wd-button> |
| | | </view> |
| | | </template> |
| | | </view> |
| | | </view> |
| | | </wd-card> |
| | | <res-card v-for="(item, index) in dataList" :key="item.id" :item="item" @click="handleResClick" /> |
| | | </view> |
| | | </z-paging> |
| | | </template> |
| | |
| | | import { useToast, useMessage } from 'wot-design-uni' |
| | | import { getRepairResList, addRepairRes, updateRepairRes } from '@/service/repair' |
| | | import { DICT_REPAIR_RES_STATUS, DICT_REPAIR_REQ_TYPE, getDictInfo } from '@/service/dict' |
| | | import { isLeader, isOperatorOrRepair } from '@/utils/RoleUtils' |
| | | import { isLeader, isLineOrRepair, isRepair } from "@/utils/RoleUtils"; |
| | | import { useUserStore } from '@/store' |
| | | import { formatDate } from '@/utils/DateUtils' |
| | | import dayjs from "dayjs"; |
| | | import ResCard from "@/components/repair/res-card.vue"; |
| | | const userStore = useUserStore() |
| | | |
| | | const message = useMessage() |
| | |
| | | ]) |
| | | const resTypeList = ref<any>([{ dictLabel: 'ææç±»å', dictValue: -1 }]) |
| | | const statusList = ref<any>([{ dictLabel: 'ææç¶æ', dictValue: -1 }]) |
| | | function handleResType({ value }) { |
| | | reloadData() |
| | | } |
| | | function handleResStatu({ value }) { |
| | | reloadData() |
| | | } |
| | | function handleFilterDate({ value }) { |
| | | reloadData() |
| | | } |
| | | // function handleResType({ value }) { |
| | | // reloadData() |
| | | // } |
| | | // function handleResStatu({ value }) { |
| | | // reloadData() |
| | | // } |
| | | // function handleFilterDate({ value }) { |
| | | // reloadData() |
| | | // } |
| | | |
| | | const paging = ref(null) |
| | | const dataList = ref([]) |
| | |
| | | const queryParams: any = { |
| | | pageNum, |
| | | pageSize, |
| | | reqType: resTypeId.value, |
| | | status: status.value, |
| | | params: {}, |
| | | // reqType: resTypeId.value, |
| | | // status: status.value, |
| | | } |
| | | if (resTypeId.value === -1) { |
| | | delete queryParams.reqType |
| | | } |
| | | if (status.value === -1) { |
| | | delete queryParams.status |
| | | } |
| | | |
| | | if (filterDate.value === '1') { |
| | | // è·åå½åæ¥æ |
| | | const now = dayjs() |
| | | queryParams.params = { |
| | | beginReqTime: now.startOf('day').format('YYYY-MM-DD 00:00:00'), |
| | | endReqTime: now.endOf('day').format('YYYY-MM-DD 23:59:59'), |
| | | } |
| | | } else if (filterDate.value === '2') { |
| | | const now = dayjs() |
| | | queryParams.params = { |
| | | beginReqTime: now.startOf('month').format('YYYY-MM-DD 00:00:00'), |
| | | endReqTime: now.endOf('month').format('YYYY-MM-DD 23:59:59'), |
| | | } |
| | | } else { |
| | | delete queryParams.params |
| | | } |
| | | // if (resTypeId.value === -1) { |
| | | // delete queryParams.reqType |
| | | // } |
| | | // if (status.value === -1) { |
| | | // delete queryParams.status |
| | | // } |
| | | // |
| | | // if (filterDate.value === '1') { |
| | | // // è·åå½åæ¥æ |
| | | // const now = dayjs() |
| | | // queryParams.params = { |
| | | // beginReqTime: now.startOf('day').format('YYYY-MM-DD 00:00:00'), |
| | | // endReqTime: now.endOf('day').format('YYYY-MM-DD 23:59:59'), |
| | | // } |
| | | // } else if (filterDate.value === '2') { |
| | | // const now = dayjs() |
| | | // queryParams.params = { |
| | | // beginReqTime: now.startOf('month').format('YYYY-MM-DD 00:00:00'), |
| | | // endReqTime: now.endOf('month').format('YYYY-MM-DD 23:59:59'), |
| | | // } |
| | | // } else { |
| | | // delete queryParams.params |
| | | // } |
| | | // 妿æ¯ä»æ«ç 页é¢è¿æ¥ï¼åªè½æ¥è¯¢åºå®è®¾å¤çæ°æ® |
| | | if (option?.from === 'scan') { |
| | | queryParams.assetNo = option.assetNo |
| | | } |
| | | queryParams.params.status = '0,1,2,3' |
| | | queryParams.reqUser = userStore?.userInfo?.userId |
| | | if (isRepair()) { |
| | | queryParams.params.status = null |
| | | queryParams.resUser = userStore?.userInfo?.userId |
| | | delete queryParams.reqUser |
| | | delete queryParams.params |
| | | } |
| | | getRepairResList(queryParams) |
| | | .then((res: any) => { |
| | |
| | | paging.value.reload() |
| | | } |
| | | |
| | | /** |
| | | * æ¡ç®ç¹å»äºä»¶ |
| | | * @param item |
| | | */ |
| | | function itemClick(item: any) { |
| | | goToDetail(item) |
| | | } |
| | | |
| | | /** |
| | | * å¼å§ç»´ä¿® |
| | | * @param item |
| | | */ |
| | | function handleStartRepair(item: any) { |
| | | // 确认å¼å§ä¿®æ¹ç¶æä¸º2-ç»´ä¿®ä¸ |
| | | const data = Object.assign({}, item) |
| | | // 确认å¼å§ä¿®æ¹ç¶æä¸º2-ç»´ä¿®ä¸ |
| | | data.status = '2' |
| | | // 设置å¼å§ç»´ä¿®æ¶é´ |
| | | data.startTime = formatDate(new Date()) |
| | | message |
| | | .confirm({ |
| | | msg: 'ç¡®å®å¼å§ç»´ä¿®ï¼', |
| | | title: 'æç¤º', |
| | | beforeConfirm: ({ resolve }) => { |
| | | updateRepair(data, resolve) |
| | | }, |
| | | }) |
| | | .then(() => {}) |
| | | .catch((error) => { |
| | | console.log(error) |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°ç»´ä¿®å·¥å |
| | | * @param data |
| | | * @param resolve |
| | | */ |
| | | function updateRepair(data: any, resolve: any) { |
| | | updateRepairRes(data) |
| | | .then((res: any) => { |
| | | resolve(true) |
| | | if (res?.code === 200) { |
| | | reloadData() |
| | | // ç»´ä¿®ä¸ç¶ææéè¦è·³è½¬ |
| | | if (data?.status === '2') { |
| | | goToDetail(data) |
| | | } |
| | | } |
| | | }) |
| | | .catch((res) => { |
| | | console.error(res) |
| | | }) |
| | | } |
| | | |
| | | function goToDetail(item) { |
| | | uni.navigateTo({ |
| | | url: `/pages/repair/res-detail?id=${item.id}`, |
| | | }) |
| | | } |
| | | |
| | | function goToFeedBack(item) { |
| | | uni.navigateTo({ |
| | | url: `/pages/repair/repair-fb?id=${item.id}`, |
| | | }) |
| | | } |
| | | // /** |
| | | // * æ¡ç®ç¹å»äºä»¶ |
| | | // * @param item |
| | | // */ |
| | | // function itemClick(item: any) { |
| | | // goToDetail(item) |
| | | // } |
| | | // |
| | | // /** |
| | | // * å¼å§ç»´ä¿® |
| | | // * @param item |
| | | // */ |
| | | // function handleStartRepair(item: any) { |
| | | // // 确认å¼å§ä¿®æ¹ç¶æä¸º2-ç»´ä¿®ä¸ |
| | | // const data = Object.assign({}, item) |
| | | // // 确认å¼å§ä¿®æ¹ç¶æä¸º2-ç»´ä¿®ä¸ |
| | | // data.status = '2' |
| | | // // 设置å¼å§ç»´ä¿®æ¶é´ |
| | | // data.startTime = formatDate(new Date()) |
| | | // message |
| | | // .confirm({ |
| | | // msg: 'ç¡®å®å¼å§ç»´ä¿®ï¼', |
| | | // title: 'æç¤º', |
| | | // beforeConfirm: ({ resolve }) => { |
| | | // updateRepair(data, resolve) |
| | | // }, |
| | | // }) |
| | | // .then(() => {}) |
| | | // .catch((error) => { |
| | | // console.log(error) |
| | | // }) |
| | | // } |
| | | // |
| | | // /** |
| | | // * æ´æ°ç»´ä¿®å·¥å |
| | | // * @param data |
| | | // * @param resolve |
| | | // */ |
| | | // function updateRepair(data: any, resolve: any) { |
| | | // updateRepairRes(data) |
| | | // .then((res: any) => { |
| | | // resolve(true) |
| | | // if (res?.code === 200) { |
| | | // reloadData() |
| | | // // ç»´ä¿®ä¸ç¶ææéè¦è·³è½¬ |
| | | // if (data?.status === '2') { |
| | | // goToDetail(data) |
| | | // } |
| | | // } |
| | | // }) |
| | | // .catch((res) => { |
| | | // console.error(res) |
| | | // }) |
| | | // } |
| | | // |
| | | // function goToDetail(item) { |
| | | // uni.navigateTo({ |
| | | // url: `/pages/repair/res-detail?id=${item.id}`, |
| | | // }) |
| | | // } |
| | | // |
| | | // function goToFeedBack(item) { |
| | | // uni.navigateTo({ |
| | | // url: `/pages/repair/repair-fb?id=${item.id}`, |
| | | // }) |
| | | // } |
| | | const goBack = () => { |
| | | uni.navigateBack() |
| | | } |
| | | function handleClickRight() { |
| | | if (isLeader()) { |
| | | toast.info('请ç»å½ç»´ä¿®å·¥è´¦å·æ¥å') |
| | | } else if (isOperatorOrRepair()) { |
| | | handleSelectReq() |
| | | } |
| | | } |
| | | // function handleClickRight() { |
| | | // if (isLineOrRepair()) { |
| | | // handleSelectReq() |
| | | // } else { |
| | | // toast.info('请ç»å½æ¥ä¿®å·¥è´¦å·æ¥å') |
| | | // } |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * éæ©æ¥ä¿®å |
| | | */ |
| | | function handleSelectReq() { |
| | | uni.navigateTo({ |
| | | url: '/pages/repair/req-list', |
| | | events: { |
| | | // 为æå®äºä»¶æ·»å ä¸ä¸ªçå¬å¨ï¼è·å被æå¼é¡µé¢ä¼ éå°å½å页é¢çæ°æ® |
| | | selectReq: function (data) { |
| | | console.error(data) |
| | | // éæ©æ¥ä¿®ååï¼ä¿®æ¹æ¥ä¿®åç¶æåæ°å¢ç»´ä¿®å·¥å |
| | | const resCode = `WXD${data.data.code.slice(3)}` |
| | | const deptId = userStore?.userInfo?.deptId |
| | | const userId = userStore?.userInfo?.userId |
| | | const resData = { |
| | | reqId: data.data.id, |
| | | reqCode: data.data.code, |
| | | reqUser: data.data.reqUser, |
| | | reqDept: data.data.reqDept, |
| | | resCode, |
| | | status: '1', |
| | | resUser: userId, |
| | | resDept: deptId, |
| | | } |
| | | addRepairRes(resData) |
| | | .then((res: any) => { |
| | | if (res.code === 200) { |
| | | toast.success(res?.msg || 'æä½æå') |
| | | reloadData() |
| | | } else { |
| | | toast.error(res?.msg || 'çæç»´ä¿®å·¥å失败ï¼è¯·éè¯') |
| | | } |
| | | }) |
| | | .catch((res) => { |
| | | toast.error(res?.msg || 'çæç»´ä¿®å·¥å失败ï¼è¯·éè¯') |
| | | }) |
| | | }, |
| | | }, |
| | | success: function (res) { |
| | | // éè¿eventChannelå被æå¼é¡µé¢ä¼ éæ°æ® |
| | | res.eventChannel.emit('OnSelectReq', { data: 'ç»´ä¿®å页é¢éæ©æ¥ä¿®å' }) |
| | | }, |
| | | }) |
| | | } |
| | | // |
| | | // /** |
| | | // * éæ©æ¥ä¿®å |
| | | // */ |
| | | // function handleSelectReq() { |
| | | // uni.navigateTo({ |
| | | // url: '/pages/repair/req-list', |
| | | // events: { |
| | | // // 为æå®äºä»¶æ·»å ä¸ä¸ªçå¬å¨ï¼è·å被æå¼é¡µé¢ä¼ éå°å½å页é¢çæ°æ® |
| | | // selectReq: function (data) { |
| | | // console.error(data) |
| | | // // éæ©æ¥ä¿®ååï¼ä¿®æ¹æ¥ä¿®åç¶æåæ°å¢ç»´ä¿®å·¥å |
| | | // const resCode = `WXD${data.data.code.slice(3)}` |
| | | // const deptId = userStore?.userInfo?.deptId |
| | | // const userId = userStore?.userInfo?.userId |
| | | // const resData = { |
| | | // reqId: data.data.id, |
| | | // reqCode: data.data.code, |
| | | // reqUser: data.data.reqUser, |
| | | // reqDept: data.data.reqDept, |
| | | // resCode, |
| | | // status: '1', |
| | | // resUser: userId, |
| | | // resDept: deptId, |
| | | // } |
| | | // addRepairRes(resData) |
| | | // .then((res: any) => { |
| | | // if (res.code === 200) { |
| | | // toast.success(res?.msg || 'æä½æå') |
| | | // reloadData() |
| | | // } else { |
| | | // toast.error(res?.msg || 'çæç»´ä¿®å·¥å失败ï¼è¯·éè¯') |
| | | // } |
| | | // }) |
| | | // .catch((res) => { |
| | | // toast.error(res?.msg || 'çæç»´ä¿®å·¥å失败ï¼è¯·éè¯') |
| | | // }) |
| | | // }, |
| | | // }, |
| | | // success: function (res) { |
| | | // // éè¿eventChannelå被æå¼é¡µé¢ä¼ éæ°æ® |
| | | // res.eventChannel.emit('OnSelectReq', { data: 'ç»´ä¿®å页é¢éæ©æ¥ä¿®å' }) |
| | | // }, |
| | | // }) |
| | | // } |
| | | |
| | | async function initData() { |
| | | const rList: any = await getDictInfo(DICT_REPAIR_REQ_TYPE) |
| | |
| | | onLoad((options) => { |
| | | Object.assign(option, options) |
| | | initData() |
| | | uni.$on('res-list-refresh', reloadData) |
| | | uni.$on('list-refresh', reloadData) |
| | | }) |
| | | onUnload(() => { |
| | | uni.$off('res-list-refresh', reloadData) |
| | | uni.$off('list-refresh', reloadData) |
| | | }) |
| | | </script> |
| | | |
| | |
| | | <view class="h-[1px] bg-base"></view> |
| | | <view class="bg-white flex justify-around py-4"> |
| | | <wd-button icon="edit-outline" @click.stop="handleInsp">ç¹æ£</wd-button> |
| | | <wd-button icon="laptop" @click.stop="handMaint">ä¿å
»</wd-button> |
| | | <wd-button icon="tools" @click.stop="showActions">ç»´ä¿®</wd-button> |
| | | <wd-button icon="laptop" v-if="isRepair() || isLeader()" @click.stop="handMaint"> |
| | | ä¿å
» |
| | | </wd-button> |
| | | <wd-button icon="laptop" @click.stop="handleRequest">æ¥ä¿®</wd-button> |
| | | <!-- <wd-button icon="tools" @click.stop="showActions">ç»´ä¿®</wd-button>--> |
| | | </view> |
| | | </view> |
| | | <view class="h-[10px] bg-base"></view> |
| | | <wd-tabs v-model="tab"> |
| | | |
| | | <wd-tab title="维修请æ±"> |
| | | <view class="h-[10px] bg-base"></view> |
| | | <!-- 维修请æ±åºå --> |
| | | <view class="mt-2" v-if="reqList.length > 0"> |
| | | |
| | | |
| | | <view class="bg-base"> |
| | | <req-card |
| | | v-for="item in reqList" |
| | | :key="item.id" |
| | | :item="item" |
| | | @click="handleReqClick" |
| | | /> |
| | | </view> |
| | | </view> |
| | | </wd-tab> |
| | | <wd-tab title="ç»´ä¿®å"> |
| | | <view class="h-[10px] bg-base"></view> |
| | | <!-- ç»´ä¿®ååºå --> |
| | | <view class="mt-2" v-if="resList.length > 0"> |
| | | |
| | | |
| | | <view class="bg-base"> |
| | | <res-card v-for="item in resList" :key="item.id" :item="item" /> |
| | | </view> |
| | | </view> |
| | | </wd-tab> |
| | | </wd-tabs> |
| | | |
| | | <wd-action-sheet |
| | | v-model="show" |
| | |
| | | <script setup lang="ts"> |
| | | import dayjs from 'dayjs' |
| | | import type { EquVO } from '@/service/equ.d' |
| | | import type { RepairReqVO, RepairResVO } from '@/service/repair.d' |
| | | import { useToast, useMessage } from 'wot-design-uni' |
| | | import { getEquByAssetNo } from '@/service/equ' |
| | | import { getInspStByStId } from '@/service/inspect' |
| | | import { isLeader, isRepair } from '@/utils/RoleUtils' |
| | | import { getRepairReqList, getRepairResList } from '@/service/repair' |
| | | import ReqCard from '@/components/repair/req-card.vue' |
| | | import ResCard from '@/components/repair/res-card.vue' |
| | | import { useUserStore } from '@/store' |
| | | const tab = ref<number>(0) |
| | | const message = useMessage() |
| | | const toast = useToast() |
| | | const model = reactive<EquVO>({}) |
| | | |
| | | const userStore = useUserStore() |
| | | const scanResult = ref<string>('') |
| | | const show = ref<boolean>(false) |
| | | const exist = ref<boolean>(false) |
| | | const reqList = ref<RepairReqVO[]>([]) |
| | | const resList = ref<RepairResVO[]>([]) |
| | | const actions = ref([ |
| | | { |
| | | name: 'æ°å¢æ¥ä¿®', |
| | |
| | | if (res?.equId) { |
| | | exist.value = true |
| | | Object.assign(model, res) |
| | | // å 载维修请æ±åç»´ä¿®åæ°æ® |
| | | loadRepairData(res.equId) |
| | | } else { |
| | | toast.error('æªæ¥è¯¢å°è¯¥èµäº§ç¼å·ç¸å
³æ°æ®ï¼') |
| | | } |
| | |
| | | toast.error(res?.data?.msg || '请æ±å¤±è´¥') |
| | | }) |
| | | } |
| | | |
| | | // å 载维修请æ±åç»´ä¿®åæ°æ® |
| | | function loadRepairData(equId: string | number) { |
| | | // å è½½æªæ¥åçç»´ä¿®è¯·æ± |
| | | getRepairReqList({ |
| | | equId, |
| | | status: '0', |
| | | }).then((res: any) => { |
| | | if (res?.rows) { |
| | | reqList.value = res.rows |
| | | } |
| | | }) |
| | | |
| | | // å è½½æªå®æçç»´ä¿®å |
| | | const params = { |
| | | equId, |
| | | params: { |
| | | status: '0,1,2', |
| | | }, |
| | | } |
| | | // 妿æ¯ç»´ä¿®å·¥åå è½½æ¬è¦æ¥åçç»´ä¿®å |
| | | if (isRepair()) { |
| | | params.resUser = userStore?.userInfo?.userId |
| | | params.params.status = '0,1,2' |
| | | } |
| | | getRepairResList(params).then((res: any) => { |
| | | if (res?.rows) { |
| | | resList.value = res.rows |
| | | } |
| | | }) |
| | | } |
| | | |
| | | function handleInfo() { |
| | | uni.showToast({ |
| | | title: 'åè½å¼åä¸', |
| | |
| | | }) |
| | | } |
| | | |
| | | function handleRequest() { |
| | | if (!model?.assetNo) { |
| | | uni.showToast({ |
| | | title: 'æªæ¥è¯¢å°è®¾å¤ï¼è¯·è系管çåï¼', |
| | | icon: 'none', |
| | | }) |
| | | return false |
| | | } |
| | | uni.navigateTo({ |
| | | url: `/pages/repair/repair-add?equId=${model?.equId}&equName=${model?.equName}&from=scan`, |
| | | }) |
| | | } |
| | | |
| | | function showActions() { |
| | | show.value = true |
| | | } |
| | |
| | | function close() { |
| | | show.value = false |
| | | } |
| | | |
| | | function select({ item, index }) { |
| | | console.error(model?.equId) |
| | | console.error(!model?.equId) |
| | |
| | | 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}`, |
| | | // }) |
| | | // } |
| | | |
| | | onLoad((options) => { |
| | | uni.$on('list-refresh', loadRepairData) |
| | | scanResult.value = options?.result |
| | | initData(options?.result) |
| | | }) |
| | | onUnload(() => { |
| | | uni.$off('list-refresh', loadRepairData) |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | |
| | | "/pages/my/index" | |
| | | "/pages/repair/repair-add" | |
| | | "/pages/repair/repair-fb" | |
| | | "/pages/repair/req-detail" | |
| | | "/pages/repair/req-list" | |
| | | "/pages/repair/res-detail" | |
| | | "/pages/repair/res-list" | |
| | |
| | | export const ROLE_REPAIR = 'repair' |
| | | |
| | | /** |
| | | * 设å¤ç®¡çå |
| | | */ |
| | | export const ROLE_EQU_ADMIN = 'equadmin' |
| | | |
| | | /** |
| | | * ç»å½è§è²æ¯æä½å·¥æç»´ä¿®å·¥ |
| | | */ |
| | | export const isOperatorOrRepair = () => { |
| | | // const roles = useUserStore()?.userInfo?.roles || [] |
| | | // return roles.includes(ROLE_OPERATOR) || roles.includes(ROLE_REPAIR) |
| | | return true |
| | | export const isLineOrRepair = () => { |
| | | const roles = useUserStore()?.userInfo?.roles || [] |
| | | return roles.includes(ROLE_LINE) || roles.includes(ROLE_REPAIR) |
| | | } |
| | | |
| | | |
| | | export const isOperator = () => { |
| | | const roles = useUserStore()?.userInfo?.roles || [] |
| | | return roles.includes(ROLE_OPERATOR) |
| | | } |
| | | |
| | | export const isRepair = () => { |
| | | const roles = useUserStore()?.userInfo?.roles || [] |
| | | return roles.includes(ROLE_REPAIR) |
| | | } |
| | | |
| | | export const isLine = () => { |
| | | const roles = useUserStore()?.userInfo?.roles || [] |
| | | return roles.includes(ROLE_LINE) |
| | | } |
| | | |
| | | export const isSuperAdmin = () => { |
| | | const roles = useUserStore()?.userInfo?.roles || [] |
| | | return roles.includes(ROLE_SUPER_ADMIN) |
| | | } |
| | | |
| | | export const isEquAdmin = () => { |
| | | const roles = useUserStore()?.userInfo?.roles || [] |
| | | return roles.includes(ROLE_EQU_ADMIN) |
| | | } |
| | | |
| | | /** |
| | |
| | | export const isLeader = () => { |
| | | const roles = useUserStore()?.userInfo?.roles || [] |
| | | return ( |
| | | roles.includes(ROLE_LINE) || roles.includes(ROLE_SUPER_ADMIN) || roles.includes(ROLE_LEADER) |
| | | roles.includes(ROLE_SUPER_ADMIN) || roles.includes(ROLE_EQU_ADMIN) || roles.includes(ROLE_LEADER) |
| | | ) |
| | | } |
| | | |
| | |
| | | if (roles.includes(ROLE_REPAIR)) { |
| | | return '维修工' |
| | | } |
| | | if (roles.includes(ROLE_EQU_ADMIN)) { |
| | | return '设å¤ç®¡çå' |
| | | } |
| | | } |
| | |
| | | * 宿 |
| | | */ |
| | | String WANCHENG = "3"; |
| | | |
| | | /** |
| | | * è¯ä»· |
| | | */ |
| | | String PINGJIA = "4"; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | private Long fbId; |
| | | |
| | | private String faultType; |
| | | |
| | | |
| | | } |
| | |
| | | /** |
| | | * ç¹æ£å¨æ |
| | | */ |
| | | @NotNull(message = "ç¹æ£å¨æä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | // @NotNull(message = "ç¹æ£å¨æä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long inspCycle; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * ç¹æ£äºº |
| | | */ |
| | | @NotNull(message = "ç¹æ£äººä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | // @NotNull(message = "ç¹æ£äººä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long inspUser; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @NotNull(message = "䏿¬¡æ§è¡æ¶é´ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | // @NotNull(message = "䏿¬¡æ§è¡æ¶é´ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date inspNextTime; |
| | | |
| | |
| | | */ |
| | | private String remark; |
| | | |
| | | private String statusLt; |
| | | |
| | | |
| | | } |
| | |
| | | import lombok.EqualsAndHashCode; |
| | | import jakarta.validation.constraints.*; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | /** |
| | |
| | | private String assetNo;//设å¤èµäº§ç¼å· |
| | | |
| | | |
| | | private Long equId; |
| | | |
| | | |
| | | private String statusLt; |
| | | |
| | | private List<EimsSpareBo> spareParts; |
| | | |
| | | |
| | | |
| | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | |
| | | @Translation(type = TransConstant.REPAIR_REQ_ID_TO_CODE, mapper = "reqId") |
| | | private String reqCode;//æ¥ä¿®ç¼ç |
| | | |
| | | private List<EimsSpareVo> spareParts; |
| | | |
| | | |
| | | } |
| | |
| | | qw.eq(bo.getInspUser() != null, "st.maint_user", bo.getInspUser()); |
| | | qw.eq(bo.getVerifyUser() != null, "st.verify_user", bo.getVerifyUser()); |
| | | qw.eq(bo.getStatus() != null, "st.status", bo.getStatus()); |
| | | qw.eq(bo.getUpdateBy() != null, "st.update_by", bo.getUpdateBy()); |
| | | qw.orderByDesc( "st.create_time"); |
| | | return qw; |
| | | } |
| | |
| | | package org.dromara.eims.service.impl; |
| | | |
| | | import org.dromara.common.core.constant.DictConstants; |
| | | import org.dromara.common.core.service.RepairResService; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | |
| | | bo.setId(add.getId()); |
| | | //æ°å¢æ¶æ´æ°repair_res表è¯ä»·id |
| | | EimsRepairRes eimsRepairRes = repairResMapper.selectById(bo.getResId()); |
| | | eimsRepairRes.setStatus(DictConstants.REPAIR_RES_STATUS_DETAIL.PINGJIA); |
| | | eimsRepairRes.setFbId(add.getId()); |
| | | repairResMapper.updateById(eimsRepairRes); |
| | | } |
| | |
| | | qw.eq(bo.getRepairUser() != null, "a.repair_user", bo.getRepairUser()); |
| | | qw.eq(StringUtils.isNotBlank(bo.getFaultType()), "a,fault_type", bo.getFaultType()); |
| | | qw.in(params.containsKey("createBy"), "a.create_by", (List<Long>) params.get("createBy")); |
| | | qw.eq(params.containsKey("status"), "a.status", params.get("status")); |
| | | Object status = params.get("status") == null ? "" : params.get("status"); |
| | | |
| | | String[] split = status.toString().split(","); |
| | | qw.in(params.containsKey("status"), "a.status", split); |
| | | qw.between(params.get("beginReqTime") != null && params.get("endReqTime") != null, |
| | | "a.req_time", params.get("beginReqTime"), params.get("endReqTime")); |
| | | |
| | | |
| | | qw.ne(StringUtils.isNotBlank(bo.getStatusLt()), "a.status", bo.getStatusLt()); |
| | | qw.eq(bo.getCreateBy()!=null, "a.create_by", bo.getCreateBy()); |
| | | qw.eq(StringUtils.isNotEmpty(bo.getStatus()), "a.status", bo.getStatus()); |
| | | qw.orderByDesc("a.create_time"); |
| | |
| | | import org.dromara.common.core.constant.DictConstants; |
| | | import org.dromara.common.core.domain.model.LoginUser; |
| | | import org.dromara.common.core.service.RepairResService; |
| | | import org.dromara.common.core.utils.DateUtils; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.SpringUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.dromara.common.satoken.utils.LoginHelper; |
| | | import org.dromara.eims.domain.*; |
| | | import org.dromara.eims.domain.vo.EimsEquVo; |
| | | import org.dromara.eims.domain.vo.EimsFixtureVo; |
| | | import org.dromara.eims.domain.vo.EimsRepairReqVo; |
| | | import org.dromara.eims.domain.bo.EimsSpareInoutBo; |
| | | import org.dromara.eims.domain.vo.*; |
| | | import org.dromara.eims.mapper.*; |
| | | import org.dromara.eims.service.IEimsSpareInoutService; |
| | | import org.dromara.eims.utils.DataFilterUtil; |
| | | import org.dromara.system.domain.SysDept; |
| | | import org.dromara.system.domain.vo.SysDeptVo; |
| | |
| | | import org.redisson.misc.LogHelper; |
| | | import org.springframework.stereotype.Service; |
| | | import org.dromara.eims.domain.bo.EimsRepairResBo; |
| | | import org.dromara.eims.domain.vo.EimsRepairResVo; |
| | | import org.dromara.eims.service.IEimsRepairResService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | private final EimsRepairRecordMapper recordMapper; |
| | | private final EimsEquMapper equMapper; |
| | | private final EimsFixtureMapper fixtureMapper; |
| | | private final IEimsSpareInoutService spareInoutService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç»´ä¿®å·¥å |
| | |
| | | EimsRepairReqVo reqVo = reqMapper.selectVoById(reqId); |
| | | resVo.setReqType(reqVo.getReqType()); |
| | | resVo.setReqCode(reqVo.getCode()); |
| | | resVo.setReqDesc(reqVo.getReqDesc()); |
| | | |
| | | if(reqVo.getEquId()!=null){ |
| | | EimsEquVo equVo = equMapper.selectVoById(reqVo.getEquId()); |
| | |
| | | } |
| | | } |
| | | |
| | | resVo.setSpareParts(querySpareParts(resVo.getResCode())); |
| | | |
| | | } |
| | | return resVo; |
| | | } |
| | | |
| | | |
| | | public List<EimsSpareVo> querySpareParts(String code) { |
| | | // æ¥è¯¢å
³èçå¤ä»¶ï¼å
³ç³»å¦ä¸ï¼å¤ä»¶åºå
¥åºåçassociatedOrder å
³èä¼ å
¥çcode,å¤ä»¶åºå
¥åºæç»éè¿åºå
¥åºåçidå
³èï¼å¤ä»¶åç§°éè¿åºå
¥åºæç»ä¸çspareIdå
³è |
| | | |
| | | EimsSpareInoutBo bo = new EimsSpareInoutBo(); |
| | | bo.setAssociatedOrder(code); |
| | | List<EimsSpareInoutVo> list = spareInoutService.queryList(bo); |
| | | if (!list.isEmpty()) { |
| | | // æ¥è¯¢å¤ä»¶æç»ååç§° |
| | | EimsSpareInoutVo eimsSpareInoutVo = spareInoutService.queryById(list.get(0).getId()); |
| | | return eimsSpareInoutVo.getSpareList(); |
| | | } |
| | | return List.of(); |
| | | } |
| | | |
| | | /** |
| | |
| | | recordMapper.insert(record); |
| | | } |
| | | validEntityBeforeSave(update); |
| | | // 夿å¤ä»¶å表æ¯å¦ä¸ºç©ºï¼ä¸ä¸ºç©ºåæ°å¢ä¸ä¸ªå¤ä»¶åºåºåï¼åæ¶å¢å åºåºæç» |
| | | if (bo.getSpareParts() != null && bo.getSpareParts().size() > 0) { |
| | | EimsSpareInoutBo spareInoutBo = new EimsSpareInoutBo(); |
| | | // æ ¹æ®æ¥æçæåå·ï¼æ ¼å¼ä¸ºCK+æ¥æ+æµæ°´å· |
| | | spareInoutBo.setOrderCode("CK"+ DateUtils.dateTimeNow("yyyyMMddHHmmss")); |
| | | spareInoutBo.setOrderTime(new Date()); |
| | | spareInoutBo.setType(DictConstants.SPARE_INOUT_TYPE_DETAIL.CK); |
| | | spareInoutBo.setPartnerName(loginUser.getNickname()); |
| | | spareInoutBo.setSpareList(bo.getSpareParts()); |
| | | spareInoutBo.setChargeUser(loginUser.getUserId()); |
| | | spareInoutBo.setChargeDept(loginUser.getDeptId()); |
| | | spareInoutBo.setAssociatedOrder(bo.getResCode()); |
| | | // ä¿åè¿æ°æ®åº |
| | | Boolean b = spareInoutService.insertByBo(spareInoutBo); |
| | | |
| | | |
| | | } |
| | | return baseMapper.updateById(update) > 0; |
| | | } |
| | | |
| | |
| | | qw.eq(bo.getReqType() != null, "req.req_type", bo.getReqType()); |
| | | qw.eq(bo.getReqUser() != null, "res.req_user", bo.getReqUser()); |
| | | qw.eq(bo.getAssetNo() != null, "equ.asset_no", bo.getAssetNo()); |
| | | qw.eq(bo.getEquId() != null, "req.equ_id", bo.getEquId()); |
| | | |
| | | qw.between(params.get("beginReqTime") != null && params.get("endReqTime") != null, |
| | | "req.req_time", params.get("beginReqTime"), params.get("endReqTime")); |
| | |
| | | |
| | | |
| | | qw.eq(StringUtils.isNotBlank(bo.getStatus()), "res.status", bo.getStatus()); |
| | | String s = params.get("status") == null ? "" : params.get("status").toString(); |
| | | String[] status = s.split(","); |
| | | qw.in(params.get("status") != null, "res.status", status); |
| | | qw.orderByDesc("res.create_time"); |
| | | return qw; |
| | | } |