车间能级提升-智能设备管理系统
feat(eims-ui-mobile): 为多个页面添加搜索功能
- 在 equ-list、insp-st、maint-st、req-list 和 res-list 页面中添加设备名称和资产编号的模糊搜索
已修改7个文件
89 ■■■■ 文件已修改
eims-ui-mobile/src/pages/equ/equ-list.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/home/index.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/inspect/insp-st.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/maint/maint-st.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/repair/req-list.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/repair/res-list.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/service/repair.ts 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/equ/equ-list.vue
@@ -15,6 +15,7 @@
        custom-style="background: #4D80F0;"
        safeAreaInsetTop
      ></wd-navbar>
      <wd-search v-model="searchValue" placeholder="请输入关键字" @search="handleSearch" />
      <wd-drop-menu>
        <wd-drop-menu-item
          v-model="equTypeId"
@@ -85,7 +86,7 @@
const equTypeId = ref<number>(-1)
// 设备状态
const status = ref<number>(-1)
const searchValue = ref<string>('')
const isSelectEqu = ref(false)
const typeList = ref<Record<string, any>[]>([{ dictLabel: '设备类型', dictValue: -1 }])
@@ -108,6 +109,9 @@
    pageSize,
    equTypeId: equTypeId.value,
    status: status.value,
    params: {
      searchValue: searchValue.value,
    },
  }
  if (equTypeId.value === -1) {
    delete parmams.equTypeId
@@ -154,6 +158,11 @@
  }
}
function handleSearch() {
  console.log('handleSearch')
  paging.value.reload()
}
/**
 * 选择设备回调
 * @param equ
eims-ui-mobile/src/pages/home/index.vue
@@ -157,7 +157,7 @@
import { useUserStore } from '@/store'
import { tabbarStore } from '@/components/fg-tabbar/tabbar'
import { getEquList } from '@/service/equ'
import { getRepairResList } from '@/service/repair'
import { getRepairResList, getRepairResUnfinished } from "@/service/repair";
import { getFixtureList } from '@/service/fixture'
import { receiveOrderRepair } from '@/service/mobile'
import { useToast, useMessage } from 'wot-design-uni'
@@ -196,7 +196,8 @@
  getEquList({ pageNum, pageSize })
    .then((res: any) => {
      equTotal.value = res?.total || 0
      queryRepairResList()
      // queryRepairResList()
      queryUnFinishedRepairResList()
      queryFixtureList()
      paging.value.complete(true)
    })
@@ -227,7 +228,7 @@
onLoad(() => {
  // getAllMenus()
  queryEquList()
  queryRepairResList()
  queryUnFinishedRepairResList()
  queryFixtureList()
})
@@ -379,6 +380,15 @@
    .catch((res) => {})
}
function queryUnFinishedRepairResList() {
  getRepairResUnfinished('0,1,2')
    .then((res: any) => {
      console.log("res", res)
      faultTotal.value = res || 0
    })
    .catch((res) => {})
}
function queryFixtureList() {
  getFixtureList({
    page: 1,
eims-ui-mobile/src/pages/inspect/insp-st.vue
@@ -11,6 +11,9 @@
<template>
  <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time>
    <template #top>
      <!-- 增加一个搜索栏 -->
      <wd-search v-model="searchValue" @search="handleSearch">
      </wd-search>
      <wd-tabs v-model="activeTab" @change="handleTabChange">
        <wd-tab title="待点检"></wd-tab>
        <wd-tab title="待确认"></wd-tab>
@@ -88,6 +91,7 @@
const equName = ref<string>('所有设备')
const filterDate = ref<string>('1')
const status = ref<string>('0') // 默认为待点检状态
const searchValue = ref<string>('')
const viewModeList = ref<Record<string, any>[]>([
  { label: '日视图', value: 'Day' },
@@ -137,6 +141,9 @@
    pageSize,
    viewMode: viewMode.value,
    status: status.value, // 添加状态筛选
    params: {
      searchValue: searchValue.value,
    },
  }
  if (filterDate.value === '1') {
    params.planTime = dayjs().format('YYYY-MM-DD')
@@ -172,6 +179,11 @@
  })
}
function handleSearch() {
  console.log('handleSearch')
  paging.value.reload()
}
function reloadData() {
  paging.value.reload()
}
eims-ui-mobile/src/pages/maint/maint-st.vue
@@ -11,6 +11,12 @@
<template>
  <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time>
    <template #top>
      <!-- 增加一个搜索栏 -->
      <wd-search v-model="searchValue" @search="handleSearch">
        <template #right-icon>
          <wd-icon name="scan" size="34rpx"></wd-icon>
        </template>
      </wd-search>
      <wd-tabs v-model="activeTab" @change="handleTabChange">
        <wd-tab title="待保养"></wd-tab>
        <wd-tab title="待确认"></wd-tab>
@@ -86,7 +92,7 @@
import { ref, computed } from 'vue'
import { getMaintStList } from '@/service/maint'
import dayjs from 'dayjs'
const searchValue = ref<string>('')
/**
 * 其他页面传过来的数据
 * assetNo: 资产编号
@@ -191,6 +197,7 @@
    pageSize,
    equName: equName.value,
    status: status.value,
    params: {},
  }
  if (filterDate.value === '1') {
    // 获取当前日期
@@ -200,7 +207,7 @@
      endPlanTime: now.endOf('month').format('YYYY-MM-DD 23:59:59'),
    }
  } else {
    delete queryParams.params
    queryParams.params = {}
  }
  if (equName.value === '-1') {
@@ -213,7 +220,7 @@
  if (option?.from === 'scan') {
    queryParams.assetNo = option.assetNo
  }
  queryParams.params.searchValue = searchValue.value
  getMaintStList(queryParams)
    .then((res: any) => {
      // 请勿在网络请求回调中给dataList赋值!!只需要调用complete就可以了
@@ -233,6 +240,11 @@
  })
}
function handleSearch () {
  console.log('handleSearch')
  paging.value.reload()
}
function reloadData() {
  paging.value.reload()
}
eims-ui-mobile/src/pages/repair/req-list.vue
@@ -23,6 +23,8 @@
        custom-style="background: #4D80F0;"
        safeAreaInsetTop
      ></wd-navbar>
      <!-- 增加一个搜索栏 -->
      <wd-search v-model="searchValue" @search="handleSearch"></wd-search>
<!--      <wd-drop-menu v-if="!isSelectReq">-->
<!--        <wd-drop-menu-item-->
<!--          v-model="reqTypeId"-->
@@ -157,7 +159,7 @@
const reqTypeId = ref<number>(-1)
// 报修单处理状态
const status = ref<number>(-1)
const searchValue = ref<string>('')
const isSelectReq = ref(false)
const filterDate = ref<string>('2')
@@ -189,7 +191,9 @@
  const queryParams: any = {
    pageNum,
    pageSize,
    params: {},
    params: {
      searchValue: searchValue.value,
    },
  }
  // if (reqTypeId.value === -1) {
  //   delete queryParams.reqType
@@ -268,6 +272,11 @@
    })
}
function handleSearch() {
  console.log('handleSearch')
  paging.value.reload()
}
/**
 * 条目点击事件
 * @param item
eims-ui-mobile/src/pages/repair/res-list.vue
@@ -19,6 +19,9 @@
<!--          <text v-if="isLineOrRepair()" class="text-white">接单</text>-->
<!--        </template>-->
      </wd-navbar>
      <!-- 增加一个搜索栏 -->
      <wd-search v-model="searchValue" @search="handleSearch">
      </wd-search>
<!--      <wd-drop-menu>-->
<!--        <wd-drop-menu-item-->
<!--          v-model="resTypeId"-->
@@ -62,6 +65,7 @@
const message = useMessage()
const toast = useToast()
const searchValue = ref<string>('')
/**
 * 其他页面传过来的数据
@@ -111,7 +115,9 @@
  const queryParams: any = {
    pageNum,
    pageSize,
    params: {},
    params: {
      searchValue: searchValue.value,
    },
    // reqType: resTypeId.value,
    // status: status.value,
  }
@@ -145,10 +151,9 @@
  queryParams.params.status = '0,1,2,3'
  queryParams.reqUser = userStore?.userInfo?.userId
  if (isRepair()) {
    queryParams.params.status = null
    queryParams.params.status = undefined
    queryParams.resUser = userStore?.userInfo?.userId
    delete queryParams.reqUser
    delete queryParams.params
  }
  getRepairResList(queryParams)
    .then((res: any) => {
eims-ui-mobile/src/service/repair.ts
@@ -29,6 +29,14 @@
export const getRepairResList = (params: any) => {
  return http.get<RepairResVO[]>('/eims/repairRes/list', params)
}
/**
 * 查询未完成的维修单
 * @param id
 */
export const getRepairResUnfinished = (status: string) => {
  return http.get<int>(`/eims/repairRes/list/unfinished?status=${status}`)
}
/**
 * 查询维修单
 * @param data