车间能级提升-智能设备管理系统
zhuguifei
2025-05-20 7fe7b6182c2d407d28c2c9da1c070c3ce964e3e7
1.移动端添加自定义navbar导航栏

2.移动端添加角色控制操作按钮
已修改18个文件
689 ■■■■ 文件已修改
eims-ui-mobile/src/layouts/default.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages.json 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/equ/equ-list.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/home/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/inspect/insp-record.vue 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/inspect/insp-st.vue 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/maint/maint-order.vue 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/maint/maint-st.vue 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/maint/order-detail.vue 129 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/my/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/repair/repair-add.vue 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/repair/req-list.vue 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/repair/res-list.vue 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/EimsInspectSt.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsInspectStBo.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/EimsInspectStVo.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsInspectStServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsRepairResServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/layouts/default.vue
@@ -13,5 +13,9 @@
  // colorTheme: 'red',
  // buttonPrimaryBgColor: '#07c160',
  // buttonPrimaryColor: '#07c160',
  navbarColor: '#FFFFFF',
  navbarDescFontColor: '#FFFFFF',
  navbarTitleFontSize: '16px',
  navbarDescFontSize: '14px',
}
</script>
eims-ui-mobile/src/pages.json
@@ -69,7 +69,8 @@
      "layout": "default",
      "needLogin": true,
      "style": {
        "navigationBarTitleText": "设备列表"
        "navigationBarTitleText": "设备列表",
        "navigationStyle": "custom"
      }
    },
    {
@@ -105,22 +106,7 @@
      "needLogin": true,
      "style": {
        "navigationBarTitleText": "点检记录",
        "app-plus": {
          "titleNView": {
            "buttons": [
              {
                "text": "提交",
                "fontSize": "14px",
                "color": "#FFFFFF"
              },
              {
                "text": "",
                "fontSize": "24px",
                "color": "#FFFFFF"
              }
            ]
          }
        }
        "navigationStyle": "custom"
      }
    },
    {
@@ -147,22 +133,7 @@
      "needLogin": true,
      "style": {
        "navigationBarTitleText": "保养工单",
        "app-plus": {
          "titleNView": {
            "buttons": [
              {
                "text": "提交",
                "fontSize": "14px",
                "color": "#FFFFFF"
              },
              {
                "text": "",
                "fontSize": "24px",
                "color": "#FFFFFF"
              }
            ]
          }
        }
        "navigationStyle": "custom"
      }
    },
    {
@@ -181,22 +152,7 @@
      "needLogin": true,
      "style": {
        "navigationBarTitleText": "工单明细",
        "app-plus": {
          "titleNView": {
            "buttons": [
              {
                "text": "提交",
                "fontSize": "14px",
                "color": "#FFFFFF"
              },
              {
                "text": "",
                "fontSize": "24px",
                "color": "#FFFFFF"
              }
            ]
          }
        }
        "navigationStyle": "custom"
      }
    },
    {
@@ -212,24 +168,10 @@
      "path": "pages/repair/repair-add",
      "type": "page",
      "layout": "default",
      "needLogin": true,
      "style": {
        "navigationBarTitleText": "添加报修",
        "app-plus": {
          "titleNView": {
            "buttons": [
              {
                "text": "提交",
                "fontSize": "14px",
                "color": "#FFFFFF"
              },
              {
                "text": "",
                "fontSize": "24px",
                "color": "#FFFFFF"
              }
            ]
          }
        }
        "navigationStyle": "custom"
      }
    },
    {
@@ -263,23 +205,8 @@
      "layout": "default",
      "needLogin": true,
      "style": {
        "navigationBarTitleText": "设备报修",
        "app-plus": {
          "titleNView": {
            "buttons": [
              {
                "text": "新增",
                "fontSize": "14px",
                "color": "#FFFFFF"
              },
              {
                "text": "",
                "fontSize": "24px",
                "color": "#FFFFFF"
              }
            ]
          }
        }
        "navigationBarTitleText": "报修列表",
        "navigationStyle": "custom"
      }
    },
    {
@@ -314,22 +241,7 @@
      "needLogin": true,
      "style": {
        "navigationBarTitleText": "设备维修",
        "app-plus": {
          "titleNView": {
            "buttons": [
              {
                "text": "接单",
                "fontSize": "14px",
                "color": "#FFFFFF"
              },
              {
                "text": "",
                "fontSize": "24px",
                "color": "#FFFFFF"
              }
            ]
          }
        }
        "navigationStyle": "custom"
      }
    },
    {
eims-ui-mobile/src/pages/equ/equ-list.vue
@@ -2,14 +2,19 @@
{
  layout: 'default',
  needLogin: true,
  style: {
    navigationBarTitleText: '设备列表',
  },
  style: { navigationBarTitleText: '设备列表', navigationStyle: 'custom' },
}
</route>
<template>
  <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time>
 <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time>
    <template #top>
      <wd-navbar
        title="设备列表"
        left-arrow
        @click-left="goBack"
        custom-style="background: #4D80F0;"
        safeAreaInsetTop
      ></wd-navbar>
      <wd-drop-menu>
        <wd-drop-menu-item
          v-model="equTypeId"
@@ -123,6 +128,10 @@
    })
}
const goBack = () => {
  uni.navigateBack()
}
/**
 * 设备条目点击事件
 * @param item
eims-ui-mobile/src/pages/home/index.vue
@@ -95,6 +95,7 @@
              v-for="(item, index) in commonMenu"
              :key="item.id"
              @click.stop="goItemPage(item)"
              v-show="!(isLeader() && item.custom)"
            >
              <image class="slot-img text-center" :src="item.icon" />
              <text>{{ item.name }}</text>
eims-ui-mobile/src/pages/inspect/insp-record.vue
@@ -2,30 +2,25 @@
{
  layout: 'default',
  needLogin: true,
  style: {
    navigationBarTitleText: '点检记录',
    'app-plus': {
      titleNView: {
        buttons: [
          {
            text: '提交',
            fontSize: '14px',
            color: '#FFFFFF',
          },
          {
            text: '',
            fontSize: '24px',
            color: '#FFFFFF',
          },
        ],
      },
    },
  },
  style: { navigationBarTitleText: '点检记录', navigationStyle: 'custom' },
}
</route>
<template>
  <z-paging ref="paging" v-model="dataList" :auto="false" @query="queryList" show-refresher-update-time>
    <template #top>
      <wd-navbar
        title="点检记录"
        left-arrow
        @click-left="goBack"
        right-text="提交"
        @click-right="handleClickRight"
        custom-style="background: #4D80F0;"
        safeAreaInsetTop
      >
        <template #right>
          <text v-if="isOperatorOrRepair()" class="text-white">提交</text>
        </template>
      </wd-navbar>
      <wd-card type="rectangle">
        <template #title>
          <view class="flex justify-between">
@@ -141,6 +136,7 @@
<script setup lang="ts">
import { ref } from 'vue'
import { useUserStore, useAccessStore, useSystemConfigStore } from '@/store'
import { isLeader, isOperatorOrRepair } from "@/utils/RoleUtils";
import {
  getInspStRecordList,
  getInspSt,
@@ -227,11 +223,13 @@
const goBack = () => {
  uni.navigateBack()
}
onNavigationBarButtonTap((e) => {
  if (e.index === 0) {
function handleClickRight() {
  if(isOperatorOrRepair()){
    handleConfirm()
  }
})
}
const toggleCollapse = () => {
  isAllExpanded.value = !isAllExpanded.value
eims-ui-mobile/src/pages/inspect/insp-st.vue
@@ -13,6 +13,11 @@
    <template #top>
      <wd-drop-menu>
        <wd-drop-menu-item v-model="viewMode" :options="viewModeList" @change="handleViewMode" />
        <wd-drop-menu-item
          v-model="filterDate"
          :options="filterDateList"
          @change="handleFilterDate"
        />
        <wd-drop-menu-item v-model="equName" :options="equList" @change="handleEquName" />
      </wd-drop-menu>
    </template>
@@ -61,9 +66,7 @@
                <text class="ml-1">进行中</text>
              </template>
            </view>
            <view class="text-color-gray text-xs mt-2 flex">
              创建时间: {{item.createTime}}
            </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>
        </view>
@@ -75,15 +78,21 @@
<script setup lang="ts">
import { ref } from 'vue'
import { getInspStList } from '@/service/inspect'
import { onShow } from '@dcloudio/uni-app'
import dayjs from 'dayjs'
const viewMode = ref<string>('Day')
const equName = ref<string>('所有设备')
const filterDate = ref<string>('1')
const viewModeList = ref<Record<string, any>[]>([
  { label: '日视图', value: 'Day' },
  { label: '月视图', value: 'Month' },
])
const filterDateList = ref<Record<string, any>[]>([
  { label: '所有数据', value: '0' },
  { label: '当天(月)数据', value: '1' },
])
const equList = ref<Record<string, any>[]>([{ label: '所有设备', value: '所有设备' }])
function handleViewMode({ value }) {
  reloadData()
@@ -91,14 +100,25 @@
function handleEquName({ value }) {
  console.log(value)
}
function handleFilterDate({ value }) {
  reloadData()
}
const paging = ref(null)
const dataList = ref([])
const queryList = (pageNum?: number, pageSize?: number) => {
  // 这里的pageNo和pageSize会自动计算好,直接传给服务器即可
  // 这里的请求只是演示,请替换成自己的项目的网络请求,并在网络请求回调中通过paging.value.complete(请求回来的数组)将请求结果传给z-paging
  getInspStList({ pageNum, pageSize, viewMode: viewMode.value })
  const params: any = {
    pageNum,
    pageSize,
    viewMode: viewMode.value,
  }
  if (filterDate.value === '1') {
    params.planTime = dayjs().format('YYYY-MM-DD')
  } else {
    delete params.planTime
  }
  getInspStList(params)
    .then((res: any) => {
      // 请勿在网络请求回调中给dataList赋值!!只需要调用complete就可以了
      paging.value.completeByTotal(res.rows, res.total)
eims-ui-mobile/src/pages/maint/maint-order.vue
@@ -2,25 +2,7 @@
{
  layout: 'default',
  needLogin: true,
  style: {
    navigationBarTitleText: '保养工单',
    'app-plus': {
      titleNView: {
        buttons: [
          {
            text: '提交',
            fontSize: '14px',
            color: '#FFFFFF',
          },
          {
            text: '',
            fontSize: '24px',
            color: '#FFFFFF',
          },
        ],
      },
    },
  },
  style: { navigationBarTitleText: '保养工单', navigationStyle: 'custom' },
}
</route>
@@ -33,6 +15,19 @@
    show-refresher-update-time
  >
    <template #top>
      <wd-navbar
        title="保养工单"
        left-arrow
        @click-left="goBack"
        right-text="提交"
        @click-right="handleClickRight"
        custom-style="background: #4D80F0;"
        safeAreaInsetTop
      >
        <template #right>
          <text v-if="isOperatorOrRepair()" class="text-white">提交</text>
        </template>
      </wd-navbar>
      <wd-cell>
        <template #title>
          <text class="text-color-gray">设备</text>
@@ -434,11 +429,17 @@
function reloadData() {
  initMaintSt(maintStId.value)
}
onNavigationBarButtonTap((e) => {
  if (e.index === 0) {
const goBack = () => {
  uni.navigateBack()
}
function handleClickRight() {
  if(isOperatorOrRepair()){
    handleUpdateMaintSt()
  }
})
}
onLoad(() => {
  uni.$on('maint-order-refresh', reloadData)
eims-ui-mobile/src/pages/maint/maint-st.vue
@@ -13,6 +13,11 @@
    <template #top>
      <wd-drop-menu>
        <wd-drop-menu-item v-model="equName" :options="equList" @change="handleEquName" />
        <wd-drop-menu-item
          v-model="filterDate"
          :options="filterDateList"
          @change="handleFilterDate"
        />
        <wd-drop-menu-item v-model="status" :options="statusList" @change="handleStatus" />
      </wd-drop-menu>
    </template>
@@ -73,6 +78,7 @@
<script setup lang="ts">
import { ref } from 'vue'
import { getMaintStList } from '@/service/maint'
import dayjs from 'dayjs'
/**
 * 其他页面传过来的数据
@@ -90,6 +96,7 @@
  assetNo?: string
  equName?: string
  status?: string
  params?: NonNullable<unknown>
}
// 页面参数,上个页面传递过来的参数
@@ -99,6 +106,12 @@
})
const status = ref<string>('-1')
const equName = ref<string>('-1')
const filterDate = ref<string>('1')
const filterDateList = ref<Record<string, any>[]>([
  { label: '所有数据', value: '0' },
  { label: '当月数据', value: '1' },
])
const statusList = ref<Record<string, any>[]>([
  { label: '所有状态', value: '-1' },
@@ -112,6 +125,9 @@
function handleEquName({ value }) {
  console.log(value)
}
function handleFilterDate({ value }) {
  reloadData()
}
const paging = ref(null)
const dataList = ref([])
@@ -119,24 +135,35 @@
const queryList = (pageNum?: number, pageSize?: number) => {
  // 这里的pageNo和pageSize会自动计算好,直接传给服务器即可
  // 这里的请求只是演示,请替换成自己的项目的网络请求,并在网络请求回调中通过paging.value.complete(请求回来的数组)将请求结果传给z-paging
  const params: QueryParams = {
  const queryParams: QueryParams = {
    pageNum,
    pageSize,
    equName: equName.value,
    status: status.value,
  }
  if (filterDate.value === '1') {
    // 获取当前日期
    const now = dayjs()
    queryParams.params = {
      beginPlanTime: now.startOf('month').format('YYYY-MM-DD 00:00:00'),
      endPlanTime: now.endOf('month').format('YYYY-MM-DD 23:59:59'),
    }
  } else {
    delete queryParams.params
  }
  if (equName.value === '-1') {
    delete params.equName
    delete queryParams.equName
  }
  if (status.value === '-1') {
    delete params.status
    delete queryParams.status
  }
  // 如果是从扫码页面过来,只能查询固定设备的数据
  if (option?.from === 'scan') {
    params.assetNo = option.assetNo
    queryParams.assetNo = option.assetNo
  }
  getMaintStList(params)
  getMaintStList(queryParams)
    .then((res: any) => {
      // 请勿在网络请求回调中给dataList赋值!!只需要调用complete就可以了
      paging.value.completeByTotal(res.rows, res.total)
eims-ui-mobile/src/pages/maint/order-detail.vue
@@ -2,29 +2,25 @@
{
  layout: 'default',
  needLogin: true,
  style: {
    navigationBarTitleText: '工单明细',
    'app-plus': {
      titleNView: {
        buttons: [
          {
            text: '提交',
            fontSize: '14px',
            color: '#FFFFFF',
          },
          {
            text: '',
            fontSize: '24px',
            color: '#FFFFFF',
          },
        ],
      },
    },
  },
  style: { navigationBarTitleText: '工单明细', navigationStyle: 'custom' },
}
</route>
<template>
  <view class="bg-base container" safeAreaInsetTopBottom>
    <wd-navbar
      title="保养工单"
      left-arrow
      @click-left="goBack"
      right-text="提交"
      @click-right="handleClickRight"
      custom-style="background: #4D80F0;"
      safeAreaInsetTop
    >
      <template #right>
        <text v-if="isOperatorOrRepair()" class="text-white">提交</text>
        <text v-else-if="isLeader()" class="text-white">验证</text>
      </template>
    </wd-navbar>
    <wd-form ref="form" :model="order" :rules="rules">
      <wd-cell-group custom-class="group" title="设备信息" border>
        <wd-cell title="设备名称" title-width="200rpx" is-link>
@@ -199,7 +195,7 @@
  toast.success('操作成功')
}
function handleClickRight(data: any) {
function handleSubmit(data: any) {
  message
    .confirm({
      msg: '确定提交?',
@@ -214,55 +210,56 @@
    })
}
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('请选择是否验证通过')
const goBack = () => {
  uni.navigateBack()
}
function handleClickRight() {
  // 管理员角色 且待验证状态
  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'
          handleSubmit(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'
          }
          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
      }
          handleSubmit(data)
        }
        break
      case '2':
        toast.warning('当前工单等待管理验证状态,不可操作')
        break
      case '3':
        toast.warning('当前工单完成状态,不可操作')
        break
    }
  }
})
}
onMounted(() => {})
onLoad((options) => {
eims-ui-mobile/src/pages/my/index.vue
@@ -11,12 +11,12 @@
<template>
  <view class="bg-base">
    <wd-cell-group border>
      <wd-cell title="登录用户" :value="realName" icon="user" is-link />
      <wd-cell title="角色" :value="loginRoleName()" icon="bags" is-link />
      <wd-cell title="人员管理" icon="usergroup" is-link @click="handleInfo" />
      <wd-cell title="登录用户" :value="realName" icon="user"  custom-icon-class="icon-color-base" is-link />
      <wd-cell title="角色" :value="loginRoleName()" icon="bags"  custom-icon-class="icon-color-base" is-link />
      <wd-cell title="人员管理" icon="usergroup" is-link  custom-icon-class="icon-color-base" @click="handleInfo" />
    </wd-cell-group>
    <wd-cell-group border class="mt-2">
      <wd-cell title="退出登录" icon="login" is-link @click="handleLogout" />
      <wd-cell title="退出登录" icon="login" is-link  custom-icon-class="icon-color-base" @click="handleLogout" />
    </wd-cell-group>
  </view>
</template>
eims-ui-mobile/src/pages/repair/repair-add.vue
@@ -1,30 +1,22 @@
<route lang="json5" type="page">
{
  layout: 'default',
  style: {
    navigationBarTitleText: '添加报修',
    'app-plus': {
      titleNView: {
        buttons: [
          {
            text: '提交',
            fontSize: '14px',
            color: '#FFFFFF',
          },
          {
            text: '',
            fontSize: '24px',
            color: '#FFFFFF',
          },
        ],
      },
    },
  },
  needLogin: true,
  style: { navigationBarTitleText: '添加报修', navigationStyle: 'custom' },
}
</route>
<template>
  <view class="bg-base">
    <wd-navbar
      title="添加报修"
      left-arrow
      @click-left="goBack"
      right-text="提交"
      @click-right="handleSubmit"
      custom-style="background: #4D80F0;"
      safeAreaInsetTop
    ></wd-navbar>
    <wd-form ref="form" :model="model">
      <wd-cell-group custom-class="group" title="类型信息" border>
        <wd-picker
@@ -243,12 +235,14 @@
  fixtureName: '',
  fileList: [],
})
const goBack = () => {
  uni.navigateBack()
}
/**
 * 选择设备
 */
