From f11bd0d8d9c1190340a445a67df9e43cdbde0a3e Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期四, 27 八月 2026 11:21:26 +0800
Subject: [PATCH] feat(mes): 基础参数与工序绑定前端 + 报工填写参数字段
---
src/views/mes/pro/task/index.vue | 69 +++++++++++++++++++++++++++++-----
1 files changed, 58 insertions(+), 11 deletions(-)
diff --git a/src/views/mes/pro/task/index.vue b/src/views/mes/pro/task/index.vue
index a97bb1c..e8e5b06 100644
--- a/src/views/mes/pro/task/index.vue
+++ b/src/views/mes/pro/task/index.vue
@@ -1,33 +1,39 @@
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
-import type { MesProWorkOrderApi } from '#/api/mes/pro/workorder';
+import {getWorkOrderSchedulePage, type MesProWorkOrderApi} from '#/api/mes/pro/workorder';
import { onMounted, ref } from 'vue';
import { useRouter } from 'vue-router';
-import { Page, useVbenModal } from '../../../../packages/effects/common-ui/src';
+import { Page, useVbenModal } from '@vben/common-ui';
import {
MesProWorkOrderStatusEnum,
MesProWorkOrderTypeEnum,
-} from '../../../../packages/constants/src';
+} from '@vben/constants';
-import { Button, Card } from 'ant-design-vue';
+import { Button, Card, Progress, Tabs } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { getGanttTaskList } from '#/api/mes/pro/task';
import { getWorkOrderPage } from '#/api/mes/pro/workorder';
+import ArchiveDetail from '#/views/mes/pd/archive/modules/detail.vue';
import { GanttChart } from './components';
import { useGridColumns, useGridFormSchema } from './data';
import ScheduleForm from './modules/schedule-form.vue';
const router = useRouter();
const ganttTasks = ref<any[]>([]); // 鐢樼壒鍥鹃瑙堟暟鎹�
+const archiveVisible = ref(false);
+const archiveProductCode = ref('');
+
+const activeTab = ref('PENDING'); // 榛樿閫変腑寰呮帓浜�
const [ScheduleModal, scheduleModalApi] = useVbenModal({
connectedComponent: ScheduleForm,
destroyOnClose: true,
});
+
/** 鍒锋柊琛ㄦ牸 */
function handleRefresh() {
@@ -43,7 +49,7 @@
});
}
-/** 鏌ョ湅宸ュ崟璇︽儏 */
+/** 鏌ョ湅璁㈠崟璇︽儏 */
function handleDetail(row: MesProWorkOrderApi.WorkOrder) {
scheduleModalApi.setData({ formType: 'detail', id: row.id }).open();
}
@@ -51,6 +57,13 @@
/** 鎺掍骇 */
function handleSchedule(row: MesProWorkOrderApi.WorkOrder) {
scheduleModalApi.setData({ formType: 'schedule', id: row.id }).open();
+}
+
+/** 涓�閿帓浜ч瑙� */
+/** 鎵撳紑褰掓。璇︽儏 */
+function handleArchive(row: MesProWorkOrderApi.WorkOrder) {
+ archiveProductCode.value = row.productCode || '';
+ archiveVisible.value = true;
}
/** 鎵撳紑鐢樼壒鍥剧紪杈戦〉闈� */
@@ -68,10 +81,19 @@
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
- return await getWorkOrderPage({
+ let scheduleStatus: number | undefined = undefined;
+
+ if (activeTab.value === 'PENDING') {
+ scheduleStatus = 0; // 寰呮帓浜�
+ } else if (activeTab.value === 'FINISHED') {
+ scheduleStatus = 1; // 宸插畬鎴�
+ }
+ // activeTab === 'ALL' 鏃朵笉浼�
+
+ return await getWorkOrderSchedulePage({
pageNo: page.currentPage,
pageSize: page.pageSize,
- status: MesProWorkOrderStatusEnum.CONFIRMED,
+ scheduleStatus,
type: MesProWorkOrderTypeEnum.SELF,
...formValues,
});
@@ -100,14 +122,27 @@
</script>
<template>
- <Page auto-content-height><ScheduleModal @success="handleRefresh" />
-
+ <Page auto-content-height>
+ <ScheduleModal @success="handleRefresh" />
<!-- 鎺掍骇鐢樼壒鍥鹃瑙� -->
<Card title="鎺掍骇鐢樼壒鍥�" class="mb-4">
+ <template #extra>
+ <span class="text-xs text-gray-400">灞曠ず宸茬‘璁よ嚜鍒惰鍗曠殑浠诲姟璁″垝</span>
+ </template>
<GanttChart :height="350" :readonly="true" :tasks="ganttTasks" />
</Card>
- <Grid table-title="寰呮帓浜у伐鍗�">
+ <Grid>
+ <template #table-title>
+ <div class="flex flex-col gap-2">
+ <span class="text-base font-medium">鐢熶骇璁㈠崟鍒楄〃</span>
+ <Tabs v-model:activeKey="activeTab" @change="handleRefresh" :tabBarStyle="{ margin: 0, borderBottom: 0 }">
+ <Tabs.TabPane key="ALL" tab="鍏ㄩ儴" />
+ <Tabs.TabPane key="PENDING" tab="鏈畬鎴�" />
+ <Tabs.TabPane key="FINISHED" tab="宸插畬鎴�" />
+ </Tabs>
+ </div>
+ </template>
<template #toolbar-tools>
<TableAction
:actions="[
@@ -125,19 +160,31 @@
{{ row.code }}
</Button>
</template>
+ <template #progressPercent="{ row }">
+ <Progress
+ :percent="Math.min(100, Math.round((row.quantity ? ((row.quantityProduced || 0) / row.quantity) * 100 : 0)))"
+ size="small"
+ />
+ </template>
<template #actions="{ row }">
<TableAction
:actions="[
{
- label: '鎺掍骇',
+ label: '鎺掍骇缁存姢',
type: 'link',
auth: ['mes:pro-task:create'],
ifShow: row.status === MesProWorkOrderStatusEnum.CONFIRMED,
onClick: handleSchedule.bind(null, row),
},
+ {
+ label: '褰掓。璇︽儏',
+ type: 'link',
+ onClick: handleArchive.bind(null, row),
+ },
]"
/>
</template>
</Grid>
+ <ArchiveDetail :visible="archiveVisible" :product-code="archiveProductCode" @update:visible="archiveVisible = $event" />
</Page>
</template>
--
Gitblit v1.9.3