<script lang="ts" setup>
|
import type { MesProFeedbackApi } from '#/api/mes/pro/feedback';
|
|
import { onMounted, ref } from 'vue';
|
import { useRouter } from 'vue-router';
|
|
import { Page } from '@vben/common-ui';
|
import { useTabs } from '@vben/hooks';
|
|
import { DICT_TYPE } from '@vben/constants';
|
|
import { Card, Table, Tabs } from 'ant-design-vue';
|
|
import { TableAction } from '#/adapter/vxe-table';
|
import { getFeedback } from '#/api/mes/pro/feedback';
|
import { DictTag } from '#/components/dict-tag';
|
import { useDescription } from '#/components/description';
|
|
import { useDetailSchema } from '../data';
|
import ItemConsumeList from '../modules/item-consume-list.vue';
|
import ProductProduceList from '../modules/product-produce-list.vue';
|
|
const paramColumns = [
|
{ title: '参数名称', dataIndex: 'paramName', key: 'paramName' },
|
{ title: '参数编码', dataIndex: 'paramCode', key: 'paramCode' },
|
{ title: '参数类型', dataIndex: 'paramType', key: 'paramType' },
|
{ title: '单位', dataIndex: 'unitMeasureName', key: 'unitMeasureName' },
|
{ title: '参数值', dataIndex: 'paramValue', key: 'paramValue' },
|
{ title: '是否必填', dataIndex: 'required', key: 'required' },
|
];
|
|
const props = defineProps<{ id: string }>();
|
|
const router = useRouter();
|
const tabs = useTabs();
|
|
const loading = ref(false);
|
const feedbackId = ref(0);
|
const feedback = ref<MesProFeedbackApi.Feedback>({});
|
const activeTab = ref('itemConsume');
|
|
const [Descriptions] = useDescription({
|
bordered: false,
|
column: 4,
|
schema: useDetailSchema(),
|
});
|
|
async function loadFeedbackDetail() {
|
loading.value = true;
|
try {
|
feedback.value = await getFeedback(feedbackId.value);
|
} finally {
|
loading.value = false;
|
}
|
}
|
|
function handleBack() {
|
tabs.closeCurrentTab();
|
router.push({ path: '/mes/pro/feedback' });
|
}
|
|
onMounted(() => {
|
feedbackId.value = Number(props.id);
|
loadFeedbackDetail();
|
});
|
</script>
|
|
<template>
|
<Page
|
auto-content-height
|
:loading="loading"
|
:title="feedback.code ? `生产报工详情 - ${feedback.code}` : '生产报工详情'"
|
>
|
<Card class="min-h-[10%]">
|
<Descriptions :data="feedback" />
|
</Card>
|
<Card v-if="feedback.paramValues && feedback.paramValues.length > 0" class="mt-3" title="工艺参数">
|
<Table
|
:columns="paramColumns"
|
:data-source="feedback.paramValues"
|
:pagination="false"
|
row-key="detailId"
|
size="small"
|
>
|
<template #bodyCell="{ column, record }">
|
<template v-if="column.key === 'paramType'">
|
<DictTag
|
v-if="record.paramType !== undefined && record.paramType !== null"
|
:type="DICT_TYPE.MES_PD_PARAM_TYPE"
|
:value="record.paramType"
|
/>
|
</template>
|
<template v-else-if="column.key === 'required'">
|
<DictTag
|
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
|
:value="record.required ? 'true' : 'false'"
|
/>
|
</template>
|
</template>
|
</Table>
|
</Card>
|
|
</Page>
|
</template>
|