function handleSelectEqu() {
  if(reqTypeDis.value){
  if (reqTypeDis.value) {
    return false
  }
  uni.navigateTo({
@@ -387,20 +381,17 @@
/**
 * 选择报修类型
 */
function handleConfirmReqType({ value }) {
}
function handleConfirmReqType({ value }) {}
/**
 * 选择故障类别
 */
function handleConfirmFaultType({ value }) {
}
function handleConfirmFaultType({ value }) {}
/**
 * 选择紧急程度
 */
function handleConfirmUrgencyLevel({ value }) {
}
function handleConfirmUrgencyLevel({ value }) {}
async function initData() {
  const reqTypeList = await getDictInfo(DICT_REPAIR_REQ_TYPE)
@@ -412,12 +403,6 @@
  const uList = await getDictInfo(DICT_REPAIR_URGENCY_LEVEL)
  urgencyList.value = uList
}
onNavigationBarButtonTap((e) => {
  if (e.index === 0) {
    handleSubmit()
  }
})
onLoad((options) => {
  Object.assign(option, options)
eims-ui-mobile/src/pages/repair/req-list.vue
@@ -2,30 +2,27 @@
{
  layout: 'default',
  needLogin: true,
  style: {
    navigationBarTitleText: '设备报修',
    'app-plus': {
      titleNView: {
        buttons: [
          {
            text: '新增',
            fontSize: '14px',
            color: '#FFFFFF',
          },
          {
            text: '',
            fontSize: '24px',
            color: '#FFFFFF',
          },
        ],
      },
    },
  },
  style: { navigationBarTitleText: '报修列表', navigationStyle: 'custom' },
}
</route>
<template>
  <z-paging ref="paging" v-model="dataList" :auto="false" @query="queryList" show-refresher-update-time>
  <z-paging
    ref="paging"
    v-model="dataList"
    :auto="false"
    @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-drop-menu v-if="!isSelectReq">
        <wd-drop-menu-item
          v-model="reqTypeId"
@@ -33,6 +30,11 @@
          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"
@@ -138,6 +140,7 @@
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";
const message = useMessage()
const toast = useToast()
@@ -148,6 +151,14 @@
const isSelectReq = ref(false)
const filterDate = ref<string>('2')
const filterDateList = ref<Record<string, any>[]>([
  { label: '所有数据', value: '0' },
  { label: '当天数据', value: '1' },
  { label: '当月数据', value: '2' },
])
const reqTypeList = ref<any>([{ dictLabel: '所有类型', dictValue: -1 }])
const statusList = ref<any>([{ dictLabel: '所有状态', dictValue: -1 }])
function handleReqType({ value }) {
@@ -156,25 +167,47 @@
function handleReqStatu({ value }) {
  reloadData()
}
function handleFilterDate({ value }) {
  reloadData()
}
const paging = ref(null)
const dataList = ref([])
const queryList = (pageNum?: number, pageSize?: number) => {
  const parmams = {
  const queryParams: any = {
    pageNum,
    pageSize,
    reqType: reqTypeId.value,
    status: status.value,
  }
  if (reqTypeId.value === -1) {
    delete parmams.reqType
    delete queryParams.reqType
  }
  if (status.value === -1) {
    delete parmams.status
    delete queryParams.status
  }
  getRepairReqList(parmams)
  if (filterDate.value === '1') {
    // 获取当前日期
    const now = dayjs()
    queryParams.params = {
      beginReqTime: now.startOf('day').format('YYYY-MM-DD 00:00:00'),
      endReqTime: now.endOf('day').format('YYYY-MM-DD 23:59:59'),
    }
  } else if (filterDate.value === '2') {
    const now = dayjs()
    queryParams.params = {
      beginReqTime: now.startOf('month').format('YYYY-MM-DD 00:00:00'),
      endReqTime: now.endOf('month').format('YYYY-MM-DD 23:59:59'),
    }
  } else {
    delete queryParams.params
  }
  getRepairReqList(queryParams)
    .then((res: any) => {
      paging.value.completeByTotal(res.rows, res.total)
    })
@@ -246,13 +279,20 @@
  })
}
onNavigationBarButtonTap((e) => {
  if (e.index === 0 && !isSelectReq.value) {
    uni.navigateTo({
      url: `/pages/repair/repair-add`,
    })
  }
})
const goBack = () => {
  uni.navigateBack()
}
function handleClickRight() {
  // if (e.index === 0 && !isSelectReq.value) {
  //   uni.navigateTo({
  //     url: `/pages/repair/repair-add`,
  //   })
  // }
  uni.navigateTo({
    url: `/pages/repair/repair-add`,
  })
}
const eventChannel = ref<any>()
onMounted(() => {
eims-ui-mobile/src/pages/repair/res-list.vue
@@ -2,30 +2,25 @@
{
  layout: 'default',
  needLogin: true,
  style: {
    navigationBarTitleText: '设备维修',
    'app-plus': {
      titleNView: {
        buttons: [
          {
            text: '接单',
            fontSize: '14px',
            color: '#FFFFFF',
          },
          {
            text: '',
            fontSize: '24px',
            color: '#FFFFFF',
          },
        ],
      },
    },
  },
  style: { navigationBarTitleText: '设备维修', navigationStyle: 'custom' },
}
</route>
<template>
  <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time>
    <template #top>
      <wd-navbar
        title="设备维修"
        left-arrow
        @click-left="goBack"
        right-text="提交"
        @click-right="handleClickRight"
        custom-style="background: #4D80F0;"
        safeAreaInsetTop
      >
        <template #right>
          <text v-if="isOperatorOrRepair()" class="text-white">接单</text>
        </template>
      </wd-navbar>
      <wd-drop-menu>
        <wd-drop-menu-item
          v-model="resTypeId"
@@ -33,6 +28,11 @@
          value-key="dictValue"
          :options="resTypeList"
          @change="handleResType"
        />
        <wd-drop-menu-item
          v-model="filterDate"
          :options="filterDateList"
          @change="handleFilterDate"
        />
        <wd-drop-menu-item
          v-model="status"
@@ -195,6 +195,7 @@
import { isLeader, isOperatorOrRepair } from '@/utils/RoleUtils'
import { useUserStore } from '@/store'
import { formatDate } from '@/utils/DateUtils'
import dayjs from "dayjs";
const userStore = useUserStore()
const message = useMessage()
@@ -222,7 +223,13 @@
const status = ref<number>(-1)
const isSelectRes = ref(false)
const filterDate = ref<string>('2')
const filterDateList = ref<Record<string, any>[]>([
  { label: '所有数据', value: '0' },
  { label: '当天数据', value: '1' },
  { label: '当月数据', value: '2' },
])
const resTypeList = ref<any>([{ dictLabel: '所有类型', dictValue: -1 }])
const statusList = ref<any>([{ dictLabel: '所有状态', dictValue: -1 }])
function handleResType({ value }) {
@@ -231,28 +238,48 @@
function handleResStatu({ value }) {
  reloadData()
}
function handleFilterDate({ value }) {
  reloadData()
}
const paging = ref(null)
const dataList = ref([])
const queryList = (pageNum?: number, pageSize?: number) => {
  const params: any = {
  const queryParams: any = {
    pageNum,
    pageSize,
    reqType: resTypeId.value,
    status: status.value,
  }
  if (resTypeId.value === -1) {
    delete params.reqType
    delete queryParams.reqType
  }
  if (status.value === -1) {
    delete params.status
    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') {
    params.assetNo = option.assetNo
    queryParams.assetNo = option.assetNo
  }
  getRepairResList(params)
  getRepairResList(queryParams)
    .then((res: any) => {
      paging.value.completeByTotal(res.rows, res.total)
    })
@@ -330,16 +357,17 @@
    url: `/pages/repair/repair-fb?id=${item.id}`,
  })
}
onNavigationBarButtonTap((e) => {
  if (e.index === 0) {
    if (isLeader()) {
      toast.info('请登录维修工账号接单')
    } else if (isOperatorOrRepair()) {
      handleSelectReq()
    }
const goBack = () => {
  uni.navigateBack()
}
function handleClickRight() {
  if (isLeader()) {
    toast.info('请登录维修工账号接单')
  } else if (isOperatorOrRepair()) {
    handleSelectReq()
  }
})
}
/**
 * 选择报修单
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/EimsInspectSt.java
@@ -6,6 +6,7 @@
import lombok.EqualsAndHashCode;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
@@ -46,6 +47,8 @@
    /**
     * 计划时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date planTime;
    /**
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsInspectStBo.java
@@ -11,6 +11,7 @@
import jakarta.validation.constraints.*;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
/**
 * 点检汇总业务对象 eims_inspect_st
@@ -48,6 +49,8 @@
    /**
     * 计划时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @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 com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;
@@ -58,6 +59,7 @@
     * 计划时间
     */
    @ExcelProperty(value = "计划时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date planTime;
    private String planTimeStr;
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsInspectStServiceImpl.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.dromara.common.core.constant.DictConstants;
import org.dromara.common.core.utils.DateUtils;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
@@ -244,6 +245,11 @@
        qw.like(StringUtils.isNotBlank(bo.getTitle()), "st.title", bo.getTitle());
        qw.like(StringUtils.isNotBlank(bo.getEquName()), "equ.equ_name", bo.getEquName());
        qw.like(StringUtils.isNotBlank(bo.getAssetNo()), "equ.asset_no", bo.getAssetNo());
        if(bo.getPlanTime()!=null&&bo.getViewMode() != null && bo.getViewMode().equals("Day")){
            qw.eq("DATE_FORMAT(st.plan_time, '%Y-%m-%d')", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,bo.getPlanTime()));
        }else if(bo.getPlanTime()!=null&&bo.getViewMode() != null && bo.getViewMode().equals("Month")){
            qw.eq("DATE_FORMAT(st.plan_time, '%Y-%m')",  DateUtils.parseDateToStr(DateUtils.YYYY_MM,bo.getPlanTime()));
        }
        qw.eq( "st.type", bo.getType());
        qw.between(params.get("beginPlanTime") != null && params.get("endPlanTime") != null,
            "st.plan_time", params.get("beginPlanTime"), params.get("endPlanTime"));
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsRepairResServiceImpl.java
@@ -303,6 +303,9 @@
        qw.eq(bo.getReqUser() != null, "res.req_user", bo.getReqUser());
        qw.eq(bo.getAssetNo() != null, "equ.asset_no", bo.getAssetNo());
        qw.between(params.get("beginReqTime") != null && params.get("endReqTime") != null,
            "req.req_time", params.get("beginReqTime"), params.get("endReqTime"));
        List<Long> resDeptIds = getAllDescendantIds(bo.getResDept());
        qw.in(bo.getResDept() != null, "res.res_dept", resDeptIds);