zhou zhou
7 小时以前 450c9d39c6eb3765642f977512202e3240ac9b03
rsf-design/src/views/manager/task/modules/task-expand-panel.vue
@@ -1,15 +1,19 @@
<template>
  <div class="rounded-xl bg-[var(--el-fill-color-blank)] px-4 py-4">
    <div class="mb-3 flex items-center justify-between">
      <div class="text-sm font-medium text-[var(--art-gray-900)]">任务明细</div>
      <ElButton text size="small" :loading="loading" @click="loadData">刷新</ElButton>
      <div class="text-sm font-medium text-[var(--art-gray-900)]">{{
        t('pages.task.expand.title')
      }}</div>
      <ElButton text size="small" :loading="loading" @click="loadData">{{
        t('common.actions.refresh')
      }}</ElButton>
    </div>
    <ArtTable
      :loading="loading"
      :data="rows"
      :columns="columns"
      empty-text="暂无任务明细"
      :empty-text="t('pages.task.expand.empty')"
      :empty-height="'220px'"
    />
  </div>
@@ -17,6 +21,7 @@
<script setup>
  import { onMounted, ref, watch } from 'vue'
  import { useI18n } from 'vue-i18n'
  import { guardRequestWithMessage } from '@/utils/sys/requestGuard'
  import { fetchTaskItemPage } from '@/api/task'
  import { normalizeTaskItemRow } from '../taskPage.helpers'
@@ -30,76 +35,137 @@
  const loading = ref(false)
  const rows = ref([])
  const { t } = useI18n()
  const columns = [
    {
      type: 'globalIndex',
      label: '序号',
      label: t('table.index'),
      width: 72,
      align: 'center'
    },
    {
      prop: 'orderTypeLabel',
      label: '单据类型',
      label: t('pages.task.expand.orderType'),
      minWidth: 120,
      showOverflowTooltip: true
    },
    {
      prop: 'wkTypeLabel',
      label: '业务类型',
      label: t('pages.task.expand.wkType'),
      minWidth: 120,
      showOverflowTooltip: true
    },
    {
      prop: 'platOrderCode',
      label: t('pages.task.expand.platOrderCode'),
      minWidth: 150,
      showOverflowTooltip: true
    },
    {
      prop: 'platWorkCode',
      label: '工单号',
      label: t('pages.task.expand.platWorkCode'),
      minWidth: 150,
      showOverflowTooltip: true
    },
    {
      prop: 'platItemId',
      label: '行号',
      label: t('pages.task.expand.platItemId'),
      minWidth: 100,
      showOverflowTooltip: true
    },
    {
      prop: 'projectCode',
      label: t('pages.task.expand.projectCode'),
      minWidth: 140,
      showOverflowTooltip: true
    },
    {
      prop: 'matnrCode',
      label: '物料编码',
      label: t('table.materialCode'),
      minWidth: 150,
      showOverflowTooltip: true
    },
    {
      prop: 'maktx',
      label: '物料名称',
      label: t('table.materialName'),
      minWidth: 220,
      showOverflowTooltip: true
    },
    {
      prop: 'batch',
      label: '批次',
      label: t('table.batch'),
      minWidth: 140,
      showOverflowTooltip: true
    },
    {
      prop: 'unit',
      label: '单位',
      label: t('table.unit'),
      width: 100
    },
    {
      prop: 'anfme',
      label: '数量',
      label: t('pages.task.expand.anfme'),
      width: 100,
      align: 'right'
    },
    {
      prop: 'updateByText',
      label: '更新人',
      prop: 'workQty',
      label: t('pages.task.expand.workQty'),
      width: 100,
      align: 'right'
    },
    {
      prop: 'qty',
      label: t('pages.task.expand.qty'),
      width: 100,
      align: 'right'
    },
    {
      prop: 'spec',
      label: t('pages.task.expand.spec'),
      minWidth: 140,
      showOverflowTooltip: true
    },
    {
      prop: 'model',
      label: t('pages.task.expand.model'),
      minWidth: 140,
      showOverflowTooltip: true
    },
    {
      prop: 'createByText',
      label: t('table.createBy'),
      minWidth: 120,
      showOverflowTooltip: true
    },
    {
      prop: 'createTimeText',
      label: t('table.createTime'),
      minWidth: 180,
      showOverflowTooltip: true
    },
    {
      prop: 'updateByText',
      label: t('table.updateBy'),
      minWidth: 120,
      showOverflowTooltip: true
    },
    {
      prop: 'statusText',
      label: t('table.status'),
      minWidth: 120,
      showOverflowTooltip: true
    },
    {
      prop: 'memo',
      label: t('table.remark'),
      minWidth: 180,
      showOverflowTooltip: true
    },
    {
      prop: 'updateTimeText',
      label: '更新时间',
      label: t('table.updateTime'),
      minWidth: 180,
      showOverflowTooltip: true
    }
@@ -120,7 +186,7 @@
          pageSize: 50
        }),
        { records: [] },
        { timeoutMessage: '任务明细加载超时,已停止等待' }
        { timeoutMessage: t('pages.task.messages.itemsTimeout') }
      )
      rows.value = Array.isArray(response?.records)
        ? response.records.map((record) => normalizeTaskItemRow(record))