From 964cfa12263cf51b2a3d1ef281130d0e808e9078 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期六, 31 十月 2026 19:04:39 +0800
Subject: [PATCH] feat: 完善业务导入及工艺流程界面
---
src/views/mes/pro/process/data.ts | 26 +++
src/views/wls/transaction/data.ts | 1
src/views/crm/saleQuotation/index.vue | 11 +
src/views/mes/pro/feedback/modules/form.vue | 21 ++
src/views/mes/pro/route/modules/product-list.vue | 21 ++
src/views/mes/pro/route/modules/route-configurator.vue | 3
src/views/erp/purchase/request/index.vue | 2
src/api/mes/pro/process/index.ts | 2
src/views/mes/pro/route/data.ts | 1
src/views/basicData/mdm/index.vue | 1
src/views/mes/pro/workorder-center/modules/quick-feedback.vue | 4
src/api/crm/saleQuotation/index.ts | 9 +
src/api/mes/pro/feedback/index.ts | 14 ++
src/api/mdm/item/index.ts | 1
src/views/mes/process-design/route/data.ts | 3
src/views/erp/purchase/order/index.vue | 2
src/views/hrm/employee/modules/import-form.vue | 8
src/views/mes/pro/feedback/modules/batch-feedback.vue | 18 +
src/views/mes/process-design/process/modules/form.vue | 5
src/components/import-modal/import-modal.vue | 13 +
src/api/mes/pro/route/index.ts | 12 +
src/views/wls/materialstock/index.vue | 26 +++
src/views/mes/process-design/process/data.ts | 37 +++++
src/views/erp/sale/order/index.vue | 2
src/views/mes/workbench/components/tabs/FeedbackTab.vue | 15 +
src/views/mes/pro/feedback/components/FeedbackParamFields.vue | 74 ++++++++++
src/api/mes/pro/route/product/index.ts | 6
src/views/mes/pro/feedback/data.ts | 3
src/views/basicData/mdm/data.ts | 8 +
src/api/mes/wm/materialstock/index.ts | 9 +
src/views/mes/process-design/route/index.vue | 29 +++
31 files changed, 359 insertions(+), 28 deletions(-)
diff --git a/src/api/crm/saleQuotation/index.ts b/src/api/crm/saleQuotation/index.ts
index 5d1106d..4b5da71 100644
--- a/src/api/crm/saleQuotation/index.ts
+++ b/src/api/crm/saleQuotation/index.ts
@@ -115,4 +115,13 @@
return requestClient.post<number>('/crm/sale-quotation/convert-contract', null, {
params: { id },
});
+}
+/** 涓嬭浇鎶ヤ环鏄庣粏瀵煎叆妯℃澘 */
+export function importSaleQuotationTemplate() {
+ return requestClient.download('/crm/sale-quotation/get-import-template');
+}
+
+/** 瀵煎叆鎶ヤ环锛堜粎鏂板锛� */
+export function importSaleQuotation(file: File, updateSupport: boolean) {
+ return requestClient.upload('/crm/sale-quotation/import', { file, updateSupport });
}
\ No newline at end of file
diff --git a/src/api/mdm/item/index.ts b/src/api/mdm/item/index.ts
index 9b0d538..414a2e2 100644
--- a/src/api/mdm/item/index.ts
+++ b/src/api/mdm/item/index.ts
@@ -6,6 +6,7 @@
/** 鐗╂枡淇℃伅 */
export interface Item {
id?: number;
+ sort?: number;
code: string;
name: string;
barCode?: string;
diff --git a/src/api/mes/pro/feedback/index.ts b/src/api/mes/pro/feedback/index.ts
index dcdab97..ff034b3 100644
--- a/src/api/mes/pro/feedback/index.ts
+++ b/src/api/mes/pro/feedback/index.ts
@@ -23,6 +23,8 @@
workOrderCode?: string; // 璁㈠崟缂栫爜
workOrderName?: string; // 璁㈠崟鍚嶇О
taskId?: number; // 鐢熶骇浠诲姟缂栧彿
+ paramValues?: ParamValue[];
+ paramSnapshot?: string;
taskCode?: string; // 浠诲姟缂栫爜
itemId?: number; // 浜у搧鐗╂枡缂栧彿
itemCode?: string; // 鐗╂枡缂栫爜
@@ -49,6 +51,12 @@
createTime?: number; // 鍒涘缓鏃堕棿
}
+ export interface ParamValue { detailId: number; value?: string }
+ export interface ParamDetail { id: number; paramCode?: string; paramName: string; paramType?: number; required?: boolean; unitMeasureId?: number; unitMeasureName?: string }
+ export interface ParamTemplate { templateId: number; templateCode?: string; templateName?: string; details: ParamDetail[] }
+ export interface ParamSnapshot { template: ParamTemplate; values: ParamValue[] }
+ export interface ParamConfig { mode: number; template?: ParamTemplate; shared?: ParamSnapshot }
+
/** MES 鐢熶骇鎶ュ伐鍒嗛〉鏌ヨ鍙傛暟 */
export interface PageParams extends PageParam {
code?: string;
@@ -62,6 +70,11 @@
status?: number;
feedbackTime?: string[];
}
+}
+
+/** 鑾峰緱浠诲姟涓嬭揪鏃跺喕缁撶殑鍙傛暟閰嶇疆 */
+export function getFeedbackParamConfig(taskId: number) {
+ return requestClient.get<MesProFeedbackApi.ParamConfig>('/mes/pro/feedback/param-config', { params: { taskId } });
}
/** 鏌ヨ鐢熶骇鎶ュ伐鍒嗛〉 */
@@ -159,6 +172,7 @@
/** 蹇�熸姤宸ヨ姹� */
export interface QuickCreateReq {
taskId: number;
+ paramValues?: MesProFeedbackApi.ParamValue[];
feedbackQuantity: number;
qualifiedQuantity?: number;
unqualifiedQuantity?: number;
diff --git a/src/api/mes/pro/process/index.ts b/src/api/mes/pro/process/index.ts
index e704568..ca11aa8 100644
--- a/src/api/mes/pro/process/index.ts
+++ b/src/api/mes/pro/process/index.ts
@@ -10,6 +10,8 @@
name?: string;
type?: number; // 鐢靛姏宸ヨ壓鍒嗙被
attention?: string;
+ paramCollectMode?: number; // 0 涓嶉噰闆嗭紱1 姣忔鎶ュ伐锛�2 浠诲姟鍏辩敤
+ paramTemplateId?: number;
status?: number;
remark?: string;
createTime?: Date;
diff --git a/src/api/mes/pro/route/index.ts b/src/api/mes/pro/route/index.ts
index 7ac13da..27b525d 100644
--- a/src/api/mes/pro/route/index.ts
+++ b/src/api/mes/pro/route/index.ts
@@ -8,6 +8,8 @@
id?: number;
code?: string;
name?: string;
+ referenceProductCode?: string;
+ referenceProductName?: string;
description?: string;
status?: number;
remark?: string;
@@ -62,6 +64,16 @@
return requestClient.download('/mes/pro/route/export-excel', { params });
}
+/** 涓嬭浇鍖呭惈鍚敤璺嚎鍙傝�冧骇鍝佸強宸ュ簭銆佷骇鍑恒�佹姇鏂欑殑瀹屾暣妯℃澘 */
+export function downloadFullRouteTemplate(routeId: number) {
+ return requestClient.download('/mes/pro/route/get-full-import-template', { params: { routeId } });
+}
+
+/** 鎸夎矾绾垮鍏ュ畬鏁村伐鑹烘祦绋� */
+export function importFullRoute(file: File, updateSupport: boolean) {
+ return requestClient.upload(`/mes/pro/route/import-full?updateSupport=${updateSupport}`, { file });
+}
+
/** 涓嬭浇宸ヨ壓璺嚎瀵煎叆妯℃澘 */
export function importRouteTemplate() {
return requestClient.download('/mes/pro/route/get-import-template');
diff --git a/src/api/mes/pro/route/product/index.ts b/src/api/mes/pro/route/product/index.ts
index 6dd7f3d..54c222d 100644
--- a/src/api/mes/pro/route/product/index.ts
+++ b/src/api/mes/pro/route/product/index.ts
@@ -6,6 +6,7 @@
id?: number;
routeId?: number;
itemId?: number;
+ templateReference?: boolean;
itemCode?: string;
itemName?: string;
warehouseId?: number;
@@ -31,6 +32,11 @@
);
}
+/** 璁剧疆璺嚎鐨勬ā鏉垮弬鑰冧骇鍝� */
+export function setRouteProductTemplateReference(id: number) {
+ return requestClient.put('/mes/pro/route-product/set-template-reference', null, { params: { id } });
+}
+
/** 鏌ヨ宸ヨ壓璺嚎浜у搧璇︽儏 */
export function getRouteProduct(id: number) {
return requestClient.get<MesProRouteProductApi.RouteProduct>(
diff --git a/src/api/mes/wm/materialstock/index.ts b/src/api/mes/wm/materialstock/index.ts
index edbd6fe..369301f 100644
--- a/src/api/mes/wm/materialstock/index.ts
+++ b/src/api/mes/wm/materialstock/index.ts
@@ -49,6 +49,15 @@
);
}
+/** 涓嬭浇搴撳瓨澧為噺瀵煎叆妯℃澘 */
+export function importMaterialStockTemplate() {
+ return requestClient.download('/mes/wm/material-stock/get-import-template');
+}
+
+/** 瀵煎叆搴撳瓨澧為噺 */
+export function importMaterialStock(file: File, updateSupport: boolean) {
+ return requestClient.upload('/mes/wm/material-stock/import', { file, updateSupport });
+}
/** 鏇存柊搴撳瓨鍐荤粨鐘舵�� */
export function updateMaterialStockFrozen(data: {
frozen: boolean;
diff --git a/src/components/import-modal/import-modal.vue b/src/components/import-modal/import-modal.vue
index 4ce97e0..7b3bd0f 100644
--- a/src/components/import-modal/import-modal.vue
+++ b/src/components/import-modal/import-modal.vue
@@ -44,8 +44,13 @@
fileName: string;
/** 鎵ц瀵煎叆鐨勬帴鍙e嚱鏁� (file, updateSupport) => Promise */
importFn: (file: File, updateSupport: boolean) => Promise<unknown>;
+ /** 鏄惁鍏佽瑕嗙洊宸叉湁鏁版嵁 */
+ allowUpdate?: boolean;
+ uploadHint?: string;
+ /** 涓嶆彁渚涙ā鏉夸笅杞芥椂闅愯棌寮圭獥鍐呯殑涓嬭浇鎸夐挳銆� */
+ showTemplateDownload?: boolean;
/** 涓嬭浇妯℃澘鐨勬帴鍙e嚱鏁� () => Promise(blob) */
- templateFn: () => Promise<BlobPart>;
+ templateFn?: () => Promise<BlobPart>;
}
const emit = defineEmits(['success']);
@@ -69,10 +74,11 @@
label: '鏁版嵁鏂囦欢',
component: 'Upload',
rules: 'required',
- help: '浠呭厑璁稿鍏� xls銆亁lsx 鏍煎紡鏂囦欢',
+ help: () => config.value.uploadHint || '浠呭厑璁稿鍏� xls銆亁lsx 鏍煎紡鏂囦欢',
},
{
fieldName: 'updateSupport',
+ dependencies: { triggerFields: ['file'], show: () => config.value.allowUpdate !== false },
label: '鏄惁瑕嗙洊',
component: 'Switch',
componentProps: {
@@ -288,6 +294,7 @@
/** 涓嬭浇妯$増 */
async function handleDownload() {
+ if (!config.value.templateFn) return;
const data = await config.value.templateFn();
downloadFileFromBlobPart({ fileName: config.value.fileName, source: data });
}
@@ -309,7 +316,7 @@
</template>
</Form>
<template #prepend-footer>
- <div class="flex flex-auto items-center">
+ <div v-if="config.showTemplateDownload !== false" class="flex flex-auto items-center">
<Button @click="handleDownload"> 涓嬭浇瀵煎叆妯℃澘 </Button>
</div>
</template>
diff --git a/src/views/basicData/mdm/data.ts b/src/views/basicData/mdm/data.ts
index a2fb42c..bf3285e 100644
--- a/src/views/basicData/mdm/data.ts
+++ b/src/views/basicData/mdm/data.ts
@@ -93,6 +93,13 @@
},
},
{
+ component: 'InputNumber',
+ fieldName: 'sort',
+ label: '鎺掑簭',
+ defaultValue: 0,
+ componentProps: { min: 0, max: 2147483647, precision: 0, placeholder: '鏁板�艰秺灏忚秺闈犲墠' },
+ },
+ {
component: "Input",
fieldName: "code",
label: "鐗╂枡缂栫爜",
@@ -525,6 +532,7 @@
export function useGridColumns(): VxeTableGridOptions["columns"] {
return [
{ type: "checkbox", width: 40 },
+ { field: 'sort', title: '鎺掑簭', width: 80 },
{
field: "code",
title: "鐗╂枡缂栫爜",
diff --git a/src/views/basicData/mdm/index.vue b/src/views/basicData/mdm/index.vue
index 16e3a42..67b8678 100644
--- a/src/views/basicData/mdm/index.vue
+++ b/src/views/basicData/mdm/index.vue
@@ -102,6 +102,7 @@
fileName: '鐗╂枡瀵煎叆妯℃澘.xls',
importFn: importItem,
templateFn: importItemTemplate,
+ uploadHint: '绾㈣壊琛ㄥご涓哄繀濉�傚垎绫诲拰鍗曚綅椤诲凡瀛樺湪锛涙柊澧炵墿鏂欏悓姝� MES锛岃鐩栨椂淇濈暀鍘熷悓姝ョ姸鎬併��',
})
.open();
}
diff --git a/src/views/crm/saleQuotation/index.vue b/src/views/crm/saleQuotation/index.vue
index 7d65b7c..0606bbf 100644
--- a/src/views/crm/saleQuotation/index.vue
+++ b/src/views/crm/saleQuotation/index.vue
@@ -14,11 +14,14 @@
convertSaleQuotationToContract,
deleteSaleQuotation,
getSaleQuotationPage,
+ importSaleQuotation,
+ importSaleQuotationTemplate,
} from '#/api/crm/saleQuotation';
import { $t } from '#/locales';
import { QUOTATION_STATUS, useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
+import ImportModalComponent from '#/components/import-modal';
const { push } = useRouter();
@@ -26,6 +29,12 @@
connectedComponent: Form,
destroyOnClose: true,
});
+
+const [ImportModal, importModalApi] = useVbenModal({ connectedComponent: ImportModalComponent, destroyOnClose: true });
+
+function handleImport() {
+ importModalApi.setData({ title: '瀵煎叆鎶ヤ环鍗�', fileName: '閿�鍞姤浠峰鍏ユā鏉�.xls', importFn: importSaleQuotation, templateFn: importSaleQuotationTemplate, allowUpdate: false, uploadHint: '璇蜂笅杞芥ā鏉匡紱鍚屼竴瀹㈡埛鍜屾姤浠峰悕绉扮殑澶氳浼氬悎骞朵负涓�寮犳姤浠峰崟锛屼粎鏀寔鏂板銆�' }).open();
+}
/** 鍒锋柊琛ㄦ牸 */
function handleRefresh() {
@@ -38,6 +47,7 @@
}
const toolbarActions: ActionItem[] = [
+ { label: '瀵煎叆鎶ヤ环鍗�', icon: ACTION_ICON.UPLOAD, auth: ['crm:sale-quotation:create'], onClick: handleImport },
{
label: $t('ui.actionTitle.create', ['鎶ヤ环鍗�']),
type: 'primary',
@@ -138,6 +148,7 @@
<template>
<Page auto-content-height>
<FormModal @success="handleRefresh" />
+ <ImportModal @success="handleRefresh" />
<Grid>
<template #toolbar-tools>
<TableAction :actions="toolbarActions" />
diff --git a/src/views/erp/purchase/order/index.vue b/src/views/erp/purchase/order/index.vue
index 8298eec..9404b0c 100644
--- a/src/views/erp/purchase/order/index.vue
+++ b/src/views/erp/purchase/order/index.vue
@@ -80,6 +80,8 @@
fileName: '閲囪喘璁㈠崟瀵煎叆妯℃澘.xls',
importFn: importPurchaseOrder,
templateFn: importPurchaseOrderTemplate,
+ allowUpdate: false,
+ uploadHint: '绾㈣壊琛ㄥご涓哄繀濉�傚悓涓�鍗曞彿鐨勫琛屽悎骞朵负涓�寮犺鍗曪紱姝e紡鍗曞彿鐢辩郴缁熺敓鎴愶紝浠呮敮鎸佹柊澧烇紝璇峰嬁閲嶅瀵煎叆銆傞渶鍏宠仈閲囪喘鐢宠鏃讹紝璇峰湪宸插鎵圭敵璇蜂腑鐢熸垚閲囪喘璁㈠崟銆�',
})
.open();
}
diff --git a/src/views/erp/purchase/request/index.vue b/src/views/erp/purchase/request/index.vue
index 604827c..766c3d7 100644
--- a/src/views/erp/purchase/request/index.vue
+++ b/src/views/erp/purchase/request/index.vue
@@ -102,6 +102,8 @@
fileName: '閲囪喘鐢宠瀵煎叆妯℃澘.xls',
importFn: importPurchaseRequest,
templateFn: importPurchaseRequestTemplate,
+ allowUpdate: false,
+ uploadHint: '绾㈣壊琛ㄥご涓哄繀濉�傚悓涓�鍗曞彿鐨勫琛屽悎骞朵负涓�寮犵敵璇凤紱姝e紡鍗曞彿鐢辩郴缁熺敓鎴愶紝浠呮敮鎸佹柊澧烇紝璇峰嬁閲嶅瀵煎叆銆�',
})
.open();
}
diff --git a/src/views/erp/sale/order/index.vue b/src/views/erp/sale/order/index.vue
index ecd7892..0d0fa16 100644
--- a/src/views/erp/sale/order/index.vue
+++ b/src/views/erp/sale/order/index.vue
@@ -80,6 +80,8 @@
fileName: '閿�鍞鍗曞鍏ユā鏉�.xls',
importFn: importSaleOrder,
templateFn: importSaleOrderTemplate,
+ allowUpdate: false,
+ uploadHint: '鍚屼竴鍗曞彿鐨勫琛屽悎骞朵负涓�寮犺鍗曪紝绯荤粺鐢熸垚姝e紡鍗曞彿銆傚悎鍚屽崟鍙峰彲閫夛紱濉啓鏃堕』涓哄凡瀹℃壒鍚堝悓涓旀槑缁嗕竴鑷淬�備粎鏀寔鏂板锛岃鍕块噸澶嶅鍏ャ��',
})
.open();
}
diff --git a/src/views/hrm/employee/modules/import-form.vue b/src/views/hrm/employee/modules/import-form.vue
index 1940064..df27dcf 100644
--- a/src/views/hrm/employee/modules/import-form.vue
+++ b/src/views/hrm/employee/modules/import-form.vue
@@ -39,7 +39,11 @@
stopMockProgress();
progressPercent.value = 100;
await delay(500);
- message.success('瀵煎叆瀹屾垚');
+ if (Object.keys(importResult.value?.failureNames ?? {}).length > 0) {
+ message.warning('瀵煎叆瀹屾垚锛岄儴鍒嗗憳宸ユ湭瀵煎叆锛岃鏌ョ湅澶辫触鍘熷洜');
+ } else {
+ message.success('瀵煎叆瀹屾垚');
+ }
emit('success');
} finally {
stopMockProgress();
@@ -113,7 +117,7 @@
<Switch v-model:checked="updateSupport" />
</div>
<div class="mt-2 text-gray-500">
- 浠呭厑璁稿鍏� xls銆亁lsx 鏍煎紡鏂囦欢锛涙ā鏉夸腑"閮ㄩ棬鍚嶇О/宀椾綅鍚嶇О/鐢ㄦ埛瑙掕壊"濉啓鍚嶇О锛岃鑹插涓敤閫楀彿鍒嗛殧
+ 浠呮敮鎸� xls銆亁lsx锛涚孩鑹茶〃澶翠负蹇呭~銆傞儴闂ㄣ�佸矖浣嶅拰瑙掕壊鍚嶇О椤诲敮涓�锛涜鑹插涓敤閫楀彿鍒嗛殧銆傛柊澧炴椂闇�濉啓鎬у埆锛岃鐩栧凡鏈夊憳宸ユ椂璇峰皢鍒濆瀵嗙爜鍜岃鑹茬暀绌猴紝宀椾綅椤讳笌鍘熸。妗堜竴鑷淬��
</div>
<!-- 瀵煎叆杩涘害鏉� -->
<div v-if="importing" class="mt-4">
diff --git a/src/views/mes/pro/feedback/components/FeedbackParamFields.vue b/src/views/mes/pro/feedback/components/FeedbackParamFields.vue
new file mode 100644
index 0000000..a077338
--- /dev/null
+++ b/src/views/mes/pro/feedback/components/FeedbackParamFields.vue
@@ -0,0 +1,74 @@
+<script lang="ts" setup>
+import type { MesProFeedbackApi } from '#/api/mes/pro/feedback';
+import { computed, ref, watch } from 'vue';
+import { message } from 'ant-design-vue';
+import { getFeedbackParamConfig } from '#/api/mes/pro/feedback';
+
+const props = defineProps<{ taskId?: number; snapshot?: string; readonly?: boolean }>();
+const config = ref<MesProFeedbackApi.ParamConfig>();
+const values = ref<Record<number, string>>({});
+const loading = ref(false);
+const error = ref('');
+let loadVersion = 0;
+const shared = computed(() => config.value?.mode === 2 && !!config.value?.shared);
+const details = computed(() => config.value?.template?.details ?? []);
+
+watch(() => [props.taskId, props.snapshot] as const, async ([taskId, raw]) => {
+ const version = ++loadVersion;
+ config.value = undefined;
+ values.value = {};
+ error.value = '';
+ if (!taskId) return;
+ loading.value = true;
+ try {
+ const result = await getFeedbackParamConfig(taskId);
+ if (version !== loadVersion) return;
+ config.value = result;
+ let previous: MesProFeedbackApi.ParamSnapshot | undefined;
+ if (raw) previous = JSON.parse(raw) as MesProFeedbackApi.ParamSnapshot;
+ const existing = props.readonly ? (previous ?? result.shared) : (result.shared ?? previous);
+ for (const entry of existing?.values ?? []) values.value[entry.detailId] = entry.value ?? '';
+ } catch {
+ if (version === loadVersion) error.value = '鍙傛暟閰嶇疆鍔犺浇澶辫触锛岃閲嶆柊閫夋嫨浠诲姟';
+ } finally {
+ if (version === loadVersion) loading.value = false;
+ }
+}, { immediate: true });
+
+function getValues() {
+ if (loading.value || error.value || (props.taskId && !config.value)) {
+ message.error(error.value || '鍙傛暟閰嶇疆姝e湪鍔犺浇锛岃绋嶅悗鍐嶈瘯');
+ throw new Error('鍙傛暟閰嶇疆鏈氨缁�');
+ }
+ if (!config.value?.mode || shared.value || props.readonly) return undefined;
+ return details.value.map((d) => ({ detailId: d.id, value: values.value[d.id] ?? '' }));
+}
+defineExpose({ getValues });
+</script>
+
+<template>
+ <section v-if="taskId && (loading || error || config?.mode)" class="param-fields">
+ <h4>宸ヨ壓鍙傛暟</h4>
+ <p v-if="loading">姝e湪鍔犺浇鍙傛暟閰嶇疆鈥�</p>
+ <p v-else-if="error" role="alert">{{ error }}</p>
+ <template v-else-if="config?.mode">
+ <p>{{ config.template?.templateName }} 路 {{ config.mode === 1 ? '姣忔鎶ュ伐濉啓' : '姣忎釜浠诲姟濉啓涓�娆�' }}</p>
+ <p v-if="shared">姝や换鍔″凡濉啓鍙傛暟锛屾姤宸ュ皢娌跨敤宸蹭繚瀛樼殑鍊笺��</p>
+ <div v-for="detail in details" :key="detail.id" class="param-fields__item">
+ <label :for="`feedback-param-${detail.id}`">{{ detail.paramName }}<span v-if="detail.unitMeasureName">锛坽{ detail.unitMeasureName }}锛�</span><span v-if="detail.required">锛堝繀濉級</span></label>
+ <a-input :id="`feedback-param-${detail.id}`" v-model:value="values[detail.id]"
+ :disabled="readonly || shared" :maxlength="100"
+ :type="detail.paramType === 4 ? 'time' : detail.paramType === 5 ? 'date' : 'text'"
+ :placeholder="`璇疯緭鍏�${detail.paramName}`" />
+ </div>
+ </template>
+ </section>
+</template>
+
+<style scoped>
+.param-fields { margin: 16px; padding: 16px; border: 1px solid var(--ant-color-border, #d9d9d9); border-radius: 6px; }
+.param-fields h4 { margin: 0 0 8px; font-weight: 600; }
+.param-fields p { margin: 0 0 12px; }
+.param-fields__item { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr; align-items: center; gap: 12px; margin-top: 10px; }
+@media (max-width: 600px) { .param-fields__item { grid-template-columns: 1fr; gap: 4px; } }
+</style>
diff --git a/src/views/mes/pro/feedback/data.ts b/src/views/mes/pro/feedback/data.ts
index 29b244a..23927ef 100644
--- a/src/views/mes/pro/feedback/data.ts
+++ b/src/views/mes/pro/feedback/data.ts
@@ -178,6 +178,7 @@
export function useFormSchema(
formType: FormType,
formApi?: VbenFormApi,
+ onTaskChange?: (taskId?: number) => void,
): VbenFormSchema[] {
const isHeaderReadonly = ['approve', 'detail', 'submit'].includes(formType);
return [
@@ -253,6 +254,7 @@
status: MesProWorkOrderStatusEnum.CONFIRMED,
// 璁㈠崟鍙樻洿锛氭竻绌轰换鍔″強浠诲姟甯﹀嚭鐨勪骇鍝佷俊鎭�佹暟閲忓尯鍩熸帶鍒朵綅
onChange: async () => {
+ onTaskChange?.(undefined);
await formApi?.setValues({
checkFlag: true,
itemCode: undefined,
@@ -287,6 +289,7 @@
// 浠诲姟鍙樻洿锛氳嚜鍔ㄥ~鍏呭叧鑱斿瓧娈点�佷骇鍝佷俊鎭�乧heckFlag
componentProps: {
onChange: async (task?: MesProTaskApi.Task) => {
+ onTaskChange?.(task?.id);
if (!task) {
return;
}
diff --git a/src/views/mes/pro/feedback/modules/batch-feedback.vue b/src/views/mes/pro/feedback/modules/batch-feedback.vue
index e8e08b2..b2cd116 100644
--- a/src/views/mes/pro/feedback/modules/batch-feedback.vue
+++ b/src/views/mes/pro/feedback/modules/batch-feedback.vue
@@ -5,7 +5,7 @@
import { useVbenModal } from '@vben/common-ui';
-import { Button, message, Tag } from 'ant-design-vue';
+import { Button, message, Modal as AntModal, Tag } from 'ant-design-vue';
import { batchCreateFeedback } from '#/api/mes/pro/feedback';
import ProTaskSelectDialog from '#/views/mes/pro/task/components/select-dialog.vue';
@@ -73,12 +73,18 @@
remark: formData.value.remark || undefined,
});
if (result.failCount) {
- message.warning(
- `鎵归噺鎶ュ伐瀹屾垚锛氭垚鍔� ${result.successCount} 涓紝澶辫触 ${result.failCount} 涓猔,
- );
- } else {
- message.success(`鎵归噺鎶ュ伐鎴愬姛锛屽叡 ${result.successCount} 涓猔);
+ const failures = (result.results ?? []).filter((row) => !row.success);
+ const names = new Map(selectedTasks.value.map((task) => [task.id, task.code]));
+ AntModal.warning({
+ title: `鎴愬姛 ${result.successCount} 涓紝澶辫触 ${result.failCount} 涓猔,
+ content: failures.map((row) => `${names.get(row.taskId) ?? row.taskId}锛�${row.errorMsg ?? '鎶ュ伐澶辫触'}`).join('锛�'),
+ });
+ const failedIds = new Set(failures.map((row) => row.taskId));
+ selectedTasks.value = selectedTasks.value.filter((task) => failedIds.has(task.id!));
+ emit('success');
+ return;
}
+ message.success(`鎵归噺鎶ュ伐鎴愬姛锛屽叡 ${result.successCount} 涓猔);
modalApi.close();
emit('success');
} finally {
diff --git a/src/views/mes/pro/feedback/modules/form.vue b/src/views/mes/pro/feedback/modules/form.vue
index d0e4edf..f7e2e8f 100644
--- a/src/views/mes/pro/feedback/modules/form.vue
+++ b/src/views/mes/pro/feedback/modules/form.vue
@@ -31,6 +31,7 @@
import BatchInputDialog from './batch-input-dialog.vue';
import ItemConsumeList from './item-consume-list.vue';
import ProductProduceList from './product-produce-list.vue';
+import FeedbackParamFields from '../components/FeedbackParamFields.vue';
const emit = defineEmits(['success']);
const formType = ref<FormType>('create');
@@ -39,6 +40,10 @@
const userStore = useUserStore();
const subTabsName = ref('itemConsume');
const originalSnapshot = ref(''); // 琛ㄥ崟鍘熷鏁版嵁蹇収锛岀敤浜� submit 鏃惰烦杩囨湭鍙樻洿鐨勪繚瀛樿姹�
+const paramTaskId = ref<number>();
+const paramSnapshot = ref<string>();
+const paramFields = ref<InstanceType<typeof FeedbackParamFields>>();
+function onParamTaskChange(taskId?: number) { paramTaskId.value = taskId; paramSnapshot.value = undefined; }
const isEditable = computed(() =>
['create', 'submit', 'update'].includes(formType.value),
@@ -102,9 +107,10 @@
}
/** 璇诲彇骞舵寜鎻愪氦瑙勫垯瀵归綈鍚庣殑琛ㄥ崟鏁版嵁锛岀敤浜庡揩鐓у拰淇濆瓨 */
-async function getAlignedData(): Promise<MesProFeedbackApi.Feedback> {
+async function getAlignedData(includeParams = true): Promise<MesProFeedbackApi.Feedback> {
const data = (await formApi.getValues()) as MesProFeedbackApi.Feedback;
alignQuantity(data);
+ if (includeParams) data.paramValues = paramFields.value?.getValues();
return data;
}
@@ -125,7 +131,7 @@
status: MesProFeedbackStatusEnum.PREPARE,
};
formType.value = 'update';
- formApi.setState({ schema: useFormSchema(formType.value, formApi) });
+ formApi.setState({ schema: useFormSchema(formType.value, formApi, onParamTaskChange) });
await formApi.setFieldValue('id', id);
message.success($t('common.createSuccess'));
} else {
@@ -253,6 +259,8 @@
async onOpenChange(isOpen: boolean) {
if (!isOpen) {
formData.value = undefined;
+ paramTaskId.value = undefined;
+ paramSnapshot.value = undefined;
subTabsName.value = 'itemConsume';
originalSnapshot.value = '';
return;
@@ -261,7 +269,7 @@
const data = modalApi.getData<{ formType: FormType; id?: number; showSubmitButton?: boolean }>();
formType.value = data.formType;
showSubmitButton.value = data.showSubmitButton !== false;
- formApi.setState({ schema: useFormSchema(formType.value, formApi) });
+ formApi.setState({ schema: useFormSchema(formType.value, formApi, onParamTaskChange) });
// 瀹℃壒/璇︽儏鏁磋〃绂佺敤锛岄伩鍏嶅鏍镐汉璇敼鏈彁浜ょ殑瀛楁
formApi.setDisabled(
formType.value === 'approve' || formType.value === 'detail',
@@ -283,12 +291,14 @@
feedbackUserId: userStore.userInfo?.id,
});
// 璁板綍鍒濆蹇収锛堝惈鏁伴噺瀵归綈缁撴灉锛夛紝submit 鏃剁敤浜庤烦杩囨棤鍙樻洿鐨勪繚瀛樿姹�
- originalSnapshot.value = JSON.stringify(await getAlignedData());
+ originalSnapshot.value = JSON.stringify(await getAlignedData(false));
return;
}
modalApi.lock();
try {
formData.value = await getFeedback(data.id);
+ paramTaskId.value = formData.value.taskId;
+ paramSnapshot.value = formData.value.paramSnapshot;
const checkFlag = await resolveCheckFlag(
formData.value.routeId,
formData.value.processId,
@@ -296,7 +306,7 @@
// 璁剧疆鍒� values
await formApi.setValues({ ...formData.value, checkFlag });
// 璁板綍鍒濆蹇収锛堝惈鏁伴噺瀵归綈缁撴灉锛夛紝submit 鏃剁敤浜庤烦杩囨棤鍙樻洿鐨勪繚瀛樿姹�
- originalSnapshot.value = JSON.stringify(await getAlignedData());
+ originalSnapshot.value = JSON.stringify(await getAlignedData(false));
} finally {
modalApi.unlock();
}
@@ -307,6 +317,7 @@
<template>
<Modal :title="getTitle" class="w-3/5">
<Form class="mx-4" />
+ <FeedbackParamFields ref="paramFields" :task-id="paramTaskId" :snapshot="paramSnapshot" :readonly="!isEditable" />
<Tabs
v-if="showSubTabs"
v-model:active-key="subTabsName"
diff --git a/src/views/mes/pro/process/data.ts b/src/views/mes/pro/process/data.ts
index 1cf6134..5a0bdc1 100644
--- a/src/views/mes/pro/process/data.ts
+++ b/src/views/mes/pro/process/data.ts
@@ -16,6 +16,7 @@
import { z } from '#/adapter/form';
import { generateAutoCode } from '#/api/mes/md/autocode/record';
+import { getTemplatePage } from '#/api/mes/pro/processdesign/template';
/** 琛ㄥ崟绫诲瀷 */
export type FormType = 'create' | 'detail' | 'update';
@@ -77,6 +78,31 @@
rules: z.number().default(CommonStatusEnum.ENABLE),
},
{
+ fieldName: 'paramCollectMode',
+ label: '鍙傛暟閲囬泦鏂瑰紡',
+ component: 'Select',
+ defaultValue: 0,
+ componentProps: {
+ options: [
+ { label: '涓嶉噰闆�', value: 0 },
+ { label: '姣忔鎶ュ伐濉啓', value: 1 },
+ { label: '姣忎釜浠诲姟濉啓涓�娆�', value: 2 },
+ ],
+ },
+ },
+ {
+ fieldName: 'paramTemplateId',
+ label: '鍙傛暟妯℃澘',
+ component: 'ApiSelect',
+ componentProps: {
+ api: getTemplatePage,
+ params: { pageNo: 1, pageSize: 100 },
+ resultField: 'list', labelField: 'templateName', valueField: 'id',
+ showSearch: true, optionFilterProp: 'label', allowClear: true,
+ placeholder: '鍚敤鍙傛暟閲囬泦鏃惰閫夋嫨妯℃澘',
+ },
+ },
+ {
fieldName: 'attention',
label: '宸ュ簭璇存槑',
component: 'Textarea',
diff --git a/src/views/mes/pro/route/data.ts b/src/views/mes/pro/route/data.ts
index b6ee40f..0444b0e 100644
--- a/src/views/mes/pro/route/data.ts
+++ b/src/views/mes/pro/route/data.ts
@@ -395,6 +395,7 @@
return [
{ field: 'itemCode', title: '浜у嚭缂栫爜', width: 150 },
{ field: 'itemName', title: '浜у嚭鍚嶇О', width: 150 },
+ { field: 'templateReference', title: '妯℃澘寮曠敤', width: 100, slots: { default: 'templateReference' } },
{ field: 'specification', title: '瑙勬牸鍨嬪彿', width: 150 },
{ field: 'unitName', title: '鍗曚綅', width: 80 },
{ field: 'quantity', title: '鐢熶骇鏁伴噺', width: 100 },
diff --git a/src/views/mes/pro/route/modules/product-list.vue b/src/views/mes/pro/route/modules/product-list.vue
index 056d6db..b25e665 100644
--- a/src/views/mes/pro/route/modules/product-list.vue
+++ b/src/views/mes/pro/route/modules/product-list.vue
@@ -7,15 +7,17 @@
import { computed, ref, watch } from 'vue';
import { useVbenModal } from '@vben/common-ui';
+import { useAccess } from '@vben/access';
import { DICT_TYPE } from '@vben/constants';
import { getDictLabel } from '@vben/hooks';
-import { message } from 'ant-design-vue';
+import { message, Radio } from 'ant-design-vue';
import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
deleteRouteProduct,
getRouteProductListByRoute,
+ setRouteProductTemplateReference,
} from '#/api/mes/pro/route/product';
import { $t } from '#/locales';
@@ -29,8 +31,11 @@
const emit = defineEmits<{
change: [list: MesProRouteProductApi.RouteProduct[]];
+ referenceChange: [];
}>();
+const { hasAccessByCodes } = useAccess();
+const canSetTemplateReference = hasAccessByCodes(['mes:pro-route:update']);
const isEditable = computed(() => props.formType !== 'detail'); // 鏄惁鍙紪杈�
const list = ref<MesProRouteProductApi.RouteProduct[]>([]); // 宸ヨ壓璺嚎浜у搧鍒楄〃
@@ -75,6 +80,15 @@
productFormModalApi.setData({ id: row.id, routeId: props.routeId }).open();
}
+/** 姣忔潯璺嚎浣跨敤涓�涓骇鍑轰骇鍝佷綔涓哄鍏ユā鏉垮弬鑰冦�� */
+async function handleTemplateReference(row: MesProRouteProductApi.RouteProduct) {
+ if (!canSetTemplateReference || !row.id || row.templateReference) return;
+ await setRouteProductTemplateReference(row.id);
+ message.success('宸茶缃ā鏉垮紩鐢ㄤ骇鍝�');
+ await getList();
+ emit('referenceChange');
+}
+
/** 鍒犻櫎宸ヨ壓璺嚎浜у搧 */
async function handleDelete(row: MesProRouteProductApi.RouteProduct) {
await deleteRouteProduct(row.id!);
@@ -107,6 +121,11 @@
/>
</div>
<Grid class="w-full" table-title="浜у嚭浜у搧鍙婃姤宸ュ叆搴撲綅缃�">
+ <template #templateReference="{ row }">
+ <Radio :checked="!!row.templateReference" :disabled="!canSetTemplateReference" @change="handleTemplateReference(row)">
+ {{ row.templateReference ? '宸查��' : '閫夋嫨' }}
+ </Radio>
+ </template>
<template #productionTime="{ row }">
<span v-if="row.productionTime">
{{ row.productionTime }}
diff --git a/src/views/mes/pro/route/modules/route-configurator.vue b/src/views/mes/pro/route/modules/route-configurator.vue
index 04cd49c..9a460af 100644
--- a/src/views/mes/pro/route/modules/route-configurator.vue
+++ b/src/views/mes/pro/route/modules/route-configurator.vue
@@ -296,7 +296,7 @@
<Alert
class="mb-4"
message="鍏堢淮鎶ゆ墍鏈夊彲鑳界殑宸ュ簭浜у嚭"
- description="瀹為檯褰㈡垚鐨勪腑闂村崐鎴愬搧鍜屾湯閬撳伐搴忕殑鎴愬搧閮借鍔犲叆锛屽苟鍒嗗埆鎸囧畾鎶ュ伐鍚庤繘鍏ョ殑浠撳簱銆佸簱鍖哄拰搴撲綅銆�"
+ description="瀹為檯褰㈡垚鐨勪腑闂村崐鎴愬搧鍜屾湯閬撳伐搴忕殑鎴愬搧閮借鍔犲叆锛屽苟鎸囧畾鍏ュ簱浠撲綅锛涢�夋嫨涓�涓垚鍝佷綔涓烘ā鏉垮紩鐢紝渚涘伐鑹烘祦绋嬫ā鏉夸笅杞戒娇鐢ㄣ��"
show-icon
type="info"
/>
@@ -304,6 +304,7 @@
:form-type="formType"
:route-id="routeId"
@change="productList = $event"
+ @reference-change="emit('success')"
/>
</section>
diff --git a/src/views/mes/pro/workorder-center/modules/quick-feedback.vue b/src/views/mes/pro/workorder-center/modules/quick-feedback.vue
index b249fdf..ea945c6 100644
--- a/src/views/mes/pro/workorder-center/modules/quick-feedback.vue
+++ b/src/views/mes/pro/workorder-center/modules/quick-feedback.vue
@@ -10,6 +10,7 @@
import { quickCreateFeedback } from '#/api/mes/pro/feedback';
import ProTaskSelect from '#/views/mes/pro/task/components/select.vue';
+import FeedbackParamFields from '#/views/mes/pro/feedback/components/FeedbackParamFields.vue';
defineOptions({ name: 'QuickFeedbackForm' });
@@ -44,6 +45,7 @@
});
const formRef = ref<FormInstance>();
+const paramFields = ref<InstanceType<typeof FeedbackParamFields>>();
const selectedTaskId = ref<number | undefined>(props.taskId);
const selectedTask = ref<MesProTaskApi.Task>();
const formData = ref({
@@ -86,6 +88,7 @@
try {
await quickCreateFeedback({
taskId,
+ paramValues: paramFields.value?.getValues(),
feedbackQuantity: formData.value.feedbackQuantity,
qualifiedQuantity: formData.value.qualifiedQuantity,
unqualifiedQuantity: formData.value.unqualifiedQuantity,
@@ -146,6 +149,7 @@
class="!w-full"
/>
</a-form-item>
+ <FeedbackParamFields ref="paramFields" :task-id="selectedTaskId" />
<a-form-item label="澶囨敞">
<a-textarea
v-model:value="formData.remark"
diff --git a/src/views/mes/process-design/process/data.ts b/src/views/mes/process-design/process/data.ts
index 146b7a2..166e02c 100644
--- a/src/views/mes/process-design/process/data.ts
+++ b/src/views/mes/process-design/process/data.ts
@@ -16,6 +16,7 @@
import { z } from '#/adapter/form';
import { generateAutoCode } from '#/api/mes/md/autocode/record';
+import { getTemplatePage } from '#/api/mes/pro/processdesign/template';
/** 琛ㄥ崟绫诲瀷 */
export type FormType = 'create' | 'detail' | 'update';
@@ -85,6 +86,35 @@
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
},
rules: z.number().default(CommonStatusEnum.ENABLE),
+ },
+ {
+ fieldName: 'paramCollectMode',
+ label: '鍙傛暟閲囬泦鏂瑰紡',
+ component: 'Select',
+ defaultValue: 0,
+ componentProps: {
+ options: [
+ { label: '涓嶉噰闆�', value: 0 },
+ { label: '姣忔鎶ュ伐濉啓', value: 1 },
+ { label: '姣忎釜浠诲姟濉啓涓�娆�', value: 2 },
+ ],
+ },
+ },
+ {
+ fieldName: 'paramTemplateId',
+ label: '鍙傛暟妯℃澘',
+ component: 'ApiSelect',
+ componentProps: {
+ api: getTemplatePage,
+ params: { pageNo: 1, pageSize: 100 },
+ resultField: 'list',
+ labelField: 'templateName',
+ valueField: 'id',
+ showSearch: true,
+ optionFilterProp: 'label',
+ allowClear: true,
+ placeholder: '鍚敤鍙傛暟閲囬泦鏃惰閫夋嫨妯℃澘',
+ },
},
{
fieldName: 'attention',
@@ -175,6 +205,13 @@
props: { type: DICT_TYPE.COMMON_STATUS },
},
},
+ {
+ field: 'paramCollectMode',
+ title: '鍙傛暟閲囬泦鏂瑰紡',
+ minWidth: 150,
+ formatter: ({ cellValue }) =>
+ (['涓嶉噰闆�', '姣忔鎶ュ伐濉啓', '姣忎釜浠诲姟濉啓涓�娆�'])[Number(cellValue ?? 0)] ?? '鏈煡',
+ },
{ field: 'remark', title: '澶囨敞', minWidth: 180 },
{
field: 'createTime',
diff --git a/src/views/mes/process-design/process/modules/form.vue b/src/views/mes/process-design/process/modules/form.vue
index 540c0be..43dd1de 100644
--- a/src/views/mes/process-design/process/modules/form.vue
+++ b/src/views/mes/process-design/process/modules/form.vue
@@ -61,6 +61,11 @@
modalApi.lock();
// 鎻愪氦琛ㄥ崟
const data = (await formApi.getValues()) as MesProProcessApi.Process;
+ if ((data.paramCollectMode ?? 0) !== 0 && !data.paramTemplateId) {
+ message.warning('鍚敤鍙傛暟閲囬泦鏃讹紝璇烽�夋嫨鍙傛暟妯℃澘');
+ modalApi.unlock();
+ return;
+ }
try {
await (formData.value?.id ? updateProcess(data) : createProcess(data));
// 鍏抽棴骞舵彁绀�
diff --git a/src/views/mes/process-design/route/data.ts b/src/views/mes/process-design/route/data.ts
index 941a2be..c23ea46 100644
--- a/src/views/mes/process-design/route/data.ts
+++ b/src/views/mes/process-design/route/data.ts
@@ -133,6 +133,7 @@
slots: { default: "code" },
},
{ field: "name", title: "璺嚎鍚嶇О", minWidth: 180 },
+ { field: "referenceProductName", title: "鍚敤浜у搧", minWidth: 160 },
{ field: "description", title: "璺嚎璇存槑", minWidth: 200 },
{
field: "status",
@@ -158,7 +159,7 @@
},
{
title: "鎿嶄綔",
- width: 160,
+ width: 260,
fixed: "right",
slots: { default: "actions" },
},
diff --git a/src/views/mes/process-design/route/index.vue b/src/views/mes/process-design/route/index.vue
index 48f9ca1..b4e3469 100644
--- a/src/views/mes/process-design/route/index.vue
+++ b/src/views/mes/process-design/route/index.vue
@@ -13,10 +13,10 @@
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
deleteRoute,
+ downloadFullRouteTemplate,
+ importFullRoute,
exportRoute,
getRoutePage,
- importRoute,
- importRouteTemplate,
updateRouteStatus,
} from '#/api/mes/pro/route';
import { $t } from '#/locales';
@@ -50,11 +50,23 @@
importModalApi
.setData({
title: $t('ui.actionTitle.import', ['宸ヨ壓璺嚎']),
- fileName: '宸ヨ壓璺嚎瀵煎叆妯℃澘.xls',
- importFn: importRoute,
- templateFn: importRouteTemplate,
+ fileName: '宸ヨ壓娴佺▼瀹屾暣瀵煎叆妯℃澘.xlsx',
+ importFn: importFullRoute,
+ showTemplateDownload: false,
+ uploadHint: '璇峰厛浠庤矾绾挎搷浣滃垪涓嬭浇妯℃澘銆傝〃鏍煎垎涓哄熀鏈俊鎭�佷骇鍝佷笌浠撲綅銆佸伐搴忋�佸伐搴忎骇鍑恒�佸伐搴忔姇鏂欙紱澶嶅埗浜у搧鏃跺彧闇�淇敼妯℃澘浜у搧琛岀殑浜у搧缂栫爜锛屸�滄湰浜у搧鈥濅細鑷姩鍏宠仈锛涘悕绉颁粎渚涘弬鑰冿紝瀵煎叆浠ョ紪鐮佷负鍑嗐�傛洿鏂拌矾绾胯鍏堝仠鐢ㄥ苟鍕鹃�夎鐩栵紱鏈垪鍑虹殑鏁版嵁涓嶄細鍒犻櫎銆�',
})
.open();
+}
+
+/** 涓嬭浇鎸囧畾璺嚎鐨勬ā鏉垮紩鐢ㄤ骇鍝佸強瀹屾暣宸ヨ壓娴佺▼銆� */
+async function handleDownloadTemplate(row: MesProRouteApi.Route) {
+ if (!row.id) return;
+ if (!row.referenceProductCode) {
+ message.warning('璇峰厛鍦ㄨ矾绾跨殑浜у嚭浜у搧涓�夋嫨妯℃澘寮曠敤');
+ return;
+ }
+ const data = await downloadFullRouteTemplate(row.id);
+ downloadFileFromBlobPart({ fileName: `宸ヨ壓娴佺▼妯℃澘-${row.code || row.id}.xlsx`, source: data });
}
/** 鍒涘缓宸ヨ壓璺嚎 */
@@ -146,7 +158,7 @@
<Alert
class="mb-3"
message="璺嚎閰嶇疆椤哄簭"
- description="鍩烘湰淇℃伅 鈫� 浜у嚭浜у搧鍙婂叆搴撲粨 鈫� 宸ュ簭鍙婂悇宸ュ簭浜у嚭 鈫� 宸ュ簭鎶曟枡 鈫� 鏍¢獙鍚敤"
+ description="鍏堝湪浜у嚭浜у搧涓�夋嫨妯℃澘寮曠敤锛涘湪鐩爣璺嚎鐨勬搷浣滃垪涓嬭浇璇ヤ骇鍝佺殑宸ュ簭銆佷骇鍑哄拰鎶曟枡锛岃矾绾垮惎鐢ㄦ垨鍋滅敤鍧囧彲涓嬭浇銆�"
show-icon
type="info"
/>
@@ -182,6 +194,11 @@
<Button type="link" @click="handleDetail(row)">{{ row.code }}</Button>
</template>
<template #actions="{ row }">
+ <Button
+ v-if="row.referenceProductCode && hasAccessByCodes(['mes:pro-route:import'])"
+ type="link"
+ @click="handleDownloadTemplate(row)"
+ >涓嬭浇妯℃澘</Button>
<Tooltip
:open="row.status === CommonStatusEnum.DISABLE ? false : undefined"
title="浠呭仠鐢ㄧ姸鎬侊紝鎵嶅彲浠ユ搷浣�"
diff --git a/src/views/mes/workbench/components/tabs/FeedbackTab.vue b/src/views/mes/workbench/components/tabs/FeedbackTab.vue
index de8aa5d..a5dc6e4 100644
--- a/src/views/mes/workbench/components/tabs/FeedbackTab.vue
+++ b/src/views/mes/workbench/components/tabs/FeedbackTab.vue
@@ -29,6 +29,7 @@
import { $t } from '#/locales';
import { useFormSchema } from '../../../pro/feedback/data';
+import FeedbackParamFields from '../../../pro/feedback/components/FeedbackParamFields.vue';
defineOptions({ name: 'WorkbenchFeedbackTab' });
@@ -47,6 +48,9 @@
const feedbackId = ref<number>();
const feedbackStatus = ref<number>();
const originalSnapshot = ref('');
+const paramFields = ref<InstanceType<typeof FeedbackParamFields>>();
+const paramSnapshot = ref<string>();
+const paramRenderKey = ref(0);
const isEditable = computed(() =>
['create', 'submit', 'update'].includes(formType.value),
@@ -86,13 +90,14 @@
}
}
-async function getAlignedData() {
+async function getAlignedData(includeParams = true) {
const data = (await formApi.getValues()) as any;
// 鏂板缓鏃朵笉鑳芥惡甯︿笂涓�寮犳姤宸ュ崟娈嬬暀鐨� id锛屽惁鍒欏悗绔寜涓婚敭鎻掑叆浼氬啿绐�
if (formType.value === 'create') {
delete data.id;
}
alignQuantity(data);
+ if (includeParams) data.paramValues = paramFields.value?.getValues();
return data;
}
@@ -113,6 +118,8 @@
feedbackId.value = undefined;
feedbackStatus.value = undefined;
originalSnapshot.value = '';
+ paramSnapshot.value = undefined;
+ paramRenderKey.value++;
formApi.setState({ schema: useFormSchema(formType.value, formApi) });
@@ -139,7 +146,7 @@
checkFlag,
});
- originalSnapshot.value = JSON.stringify(await getAlignedData());
+ originalSnapshot.value = JSON.stringify(await getAlignedData(false));
}
/** 淇濆瓨 */
@@ -274,12 +281,13 @@
async function loadFeedback(id: number) {
const data = await getFeedback(id);
feedbackId.value = data.id;
+ paramSnapshot.value = data.paramSnapshot;
feedbackStatus.value = data.status;
formType.value = 'update';
formApi.setState({ schema: useFormSchema(formType.value, formApi) });
const checkFlag = await resolveCheckFlag(data.routeId, data.processId);
await formApi.setValues({ ...data, checkFlag });
- originalSnapshot.value = JSON.stringify(await getAlignedData());
+ originalSnapshot.value = JSON.stringify(await getAlignedData(false));
}
// 鐩戝惉浠诲姟鍙樻洿锛堜粎褰撲换鍔� ID 鐪熸鍙樺寲鏃舵墠閲嶇疆琛ㄥ崟锛�
@@ -313,6 +321,7 @@
</div>
<Form class="feedback-tab__form" />
+ <FeedbackParamFields :key="paramRenderKey" ref="paramFields" :task-id="task.id" :snapshot="paramSnapshot" :readonly="!isEditable" />
<div class="feedback-tab__actions">
<Button
diff --git a/src/views/wls/materialstock/index.vue b/src/views/wls/materialstock/index.vue
index 1ac1143..6ce5c88 100644
--- a/src/views/wls/materialstock/index.vue
+++ b/src/views/wls/materialstock/index.vue
@@ -13,6 +13,8 @@
import {
exportMaterialStock,
getMaterialStockPage,
+ importMaterialStock,
+ importMaterialStockTemplate,
updateMaterialStockFrozen,
} from '#/api/mes/wm/materialstock';
import { $t } from '#/locales';
@@ -20,6 +22,7 @@
import { WmBatchDetail } from '#/views/wls/batch/components';
import AreaForm from '#/views/wls/warehouse/area/modules/form.vue';
import { WmStockAdjustModal, WmStockMoveModal } from './components';
+import ImportModalComponent from '#/components/import-modal';
import { useGridColumns, useGridFormSchema } from './data';
@@ -38,6 +41,21 @@
destroyOnClose: true,
});
+const [StockImportModal, stockImportModalApi] = useVbenModal({
+ connectedComponent: ImportModalComponent,
+ destroyOnClose: true,
+});
+
+function handleImportStock() {
+ stockImportModalApi.setData({
+ title: '瀵煎叆搴撳瓨澧為噺',
+ fileName: '搴撳瓨瀵煎叆妯℃澘.xls',
+ importFn: importMaterialStock,
+ templateFn: importMaterialStockTemplate,
+ allowUpdate: false,
+ uploadHint: '鏁伴噺鎸夌墿鏂欎富鍗曚綅绱姞锛涙瘡琛屼娇鐢ㄥ敮涓�瀵煎叆鏄庣粏缂栧彿锛岄噸澶嶇紪鍙蜂笉浼氬啀娆″叆璐︺�傛壒娆¢』棰勫厛寤虹珛涓斿悎鏍硷紱鐩稿悓搴撳瓨缁村害瀛樺湪澶氫釜渚涘簲鍟嗘椂椤诲~鍐欎緵搴斿晢缂栫爜銆傚簭鍒楀彿鐗╂枡涓嶅彲鎵归噺瀵煎叆銆�',
+ }).open();
+}
const batchDetailRef = ref<InstanceType<typeof WmBatchDetail>>();
/** 鍒锋柊琛ㄦ牸 */
@@ -154,6 +172,7 @@
<Page auto-content-height><AreaModal />
<WmBatchDetail ref="batchDetailRef" />
<StockAdjustModal @success="handleStockAdjustSuccess" />
+ <StockImportModal @success="handleRefresh" />
<StockMoveModal @success="handleStockMoveSuccess" />
<div class="flex h-full w-full">
@@ -171,6 +190,13 @@
<TableAction
:actions="[
{
+ label: '瀵煎叆搴撳瓨',
+ type: 'default',
+ icon: ACTION_ICON.UPLOAD,
+ auth: ['mes:wm-material-stock:adjust'],
+ onClick: handleImportStock,
+ },
+ {
label: '搴撳瓨璋冩暣',
type: 'default',
icon: ACTION_ICON.EDIT,
diff --git a/src/views/wls/transaction/data.ts b/src/views/wls/transaction/data.ts
index a294a3e..6c698cf 100644
--- a/src/views/wls/transaction/data.ts
+++ b/src/views/wls/transaction/data.ts
@@ -13,6 +13,7 @@
/** 涓氬姟绫诲瀷閫夐」 */
const bizTypeOptions = [
+ { label: '搴撳瓨瀵煎叆鍏ュ簱', value: 128 },
{ label: '鑷畾涔夊叆搴�', value: 126 },
{ label: '鑷畾涔夊嚭搴�', value: 127 },
{ label: '閲囪喘鍏ュ簱', value: 110 },
--
Gitblit v1.9.3