车间能级提升-智能设备管理系统
zhuguifei
2025-04-24 f0610c371668b042d36d7772cb04b49a2afc69ea
完成移动端保养
已修改13个文件
609 ■■■■ 文件已修改
eims-ui-mobile/src/pages.json 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/inspect/insp-record.vue 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/inspect/insp-st.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/maint/maint-order.vue 198 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/maint/maint-st.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/maint/order-detail.vue 191 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/service/maint.d.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/service/maint.ts 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsMaintOrderBo.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsMaintStBo.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/EimsInspectStVo.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsInspectStServiceImpl.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsMaintStServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages.json
@@ -92,11 +92,26 @@
    {
      "path": "pages/inspect/insp-record",
      "type": "page",
      "layout": "default",
      "needLogin": true,
      "style": {
        "navigationBarTitleText": "点检记录",
        "navigationStyle": "custom",
        "navigationBarBackgroundColor": "#4D80F0"
        "app-plus": {
          "titleNView": {
            "buttons": [
              {
                "text": "提交",
                "fontSize": "14px",
                "color": "#FFFFFF"
              },
              {
                "text": "",
                "fontSize": "24px",
                "color": "#FFFFFF"
              }
            ]
          }
        }
      }
    },
    {
@@ -119,11 +134,26 @@
    {
      "path": "pages/maint/maint-order",
      "type": "page",
      "layout": "default",
      "needLogin": true,
      "style": {
        "navigationBarTitleText": "保养工单",
        "navigationStyle": "custom",
        "navigationBarBackgroundColor": "#4D80F0"
        "app-plus": {
          "titleNView": {
            "buttons": [
              {
                "text": "提交",
                "fontSize": "14px",
                "color": "#FFFFFF"
              },
              {
                "text": "",
                "fontSize": "24px",
                "color": "#FFFFFF"
              }
            ]
          }
        }
      }
    },
    {
@@ -138,11 +168,26 @@
    {
      "path": "pages/maint/order-detail",
      "type": "page",
      "layout": "default",
      "needLogin": true,
      "style": {
        "navigationBarTitleText": "工单明细",
        "navigationStyle": "custom",
        "navigationBarBackgroundColor": "#4D80F0"
        "app-plus": {
          "titleNView": {
            "buttons": [
              {
                "text": "提交",
                "fontSize": "14px",
                "color": "#FFFFFF"
              },
              {
                "text": "",
                "fontSize": "24px",
                "color": "#FFFFFF"
              }
            ]
          }
        }
      }
    },
    {
eims-ui-mobile/src/pages/inspect/insp-record.vue
@@ -1,26 +1,31 @@
<route lang="json5">
{
  layout: 'default',
  needLogin: true,
  style: {
    navigationBarTitleText: '点检记录',
    navigationStyle: 'custom',
    navigationBarBackgroundColor: '#4D80F0',
    'app-plus': {
      titleNView: {
        buttons: [
          {
            text: '提交',
            fontSize: '14px',
            color: '#FFFFFF',
          },
          {
            text: '',
            fontSize: '24px',
            color: '#FFFFFF',
          },
        ],
      },
    },
  },
}
</route>
<template>
  <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time>
    <template #top>
      <wd-navbar
        title="点检记录"
        left-arrow
        @click-left="goBack"
        right-text="提交"
        @click-right="handleClickRight"
        custom-style="background: #4D80F0;"
        safeAreaInsetTop
      ></wd-navbar>
      <wd-card type="rectangle">
        <template #title>
          <view class="flex justify-between">
@@ -35,7 +40,7 @@
            </view>
          </view>
        </template>
        <view class="flex h-[100rpx]" items-center>
        <view class="flex h-[140rpx]" items-center>
          <image class="slot-img text-center" src="/static/images/camera.png" />
          <view class="flex-1">
            <view class="text-color-gray text-xs mt-1 flex">
@@ -60,6 +65,9 @@
                <wd-icon class="icon-color-base" name="detection" size="40rpx"></wd-icon>
                <text class="ml-1">进行中</text>
              </template>
            </view>
            <view class="text-color-gray text-xs mt-2 flex">
              创建时间: {{inspSt.createTime}}
            </view>
          </view>
        </view>
@@ -152,6 +160,7 @@
  equName: string
  assetNo: string
  planTimeStr?: string
  createTime?: string
  status: string
  inspUser: number | string
  specialNote: string
@@ -170,6 +179,7 @@
  equName: '',
  assetNo: '',
  planTimeStr: '',
  createTime: '',
  status: '',
  inspUser: '',
  specialNote: '',
@@ -207,9 +217,11 @@
const goBack = () => {
  uni.navigateBack()
}
function handleClickRight() {
onNavigationBarButtonTap((e) => {
  if (e.index === 0) {
  handleConfirm()
}
})
const toggleCollapse = () => {
  isAllExpanded.value = !isAllExpanded.value
@@ -243,6 +255,7 @@
  updateInspRecordBatch(params)
    .then((res: any) => {
      updateInspSt(resolve)
      toast.success("操作成功")
    })
    .catch((res) => {
      console.error(res)
@@ -283,6 +296,7 @@
  inspSt.equName = options.equName
  inspSt.assetNo = options.assetNo
  inspSt.planTimeStr = options.planTimeStr
  inspSt.createTime = options.createTime
  inspSt.specialNote = options?.specialNote
  inspSt.inspUser = userStore?.userInfo?.userId
})
eims-ui-mobile/src/pages/inspect/insp-st.vue
@@ -37,7 +37,7 @@
            </view>
          </view>
        </template>
        <view class="flex h-[100rpx]" items-center>
        <view class="flex h-[140rpx]" items-center>
          <image class="slot-img text-center" src="/static/images/camera.png" />
          <view class="flex-1">
            <view class="text-color-gray text-xs mt-1 flex">
@@ -62,6 +62,9 @@
                <wd-icon class="icon-color-base" name="detection" size="40rpx"></wd-icon>
                <text class="ml-1">进行中</text>
              </template>
            </view>
            <view class="text-color-gray text-xs mt-2 flex">
              创建时间: {{item.createTime}}
            </view>
          </view>
          <wd-button size="small" icon="edit-outline" @click.stop="itemClick(item)">明细</wd-button>
@@ -113,7 +116,7 @@
function itemClick(item) {
  const inspCode = `${item.equId}_${item.planTime}_${viewMode.value}`
  uni.navigateTo({
    url: `/pages/inspect/insp-record?id=${item.id}&inspCode=${inspCode}&specialNote=${item.specialNote ?? ''}&equName=${item.equName ?? ''}&assetNo=${item.assetNo ?? ''}&planTimeStr=${item.planTimeStr ?? ''}`,
    url: `/pages/inspect/insp-record?id=${item.id}&createTime=${item.createTime}&inspCode=${inspCode}&specialNote=${item.specialNote ?? ''}&equName=${item.equName ?? ''}&assetNo=${item.assetNo ?? ''}&planTimeStr=${item.planTimeStr ?? ''}`,
  })
}
eims-ui-mobile/src/pages/maint/maint-order.vue
@@ -1,26 +1,38 @@
<route lang="json5" type="page">
{
  layout: 'default',
  needLogin: true,
  style: {
    navigationBarTitleText: '保养工单',
    navigationStyle: 'custom',
    navigationBarBackgroundColor: '#4D80F0',
    'app-plus': {
      titleNView: {
        buttons: [
          {
            text: '提交',
            fontSize: '14px',
            color: '#FFFFFF',
          },
          {
            text: '',
            fontSize: '24px',
            color: '#FFFFFF',
          },
        ],
      },
    },
  },
}
</route>
<template>
  <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time>
  <z-paging
    ref="paging"
    v-model="dataList"
    @query="queryList"
    :auto="false"
    show-refresher-update-time
  >
    <template #top>
      <wd-navbar
        title="保养工单"
        left-arrow
        @click-left="goBack"
        right-text="提交"
        @click-right="handleClickRight"
        custom-style="background: #4D80F0;"
        safeAreaInsetTop
      ></wd-navbar>
      <wd-cell>
        <template #title>
          <text class="text-color-gray">设备</text>
@@ -41,7 +53,7 @@
            </view>
          </view>
        </template>
        <view class="flex h-[100rpx]" items-center>
        <view class="flex h-[140rpx]" items-center>
          <image class="slot-img text-center" src="/static/images/camera.png" />
          <view class="flex-1">
            <view class="text-color-gray text-xs mt-1 flex">
@@ -58,7 +70,7 @@
            </view>
            <view class="text-color-gray text-xs mt-2 flex">
              <text>状态:</text>
              <template v-if="maintSt.orderCount === maintSt.wcCount">
              <template v-if="maintSt.status === '1'">
                <wd-icon class="icon-color-success" name="check-outline" size="34rpx"></wd-icon>
                <text class="ml-1">已完成</text>
              </template>
@@ -66,6 +78,10 @@
                <wd-icon class="icon-color-base" name="detection" size="40rpx"></wd-icon>
                <text class="ml-1">进行中</text>
              </template>
            </view>
            <view class="text-color-gray text-xs mt-2 flex">
              创建时间: {{ maintSt.createTime }}
            </view>
          </view>
        </view>
@@ -129,14 +145,24 @@
          </view>
          <!--操作工或维修工角色-->
          <template v-if="isOperatorOrRepair()">
            <view class="flex flex-col justify-between"  v-if="item.status === '0'">
            <wd-button
              v-if="item.status === '0'"
              size="small"
              icon="edit-outline"
              @click.stop="handleStartMaint(item)"
            >
              开始保养
            </wd-button>
              <wd-button
                class="mt-3"
                size="small"
                icon="edit-outline"
                @click.stop="handleMaintFinish(item)"
              >
                一键保养
              </wd-button>
            </view>
            <wd-button
              v-if="item.status === '1'"
              size="small"
@@ -167,20 +193,10 @@
          <!--管理员角色-->
          <template v-else-if="isLeader()">
            <wd-button
              v-if="item.status === '0'"
              size="small"
              icon="warn-bold"
              disabled
            >
            <wd-button v-if="item.status === '0'" size="small" icon="warn-bold" disabled>
              待保养
            </wd-button>
            <wd-button
              v-if="item.status === '1'"
              size="small"
              icon="warn-bold"
              disabled
            >
            <wd-button v-if="item.status === '1'" size="small" icon="warn-bold" disabled>
              保养中
            </wd-button>
@@ -226,14 +242,17 @@
</template>
<script setup lang="ts">
import type { MaintStVO } from '@/service/maint.d'
import { getMaintSt, getMaintStOrderList, updateMaintOrder } from '@/service/maint'
import { getMaintSt, getMaintStOrderList, updateMaintOrder, updateMaintSt } from '@/service/maint'
import { ref, reactive } from 'vue'
import { useToast, useMessage } from 'wot-design-uni'
import { isLeader, isOperatorOrRepair } from '@/utils/RoleUtils'
import { formatDate } from '@/utils/DateUtils'
const message = useMessage()
const toast = useToast()
const paging = ref(null)
const dataList = ref([])
const maintStId = ref('')
interface QueryParams {
  pageNum: number
@@ -247,6 +266,7 @@
  equName: '',
  assetNo: '',
  planTime: '',
  createTime: '',
  orderCount: null,
  wcCount: null,
  dbyCount: null,
@@ -260,7 +280,6 @@
    pageSize,
    maintCode: maintCode.value,
  }
  getMaintStOrderList(params)
    .then((res: any) => {
      // 请勿在网络请求回调中给dataList赋值!!只需要调用complete就可以了
@@ -271,6 +290,17 @@
      // 注意,每次都需要在catch中写这句话很麻烦,z-paging提供了方案可以全局统一处理
      // 在底层的网络请求抛出异常时,写uni.$emit('z-paging-error-emit');即可
      paging.value.complete(false)
    })
}
function initMaintSt(id: any) {
  getMaintSt(id)
    .then((res: any) => {
      Object.assign(maintSt, res)
      paging.value.reload()
    })
    .catch((res) => {
      console.error(res)
      toast.error(res?.data?.msg || '请求失败')
    })
}
@@ -284,15 +314,44 @@
  })
}
/**
 * 开始保养
 * @param item
 */
function handleStartMaint(item) {
  // 确认开始修改状态为1-保养中
  const data = Object.assign({}, item)
  data.status = '1'
  message
    .confirm({
      msg: '确定开始保养?',
      title: '提示',
      beforeConfirm: ({ resolve }) => {
        // 确认开始修改状态为1-保养中
        updateOrder(data, resolve)
      },
    })
    .then(() => {})
    .catch((error) => {
      console.log(error)
    })
}
/**
 * 一键保养
 * @param item
 */
function handleMaintFinish(item) {
  // 一键保养
        const data = Object.assign({}, item)
        data.status = '1'
  data.status = '2'
  data.startTime = formatDate(new Date())
  data.endTime = formatDate(new Date())
  message
    .confirm({
      msg: '确定使用一键保养?',
      title: '提示',
      beforeConfirm: ({ resolve }) => {
        updateOrder(data, resolve)
      },
    })
@@ -308,25 +367,85 @@
 * @param resolve
 */
function updateOrder(data: any, resolve: any) {
  updateMaintOrder(data)
    .then((res: any) => {
      resolve(true)
      if (res?.code === 200) {
        reloadData()
        // 保养状态才需要跳转
        if(data?.status === '1'){
          goToOrderDetail(data)
        }
      }
    })
    .catch((res) => {
      console.error(res)
    })
}
function reloadData() {
  paging.value.reload()
}
const goBack = () => {
  uni.navigateBack()
function handleUpdateMaintSt() {
  if (maintSt.orderCount !== maintSt.wcCount) {
    toast.info('请先完成所有保养项!')
    return false
}
function handleClickRight() {}
  const data: any = Object.assign(
    {},
    {
      id: maintSt.id,
      orderCount: maintSt.orderCount,
      wcCount: maintSt.wcCount,
      status: maintSt.status,
      specialNote: maintSt.specialNote,
    },
  )
  if (data.orderCount === data.wcCount) {
    data.status = '1'
  }
  message
    .confirm({
      msg: '确定更新工单汇总数据?',
      title: '提示',
      beforeConfirm: ({ resolve }) => {
        updateMaintSt(data)
          .then((res: any) => {
            resolve(true)
            if (res?.code === 200) {
              reloadData()
              toastSucces()
            }
          })
          .catch((res) => {
            console.error(res)
          })
      },
    })
    .then(() => {})
    .catch((error) => {
      console.log(error)
    })
}
function toastSucces() {
  toast.success('操作成功')
}
function reloadData() {
  initMaintSt(maintStId.value)
}
onNavigationBarButtonTap((e) => {
  if (e.index === 0) {
    handleUpdateMaintSt()
  }
})
onLoad(() => {
  uni.$on('maint-order-refresh', reloadData)
})
onUnload(() => {
  uni.$off('maint-order-refresh', reloadData)
})
/**
 * 查询保养明细需要的code
@@ -334,9 +453,8 @@
const maintCode = computed(() => `${maintSt.equId}_${maintSt.planTime}`)
onLoad((options) => {
  const itemString = decodeURIComponent(options.maintSt)
  const item = JSON.parse(itemString)
  Object.assign(maintSt, item)
  maintStId.value = options.id
  reloadData()
})
</script>
eims-ui-mobile/src/pages/maint/maint-st.vue
@@ -37,7 +37,7 @@
            </view>
          </view>
        </template>
        <view class="flex h-[100rpx]" items-center>
        <view class="flex h-[140rpx]" items-center>
          <image class="slot-img text-center" src="/static/images/camera.png" />
          <view class="flex-1">
            <view class="text-color-gray text-xs mt-1 flex">
@@ -54,7 +54,7 @@
            </view>
            <view class="text-color-gray text-xs mt-2 flex">
              <text>状态:</text>
              <template v-if="item.orderCount === item.wcCount">
              <template v-if="item.status=== '1'">
                <wd-icon class="icon-color-success" name="check-outline" size="34rpx"></wd-icon>
                <text class="ml-1">已完成</text>
              </template>
@@ -62,6 +62,9 @@
                <wd-icon class="icon-color-base" name="detection" size="40rpx"></wd-icon>
                <text class="ml-1">进行中</text>
              </template>
            </view>
            <view class="text-color-gray text-xs mt-2 flex">
              创建时间: {{item.createTime}}
            </view>
          </view>
          <wd-button size="small" icon="edit-outline" @click.stop="itemClick(item)">明细</wd-button>
@@ -131,9 +134,8 @@
}
function itemClick(item) {
  const itemString = encodeURIComponent(JSON.stringify(item))
  uni.navigateTo({
    url: `/pages/maint/maint-order?maintSt=${itemString}`,
    url: `/pages/maint/maint-order?id=${item.id}`,
  })
}
@@ -145,7 +147,7 @@
  uni.$on('maint-st-refresh', reloadData)
})
onUnload(() => {
  uni.$off('maint-st-refres', reloadData)
  uni.$off('maint-st-refresh', reloadData)
})
</script>
eims-ui-mobile/src/pages/maint/order-detail.vue
@@ -1,25 +1,30 @@
<route lang="json5" type="page">
{
  layout: 'default',
  needLogin: true,
  style: {
    navigationBarTitleText: '工单明细',
    navigationStyle: 'custom',
    navigationBarBackgroundColor: '#4D80F0',
    'app-plus': {
      titleNView: {
        buttons: [
          {
            text: '提交',
            fontSize: '14px',
            color: '#FFFFFF',
          },
          {
            text: '',
            fontSize: '24px',
            color: '#FFFFFF',
          },
        ],
      },
    },
  },
}
</route>
<template>
  <view class="bg-base h-[100vh]">
    <wd-navbar
      title="工单明细"
      left-arrow
      @click-left="goBack"
      right-text="提交"
      @click-right="handleClickRight"
      custom-style="background: #4D80F0;"
      safeAreaInsetTop
    ></wd-navbar>
  <view class="bg-base container" safeAreaInsetTopBottom>
    <wd-form ref="form" :model="order" :rules="rules">
      <wd-cell-group custom-class="group" title="设备信息" border>
        <wd-cell title="设备名称" title-width="200rpx" is-link>
@@ -40,24 +45,12 @@
        <wd-cell title="计划保养日期" title-width="200rpx" is-link>
          <text>{{ order?.planTime }}</text>
        </wd-cell>
        <wd-datetime-picker
          label="保养开始时间"
          label-width="200rpx"
          placeholder="请选择时间"
          prop="startTime"
          v-model="startTime"
          @open="openStartTime"
          @confirm="handleStartTime"
        />
        <wd-datetime-picker
          label="保养结束时间"
          label-width="200rpx"
          placeholder="请选择时间"
          prop="endTime"
          v-model="endTime"
          @open="openEndTime"
          @confirm="handleEndTime"
        />
        <wd-cell title="保养开始时间" title-width="200rpx" is-link>
          <text>{{ order?.startTime }}</text>
        </wd-cell>
        <wd-cell title="保养完成时间" title-width="200rpx" is-link>
          <text>{{ order?.endTime }}</text>
        </wd-cell>
        <wd-textarea
          label="工作描述"
@@ -89,25 +82,54 @@
          clearable
        />
      </wd-cell-group>
      <view class="h-[2px] w-full bg-base"></view>
      <!--是否显示管理员验证按钮 (工单状态为2-待验证  且登录人role-leader管理员角色)-->
      <wd-cell
        title="验证通过(管理员)"
        title-width="200px"
        v-if="order.status === '2' && isLeader()"
      >
        <view style="text-align: right">
          <wd-switch v-model="isVerify" />
        </view>
      </wd-cell>
      <!--是否显示操作工保养完成 (工单状态为1-保养中 且登录人role-操作工角色)-->
      <wd-cell
        title="保养完成(操作工)"
        title-width="200px"
        v-if="order.status === '1' && isOperatorOrRepair()"
      >
        <view style="text-align: right">
          <wd-switch v-model="isFinish" />
        </view>
      </wd-cell>
    </wd-form>
    <view class="h-[100rpx]"></view>
  </view>
</template>
<script setup lang="ts">
import { getMaintOrder, updateMaintOrder } from '@/service/maint'
import { formatDate } from '@/utils/DateUtils'
import { reactive } from 'vue'
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'
const toast = useToast()
const message = useMessage()
const fileList = ref<[]>()
const startTime = ref<number>(0)
const endTime = ref<number>(0)
// 管理员验是否通过
const isVerify = ref(false)
// 操作工保养是完成
const isFinish = ref(false)
interface MaintOrder {
  id: string
  equName: string
  assetNo: string
  status: string
  maintCode: string
  maintName: string
  planTime: string
@@ -120,6 +142,8 @@
const order = reactive<MaintOrder>({
  id: '',
  equName: '',
  assetNo: '',
  status: '',
  maintCode: '',
  maintName: '',
  planTime: '',
@@ -149,23 +173,6 @@
    },
  ],
}
function openStartTime() {
  if (startTime.value === 0) {
    startTime.value = Date.now()
  }
}
function openEndTime() {
  if (endTime.value === 0) {
    endTime.value = Date.now()
  }
}
function handleStartTime(value) {
  order.startTime = formatDate(new Date(value.value))
}
function handleEndTime(value) {
  order.endTime = formatDate(new Date(value.value))
}
function handleFileChange({ fileList }) {}
@@ -173,33 +180,32 @@
  getMaintOrder(id)
    .then((res: any) => {
      Object.assign(order, res)
      startTime.value = new Date(order.startTime).getTime()
      endTime.value = new Date(order.endTime).getTime()
    })
    .catch((res) => {})
}
function updateOrder(resolve: any) {
  updateMaintOrder(order)
function updateOrder(data: any, resolve: any) {
  updateMaintOrder(data)
    .then((res: any) => {
      resolve(true)
      toastSucces()
      uni.$emit('maint-order-refresh')
    })
    .catch((res) => {
      console.error(res)
    })
}
const goBack = () => {
  uni.navigateBack()
function toastSucces() {
  toast.success('操作成功')
}
function handleClickRight() {
function handleClickRight(data: any) {
  message
    .confirm({
      msg: '确定提交?',
      title: '提示',
      beforeConfirm: ({ resolve }) => {
        updateOrder(resolve)
        updateOrder(data, resolve)
      },
    })
    .then(() => {})
@@ -208,21 +214,64 @@
    })
}
onNavigationBarButtonTap((e) => {
  if (e.index === 0) {
    // 管理员角色 且待验证状态
    if (isLeader()) {
      switch (order.status) {
        case '0':
        case '1':
          toast.warning('当前工单等待操作工保养状态,不可操作')
          break
        case '2':
          // 勾选验证,可提交
          if (isVerify.value) {
            // 修改工单状态为已完成
            const data: any = Object.assign({}, { id: order.id, status: order.status })
            data.status = '3'
            handleClickRight(data)
          } else {
            toast.warning('请选择是否验证通过')
          }
          break
        case '3':
          toast.warning('当前工单完成状态,不可操作')
          break
      }
    } else if (isOperatorOrRepair()) {
      switch (order.status) {
        case '0':
          break
        case '1':
          {
            const data = Object.assign({}, order)
            // 勾选工单完成,改变状态
            if (isFinish.value) {
              // 修改工单状态为待验证
              data.status = '2'
            }
            handleClickRight(data)
          }
          break
        case '2':
          toast.warning('当前工单等待管理验证状态,不可操作')
          break
        case '3':
          toast.warning('当前工单完成状态,不可操作')
          break
      }
    }
  }
})
onMounted(() => {})
onLoad((options) => {
  initMaintOrder(options.id)
})
</script>
<style scoped lang="scss">
:deep(.wd-navbar__text) {
  font-size: 26rpx;
  color: white;
}
:deep(.wd-icon-arrow-left:before),
:deep(.wd-navbar__title) {
  color: white;
  font-weight: bold !important;
  font-size: 32rpx;
.container {
  height: 100vh;
}
</style>
eims-ui-mobile/src/service/maint.d.ts
@@ -16,6 +16,7 @@
  equName?: string;
  assetNo?: string;
  status?: string;
  createTime?: string;
  /**
   *
eims-ui-mobile/src/service/maint.ts
@@ -10,6 +10,15 @@
  return http.get<MaintStVO>(`/eims/maintSt/${id}`)
}
/**
 * 更新工单汇总
 * @param data
 */
export const updateMaintSt = (data: any) => {
  return http.put<void>('/eims/maintSt', data)
}
/**
 * 保养汇总列表
 */
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsMaintOrderBo.java
@@ -31,7 +31,6 @@
    /**
     *
     */
    @NotNull(message = "设备id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long equId;
    /**
@@ -57,7 +56,6 @@
    /**
     * 计划表冗余-保养人
     */
    @NotNull(message = "计划表冗余-保养人不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long maintUser;
    /**
@@ -68,13 +66,11 @@
    /**
     * 计划表冗余-保养部门
     */
    @NotNull(message = "计划表冗余-保养部门不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long maintDept;
    /**
     * 保养单号
     */
    @NotBlank(message = "保养单号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String maintCode;
    /**
@@ -90,13 +86,11 @@
    /**
     *
     */
    @NotBlank(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
    private String status;
    /**
     * 保养计划时间
     */
    @NotNull(message = "保养计划时间不能为空", groups = { AddGroup.class, EditGroup.class })
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date planTime;
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsMaintStBo.java
@@ -31,20 +31,17 @@
    /**
     *
     */
    @NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
    private String title;
    /**
     *
     */
    @NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long equId;
    private String equName;
    private String assetNo;
    /**
     *
     */
    @NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date planTime;
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/EimsInspectStVo.java
@@ -2,6 +2,7 @@
import java.util.Date;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.eims.domain.EimsInspectSt;
@@ -25,7 +26,7 @@
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = EimsInspectSt.class)
public class EimsInspectStVo implements Serializable {
public class EimsInspectStVo extends BaseEntity implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsInspectStServiceImpl.java
@@ -49,7 +49,53 @@
     */
    @Override
    public EimsInspectStVo queryById(Long id){
        return baseMapper.selectVoById(id);
        EimsInspectStVo stVo = baseMapper.selectVoById(id);
        return stVo;
    }
    /**
     *
     * @param stVo
     * @param type Day-日视图 Month-月视图
     */
    private void fillStDataSingle(EimsInspectStVo stVo,String type) {
            LambdaQueryWrapper<EimsInspectRecord> recordLqw = Wrappers.lambdaQuery();
            recordLqw.eq(EimsInspectRecord::getEquId, stVo.getEquId());
            LocalDate planTime = stVo.getPlanTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
            // 月视图查询范围
            LocalDate startOfMonth = planTime.with(TemporalAdjusters.firstDayOfMonth());
            LocalDate endOfMonth = planTime.with(TemporalAdjusters.lastDayOfMonth());
            // 日视图查询范围
            if(type.equals("Day")){
                recordLqw.between(EimsInspectRecord::getPlanTime, planTime, planTime);
            }else {
                //  月视图查询范围
                recordLqw.between(EimsInspectRecord::getPlanTime, startOfMonth, endOfMonth);
            }
            // 执行查询
            List<EimsInspectRecordVo> recordList = recordMapper.selectVoList(recordLqw);
            // TODO 根据字典eims_inspect_status
            Map<String, Long> cMap = recordList.stream()
                .filter(order -> List.of("0", "1").contains(order.getStatus()))
                .collect(Collectors.groupingBy(EimsInspectRecordVo::getStatus, Collectors.counting()));
            // TODO 根据字典eims_inspect_result
            Map<String, Long> rMap = recordList.stream()
                .filter(order ->order.getInspResult()!=null && List.of("1", "2").contains(order.getInspResult()))
                .collect(Collectors.groupingBy(EimsInspectRecordVo::getInspResult, Collectors.counting()));
            stVo.setRecordCount(recordList.size());
            stVo.setUnCheckCount(cMap.getOrDefault("0", 0L).intValue());
            stVo.setCheckCount(cMap.getOrDefault("1", 0L).intValue());
            stVo.setNormalNum(rMap.getOrDefault("1", 0L).intValue());
            stVo.setAbNormalNum(rMap.getOrDefault("2", 0L).intValue());
    }
    /**
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsMaintStServiceImpl.java
@@ -57,7 +57,37 @@
     */
    @Override
    public EimsMaintStVo queryById(Long id) {
        return baseMapper.selectVoById(id);
        EimsMaintStVo stVo = baseMapper.selectVoById(id);
        if(stVo!=null){
            fillStDataSingle(stVo);
        }
        return stVo;
    }
    private void fillStDataSingle(EimsMaintStVo stVo) {
            //1.填充设备
            EimsEqu eimsEqu = equMapper.selectById(stVo.getEquId());
            stVo.setAssetNo(eimsEqu.getAssetNo());
            //2.统计数据
            LambdaQueryWrapper<EimsMaintOrder> orderLqw = Wrappers.lambdaQuery();
            orderLqw.eq(EimsMaintOrder::getEquId, stVo.getEquId());
            LocalDate planTime = stVo.getPlanTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
            LocalDate startOfMonth = planTime.with(TemporalAdjusters.firstDayOfMonth());
            LocalDate endOfMonth = planTime.with(TemporalAdjusters.lastDayOfMonth());
            orderLqw.between(EimsMaintOrder::getPlanTime, startOfMonth, endOfMonth);
            // 执行查询
            List<EimsMaintOrderVo> orderList = orderMapper.selectVoList(orderLqw);
            // TODO 根据字典maint_order_status
            Map<String, Long> cMap = orderList.stream()
                .filter(order -> List.of("0", "1", "2", "3").contains(order.getStatus()))
                .collect(Collectors.groupingBy(EimsMaintOrderVo::getStatus, Collectors.counting()));
            stVo.setOrderCount(orderList.size());
            stVo.setDbyCount(cMap.getOrDefault("0", 0L).intValue());
            stVo.setByCount(cMap.getOrDefault("1", 0L).intValue());
            stVo.setDyzCount(cMap.getOrDefault("2", 0L).intValue());
            stVo.setWcCount(cMap.getOrDefault("3", 0L).intValue());
    }
    /**