车间能级提升-智能设备管理系统
baoshiwei
2025-06-14 1efdf8fa2f60cc6d9da42b319540d4c2df4b3e0a
refactor(repair): 优化报修相关功能和页面展示

- 修改紧急程度标签显示逻辑
- 增加已评价状态展示
- 优化按钮显示逻辑- 统一列表刷新事件名称
- 调整快捷操作菜单样式
- 优化报修单详情页面布局
已修改9个文件
112 ■■■■■ 文件已修改
eims-ui-mobile/src/components/repair/req-card.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/components/repair/res-card.vue 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/home/index.vue 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/repair/repair-add.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/repair/repair-fb.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/repair/req-detail.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/repair/res-detail.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/repair/res-list.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/pages/scan/index.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
eims-ui-mobile/src/components/repair/req-card.vue
@@ -61,8 +61,8 @@
            </view>
            <view class="text-color-gray mt-1 text-mini">
              <text>紧急程度: </text>
              <wd-tag type="danger" v-if="item.urgencyLevel === '1'">紧急</wd-tag>
              <wd-tag type="warning" v-else-if="item.urgencyLevel === '2'">一般</wd-tag>
              <wd-tag type="warning" v-if="item.urgencyLevel === '1'">一般</wd-tag>
              <wd-tag type="danger" v-else-if="item.urgencyLevel === '2'">紧急</wd-tag>
              <wd-tag type="success" v-else-if="item.urgencyLevel === '3'">普通</wd-tag>
            </view>
          </view>
eims-ui-mobile/src/components/repair/res-card.vue
@@ -12,6 +12,7 @@
          <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>
          <wd-tag size="small" v-else-if="item.status === '4'" type="default">已评价</wd-tag>
        </view>
      </view>
    </template>
@@ -67,12 +68,13 @@
        </view>
      </view>
      <view>
        <template v-if="item.status === '3'">
        <template v-if="item.status === '3' || item.status === '4'">
          <view class="h-full flex flex-col">
            <wd-button size="small" icon="warn-bold" @click.stop="itemClick(item)">
              详情
            </wd-button>
            <wd-button
              v-if="isRequest"
              class="mt-4"
              size="small"
              icon="edit-outline"
@@ -80,6 +82,17 @@
              type="warning"
            >
              {{ item.fbId == null ? '写评价' : '查看评价' }}
            </wd-button>
            <wd-button
              v-else
              class="mt-4"
              size="small"
              icon="edit-outline"
              @click.stop="goToFeedBack(item)"
              type="warning"
              :disabled="item.fdId == null"
            >
              {{ item.fbId == null ? '暂未评价' : '查看评价' }}
            </wd-button>
          </view>
        </template>
