From b7ffa7395cddfeb10f88d70a81567371f62021c3 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期日, 25 十月 2026 16:30:17 +0800
Subject: [PATCH] feat(router): 排除AI模块页面并添加访问权限控制
---
src/views/dashboard/analytics/modules/quick-actions.vue | 31 +-
src/views/mes/qc/iqc/modules/form.vue | 9
src/views/crm/saleQuotation/index.vue | 33 ---
src/views/mes/qc/ipqc/data.ts | 1
src/views/mes/qc/iqc/data.ts | 1
src/views/mes/pro/mps/modules/form.vue | 15 -
src/views/mes/qc/oqc/modules/form.vue | 9
src/views/mes/pro/route/data.ts | 77 +++++++
src/views/erp/purchase/request/data.ts | 19 +
src/router/access.ts | 6
src/views/erp/purchase/request/modules/form.vue | 8
src/views/hrm/attendance/record/modules/clock-panel.vue | 41 ++-
src/views/hrm/attendance/rule/data.ts | 87 ++++++++
src/api/erp/purchase/request/index.ts | 2
src/api/hrm/attendance/rule/index.ts | 9
src/views/mes/qc/ipqc/modules/form.vue | 9
src/views/system/user/data.ts | 9
src/views/mes/md/item/modules/form.vue | 5
src/views/mes/pro/route/modules/process-form.vue | 27 +-
src/views/dashboard/analytics/modules/biz-cards.vue | 22 +
src/views/mes/qc/oqc/data.ts | 1
src/views/mes/qc/rqc/modules/form.vue | 9
src/api/hrm/attendance/record/index.ts | 19 +
src/views/dashboard/analytics/modules/alert-panel.vue | 18 +
src/views/dashboard/analytics/modules/kpi-cards.vue | 17 +
src/views/erp/sale/order/index.vue | 9
src/views/mes/pro/workorder/modules/form.vue | 19 -
src/views/mes/pro/route/modules/product-form.vue | 2
src/api/mes/pro/route/product/index.ts | 6
src/views/dashboard/analytics/index.vue | 32 ++
src/views/mes/qc/rqc/data.ts | 1
31 files changed, 372 insertions(+), 181 deletions(-)
diff --git a/src/api/erp/purchase/request/index.ts b/src/api/erp/purchase/request/index.ts
index 8a8c102..1da6968 100644
--- a/src/api/erp/purchase/request/index.ts
+++ b/src/api/erp/purchase/request/index.ts
@@ -17,10 +17,12 @@
supplierId?: number; // 渚涘簲鍟嗙紪鍙�
supplierName?: string; // 渚涘簲鍟嗗悕绉�
discountPercent?: number; // 浼樻儬鐜�
+ depositPrice: number; // 瀹氶噾閲戦
attachmentList?: { id: number; name?: string; url?: string }[]; // 闄勪欢鍒楄〃
remark?: string; // 澶囨敞
totalCount?: number; // 鎬绘暟閲�
totalPrice?: number; // 鎬婚噾棰�
+ totalTaxPrice?: number; // 绋庨鍚堣
productNames?: string; // 浜у搧鍚嶇О鍒楄〃
orderId?: number; // 鐢熸垚鐨勯噰璐鍗曠紪鍙�
orderNo?: string; // 鐢熸垚鐨勯噰璐鍗曞彿
diff --git a/src/api/hrm/attendance/record/index.ts b/src/api/hrm/attendance/record/index.ts
index 584cb2e..8962dc1 100644
--- a/src/api/hrm/attendance/record/index.ts
+++ b/src/api/hrm/attendance/record/index.ts
@@ -79,20 +79,25 @@
return requestClient.download('/hrm/attendance/record/export-excel', { params });
}
+export interface AttendanceClockLocation {
+ longitude: number;
+ latitude: number;
+ accuracy: number;
+ coordinateSystem: 'WGS84';
+}
+
/** 涓婄彮鎵撳崱 */
-export function clockIn(params: { location: string }) {
+export function clockIn(data: AttendanceClockLocation) {
return requestClient.post<HrmAttendanceRecordApi.AttendanceRecord>(
'/hrm/attendance/record/clock-in',
- null,
- { params },
+ data,
);
}
/** 涓嬬彮鎵撳崱 */
-export function clockOut(params: { location: string }) {
+export function clockOut(data: AttendanceClockLocation) {
return requestClient.post<HrmAttendanceRecordApi.AttendanceRecord>(
'/hrm/attendance/record/clock-out',
- null,
- { params },
+ data,
);
-}
\ No newline at end of file
+}
diff --git a/src/api/hrm/attendance/rule/index.ts b/src/api/hrm/attendance/rule/index.ts
index 75a1e6c..9eed25b 100644
--- a/src/api/hrm/attendance/rule/index.ts
+++ b/src/api/hrm/attendance/rule/index.ts
@@ -14,6 +14,13 @@
lateAllowMinutes?: number;
earlyAllowMinutes?: number;
overtimeThreshold?: number;
+ locationName?: string;
+ locationAddress?: string;
+ longitude?: number;
+ latitude?: number;
+ radiusMeters?: number;
+ locationRequired?: boolean;
+ coordinateSystem?: 'WGS84';
status?: number;
remark?: string;
createTime?: string;
@@ -73,4 +80,4 @@
file,
updateSupport,
});
-}
\ No newline at end of file
+}
diff --git a/src/api/mes/pro/route/product/index.ts b/src/api/mes/pro/route/product/index.ts
index 2312f68..6dd7f3d 100644
--- a/src/api/mes/pro/route/product/index.ts
+++ b/src/api/mes/pro/route/product/index.ts
@@ -8,6 +8,12 @@
itemId?: number;
itemCode?: string;
itemName?: string;
+ warehouseId?: number;
+ warehouseName?: string;
+ locationId?: number;
+ locationName?: string;
+ areaId?: number;
+ areaName?: string;
specification?: string;
unitName?: string;
quantity?: number;
diff --git a/src/router/access.ts b/src/router/access.ts
index f598e28..1076d56 100644
--- a/src/router/access.ts
+++ b/src/router/access.ts
@@ -40,7 +40,11 @@
}
async function generateAccess(options: GenerateMenuAndRoutesOptions) {
- const pageMap: ComponentRecordType = import.meta.glob('../views/**/*.vue');
+ // 杞婚噺鐗堝悗绔笉鍖呭惈 AI 妯″潡锛屾瀯寤洪樁娈靛嵆鎺掗櫎 AI 椤甸潰锛岄伩鍏嶇敓鎴愪笉鍙闂殑 AI 鍒嗗寘銆�
+ const pageMap: ComponentRecordType = import.meta.glob([
+ '../views/**/*.vue',
+ '!../views/ai/**/*.vue',
+ ]);
const accessStore = useAccessStore();
const layoutMap: ComponentRecordType = {
diff --git a/src/views/crm/saleQuotation/index.vue b/src/views/crm/saleQuotation/index.vue
index bebca59..7d65b7c 100644
--- a/src/views/crm/saleQuotation/index.vue
+++ b/src/views/crm/saleQuotation/index.vue
@@ -16,15 +16,9 @@
getSaleQuotationPage,
} from '#/api/crm/saleQuotation';
import { $t } from '#/locales';
-import { isAiFeatureEnabled } from '#/utils/features';
-
-import type { CrmSaleQuotationAiApi } from '#/api/crm/saleQuotation/ai';
-
-import { nextTick, ref } from 'vue';
import { QUOTATION_STATUS, useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
-import OcrUpload from './modules/ocr-upload.vue';
const { push } = useRouter();
@@ -32,8 +26,6 @@
connectedComponent: Form,
destroyOnClose: true,
});
-
-const ocrUploadRef = ref<InstanceType<typeof OcrUpload>>();
/** 鍒锋柊琛ㄦ牸 */
function handleRefresh() {
@@ -45,18 +37,6 @@
formModalApi.setData(null).open();
}
-/** AI 璇嗗埆褰曞叆 */
-function handleOcrCreate() {
- ocrUploadRef.value?.open();
-}
-
-/** OCR 璇嗗埆缁撴灉纭 */
-function handleOcrSuccess(data: CrmSaleQuotationAiApi.OcrResultVO) {
- nextTick(() => {
- formModalApi.setData({ ocrData: data } as any).open();
- });
-}
-
const toolbarActions: ActionItem[] = [
{
label: $t('ui.actionTitle.create', ['鎶ヤ环鍗�']),
@@ -66,14 +46,6 @@
onClick: handleCreate,
},
];
-if (isAiFeatureEnabled) {
- toolbarActions.push({
- label: 'AI 璇嗗埆褰曞叆',
- type: 'default',
- auth: ['crm:sale-quotation:create'],
- onClick: handleOcrCreate,
- });
-}
/** 缂栬緫鎶ヤ环鍗� */
function handleEdit(row: CrmSaleQuotationApi.SaleQuotation) {
@@ -166,11 +138,6 @@
<template>
<Page auto-content-height>
<FormModal @success="handleRefresh" />
- <OcrUpload
- v-if="isAiFeatureEnabled"
- ref="ocrUploadRef"
- @success="handleOcrSuccess"
- />
<Grid>
<template #toolbar-tools>
<TableAction :actions="toolbarActions" />
diff --git a/src/views/dashboard/analytics/index.vue b/src/views/dashboard/analytics/index.vue
index 6085aef..9f3ed2a 100644
--- a/src/views/dashboard/analytics/index.vue
+++ b/src/views/dashboard/analytics/index.vue
@@ -3,6 +3,7 @@
import { useRouter } from 'vue-router';
import { Page } from '@vben/common-ui';
+import { useAccess } from '@vben/access';
import { Card, Col, Row } from 'ant-design-vue';
@@ -18,7 +19,29 @@
defineOptions({ name: 'DashboardAnalytics' });
const router = useRouter();
+const { hasAccessByCodes } = useAccess();
const summary = ref(defaultSummary);
+
+const canViewProduction = computed(() =>
+ hasAccessByCodes(['mes:pro-work-order:query', 'mes:pro-feedback:query']),
+);
+const canViewAlerts = computed(() =>
+ hasAccessByCodes([
+ 'mes:pro-work-order:query',
+ 'mes:pro-andon-record:query',
+ 'mes:dv-repair:query',
+ ]),
+);
+const canViewMesSummary = computed(() =>
+ hasAccessByCodes([
+ 'mes:pro-work-order:query',
+ 'mes:pro-feedback:query',
+ 'mes:qc-ipqc:query',
+ 'mes:dv-machinery:query',
+ 'mes:pro-andon-record:query',
+ 'mes:dv-repair:query',
+ ]),
+);
const greeting = computed(() => {
const hour = new Date().getHours();
@@ -41,6 +64,7 @@
}
async function loadSummary() {
+ if (!canViewMesSummary.value) return;
summary.value = await getHomeSummary();
}
@@ -71,14 +95,14 @@
</div>
<!-- MES 鐢熶骇 KPI -->
- <KpiCards :summary="summary" @navigate="handleNavigate" />
+ <KpiCards v-if="canViewMesSummary" :summary="summary" @navigate="handleNavigate" />
<!-- ERP/WMS/BPM 缁忚惀 KPI -->
<BizCards @navigate="handleNavigate" />
<!-- 鐢熶骇瓒嬪娍 + 棰勮闈㈡澘 -->
- <Row :gutter="16" class="mb-4">
- <Col :lg="14" :md="24" :sm="24" :xl="14" :xs="24" class="mb-4">
+ <Row v-if="canViewProduction || canViewAlerts" :gutter="16" class="mb-4">
+ <Col v-if="canViewProduction" :lg="canViewAlerts ? 14 : 24" :md="24" :sm="24" :xl="canViewAlerts ? 14 : 24" :xs="24" class="mb-4">
<div class="glass-card rounded-2xl p-5">
<h3 class="mb-4 text-base font-semibold text-gray-800 dark:text-gray-100">
鐢熶骇瓒嬪娍锛堣繎7澶╋級
@@ -86,7 +110,7 @@
<ProductionTrend />
</div>
</Col>
- <Col :lg="10" :md="24" :sm="24" :xl="10" :xs="24" class="mb-4">
+ <Col v-if="canViewAlerts" :lg="canViewProduction ? 10 : 24" :md="24" :sm="24" :xl="canViewProduction ? 10 : 24" :xs="24" class="mb-4">
<AlertPanel
:andon-active-count="summary.andonActiveCount"
:repair-active-count="summary.repairActiveCount"
diff --git a/src/views/dashboard/analytics/modules/alert-panel.vue b/src/views/dashboard/analytics/modules/alert-panel.vue
index 4be1544..0f1bf4d 100644
--- a/src/views/dashboard/analytics/modules/alert-panel.vue
+++ b/src/views/dashboard/analytics/modules/alert-panel.vue
@@ -2,9 +2,10 @@
import type { MesHomeApi } from '#/api/mes/home';
import type { EchartsUIType } from '@vben/plugins/echarts';
-import { onMounted, ref } from 'vue';
+import { computed, onMounted, ref } from 'vue';
import { CountTo } from '@vben/common-ui';
+import { useAccess } from '@vben/access';
import { IconifyIcon } from '@vben/icons';
import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
@@ -22,12 +23,17 @@
const emit = defineEmits<{
navigate: [name: string];
}>();
+const { hasAccessByCodes } = useAccess();
+const canViewWorkOrder = computed(() => hasAccessByCodes(['mes:pro-work-order:query']));
+const canViewAndon = computed(() => hasAccessByCodes(['mes:pro-andon-record:query']));
+const canViewRepair = computed(() => hasAccessByCodes(['mes:dv-repair:query']));
const chartRef = ref<EchartsUIType>();
const { renderEcharts } = useEcharts(chartRef);
const loading = ref(false);
async function loadStatus() {
+ if (!canViewWorkOrder.value) return;
loading.value = true;
try {
const data = await getWorkOrderStatusDistribution();
@@ -67,10 +73,11 @@
<template>
<div class="space-y-4">
<!-- 棰勮鍗$墖琛� -->
- <div class="grid grid-cols-2 gap-3">
+ <div v-if="canViewAndon || canViewRepair" class="grid gap-3" :class="canViewAndon && canViewRepair ? 'grid-cols-2' : 'grid-cols-1'">
<div
+ v-if="canViewAndon"
class="glass-tilt group cursor-pointer overflow-hidden rounded-2xl border-0 p-4"
- @click="emit('navigate', 'MesProAndon')"
+ @click="emit('navigate', 'MesProAndonRecord')"
>
<div class="relative z-10 flex items-center gap-3">
<div class="flex size-10 items-center justify-center rounded-lg bg-red-50 text-red-600 shadow-sm dark:bg-red-500/15 dark:text-red-400">
@@ -86,8 +93,9 @@
</div>
</div>
<div
+ v-if="canViewRepair"
class="glass-tilt group cursor-pointer overflow-hidden rounded-2xl border-0 p-4"
- @click="emit('navigate', 'MesProRepair')"
+ @click="emit('navigate', 'MesDvRepair')"
>
<div class="relative z-10 flex items-center gap-3">
<div class="flex size-10 items-center justify-center rounded-lg bg-amber-50 text-amber-600 shadow-sm dark:bg-amber-500/15 dark:text-amber-400">
@@ -105,7 +113,7 @@
</div>
<!-- 宸ュ崟鐘舵�佸浘 -->
- <div class="glass-tilt rounded-2xl p-5">
+ <div v-if="canViewWorkOrder" class="glass-tilt rounded-2xl p-5">
<h4 class="mb-3 text-sm font-semibold text-gray-800 dark:text-gray-100">
宸ュ崟鐘舵�佸垎甯�
</h4>
diff --git a/src/views/dashboard/analytics/modules/biz-cards.vue b/src/views/dashboard/analytics/modules/biz-cards.vue
index 95a9e63..0db6bd4 100644
--- a/src/views/dashboard/analytics/modules/biz-cards.vue
+++ b/src/views/dashboard/analytics/modules/biz-cards.vue
@@ -1,6 +1,7 @@
<script lang="ts" setup>
import { onMounted, ref } from 'vue';
+import { useAccess } from '@vben/access';
import { CountTo } from '@vben/common-ui';
import { IconifyIcon } from '@vben/icons';
@@ -16,6 +17,11 @@
const emit = defineEmits<{
navigate: [name: string];
}>();
+const { hasAccessByCodes } = useAccess();
+const canPurchase = hasAccessByCodes(['erp:purchase-order:query']);
+const canSale = hasAccessByCodes(['erp:sale-order:query']);
+const canStock = hasAccessByCodes(['mes:wm-material-stock:query']);
+const canBpmTodo = hasAccessByCodes(['bpm:task:query']);
const purchaseCount = ref(0);
const saleCount = ref(0);
@@ -75,17 +81,17 @@
}
onMounted(() => {
- loadPurchase();
- loadSale();
- loadStock();
- loadBpmTodo();
+ if (canPurchase) loadPurchase();
+ if (canSale) loadSale();
+ if (canStock) loadStock();
+ if (canBpmTodo) loadBpmTodo();
});
</script>
<template>
<Row :gutter="16">
<!-- 閲囪喘璁㈠崟 -->
- <Col :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
+ <Col v-if="canPurchase" :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
<div
class="glass-tilt group cursor-pointer overflow-hidden rounded-2xl border-0"
:style="tiltStyle('purchase')"
@@ -112,7 +118,7 @@
</Col>
<!-- 閿�鍞鍗� -->
- <Col :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
+ <Col v-if="canSale" :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
<div
class="glass-tilt group cursor-pointer overflow-hidden rounded-2xl border-0"
:style="tiltStyle('sale')"
@@ -139,7 +145,7 @@
</Col>
<!-- 鐗╂枡搴撳瓨 -->
- <Col :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
+ <Col v-if="canStock" :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
<div
class="glass-tilt group cursor-pointer overflow-hidden rounded-2xl border-0"
:style="tiltStyle('stock')"
@@ -166,7 +172,7 @@
</Col>
<!-- BPM 寰呭姙 -->
- <Col :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
+ <Col v-if="canBpmTodo" :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
<div
class="glass-tilt group cursor-pointer overflow-hidden rounded-2xl border-0"
:style="tiltStyle('bpm')"
diff --git a/src/views/dashboard/analytics/modules/kpi-cards.vue b/src/views/dashboard/analytics/modules/kpi-cards.vue
index 761db56..cb5eaf9 100644
--- a/src/views/dashboard/analytics/modules/kpi-cards.vue
+++ b/src/views/dashboard/analytics/modules/kpi-cards.vue
@@ -4,6 +4,7 @@
import { computed, ref } from 'vue';
import { CountTo } from '@vben/common-ui';
+import { useAccess } from '@vben/access';
import { IconifyIcon } from '@vben/icons';
import { Col, Row } from 'ant-design-vue';
@@ -13,6 +14,14 @@
const props = defineProps<{
summary: MesHomeApi.Summary;
}>();
+const { hasAccessByCodes } = useAccess();
+
+const canViewWorkOrder = computed(() => hasAccessByCodes(['mes:pro-work-order:query']));
+const canViewFeedback = computed(() => hasAccessByCodes(['mes:pro-feedback:query']));
+const canViewQuality = computed(() => hasAccessByCodes([
+ 'mes:qc-iqc:query', 'mes:qc-ipqc:query', 'mes:qc-oqc:query', 'mes:qc-rqc:query',
+]));
+const canViewEquipment = computed(() => hasAccessByCodes(['mes:dv-machinery:query']));
const emit = defineEmits<{
navigate: [name: string];
@@ -59,7 +68,7 @@
<template>
<Row :gutter="16">
<!-- 鐢熶骇璁㈠崟 -->
- <Col :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
+ <Col v-if="canViewWorkOrder" :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
<div
class="glass-tilt group cursor-pointer overflow-hidden rounded-2xl border-0"
:style="tiltStyle('order')"
@@ -90,7 +99,7 @@
</Col>
<!-- 浠婃棩浜ч噺 -->
- <Col :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
+ <Col v-if="canViewFeedback" :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
<div
class="glass-tilt group cursor-pointer overflow-hidden rounded-2xl border-0"
:style="tiltStyle('output')"
@@ -121,7 +130,7 @@
</Col>
<!-- 璐ㄩ噺鍚堟牸鐜� -->
- <Col :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
+ <Col v-if="canViewQuality" :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
<div
class="glass-tilt group cursor-pointer overflow-hidden rounded-2xl border-0"
:style="tiltStyle('quality')"
@@ -154,7 +163,7 @@
</Col>
<!-- 璁惧杩愯鐜� -->
- <Col :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
+ <Col v-if="canViewEquipment" :lg="6" :md="12" :sm="12" :xl="6" :xs="24" class="mb-4">
<div
class="glass-tilt group cursor-pointer overflow-hidden rounded-2xl border-0"
:style="tiltStyle('equip')"
diff --git a/src/views/dashboard/analytics/modules/quick-actions.vue b/src/views/dashboard/analytics/modules/quick-actions.vue
index f84affb..a576846 100644
--- a/src/views/dashboard/analytics/modules/quick-actions.vue
+++ b/src/views/dashboard/analytics/modules/quick-actions.vue
@@ -1,4 +1,7 @@
<script lang="ts" setup>
+import { computed } from 'vue';
+
+import { useAccess } from '@vben/access';
import { IconifyIcon } from '@vben/icons';
defineOptions({ name: 'DashboardQuickActions' });
@@ -13,25 +16,29 @@
route: string;
gradient: string;
shadow: string;
+ permissions: string[];
}
-const actions: QuickAction[] = [
- { title: '鐢熶骇宸ュ崟', icon: 'lucide:file-text', route: 'MesProWorkOrder', gradient: 'from-blue-500 to-cyan-500', shadow: 'shadow-blue-500/15' },
- { title: '鐢熶骇鎶ュ伐', icon: 'lucide:check-square', route: 'MesProFeedback', gradient: 'from-emerald-500 to-green-500', shadow: 'shadow-emerald-500/15' },
- { title: '璐ㄦ绠$悊', icon: 'lucide:clipboard-check', route: 'MesQcRecord', gradient: 'from-orange-500 to-amber-500', shadow: 'shadow-orange-500/15' },
- { title: '璁惧鐐规', icon: 'lucide:settings', route: 'MesDvMachinery', gradient: 'from-violet-500 to-purple-500', shadow: 'shadow-violet-500/15' },
- { title: '鐢熶骇鎺掔▼', icon: 'lucide:calendar-range', route: 'MesProScheduling', gradient: 'from-cyan-500 to-teal-500', shadow: 'shadow-cyan-500/15' },
- { title: '瀹夌伅鍛煎彨', icon: 'lucide:bell-ring', route: 'MesProAndon', gradient: 'from-red-500 to-rose-500', shadow: 'shadow-red-500/15' },
- { title: '鐗╂枡搴撳瓨', icon: 'lucide:package-search', route: 'WlsMaterialStock', gradient: 'from-indigo-500 to-blue-500', shadow: 'shadow-indigo-500/15' },
- { title: '宸ヨ壓璺嚎', icon: 'lucide:route', route: 'MesPdRouting', gradient: 'from-teal-500 to-emerald-500', shadow: 'shadow-teal-500/15' },
- { title: '鏁版嵁鎶ヨ〃', icon: 'lucide:bar-chart-big', route: 'MesHomeIndex', gradient: 'from-pink-500 to-rose-500', shadow: 'shadow-pink-500/15' },
+const { hasAccessByCodes } = useAccess();
+const allActions: QuickAction[] = [
+ { title: '鐢熶骇宸ュ崟', icon: 'lucide:file-text', route: 'MesProWorkOrder', gradient: 'from-blue-500 to-cyan-500', shadow: 'shadow-blue-500/15', permissions: ['mes:pro-work-order:query'] },
+ { title: '鐢熶骇鎶ュ伐', icon: 'lucide:check-square', route: 'MesProFeedback', gradient: 'from-emerald-500 to-green-500', shadow: 'shadow-emerald-500/15', permissions: ['mes:pro-feedback:query'] },
+ { title: '璐ㄦ绠$悊', icon: 'lucide:clipboard-check', route: 'MesQcIqc', gradient: 'from-orange-500 to-amber-500', shadow: 'shadow-orange-500/15', permissions: ['mes:qc-iqc:query', 'mes:qc-ipqc:query', 'mes:qc-oqc:query', 'mes:qc-rqc:query'] },
+ { title: '璁惧鍙拌处', icon: 'lucide:settings', route: 'MesDvMachinery', gradient: 'from-violet-500 to-purple-500', shadow: 'shadow-violet-500/15', permissions: ['mes:dv-machinery:query'] },
+ { title: '鍛樺伐鎺掔彮', icon: 'lucide:calendar-range', route: 'MesCalScheduleDetail', gradient: 'from-cyan-500 to-teal-500', shadow: 'shadow-cyan-500/15', permissions: ['mes:cal-schedule-detail:query'] },
+ { title: '瀹夌伅鍛煎彨', icon: 'lucide:bell-ring', route: 'MesProAndonRecord', gradient: 'from-red-500 to-rose-500', shadow: 'shadow-red-500/15', permissions: ['mes:pro-andon-record:query'] },
+ { title: '鐗╂枡搴撳瓨', icon: 'lucide:package-search', route: 'MesWmMaterialStock', gradient: 'from-indigo-500 to-blue-500', shadow: 'shadow-indigo-500/15', permissions: ['mes:wm-material-stock:query'] },
+ { title: '宸ヨ壓璺嚎', icon: 'lucide:route', route: 'MesProRoute', gradient: 'from-teal-500 to-emerald-500', shadow: 'shadow-teal-500/15', permissions: ['mes:pro-route:query'] },
];
+const actions = computed(() =>
+ allActions.filter((action) => hasAccessByCodes(action.permissions)),
+);
</script>
<template>
- <div class="glass-card rounded-2xl p-5">
+ <div v-if="actions.length" class="glass-card rounded-2xl p-5">
<h3 class="mb-4 text-sm font-semibold text-gray-800 dark:text-gray-100">蹇嵎鎿嶄綔</h3>
- <div class="grid grid-cols-3 gap-3 sm:grid-cols-9">
+ <div class="grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-8">
<div
v-for="action in actions"
:key="action.route"
diff --git a/src/views/erp/purchase/request/data.ts b/src/views/erp/purchase/request/data.ts
index a1b9268..da8de06 100644
--- a/src/views/erp/purchase/request/data.ts
+++ b/src/views/erp/purchase/request/data.ts
@@ -84,11 +84,24 @@
fieldName: 'depositPrice',
label: '瀹氶噾',
component: 'InputNumber',
+ defaultValue: 0,
componentProps: {
placeholder: '璇疯緭鍏ュ畾閲�',
min: 0,
precision: 2,
disabled: formType === 'detail',
+ },
+ rules: 'required',
+ },
+ {
+ fieldName: 'totalTaxPrice',
+ label: '绋庨',
+ component: 'InputNumber',
+ componentProps: {
+ placeholder: '鏍规嵁鏄庣粏绋庣巼鑷姩璁$畻',
+ min: 0,
+ precision: 2,
+ disabled: true,
},
},
{
@@ -180,6 +193,12 @@
formatter: 'formatAmount2',
},
{
+ field: 'totalTaxPrice',
+ title: '绋庨',
+ formatter: 'formatAmount2',
+ minWidth: 120,
+ },
+ {
field: 'taxPercent',
title: '绋庣巼(%)',
minWidth: 100,
diff --git a/src/views/erp/purchase/request/modules/form.vue b/src/views/erp/purchase/request/modules/form.vue
index 7444f4e..0acd1df 100644
--- a/src/views/erp/purchase/request/modules/form.vue
+++ b/src/views/erp/purchase/request/modules/form.vue
@@ -108,6 +108,12 @@
formApi.setDisabled(formType.value === 'detail');
formApi.updateSchema(useFormSchema(formType.value));
if (!data || !data.id) {
+ formData.value = {
+ requestTime: '',
+ depositPrice: 0,
+ items: [],
+ };
+ await formApi.setFieldValue('depositPrice', 0);
return;
}
modalApi.lock();
@@ -148,4 +154,4 @@
</template>
</Form>
</Modal>
-</template>
\ No newline at end of file
+</template>
diff --git a/src/views/erp/sale/order/index.vue b/src/views/erp/sale/order/index.vue
index cc3a921..0b09c01 100644
--- a/src/views/erp/sale/order/index.vue
+++ b/src/views/erp/sale/order/index.vue
@@ -2,10 +2,11 @@
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { ErpSaleOrderApi } from '#/api/erp/sale/order';
-import { onMounted, ref } from 'vue';
+import { computed, onMounted, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { Page, useVbenModal } from '@vben/common-ui';
+import { useUserStore } from '@vben/stores';
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
import { message, Tag, Tooltip } from 'ant-design-vue';
@@ -35,6 +36,10 @@
const router = useRouter();
const route = useRoute();
+const userStore = useUserStore();
+const isSuperAdmin = computed(() =>
+ userStore.userRoles?.includes('super_admin'),
+);
const [FormModal, formModalApi] = useVbenModal({
connectedComponent: Form,
@@ -356,7 +361,7 @@
type: 'link',
icon: ACTION_ICON.AUDIT,
auth: ['erp:sale-order:update-status'],
- ifShow: () => row.status === 20,
+ ifShow: () => row.status === 20 && isSuperAdmin.value,
popConfirm: {
title: `纭鍙嶅鎵�${row.no}鍚楋紵`,
confirm: handleUpdateStatus.bind(null, row, 10),
diff --git a/src/views/hrm/attendance/record/modules/clock-panel.vue b/src/views/hrm/attendance/record/modules/clock-panel.vue
index 7f41eed..80c504d 100644
--- a/src/views/hrm/attendance/record/modules/clock-panel.vue
+++ b/src/views/hrm/attendance/record/modules/clock-panel.vue
@@ -5,18 +5,36 @@
import { message } from 'ant-design-vue';
+import type { AttendanceClockLocation } from '#/api/hrm/attendance/record';
import { clockIn, clockOut } from '#/api/hrm/attendance/record';
const emit = defineEmits(['success']);
-const location = ref('鍏徃鍓嶅彴');
const loading = ref(false);
+
+function getCurrentLocation(): Promise<AttendanceClockLocation> {
+ if (!navigator.geolocation) {
+ return Promise.reject(new Error('褰撳墠娴忚鍣ㄤ笉鏀寔瀹氫綅锛岃浣跨敤鏀寔 GPS 鐨勬祻瑙堝櫒'));
+ }
+ return new Promise((resolve, reject) => {
+ navigator.geolocation.getCurrentPosition(
+ (position) => resolve({
+ longitude: position.coords.longitude,
+ latitude: position.coords.latitude,
+ accuracy: position.coords.accuracy,
+ coordinateSystem: 'WGS84',
+ }),
+ () => reject(new Error('瀹氫綅澶辫触锛岃寮�鍚畾浣嶆潈闄愬悗閲嶈瘯锛堥潪 localhost 闇�浣跨敤 HTTPS锛�')),
+ { enableHighAccuracy: true, maximumAge: 0, timeout: 15_000 },
+ );
+ });
+}
/** 涓婄彮鎵撳崱 */
async function handleClockIn() {
loading.value = true;
try {
- await clockIn({ location: location.value });
+ await clockIn(await getCurrentLocation());
message.success('涓婄彮鎵撳崱鎴愬姛');
emit('success');
} catch (e: any) {
@@ -30,7 +48,7 @@
async function handleClockOut() {
loading.value = true;
try {
- await clockOut({ location: location.value });
+ await clockOut(await getCurrentLocation());
message.success('涓嬬彮鎵撳崱鎴愬姛');
emit('success');
} catch (e: any) {
@@ -41,24 +59,15 @@
}
const [Modal, modalApi] = useVbenModal({
- onOpenChange(isOpen: boolean) {
- if (!isOpen) {
- location.value = '鍏徃鍓嶅彴';
- }
- },
+ onOpenChange() {},
});
</script>
<template>
<Modal title="鎵撳崱" class="w-[400px]">
<div class="p-4">
- <div class="mb-4">
- <label class="mr-2">鎵撳崱鍦扮偣锛�</label>
- <a-input
- v-model:value="location"
- placeholder="璇疯緭鍏ユ墦鍗″湴鐐�"
- style="width: 200px"
- />
+ <div class="mb-4 text-sm text-gray-500">
+ 鐐瑰嚮鎵撳崱鍚庡皢鑾峰彇褰撳墠 GPS 浣嶇疆锛屽苟鎸夎�冨嫟瑙勫垯涓殑缁忕含搴﹀拰鎵撳崱鍗婂緞鏍¢獙銆�
</div>
<div class="flex gap-4">
<a-button
@@ -79,4 +88,4 @@
</div>
</div>
</Modal>
-</template>
\ No newline at end of file
+</template>
diff --git a/src/views/hrm/attendance/rule/data.ts b/src/views/hrm/attendance/rule/data.ts
index 50bca13..c286424 100644
--- a/src/views/hrm/attendance/rule/data.ts
+++ b/src/views/hrm/attendance/rule/data.ts
@@ -106,6 +106,83 @@
},
},
{
+ fieldName: 'locationRequired',
+ label: '瀹氫綅鎵撳崱',
+ component: 'Switch',
+ defaultValue: false,
+ componentProps: {
+ checkedChildren: '鍚敤',
+ unCheckedChildren: '鍏抽棴',
+ },
+ },
+ {
+ fieldName: 'locationName',
+ label: '鎵撳崱鍦扮偣',
+ component: 'Input',
+ componentProps: { placeholder: '渚嬪锛氭柊楂樼數鍔涘巶鍖�' },
+ dependencies: {
+ triggerFields: ['locationRequired'],
+ show: (values) => Boolean(values.locationRequired),
+ },
+ rules: 'required',
+ },
+ {
+ fieldName: 'locationAddress',
+ label: '鍦扮偣鍦板潃',
+ component: 'Input',
+ componentProps: { placeholder: '璇疯緭鍏ヨ缁嗗湴鍧�锛屼究浜庡憳宸ヨ瘑鍒�' },
+ dependencies: {
+ triggerFields: ['locationRequired'],
+ show: (values) => Boolean(values.locationRequired),
+ },
+ },
+ {
+ fieldName: 'longitude',
+ label: '缁忓害(WGS84)',
+ component: 'InputNumber',
+ componentProps: { min: -180, max: 180, precision: 7, style: { width: '100%' } },
+ dependencies: {
+ triggerFields: ['locationRequired'],
+ show: (values) => Boolean(values.locationRequired),
+ },
+ rules: 'required',
+ },
+ {
+ fieldName: 'latitude',
+ label: '绾害(WGS84)',
+ component: 'InputNumber',
+ componentProps: { min: -90, max: 90, precision: 7, style: { width: '100%' } },
+ dependencies: {
+ triggerFields: ['locationRequired'],
+ show: (values) => Boolean(values.locationRequired),
+ },
+ rules: 'required',
+ },
+ {
+ fieldName: 'radiusMeters',
+ label: '鎵撳崱鍗婂緞(绫�)',
+ component: 'InputNumber',
+ defaultValue: 100,
+ componentProps: { min: 10, max: 5000, precision: 0, style: { width: '100%' } },
+ help: '鏈�灏忓彲璁� 10 绫筹紱瀹為檯绮惧害鍙栧喅浜庢墜鏈� GPS 涓庣幆澧�',
+ dependencies: {
+ triggerFields: ['locationRequired'],
+ show: (values) => Boolean(values.locationRequired),
+ },
+ rules: 'required',
+ },
+ {
+ fieldName: 'coordinateSystem',
+ label: '鍧愭爣绯�',
+ component: 'Input',
+ defaultValue: 'WGS84',
+ componentProps: { disabled: true },
+ dependencies: {
+ triggerFields: ['locationRequired'],
+ show: (values) => Boolean(values.locationRequired),
+ },
+ },
+ {
fieldName: 'status',
label: '鐘舵��',
component: 'RadioGroup',
@@ -186,6 +263,14 @@
{ field: 'earlyAllowMinutes', title: '鏃╅��鍏佽(鍒嗛挓)', width: 120 },
{ field: 'overtimeThreshold', title: '鍔犵彮璧风畻(灏忔椂)', width: 120 },
{
+ field: 'locationName',
+ title: '鎵撳崱鑼冨洿',
+ minWidth: 180,
+ formatter: ({ row }) => row.locationRequired
+ ? `${row.locationName || '-'}锛�${row.radiusMeters || 0}绫筹級`
+ : '涓嶉檺鍒朵綅缃�',
+ },
+ {
field: 'status',
title: '鐘舵��',
width: 80,
@@ -203,4 +288,4 @@
},
},
];
-}
\ No newline at end of file
+}
diff --git a/src/views/mes/md/item/modules/form.vue b/src/views/mes/md/item/modules/form.vue
index 7f1f865..7fc3d4f 100644
--- a/src/views/mes/md/item/modules/form.vue
+++ b/src/views/mes/md/item/modules/form.vue
@@ -8,7 +8,7 @@
import { useVbenModal } from '@vben/common-ui';
import { BarcodeBizTypeEnum } from '@vben/constants';
-import { Button, Empty, message, Tabs } from 'ant-design-vue';
+import { Button, message, Tabs } from 'ant-design-vue';
import { useVbenForm } from '#/adapter/form';
import { createItem, getItem, updateItem } from '#/api/mes/md/item';
@@ -137,9 +137,6 @@
:item-id="formData.id"
:item-or-product="currentItemOrProduct"
/>
- </Tabs.TabPane>
- <Tabs.TabPane key="substitute" tab="鏇夸唬鍝�">
- <Empty description="鏇夸唬鍝侊紙寰呭疄鐜帮級" />
</Tabs.TabPane>
<Tabs.TabPane key="sip" tab="妫�楠屾寚瀵间功(SIP)">
<ProductSipForm :form-type="formType" :item-id="formData.id" />
diff --git a/src/views/mes/pro/mps/modules/form.vue b/src/views/mes/pro/mps/modules/form.vue
index 079be95..19a8bfc 100644
--- a/src/views/mes/pro/mps/modules/form.vue
+++ b/src/views/mes/pro/mps/modules/form.vue
@@ -12,12 +12,6 @@
import { useVbenForm } from '#/adapter/form';
import { createMps, getMps, updateMps } from '#/api/mes/pro/mps';
import { $t } from '#/locales';
-import { isAiFeatureEnabled } from '#/utils/features';
-
-import PredictDelivery from '../../workorder/modules/ai/predict-delivery.vue';
-import PredictDuration from '../../workorder/modules/ai/predict-duration.vue';
-import PredictMaterial from '../../workorder/modules/ai/predict-material.vue';
-import PredictRisk from '../../workorder/modules/ai/predict-risk.vue';
import { MpsStatusEnum, useFormSchema } from '../data';
const emit = defineEmits(['success']);
@@ -26,7 +20,6 @@
const isEditable = computed(() => ['create', 'edit'].includes(formType.value));
-const canUseAi = computed(() => isAiFeatureEnabled && !!formData.value?.id);
const getTitle = computed(() => {
switch (formType.value) {
@@ -178,13 +171,5 @@
</Descriptions.Item>
</Descriptions>
</div>
- <template #prepend-footer>
- <div v-if="canUseAi" class="flex items-center gap-2">
- <PredictMaterial :mps-id="formData!.id" :work-order-id="formData!.workOrderId" />
- <PredictDuration :mps-id="formData!.id" :work-order-id="formData!.workOrderId" />
- <PredictRisk :mps-id="formData!.id" :work-order-id="formData!.workOrderId" />
- <PredictDelivery :mps-id="formData!.id" :work-order-id="formData!.workOrderId" />
- </div>
- </template>
</Modal>
</template>
diff --git a/src/views/mes/pro/route/data.ts b/src/views/mes/pro/route/data.ts
index d59d436..71199db 100644
--- a/src/views/mes/pro/route/data.ts
+++ b/src/views/mes/pro/route/data.ts
@@ -18,6 +18,9 @@
import { z } from '#/adapter/form';
import { generateAutoCode } from '#/api/mes/md/autocode/record';
+import { getWarehouseSimpleList } from '#/api/mes/wm/warehouse';
+import { getWarehouseAreaSimpleList } from '#/api/mes/wm/warehouse/area';
+import { getWarehouseLocationSimpleList } from '#/api/mes/wm/warehouse/location';
import {
MdItemSelect,
MdProductBomSelect,
@@ -180,6 +183,7 @@
/** 宸ヨ壓璺嚎宸ュ簭鏄庣粏琛ㄥ崟 */
export function useRouteProcessFormSchema(
processOptions: Array<{ label: string; value: number }>,
+ productIds: number[] = [],
): VbenFormSchema[] {
return [
{
@@ -250,6 +254,17 @@
unCheckedChildren: '鍚�',
},
rules: z.boolean().default(false),
+ },
+ {
+ fieldName: 'outputItemIds',
+ label: '浜у嚭浜у搧',
+ component: markRaw(MdItemSelect),
+ componentProps: {
+ multiple: true,
+ productIds,
+ placeholder: '涓棿宸ュ簭閫夊崐鎴愬搧锛屾湯閬撳伐搴忛�夊叏閮ㄦ垚鍝�',
+ },
+ formItemClass: 'col-span-2',
},
{
fieldName: 'prepareTime',
@@ -323,6 +338,7 @@
},
{ field: 'prepareTime', title: '鍑嗗鏃堕棿(鍒�)', width: 110 },
{ field: 'waitTime', title: '绛夊緟鏃堕棿(鍒�)', width: 110 },
+ { field: 'outputItemNames', title: '浜у嚭浜у搧', minWidth: 180 },
{
field: 'colorCode',
title: '鐢樼壒鍥鹃鑹�',
@@ -347,6 +363,9 @@
{ field: 'specification', title: '瑙勬牸鍨嬪彿', width: 150 },
{ field: 'unitName', title: '鍗曚綅', width: 80 },
{ field: 'quantity', title: '鐢熶骇鏁伴噺', width: 100 },
+ { field: 'warehouseName', title: '鎶ュ伐浠撳簱', width: 130 },
+ { field: 'locationName', title: '搴撳尯', width: 120 },
+ { field: 'areaName', title: '搴撲綅', width: 120 },
{
field: 'productionTime',
title: '鐢熶骇鐢ㄦ椂',
@@ -384,6 +403,7 @@
/** 宸ヨ壓璺嚎浜у搧琛ㄥ崟 */
export function useRouteProductFormSchema(
onItemChange?: (item: any) => void,
+ getFormApi?: () => VbenFormApi,
): VbenFormSchema[] {
return [
{
@@ -419,6 +439,63 @@
rules: z.number().default(1),
},
{
+ fieldName: 'warehouseId',
+ label: '鎶ュ伐浠撳簱',
+ component: 'ApiSelect',
+ componentProps: {
+ api: getWarehouseSimpleList,
+ labelField: 'name',
+ valueField: 'id',
+ placeholder: '璇烽�夋嫨鎶ュ伐浜у嚭浠撳簱',
+ onChange: async () => {
+ await getFormApi?.().setFieldValue('locationId', undefined);
+ await getFormApi?.().setFieldValue('areaId', undefined);
+ },
+ },
+ rules: 'selectRequired',
+ },
+ {
+ fieldName: 'locationId',
+ label: '鎶ュ伐搴撳尯',
+ component: 'Select',
+ dependencies: {
+ triggerFields: ['warehouseId'],
+ disabled: (values) => !values.warehouseId,
+ async componentProps(values) {
+ const options = values.warehouseId
+ ? await getWarehouseLocationSimpleList(values.warehouseId)
+ : [];
+ return {
+ fieldNames: { label: 'name', value: 'id' },
+ options,
+ placeholder: '璇烽�夋嫨鎶ュ伐浜у嚭搴撳尯',
+ onChange: async () => getFormApi?.().setFieldValue('areaId', undefined),
+ };
+ },
+ },
+ rules: 'selectRequired',
+ },
+ {
+ fieldName: 'areaId',
+ label: '鎶ュ伐搴撲綅',
+ component: 'Select',
+ dependencies: {
+ triggerFields: ['locationId'],
+ disabled: (values) => !values.locationId,
+ async componentProps(values) {
+ const options = values.locationId
+ ? await getWarehouseAreaSimpleList(values.locationId)
+ : [];
+ return {
+ fieldNames: { label: 'name', value: 'id' },
+ options,
+ placeholder: '璇烽�夋嫨鎶ュ伐浜у嚭搴撲綅',
+ };
+ },
+ },
+ rules: 'selectRequired',
+ },
+ {
fieldName: 'productionTime',
label: '鐢熶骇鐢ㄦ椂',
component: 'InputNumber',
diff --git a/src/views/mes/pro/route/modules/process-form.vue b/src/views/mes/pro/route/modules/process-form.vue
index b742c63..46b7318 100644
--- a/src/views/mes/pro/route/modules/process-form.vue
+++ b/src/views/mes/pro/route/modules/process-form.vue
@@ -15,6 +15,7 @@
getRouteProcess,
updateRouteProcess,
} from '#/api/mes/pro/route/process';
+import { getRouteProductListByRoute } from '#/api/mes/pro/route/product';
import { $t } from '#/locales';
import { useRouteProcessFormSchema } from '../data';
@@ -40,13 +41,17 @@
});
/** 鍔犺浇宸ュ簭閫夐」鍚庡啀鐢熸垚 schema锛堥伩鍏嶄笅鎷夌┖閫夐」锛� */
-async function loadSchema(): Promise<VbenFormSchema[]> {
+async function loadSchema(routeId: number): Promise<VbenFormSchema[]> {
const list = await getProcessSimpleList();
const options = (list || []).map((item) => ({
label: item.name ?? '',
value: item.id!,
}));
- return useRouteProcessFormSchema(options);
+ const products = routeId ? await getRouteProductListByRoute(routeId) : [];
+ return useRouteProcessFormSchema(
+ options,
+ products.map((item) => item.itemId!).filter(Boolean),
+ );
}
const [Modal, modalApi] = useVbenModal({
@@ -76,15 +81,6 @@
formData.value = undefined;
return;
}
- modalApi.lock();
- try {
- // 宸ュ簭涓嬫媺渚濊禆杩滅▼鏁版嵁锛宻chema 鍦ㄥ脊绐楁墦寮�鏃跺啀鐢熸垚
- const schema = await loadSchema();
- formApi.setState({ schema });
- } finally {
- modalApi.unlock();
- }
- // 鍔犺浇鏁版嵁
const data = modalApi.getData<{
id?: number;
maxSort?: number;
@@ -93,6 +89,15 @@
if (!data) {
return;
}
+ modalApi.lock();
+ try {
+ // 宸ュ簭涓嬫媺渚濊禆杩滅▼鏁版嵁锛宻chema 鍦ㄥ脊绐楁墦寮�鏃跺啀鐢熸垚
+ const schema = await loadSchema(data.routeId);
+ formApi.setState({ schema });
+ } finally {
+ modalApi.unlock();
+ }
+ // 鍔犺浇鏁版嵁
if (!data.id) {
// 鏂板鏃讹紝榛樿搴忓彿 = maxSort + 1锛屽苟缁欎竴涓粯璁ょ敇鐗瑰浘棰滆壊
await formApi.setValues({
diff --git a/src/views/mes/pro/route/modules/product-form.vue b/src/views/mes/pro/route/modules/product-form.vue
index a3b0e5d..399681d 100644
--- a/src/views/mes/pro/route/modules/product-form.vue
+++ b/src/views/mes/pro/route/modules/product-form.vue
@@ -46,7 +46,7 @@
labelWidth: 100,
},
layout: 'horizontal',
- schema: useRouteProductFormSchema(handleItemChange),
+ schema: useRouteProductFormSchema(handleItemChange, () => formApi),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
diff --git a/src/views/mes/pro/workorder/modules/form.vue b/src/views/mes/pro/workorder/modules/form.vue
index 43f1741..1b24e67 100644
--- a/src/views/mes/pro/workorder/modules/form.vue
+++ b/src/views/mes/pro/workorder/modules/form.vue
@@ -23,14 +23,9 @@
} from "#/api/mes/pro/workorder";
import { batchSaveWorkOrderProcess, getWorkOrderProcessListByWorkOrderId } from "#/api/mes/pro/workorder/process";
import { $t } from "#/locales";
- import { isAiFeatureEnabled } from "#/utils/features";
// import { BarcodeDetail } from "#/views/wls/barcode/components";
import { useFormSchema } from "../data";
- import PredictDelivery from "./ai/predict-delivery.vue";
- import PredictDuration from "./ai/predict-duration.vue";
- import PredictMaterial from "./ai/predict-material.vue";
- import PredictRisk from "./ai/predict-risk.vue";
import ItemList from "./item-list.vue";
import ProcessList from "./process-list.vue";
@@ -54,13 +49,6 @@
() =>
formType.value === "update" &&
formData.value?.status === MesProWorkOrderStatusEnum.PREPARE
- );
- const canUseAi = computed(
- () =>
- isAiFeatureEnabled &&
- formData.value?.id &&
- (formData.value?.status === MesProWorkOrderStatusEnum.PREPARE ||
- formData.value?.status === MesProWorkOrderStatusEnum.CONFIRMED)
);
const getTitle = computed(() => {
const isChild = !!formData.value?.parentId;
@@ -363,13 +351,6 @@
</template>
<template #prepend-footer>
<div class="flex flex-auto flex-col gap-2">
- <div v-if="canUseAi" class="flex items-center gap-2">
- <PredictMaterial :work-order-id="formData!.id" />
- <PredictDuration :work-order-id="formData!.id" />
- <PredictRisk :work-order-id="formData!.id" />
- <PredictDelivery :work-order-id="formData!.id" />
- </div>
- <div v-if="canUseAi && showMainBtn" class="border-t border-gray-200" />
<div class="flex items-center">
<Button v-if="showMainBtn"
type="primary"
diff --git a/src/views/mes/qc/ipqc/data.ts b/src/views/mes/qc/ipqc/data.ts
index d7ece73..688c95f 100644
--- a/src/views/mes/qc/ipqc/data.ts
+++ b/src/views/mes/qc/ipqc/data.ts
@@ -342,6 +342,7 @@
options: getDictOptions(DICT_TYPE.MES_QC_CHECK_RESULT, 'number'),
placeholder: '璇烽�夋嫨妫�娴嬬粨鏋�',
},
+ rules: 'required',
},
{
fieldName: 'remark',
diff --git a/src/views/mes/qc/ipqc/modules/form.vue b/src/views/mes/qc/ipqc/modules/form.vue
index ddf5485..9833685 100644
--- a/src/views/mes/qc/ipqc/modules/form.vue
+++ b/src/views/mes/qc/ipqc/modules/form.vue
@@ -13,11 +13,8 @@
import { useVbenForm } from '#/adapter/form';
import { createIpqc, finishIpqc, getIpqc, updateIpqc } from '#/api/mes/qc/ipqc';
import { $t } from '#/locales';
-import { isAiFeatureEnabled } from '#/utils/features';
import { QcIndicatorResultList } from '../../indicatorresult/components';
-import MesQcAiSuggest from '../../components/ai-suggest.vue';
-import MesQcAiAssistant from '../../components/ai-assistant.vue';
import { useFormSchema } from '../data';
import LineList from './line-list.vue';
@@ -245,12 +242,6 @@
<Button v-if="canFinish" type="primary" @click="handleFinish">
瀹屾垚
</Button>
- <MesQcAiSuggest
- v-if="isAiFeatureEnabled && canFinish && formData?.id"
- :qc-id="formData.id"
- :qc-type="MesQcTypeEnum.IPQC"
- />
- <MesQcAiAssistant v-if="isAiFeatureEnabled" />
</div>
</template>
</Modal>
diff --git a/src/views/mes/qc/iqc/data.ts b/src/views/mes/qc/iqc/data.ts
index 2e8b359..40e693f 100644
--- a/src/views/mes/qc/iqc/data.ts
+++ b/src/views/mes/qc/iqc/data.ts
@@ -254,6 +254,7 @@
options: getDictOptions(DICT_TYPE.MES_QC_CHECK_RESULT, 'number'),
placeholder: '璇烽�夋嫨妫�娴嬬粨鏋�',
},
+ rules: 'required',
},
{
fieldName: 'remark',
diff --git a/src/views/mes/qc/iqc/modules/form.vue b/src/views/mes/qc/iqc/modules/form.vue
index 3090a70..72832df 100644
--- a/src/views/mes/qc/iqc/modules/form.vue
+++ b/src/views/mes/qc/iqc/modules/form.vue
@@ -13,11 +13,8 @@
import { useVbenForm } from '#/adapter/form';
import { createIqc, finishIqc, getIqc, updateIqc } from '#/api/mes/qc/iqc';
import { $t } from '#/locales';
-import { isAiFeatureEnabled } from '#/utils/features';
import { QcIndicatorResultList } from '../../indicatorresult/components';
-import MesQcAiSuggest from '../../components/ai-suggest.vue';
-import MesQcAiAssistant from '../../components/ai-assistant.vue';
import { useFormSchema } from '../data';
import LineList from './line-list.vue';
@@ -246,12 +243,6 @@
<Button v-if="canFinish" type="primary" @click="handleFinish">
瀹屾垚
</Button>
- <MesQcAiSuggest
- v-if="isAiFeatureEnabled && canFinish && formData?.id"
- :qc-id="formData.id"
- :qc-type="MesQcTypeEnum.IQC"
- />
- <MesQcAiAssistant v-if="isAiFeatureEnabled" />
</div>
</template>
</Modal>
diff --git a/src/views/mes/qc/oqc/data.ts b/src/views/mes/qc/oqc/data.ts
index 0183a35..78b877b 100644
--- a/src/views/mes/qc/oqc/data.ts
+++ b/src/views/mes/qc/oqc/data.ts
@@ -279,6 +279,7 @@
options: getDictOptions(DICT_TYPE.MES_QC_CHECK_RESULT, 'number'),
placeholder: '璇烽�夋嫨妫�娴嬬粨鏋�',
},
+ rules: 'required',
},
{
fieldName: 'remark',
diff --git a/src/views/mes/qc/oqc/modules/form.vue b/src/views/mes/qc/oqc/modules/form.vue
index be74923..b634522 100644
--- a/src/views/mes/qc/oqc/modules/form.vue
+++ b/src/views/mes/qc/oqc/modules/form.vue
@@ -13,11 +13,8 @@
import { useVbenForm } from '#/adapter/form';
import { createOqc, finishOqc, getOqc, updateOqc } from '#/api/mes/qc/oqc';
import { $t } from '#/locales';
-import { isAiFeatureEnabled } from '#/utils/features';
import { QcIndicatorResultList } from '../../indicatorresult/components';
-import MesQcAiSuggest from '../../components/ai-suggest.vue';
-import MesQcAiAssistant from '../../components/ai-assistant.vue';
import { useFormSchema } from '../data';
import LineList from './line-list.vue';
@@ -249,12 +246,6 @@
<Button v-if="canFinish" type="primary" @click="handleFinish">
瀹屾垚
</Button>
- <MesQcAiSuggest
- v-if="isAiFeatureEnabled && canFinish && formData?.id"
- :qc-id="formData.id"
- :qc-type="MesQcTypeEnum.OQC"
- />
- <MesQcAiAssistant v-if="isAiFeatureEnabled" />
</div>
</template>
</Modal>
diff --git a/src/views/mes/qc/rqc/data.ts b/src/views/mes/qc/rqc/data.ts
index 8f98408..23ca51e 100644
--- a/src/views/mes/qc/rqc/data.ts
+++ b/src/views/mes/qc/rqc/data.ts
@@ -246,6 +246,7 @@
options: getDictOptions(DICT_TYPE.MES_QC_CHECK_RESULT, 'number'),
placeholder: '璇烽�夋嫨妫�娴嬬粨鏋�',
},
+ rules: 'required',
},
{
fieldName: 'remark',
diff --git a/src/views/mes/qc/rqc/modules/form.vue b/src/views/mes/qc/rqc/modules/form.vue
index 23b6c28..6be0df6 100644
--- a/src/views/mes/qc/rqc/modules/form.vue
+++ b/src/views/mes/qc/rqc/modules/form.vue
@@ -13,11 +13,8 @@
import { useVbenForm } from '#/adapter/form';
import { createRqc, finishRqc, getRqc, updateRqc } from '#/api/mes/qc/rqc';
import { $t } from '#/locales';
-import { isAiFeatureEnabled } from '#/utils/features';
import { QcIndicatorResultList } from '../../indicatorresult/components';
-import MesQcAiSuggest from '../../components/ai-suggest.vue';
-import MesQcAiAssistant from '../../components/ai-assistant.vue';
import { useFormSchema } from '../data';
import LineList from './line-list.vue';
@@ -245,12 +242,6 @@
<Button v-if="canFinish" type="primary" @click="handleFinish">
瀹屾垚
</Button>
- <MesQcAiSuggest
- v-if="isAiFeatureEnabled && canFinish && formData?.id"
- :qc-id="formData.id"
- :qc-type="MesQcTypeEnum.RQC"
- />
- <MesQcAiAssistant v-if="isAiFeatureEnabled" />
</div>
</template>
</Modal>
diff --git a/src/views/system/user/data.ts b/src/views/system/user/data.ts
index fb9ea8f..1ab6e8a 100644
--- a/src/views/system/user/data.ts
+++ b/src/views/system/user/data.ts
@@ -34,6 +34,15 @@
rules: 'required',
},
{
+ fieldName: 'nickname',
+ label: '鐢ㄦ埛鏄电О',
+ component: 'Input',
+ componentProps: {
+ placeholder: '璇疯緭鍏ョ敤鎴锋樀绉�',
+ allowClear: true,
+ },
+ },
+ {
label: '鐢ㄦ埛瀵嗙爜',
fieldName: 'password',
component: 'InputPassword',
--
Gitblit v1.9.3