车间能级提升-智能设备管理系统
zhuguifei
2025-04-27 d7862b2890b68743ec9c4fc05800bb23ec9b412e
完成新增报修单
已添加15个文件
已修改15个文件
1728 ■■■■■ 文件已修改
eims-ui-mobile/src/pages.json 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/equ/equ-list.vue 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/fixture/fixture-list.vue 185 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/home/index.vue 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/inspect/insp-record.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/inspect/insp-st.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/maint/maint-order.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/maint/maint-st.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/repair/repair-add.vue 408 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/repair/req-list.vue 316 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/repair/res-list.vue 278 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/service/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/service/dict.d.ts 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/service/dict.ts 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/service/fixture.d.ts 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/service/fixture.ts 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/service/repair.d.ts 159 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/service/repair.ts 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/service/utils.ts 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/static/ico/ico-faxian.png 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/static/ico/ico-huiyi.png 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/static/ico/ico-setting.png 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/style/index.scss 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/types/uni-pages.d.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/utils/http.ts 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui/apps/web-antd/src/views/eims/repair-req/data.tsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsRepairReqBo.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsRepairResBo.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/EimsRepairResVo.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsRepairResServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages.json
@@ -82,6 +82,15 @@
      }
    },
    {
      "path": "pages/fixture/fixture-list",
      "type": "page",
      "layout": "default",
      "needLogin": true,
      "style": {
        "navigationBarTitleText": "工具列表"
      }
    },
    {
      "path": "pages/inspect/insp-add",
      "type": "page",
      "layout": "default",
@@ -200,6 +209,80 @@
      }
    },
    {
      "path": "pages/repair/repair-add",
      "type": "page",
      "layout": "default",
      "style": {
        "navigationBarTitleText": "添加报修",
        "app-plus": {
          "titleNView": {
            "buttons": [
              {
                "text": "提交",
                "fontSize": "14px",
                "color": "#FFFFFF"
              },
              {
                "text": "",
                "fontSize": "24px",
                "color": "#FFFFFF"
              }
            ]
          }
        }
      }
    },
    {
      "path": "pages/repair/req-list",
      "type": "page",
      "layout": "default",
      "needLogin": true,
      "style": {
        "navigationBarTitleText": "设备报修",
        "app-plus": {
          "titleNView": {
            "buttons": [
              {
                "text": "新增",
                "fontSize": "14px",
                "color": "#FFFFFF"
              },
              {
                "text": "",
                "fontSize": "24px",
                "color": "#FFFFFF"
              }
            ]
          }
        }
      }
    },
    {
      "path": "pages/repair/res-list",
      "type": "page",
      "layout": "default",
      "needLogin": true,
      "style": {
        "navigationBarTitleText": "设备维修",
        "app-plus": {
          "titleNView": {
            "buttons": [
              {
                "text": "接单",
                "fontSize": "14px",
                "color": "#FFFFFF"
              },
              {
                "text": "",
                "fontSize": "24px",
                "color": "#FFFFFF"
              }
            ]
          }
        }
      }
    },
    {
      "path": "pages/spare/index",
      "type": "page",
      "layout": "tabbar",
eims-ui-mobile/src/pages/equ/equ-list.vue
@@ -31,9 +31,9 @@
            </view>
          </view>
        </template>
        <view class="flex h-[80rpx]" @click.stop="itemClick(item)">
        <view class="flex h-[80rpx] items-center" @click.stop="itemClick(item)">
          <image class="slot-img text-center" src="/static/images/camera.png" />
          <view>
          <view class="flex-1">
            <view class="text-color-base">
              {{ item.equName }}
              <text class="text-color-gray ml-2 text-mini">{{ item.modelNo }}</text>
@@ -41,6 +41,15 @@
            <view class="text-color-gray text-xs mt-1">
              {{ item.location }} | {{ item.madeIn }}
            </view>
          </view>
          <view v-if="isSelectEqu">
            <wd-button
              size="small"
              icon="edit-outline"
              @click.stop="handleSelectEqu(item)"
            >
              é€‰ä¸­
            </wd-button>
          </view>
        </view>
      </wd-card>
@@ -78,8 +87,7 @@
  getEquList({ pageNum, pageSize })
    .then((res: any) => {
      // è¯·å‹¿åœ¨ç½‘络请求回调中给dataList赋值!!只需要调用complete就可以了
      console.log(res)
      paging.value.complete(res.rows)
      paging.value.completeByTotal(res.rows, res.total)
    })
    .catch((res) => {
      // å¦‚果请求失败写paging.value.complete(false),会自动展示错误页面
@@ -94,6 +102,14 @@
 * @param item
 */
function itemClick(item: any) {
}
/**
 * å…¶å®ƒé¡µé¢é€‰æ‹©è®¾å¤‡
 * @param item
 */
function handleSelectEqu(item: any) {
  if (isSelectEqu.value) {
    emitSelectEqu(item)
    uni.navigateBack()
@@ -116,9 +132,9 @@
  const instance: any = getCurrentInstance().proxy
  const event = instance.getOpenerEventChannel()
  eventChannel.value = event
  event.on('handleSelectEqu', function (data) {
  event.on('OnSelectEqu', function (data) {
    isSelectEqu.value = true
    console.log('handleSelectEqu', data)
    console.log('OnSelectEqu', data)
  })
})
</script>
eims-ui-mobile/src/pages/fixture/fixture-list.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,185 @@
<route lang="json5" type="page">
{
  layout: 'default',
  needLogin: true,
  style: {
    navigationBarTitleText: '工具列表',
  },
}
</route>
<template>
  <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time>
    <template #top>
      <wd-drop-menu>
        <wd-drop-menu-item v-model="fixtureType" :options="typeList" @change="handleFixtureType" />
        <wd-drop-menu-item v-model="status" :options="statusList" @change="handleFixtureStatu" />
      </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-xs">{{ item.fixtureName }}</text>
              <text class="ml-1 text-mini text-color-gray">{{ item.assetNo }}</text>
            </view>
            <view>
              <text class="icon-color-base">详情</text>
              <wd-icon name="arrow-right" custom-class="icon-color-base"></wd-icon>
            </view>
          </view>
        </template>
        <view class="flex h-[80rpx] items-center" @click.stop="itemClick(item)">
          <image class="slot-img text-center" src="/static/images/camera.png" />
          <view class="flex-1">
            <view class="text-color-base">
              <text class="text-color-gray text-mini">类型: {{ item.fixtureTypeName }}</text>
              <text class="text-color-gray ml-2 text-mini">规格: {{ item.specNo }}</text>
              <text class="text-color-gray ml-2 text-mini">型号: {{ item.modelNo }}</text>
            </view>
            <view class="text-color-gray text-xs mt-1 flex">
              <template
                v-if="!item.borrowStatus || item.borrowStatus === '0'"
              >
                <view class="flex items-center">
                  <wd-icon class="icon-color-success" name="check-outline" size="28rpx"></wd-icon>
                  <text class="ml-[2px]">空闲</text>
                </view>
              </template>
              <template
                v-if="item.borrowStatus === '1'"
              >
                <view class="flex items-center">
                  <wd-icon class="text-color-primary" name="check-outline" size="28rpx"></wd-icon>
                  <text class="ml-[2px]">借出</text>
                </view>
              </template>
              <text v-if="item.borrowUserName" class="mx-2">|</text>
              <view class="flex items-center">
                <wd-icon name="setting" size="26rpx"></wd-icon>
                <text class="ml-[2px]">{{ item.borrowUserName }}</text>
              </view>
            </view>
          </view>
          <view v-if="isSelectFixture">
            <wd-button size="small" icon="edit-outline" @click.stop="handleSelectFixture(item)">
              é€‰ä¸­
            </wd-button>
          </view>
        </view>
      </wd-card>
    </view>
  </z-paging>
</template>
<script setup lang="ts">
import { onMounted, getCurrentInstance, ref } from 'vue'
import { getFixtureList } from '@/service/fixture'
// å·¥å…·ç±»åž‹
const fixtureType = ref<number>(0)
// å·¥å…·çŠ¶æ€
const status = ref<number>(0)
const isSelectFixture = ref(false)
const typeList = ref<Record<string, any>[]>([{ label: '所有工具', value: 0 }])
const statusList = ref<Record<string, any>[]>([{ label: '所有状态', value: 0 }])
function handleFixtureType({ value }) {
  console.log(value)
}
function handleFixtureStatu({ value }) {
  console.log(value)
}
const paging = ref(null)
const dataList = ref([])
const queryList = (pageNum?: number, pageSize?: number) => {
  // è¿™é‡Œçš„pageNo和pageSize会自动计算好,直接传给服务器即可
  // è¿™é‡Œçš„请求只是演示,请替换成自己的项目的网络请求,并在网络请求回调中通过paging.value.complete(请求回来的数组)将请求结果传给z-paging
  getFixtureList({ pageNum, pageSize })
    .then((res: any) => {
      // è¯·å‹¿åœ¨ç½‘络请求回调中给dataList赋值!!只需要调用complete就可以了
      paging.value.completeByTotal(res.rows, res.total)
    })
    .catch((res) => {
      // å¦‚果请求失败写paging.value.complete(false),会自动展示错误页面
      // æ³¨æ„ï¼Œæ¯æ¬¡éƒ½éœ€è¦åœ¨catch中写这句话很麻烦,z-paging提供了方案可以全局统一处理
      // åœ¨åº•层的网络请求抛出异常时,写uni.$emit('z-paging-error-emit');即可
      paging.value.complete(false)
    })
}
/**
 * å·¥å…·æ¡ç›®ç‚¹å‡»äº‹ä»¶
 * @param item
 */
function itemClick(item: any) {}
/**
 * å…¶å®ƒé¡µé¢é€‰æ‹©å·¥å…·
 * @param item
 */
function handleSelectFixture(item: any) {
  if (isSelectFixture.value) {
    emitSelectFixture(item)
    uni.navigateBack()
  }
}
/**
 * é€‰æ‹©å·¥å…·å›žè°ƒ
 * @param equ
 */
function emitSelectFixture(fixture: any) {
  eventChannel.value.emit('selectFixture', {
    data: fixture,
  })
}
const eventChannel = ref<any>()
onMounted(() => {
  const instance: any = getCurrentInstance().proxy
  const event = instance.getOpenerEventChannel()
  eventChannel.value = event
  event.on('OnSelectFixture', function (data) {
    isSelectFixture.value = true
    console.log('OnSelectFixture', data)
  })
})
</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__footer) {
  padding: 10rpx !important;
}
:deep(.wd-card__title-content) {
  padding: 20rpx 0 !important;
}
</style>
eims-ui-mobile/src/pages/home/index.vue
@@ -145,7 +145,13 @@
    name: '设备管理',
    icon: '/static/menu/menu1.png',
    path: 'pages/equ/equ-list',
  }
  },
  {
    id: 2,
    name: '工具管理',
    icon: '/static/menu/menu1.png',
    path: 'pages/fixture/fixture-list',
  },
])
const inspectMenu = reactive([
@@ -158,26 +164,26 @@
  {
    id: 1,
    name: '点检汇总',
    icon: '/static/menu/menu2.png',
    icon: '/static/menu/menu4.png',
    path: 'pages/inspect/insp-st',
  },
  {
    id: 2,
    name: '保养汇总',
    icon: '/static/menu/menu1.png',
    icon: '/static/menu/menu3.png',
    path: 'pages/maint/maint-st',
  },
  {
    id: 3,
    name: '点检记录',
    icon: '/static/menu/menu3.png',
    path: 'pages/inspect/insp-record',
    name: '设备报修',
    icon: '/static/menu/menu1.png',
    path: 'pages/repair/req-list',
  },
  {
    id: 4,
    name: '点检计划',
    icon: '/static/menu/menu4.png',
    path: 'pages/inspect/insp-add',
    name: '设备维修',
    icon: '/static/menu/menu2.png',
    path: 'pages/repair/res-list',
  },
])
@@ -223,4 +229,7 @@
  height: 72rpx;
  margin-left: 4rpx;
}
:deep(.wd-grid-item__content){
  align-items: center;
}
</style>
eims-ui-mobile/src/pages/inspect/insp-record.vue
@@ -200,7 +200,7 @@
  getInspStRecordList(params)
    .then((res: any) => {
      // è¯·å‹¿åœ¨ç½‘络请求回调中给dataList赋值!!只需要调用complete就可以了
      paging.value.complete(res.rows)
      paging.value.completeByTotal(res.rows, res.total)
    })
    .catch((res) => {
      // å¦‚果请求失败写paging.value.complete(false),会自动展示错误页面
eims-ui-mobile/src/pages/inspect/insp-st.vue
@@ -15,10 +15,8 @@
        <wd-drop-menu-item v-model="viewMode" :options="viewModeList" @change="handleViewMode" />
        <wd-drop-menu-item v-model="equName" :options="equList" @change="handleEquName" />
      </wd-drop-menu>
      <wd-divider></wd-divider>
    </template>
    <view class="bg-base">
      <view class="w-full h-[24rpx]"></view>
      <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id">
        <template #title>
          <view class="flex justify-between">
@@ -103,7 +101,7 @@
  getInspStList({ pageNum, pageSize, viewMode: viewMode.value })
    .then((res: any) => {
      // è¯·å‹¿åœ¨ç½‘络请求回调中给dataList赋值!!只需要调用complete就可以了
      paging.value.complete(res.rows)
      paging.value.completeByTotal(res.rows, res.total)
    })
    .catch((res) => {
      // å¦‚果请求失败写paging.value.complete(false),会自动展示错误页面
@@ -127,7 +125,7 @@
  uni.$on('insp-st-refresh', reloadData)
})
onUnload(() => {
  uni.$off('insp-st-refres', reloadData)
  uni.$off('insp-st-refresh', reloadData)
})
</script>
eims-ui-mobile/src/pages/maint/maint-order.vue
@@ -283,7 +283,7 @@
  getMaintStOrderList(params)
    .then((res: any) => {
      // è¯·å‹¿åœ¨ç½‘络请求回调中给dataList赋值!!只需要调用complete就可以了
      paging.value.complete(res.rows)
      paging.value.completeByTotal(res.rows, res.total)
    })
    .catch((res) => {
      // å¦‚果请求失败写paging.value.complete(false),会自动展示错误页面
eims-ui-mobile/src/pages/maint/maint-st.vue
@@ -15,10 +15,8 @@
        <wd-drop-menu-item v-model="equName" :options="equList" @change="handleEquName" />
        <wd-drop-menu-item v-model="status" :options="statusList" @change="handleStatus" />
      </wd-drop-menu>
      <wd-divider></wd-divider>
    </template>
    <view class="bg-base">
      <view class="w-full h-[24rpx]"></view>
      <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id">
        <template #title>
          <view class="flex justify-between">
@@ -123,7 +121,7 @@
  getMaintStList(params)
    .then((res: any) => {
      // è¯·å‹¿åœ¨ç½‘络请求回调中给dataList赋值!!只需要调用complete就可以了
      paging.value.complete(res.rows)
      paging.value.completeByTotal(res.rows, res.total)
    })
    .catch((res) => {
      // å¦‚果请求失败写paging.value.complete(false),会自动展示错误页面
@@ -143,7 +141,6 @@
  paging.value.reload()
}
onLoad(() => {
  queryList()
  uni.$on('maint-st-refresh', reloadData)
})
onUnload(() => {
eims-ui-mobile/src/pages/repair/repair-add.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,408 @@
<route lang="json5" type="page">
{
  layout: 'default',
  style: {
    navigationBarTitleText: '添加报修',
    'app-plus': {
      titleNView: {
        buttons: [
          {
            text: '提交',
            fontSize: '14px',
            color: '#FFFFFF',
          },
          {
            text: '',
            fontSize: '24px',
            color: '#FFFFFF',
          },
        ],
      },
    },
  },
}
</route>
<template>
  <view class="bg-base">
    <wd-form ref="form" :model="model">
      <wd-cell-group custom-class="group" title="类型信息" border>
        <wd-picker
          prop="reqType"
          :columns="reqList"
          label-key="dictLabel"
          value-key="dictValue"
          label="故障类型"
          v-model="model.reqType"
          @confirm="handleConfirmReqType"
        />
      </wd-cell-group>
      <wd-cell-group
        v-if="model.reqType === '1'"
        custom-class="mt-2"
        title="设备信息"
        use-slot
        border
      >
        <template #value>
          <view class="text-color-gray flex items-center">
            <wd-icon class="icon-color-base" name="scan" size="30rpx"></wd-icon>
            <text class="ml-1">扫设备码添加</text>
          </view>
        </template>
        <wd-input
          @click.stop="handleSelectEqu"
          label="设备名称"
          label-width="200rpx"
          prop="equName"
          readonly
          required
          suffix-icon="arrow-right"
          clearable
          v-model="model.equName"
          placeholder="请选择设备"
        />
      </wd-cell-group>
      <wd-cell-group
        v-if="model.reqType === '2'"
        custom-class="mt-2"
        title="工具信息"
        use-slot
        border
      >
        <template #value>
          <view class="text-color-gray flex items-center">
            <wd-icon class="icon-color-base" name="scan" size="30rpx"></wd-icon>
            <text class="ml-1">扫工具码添加</text>
          </view>
        </template>
        <wd-input
          @click.stop="handleSelectFixture"
          label="工具名称"
          label-width="200rpx"
          prop="fixtureName"
          readonly
          required
          suffix-icon="arrow-right"
          clearable
          v-model="model.fixtureName"
          placeholder="请选择工具"
        />
      </wd-cell-group>
      <wd-cell-group custom-class="mt-2" title="故障信息" border>
        <wd-input
          v-if="false"
          label="报修单号"
          placeholder="请生成报修单号"
          label-width="200rpx"
          v-model="model.code"
          prop="code"
        >
          <template #suffix>
            <wd-button size="small" icon="edit-outline" @click.stop="handleRepairCode">
              ç”Ÿæˆ
            </wd-button>
          </template>
        </wd-input>
        <wd-textarea
          label="报修描述"
          label-width="200rpx"
          type="textarea"
          v-model="model.reqDesc"
          auto-height
          :maxlength="200"
          show-word-limit
          placeholder="请输入报修描述"
          clearable
          prop="reqDesc"
        />
        <wd-cell title="报修图片" title-width="200rpx" prop="fileList">
          <wd-upload
            :auto-upload="false"
            :file-list="model.fileList"
            :action="VITE_UPLOAD_BASEURL"
            @change="handleFileChange"
          ></wd-upload>
        </wd-cell>
        <wd-datetime-picker
          label="发生时间"
          label-width="200rpx"
          placeholder="请选择故障发生时间"
          prop="occTime"
          v-model="occTime"
          @open="openOccTime"
          @confirm="handleOccTimeConfirm"
        />
      </wd-cell-group>
      <wd-cell-group custom-class="mt-2" title="其他信息" border>
        <wd-picker
          :columns="faultList"
          label-key="dictLabel"
          value-key="dictValue"
          label="故障类别"
          v-model="model.faultType"
          @confirm="handleConfirmFaultType"
        />
        <wd-picker
          :columns="urgencyList"
          label-key="dictLabel"
          value-key="dictValue"
          label="紧急程度"
          v-model="model.urgencyLevel"
          @confirm="handleConfirmUrgencyLevel"
        />
      </wd-cell-group>
    </wd-form>
  </view>
</template>
<script setup lang="ts">
import { reactive, ref } from 'vue'
import { getEnvBaseUploadUrl } from '@/utils'
import { generateCode } from '@/service/utils'
import { addRepairReq } from '@/service/repair'
import { formatDate } from '@/utils/DateUtils'
import { useToast, useMessage } from 'wot-design-uni'
import { useUserStore } from '@/store'
import {
  DICT_REPAIR_FAULT_TYPE,
  DICT_REPAIR_REQ_TYPE,
  DICT_REPAIR_URGENCY_LEVEL,
  getDictInfo,
} from '@/service/dict'
const VITE_UPLOAD_BASEURL = `${getEnvBaseUploadUrl()}`
const message = useMessage()
const toast = useToast()
const userStore = useUserStore()
// æŠ¥ä¿®ç±»åž‹
const reqList = ref<any>([])
// æ•…障类别
const faultList = ref<any>([])
// ç´§æ€¥ç¨‹åº¦
const urgencyList = ref<any>([])
const form = ref()
const occTime = ref(0)
const model = reactive<{
  code: string
  status: string
  reqDesc: string
  occTime: string
  reqTime: string
  reqDept: number | string
  reqUser: number | string
  equId: string
  equName: string
  reqType: string
  faultType: string
  urgencyLevel: string
  fixtureId: string
  fixtureName: string
  fileList: []
}>({
  code: '',
  reqDesc: '',
  status: '',
  occTime: '',
  reqTime: '',
  reqDept: null,
  reqUser: null,
  equId: '',
  equName: '',
  reqType: '',
  faultType: '',
  urgencyLevel: '',
  fixtureId: '',
  fixtureName: '',
  fileList: [],
})
/**
 * é€‰æ‹©è®¾å¤‡
 */
function handleSelectEqu() {
  uni.navigateTo({
    url: '/pages/equ/equ-list',
    events: {
      // ä¸ºæŒ‡å®šäº‹ä»¶æ·»åŠ ä¸€ä¸ªç›‘å¬å™¨ï¼ŒèŽ·å–è¢«æ‰“å¼€é¡µé¢ä¼ é€åˆ°å½“å‰é¡µé¢çš„æ•°æ®
      selectEqu: function (data) {
        model.equId = data.data.equId
        model.equName = data.data.equName
      },
    },
    success: function (res) {
      // é€šè¿‡eventChannel向被打开页面传送数据
      res.eventChannel.emit('OnSelectEqu', { data: '点检页面选择设备' })
    },
  })
}
/**
 * é€‰æ‹©å·¥å…·
 */
function handleSelectFixture() {
  uni.navigateTo({
    url: '/pages/fixture/fixture-list',
    events: {
      // ä¸ºæŒ‡å®šäº‹ä»¶æ·»åŠ ä¸€ä¸ªç›‘å¬å™¨ï¼ŒèŽ·å–è¢«æ‰“å¼€é¡µé¢ä¼ é€åˆ°å½“å‰é¡µé¢çš„æ•°æ®
      selectFixture: function (data) {
        model.fixtureId = data.data.id
        model.fixtureName = data.data.fixtureName
      },
    },
    success: function (res) {
      // é€šè¿‡eventChannel向被打开页面传送数据
      res.eventChannel.emit('OnSelectFixture', { data: '添加维修页面选择工具' })
    },
  })
}
/**
 * ç”ŸæˆæŠ¥ä¿®ç¼–号
 */
async function handleRepairCode() {
  try {
    const code: any = await generateCode('BXD')
    model.code = code
    console.log('生成报修单号:', code)
    message
      .confirm({
        msg: '确定提交?',
        title: '提示',
        beforeConfirm: ({ resolve }) => {
          resolve(true)
          handleAddRepairReq()
        },
      })
      .then(() => {})
      .catch((error) => {
        console.log(error)
      })
  } catch (error) {
    console.error('生成报修单号失败:', error)
    toast.error('生成报修单号失败,请检查网络后重试')
  }
}
function handleAddRepairReq() {
  // è¡¥å……必要字段
  model.status = '0'
  model.reqTime = formatDate(new Date())
  model.reqDept = userStore?.userInfo?.deptId
  model.reqUser = userStore?.userInfo?.userId
  addRepairReq(model)
    .then((res: any) => {
      if (res?.code === 200) {
        toast.success(res?.msg)
        uni.$emit('req-list-refresh')
        setTimeout(() => {
          uni.navigateBack()
        }, 1500)
      }
    })
    .catch((res) => {
      toast.error(res?.data?.msg || '请求失败')
    })
}
/**
 * ä¸Šä¼ ç‚¹æ£€å›¾ç‰‡
 * @param fileList
 */
function handleFileChange({ fileList }) {
  model.fileList = fileList
}
function checkData() {
  if (!model.reqType) {
    toast.error('请选择报修类型')
    return false
  }
  if (model.reqType === '1' && !model.equId) {
    toast.error('请选择报修设备')
    return false
  }
  if (model.reqType === '2' && !model.fixtureId) {
    toast.error('请选择报修工具')
    return false
  }
  if (!model.occTime) {
    toast.error('请选发生时间')
    return false
  }
  return true
}
function handleSubmit() {
  if (!checkData()) {
    return false
  }
  handleRepairCode()
}
/**
 * æ‰“开发生时间 æ—¶é—´é€‰æ‹©å™¨
 */
function openOccTime() {
  occTime.value = Date.now()
}
/**
 * ç¡®è®¤é€‰æ‹©å‘生时间
 */
function handleOccTimeConfirm({ value }) {
  model.occTime = formatDate(new Date(value))
}
/**
 * é€‰æ‹©æŠ¥ä¿®ç±»åž‹
 */
function handleConfirmReqType({ value }) {
}
/**
 * é€‰æ‹©æ•…障类别
 */
function handleConfirmFaultType({ value }) {
}
/**
 * é€‰æ‹©ç´§æ€¥ç¨‹åº¦
 */
function handleConfirmUrgencyLevel({ value }) {
}
async function initData() {
  const reqTypeList = await getDictInfo(DICT_REPAIR_REQ_TYPE)
  reqList.value = reqTypeList
  const fList = await getDictInfo(DICT_REPAIR_FAULT_TYPE)
  faultList.value = fList
  const uList = await getDictInfo(DICT_REPAIR_URGENCY_LEVEL)
  urgencyList.value = uList
}
onNavigationBarButtonTap((e) => {
  if (e.index === 0) {
    handleSubmit()
  }
})
onLoad((options) => {
  initData()
})
</script>
<style scoped lang="scss">
.footer {
  background: white;
  padding: 60rpx 42rpx;
}
</style>
eims-ui-mobile/src/pages/repair/req-list.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,316 @@
<route lang="json5">
{
  layout: 'default',
  needLogin: true,
  style: {
    navigationBarTitleText: '设备报修',
    '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-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="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-xs">{{ 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>
                <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.reqTime }}</text>
                </view>
                <view class="text-color-gray mt-1 text-mini">
                  <text>报修人: {{ item.reqUserName }}</text>
                </view>
              </view>
              <view class="text-color-gray text-xs 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'
const message = useMessage()
const toast = useToast()
// æŠ¥ä¿®å•类型
const reqTypeId = ref<number>(-1)
// æŠ¥ä¿®å•处理状态
const status = ref<number>(-1)
const isSelectReq = ref(false)
const reqTypeList = ref<any>([{ dictLabel: '所有类型', dictValue: -1 }])
const statusList = ref<any>([{ dictLabel: '所有状态', dictValue: -1 }])
function handleReqType({ value }) {
  reloadData()
}
function handleReqStatu({ value }) {
  reloadData()
}
const paging = ref(null)
const dataList = ref([])
const queryList = (pageNum?: number, pageSize?: number) => {
  const parmams = {
    pageNum,
    pageSize,
    reqType: reqTypeId.value,
    status: status.value,
  }
  if (reqTypeId.value === -1) {
    delete parmams.reqType
  }
  if (status.value === -1) {
    delete parmams.status
  }
  getRepairReqList(parmams)
    .then((res: any) => {
      paging.value.completeByTotal(res.rows, res.total)
    })
    .catch((res) => {
      paging.value.complete(false)
    })
}
function reloadData() {
  paging.value.reload()
}
/**
 * åˆ é™¤
 * @param item
 */
function handleDelete(item: any) {
  message
    .confirm({
      msg: '确定删除?',
      title: '提示',
      beforeConfirm: ({ resolve }) => {
        resolve(true)
        if (item.status !== '0') {
          toast.error('该报修单已被接单,请联系管理员!')
        } else {
          delRepairReq(item.id)
            .then((res: any) => {
              if (res?.code === 200) {
                toast.success('删除成功')
                reloadData()
              }
            })
            .catch((res) => {
              toast.error('删除失败')
            })
        }
      },
    })
    .then(() => {})
    .catch((error) => {
      console.log(error)
    })
}
/**
 * æ¡ç›®ç‚¹å‡»äº‹ä»¶
 * @param item
 */
function itemClick(item: any) {}
/**
 * å…¶å®ƒé¡µé¢é€‰æ‹©æŠ¥ä¿®å•
 * @param item
 */
function handleSelectReq(item: any) {
  if (isSelectReq.value) {
    emitSelectReq(item)
    uni.navigateBack()
  }
}
/**
 * é€‰æ‹©å›žè°ƒ
 * @param req
 */
function emitSelectReq(req: any) {
  eventChannel.value.emit('selectReq', {
    data: req,
  })
}
onNavigationBarButtonTap((e) => {
  if (e.index === 0 && !isSelectReq.value) {
    uni.navigateTo({
      url: `/pages/repair/repair-add`,
    })
  }
})
const eventChannel = ref<any>()
onMounted(() => {
  const instance: any = getCurrentInstance().proxy
  const event = instance.getOpenerEventChannel()
  eventChannel.value = event
  event.on('OnSelectReq', function (data) {
    isSelectReq.value = true
    // åªæ˜¾ç¤ºæœªæŽ¥å•数据
    status.value = 0
    console.log('OnSelectReq', data)
  })
})
async function initData() {
  const rList: any = await getDictInfo(DICT_REPAIR_REQ_TYPE)
  reqTypeList.value.push(...rList)
  const sList: any = await getDictInfo(DICT_REPAIR_REQ_STATUS)
  statusList.value.push(...sList)
}
onLoad(() => {
  initData()
  uni.$on('req-list-refresh', reloadData)
})
onUnload(() => {
  uni.$off('req-list-refresh', reloadData)
})
</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>
eims-ui-mobile/src/pages/repair/res-list.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,278 @@
<route lang="json5">
{
  layout: 'default',
  needLogin: true,
  style: {
    navigationBarTitleText: '设备维修',
    '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-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="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-xs">{{ 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" @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.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>
            <wd-button v-if="item.status === '1'"  size="small" icon="edit-outline">开始维修</wd-button>
            <wd-button v-if="item.status === '2'"  size="small" icon="edit-outline">维修中</wd-button>
            <wd-button v-if="item.status === '3'"  size="small" icon="edit-outline">已完成</wd-button>
          </view>
        </view>
      </wd-card>
    </view>
  </z-paging>
</template>
<script setup lang="ts">
import { onMounted, getCurrentInstance, ref } from 'vue'
import { useToast, useMessage } from 'wot-design-uni'
import { getRepairResList, addRepairRes } from '@/service/repair'
import { DICT_REPAIR_RES_STATUS, DICT_REPAIR_REQ_TYPE, getDictInfo } from '@/service/dict'
import { useUserStore } from '@/store'
const userStore = useUserStore()
const message = useMessage()
const toast = useToast()
// ç»´ä¿®å•类型
const resTypeId = ref<number>(0)
// ç»´ä¿®å•处理状态
const status = ref<number>(0)
const isSelectRes = ref(false)
const resTypeList = ref<any>([{ dictLabel: '所有类型', dictValue: 0 }])
const statusList = ref<any>([{ dictLabel: '所有状态', dictValue: 0 }])
function handleResType({ value }) {
  reloadData()
}
function handleResStatu({ value }) {
  reloadData()
}
const paging = ref(null)
const dataList = ref([])
const queryList = (pageNum?: number, pageSize?: number) => {
  const parmams = {
    pageNum,
    pageSize,
    reqType: resTypeId.value,
    status: status.value,
  }
  if (resTypeId.value === 0) {
    delete parmams.reqType
  }
  if (status.value === 0) {
    delete parmams.status
  }
  getRepairResList(parmams)
    .then((res: any) => {
      paging.value.completeByTotal(res.rows, res.total)
    })
    .catch((res) => {
      paging.value.complete(false)
    })
}
function reloadData() {
  paging.value.reload()
}
/**
 * æ¡ç›®ç‚¹å‡»äº‹ä»¶
 * @param item
 */
function itemClick(item: any) {}
onNavigationBarButtonTap((e) => {
  if (e.index === 0) {
    handleSelectReq()
  }
})
/**
 * é€‰æ‹©æŠ¥ä¿®å•
 */
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)
  resTypeList.value.push(...rList)
  const sList: any = await getDictInfo(DICT_REPAIR_RES_STATUS)
  statusList.value.push(...sList)
}
onLoad((options) => {
  initData()
})
</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>
eims-ui-mobile/src/service/.DS_Store
Binary files differ
eims-ui-mobile/src/service/dict.d.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
export interface DictData {
  createBy: string;
  createTime: string;
  cssClass: string;
  default: boolean;
  dictCode: number;
  dictLabel: string;
  dictSort: number;
  dictType: string;
  dictValue: string;
  isDefault: string;
  listClass: string;
  remark: string;
  status: string;
  updateBy?: any;
  updateTime?: any;
}
eims-ui-mobile/src/service/dict.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
import { http } from '@/utils/http'
import type { DictData } from './dict.d'
export const DICT_REPAIR_REQ_TYPE = 'repair_req_type'
export const DICT_REPAIR_URGENCY_LEVEL = 'repair_urgency_level'
export const DICT_REPAIR_FAULT_TYPE = 'repair_fault_type'
export const DICT_REPAIR_REQ_STATUS = 'repair_req_status'
export const DICT_REPAIR_RES_STATUS = 'repair_res_status'
export const getDictInfo = (dictType: string) => {
  return http.get<DictData[]>(`/system/dict/data/type/${dictType}`)
}
eims-ui-mobile/src/service/fixture.d.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,95 @@
export interface FixtureVO {
  /**
   *
   */
  id: number | string;
  /**
   * æ²»å…·ç¼–码
   */
  fixtureCode: string;
  /**
   * æ²»å…·åç§°
   */
  fixtureName: string;
  /**
   * æ²»å…·ï¼ˆå·¥å…·ï¼‰ç±»åž‹
   */
  fixtureType: number;
  /**
   * æ²»å…·æè¿°
   */
  fixtureDesc: string;
  /**
   * å€Ÿç”¨éƒ¨é—¨
   */
  borrowDept: number | string;
  /**
   * å€Ÿç”¨éƒ¨é—¨
   */
  borrowDeptName: string;
  /**
   * å€Ÿç”¨äºº
   */
  borrowUser: number | string;
  /**
   * å€Ÿç”¨äºº
   */
  borrowUserName: string;
  /**
   * å€Ÿç”¨çŠ¶æ€
   */
  borrowStatus: string;
  createTime: string;
  /**
   * çŠ¶æ€ï¼ˆå­—å…¸ï¼‰
   */
  status: string;
  /**
   * èµ„产编号
   */
  assetNo: string;
  /**
   * åž‹å·
   */
  modelNo: string;
  /**
   * è§„æ ¼
   */
  specNo: string;
  /**
   * åˆ¶é€ å•†
   */
  madeIn: string;
  /**
   * é‡‡è´­æ—¥æœŸ
   */
  purchaseDate: string;
  /**
   * ä½¿ç”¨æ—¥æœŸ
   */
  deployDate: string;
  /**
   * ä½¿ç”¨å¹´é™
   */
  serviceLife: number;
  /**
   * å¤‡æ³¨
   */
  remark: string;
}
eims-ui-mobile/src/service/fixture.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
import { http } from '@/utils/http'
import type { FixtureVO } from './fixture.d'
/**
 * å·¥å…·åˆ—表
 */
export const getFixtureList = (params: any) => {
  return http.get<FixtureVO[]>('/eims/fixture/list', params)
}
eims-ui-mobile/src/service/repair.d.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,159 @@
export interface RepairReqVO {
  /**
   * æŠ¥ä¿®id
   */
  id: number | string;
  /**
   * æŠ¥ä¿®å•号
   */
  code: string;
  /**
   * æŠ¥ä¿®çŠ¶æ€
   */
  status: string;
  /**
   * å‘生事件
   */
  occTime: string;
  /**
   * æŠ¥ä¿®æ—¶é—´
   */
  reqTime: string;
  /**
   * æŠ¥ä¿®äººéƒ¨é—¨
   */
  reqDept: number;
  /**
   * æŠ¥ä¿®äºº
   */
  reqUser: number;
  /**
   * æŠ¥ä¿®æè¿°
   */
  reqDesc: string;
  /**
   * ç´§æ€¥ç¨‹åº¦
   */
  urgencyLevel: string;
  /**
   * æ•…障图片
   */
  faultPicture: string;
  /**
   * æŠ¥ä¿®ç±»åž‹
   */
  reqType: string;
  /**
   * è®¾å¤‡id
   */
  equId: number | string;
  /**
   * ç»´ä¿®å•id
   */
  repairId: number | string;
  /**
   * ç»´ä¿®äººéƒ¨é—¨
   */
  repairDept: number;
  /**
   * ç»´ä¿®äºº
   */
  repairUser: number;
  /**
   * æ•…障类别
   */
  faultType: string;
  /**
   * å¤‡æ³¨
   */
  remark: string;
}
export interface RepairResVO {
  /**
   *
   */
  id: number | string;
  /**
   * æŠ¥ä¿®å•id
   */
  reqId: number | string;
  /**
   * ç»´ä¿®å•号
   */
  resCode: string;
  /**
   * ç»´ä¿®äºº
   */
  resUser: number;
  /**
   * ç»´ä¿®äººéƒ¨é—¨
   */
  resDept: number;
  /**
   * åŽŸå› åˆ†æž
   */
  resReason: string;
  /**
   * å¤„理措施
   */
  resHandle: string;
  /**
   * é¢„防措施
   */
  resPrevent: string;
  /**
   * ç»´ä¿®çŠ¶æ€(字典)
   */
  status: string;
  /**
   * å¼€å§‹æ—¶é—´
   */
  startTime: string;
  /**
   * ç»“束时间
   */
  endTime: string;
  /**
   * ä½¿ç”¨å·¥å…·
   */
  useFixture: string;
  /**
   * ä½¿ç”¨å¤‡ä»¶
   */
  useParts: string;
  /**
   * å¤‡æ³¨
   */
  remark: string;
}
eims-ui-mobile/src/service/repair.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,42 @@
import { http } from '@/utils/http'
import type { RepairReqVO, RepairResVO } from './repair.d'
type ID = number | string
/**
 * æ–°å¢žæŠ¥ä¿®å•
 * @param data
 */
export const addRepairReq = (data: any) => {
  return http.post<void>('/eims/repairReq', data)
}
/**
 * åˆ é™¤æŠ¥ä¿®å•
 * @param id
 */
export const delRepairReq = (id: ID) => {
  return http.del<void>(`/eims/repairReq/${id}`)
}
/**
 * æŠ¥ä¿®å•列表
 */
export const getRepairReqList = (params: any) => {
  return http.get<RepairReqVO[]>('/eims/repairReq/list', params)
}
/**
 * ç»´ä¿®å•列表
 */
export const getRepairResList = (params: any) => {
  return http.get<RepairResVO[]>('/eims/repairRes/list', params)
}
/**
 * æ–°å¢žç»´ä¿®å•
 * @param data
 */
export const addRepairRes = (data: any) => {
  return http.post<void>('/eims/repairRes/add', data)
}
eims-ui-mobile/src/service/utils.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
import { http } from '@/utils/http'
/**
 * ç”Ÿæˆå„种单号
 * @param prefix å•号前缀
 */
export const generateCode = (prefix: string) => {
  return http.get<string>(`/eims/generate/${prefix}`)
}
eims-ui-mobile/src/static/ico/ico-faxian.png
eims-ui-mobile/src/static/ico/ico-huiyi.png
eims-ui-mobile/src/static/ico/ico-setting.png
eims-ui-mobile/src/style/index.scss
@@ -24,6 +24,12 @@
.text-color-gray {
  color: $uni-text-color-grey;
}
.text-color-primary {
  color: $uni-color-primary;
}
.text-color-success {
  color: $uni-color-success;
}
// å›¾æ ‡é¢œè‰²
.icon-color-base {
eims-ui-mobile/src/types/uni-pages.d.ts
@@ -7,6 +7,7 @@
  url: "/pages/home/index" |
       "/pages/equ/equ-list" |
       "/pages/equ/index" |
       "/pages/fixture/fixture-list" |
       "/pages/inspect/insp-add" |
       "/pages/inspect/insp-record" |
       "/pages/inspect/insp-st" |
@@ -15,6 +16,9 @@
       "/pages/maint/maint-st" |
       "/pages/maint/order-detail" |
       "/pages/my/index" |
       "/pages/repair/repair-add" |
       "/pages/repair/req-list" |
       "/pages/repair/res-list" |
       "/pages/spare/index";
}
interface RedirectToOptions extends NavigateToOptions {}
eims-ui-mobile/src/utils/http.ts
@@ -119,6 +119,14 @@
  })
}
export const httpDel = <T>(url: string) => {
  return http<T>({
    url,
    method: 'DELETE',
  })
}
http.get = httpGet
http.post = httpPost
http.put = httpPut
http.del = httpDel
eims-ui/apps/web-antd/src/views/eims/repair-req/data.tsx
@@ -135,11 +135,20 @@
    minWidth: 200
  },
  {
    title: '发生时间',
    field: 'occTime',
    sortable: true,
    minWidth: 200
  },
  {
    title: '故障类别',
    field: 'faultType',
    minWidth: 100,
    slots: {
      default: ({ row }) => {
        if(!row.faultType){
          return ''
        }
        return renderDict(row.faultType, DictEnum.REPAIR_FAULT_TYPE);
      }
    }
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsRepairReqBo.java
@@ -31,13 +31,11 @@
    /**
     * æŠ¥ä¿®å•号
     */
    @NotBlank(message = "报修单号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String code;
    /**
     * æŠ¥ä¿®çŠ¶æ€
     */
    @NotBlank(message = "报修状态不能为空", groups = { AddGroup.class, EditGroup.class })
    private String status;
    /**
@@ -55,25 +53,21 @@
    /**
     * æŠ¥ä¿®äººéƒ¨é—¨
     */
    @NotNull(message = "报修人部门不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long reqDept;
    /**
     * æŠ¥ä¿®äºº
     */
    @NotNull(message = "报修人不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long reqUser;
    /**
     * æŠ¥ä¿®æè¿°
     */
    @NotBlank(message = "报修描述不能为空", groups = { AddGroup.class, EditGroup.class })
    private String reqDesc;
    /**
     * ç´§æ€¥ç¨‹åº¦
     */
    @NotBlank(message = "紧急程度不能为空", groups = { AddGroup.class, EditGroup.class })
    private String urgencyLevel;
    /**
@@ -84,7 +78,6 @@
    /**
     * æŠ¥ä¿®ç±»åž‹
     */
    @NotBlank(message = "报修类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private String reqType;
    /**
@@ -115,7 +108,6 @@
    /**
     * æ•…障类别
     */
    @NotBlank(message = "故障类别不能为空", groups = { AddGroup.class, EditGroup.class })
    private String faultType;
    /**
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsRepairResBo.java
@@ -115,6 +115,7 @@
    // å…³è”表字段
    private  String reqCode;//报修单编码
    private  String reqType;//报修单类型
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/EimsRepairResVo.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;
import org.dromara.eims.domain.EimsRepairRes;
@@ -27,7 +28,7 @@
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = EimsRepairRes.class)
public class EimsRepairResVo implements Serializable {
public class EimsRepairResVo extends BaseEntity implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
@@ -127,7 +128,7 @@
     */
    @ExcelProperty(value = "备注")
    private String remark;
    /**
     * è¯„ä»·id
     */
eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsRepairResServiceImpl.java
@@ -111,7 +111,7 @@
     */
    @Transactional(rollbackFor = Exception.class)
    @Override
    public Boolean insertByBo(EimsRepairResBo bo) {
    public synchronized Boolean insertByBo(EimsRepairResBo bo) {
        EimsRepairRes add = MapstructUtils.convert(bo, EimsRepairRes.class);
        validEntityBeforeSave(add);
        boolean flag = baseMapper.insert(add) > 0;
@@ -272,6 +272,7 @@
        qw.like(StringUtils.isNotBlank(bo.getResCode()), "res.res_code", bo.getResCode());
        qw.like(StringUtils.isNotBlank(bo.getReqCode()), "req.code", bo.getReqCode());
        qw.eq(bo.getResUser() != null, "res.res_user", bo.getResUser());
        qw.eq(bo.getReqType() != null, "req.req_type", bo.getReqType());
        qw.eq(bo.getReqUser() != null, "res.req_user", bo.getReqUser());
        List<Long> resDeptIds = getAllDescendantIds(bo.getResDept());