@@ -121,18 +134,23 @@
const userStore = useUserStore()
const message = useMessage()
const toast = useToast()
defineProps({
const defineProps1 = defineProps({
  item: {
    type: Object as () => RepairResVO,
    required: true
  }
})
    required: true,
  },
});
const emit = defineEmits(['click'])
function handleClick(item) {
  emit('click', item)
// 使用计算属性,判断当前用户是不是请求人
const isRequest = computed(() => {
  if (defineProps1.item) {
    console.log('isRequest', defineProps1.item.reqUser === userStore.userInfo.userId)
    return userStore.userInfo.userId === defineProps1.item.reqUser
}
  return false
})
/**
 * 开始维修
eims-ui-mobile/src/pages/home/index.vue
@@ -80,29 +80,29 @@
          </view>
        </wd-card>
      </view>
      <view class="bg-white mt-2">
        <wd-card type="rectangle">
          <template #title>
            <view class="flex items-center menu-title-box">
              <view class="menu-indicator"></view>
              <view class="ml-1 text-sm">快捷操作</view>
            </view>
          </template>
          <wd-grid :column="4">
            <wd-grid-item
              use-slot
              class="flex justify-center items-center"
              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>
            </wd-grid-item>
          </wd-grid>
        </wd-card>
      </view>
<!--      <view class="bg-white mt-2">-->
<!--        <wd-card type="rectangle">-->
<!--          <template #title>-->
<!--            <view class="flex items-center menu-title-box">-->
<!--              <view class="menu-indicator"></view>-->
<!--              <view class="ml-1 text-sm">快捷操作</view>-->
<!--            </view>-->
<!--          </template>-->
<!--          <wd-grid :column="4">-->
<!--            <wd-grid-item-->
<!--              use-slot-->
<!--              class="flex justify-center items-center"-->
<!--              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>-->
<!--            </wd-grid-item>-->
<!--          </wd-grid>-->
<!--        </wd-card>-->
<!--      </view>-->
      <view class="bg-white mt-2">
        <wd-card type="rectangle">
          <template #title>
eims-ui-mobile/src/pages/repair/repair-add.vue
@@ -24,7 +24,7 @@
          :columns="reqList"
          label-key="dictLabel"
          value-key="dictValue"
          label="故障类型"
          label="报修类型"
          v-model="model.reqType"
          @confirm="handleConfirmReqType"
          :disabled="reqTypeDis"
@@ -339,7 +339,7 @@
    .then((res: any) => {
      if (res?.code === 200) {
        toast.success(res?.msg)
        uni.$emit('req-list-refresh')
        uni.$emit('list-refresh')
        setTimeout(() => {
          uni.navigateBack()
        }, 1500)
eims-ui-mobile/src/pages/repair/repair-fb.vue
@@ -206,7 +206,7 @@
            icon: 'none',
          })
          uni.navigateBack()
          uni.$emit('res-list-refresh')
          uni.$emit('list-refresh')
        }
      })
      .catch((res) => {})
@@ -219,7 +219,7 @@
            icon: 'none',
          })
          uni.navigateBack()
          uni.$emit('res-list-refresh')
          uni.$emit('list-refresh')
        }
      })
      .catch((res) => {})
eims-ui-mobile/src/pages/repair/req-detail.vue
@@ -78,8 +78,8 @@
          <text>{{ repairReq.reqUserName }}</text>
        </wd-cell>
        <wd-cell title="紧急程度" title-width="200rpx">
          <wd-tag type="danger" v-if="repairReq.urgencyLevel === '1'">紧急</wd-tag>
          <wd-tag type="warning" v-else-if="repairReq.urgencyLevel === '2'">一般</wd-tag>
          <wd-tag type="danger" v-if="repairReq.urgencyLevel === '2'">紧急</wd-tag>
          <wd-tag type="warning" v-else-if="repairReq.urgencyLevel === '1'">一般</wd-tag>
          <wd-tag type="success" v-else-if="repairReq.urgencyLevel === '3'">普通</wd-tag>
        </wd-cell>
      </wd-cell-group>
@@ -215,9 +215,7 @@
.description-box {
  padding: 24rpx;
  background-color: #f9f9f9;
  border-radius: 8rpx;
  margin: 16rpx;
  color: #666666;
  line-height: 1.6;
}
@@ -229,8 +227,6 @@
}
.fault-image {
  width: 80%;
  height: 400rpx;
  border-radius: 8rpx;
  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
}
eims-ui-mobile/src/pages/repair/res-detail.vue
@@ -309,7 +309,7 @@
    .then((res: any) => {
      resolve(true)
      toastSucces()
      uni.$emit('res-list-refresh')
      uni.$emit('list-refresh')
      uni.navigateBack()
    })
    .catch((res) => {
eims-ui-mobile/src/pages/repair/res-list.vue
@@ -43,7 +43,7 @@
    </template>
    <view class="bg-base">
      <res-card v-for="(item, index) in dataList" :key="item.id" :item="item" @click="handleResClick" />
      <res-card v-for="item in dataList" :key="item.id" :item="item" />
    </view>
  </z-paging>
</template>
eims-ui-mobile/src/pages/scan/index.vue
@@ -67,7 +67,7 @@
      <view class="h-[10px] bg-base"></view>
      <wd-tabs v-model="tab">
        <wd-tab title="维修请求">
        <wd-tab title="报修单">
          <view class="h-[10px] bg-base"></view>
          <!-- 维修请求区域 -->
          <view class="mt-2" v-if="reqList.length > 0">
@@ -149,7 +149,7 @@
        exist.value = true
        Object.assign(model, res)
        // 加载维修请求和维修单数据
        loadRepairData(res.equId)
        loadRepairData()
      } else {
        toast.error('未查询到该资产编号相关数据!')
      }
@@ -161,10 +161,10 @@
}
// 加载维修请求和维修单数据
function loadRepairData(equId: string | number) {
function loadRepairData() {
  // 加载未接单的维修请求
  getRepairReqList({
    equId,
    equId: model.equId,
    status: '0',
  }).then((res: any) => {
    if (res?.rows) {
@@ -174,7 +174,7 @@
  // 加载未完成的维修单
  const params = {
    equId,
    equId: model.equId,
    params: {
      status: '0,1,2',
    },