| | |
| | | <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> |
| | |
| | | |
| | | <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' |
| | |
| | | |
| | | 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: '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: '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: '更新人', |
| | | label: t('table.updateBy'), |
| | | minWidth: 120, |
| | | showOverflowTooltip: true |
| | | }, |
| | | { |
| | | prop: 'updateTimeText', |
| | | label: '更新时间', |
| | | label: t('table.updateTime'), |
| | | minWidth: 180, |
| | | showOverflowTooltip: true |
| | | } |
| | |
| | | pageSize: 50 |
| | | }), |
| | | { records: [] }, |
| | | { timeoutMessage: '任务明细加载超时,已停止等待' } |
| | | { timeoutMessage: t('pages.task.messages.itemsTimeout') } |
| | | ) |
| | | rows.value = Array.isArray(response?.records) |
| | | ? response.records.map((record) => normalizeTaskItemRow(record)) |