From 943954bdcb3b672b89cfa097e53d2ac17a36a101 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期日, 30 六月 2024 13:13:25 +0800
Subject: [PATCH] 产品工艺路线路由节点选择功能更新

---
 src/views/components/data.ts |  128 ++++++++++++++++++++++++++++++++++++++----
 1 files changed, 115 insertions(+), 13 deletions(-)

diff --git a/src/views/components/data.ts b/src/views/components/data.ts
index 35abfb1..3f4d0b6 100644
--- a/src/views/components/data.ts
+++ b/src/views/components/data.ts
@@ -1,25 +1,53 @@
-import { getFns, woGetSelectSuccess, woCustFn, woformSchema, woCfgformSchema, prodCfgformSchema, xxCfgformSchema } from './bizMesWo';
-import { ActionItem, BasicColumn, FormSchema } from '/@/components/Table';
+/*
+ * @Description: 鑷畾涔夊脊鍑烘璇锋暟鎹�
+ * @Author: Ben Lin
+ * @version:
+ * @Date: 2024-06-05 15:50:59
+ * @LastEditors: Ben Lin
+ * @LastEditTime: 2024-06-28 11:31:37
+ */
+import {
+  getWoFns,
+  woGetSelectSuccess,
+  woCustFn,
+  woformSchema,
+  woCfgformSchema,
+  prodCfgformSchema,
+  xxCfgformSchema,
+} from './bizMesWo';
+import { FormSchema } from '/@/components/Table';
 import { useI18n } from '/@/hooks/web/useI18n';
 
 const { t } = useI18n();
 export const formSchema: FormSchema[] = [];
-export function custFunction(e: any, fnName: string, type: string, ...args) {
+export async function custFunction<T = any>(
+  e: any,
+  fnName: string,
+  type: string,
+  ...args
+): Promise<T> {
   switch (type) {
     case 'BIZ_MES_WO':
-      getFns[fnName](e, args);
-      break;
     case 'BIZ_MES_WO_Config':
-      getFns[fnName](e, args);
-      break;
+      return getWoFns[fnName](e, args);
+    // break;
     default:
-      break;
-      (e) => {};
+      return new Promise((resolve, reject) => {
+        try {
+          (e) => {};
+          resolve(true);
+        } catch {
+          reject(false);
+        } finally {
+          args[0][0]({ confirmLoading: false });
+        }
+      });
+    // break;
   }
 }
 
 export function getFormSchema(type: string) {
-  let _formSchema = [] as FormSchema[];
+  let _formSchema: FormSchema[] = [];
   switch (type) {
     case 'BIZ_MES_WO':
       _formSchema = woformSchema;
@@ -40,11 +68,18 @@
   return _formSchema;
 }
 
-/* 寮瑰嚭閫夋嫨妗嗛�夋嫨鎴愬姛 */
+/**
+ * @description: 寮瑰嚭閫夋嫨妗嗛�夋嫨鎴愬姛
+ * @param {*} d
+ * @param {*} u
+ * @param {string} entityName
+ * @return {*}
+ */
 export function GetSelectSuccess(d, u, entityName: string) {
   let data = {};
   switch (entityName) {
     case 'BIZ_MES_WO':
+    case 'BIZ_MES_WO_Config':
       data = woGetSelectSuccess(d, u);
       break;
     default:
@@ -56,7 +91,10 @@
   return data;
 }
 
-/* 鎵撳紑寮瑰嚭閫夋嫨妗� */
+/**
+ * @description: 鎵撳紑寮瑰嚭閫夋嫨妗�
+ * @return {*}
+ */
 export function OpenSelectItem(
   openItemModal: Fn,
   entityName: string,
@@ -66,9 +104,10 @@
 ) {
   switch (entityName) {
     case 'BIZ_MES_WO':
+    case 'BIZ_MES_WO_Config': //鏍规嵁甯﹀叆鐨勫悕绉版墦寮�涓嶅悓鐨勫疄浣撳垪琛�
       woCustFn(openItemModal, slotName, others, args);
       break;
-    default:
+    default: //榛樿鎵撳紑鐗╂枡鍒楄〃
       openItemModal(true, {
         title: '鐗╂枡鍒楄〃',
         schemas: [
@@ -99,7 +138,70 @@
         ],
         tableName: 'BAS_ITEM',
         rowKey: 'ITEM_CODE',
+        searchInfo: { TABLE_NAME: 'BAS_ITEM' }, //searchInfo: {TABLE_NAME: 'MES_CUSTOM_ACT', ACT_TYPE: routeConfig.currentAct.ACT_TYPE}
       });
       break;
   }
 }
+
+export const step1Schemas: FormSchema[] = [
+  {
+    field: 'CUST_CODE',
+    component: 'Input',
+    label: '瀹㈡埛缂栫爜',
+    required: true,
+    colProps: {
+      span: 20,
+    },
+  },
+  {
+    field: '0',
+    label: '',
+    defaultValue: '',
+    slot: 'add',
+    colProps: {
+      span: 4,
+    },
+  },
+  {
+    field: 'CUST_ID',
+    component: 'Input',
+    label: 'ID',
+    required: true,
+    colProps: {
+      span: 20,
+    },
+    show: false,
+  },
+];
+
+export const step2Schemas: FormSchema[] = [
+  {
+    field: 'ROT_CODE',
+    component: 'Input',
+    label: '宸ヨ壓璺嚎',
+    required: true,
+    colProps: {
+      span: 20,
+    },
+  },
+  {
+    field: '0',
+    label: '',
+    defaultValue: '',
+    slot: 'add',
+    colProps: {
+      span: 4,
+    },
+  },
+  {
+    field: 'ROT_ID',
+    component: 'Input',
+    label: 'ID',
+    required: true,
+    colProps: {
+      span: 20,
+    },
+    show: false,
+  },
+];

--
Gitblit v1.9.3