车间能级提升-智能设备管理系统
zhuguifei
2025-05-13 14681dfe7052cb76eefcc0c17d0a0d708e1ac9dd
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">
@@ -37,7 +35,7 @@
            </view>
          </view>
        </template>
        <view class="flex h-[100rpx]" items-center>
        <view class="flex h-[140rpx]" items-center>
          <image class="slot-img text-center" src="/static/images/camera.png" />
          <view class="flex-1">
            <view class="text-color-gray text-xs mt-1 flex">
@@ -54,7 +52,7 @@
            </view>
            <view class="text-color-gray text-xs mt-2 flex">
              <text>状态:</text>
              <template v-if="item.orderCount === item.wcCount">
              <template v-if="item.status === '1'">
                <wd-icon class="icon-color-success" name="check-outline" size="34rpx"></wd-icon>
                <text class="ml-1">已完成</text>
              </template>
@@ -63,6 +61,7 @@
                <text class="ml-1">进行中</text>
              </template>
            </view>
            <view class="text-color-gray text-xs mt-2 flex">创建时间: {{ item.createTime }}</view>
          </view>
          <wd-button size="small" icon="edit-outline" @click.stop="itemClick(item)">明细</wd-button>
        </view>
@@ -75,13 +74,29 @@
import { ref } from 'vue'
import { getMaintStList } from '@/service/maint'
/**
 * 其他页面传过来的数据
 * assetNo: 资产编号
 * from: 是否是扫码进来的,如果是扫码进来,只能查询固定设备的数据
 */
interface PageParams {
  assetNo?: string
  from?: string
}
interface QueryParams {
  pageNum: number
  pageSize: number
  assetNo?: string
  equName?: string
  status?: string
}
// 页面参数,上个页面传递过来的参数
const option = reactive<PageParams>({
  assetNo: '',
  from: '',
})
const status = ref<string>('-1')
const equName = ref<string>('-1')
@@ -116,11 +131,15 @@
  if (status.value === '-1') {
    delete params.status
  }
  // 如果是从扫码页面过来,只能查询固定设备的数据
  if (option?.from === 'scan') {
    params.assetNo = option.assetNo
  }
  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),会自动展示错误页面
@@ -131,21 +150,20 @@
}
function itemClick(item) {
  const itemString = encodeURIComponent(JSON.stringify(item))
  uni.navigateTo({
    url: `/pages/maint/maint-order?maintSt=${itemString}`,
    url: `/pages/maint/maint-order?id=${item.id}`,
  })
}
function reloadData() {
  paging.value.reload()
}
onLoad(() => {
  queryList()
onLoad((options) => {
  Object.assign(option, options)
  uni.$on('maint-st-refresh', reloadData)
})
onUnload(() => {
  uni.$off('maint-st-refres', reloadData)
  uni.$off('maint-st-refresh', reloadData)
})
</script>